ath9k: Make sure we have current channel in ah_curchan before rf disable/enable
authorVasanthakumar Thiagarajan <vasanth@atheros.com>
Sat, 13 Jun 2009 09:20:25 +0000 (14:50 +0530)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 15 Jun 2009 19:05:57 +0000 (15:05 -0400)
Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/ath/ath9k/main.c

index 89bf07e66d10b4d10459293096b07ba14bf449e9..6516a426f6ce05288898f882cae0f458b459f86b 100644 (file)
@@ -1123,6 +1123,9 @@ void ath_radio_enable(struct ath_softc *sc)
        ath9k_ps_wakeup(sc);
        ath9k_hw_configpcipowersave(ah, 0);
 
+       if (!ah->curchan)
+               ah->curchan = ath_get_curchannel(sc, sc->hw);
+
        spin_lock_bh(&sc->sc_resetlock);
        r = ath9k_hw_reset(ah, ah->curchan, false);
        if (r) {
@@ -1175,6 +1178,9 @@ void ath_radio_disable(struct ath_softc *sc)
        ath_stoprecv(sc);               /* turn off frame recv */
        ath_flushrecv(sc);              /* flush recv queue */
 
+       if (!ah->curchan)
+               ah->curchan = ath_get_curchannel(sc, sc->hw);
+
        spin_lock_bh(&sc->sc_resetlock);
        r = ath9k_hw_reset(ah, ah->curchan, false);
        if (r) {