aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/ath/if_ath.c
diff options
context:
space:
mode:
authorAdrian Chadd <adrian@FreeBSD.org>2013-02-25 22:45:02 +0000
committerAdrian Chadd <adrian@FreeBSD.org>2013-02-25 22:45:02 +0000
commit6322256b83ed63e1806d3a91bf3529d0f525ab5b (patch)
treedb3977fe215286db1afd3479b715a9440c41b25c /sys/dev/ath/if_ath.c
parentd2a72d673fd835f7d8032f6801447d57ee50e53c (diff)
downloadsrc-6322256b83ed63e1806d3a91bf3529d0f525ab5b.tar.gz
src-6322256b83ed63e1806d3a91bf3529d0f525ab5b.zip
Part #2 of the TX chainmask changes:
* Remove ar5416UpdateChainmasks(); * Remove the TX chainmask override code from the ar5416 TX descriptor setup routines; * Write a driver method to calculate the current chainmask based on the operating mode and update the driver state; * Call the HAL chainmask method before calling ath_hal_reset(); * Use the currently configured chainmask in the TX descriptors rather than the hardware TX chainmasks. Tested: * AR5416, STA/AP mode - legacy and 11n modes
Notes
Notes: svn path=/head/; revision=247287
Diffstat (limited to 'sys/dev/ath/if_ath.c')
-rw-r--r--sys/dev/ath/if_ath.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/sys/dev/ath/if_ath.c b/sys/dev/ath/if_ath.c
index 2ea3909fb59b..a614d6f01130 100644
--- a/sys/dev/ath/if_ath.c
+++ b/sys/dev/ath/if_ath.c
@@ -1476,6 +1476,26 @@ ath_reset_keycache(struct ath_softc *sc)
ieee80211_crypto_reload_keys(ic);
}
+/*
+ * Fetch the current chainmask configuration based on the current
+ * operating channel and options.
+ */
+static void
+ath_update_chainmasks(struct ath_softc *sc, struct ieee80211_channel *chan)
+{
+
+ /*
+ * Set TX chainmask to the currently configured chainmask;
+ * the TX chainmask depends upon the current operating mode.
+ */
+ sc->sc_cur_rxchainmask = sc->sc_rxchainmask;
+ if (IEEE80211_IS_CHAN_HT(chan)) {
+ sc->sc_cur_txchainmask = sc->sc_txchainmask;
+ } else {
+ sc->sc_cur_txchainmask = 1;
+ }
+}
+
void
ath_resume(struct ath_softc *sc)
{
@@ -1494,6 +1514,10 @@ ath_resume(struct ath_softc *sc)
* Must reset the chip before we reload the
* keycache as we were powered down on suspend.
*/
+ ath_update_chainmasks(sc,
+ sc->sc_curchan != NULL ? sc->sc_curchan : ic->ic_curchan);
+ ath_hal_setchainmasks(sc->sc_ah, sc->sc_cur_txchainmask,
+ sc->sc_cur_rxchainmask);
ath_hal_reset(ah, sc->sc_opmode,
sc->sc_curchan != NULL ? sc->sc_curchan : ic->ic_curchan,
AH_FALSE, &status);
@@ -1935,6 +1959,9 @@ ath_init(void *arg)
* and then setup of the interrupt mask.
*/
ath_settkipmic(sc);
+ ath_update_chainmasks(sc, ic->ic_curchan);
+ ath_hal_setchainmasks(sc->sc_ah, sc->sc_cur_txchainmask,
+ sc->sc_cur_rxchainmask);
if (!ath_hal_reset(ah, sc->sc_opmode, ic->ic_curchan, AH_FALSE, &status)) {
if_printf(ifp, "unable to reset hardware; hal status %u\n",
status);
@@ -2250,6 +2277,9 @@ ath_reset(struct ifnet *ifp, ATH_RESET_TYPE reset_type)
ath_settkipmic(sc); /* configure TKIP MIC handling */
/* NB: indicate channel change so we do a full reset */
+ ath_update_chainmasks(sc, ic->ic_curchan);
+ ath_hal_setchainmasks(sc->sc_ah, sc->sc_cur_txchainmask,
+ sc->sc_cur_rxchainmask);
if (!ath_hal_reset(ah, sc->sc_opmode, ic->ic_curchan, AH_TRUE, &status))
if_printf(ifp, "%s: unable to reset hardware; hal status %u\n",
__func__, status);
@@ -4440,6 +4470,9 @@ ath_chan_set(struct ath_softc *sc, struct ieee80211_channel *chan)
*/
ath_draintxq(sc, ATH_RESET_FULL); /* clear pending tx frames */
+ ath_update_chainmasks(sc, chan);
+ ath_hal_setchainmasks(sc->sc_ah, sc->sc_cur_txchainmask,
+ sc->sc_cur_rxchainmask);
if (!ath_hal_reset(ah, sc->sc_opmode, chan, AH_TRUE, &status)) {
if_printf(ifp, "%s: unable to reset "
"channel %u (%u MHz, flags 0x%x), hal status %u\n",