diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/ath9k.h | 1 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/main.c | 8 |
2 files changed, 7 insertions, 2 deletions
diff --git a/drivers/net/wireless/ath/ath9k/ath9k.h b/drivers/net/wireless/ath/ath9k/ath9k.h index bdbcc70df07..3f8a7e773d5 100644 --- a/drivers/net/wireless/ath/ath9k/ath9k.h +++ b/drivers/net/wireless/ath/ath9k/ath9k.h | |||
@@ -480,6 +480,7 @@ struct ath_softc { | |||
480 | u8 nbcnvifs; | 480 | u8 nbcnvifs; |
481 | u16 nvifs; | 481 | u16 nvifs; |
482 | bool ps_enabled; | 482 | bool ps_enabled; |
483 | bool ps_idle; | ||
483 | unsigned long ps_usecount; | 484 | unsigned long ps_usecount; |
484 | enum ath9k_int imask; | 485 | enum ath9k_int imask; |
485 | 486 | ||
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c index 6f3e71c5071..e04835cb21b 100644 --- a/drivers/net/wireless/ath/ath9k/main.c +++ b/drivers/net/wireless/ath/ath9k/main.c | |||
@@ -143,8 +143,10 @@ void ath9k_ps_restore(struct ath_softc *sc) | |||
143 | if (--sc->ps_usecount != 0) | 143 | if (--sc->ps_usecount != 0) |
144 | goto unlock; | 144 | goto unlock; |
145 | 145 | ||
146 | if (sc->ps_enabled && | 146 | if (sc->ps_idle) |
147 | !(sc->ps_flags & (PS_WAIT_FOR_BEACON | | 147 | ath9k_hw_setpower(sc->sc_ah, ATH9K_PM_FULL_SLEEP); |
148 | else if (sc->ps_enabled && | ||
149 | !(sc->ps_flags & (PS_WAIT_FOR_BEACON | | ||
148 | PS_WAIT_FOR_CAB | | 150 | PS_WAIT_FOR_CAB | |
149 | PS_WAIT_FOR_PSPOLL_DATA | | 151 | PS_WAIT_FOR_PSPOLL_DATA | |
150 | PS_WAIT_FOR_TX_ACK))) | 152 | PS_WAIT_FOR_TX_ACK))) |
@@ -1528,6 +1530,7 @@ static int ath9k_config(struct ieee80211_hw *hw, u32 changed) | |||
1528 | spin_unlock_bh(&sc->wiphy_lock); | 1530 | spin_unlock_bh(&sc->wiphy_lock); |
1529 | 1531 | ||
1530 | if (enable_radio) { | 1532 | if (enable_radio) { |
1533 | sc->ps_idle = false; | ||
1531 | ath_radio_enable(sc, hw); | 1534 | ath_radio_enable(sc, hw); |
1532 | ath_print(common, ATH_DBG_CONFIG, | 1535 | ath_print(common, ATH_DBG_CONFIG, |
1533 | "not-idle: enabling radio\n"); | 1536 | "not-idle: enabling radio\n"); |
@@ -1635,6 +1638,7 @@ skip_chan_change: | |||
1635 | 1638 | ||
1636 | if (disable_radio) { | 1639 | if (disable_radio) { |
1637 | ath_print(common, ATH_DBG_CONFIG, "idle: disabling radio\n"); | 1640 | ath_print(common, ATH_DBG_CONFIG, "idle: disabling radio\n"); |
1641 | sc->ps_idle = true; | ||
1638 | ath_radio_disable(sc, hw); | 1642 | ath_radio_disable(sc, hw); |
1639 | } | 1643 | } |
1640 | 1644 | ||