diff options
author | Tomas Winkler <tomas.winkler@intel.com> | 2008-10-30 17:08:08 +0200 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-11-10 15:17:40 -0500 |
commit | d61272cbb35fa1c08fe94898583d880256f2dbd3 (patch) | |
tree | 94371a1dd2f592f19286be3a4b5f262227b177b6 /net/mac80211 | |
parent | ab1ef980504ca7f17b675b3a53a88956f800fce3 (diff) | |
download | lwn-d61272cbb35fa1c08fe94898583d880256f2dbd3.tar.gz lwn-d61272cbb35fa1c08fe94898583d880256f2dbd3.zip |
mac80211: fix basic rates setting from association response
In previous code all the rates were marked as basic.
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211')
-rw-r--r-- | net/mac80211/mlme.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index 708eb4502ed7..dee6448c4eb0 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c @@ -1291,29 +1291,35 @@ static void ieee80211_rx_mgmt_assoc_resp(struct ieee80211_sub_if_data *sdata, for (i = 0; i < elems.supp_rates_len; i++) { int rate = (elems.supp_rates[i] & 0x7f) * 5; + bool is_basic = !!(elems.supp_rates[i] & 0x80); if (rate > 110) have_higher_than_11mbit = true; for (j = 0; j < sband->n_bitrates; j++) { - if (sband->bitrates[j].bitrate == rate) + if (sband->bitrates[j].bitrate == rate) { rates |= BIT(j); - if (elems.supp_rates[i] & 0x80) - basic_rates |= BIT(j); + if (is_basic) + basic_rates |= BIT(j); + break; + } } } for (i = 0; i < elems.ext_supp_rates_len; i++) { int rate = (elems.ext_supp_rates[i] & 0x7f) * 5; + bool is_basic = !!(elems.supp_rates[i] & 0x80); if (rate > 110) have_higher_than_11mbit = true; for (j = 0; j < sband->n_bitrates; j++) { - if (sband->bitrates[j].bitrate == rate) + if (sband->bitrates[j].bitrate == rate) { rates |= BIT(j); - if (elems.ext_supp_rates[i] & 0x80) - basic_rates |= BIT(j); + if (is_basic) + basic_rates |= BIT(j); + break; + } } } |