]> Pileus Git - ~andy/linux/blobdiff - drivers/net/wireless/ath/ath9k/main.c
ath9k: fix going to full-sleep on PS idle
[~andy/linux] / drivers / net / wireless / ath / ath9k / main.c
index 33403a92e45fbd55a81d08ca56748af5d24fd08c..4a9901090811803ee1b4a46e588d5cb692f820ca 100644 (file)
@@ -118,13 +118,15 @@ void ath9k_ps_restore(struct ath_softc *sc)
        if (--sc->ps_usecount != 0)
                goto unlock;
 
-       if (sc->ps_idle && (sc->ps_flags & PS_WAIT_FOR_TX_ACK))
+       if (sc->ps_flags & PS_WAIT_FOR_TX_ACK)
+               goto unlock;
+
+       if (sc->ps_idle)
                mode = ATH9K_PM_FULL_SLEEP;
        else if (sc->ps_enabled &&
                 !(sc->ps_flags & (PS_WAIT_FOR_BEACON |
                              PS_WAIT_FOR_CAB |
-                             PS_WAIT_FOR_PSPOLL_DATA |
-                             PS_WAIT_FOR_TX_ACK)))
+                             PS_WAIT_FOR_PSPOLL_DATA)))
                mode = ATH9K_PM_NETWORK_SLEEP;
        else
                goto unlock;