]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - net/mac80211/rc80211_minstrel.c
mac80211: fix contention time computation in minstrel, minstrel_ht
[karo-tx-linux.git] / net / mac80211 / rc80211_minstrel.c
index 778c604d7939e39e3894e3c51af6b97360ca8e3b..8adac67395f7802445df4d64f622b3a34b5a750d 100644 (file)
@@ -417,8 +417,8 @@ minstrel_rate_init(void *priv, struct ieee80211_supported_band *sband,
                        tx_time_single = mr->ack_time + mr->perfect_tx_time;
 
                        /* contention window */
-                       tx_time_single += t_slot + min(cw, mp->cw_max);
-                       cw = (cw << 1) | 1;
+                       tx_time_single += (t_slot * cw) >> 1;
+                       cw = min((cw << 1) | 1, mp->cw_max);
 
                        tx_time += tx_time_single;
                        tx_time_cts += tx_time_single + mi->sp_ack_dur;