aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/wireless/ath/ath9k/ath9k.h1
-rw-r--r--drivers/net/wireless/ath/ath9k/main.c24
-rw-r--r--drivers/net/wireless/ath/ath9k/xmit.c7
3 files changed, 18 insertions, 14 deletions
diff --git a/drivers/net/wireless/ath/ath9k/ath9k.h b/drivers/net/wireless/ath/ath9k/ath9k.h
index 1597a42731ed..2bad7120171f 100644
--- a/drivers/net/wireless/ath/ath9k/ath9k.h
+++ b/drivers/net/wireless/ath/ath9k/ath9k.h
@@ -267,6 +267,7 @@ void ath_tx_aggr_start(struct ath_softc *sc, struct ieee80211_sta *sta,
267 u16 tid, u16 *ssn); 267 u16 tid, u16 *ssn);
268void ath_tx_aggr_stop(struct ath_softc *sc, struct ieee80211_sta *sta, u16 tid); 268void ath_tx_aggr_stop(struct ath_softc *sc, struct ieee80211_sta *sta, u16 tid);
269void ath_tx_aggr_resume(struct ath_softc *sc, struct ieee80211_sta *sta, u16 tid); 269void ath_tx_aggr_resume(struct ath_softc *sc, struct ieee80211_sta *sta, u16 tid);
270void ath9k_enable_ps(struct ath_softc *sc);
270 271
271/********/ 272/********/
272/* VIFs */ 273/* VIFs */
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index 958d9e85fbac..849c90c23de1 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -2681,6 +2681,19 @@ static void ath9k_remove_interface(struct ieee80211_hw *hw,
2681 mutex_unlock(&sc->mutex); 2681 mutex_unlock(&sc->mutex);
2682} 2682}
2683 2683
2684void ath9k_enable_ps(struct ath_softc *sc)
2685{
2686 sc->ps_enabled = true;
2687 if (!(sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_AUTOSLEEP)) {
2688 if ((sc->imask & ATH9K_INT_TIM_TIMER) == 0) {
2689 sc->imask |= ATH9K_INT_TIM_TIMER;
2690 ath9k_hw_set_interrupts(sc->sc_ah,
2691 sc->imask);
2692 }
2693 }
2694 ath9k_hw_setrxabort(sc->sc_ah, 1);
2695}
2696
2684static int ath9k_config(struct ieee80211_hw *hw, u32 changed) 2697static int ath9k_config(struct ieee80211_hw *hw, u32 changed)
2685{ 2698{
2686 struct ath_wiphy *aphy = hw->priv; 2699 struct ath_wiphy *aphy = hw->priv;
@@ -2734,22 +2747,13 @@ static int ath9k_config(struct ieee80211_hw *hw, u32 changed)
2734 if (changed & IEEE80211_CONF_CHANGE_PS) { 2747 if (changed & IEEE80211_CONF_CHANGE_PS) {
2735 if (conf->flags & IEEE80211_CONF_PS) { 2748 if (conf->flags & IEEE80211_CONF_PS) {
2736 sc->sc_flags |= SC_OP_PS_ENABLED; 2749 sc->sc_flags |= SC_OP_PS_ENABLED;
2737 if (!(ah->caps.hw_caps &
2738 ATH9K_HW_CAP_AUTOSLEEP)) {
2739 if ((sc->imask & ATH9K_INT_TIM_TIMER) == 0) {
2740 sc->imask |= ATH9K_INT_TIM_TIMER;
2741 ath9k_hw_set_interrupts(sc->sc_ah,
2742 sc->imask);
2743 }
2744 }
2745 /* 2750 /*
2746 * At this point we know hardware has received an ACK 2751 * At this point we know hardware has received an ACK
2747 * of a previously sent null data frame. 2752 * of a previously sent null data frame.
2748 */ 2753 */
2749 if ((sc->sc_flags & SC_OP_NULLFUNC_COMPLETED)) { 2754 if ((sc->sc_flags & SC_OP_NULLFUNC_COMPLETED)) {
2750 sc->sc_flags &= ~SC_OP_NULLFUNC_COMPLETED; 2755 sc->sc_flags &= ~SC_OP_NULLFUNC_COMPLETED;
2751 sc->ps_enabled = true; 2756 ath9k_enable_ps(sc);
2752 ath9k_hw_setrxabort(sc->sc_ah, 1);
2753 } 2757 }
2754 } else { 2758 } else {
2755 sc->ps_enabled = false; 2759 sc->ps_enabled = false;
diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c
index 61c553eaa432..c3ce920d4773 100644
--- a/drivers/net/wireless/ath/ath9k/xmit.c
+++ b/drivers/net/wireless/ath/ath9k/xmit.c
@@ -2034,10 +2034,9 @@ static void ath_tx_processq(struct ath_softc *sc, struct ath_txq *txq)
2034 */ 2034 */
2035 if (bf->bf_isnullfunc && 2035 if (bf->bf_isnullfunc &&
2036 (ds->ds_txstat.ts_status & ATH9K_TX_ACKED)) { 2036 (ds->ds_txstat.ts_status & ATH9K_TX_ACKED)) {
2037 if ((sc->sc_flags & SC_OP_PS_ENABLED)) { 2037 if ((sc->sc_flags & SC_OP_PS_ENABLED))
2038 sc->ps_enabled = true; 2038 ath9k_enable_ps(sc);
2039 ath9k_hw_setrxabort(sc->sc_ah, 1); 2039 else
2040 } else
2041 sc->sc_flags |= SC_OP_NULLFUNC_COMPLETED; 2040 sc->sc_flags |= SC_OP_NULLFUNC_COMPLETED;
2042 } 2041 }
2043 2042