}
 }
 
+static void ath9k_beacon_init(struct ath_softc *sc,
+                             u32 next_beacon,
+                             u32 beacon_period)
+{
+       if (beacon_period & ATH9K_BEACON_RESET_TSF)
+               ath9k_ps_wakeup(sc);
+
+       ath9k_hw_beaconinit(sc->sc_ah, next_beacon, beacon_period);
+
+       if (beacon_period & ATH9K_BEACON_RESET_TSF)
+               ath9k_ps_restore(sc);
+}
+
 /*
  * For multi-bss ap support beacons are either staggered evenly over N slots or
  * burst together.  For the former arrange for the SWBA to be delivered for each
        /* Set the computed AP beacon timers */
 
        ath9k_hw_set_interrupts(sc->sc_ah, 0);
-       ath9k_hw_beaconinit(sc->sc_ah, nexttbtt, intval);
+       ath9k_beacon_init(sc, nexttbtt, intval);
        sc->beacon.bmisscnt = 0;
        ath9k_hw_set_interrupts(sc->sc_ah, sc->imask);
 
        /* Set the computed ADHOC beacon timers */
 
        ath9k_hw_set_interrupts(sc->sc_ah, 0);
-       ath9k_hw_beaconinit(sc->sc_ah, nexttbtt, intval);
+       ath9k_beacon_init(sc, nexttbtt, intval);
        sc->beacon.bmisscnt = 0;
        ath9k_hw_set_interrupts(sc->sc_ah, sc->imask);
 
 
 
 void ath9k_hw_reset_tsf(struct ath_hw *ah)
 {
-       ath9k_ps_wakeup(ah->ah_sc);
        if (!ath9k_hw_wait(ah, AR_SLP32_MODE, AR_SLP32_TSF_WRITE_STATUS, 0,
                           AH_TSF_WRITE_TIMEOUT))
                DPRINTF(ah, ATH_DBG_RESET,
                        "AR_SLP32_TSF_WRITE_STATUS limit exceeded\n");
 
        REG_WRITE(ah, AR_RESET_TSF, AR_RESET_TSF_ONCE);
-       ath9k_ps_restore(ah->ah_sc);
 }
 
 void ath9k_hw_set_tsfadjust(struct ath_hw *ah, u32 setting)