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>
 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);
 }
 
                        return IRQ_NONE;
 
                sc->intrstatus = status;
+               ath9k_ps_wakeup(sc);
 
                if (status & ATH9K_INT_FATAL) {
                        /* need a chip reset */
                                sched = true;
                        }
                }
+               ath9k_ps_restore(sc);
        } while (0);
 
        ath_debug_stat_interrupt(sc, status);