diff options
author | Felix Fietkau <nbd@openwrt.org> | 2013-04-16 13:38:43 +0200 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2013-04-16 23:42:30 +0200 |
commit | 991fec091061b901e4fdcc8af4fd25d24a5a7bab (patch) | |
tree | e85082dc9b42276fb9695ff02ca1461f406e4042 /net/mac80211/tx.c | |
parent | mac80211: fix and optimize MCS mask handling (diff) | |
download | linux-991fec091061b901e4fdcc8af4fd25d24a5a7bab.tar.xz linux-991fec091061b901e4fdcc8af4fd25d24a5a7bab.zip |
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/tx.c')
-rw-r--r-- | net/mac80211/tx.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c index 15c1b286e280..6ca857f8f424 100644 --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c @@ -656,6 +656,9 @@ ieee80211_tx_h_rate_ctrl(struct ieee80211_tx_data *tx) txrc.rts = rts = true; } + info->control.use_rts = rts; + info->control.use_cts_prot = tx->sdata->vif.bss_conf.use_cts_prot; + /* * Use short preamble if the BSS can handle it, but not for * management frames unless we know the receiver can handle @@ -766,6 +769,11 @@ ieee80211_tx_h_rate_ctrl(struct ieee80211_tx_data *tx) */ if (rc_rate->flags & IEEE80211_TX_RC_MCS) { WARN_ON(rc_rate->idx > 76); + + if (!(rc_rate->flags & IEEE80211_TX_RC_USE_RTS_CTS) && + tx->sdata->vif.bss_conf.use_cts_prot) + rc_rate->flags |= + IEEE80211_TX_RC_USE_CTS_PROTECT; continue; } |