Commit 8c6c03fe230c448e5795464a9d73efb796acf3d6

Authored by Pavel Roskin
Committed by John W. Linville
1 parent de32cce132

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>

Showing 1 changed file with 1 additions and 1 deletions Side-by-side Diff

net/mac80211/rc80211_minstrel.c
... ... @@ -418,7 +418,7 @@
418 418  
419 419 /* contention window */
420 420 tx_time_single += t_slot + min(cw, mp->cw_max);
421   - cw = (cw + 1) << 1;
  421 + cw = (cw << 1) | 1;
422 422  
423 423 tx_time += tx_time_single;
424 424 tx_time_cts += tx_time_single + mi->sp_ack_dur;