ath9k: fix beacon restart on channel change
authorRajkumar Manoharan <rmanoharan@atheros.com>
Thu, 30 Dec 2010 13:37:44 +0000 (19:07 +0530)
committerJohn W. Linville <linville@tuxdriver.com>
Tue, 4 Jan 2011 19:43:01 +0000 (14:43 -0500)
Restart the beacon timers only if the beacon
was already configured. Otherwise beacons timers
are restarted unnecessarily in unassociated state too.

Cc: stable@kernel.org
Signed-off-by: Rajkumar Manoharan <rmanoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/ath/ath9k/main.c

index 0f1b624561411b65cc346618493409dd9c44d40f..a818e4fd56f5555d587d92eac01104830427a0e8 100644 (file)
@@ -285,7 +285,8 @@ int ath_set_channel(struct ath_softc *sc, struct ieee80211_hw *hw,
        ath9k_hw_set_interrupts(ah, ah->imask);
 
        if (!(sc->sc_flags & (SC_OP_OFFCHANNEL))) {
-               ath_beacon_config(sc, NULL);
+               if (sc->sc_flags & SC_OP_BEACONS)
+                       ath_beacon_config(sc, NULL);
                ieee80211_queue_delayed_work(sc->hw, &sc->tx_complete_work, 0);
                ath_start_ani(common);
        }