diff options
author | Pavel Roskin <proski@gnu.org> | 2009-09-15 22:24:30 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-09-23 11:35:42 -0400 |
commit | 909a203566a75d26c65370d7dd933fa513d47990 (patch) | |
tree | c77fc25740fa2c4061911b9551b3031f51c2c13e /net/mac80211 | |
parent | 71702bc13efd3238e02197780d6e62c51c196a9d (diff) | |
download | linux-3.10-909a203566a75d26c65370d7dd933fa513d47990.tar.gz linux-3.10-909a203566a75d26c65370d7dd933fa513d47990.tar.bz2 linux-3.10-909a203566a75d26c65370d7dd933fa513d47990.zip |
rc80211_minstrel: fix contention window calculation
The contention window is supposed to be a power of two minus one, i.e.
15, 31, 63, 127... minstrel_rate_init() forgets to subtract 1, so the
sequence becomes 15, 32, 66, 134...
Bug reported by Dan Halperin <dhalperi@cs.washington.edu>
Signed-off-by: Pavel Roskin <proski@gnu.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211')
-rw-r--r-- | net/mac80211/rc80211_minstrel.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/mac80211/rc80211_minstrel.c b/net/mac80211/rc80211_minstrel.c index 7c5142988bb..6e5d68b4e42 100644 --- a/net/mac80211/rc80211_minstrel.c +++ b/net/mac80211/rc80211_minstrel.c @@ -418,7 +418,7 @@ minstrel_rate_init(void *priv, struct ieee80211_supported_band *sband, /* contention window */ tx_time_single += t_slot + min(cw, mp->cw_max); - cw = (cw + 1) << 1; + cw = (cw << 1) | 1; tx_time += tx_time_single; tx_time_cts += tx_time_single + mi->sp_ack_dur; |