Skip to contentSkip to conversation

ath5k: Increase PHY settling parameters for turo mode

PATCH In review Nick Kossifidis 3 participants 4 messages Nov 23, 2010 – Nov 24, 2010 Atheros ATH5K wireless driver

lore
Share & tools
lore

Nick Kossifidis

author maintainer
#0 lore raw

PATCH 12/30 ath5k: Increase PHY settling parameters for turo mode

* On turbo mode increase PHY settling times, note that we only increase switch settling time on AR5212 as indicated by initvals.

* A few cleanups: Move frame control settings for AR5210 from reset_tx_queue to tweak_initvals and remove phy_scal settings from tweak_initvals (we tweak them alread on set_sleep_clock).

---
 drivers/net/wireless/ath/ath5k/ath5k.h |   14 +++++++--
 drivers/net/wireless/ath/ath5k/qcu.c   |   13 --------
 drivers/net/wireless/ath/ath5k/reg.h   |    2 +
 drivers/net/wireless/ath/ath5k/reset.c |   52 ++++++++++++++++++++++++--------
 4 files changed, 52 insertions(+), 29 deletions(-)
drivers/net/wireless/ath/ath5k/ath5k.h +11 -3
index c953544..005cad0 100644
@@ -259,15 +259,23 @@
 #define	AR5K_INIT_TX_LAT_BG			384
 /* Tx latency for 40MHz (turbo) operation (min ?) */
 #define	AR5K_INIT_TX_LAT_MIN			32
+/* Default Tx/Rx latencies (same for 5211)*/
+#define AR5K_INIT_TX_LATENCY_5210		54
+#define	AR5K_INIT_RX_LATENCY_5210		29
 
 /* Tx frame to Tx data start delay */
 #define AR5K_INIT_TXF2TXD_START_DEFAULT		14
 #define AR5K_INIT_TXF2TXD_START_DELAY_10MHZ	12
 #define AR5K_INIT_TXF2TXD_START_DELAY_5MHZ	13
 
-/* Default Tx/Rx latencies (same for 5211)*/
-#define AR5K_INIT_TX_LATENCY_5210		54
-#define	AR5K_INIT_RX_LATENCY_5210		29
+/* We need to increase PHY switch and agc settling time
+ * on turbo mode */
+#define	AR5K_SWITCH_SETTLING			5760
+#define	AR5K_SWITCH_SETTLING_TURBO		7168
+
+#define	AR5K_AGC_SETTLING			28
+/* 38 on 5210 but shouldn't matter */
+#define	AR5K_AGC_SETTLING_TURBO			37
 
 
 /* GENERIC CHIPSET DEFINITIONS */
drivers/net/wireless/ath/ath5k/qcu.c +0 -13
index f89bc94..00c4908 100644
@@ -271,19 +271,6 @@ int ath5k_hw_reset_tx_queue(struct ath5k_hw *ah, unsigned int queue)
 		ath5k_hw_reg_write(ah, (ah->ah_bwmode == AR5K_BWMODE_40MHZ) ?
 			AR5K_INIT_PROTO_TIME_CNTRL_TURBO :
 			AR5K_INIT_PROTO_TIME_CNTRL, AR5K_IFS1);
-		/* Set AR5K_PHY_SETTLING */
-		ath5k_hw_reg_write(ah, (ah->ah_bwmode == AR5K_BWMODE_40MHZ) ?
-			(ath5k_hw_reg_read(ah, AR5K_PHY_SETTLING) & ~0x7F)
-			| 0x38 :
-			(ath5k_hw_reg_read(ah, AR5K_PHY_SETTLING) & ~0x7F)
-			| 0x1C,
-			AR5K_PHY_SETTLING);
-		/* Set Frame Control Register */
-		ath5k_hw_reg_write(ah, (ah->ah_bwmode == AR5K_BWMODE_40MHZ) ?
-			(AR5K_PHY_FRAME_CTL_INI | AR5K_PHY_TURBO_MODE |
-			AR5K_PHY_TURBO_SHORT | 0x2020) :
-			(AR5K_PHY_FRAME_CTL_INI | 0x1020),
-			AR5K_PHY_FRAME_CTL_5210);
 	}
 
 	/*
drivers/net/wireless/ath/ath5k/reg.h +2 -0
index 4d61061..dc213bb 100644
@@ -2245,6 +2245,8 @@
 #define	AR5K_PHY_FRAME_CTL		(ah->ah_version == AR5K_AR5210 ? \
 					AR5K_PHY_FRAME_CTL_5210 : AR5K_PHY_FRAME_CTL_5211)
 /*---[5111+]---*/
