ath9k: Handle power modes in isr for power save.
authorVivek Natarajan <vivek.natraj@gmail.com>
Mon, 2 Mar 2009 14:55:14 +0000 (20:25 +0530)
committerJohn W. Linville <linville@tuxdriver.com>
Thu, 5 Mar 2009 19:39:39 +0000 (14:39 -0500)
Restore network sleep mode in isr if power save is enabled.

Signed-off-by: Vivek Natarajan <vnatarajan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/ath9k/ath9k.h
drivers/net/wireless/ath9k/main.c

index 6481ea4bbc4e2f3e69d445015c61ef5331e4df39..69292f31d20b902a4c3d1cc4b94c552b6b8dc8ca 100644 (file)
@@ -677,7 +677,8 @@ static inline void ath9k_ps_wakeup(struct ath_softc *sc)
 static inline void ath9k_ps_restore(struct ath_softc *sc)
 {
        if (atomic_dec_and_test(&sc->ps_usecount))
-               if (sc->hw->conf.flags & IEEE80211_CONF_PS)
+               if ((sc->hw->conf.flags & IEEE80211_CONF_PS) &&
+                   !(sc->sc_flags & SC_OP_WAIT_FOR_BEACON))
                        ath9k_hw_setpower(sc->sc_ah,
                                          sc->sc_ah->restore_mode);
 }
index 28200ce1d88eec7faf000d097f19072036cbc2c8..7effa0c40b8a8f3f3e5e09e0e1d4999e8899f2fa 100644 (file)
@@ -516,6 +516,7 @@ irqreturn_t ath_isr(int irq, void *dev)
                        return IRQ_NONE;
 
                sc->intrstatus = status;
+               ath9k_ps_wakeup(sc);
 
                if (status & ATH9K_INT_FATAL) {
                        /* need a chip reset */
@@ -581,6 +582,7 @@ irqreturn_t ath_isr(int irq, void *dev)
                                sched = true;
                        }
                }
+               ath9k_ps_restore(sc);
        } while (0);
 
        ath_debug_stat_interrupt(sc, status);