diff options
author | Vivek Natarajan <vnatarajan@atheros.com> | 2010-01-29 06:26:51 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-01-29 10:43:37 -0500 |
commit | 1dbfd9d46a6df5232ba0b12d2da950da89eff3da (patch) | |
tree | f9103cc7069d38e04666ebaeac705e2e6f59c30e /drivers/net/wireless | |
parent | f276586a8af410d2b79733daf52471605b6559e9 (diff) |
ath9k: Handle full sleep in ps_restore.
IDLE PS (Full Sleep) doesn't work when ifconfig up
is done during Idle unassociated state.
Fix this by restoring FULL SLEEP in ps_restore if CONF_IDLE
is set.
Signed-off-by: Vivek Natarajan <vnatarajan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless')
-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 bdbcc70df075..3f8a7e773d55 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 6f3e71c5071e..e04835cb21b5 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 | ||