ath9k: always call ath_reset from workqueue context
[pandora-kernel.git] / drivers / net / wireless / ath / ath9k / beacon.c
index 0d13ff7..22e8e25 100644 (file)
@@ -107,7 +107,7 @@ static void ath_beacon_setup(struct ath_softc *sc, struct ath_vif *avp,
        series[0].Tries = 1;
        series[0].Rate = rate;
        series[0].ChSel = ath_txchainmask_reduction(sc,
-                       common->tx_chainmask, series[0].Rate);
+                       ah->txchainmask, series[0].Rate);
        series[0].RateFlags = (ctsrate) ? ATH9K_RATESERIES_RTS_CTS : 0;
        ath9k_hw_set11n_ratescenario(ah, ds, ds, 0, ctsrate, ctsduration,
                                     series, 4, 0);
@@ -386,9 +386,7 @@ void ath_beacon_tasklet(unsigned long data)
                        ath_dbg(common, ATH_DBG_BSTUCK,
                                "beacon is officially stuck\n");
                        sc->sc_flags |= SC_OP_TSF_RESET;
-                       spin_lock(&sc->sc_pcu_lock);
-                       ath_reset(sc, true);
-                       spin_unlock(&sc->sc_pcu_lock);
+                       ieee80211_queue_work(sc->hw, &sc->hw_reset_work);
                }
 
                return;
@@ -522,6 +520,7 @@ static void ath_beacon_config_ap(struct ath_softc *sc,
        ath9k_beacon_init(sc, nexttbtt, intval);
        sc->beacon.bmisscnt = 0;
        ath9k_hw_set_interrupts(ah, ah->imask);
+       ath9k_hw_enable_interrupts(ah);
 }
 
 /*
@@ -648,12 +647,8 @@ static void ath_beacon_config_sta(struct ath_softc *sc,
        ath9k_hw_set_sta_beacon_timers(ah, &bs);
        ah->imask |= ATH9K_INT_BMISS;
 
-       /*
-        * If the beacon config is called beacause of TSFOOR,
-        * Interrupts will be enabled back at the end of ath9k_tasklet
-        */
-       if (!(sc->ps_flags & PS_TSFOOR_SYNC))
-               ath9k_hw_set_interrupts(ah, ah->imask);
+       ath9k_hw_set_interrupts(ah, ah->imask);
+       ath9k_hw_enable_interrupts(ah);
 }
 
 static void ath_beacon_config_adhoc(struct ath_softc *sc,
@@ -687,12 +682,9 @@ static void ath_beacon_config_adhoc(struct ath_softc *sc,
        ath9k_hw_disable_interrupts(ah);
        ath9k_beacon_init(sc, nexttbtt, intval);
        sc->beacon.bmisscnt = 0;
-       /*
-        * If the beacon config is called beacause of TSFOOR,
-        * Interrupts will be enabled back at the end of ath9k_tasklet
-        */
-       if (!(sc->ps_flags & PS_TSFOOR_SYNC))
-               ath9k_hw_set_interrupts(ah, ah->imask);
+
+       ath9k_hw_set_interrupts(ah, ah->imask);
+       ath9k_hw_enable_interrupts(ah);
 }
 
 static bool ath9k_allow_beacon_config(struct ath_softc *sc,