Skip to content

Commit

Permalink
rc80211_minstrel: fix contention window calculation
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Pavel Roskin authored and John W. Linville committed Sep 16, 2009
1 parent de32cce commit 8c6c03f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/mac80211/rc80211_minstrel.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 8c6c03f

Please sign in to comment.