aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath
diff options
context:
space:
mode:
authorSenthil Balasubramanian <senthilkumar@atheros.com>2010-02-03 12:21:13 -0500
committerJohn W. Linville <linville@tuxdriver.com>2010-02-08 16:50:54 -0500
commit3f7c5c10e9dc6bf90179eb9f7c06151d508fb324 (patch)
treed630236500fd928c51d78dae71febf49ea26ba5c /drivers/net/wireless/ath
parent1a20034a73a40b8056731f9db0c535cec2961eb7 (diff)
ath9k: Enable TIM timer interrupt only when needed.
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>
Diffstat (limited to 'drivers/net/wireless/ath')
-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 0ea340fd071c..83c7ea4c007f 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 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
1495void 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
1495static int ath9k_config(struct ieee80211_hw *hw, u32 changed) 1508static 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;
diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c
index 3c790a4f38f7..f5cbbcb9a4aa 100644
--- a/drivers/net/wireless/ath/ath9k/xmit.c
+++ b/drivers/net/wireless/ath/ath9k/xmit.c
@@ -2048,10 +2048,9 @@ static void ath_tx_processq(struct ath_softc *sc, struct ath_txq *txq)
2048 */ 2048 */
2049 if (bf->bf_isnullfunc && 2049 if (bf->bf_isnullfunc &&
2050 (ds->ds_txstat.ts_status & ATH9K_TX_ACKED)) { 2050 (ds->ds_txstat.ts_status & ATH9K_TX_ACKED)) {
2051 if ((sc->ps_flags & PS_ENABLED)) { 2051 if ((sc->ps_flags & PS_ENABLED))
2052 sc->ps_enabled = true; 2052 ath9k_enable_ps(sc);
2053 ath9k_hw_setrxabort(sc->sc_ah, 1); 2053 else
2054 } else
2055 sc->ps_flags |= PS_NULLFUNC_COMPLETED; 2054 sc->ps_flags |= PS_NULLFUNC_COMPLETED;
2056 } 2055 }
2057 2056