Linux wireless drivers development
 help / color / mirror / Atom feed
* [PATCH 1/3] ath9k: Make sure null func frame is acked before going into PS for ar9003
@ 2010-05-18  1:57 Vasanthakumar Thiagarajan
  2010-05-18  1:57 ` [PATCH 2/3] ath9k: Fix power save with auto sleeping Vasanthakumar Thiagarajan
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Vasanthakumar Thiagarajan @ 2010-05-18  1:57 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless

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

Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
---
 drivers/net/wireless/ath/ath9k/xmit.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c
index 3db1917..debb62d 100644
--- a/drivers/net/wireless/ath/ath9k/xmit.c
+++ b/drivers/net/wireless/ath/ath9k/xmit.c
@@ -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)
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/3] ath9k: Fix power save with auto sleeping
  2010-05-18  1:57 [PATCH 1/3] ath9k: Make sure null func frame is acked before going into PS for ar9003 Vasanthakumar Thiagarajan
@ 2010-05-18  1:57 ` Vasanthakumar Thiagarajan
  2010-05-18  1:57 ` [PATCH 3/3] ath9k_hw: Enable auto sleep for ar9003 Vasanthakumar Thiagarajan
  2010-05-22 18:43 ` [PATCH 1/3] ath9k: Make sure null func frame is acked before going into PS " Kalle Valo
  2 siblings, 0 replies; 5+ messages in thread
From: Vasanthakumar Thiagarajan @ 2010-05-18  1:57 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless

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

Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
---
 drivers/net/wireless/ath/ath9k/main.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index 893b552..53e9c8f 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -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)
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 3/3] ath9k_hw: Enable auto sleep for ar9003
  2010-05-18  1:57 [PATCH 1/3] ath9k: Make sure null func frame is acked before going into PS for ar9003 Vasanthakumar Thiagarajan
  2010-05-18  1:57 ` [PATCH 2/3] ath9k: Fix power save with auto sleeping Vasanthakumar Thiagarajan
@ 2010-05-18  1:57 ` Vasanthakumar Thiagarajan
  2010-05-22 18:43 ` [PATCH 1/3] ath9k: Make sure null func frame is acked before going into PS " Kalle Valo
  2 siblings, 0 replies; 5+ messages in thread
From: Vasanthakumar Thiagarajan @ 2010-05-18  1:57 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless

Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
---
 drivers/net/wireless/ath/ath9k/hw.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c
index 1985d19..7997d0f 100644
--- a/drivers/net/wireless/ath/ath9k/hw.c
+++ b/drivers/net/wireless/ath/ath9k/hw.c
@@ -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;
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/3] ath9k: Make sure null func frame is acked before going into PS for ar9003
  2010-05-18  1:57 [PATCH 1/3] ath9k: Make sure null func frame is acked before going into PS for ar9003 Vasanthakumar Thiagarajan
  2010-05-18  1:57 ` [PATCH 2/3] ath9k: Fix power save with auto sleeping Vasanthakumar Thiagarajan
  2010-05-18  1:57 ` [PATCH 3/3] ath9k_hw: Enable auto sleep for ar9003 Vasanthakumar Thiagarajan
@ 2010-05-22 18:43 ` Kalle Valo
  2010-05-23  6:29   ` Vasanthakumar Thiagarajan
  2 siblings, 1 reply; 5+ messages in thread
From: Kalle Valo @ 2010-05-22 18:43 UTC (permalink / raw)
  To: Vasanthakumar Thiagarajan; +Cc: linville, linux-wireless

Vasanthakumar Thiagarajan <vasanth@atheros.com> writes:

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

[...]

> +		/*
> +		 * 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?

-- 
Kalle Valo

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/3] ath9k: Make sure null func frame is acked before going into PS for ar9003
  2010-05-22 18:43 ` [PATCH 1/3] ath9k: Make sure null func frame is acked before going into PS " Kalle Valo
@ 2010-05-23  6:29   ` Vasanthakumar Thiagarajan
  0 siblings, 0 replies; 5+ messages in thread
From: Vasanthakumar Thiagarajan @ 2010-05-23  6:29 UTC (permalink / raw)
  To: Kalle Valo
  Cc: Vasanth Thiagarajan, linville@tuxdriver.com,
	linux-wireless@vger.kernel.org

On Sun, May 23, 2010 at 12:13:54AM +0530, Kalle Valo wrote:
> Vasanthakumar Thiagarajan <vasanth@atheros.com> writes:
> 
> > Add missing code to handle nullfunc frame completion in
> > ath_tx_edma_tasklet().
> 
> [...]
> 
> > +		/*
> > +		 * 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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-05-23  6:29 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-18  1:57 [PATCH 1/3] ath9k: Make sure null func frame is acked before going into PS for ar9003 Vasanthakumar Thiagarajan
2010-05-18  1:57 ` [PATCH 2/3] ath9k: Fix power save with auto sleeping Vasanthakumar Thiagarajan
2010-05-18  1:57 ` [PATCH 3/3] ath9k_hw: Enable auto sleep for ar9003 Vasanthakumar Thiagarajan
2010-05-22 18:43 ` [PATCH 1/3] ath9k: Make sure null func frame is acked before going into PS " Kalle Valo
2010-05-23  6:29   ` Vasanthakumar Thiagarajan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox