summaryrefslogtreecommitdiffstats
path: root/sys/dev/ath/if_ath.c
diff options
context:
space:
mode:
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 2ea3909..a614d6f 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",
OpenPOWER on IntegriCloud