aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/rc80211_minstrel.c
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2013-04-16 07:38:43 -0400
committerJohannes Berg <johannes.berg@intel.com>2013-04-16 17:42:30 -0400
commit991fec091061b901e4fdcc8af4fd25d24a5a7bab (patch)
treee85082dc9b42276fb9695ff02ca1461f406e4042 /net/mac80211/rc80211_minstrel.c
parent2ffbe6d333664a089f17b13aa79eefe38f794bb7 (diff)
mac80211: fix CTS protection handling
The rates[0] CTS and RTS flags are only set after rate control has been called, so minstrel cannot use them to for setting the number of retries. This patch adds two new flags to explicitly indicate RTS/CTS use. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/rc80211_minstrel.c')
-rw-r--r--net/mac80211/rc80211_minstrel.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/net/mac80211/rc80211_minstrel.c b/net/mac80211/rc80211_minstrel.c
index 1c36c9b4fa4a..eda290fb8bd2 100644
--- a/net/mac80211/rc80211_minstrel.c
+++ b/net/mac80211/rc80211_minstrel.c
@@ -209,9 +209,9 @@ minstrel_get_retry_count(struct minstrel_rate *mr,
209{ 209{
210 unsigned int retry = mr->adjusted_retry_count; 210 unsigned int retry = mr->adjusted_retry_count;
211 211
212 if (info->control.rates[0].flags & IEEE80211_TX_RC_USE_RTS_CTS) 212 if (info->control.use_rts)
213 retry = max(2U, min(mr->retry_count_rtscts, retry)); 213 retry = max(2U, min(mr->retry_count_rtscts, retry));
214 else if (info->control.rates[0].flags & IEEE80211_TX_RC_USE_CTS_PROTECT) 214 else if (info->control.use_cts_prot)
215 retry = max(2U, min(mr->retry_count_cts, retry)); 215 retry = max(2U, min(mr->retry_count_cts, retry));
216 return retry; 216 return retry;
217} 217}
@@ -460,6 +460,8 @@ minstrel_rate_init(void *priv, struct ieee80211_supported_band *sband,
460 } while ((tx_time < mp->segment_size) && 460 } while ((tx_time < mp->segment_size) &&
461 (++mr->retry_count < mp->max_retry)); 461 (++mr->retry_count < mp->max_retry));
462 mr->adjusted_retry_count = mr->retry_count; 462 mr->adjusted_retry_count = mr->retry_count;
463 if (!(sband->bitrates[i].flags & IEEE80211_RATE_ERP_G))
464 mr->retry_count_cts = mr->retry_count;
463 } 465 }
464 466
465 for (i = n; i < sband->n_bitrates; i++) { 467 for (i = n; i < sband->n_bitrates; i++) {