Search Linux Wireless

[RFC 3/3] mac80211: Store basic rates for bss when joining ibss network

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



When joinig a ibss network, basic rates for bss were not stored. When
network was self created, leaving and (re)joining same network has
caused basic rates to be left unset. With this patch stored values are
used.

Signed-off-by: Teemu Paasikivi <ext-teemu.3.paasikivi@xxxxxxxxx>
---
 net/mac80211/ibss.c |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/net/mac80211/ibss.c b/net/mac80211/ibss.c
index d984ab2..72407f0 100644
--- a/net/mac80211/ibss.c
+++ b/net/mac80211/ibss.c
@@ -77,6 +77,7 @@ static void __ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata,
 	struct cfg80211_bss *bss;
 	u32 bss_change;
 	u8 supp_rates[IEEE80211_MAX_SUPP_RATES];
+	struct ieee80211_bss *ibss;
 
 	/* Reset own TSF to allow time synchronization work. */
 	drv_reset_tsf(local);
@@ -191,6 +192,19 @@ static void __ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata,
 
 	bss = cfg80211_inform_bss_frame(local->hw.wiphy, local->hw.conf.channel,
 					mgmt, skb->len, 0, GFP_KERNEL);
+
+	ibss = (struct ieee80211_bss *)(bss->priv);
+
+	for (i = 0; i < sband->n_bitrates; i++) {
+		u8 basic = 0x00;
+		if (basic_rates & BIT(i))
+			basic = 0x80;
+
+		ibss->supp_rates[i] = supp_rates[i] | basic;
+	}
+
+	ibss->supp_rates_len = i;
+
 	cfg80211_put_bss(bss);
 	cfg80211_ibss_joined(sdata->dev, ifibss->bssid, GFP_KERNEL);
 }
-- 
1.5.6.3

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux