aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/ibss.c
diff options
context:
space:
mode:
authorSimon Wunderlich <simon.wunderlich@s2003.tu-chemnitz.de>2013-07-11 12:07:46 -0400
committerJohannes Berg <johannes.berg@intel.com>2013-07-16 02:58:12 -0400
commit2ec9c1f67ab1f58b5bf5ac19e4b61b9f75c83a04 (patch)
tree8e5b9f057f655cbbae4dd718173676f7b50d5b27 /net/mac80211/ibss.c
parentbf3726457276c8773ec97da30c6459caf512b22f (diff)
mac80211: fix regression when initializing ibss wmm params
There appear to be two regressions in ibss.c when calling ieee80211_sta_def_wmm_params(): * the second argument should be a rate length, not a rate array. This was introduced by my commit "mac80211: select and adjust bitrates according to channel mode" * the third argument is not initialized (anymore), making further checks within this function useless. Since ieee80211_sta_def_wmm_params() is only used by ibss anyway, remove the function entirely and handle the operating mode decision immediately. Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/ibss.c')
-rw-r--r--net/mac80211/ibss.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/net/mac80211/ibss.c b/net/mac80211/ibss.c
index 449702df24ab..83197c3ae5f1 100644
--- a/net/mac80211/ibss.c
+++ b/net/mac80211/ibss.c
@@ -49,9 +49,9 @@ static void __ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata,
49 struct ieee80211_supported_band *sband; 49 struct ieee80211_supported_band *sband;
50 struct cfg80211_bss *bss; 50 struct cfg80211_bss *bss;
51 u32 bss_change, rate_flags, rates = 0, rates_added = 0; 51 u32 bss_change, rate_flags, rates = 0, rates_added = 0;
52 u8 supp_rates[IEEE80211_MAX_SUPP_RATES];
53 struct cfg80211_chan_def chandef; 52 struct cfg80211_chan_def chandef;
54 enum nl80211_bss_scan_width scan_width; 53 enum nl80211_bss_scan_width scan_width;
54 bool have_higher_than_11mbit = false;
55 struct beacon_data *presp; 55 struct beacon_data *presp;
56 int frame_len; 56 int frame_len;
57 int shift; 57 int shift;
@@ -149,6 +149,8 @@ static void __ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata,
149 for (i = 0; i < sband->n_bitrates; i++) { 149 for (i = 0; i < sband->n_bitrates; i++) {
150 if ((rate_flags & sband->bitrates[i].flags) != rate_flags) 150 if ((rate_flags & sband->bitrates[i].flags) != rate_flags)
151 continue; 151 continue;
152 if (sband->bitrates[i].bitrate > 110)
153 have_higher_than_11mbit = true;
152 154
153 rates |= BIT(i); 155 rates |= BIT(i);
154 rates_n++; 156 rates_n++;
@@ -270,11 +272,17 @@ static void __ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata,
270 sdata->vif.bss_conf.use_short_slot = chan->band == IEEE80211_BAND_5GHZ; 272 sdata->vif.bss_conf.use_short_slot = chan->band == IEEE80211_BAND_5GHZ;
271 bss_change |= BSS_CHANGED_ERP_SLOT; 273 bss_change |= BSS_CHANGED_ERP_SLOT;
272 274
275 /* cf. IEEE 802.11 9.2.12 */
276 if (chan->band == IEEE80211_BAND_2GHZ && have_higher_than_11mbit)
277 sdata->flags |= IEEE80211_SDATA_OPERATING_GMODE;
278 else
279 sdata->flags &= ~IEEE80211_SDATA_OPERATING_GMODE;
280
273 sdata->vif.bss_conf.ibss_joined = true; 281 sdata->vif.bss_conf.ibss_joined = true;
274 sdata->vif.bss_conf.ibss_creator = creator; 282 sdata->vif.bss_conf.ibss_creator = creator;
275 ieee80211_bss_info_change_notify(sdata, bss_change); 283 ieee80211_bss_info_change_notify(sdata, bss_change);
276 284
277 ieee80211_sta_def_wmm_params(sdata, rates, supp_rates); 285 ieee80211_set_wmm_default(sdata, true);
278 286
279 ifibss->state = IEEE80211_IBSS_MLME_JOINED; 287 ifibss->state = IEEE80211_IBSS_MLME_JOINED;
280 mod_timer(&ifibss->timer, 288 mod_timer(&ifibss->timer,