Skip to contentSkip to conversation

ath9k: Make sure null func frame is acked before going into PS for ar9003

PATCH In review Vasanthakumar Thiagarajan 2 participants 5 messages May 18, 2010 – May 23, 2010 Qualcomm Atheros ATH9K wireless driver

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 ath9k: Make sure null func frame is acked before going into PS for ar9003

Add missing code to handle nullfunc frame completion in ath_tx_edma_tasklet().

---
 drivers/net/wireless/ath/ath9k/xmit.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)
drivers/net/wireless/ath/ath9k/xmit.c +11 -0
index 3db1917..debb62d 100644
@@ -2277,6 +2277,17 @@ void ath_tx_edma_tasklet(struct ath_softc *sc)
 
 		txok = !(txs.ts_status & ATH9K_TXERR_MASK);
 
+		/*
+		 * Make sure null func frame is acked before configuring
+		 * hw into ps mode.
+		 */
+		if (bf->bf_isnullfunc && txok) {
+			if ((sc->ps_flags & PS_ENABLED))
+				ath9k_enable_ps(sc);
+			else
+				sc->ps_flags |= PS_NULLFUNC_COMPLETED;
+		}
+
 		if (!bf_isampdu(bf)) {
 			bf->bf_retries = txs.ts_longretry;
 			if (txs.ts_status & ATH9K_TXERR_XRETRY)
Signature · 1 line
1.7.0.4
#1 lore raw

PATCH 2/3 ath9k: Fix power save with auto sleeping

Rx should not be disabed/disabled when hw supports auto sleeping.

---
 drivers/net/wireless/ath/ath9k/main.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
drivers/net/wireless/ath/ath9k/main.c +3 -2
index 893b552..53e9c8f 100644
@@ -1296,7 +1296,8 @@ static int ath9k_tx(struct ieee80211_hw *hw,
 		 * completed and if needed, also for RX of buffered frames.
 		 */
 		ath9k_ps_wakeup(sc);
-		ath9k_hw_setrxabort(sc->sc_ah, 0);
+		if (!(sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_AUTOSLEEP))
+			ath9k_hw_setrxabort(sc->sc_ah, 0);
 		if (ieee80211_is_pspoll(hdr->frame_control)) {
 			ath_print(common, ATH_DBG_PS,
 				  "Sending PS-Poll to pick a buffered frame\n");
@@ -1560,8 +1561,8 @@ void ath9k_enable_ps(struct ath_softc *sc)
 			ah->imask |= ATH9K_INT_TIM_TIMER;
 			ath9k_hw_set_interrupts(ah, ah->imask);
 		}
+		ath9k_hw_setrxabort(ah, 1);
 	}
-	ath9k_hw_setrxabort(ah, 1);
 }
 
 static int ath9k_config(struct ieee80211_hw *hw, u32 changed)
Signature · 1 line
1.7.0.4
#2 lore raw

PATCH 3/3 ath9k_hw: Enable auto sleep for ar9003

In reply to Vasanthakumar Thiagarajan
---
 drivers/net/wireless/ath/ath9k/hw.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/net/wireless/ath/ath9k/hw.c +1 -1
index 1985d19..7997d0f 100644
@@ -2165,7 +2165,7 @@ int ath9k_hw_fill_cap_info(struct ath_hw *ah)
 		pCap->hw_caps |= ATH9K_HW_CAP_RFSILENT;
 	}
 #endif
-	if (AR_SREV_9271(ah))
+	if (AR_SREV_9271(ah) || AR_SREV_9300_20_OR_LATER(ah))
 		pCap->hw_caps |= ATH9K_HW_CAP_AUTOSLEEP;
 	else
 		pCap->hw_caps &= ~ATH9K_HW_CAP_AUTOSLEEP;
Signature · 1 line
1.7.0.4
#3 lore raw
In reply to Vasanthakumar Thiagarajan
Quoted 2 lines · Vasanthakumar Thiagarajan

Add missing code to handle nullfunc frame completion in ath_tx_edma_tasklet().

[...]

drivers/net/wireless/ath/ath9k/xmit.c void ath_tx_edma_tasklet(struct ath_softc *sc) · line 2289

Quoted 10 lines
drivers/net/wireless/ath/ath9k/xmit.c +10 -0
+		/*
+		 * Make sure null func frame is acked before configuring
+		 * hw into ps mode.
+		 */
+		if (bf->bf_isnullfunc && txok) {
+			if ((sc->ps_flags & PS_ENABLED))
+				ath9k_enable_ps(sc);
+			else
+				sc->ps_flags |= PS_NULLFUNC_COMPLETED;
+		}

Few months ago a similar test was added to mac80211. Why does ath9k need this also in the driver?

Signature · 1 line
Kalle Valo
#4 lore raw
Quoted 7 lines · Kalle Valo
Quoted 2 lines · Vasanthakumar Thiagarajan

Add missing code to handle nullfunc frame completion in ath_tx_edma_tasklet().

[...]

Quoted 14 lines

drivers/net/wireless/ath/ath9k/xmit.c void ath_tx_edma_tasklet(struct ath_softc *sc) · line 2289

Quoted 10 lines
drivers/net/wireless/ath/ath9k/xmit.c +10 -0
+		/*
+		 * Make sure null func frame is acked before configuring
+		 * hw into ps mode.
+		 */
+		if (bf->bf_isnullfunc && txok) {
+			if ((sc->ps_flags & PS_ENABLED))
+				ath9k_enable_ps(sc);
+			else
+				sc->ps_flags |= PS_NULLFUNC_COMPLETED;
+		}

Few months ago a similar test was added to mac80211. Why does ath9k need this also in the driver?

Right, but this patch is needed unless the logic which checks for completion of null func in driver is cleaned up. I'll do this clean up later. thanks.

Vasanth