+#define	AR5K_PHY_FRAME_CTL_WIN_LEN	0x00000003	/* Force window length (?) */
+#define	AR5K_PHY_FRAME_CTL_WIN_LEN_S	0
 #define	AR5K_PHY_FRAME_CTL_TX_CLIP	0x00000038	/* Mask for tx clip (?) */
 #define	AR5K_PHY_FRAME_CTL_TX_CLIP_S	3
 #define	AR5K_PHY_FRAME_CTL_PREP_CHINFO	0x00010000	/* Prepend chan info */
drivers/net/wireless/ath/ath5k/reset.c +39 -13

64 lines not on this page · raw message

#1 lore raw

On Tue, Nov 23, 2010 at 11:04:43AM -0800, Nick Kossifidis wrote:

Are you willing to deal with *all* bug reports for this?

Luis

author maintainer
#2 lore raw

2010/11/23 Luis R. Rodriguez <[email protected]>:

Quoted 6 lines · Nick Kossifidis

Are you willing to deal with *all* bug reports for this?

 Luis

I don't enable 5/10/40MHz operation anywhere for now, it's just there for testing/debug. I tested it and it seems to work fine (also with a spectrum analyzer) but until we come up with the proper way to set this from user-space I'll wait. Also have in mind I just do what Atheros does on initvals, nothing new, I just diffed initvals/rfbuffer settings between turbo/non-turbo modes, found what's changing and how (i had 5/10MHz code from HAL for that -as i wrote on another mail 5/10/40MHz work mostly the same way-) and implemented it on code. Now it's much cleaner + it actually works so i don't see a problem with that. Before we had code for turbo that didn't work and duplicated arrays of initvals/rfbuffer settings for no reason.

Have in mind that there are people out there that want 5/10MHz support badly to implement 802.11p on top of it (or for research) and people who want to get rid of MadWiFi on OpenWRT and use turbo mode with ath5k. We had to do this sometime, it's not a dirty hack, i think the implementation is clean and simple.

As for bug reports we already have bug reports about cards that fail to wake up that we are unable to debug because we have no idea what's going on, you can't choose what you 'll do based on possible bug reports, bugs are part of the process...

Signature · 3 lines
GPG ID: 0xD21DB2DB
As you read this post global entropy rises. Have Fun ;-)
Nick
#3 lore raw
Quoted 25 lines · On Wed November 24 2010 05:11:57 Nick Kossifidis wrote:

2010/11/23 Luis R. Rodriguez <[email protected]>:

Quoted 5 lines · Nick Kossifidis

Are you willing to deal with *all* bug reports for this?

Luis

I don't enable 5/10/40MHz operation anywhere for now, it's just there for testing/debug. I tested it and it seems to work fine (also with a spectrum analyzer) but until we come up with the proper way to set this from user-space I'll wait. Also have in mind I just do what Atheros does on initvals, nothing new, I just diffed initvals/rfbuffer settings between turbo/non-turbo modes, found what's changing and how (i had 5/10MHz code from HAL for that -as i wrote on another mail 5/10/40MHz work mostly the same way-) and implemented it on code. Now it's much cleaner + it actually works so i don't see a problem with that. Before we had code for turbo that didn't work and duplicated arrays of initvals/rfbuffer settings for no reason.

Have in mind that there are people out there that want 5/10MHz support badly to implement 802.11p on top of it (or for research) and people who want to get rid of MadWiFi on OpenWRT and use turbo mode with ath5k. We had to do this sometime, it's not a dirty hack, i think the implementation is clean and simple.

Quoted 4 lines

As for bug reports we already have bug reports about cards that fail to wake up that we are unable to debug because we have no idea what's going on, you can't choose what you 'll do based on possible bug reports, bugs are part of the process...

Hey Nick!

It's great to see that patch series! Glad you're back...
I'll look at the individual patches later, but it's a lot - as you know ;)

bruno