aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/wireless/ath9k/main.c29
1 files changed, 18 insertions, 11 deletions
diff --git a/drivers/net/wireless/ath9k/main.c b/drivers/net/wireless/ath9k/main.c
index 0607df20e497..97cf83fa8555 100644
--- a/drivers/net/wireless/ath9k/main.c
+++ b/drivers/net/wireless/ath9k/main.c
@@ -2325,26 +2325,33 @@ static int ath9k_config(struct ieee80211_hw *hw, u32 changed)
2325 struct ath_wiphy *aphy = hw->priv; 2325 struct ath_wiphy *aphy = hw->priv;
2326 struct ath_softc *sc = aphy->sc; 2326 struct ath_softc *sc = aphy->sc;
2327 struct ieee80211_conf *conf = &hw->conf; 2327 struct ieee80211_conf *conf = &hw->conf;
2328 struct ath_hw *ah = sc->sc_ah;
2328 2329
2329 mutex_lock(&sc->mutex); 2330 mutex_lock(&sc->mutex);
2330 2331
2331 if (changed & IEEE80211_CONF_CHANGE_PS) { 2332 if (changed & IEEE80211_CONF_CHANGE_PS) {
2332 if (conf->flags & IEEE80211_CONF_PS) { 2333 if (conf->flags & IEEE80211_CONF_PS) {
2333 if ((sc->imask & ATH9K_INT_TIM_TIMER) == 0) { 2334 if (!(ah->caps.hw_caps &
2334 sc->imask |= ATH9K_INT_TIM_TIMER; 2335 ATH9K_HW_CAP_AUTOSLEEP)) {
2335 ath9k_hw_set_interrupts(sc->sc_ah, 2336 if ((sc->imask & ATH9K_INT_TIM_TIMER) == 0) {
2336 sc->imask); 2337 sc->imask |= ATH9K_INT_TIM_TIMER;
2338 ath9k_hw_set_interrupts(sc->sc_ah,
2339 sc->imask);
2340 }
2341 ath9k_hw_setrxabort(sc->sc_ah, 1);
2337 } 2342 }
2338 ath9k_hw_setrxabort(sc->sc_ah, 1);
2339 ath9k_hw_setpower(sc->sc_ah, ATH9K_PM_NETWORK_SLEEP); 2343 ath9k_hw_setpower(sc->sc_ah, ATH9K_PM_NETWORK_SLEEP);
2340 } else { 2344 } else {
2341 ath9k_hw_setpower(sc->sc_ah, ATH9K_PM_AWAKE); 2345 ath9k_hw_setpower(sc->sc_ah, ATH9K_PM_AWAKE);
2342 ath9k_hw_setrxabort(sc->sc_ah, 0); 2346 if (!(ah->caps.hw_caps &
2343 sc->sc_flags &= ~SC_OP_WAIT_FOR_BEACON; 2347 ATH9K_HW_CAP_AUTOSLEEP)) {
2344 if (sc->imask & ATH9K_INT_TIM_TIMER) { 2348 ath9k_hw_setrxabort(sc->sc_ah, 0);
2345 sc->imask &= ~ATH9K_INT_TIM_TIMER; 2349 sc->sc_flags &= ~SC_OP_WAIT_FOR_BEACON;
2346 ath9k_hw_set_interrupts(sc->sc_ah, 2350 if (sc->imask & ATH9K_INT_TIM_TIMER) {
2347 sc->imask); 2351 sc->imask &= ~ATH9K_INT_TIM_TIMER;
2352 ath9k_hw_set_interrupts(sc->sc_ah,
2353 sc->imask);
2354 }
2348 } 2355 }
2349 } 2356 }
2350 } 2357 }