diff mbox

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

Message ID 1276000459-1121-4-git-send-email-ext-teemu.3.paasikivi@nokia.com (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Teemu Paasikivi June 8, 2010, 12:34 p.m. UTC
None
diff mbox

Patch

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);
 }