From 2b5684a81300496044e55d5363eb1fd9b52d5d6e Mon Sep 17 00:00:00 2001 From: Adrian Chadd Date: Tue, 22 Feb 2011 04:41:04 +0000 Subject: [PATCH] Don't set the RTS/CTS enable bit per-scenario if the global RTS/CTS flags aren't set. --- sys/dev/ath/if_ath_tx_ht.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/sys/dev/ath/if_ath_tx_ht.c b/sys/dev/ath/if_ath_tx_ht.c index 1e9c9cef2298..a8b5a608ca78 100644 --- a/sys/dev/ath/if_ath_tx_ht.c +++ b/sys/dev/ath/if_ath_tx_ht.c @@ -96,7 +96,7 @@ __FBSDID("$FreeBSD$"); static void ath_rateseries_setup(struct ath_softc *sc, struct ieee80211_node *ni, HAL_11N_RATE_SERIES *series, unsigned int pktlen, uint8_t *rix, - uint8_t *try) + uint8_t *try, int flags) { struct ieee80211com *ic = ni->ni_ic; struct ath_hal *ah = sc->sc_ah; @@ -125,12 +125,7 @@ ath_rateseries_setup(struct ath_softc *sc, struct ieee80211_node *ni, */ series[i].ChSel = sc->sc_txchainmask; - /* - * This merely enables RTS or RTS/CTS for the given scenario; - * it needs to be enabled elsewhere. - */ - if (ic->ic_protmode == IEEE80211_PROT_RTSCTS || - ic->ic_protmode == IEEE80211_PROT_CTSONLY) + if (flags & (HAL_TXDESC_RTSENA | HAL_TXDESC_CTSENA)) series[i].RateFlags |= HAL_RATESERIES_RTS_CTS; if (ni->ni_htcap & IEEE80211_HTCAP_CHWIDTH40) @@ -201,7 +196,7 @@ ath_buf_set_rate(struct ath_softc *sc, struct ieee80211_node *ni, struct ath_buf /* Setup rate scenario */ memset(&series, 0, sizeof(series)); - ath_rateseries_setup(sc, ni, series, pktlen, rix, try); + ath_rateseries_setup(sc, ni, series, pktlen, rix, try, flags); /* Enforce AR5416 aggregate limit - can't do RTS w/ an agg frame > 8k */ @@ -210,6 +205,11 @@ ath_buf_set_rate(struct ath_softc *sc, struct ieee80211_node *ni, struct ath_buf /* Get a pointer to the last tx descriptor in the list */ lastds = &bf->bf_desc[bf->bf_nseg - 1]; +#if 0 + printf("pktlen: %d; flags 0x%x\n", pktlen, flags); + ath_rateseries_print(series); +#endif + /* Set rate scenario */ ath_hal_set11nratescenario(ah, ds, !is_pspoll, /* whether to override the duration or not */