aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless
diff options
context:
space:
mode:
authorSenthil Balasubramanian <senthilkumar@atheros.com>2010-03-11 15:10:12 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2010-04-01 19:01:56 -0400
commiteb4265ff035b929a44fe58b8f2fd09a45e7fea07 (patch)
tree4f9165c5e7bc646fd1cc76b31e59c5edf6ffe9bf /drivers/net/wireless
parent8427ce07d4df285b8b4b85496abf7913b4b4839e (diff)
ath9k: Enable TIM timer interrupt only when needed.
commit 3f7c5c10e9dc6bf90179eb9f7c06151d508fb324 upstream. The TIM timer interrupt is enabled even before the ACK of nullqos is received which is unnecessary. Also clean up the CONF_PS part of config callback properly for better readability. Signed-off-by: Senthil Balasubramanian <senthilkumar@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com> Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/net/wireless')
-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