summaryrefslogtreecommitdiff
path: root/package/mac80211
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2010-01-15 07:39:35 +0000
committerFelix Fietkau <nbd@openwrt.org>2010-01-15 07:39:35 +0000
commit7c6b51f9e286204cc9db1d1f5f6b57013b15b123 (patch)
tree69c1ebbd65c55c56a69a0622c8f9d5ee27851200 /package/mac80211
parent87226cbdc619874fec78cef8f24674db0d9fc25f (diff)
downloadmtk-20170518-7c6b51f9e286204cc9db1d1f5f6b57013b15b123.zip
mtk-20170518-7c6b51f9e286204cc9db1d1f5f6b57013b15b123.tar.gz
mtk-20170518-7c6b51f9e286204cc9db1d1f5f6b57013b15b123.tar.bz2
ath9k: fix rts/cts handling
SVN-Revision: 19147
Diffstat (limited to 'package/mac80211')
-rw-r--r--package/mac80211/patches/570-ath9k_fix_rts_cts.patch61
1 files changed, 61 insertions, 0 deletions
diff --git a/package/mac80211/patches/570-ath9k_fix_rts_cts.patch b/package/mac80211/patches/570-ath9k_fix_rts_cts.patch
new file mode 100644
index 0000000..789623c
--- /dev/null
+++ b/package/mac80211/patches/570-ath9k_fix_rts_cts.patch
@@ -0,0 +1,61 @@
+--- a/drivers/net/wireless/ath/ath9k/xmit.c
++++ b/drivers/net/wireless/ath/ath9k/xmit.c
+@@ -1498,26 +1498,6 @@ static void ath_buf_set_rate(struct ath_
+ if (sc->sc_flags & SC_OP_PREAMBLE_SHORT)
+ ctsrate |= rate->hw_value_short;
+
+- /*
+- * ATH9K_TXDESC_RTSENA and ATH9K_TXDESC_CTSENA are mutually exclusive.
+- * Check the first rate in the series to decide whether RTS/CTS
+- * or CTS-to-self has to be used.
+- */
+- if (rates[0].flags & IEEE80211_TX_RC_USE_CTS_PROTECT)
+- flags = ATH9K_TXDESC_CTSENA;
+- else if (rates[0].flags & IEEE80211_TX_RC_USE_RTS_CTS)
+- flags = ATH9K_TXDESC_RTSENA;
+-
+- /* FIXME: Handle aggregation protection */
+- if (sc->config.ath_aggr_prot &&
+- (!bf_isaggr(bf) || (bf_isaggr(bf) && bf->bf_al < 8192))) {
+- flags = ATH9K_TXDESC_RTSENA;
+- }
+-
+- /* For AR5416 - RTS cannot be followed by a frame larger than 8K */
+- if (bf_isaggr(bf) && (bf->bf_al > sc->sc_ah->caps.rts_aggr_limit))
+- flags &= ~(ATH9K_TXDESC_RTSENA);
+-
+ for (i = 0; i < 4; i++) {
+ bool is_40, is_sgi, is_sp;
+ int phy;
+@@ -1529,8 +1509,15 @@ static void ath_buf_set_rate(struct ath_
+ series[i].Tries = rates[i].count;
+ series[i].ChSel = common->tx_chainmask;
+
+- if (rates[i].flags & IEEE80211_TX_RC_USE_RTS_CTS)
++ if ((sc->config.ath_aggr_prot && bf_isaggr(bf)) ||
++ (rates[i].flags & IEEE80211_TX_RC_USE_RTS_CTS)) {
+ series[i].RateFlags |= ATH9K_RATESERIES_RTS_CTS;
++ flags |= ATH9K_TXDESC_RTSENA;
++ } else if (rates[i].flags & IEEE80211_TX_RC_USE_CTS_PROTECT) {
++ series[i].RateFlags |= ATH9K_RATESERIES_RTS_CTS;
++ flags |= ATH9K_TXDESC_CTSENA;
++ }
++
+ if (rates[i].flags & IEEE80211_TX_RC_40_MHZ_WIDTH)
+ series[i].RateFlags |= ATH9K_RATESERIES_2040;
+ if (rates[i].flags & IEEE80211_TX_RC_SHORT_GI)
+@@ -1568,6 +1555,14 @@ static void ath_buf_set_rate(struct ath_
+ phy, rate->bitrate * 100, bf->bf_frmlen, rix, is_sp);
+ }
+
++ /* For AR5416 - RTS cannot be followed by a frame larger than 8K */
++ if (bf_isaggr(bf) && (bf->bf_al > sc->sc_ah->caps.rts_aggr_limit))
++ flags &= ~ATH9K_TXDESC_RTSENA;
++
++ /* ATH9K_TXDESC_RTSENA and ATH9K_TXDESC_CTSENA are mutually exclusive. */
++ if (flags & ATH9K_TXDESC_RTSENA)
++ flags &= ~ATH9K_TXDESC_CTSENA;
++
+ /* set dur_update_en for l-sig computation except for PS-Poll frames */
+ ath9k_hw_set11n_ratescenario(sc->sc_ah, bf->bf_desc,
+ bf->bf_lastbf->bf_desc,