]>
Commit | Line | Data |
---|---|---|
0f833e0d GKH |
1 | From 66024478ac9ed5a373ab6abfa055a46b156906ff Mon Sep 17 00:00:00 2001 |
2 | From: Senthil Balasubramanian <senthilkumar@atheros.com> | |
3 | Date: Thu, 11 Mar 2010 12:10:12 -0800 | |
4 | Subject: ath9k: Enable TIM timer interrupt only when needed. | |
5 | ||
6 | From: Senthil Balasubramanian <senthilkumar@atheros.com> | |
7 | ||
8 | commit 3f7c5c10e9dc6bf90179eb9f7c06151d508fb324 upstream. | |
9 | ||
10 | The TIM timer interrupt is enabled even before the ACK of nullqos | |
11 | is received which is unnecessary. | |
12 | ||
13 | Also clean up the CONF_PS part of config callback properly for | |
14 | better readability. | |
15 | ||
16 | Signed-off-by: Senthil Balasubramanian <senthilkumar@atheros.com> | |
17 | Signed-off-by: John W. Linville <linville@tuxdriver.com> | |
18 | Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com> | |
19 | Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> | |
20 | ||
21 | --- | |
22 | drivers/net/wireless/ath/ath9k/ath9k.h | 1 + | |
23 | drivers/net/wireless/ath/ath9k/main.c | 24 ++++++++++++++---------- | |
24 | drivers/net/wireless/ath/ath9k/xmit.c | 7 +++---- | |
25 | 3 files changed, 18 insertions(+), 14 deletions(-) | |
26 | ||
27 | --- a/drivers/net/wireless/ath/ath9k/ath9k.h | |
28 | +++ b/drivers/net/wireless/ath/ath9k/ath9k.h | |
29 | @@ -267,6 +267,7 @@ void ath_tx_aggr_start(struct ath_softc | |
30 | u16 tid, u16 *ssn); | |
31 | void ath_tx_aggr_stop(struct ath_softc *sc, struct ieee80211_sta *sta, u16 tid); | |
32 | void ath_tx_aggr_resume(struct ath_softc *sc, struct ieee80211_sta *sta, u16 tid); | |
33 | +void ath9k_enable_ps(struct ath_softc *sc); | |
34 | ||
35 | /********/ | |
36 | /* VIFs */ | |
37 | --- a/drivers/net/wireless/ath/ath9k/main.c | |
38 | +++ b/drivers/net/wireless/ath/ath9k/main.c | |
39 | @@ -2681,6 +2681,19 @@ static void ath9k_remove_interface(struc | |
40 | mutex_unlock(&sc->mutex); | |
41 | } | |
42 | ||
43 | +void ath9k_enable_ps(struct ath_softc *sc) | |
44 | +{ | |
45 | + sc->ps_enabled = true; | |
46 | + if (!(sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_AUTOSLEEP)) { | |
47 | + if ((sc->imask & ATH9K_INT_TIM_TIMER) == 0) { | |
48 | + sc->imask |= ATH9K_INT_TIM_TIMER; | |
49 | + ath9k_hw_set_interrupts(sc->sc_ah, | |
50 | + sc->imask); | |
51 | + } | |
52 | + } | |
53 | + ath9k_hw_setrxabort(sc->sc_ah, 1); | |
54 | +} | |
55 | + | |
56 | static int ath9k_config(struct ieee80211_hw *hw, u32 changed) | |
57 | { | |
58 | struct ath_wiphy *aphy = hw->priv; | |
59 | @@ -2734,22 +2747,13 @@ static int ath9k_config(struct ieee80211 | |
60 | if (changed & IEEE80211_CONF_CHANGE_PS) { | |
61 | if (conf->flags & IEEE80211_CONF_PS) { | |
62 | sc->sc_flags |= SC_OP_PS_ENABLED; | |
63 | - if (!(ah->caps.hw_caps & | |
64 | - ATH9K_HW_CAP_AUTOSLEEP)) { | |
65 | - if ((sc->imask & ATH9K_INT_TIM_TIMER) == 0) { | |
66 | - sc->imask |= ATH9K_INT_TIM_TIMER; | |
67 | - ath9k_hw_set_interrupts(sc->sc_ah, | |
68 | - sc->imask); | |
69 | - } | |
70 | - } | |
71 | /* | |
72 | * At this point we know hardware has received an ACK | |
73 | * of a previously sent null data frame. | |
74 | */ | |
75 | if ((sc->sc_flags & SC_OP_NULLFUNC_COMPLETED)) { | |
76 | sc->sc_flags &= ~SC_OP_NULLFUNC_COMPLETED; | |
77 | - sc->ps_enabled = true; | |
78 | - ath9k_hw_setrxabort(sc->sc_ah, 1); | |
79 | + ath9k_enable_ps(sc); | |
80 | } | |
81 | } else { | |
82 | sc->ps_enabled = false; | |
83 | --- a/drivers/net/wireless/ath/ath9k/xmit.c | |
84 | +++ b/drivers/net/wireless/ath/ath9k/xmit.c | |
85 | @@ -2034,10 +2034,9 @@ static void ath_tx_processq(struct ath_s | |
86 | */ | |
87 | if (bf->bf_isnullfunc && | |
88 | (ds->ds_txstat.ts_status & ATH9K_TX_ACKED)) { | |
89 | - if ((sc->sc_flags & SC_OP_PS_ENABLED)) { | |
90 | - sc->ps_enabled = true; | |
91 | - ath9k_hw_setrxabort(sc->sc_ah, 1); | |
92 | - } else | |
93 | + if ((sc->sc_flags & SC_OP_PS_ENABLED)) | |
94 | + ath9k_enable_ps(sc); | |
95 | + else | |
96 | sc->sc_flags |= SC_OP_NULLFUNC_COMPLETED; | |
97 | } | |
98 |