aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211
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
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')
-rw-r--r--net/mac80211/ibss.c12
-rw-r--r--net/mac80211/ieee80211_i.h3
-rw-r--r--net/mac80211/util.c26
3 files changed, 10 insertions, 31 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,
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index 23a191b03bbf..3d32df1fbc6d 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -1615,9 +1615,6 @@ void ieee80211_send_probe_req(struct ieee80211_sub_if_data *sdata, u8 *dst,
1615 u32 ratemask, bool directed, u32 tx_flags, 1615 u32 ratemask, bool directed, u32 tx_flags,
1616 struct ieee80211_channel *channel, bool scan); 1616 struct ieee80211_channel *channel, bool scan);
1617 1617
1618void ieee80211_sta_def_wmm_params(struct ieee80211_sub_if_data *sdata,
1619 const size_t supp_rates_len,
1620 const u8 *supp_rates);
1621u32 ieee80211_sta_get_rates(struct ieee80211_sub_if_data *sdata, 1618u32 ieee80211_sta_get_rates(struct ieee80211_sub_if_data *sdata,
1622 struct ieee802_11_elems *elems, 1619 struct ieee802_11_elems *elems,
1623 enum ieee80211_band band, u32 *basic_rates); 1620 enum ieee80211_band band, u32 *basic_rates);
diff --git a/net/mac80211/util.c b/net/mac80211/util.c
index 1e45891ca219..d23c5a705a68 100644
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
@@ -1073,32 +1073,6 @@ void ieee80211_set_wmm_default(struct ieee80211_sub_if_data *sdata,
1073 } 1073 }
1074} 1074}
1075 1075
1076void ieee80211_sta_def_wmm_params(struct ieee80211_sub_if_data *sdata,
1077 const size_t supp_rates_len,
1078 const u8 *supp_rates)
1079{
1080 struct ieee80211_chanctx_conf *chanctx_conf;
1081 int i, have_higher_than_11mbit = 0;
1082
1083 /* cf. IEEE 802.11 9.2.12 */
1084 for (i = 0; i < supp_rates_len; i++)
1085 if ((supp_rates[i] & 0x7f) * 5 > 110)
1086 have_higher_than_11mbit = 1;
1087
1088 rcu_read_lock();
1089 chanctx_conf = rcu_dereference(sdata->vif.chanctx_conf);
1090
1091 if (chanctx_conf &&
1092 chanctx_conf->def.chan->band == IEEE80211_BAND_2GHZ &&
1093 have_higher_than_11mbit)
1094 sdata->flags |= IEEE80211_SDATA_OPERATING_GMODE;
1095 else
1096 sdata->flags &= ~IEEE80211_SDATA_OPERATING_GMODE;
1097 rcu_read_unlock();
1098
1099 ieee80211_set_wmm_default(sdata, true);
1100}
1101
1102void ieee80211_send_auth(struct ieee80211_sub_if_data *sdata, 1076void ieee80211_send_auth(struct ieee80211_sub_if_data *sdata,
1103 u16 transaction, u16 auth_alg, u16 status, 1077 u16 transaction, u16 auth_alg, u16 status,
1104 const u8 *extra, size_t extra_len, const u8 *da, 1078 const u8 *extra, size_t extra_len, const u8 *da,