aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorSenthil Balasubramanian <senthilkumar@atheros.com>2010-10-05 11:06:40 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-10-06 16:30:40 -0400
commitfbab7390f954e3517c72d12cfd9a1502699aa368 (patch)
tree35c1a58ac086162531e06a5c8f9e3b0b3fb829c4 /drivers
parent95792178a58716a6afaeb5ab9654f1a0f17a5e8e (diff)
ath9k: remove unnecessary power save flags.
drv_config callback is called only after the ack for the nullframe is received and so driver need not do anything special for this. So remove NULLFUNC_COMPLETED, PS_ENABLED flags and bf_isnullfunc flags from ath9k as mac80211 already handles them properly. Signed-off-by: Senthil Balasubramanian <senthilkumar@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/ath/ath9k/ath9k.h4
-rw-r--r--drivers/net/wireless/ath/ath9k/main.c18
-rw-r--r--drivers/net/wireless/ath/ath9k/xmit.c30
3 files changed, 4 insertions, 48 deletions
diff --git a/drivers/net/wireless/ath/ath9k/ath9k.h b/drivers/net/wireless/ath/ath9k/ath9k.h
index 9f8e542ef47e..de2b18ee7f77 100644
--- a/drivers/net/wireless/ath/ath9k/ath9k.h
+++ b/drivers/net/wireless/ath/ath9k/ath9k.h
@@ -241,7 +241,6 @@ struct ath_buf {
241 dma_addr_t bf_daddr; /* physical addr of desc */ 241 dma_addr_t bf_daddr; /* physical addr of desc */
242 dma_addr_t bf_buf_addr; /* physical addr of data buffer */ 242 dma_addr_t bf_buf_addr; /* physical addr of data buffer */
243 bool bf_stale; 243 bool bf_stale;
244 bool bf_isnullfunc;
245 bool bf_tx_aborted; 244 bool bf_tx_aborted;
246 u16 bf_flags; 245 u16 bf_flags;
247 struct ath_buf_state bf_state; 246 struct ath_buf_state bf_state;
@@ -349,7 +348,6 @@ int ath_tx_aggr_start(struct ath_softc *sc, struct ieee80211_sta *sta,
349 u16 tid, u16 *ssn); 348 u16 tid, u16 *ssn);
350void ath_tx_aggr_stop(struct ath_softc *sc, struct ieee80211_sta *sta, u16 tid); 349void ath_tx_aggr_stop(struct ath_softc *sc, struct ieee80211_sta *sta, u16 tid);
351void ath_tx_aggr_resume(struct ath_softc *sc, struct ieee80211_sta *sta, u16 tid); 350void ath_tx_aggr_resume(struct ath_softc *sc, struct ieee80211_sta *sta, u16 tid);
352void ath9k_enable_ps(struct ath_softc *sc);
353 351
354/********/ 352/********/
355/* VIFs */ 353/* VIFs */
@@ -573,8 +571,6 @@ struct ath_ant_comb {
573#define PS_WAIT_FOR_PSPOLL_DATA BIT(2) 571#define PS_WAIT_FOR_PSPOLL_DATA BIT(2)
574#define PS_WAIT_FOR_TX_ACK BIT(3) 572#define PS_WAIT_FOR_TX_ACK BIT(3)
575#define PS_BEACON_SYNC BIT(4) 573#define PS_BEACON_SYNC BIT(4)
576#define PS_NULLFUNC_COMPLETED BIT(5)
577#define PS_ENABLED BIT(6)
578 574
579struct ath_wiphy; 575struct ath_wiphy;
580struct ath_rate_table; 576struct ath_rate_table;
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index d9c2e2d93136..d0694cb685fa 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -1484,7 +1484,7 @@ static void ath9k_remove_interface(struct ieee80211_hw *hw,
1484 mutex_unlock(&sc->mutex); 1484 mutex_unlock(&sc->mutex);
1485} 1485}
1486 1486
1487void ath9k_enable_ps(struct ath_softc *sc) 1487static void ath9k_enable_ps(struct ath_softc *sc)
1488{ 1488{
1489 struct ath_hw *ah = sc->sc_ah; 1489 struct ath_hw *ah = sc->sc_ah;
1490 1490
@@ -1551,20 +1551,10 @@ static int ath9k_config(struct ieee80211_hw *hw, u32 changed)
1551 if (changed & IEEE80211_CONF_CHANGE_PS) { 1551 if (changed & IEEE80211_CONF_CHANGE_PS) {
1552 unsigned long flags; 1552 unsigned long flags;
1553 spin_lock_irqsave(&sc->sc_pm_lock, flags); 1553 spin_lock_irqsave(&sc->sc_pm_lock, flags);
1554 if (conf->flags & IEEE80211_CONF_PS) { 1554 if (conf->flags & IEEE80211_CONF_PS)
1555 sc->ps_flags |= PS_ENABLED; 1555 ath9k_enable_ps(sc);
1556 /* 1556 else {
1557 * At this point we know hardware has received an ACK
1558 * of a previously sent null data frame.
1559 */
1560 if ((sc->ps_flags & PS_NULLFUNC_COMPLETED)) {
1561 sc->ps_flags &= ~PS_NULLFUNC_COMPLETED;
1562 ath9k_enable_ps(sc);
1563 }
1564 } else {
1565 sc->ps_enabled = false; 1557 sc->ps_enabled = false;
1566 sc->ps_flags &= ~(PS_ENABLED |
1567 PS_NULLFUNC_COMPLETED);
1568 ath9k_hw_setpower(sc->sc_ah, ATH9K_PM_AWAKE); 1558 ath9k_hw_setpower(sc->sc_ah, ATH9K_PM_AWAKE);
1569 if (!(ah->caps.hw_caps & 1559 if (!(ah->caps.hw_caps &
1570 ATH9K_HW_CAP_AUTOSLEEP)) { 1560 ATH9K_HW_CAP_AUTOSLEEP)) {
diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c
index f7da6b20a925..aa447770eb2b 100644
--- a/drivers/net/wireless/ath/ath9k/xmit.c
+++ b/drivers/net/wireless/ath/ath9k/xmit.c
@@ -1648,13 +1648,6 @@ static int ath_tx_setup_buffer(struct ieee80211_hw *hw, struct ath_buf *bf,
1648 1648
1649 bf->bf_buf_addr = bf->bf_dmacontext; 1649 bf->bf_buf_addr = bf->bf_dmacontext;
1650 1650
1651 /* tag if this is a nullfunc frame to enable PS when AP acks it */
1652 if (ieee80211_is_nullfunc(fc) && ieee80211_has_pm(fc)) {
1653 bf->bf_isnullfunc = true;
1654 sc->ps_flags &= ~PS_NULLFUNC_COMPLETED;
1655 } else
1656 bf->bf_isnullfunc = false;
1657
1658 bf->bf_tx_aborted = false; 1651 bf->bf_tx_aborted = false;
1659 1652
1660 return 0; 1653 return 0;
@@ -2082,18 +2075,6 @@ static void ath_tx_processq(struct ath_softc *sc, struct ath_txq *txq)
2082 } 2075 }
2083 2076
2084 /* 2077 /*
2085 * We now know the nullfunc frame has been ACKed so we
2086 * can disable RX.
2087 */
2088 if (bf->bf_isnullfunc &&
2089 (ts.ts_status & ATH9K_TX_ACKED)) {
2090 if ((sc->ps_flags & PS_ENABLED))
2091 ath9k_enable_ps(sc);
2092 else
2093 sc->ps_flags |= PS_NULLFUNC_COMPLETED;
2094 }
2095
2096 /*
2097 * Remove ath_buf's of the same transmit unit from txq, 2078 * Remove ath_buf's of the same transmit unit from txq,
2098 * however leave the last descriptor back as the holding 2079 * however leave the last descriptor back as the holding
2099 * descriptor for hw. 2080 * descriptor for hw.
@@ -2236,17 +2217,6 @@ void ath_tx_edma_tasklet(struct ath_softc *sc)
2236 2217
2237 txok = !(txs.ts_status & ATH9K_TXERR_MASK); 2218 txok = !(txs.ts_status & ATH9K_TXERR_MASK);
2238 2219
2239 /*
2240 * Make sure null func frame is acked before configuring
2241 * hw into ps mode.
2242 */
2243 if (bf->bf_isnullfunc && txok) {
2244 if ((sc->ps_flags & PS_ENABLED))
2245 ath9k_enable_ps(sc);
2246 else
2247 sc->ps_flags |= PS_NULLFUNC_COMPLETED;
2248 }
2249
2250 if (!bf_isampdu(bf)) { 2220 if (!bf_isampdu(bf)) {
2251 if (txs.ts_status & ATH9K_TXERR_XRETRY) 2221 if (txs.ts_status & ATH9K_TXERR_XRETRY)
2252 bf->bf_state.bf_type |= BUF_XRETRY; 2222 bf->bf_state.bf_type |= BUF_XRETRY;