ath9k: Use power save wrappers for TSF get/set
authorSujith Manoharan <Sujith.Manoharan@atheros.com>
Fri, 10 Dec 2010 05:57:06 +0000 (11:27 +0530)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 13 Dec 2010 20:23:30 +0000 (15:23 -0500)
The HW has to be awake when accessing registers.

Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/ath/ath9k/main.c

index ca35aaa..5b4ef81 100644 (file)
@@ -1987,7 +1987,9 @@ static u64 ath9k_get_tsf(struct ieee80211_hw *hw)
        struct ath_softc *sc = aphy->sc;
 
        mutex_lock(&sc->mutex);
+       ath9k_ps_wakeup(sc);
        tsf = ath9k_hw_gettsf64(sc->sc_ah);
+       ath9k_ps_restore(sc);
        mutex_unlock(&sc->mutex);
 
        return tsf;
@@ -1999,7 +2001,9 @@ static void ath9k_set_tsf(struct ieee80211_hw *hw, u64 tsf)
        struct ath_softc *sc = aphy->sc;
 
        mutex_lock(&sc->mutex);
+       ath9k_ps_wakeup(sc);
        ath9k_hw_settsf64(sc->sc_ah, tsf);
+       ath9k_ps_restore(sc);
        mutex_unlock(&sc->mutex);
 }