diff options
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/main.c')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/main.c | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c index 6796d5cdc293..40da7a6e4b6b 100644 --- a/drivers/net/wireless/ath/ath9k/main.c +++ b/drivers/net/wireless/ath/ath9k/main.c | |||
@@ -1492,6 +1492,19 @@ static void ath9k_remove_interface(struct ieee80211_hw *hw, | |||
1492 | mutex_unlock(&sc->mutex); | 1492 | mutex_unlock(&sc->mutex); |
1493 | } | 1493 | } |
1494 | 1494 | ||
1495 | void ath9k_enable_ps(struct ath_softc *sc) | ||
1496 | { | ||
1497 | sc->ps_enabled = true; | ||
1498 | if (!(sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_AUTOSLEEP)) { | ||
1499 | if ((sc->imask & ATH9K_INT_TIM_TIMER) == 0) { | ||
1500 | sc->imask |= ATH9K_INT_TIM_TIMER; | ||
1501 | ath9k_hw_set_interrupts(sc->sc_ah, | ||
1502 | sc->imask); | ||
1503 | } | ||
1504 | } | ||
1505 | ath9k_hw_setrxabort(sc->sc_ah, 1); | ||
1506 | } | ||
1507 | |||
1495 | static int ath9k_config(struct ieee80211_hw *hw, u32 changed) | 1508 | static int ath9k_config(struct ieee80211_hw *hw, u32 changed) |
1496 | { | 1509 | { |
1497 | struct ath_wiphy *aphy = hw->priv; | 1510 | struct ath_wiphy *aphy = hw->priv; |
@@ -1546,22 +1559,13 @@ static int ath9k_config(struct ieee80211_hw *hw, u32 changed) | |||
1546 | if (changed & IEEE80211_CONF_CHANGE_PS) { | 1559 | if (changed & IEEE80211_CONF_CHANGE_PS) { |
1547 | if (conf->flags & IEEE80211_CONF_PS) { | 1560 | if (conf->flags & IEEE80211_CONF_PS) { |
1548 | sc->ps_flags |= PS_ENABLED; | 1561 | sc->ps_flags |= PS_ENABLED; |
1549 | if (!(ah->caps.hw_caps & | ||
1550 | ATH9K_HW_CAP_AUTOSLEEP)) { | ||
1551 | if ((sc->imask & ATH9K_INT_TIM_TIMER) == 0) { | ||
1552 | sc->imask |= ATH9K_INT_TIM_TIMER; | ||
1553 | ath9k_hw_set_interrupts(sc->sc_ah, | ||
1554 | sc->imask); | ||
1555 | } | ||
1556 | } | ||
1557 | /* | 1562 | /* |
1558 | * At this point we know hardware has received an ACK | 1563 | * At this point we know hardware has received an ACK |
1559 | * of a previously sent null data frame. | 1564 | * of a previously sent null data frame. |
1560 | */ | 1565 | */ |
1561 | if ((sc->ps_flags & PS_NULLFUNC_COMPLETED)) { | 1566 | if ((sc->ps_flags & PS_NULLFUNC_COMPLETED)) { |
1562 | sc->ps_flags &= ~PS_NULLFUNC_COMPLETED; | 1567 | sc->ps_flags &= ~PS_NULLFUNC_COMPLETED; |
1563 | sc->ps_enabled = true; | 1568 | ath9k_enable_ps(sc); |
1564 | ath9k_hw_setrxabort(sc->sc_ah, 1); | ||
1565 | } | 1569 | } |
1566 | } else { | 1570 | } else { |
1567 | sc->ps_enabled = false; | 1571 | sc->ps_enabled = false; |