aboutsummaryrefslogtreecommitdiff
path: root/sys/net80211
diff options
context:
space:
mode:
authorAdrian Chadd <adrian@FreeBSD.org>2013-11-09 07:30:13 +0000
committerAdrian Chadd <adrian@FreeBSD.org>2013-11-09 07:30:13 +0000
commit5140f9e6ae979c04c28bf97758e53d268f13171e (patch)
tree27f5c16b8f42f24d5d0200365ba647dac4b5d779 /sys/net80211
parent4cfb1a088da537f946c1aa8b07c13d81235c3fbd (diff)
downloadsrc-5140f9e6ae979c04c28bf97758e53d268f13171e.tar.gz
src-5140f9e6ae979c04c28bf97758e53d268f13171e.zip
Fix AMRR to correctly select the initial rate.
There were two bugs: * If the initial lowest rate didn't go through the loop at least once, the AMRR rate index would be the highest rate in the table (eg the rix mapping to MCS15) but rate would stay at the default value, namely 0. This meant that the initial rate selection would be MCS15 _but_ the node ni_txrate value would be MCS0. * If the node is 11n, then break out of the loop correctly. Beforehand, my initial 11n AMRR commit would immediately exit out as it would fail the 11n check, then it would always fall through to the non-11n rate which would then see if it was < 36mbit (ie, "72"), which would always match. Hence, it'd always return MCS15. Tested: * Intel Centrino 2230 STA (local changes), STA mode * Intel Wifi 5100, STA
Notes
Notes: svn path=/head/; revision=257881
Diffstat (limited to 'sys/net80211')
-rw-r--r--sys/net80211/ieee80211_amrr.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/net80211/ieee80211_amrr.c b/sys/net80211/ieee80211_amrr.c
index be2668ddf0b0..ab1f03339047 100644
--- a/sys/net80211/ieee80211_amrr.c
+++ b/sys/net80211/ieee80211_amrr.c
@@ -199,13 +199,13 @@ amrr_node_init(struct ieee80211_node *ni)
amn->amn_rix--) {
/* legacy - anything < 36mbit, stop searching */
/* 11n - stop at MCS4 / MCS12 / MCS28 */
- if (amrr_node_is_11n(ni) &&
- (rs->rs_rates[amn->amn_rix] & 0x7) < 4)
+ if (amrr_node_is_11n(ni)) {
+ if ((rs->rs_rates[amn->amn_rix] & 0x7) < 4)
+ break;
+ } else if ((rs->rs_rates[amn->amn_rix] & IEEE80211_RATE_VAL) <= 72)
break;
- else if ((rs->rs_rates[amn->amn_rix] & IEEE80211_RATE_VAL) <= 72)
- break;
- rate = rs->rs_rates[amn->amn_rix] & IEEE80211_RATE_VAL;
}
+ rate = rs->rs_rates[amn->amn_rix] & IEEE80211_RATE_VAL;
/* if the rate is an 11n rate, ensure the MCS bit is set */
if (amrr_node_is_11n(ni))