All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC] ath9k: use correct init values for ar9100 devices
@ 2009-03-03 18:10 ` Gabor Juhos
  0 siblings, 0 replies; 27+ messages in thread
From: Gabor Juhos @ 2009-03-03 18:10 UTC (permalink / raw)
  To: John W. Linville; +Cc: ath9k-devel, linux-wireless, Gabor Juhos, Imre Kaloz

Changes-licensed-under: ISC

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Signed-off-by: Imre Kaloz <kaloz@openwrt.org>
---
 drivers/net/wireless/ath9k/initvals.h |   44 ++++++++++++++++----------------
 drivers/net/wireless/ath9k/reg.h      |   32 ++++++++++++-----------
 2 files changed, 39 insertions(+), 37 deletions(-)
 
Hi,

Currently I'm trying to resolve the following mysterious issues caused by the
ath9k driver on the ar913x based devices:

1. In some cases the ethernet interface goes down for a short time
after'ifconfig wlan0 up'.
2. Sometimes the device simply reboots itself after 'ifconfig wlan0 up'.

After I have added some printk statements into the code, I noticed that the 
ar5416 and ar9100 devices use the same initval arrays currently. I assume 
that they requires different initialization, because we have different 
arrays for them.

Although I have no detailed knowledge about the evolution of the ath9k devices,
but the version checking macros for ther AR5416 cards seemed weird enough, so I
have replaced them. Unfortunately, this leaded to very bad performance with the
ar5416 cards I have, but the driver was working on the ar913x boards.

After some digging, I have found an interesting ifdef statement in Sam's current
HAL. In his ar5416Common initval array, this ifdef conditionally selects the
right RTC register offsets for the ar5416/ar9100 devices. The strange thing,
that in the ath9k driver the ar5416 specific RTC register offsets are used in
the ar5416Common_ar9100 array, while the ar9100 specific offsets are used in the
ar5416Common.

After I have renamed the arrays and tested the ath9k driver with the new
settings on the ar9100 devices, the strange problems I have mentioned above
disappeared. Unfortunately I have no ar5418 devices so I can't test them, 
but they are using the same array as before so this change should not 
cause problems on them.

Regards,
Gabor

diff --git a/drivers/net/wireless/ath9k/initvals.h b/drivers/net/wireless/ath9k/initvals.h
index d492363..4eb8b59 100644
--- a/drivers/net/wireless/ath9k/initvals.h
+++ b/drivers/net/wireless/ath9k/initvals.h
@@ -14,7 +14,7 @@
  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-static const u32 ar5416Modes_9100[][6] = {
+static const u32 ar5416Modes[][6] = {
     { 0x00001030, 0x00000230, 0x00000460, 0x000002c0, 0x00000160, 0x000001e0 },
     { 0x00001070, 0x00000168, 0x000002d0, 0x00000318, 0x0000018c, 0x000001e0 },
     { 0x000010b0, 0x00000e60, 0x00001cc0, 0x00007c70, 0x00003e38, 0x00001180 },
@@ -78,7 +78,7 @@ static const u32 ar5416Modes_9100[][6] = {
     { 0x0000a334, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 },
 };
 
-static const u32 ar5416Common_9100[][2] = {
+static const u32 ar5416Common[][2] = {
     { 0x0000000c, 0x00000000 },
     { 0x00000030, 0x00020015 },
     { 0x00000034, 0x00000005 },
@@ -456,12 +456,12 @@ static const u32 ar5416Common_9100[][2] = {
     { 0x0000a3e0, 0x000001ce },
 };
 
-static const u32 ar5416Bank0_9100[][2] = {
+static const u32 ar5416Bank0[][2] = {
     { 0x000098b0, 0x1e5795e5 },
     { 0x000098e0, 0x02008020 },
 };
 
-static const u32 ar5416BB_RfGain_9100[][3] = {
+static const u32 ar5416BB_RfGain[][3] = {
     { 0x00009a00, 0x00000000, 0x00000000 },
     { 0x00009a04, 0x00000040, 0x00000040 },
     { 0x00009a08, 0x00000080, 0x00000080 },
@@ -528,21 +528,21 @@ static const u32 ar5416BB_RfGain_9100[][3] = {
     { 0x00009afc, 0x000000f9, 0x000000f9 },
 };
 
-static const u32 ar5416Bank1_9100[][2] = {
+static const u32 ar5416Bank1[][2] = {
     { 0x000098b0, 0x02108421 },
     { 0x000098ec, 0x00000008 },
 };
 
-static const u32 ar5416Bank2_9100[][2] = {
+static const u32 ar5416Bank2[][2] = {
     { 0x000098b0, 0x0e73ff17 },
     { 0x000098e0, 0x00000420 },
 };
 
-static const u32 ar5416Bank3_9100[][3] = {
+static const u32 ar5416Bank3[][3] = {
     { 0x000098f0, 0x01400018, 0x01c00018 },
 };
 
-static const u32 ar5416Bank6_9100[][3] = {
+static const u32 ar5416Bank6[][3] = {
 
     { 0x0000989c, 0x00000000, 0x00000000 },
     { 0x0000989c, 0x00000000, 0x00000000 },
@@ -579,7 +579,7 @@ static const u32 ar5416Bank6_9100[][3] = {
     { 0x000098d0, 0x0000000f, 0x0010000f },
 };
 
-static const u32 ar5416Bank6TPC_9100[][3] = {
+static const u32 ar5416Bank6TPC[][3] = {
     { 0x0000989c, 0x00000000, 0x00000000 },
     { 0x0000989c, 0x00000000, 0x00000000 },
     { 0x0000989c, 0x00000000, 0x00000000 },
@@ -615,13 +615,13 @@ static const u32 ar5416Bank6TPC_9100[][3] = {
     { 0x000098d0, 0x0000000f, 0x0010000f },
 };
 
-static const u32 ar5416Bank7_9100[][2] = {
+static const u32 ar5416Bank7[][2] = {
     { 0x0000989c, 0x00000500 },
     { 0x0000989c, 0x00000800 },
     { 0x000098cc, 0x0000000e },
 };
 
-static const u32 ar5416Addac_9100[][2] = {
+static const u32 ar5416Addac[][2] = {
     {0x0000989c,  0x00000000 },
     {0x0000989c,  0x00000003 },
     {0x0000989c,  0x00000000 },
@@ -661,7 +661,7 @@ static const u32 ar5416Addac_9100[][2] = {
     {0x000098cc,  0x00000000 },
 };
 
-static const u32 ar5416Modes[][6] = {
+static const u32 ar5416Modes_9100[][6] = {
     { 0x00001030, 0x00000230, 0x00000460, 0x000002c0, 0x00000160, 0x000001e0 },
     { 0x00001070, 0x00000168, 0x000002d0, 0x00000318, 0x0000018c, 0x000001e0 },
     { 0x000010b0, 0x00000e60, 0x00001cc0, 0x00007c70, 0x00003e38, 0x00001180 },
@@ -735,7 +735,7 @@ static const u32 ar5416Modes[][6] = {
     { 0x0000a334, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 },
 };
 
-static const u32 ar5416Common[][2] = {
+static const u32 ar5416Common_9100[][2] = {
     { 0x0000000c, 0x00000000 },
     { 0x00000030, 0x00020015 },
     { 0x00000034, 0x00000005 },
@@ -1109,12 +1109,12 @@ static const u32 ar5416Common[][2] = {
     { 0x0000a3e0, 0x000001ce },
 };
 
-static const u32 ar5416Bank0[][2] = {
+static const u32 ar5416Bank0_9100[][2] = {
     { 0x000098b0, 0x1e5795e5 },
     { 0x000098e0, 0x02008020 },
 };
 
-static const u32 ar5416BB_RfGain[][3] = {
+static const u32 ar5416BB_RfGain_9100[][3] = {
     { 0x00009a00, 0x00000000, 0x00000000 },
     { 0x00009a04, 0x00000040, 0x00000040 },
     { 0x00009a08, 0x00000080, 0x00000080 },
@@ -1181,21 +1181,21 @@ static const u32 ar5416BB_RfGain[][3] = {
     { 0x00009afc, 0x000000f9, 0x000000f9 },
 };
 
-static const u32 ar5416Bank1[][2] = {
+static const u32 ar5416Bank1_9100[][2] = {
     { 0x000098b0, 0x02108421},
     { 0x000098ec, 0x00000008},
 };
 
-static const u32 ar5416Bank2[][2] = {
+static const u32 ar5416Bank2_9100[][2] = {
     { 0x000098b0, 0x0e73ff17},
     { 0x000098e0, 0x00000420},
 };
 
-static const u32 ar5416Bank3[][3] = {
+static const u32 ar5416Bank3_9100[][3] = {
     { 0x000098f0, 0x01400018, 0x01c00018 },
 };
 
-static const u32 ar5416Bank6[][3] = {
+static const u32 ar5416Bank6_9100[][3] = {
 
     { 0x0000989c, 0x00000000, 0x00000000 },
     { 0x0000989c, 0x00000000, 0x00000000 },
@@ -1233,7 +1233,7 @@ static const u32 ar5416Bank6[][3] = {
 };
 
 
-static const u32 ar5416Bank6TPC[][3] = {
+static const u32 ar5416Bank6TPC_9100[][3] = {
 
     { 0x0000989c, 0x00000000, 0x00000000 },
     { 0x0000989c, 0x00000000, 0x00000000 },
@@ -1270,13 +1270,13 @@ static const u32 ar5416Bank6TPC[][3] = {
     { 0x000098d0, 0x0000000f, 0x0010000f },
 };
 
-static const u32 ar5416Bank7[][2] = {
+static const u32 ar5416Bank7_9100[][2] = {
     { 0x0000989c, 0x00000500 },
     { 0x0000989c, 0x00000800 },
     { 0x000098cc, 0x0000000e },
 };
 
-static const u32 ar5416Addac[][2] = {
+static const u32 ar5416Addac_9100[][2] = {
     {0x0000989c, 0x00000000 },
     {0x0000989c, 0x00000000 },
     {0x0000989c, 0x00000000 },
diff --git a/drivers/net/wireless/ath9k/reg.h b/drivers/net/wireless/ath9k/reg.h
index 8d85106..22a14a4 100644
--- a/drivers/net/wireless/ath9k/reg.h
+++ b/drivers/net/wireless/ath9k/reg.h
@@ -158,14 +158,6 @@
 #define AR_CST_TIMEOUT_LIMIT      0xFFFF0000
 #define AR_CST_TIMEOUT_LIMIT_S    16
 
-#define AR_SREV_VERSION_9100                  0x014
-
-#define AR_SREV_9100(ah) ((ah->hw_version.macVersion) == AR_SREV_VERSION_9100)
-#define AR_SREV_5416_V20_OR_LATER(_ah) \
-	(AR_SREV_9100((_ah)) || AR_SREV_5416_20_OR_LATER(_ah))
-#define AR_SREV_5416_V22_OR_LATER(_ah) \
-	(AR_SREV_9100((_ah)) || AR_SREV_5416_22_OR_LATER(_ah))
-
 #define AR_ISR               0x0080
 #define AR_ISR_RXOK          0x00000001
 #define AR_ISR_RXDESC        0x00000002
@@ -734,6 +726,7 @@
 #define AR_SREV_REVISION_5416_10               0
 #define AR_SREV_REVISION_5416_20               1
 #define AR_SREV_REVISION_5416_22               2
+#define AR_SREV_VERSION_9100                  0x14
 #define AR_SREV_VERSION_9160        	      0x40
 #define AR_SREV_REVISION_9160_10    	      0
 #define AR_SREV_REVISION_9160_11    	      1
@@ -746,14 +739,23 @@
 #define AR_SREV_REVISION_9285_11              1
 #define AR_SREV_REVISION_9285_12              2
 
+#define AR_SREV_5416(_ah) \
+	(((_ah)->hw_version.macVersion == AR_SREV_VERSION_5416_PCIE) || \
+	((_ah)->hw_version.macVersion == AR_SREV_VERSION_5416_PCI))
+#define AR_SREV_5416_V20_OR_LATER(_ah) \
+	(((_ah)->hw_version.macVersion > AR_SREV_VERSION_5416_PCIE) || \
+	((AR_SREV_5416(_ah)) && \
+	((_ah)->hw_version.macRev >= AR_SREV_REVISION_5416_20)))
+#define AR_SREV_5416_V22_OR_LATER(_ah) \
+	(((_ah)->hw_version.macVersion > AR_SREV_VERSION_5416_PCIE) || \
+	((AR_SREV_5416(_ah)) && \
+	((_ah)->hw_version.macRev >= AR_SREV_REVISION_5416_22)))
+
+#define AR_SREV_9100(ah) \
+	((ah->hw_version.macVersion) == AR_SREV_VERSION_9100)
 #define AR_SREV_9100_OR_LATER(_ah) \
-	(((_ah)->hw_version.macVersion >= AR_SREV_VERSION_5416_PCIE))
-#define AR_SREV_5416_20_OR_LATER(_ah) \
-	(((_ah)->hw_version.macVersion >= AR_SREV_VERSION_9160) || \
-		((_ah)->hw_version.macRev >= AR_SREV_REVISION_5416_20))
-#define AR_SREV_5416_22_OR_LATER(_ah) \
-	(((_ah)->hw_version.macVersion >= AR_SREV_VERSION_9160) || \
-		((_ah)->hw_version.macRev >= AR_SREV_REVISION_5416_22))
+	((_ah)->hw_version.macVersion >= AR_SREV_VERSION_9100)
+
 #define AR_SREV_9160(_ah) \
 	(((_ah)->hw_version.macVersion == AR_SREV_VERSION_9160))
 #define AR_SREV_9160_10_OR_LATER(_ah) \
-- 
1.5.3.2


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

* [ath9k-devel] [RFC] ath9k: use correct init values for ar9100 devices
@ 2009-03-03 18:10 ` Gabor Juhos
  0 siblings, 0 replies; 27+ messages in thread
From: Gabor Juhos @ 2009-03-03 18:10 UTC (permalink / raw)
  To: ath9k-devel

Changes-licensed-under: ISC

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Signed-off-by: Imre Kaloz <kaloz@openwrt.org>
---
 drivers/net/wireless/ath9k/initvals.h |   44 ++++++++++++++++----------------
 drivers/net/wireless/ath9k/reg.h      |   32 ++++++++++++-----------
 2 files changed, 39 insertions(+), 37 deletions(-)
 
Hi,

Currently I'm trying to resolve the following mysterious issues caused by the
ath9k driver on the ar913x based devices:

1. In some cases the ethernet interface goes down for a short time
after'ifconfig wlan0 up'.
2. Sometimes the device simply reboots itself after 'ifconfig wlan0 up'.

After I have added some printk statements into the code, I noticed that the 
ar5416 and ar9100 devices use the same initval arrays currently. I assume 
that they requires different initialization, because we have different 
arrays for them.

Although I have no detailed knowledge about the evolution of the ath9k devices,
but the version checking macros for ther AR5416 cards seemed weird enough, so I
have replaced them. Unfortunately, this leaded to very bad performance with the
ar5416 cards I have, but the driver was working on the ar913x boards.

After some digging, I have found an interesting ifdef statement in Sam's current
HAL. In his ar5416Common initval array, this ifdef conditionally selects the
right RTC register offsets for the ar5416/ar9100 devices. The strange thing,
that in the ath9k driver the ar5416 specific RTC register offsets are used in
the ar5416Common_ar9100 array, while the ar9100 specific offsets are used in the
ar5416Common.

After I have renamed the arrays and tested the ath9k driver with the new
settings on the ar9100 devices, the strange problems I have mentioned above
disappeared. Unfortunately I have no ar5418 devices so I can't test them, 
but they are using the same array as before so this change should not 
cause problems on them.

Regards,
Gabor

diff --git a/drivers/net/wireless/ath9k/initvals.h b/drivers/net/wireless/ath9k/initvals.h
index d492363..4eb8b59 100644
--- a/drivers/net/wireless/ath9k/initvals.h
+++ b/drivers/net/wireless/ath9k/initvals.h
@@ -14,7 +14,7 @@
  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-static const u32 ar5416Modes_9100[][6] = {
+static const u32 ar5416Modes[][6] = {
     { 0x00001030, 0x00000230, 0x00000460, 0x000002c0, 0x00000160, 0x000001e0 },
     { 0x00001070, 0x00000168, 0x000002d0, 0x00000318, 0x0000018c, 0x000001e0 },
     { 0x000010b0, 0x00000e60, 0x00001cc0, 0x00007c70, 0x00003e38, 0x00001180 },
@@ -78,7 +78,7 @@ static const u32 ar5416Modes_9100[][6] = {
     { 0x0000a334, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 },
 };
 
-static const u32 ar5416Common_9100[][2] = {
+static const u32 ar5416Common[][2] = {
     { 0x0000000c, 0x00000000 },
     { 0x00000030, 0x00020015 },
     { 0x00000034, 0x00000005 },
@@ -456,12 +456,12 @@ static const u32 ar5416Common_9100[][2] = {
     { 0x0000a3e0, 0x000001ce },
 };
 
-static const u32 ar5416Bank0_9100[][2] = {
+static const u32 ar5416Bank0[][2] = {
     { 0x000098b0, 0x1e5795e5 },
     { 0x000098e0, 0x02008020 },
 };
 
-static const u32 ar5416BB_RfGain_9100[][3] = {
+static const u32 ar5416BB_RfGain[][3] = {
     { 0x00009a00, 0x00000000, 0x00000000 },
     { 0x00009a04, 0x00000040, 0x00000040 },
     { 0x00009a08, 0x00000080, 0x00000080 },
@@ -528,21 +528,21 @@ static const u32 ar5416BB_RfGain_9100[][3] = {
     { 0x00009afc, 0x000000f9, 0x000000f9 },
 };
 
-static const u32 ar5416Bank1_9100[][2] = {
+static const u32 ar5416Bank1[][2] = {
     { 0x000098b0, 0x02108421 },
     { 0x000098ec, 0x00000008 },
 };
 
-static const u32 ar5416Bank2_9100[][2] = {
+static const u32 ar5416Bank2[][2] = {
     { 0x000098b0, 0x0e73ff17 },
     { 0x000098e0, 0x00000420 },
 };
 
-static const u32 ar5416Bank3_9100[][3] = {
+static const u32 ar5416Bank3[][3] = {
     { 0x000098f0, 0x01400018, 0x01c00018 },
 };
 
-static const u32 ar5416Bank6_9100[][3] = {
+static const u32 ar5416Bank6[][3] = {
 
     { 0x0000989c, 0x00000000, 0x00000000 },
     { 0x0000989c, 0x00000000, 0x00000000 },
@@ -579,7 +579,7 @@ static const u32 ar5416Bank6_9100[][3] = {
     { 0x000098d0, 0x0000000f, 0x0010000f },
 };
 
-static const u32 ar5416Bank6TPC_9100[][3] = {
+static const u32 ar5416Bank6TPC[][3] = {
     { 0x0000989c, 0x00000000, 0x00000000 },
     { 0x0000989c, 0x00000000, 0x00000000 },
     { 0x0000989c, 0x00000000, 0x00000000 },
@@ -615,13 +615,13 @@ static const u32 ar5416Bank6TPC_9100[][3] = {
     { 0x000098d0, 0x0000000f, 0x0010000f },
 };
 
-static const u32 ar5416Bank7_9100[][2] = {
+static const u32 ar5416Bank7[][2] = {
     { 0x0000989c, 0x00000500 },
     { 0x0000989c, 0x00000800 },
     { 0x000098cc, 0x0000000e },
 };
 
-static const u32 ar5416Addac_9100[][2] = {
+static const u32 ar5416Addac[][2] = {
     {0x0000989c,  0x00000000 },
     {0x0000989c,  0x00000003 },
     {0x0000989c,  0x00000000 },
@@ -661,7 +661,7 @@ static const u32 ar5416Addac_9100[][2] = {
     {0x000098cc,  0x00000000 },
 };
 
-static const u32 ar5416Modes[][6] = {
+static const u32 ar5416Modes_9100[][6] = {
     { 0x00001030, 0x00000230, 0x00000460, 0x000002c0, 0x00000160, 0x000001e0 },
     { 0x00001070, 0x00000168, 0x000002d0, 0x00000318, 0x0000018c, 0x000001e0 },
     { 0x000010b0, 0x00000e60, 0x00001cc0, 0x00007c70, 0x00003e38, 0x00001180 },
@@ -735,7 +735,7 @@ static const u32 ar5416Modes[][6] = {
     { 0x0000a334, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 },
 };
 
-static const u32 ar5416Common[][2] = {
+static const u32 ar5416Common_9100[][2] = {
     { 0x0000000c, 0x00000000 },
     { 0x00000030, 0x00020015 },
     { 0x00000034, 0x00000005 },
@@ -1109,12 +1109,12 @@ static const u32 ar5416Common[][2] = {
     { 0x0000a3e0, 0x000001ce },
 };
 
-static const u32 ar5416Bank0[][2] = {
+static const u32 ar5416Bank0_9100[][2] = {
     { 0x000098b0, 0x1e5795e5 },
     { 0x000098e0, 0x02008020 },
 };
 
-static const u32 ar5416BB_RfGain[][3] = {
+static const u32 ar5416BB_RfGain_9100[][3] = {
     { 0x00009a00, 0x00000000, 0x00000000 },
     { 0x00009a04, 0x00000040, 0x00000040 },
     { 0x00009a08, 0x00000080, 0x00000080 },
@@ -1181,21 +1181,21 @@ static const u32 ar5416BB_RfGain[][3] = {
     { 0x00009afc, 0x000000f9, 0x000000f9 },
 };
 
-static const u32 ar5416Bank1[][2] = {
+static const u32 ar5416Bank1_9100[][2] = {
     { 0x000098b0, 0x02108421},
     { 0x000098ec, 0x00000008},
 };
 
-static const u32 ar5416Bank2[][2] = {
+static const u32 ar5416Bank2_9100[][2] = {
     { 0x000098b0, 0x0e73ff17},
     { 0x000098e0, 0x00000420},
 };
 
-static const u32 ar5416Bank3[][3] = {
+static const u32 ar5416Bank3_9100[][3] = {
     { 0x000098f0, 0x01400018, 0x01c00018 },
 };
 
-static const u32 ar5416Bank6[][3] = {
+static const u32 ar5416Bank6_9100[][3] = {
 
     { 0x0000989c, 0x00000000, 0x00000000 },
     { 0x0000989c, 0x00000000, 0x00000000 },
@@ -1233,7 +1233,7 @@ static const u32 ar5416Bank6[][3] = {
 };
 
 
-static const u32 ar5416Bank6TPC[][3] = {
+static const u32 ar5416Bank6TPC_9100[][3] = {
 
     { 0x0000989c, 0x00000000, 0x00000000 },
     { 0x0000989c, 0x00000000, 0x00000000 },
@@ -1270,13 +1270,13 @@ static const u32 ar5416Bank6TPC[][3] = {
     { 0x000098d0, 0x0000000f, 0x0010000f },
 };
 
-static const u32 ar5416Bank7[][2] = {
+static const u32 ar5416Bank7_9100[][2] = {
     { 0x0000989c, 0x00000500 },
     { 0x0000989c, 0x00000800 },
     { 0x000098cc, 0x0000000e },
 };
 
-static const u32 ar5416Addac[][2] = {
+static const u32 ar5416Addac_9100[][2] = {
     {0x0000989c, 0x00000000 },
     {0x0000989c, 0x00000000 },
     {0x0000989c, 0x00000000 },
diff --git a/drivers/net/wireless/ath9k/reg.h b/drivers/net/wireless/ath9k/reg.h
index 8d85106..22a14a4 100644
--- a/drivers/net/wireless/ath9k/reg.h
+++ b/drivers/net/wireless/ath9k/reg.h
@@ -158,14 +158,6 @@
 #define AR_CST_TIMEOUT_LIMIT      0xFFFF0000
 #define AR_CST_TIMEOUT_LIMIT_S    16
 
-#define AR_SREV_VERSION_9100                  0x014
-
-#define AR_SREV_9100(ah) ((ah->hw_version.macVersion) == AR_SREV_VERSION_9100)
-#define AR_SREV_5416_V20_OR_LATER(_ah) \
-	(AR_SREV_9100((_ah)) || AR_SREV_5416_20_OR_LATER(_ah))
-#define AR_SREV_5416_V22_OR_LATER(_ah) \
-	(AR_SREV_9100((_ah)) || AR_SREV_5416_22_OR_LATER(_ah))
-
 #define AR_ISR               0x0080
 #define AR_ISR_RXOK          0x00000001
 #define AR_ISR_RXDESC        0x00000002
@@ -734,6 +726,7 @@
 #define AR_SREV_REVISION_5416_10               0
 #define AR_SREV_REVISION_5416_20               1
 #define AR_SREV_REVISION_5416_22               2
+#define AR_SREV_VERSION_9100                  0x14
 #define AR_SREV_VERSION_9160        	      0x40
 #define AR_SREV_REVISION_9160_10    	      0
 #define AR_SREV_REVISION_9160_11    	      1
@@ -746,14 +739,23 @@
 #define AR_SREV_REVISION_9285_11              1
 #define AR_SREV_REVISION_9285_12              2
 
+#define AR_SREV_5416(_ah) \
+	(((_ah)->hw_version.macVersion == AR_SREV_VERSION_5416_PCIE) || \
+	((_ah)->hw_version.macVersion == AR_SREV_VERSION_5416_PCI))
+#define AR_SREV_5416_V20_OR_LATER(_ah) \
+	(((_ah)->hw_version.macVersion > AR_SREV_VERSION_5416_PCIE) || \
+	((AR_SREV_5416(_ah)) && \
+	((_ah)->hw_version.macRev >= AR_SREV_REVISION_5416_20)))
+#define AR_SREV_5416_V22_OR_LATER(_ah) \
+	(((_ah)->hw_version.macVersion > AR_SREV_VERSION_5416_PCIE) || \
+	((AR_SREV_5416(_ah)) && \
+	((_ah)->hw_version.macRev >= AR_SREV_REVISION_5416_22)))
+
+#define AR_SREV_9100(ah) \
+	((ah->hw_version.macVersion) == AR_SREV_VERSION_9100)
 #define AR_SREV_9100_OR_LATER(_ah) \
-	(((_ah)->hw_version.macVersion >= AR_SREV_VERSION_5416_PCIE))
-#define AR_SREV_5416_20_OR_LATER(_ah) \
-	(((_ah)->hw_version.macVersion >= AR_SREV_VERSION_9160) || \
-		((_ah)->hw_version.macRev >= AR_SREV_REVISION_5416_20))
-#define AR_SREV_5416_22_OR_LATER(_ah) \
-	(((_ah)->hw_version.macVersion >= AR_SREV_VERSION_9160) || \
-		((_ah)->hw_version.macRev >= AR_SREV_REVISION_5416_22))
+	((_ah)->hw_version.macVersion >= AR_SREV_VERSION_9100)
+
 #define AR_SREV_9160(_ah) \
 	(((_ah)->hw_version.macVersion == AR_SREV_VERSION_9160))
 #define AR_SREV_9160_10_OR_LATER(_ah) \
-- 
1.5.3.2

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

* [RFC] ath9k: use correct init values for ar9100 devices
  2009-03-03 18:10 ` [ath9k-devel] " Gabor Juhos
@ 2009-03-04  4:30   ` Sujith
  -1 siblings, 0 replies; 27+ messages in thread
From: Sujith @ 2009-03-04  4:30 UTC (permalink / raw)
  To: Gabor Juhos; +Cc: John W. Linville, ath9k-devel, linux-wireless, Imre Kaloz

Gabor Juhos wrote:
> 1. In some cases the ethernet interface goes down for a short time
> after'ifconfig wlan0 up'.
> 2. Sometimes the device simply reboots itself after 'ifconfig wlan0 up'.
> 
> After I have added some printk statements into the code, I noticed that the
> ar5416 and ar9100 devices use the same initval arrays currently. I assume
> that they requires different initialization, because we have different
> arrays for them.
> 

Yep, this is a bug, and AR_SREV_9100_OR_LATER is probably wrong.

> Although I have no detailed knowledge about the evolution of the ath9k devices,
> but the version checking macros for ther AR5416 cards seemed weird enough, so I
> have replaced them. Unfortunately, this leaded to very bad performance with the
> ar5416 cards I have, but the driver was working on the ar913x boards.
> 
> After some digging, I have found an interesting ifdef statement in Sam's current
> HAL. In his ar5416Common initval array, this ifdef conditionally selects the
> right RTC register offsets for the ar5416/ar9100 devices. The strange thing,
> that in the ath9k driver the ar5416 specific RTC register offsets are used in
> the ar5416Common_ar9100 array, while the ar9100 specific offsets are used in the
> ar5416Common.
> 

I'll check the initval arrays and update.

> +#define AR_SREV_5416(_ah) \
> +       (((_ah)->hw_version.macVersion == AR_SREV_VERSION_5416_PCIE) || \
> +       ((_ah)->hw_version.macVersion == AR_SREV_VERSION_5416_PCI))
> +#define AR_SREV_5416_V20_OR_LATER(_ah) \
> +       (((_ah)->hw_version.macVersion > AR_SREV_VERSION_5416_PCIE) || \
> +       ((AR_SREV_5416(_ah)) && \
> +       ((_ah)->hw_version.macRev >= AR_SREV_REVISION_5416_20)))
> +#define AR_SREV_5416_V22_OR_LATER(_ah) \
> +       (((_ah)->hw_version.macVersion > AR_SREV_VERSION_5416_PCIE) || \
> +       ((AR_SREV_5416(_ah)) && \
> +       ((_ah)->hw_version.macRev >= AR_SREV_REVISION_5416_22)))
> +

Hm, the 5416_V1, 5416_V2 macros have to check 3 different HW (5416, 9100, 9160).

> +#define AR_SREV_9100(ah) \
> +       ((ah->hw_version.macVersion) == AR_SREV_VERSION_9100)
>  #define AR_SREV_9100_OR_LATER(_ah) \
> -       (((_ah)->hw_version.macVersion >= AR_SREV_VERSION_5416_PCIE))
> -#define AR_SREV_5416_20_OR_LATER(_ah) \
> -       (((_ah)->hw_version.macVersion >= AR_SREV_VERSION_9160) || \
> -               ((_ah)->hw_version.macRev >= AR_SREV_REVISION_5416_20))
> -#define AR_SREV_5416_22_OR_LATER(_ah) \
> -       (((_ah)->hw_version.macVersion >= AR_SREV_VERSION_9160) || \
> -               ((_ah)->hw_version.macRev >= AR_SREV_REVISION_5416_22))
> +       ((_ah)->hw_version.macVersion >= AR_SREV_VERSION_9100)
> +
>  #define AR_SREV_9160(_ah) \
>         (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9160))
>  #define AR_SREV_9160_10_OR_LATER(_ah) \
> --
> 1.5.3.2
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [ath9k-devel] [RFC] ath9k: use correct init values for ar9100 devices
@ 2009-03-04  4:30   ` Sujith
  0 siblings, 0 replies; 27+ messages in thread
From: Sujith @ 2009-03-04  4:30 UTC (permalink / raw)
  To: ath9k-devel

Gabor Juhos wrote:
> 1. In some cases the ethernet interface goes down for a short time
> after'ifconfig wlan0 up'.
> 2. Sometimes the device simply reboots itself after 'ifconfig wlan0 up'.
> 
> After I have added some printk statements into the code, I noticed that the
> ar5416 and ar9100 devices use the same initval arrays currently. I assume
> that they requires different initialization, because we have different
> arrays for them.
> 

Yep, this is a bug, and AR_SREV_9100_OR_LATER is probably wrong.

> Although I have no detailed knowledge about the evolution of the ath9k devices,
> but the version checking macros for ther AR5416 cards seemed weird enough, so I
> have replaced them. Unfortunately, this leaded to very bad performance with the
> ar5416 cards I have, but the driver was working on the ar913x boards.
> 
> After some digging, I have found an interesting ifdef statement in Sam's current
> HAL. In his ar5416Common initval array, this ifdef conditionally selects the
> right RTC register offsets for the ar5416/ar9100 devices. The strange thing,
> that in the ath9k driver the ar5416 specific RTC register offsets are used in
> the ar5416Common_ar9100 array, while the ar9100 specific offsets are used in the
> ar5416Common.
> 

I'll check the initval arrays and update.

> +#define AR_SREV_5416(_ah) \
> +       (((_ah)->hw_version.macVersion == AR_SREV_VERSION_5416_PCIE) || \
> +       ((_ah)->hw_version.macVersion == AR_SREV_VERSION_5416_PCI))
> +#define AR_SREV_5416_V20_OR_LATER(_ah) \
> +       (((_ah)->hw_version.macVersion > AR_SREV_VERSION_5416_PCIE) || \
> +       ((AR_SREV_5416(_ah)) && \
> +       ((_ah)->hw_version.macRev >= AR_SREV_REVISION_5416_20)))
> +#define AR_SREV_5416_V22_OR_LATER(_ah) \
> +       (((_ah)->hw_version.macVersion > AR_SREV_VERSION_5416_PCIE) || \
> +       ((AR_SREV_5416(_ah)) && \
> +       ((_ah)->hw_version.macRev >= AR_SREV_REVISION_5416_22)))
> +

Hm, the 5416_V1, 5416_V2 macros have to check 3 different HW (5416, 9100, 9160).

> +#define AR_SREV_9100(ah) \
> +       ((ah->hw_version.macVersion) == AR_SREV_VERSION_9100)
>  #define AR_SREV_9100_OR_LATER(_ah) \
> -       (((_ah)->hw_version.macVersion >= AR_SREV_VERSION_5416_PCIE))
> -#define AR_SREV_5416_20_OR_LATER(_ah) \
> -       (((_ah)->hw_version.macVersion >= AR_SREV_VERSION_9160) || \
> -               ((_ah)->hw_version.macRev >= AR_SREV_REVISION_5416_20))
> -#define AR_SREV_5416_22_OR_LATER(_ah) \
> -       (((_ah)->hw_version.macVersion >= AR_SREV_VERSION_9160) || \
> -               ((_ah)->hw_version.macRev >= AR_SREV_REVISION_5416_22))
> +       ((_ah)->hw_version.macVersion >= AR_SREV_VERSION_9100)
> +
>  #define AR_SREV_9160(_ah) \
>         (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9160))
>  #define AR_SREV_9160_10_OR_LATER(_ah) \
> --
> 1.5.3.2
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [RFC] ath9k: use correct init values for ar9100 devices
  2009-03-04  4:30   ` [ath9k-devel] " Sujith
@ 2009-03-04  5:35     ` Sujith
  -1 siblings, 0 replies; 27+ messages in thread
From: Sujith @ 2009-03-04  5:35 UTC (permalink / raw)
  To: Gabor Juhos; +Cc: John W. Linville, ath9k-devel, linux-wireless, Imre Kaloz

Sujith Manoharan wrote:
> I'll check the initval arrays and update.
> 

Does this patch help ? I haven't tested on 9100, but 5416 works fine.

diff --git a/drivers/net/wireless/ath9k/hw.c b/drivers/net/wireless/ath9k/hw.c
index eb750a5..d7b3c44 100644
--- a/drivers/net/wireless/ath9k/hw.c
+++ b/drivers/net/wireless/ath9k/hw.c
@@ -760,7 +760,7 @@ static struct ath_hw *ath9k_hw_do_attach(u16 devid, struct ath_softc *sc,
 			INIT_INI_ARRAY(&ah->iniAddac, ar5416Addac_9160,
 				       ARRAY_SIZE(ar5416Addac_9160), 2);
 		}
-	} else if (AR_SREV_9100_OR_LATER(ah)) {
+	} else if (AR_SREV_9100(ah)) {
 		INIT_INI_ARRAY(&ah->iniModes, ar5416Modes_9100,
 			       ARRAY_SIZE(ar5416Modes_9100), 6);
 		INIT_INI_ARRAY(&ah->iniCommon, ar5416Common_9100,
diff --git a/drivers/net/wireless/ath9k/initvals.h b/drivers/net/wireless/ath9k/initvals.h
index d492363..0b579b4 100644
--- a/drivers/net/wireless/ath9k/initvals.h
+++ b/drivers/net/wireless/ath9k/initvals.h
@@ -27,38 +27,48 @@ static const u32 ar5416Modes_9100[][6] = {
     { 0x00009828, 0x0a020001, 0x0a020001, 0x0a020001, 0x0a020001, 0x0a020001 },
     { 0x00009834, 0x00000e0e, 0x00000e0e, 0x00000e0e, 0x00000e0e, 0x00000e0e },
     { 0x00009838, 0x00000007, 0x00000007, 0x00000007, 0x00000007, 0x00000007 },
-    { 0x00009844, 0x1372161e, 0x1372161e, 0x137216a0, 0x137216a0, 0x137216a0 },
+    { 0x00009844, 0x0372161e, 0x0372161e, 0x037216a0, 0x037216a0, 0x037216a0 },
     { 0x00009848, 0x001a6a65, 0x001a6a65, 0x00197a68, 0x00197a68, 0x00197a68 },
     { 0x0000a848, 0x001a6a65, 0x001a6a65, 0x00197a68, 0x00197a68, 0x00197a68 },
     { 0x0000b848, 0x001a6a65, 0x001a6a65, 0x00197a68, 0x00197a68, 0x00197a68 },
-    { 0x00009850, 0x6c48b4e0, 0x6c48b4e0, 0x6c48b0de, 0x6c48b0de, 0x6c48b0de },
-    { 0x00009858, 0x7ec82d2e, 0x7ec82d2e, 0x7ec82d2e, 0x7ec82d2e, 0x7ec82d2e },
-    { 0x0000985c, 0x31395d5e, 0x31395d5e, 0x31395d5e, 0x31395d5e, 0x31395d5e },
-    { 0x00009860, 0x00049d18, 0x00049d18, 0x00049d18, 0x00049d18, 0x00049d18 },
+    { 0x00009850, 0x6d48b4e2, 0x6d48b4e2, 0x6d48b0e2, 0x6d48b0e2, 0x6d48b0e2 },
+    { 0x00009858, 0x7ec82d2e, 0x7ec82d2e, 0x7ec86d2e, 0x7ec84d2e, 0x7ec82d2e },
+    { 0x0000985c, 0x3139605e, 0x3139605e, 0x3139605e, 0x3139605e, 0x3139605e },
+    { 0x00009860, 0x00048d18, 0x00048d18, 0x00048d20, 0x00048d20, 0x00048d18 },
     { 0x0000c864, 0x0001ce00, 0x0001ce00, 0x0001ce00, 0x0001ce00, 0x0001ce00 },
-    { 0x00009868, 0x409a4190, 0x409a4190, 0x409a4190, 0x409a4190, 0x409a4190 },
+    { 0x00009868, 0x409a40d0, 0x409a40d0, 0x409a40d0, 0x409a40d0, 0x409a40d0 },
     { 0x0000986c, 0x050cb081, 0x050cb081, 0x050cb081, 0x050cb081, 0x050cb081 },
-    { 0x00009914, 0x000007d0, 0x00000fa0, 0x00001130, 0x00000898, 0x000007d0 },
-    { 0x00009918, 0x000001b8, 0x00000370, 0x00000268, 0x00000134, 0x00000134 },
-    { 0x00009924, 0xd0058a0b, 0xd0058a0b, 0xd0058a0b, 0xd0058a0b, 0xd0058a0b },
-    { 0x00009944, 0xffb81020, 0xffb81020, 0xffb81020, 0xffb81020, 0xffb81020 },
-    { 0x00009960, 0x00000900, 0x00000900, 0x00012d80, 0x00012d80, 0x00012d80 },
-    { 0x0000a960, 0x00000900, 0x00000900, 0x00012d80, 0x00012d80, 0x00012d80 },
-    { 0x0000b960, 0x00000900, 0x00000900, 0x00012d80, 0x00012d80, 0x00012d80 },
-    { 0x00009964, 0x00000000, 0x00000000, 0x00001120, 0x00001120, 0x00001120 },
-    { 0x0000c9bc, 0x001a0a00, 0x001a0a00, 0x001a0a00, 0x001a0a00, 0x001a0a00 },
+    { 0x00009914, 0x000007d0, 0x000007d0, 0x00000898, 0x00000898, 0x000007d0 },
+    { 0x00009918, 0x0000000a, 0x00000014, 0x00000016, 0x0000000b, 0x00000016 },
+    { 0x00009924, 0xd00a8a07, 0xd00a8a07, 0xd00a8a11, 0xd00a8a0d, 0xd00a8a0d },
+    { 0x00009940, 0x00754604, 0x00754604, 0xfff81204, 0xfff81204, 0xfff81204 },
+    { 0x00009944, 0xdfb81020, 0xdfb81020, 0xdfb81020, 0xdfb81020, 0xdfb81020 },
+    { 0x00009954, 0x5f3ca3de, 0x5f3ca3de, 0xe250a51e, 0xe250a51e, 0xe250a51e },
+    { 0x00009958, 0x2108ecff, 0x2108ecff, 0x3388ffff, 0x3388ffff, 0x3388ffff },
+#ifdef TB243
+    { 0x00009960, 0x00000900, 0x00000900, 0x00009b40, 0x00009b40, 0x00012d80 },
+    { 0x0000a960, 0x00000900, 0x00000900, 0x00009b40, 0x00009b40, 0x00012d80 },
+    { 0x0000b960, 0x00000900, 0x00000900, 0x00009b40, 0x00009b40, 0x00012d80 },
+    { 0x00009964, 0x00000000, 0x00000000, 0x00002210, 0x00002210, 0x00001120 },
+#else
+    { 0x00009960, 0x0001bfc0, 0x0001bfc0, 0x0001bfc0, 0x0001bfc0, 0x0001bfc0 },
+    { 0x0000a960, 0x0001bfc0, 0x0001bfc0, 0x0001bfc0, 0x0001bfc0, 0x0001bfc0 },
+    { 0x0000b960, 0x0001bfc0, 0x0001bfc0, 0x0001bfc0, 0x0001bfc0, 0x0001bfc0 },
+    { 0x00009964, 0x00001120, 0x00001120, 0x00001120, 0x00001120, 0x00001120 },
+#endif
+    { 0x0000c9bc, 0x001a0600, 0x001a0600, 0x001a1000, 0x001a0c00, 0x001a0c00 },
     { 0x000099c0, 0x038919be, 0x038919be, 0x038919be, 0x038919be, 0x038919be },
     { 0x000099c4, 0x06336f77, 0x06336f77, 0x06336f77, 0x06336f77, 0x06336f77 },
-    { 0x000099c8, 0x60f6532c, 0x60f6532c, 0x60f6532c, 0x60f6532c, 0x60f6532c },
+    { 0x000099c8, 0x60f65329, 0x60f65329, 0x60f65329, 0x60f65329, 0x60f65329 },
     { 0x000099cc, 0x08f186c8, 0x08f186c8, 0x08f186c8, 0x08f186c8, 0x08f186c8 },
     { 0x000099d0, 0x00046384, 0x00046384, 0x00046384, 0x00046384, 0x00046384 },
     { 0x000099d4, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 },
     { 0x000099d8, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 },
     { 0x0000a204, 0x00000880, 0x00000880, 0x00000880, 0x00000880, 0x00000880 },
     { 0x0000a208, 0xd6be4788, 0xd6be4788, 0xd03e4788, 0xd03e4788, 0xd03e4788 },
-    { 0x0000a20c, 0x002ec1e0, 0x002ec1e0, 0x002ac120, 0x002ac120, 0x002ac120 },
-    { 0x0000b20c, 0x002ec1e0, 0x002ec1e0, 0x002ac120, 0x002ac120, 0x002ac120 },
-    { 0x0000c20c, 0x002ec1e0, 0x002ec1e0, 0x002ac120, 0x002ac120, 0x002ac120 },
+    { 0x0000a20c, 0x002fc160, 0x002fc160, 0x002ac120, 0x002ac120, 0x002ac120 },
+    { 0x0000b20c, 0x002fc160, 0x002fc160, 0x002ac120, 0x002ac120, 0x002ac120 },
+    { 0x0000c20c, 0x002fc160, 0x002fc160, 0x002ac120, 0x002ac120, 0x002ac120 },
     { 0x0000a21c, 0x1883800a, 0x1883800a, 0x1883800a, 0x1883800a, 0x1883800a },
     { 0x0000a230, 0x00000000, 0x00000000, 0x00000210, 0x00000108, 0x00000000 },
     { 0x0000a274, 0x0a1a9caa, 0x0a1a9caa, 0x0a1a7caa, 0x0a1a7caa, 0x0a1a7caa },
@@ -160,10 +170,8 @@ static const u32 ar5416Common_9100[][2] = {
     { 0x000013fc, 0x00000000 },
     { 0x0000143c, 0x00000000 },
     { 0x0000147c, 0x00000000 },
-    { 0x00004030, 0x00000002 },
-    { 0x0000403c, 0x00000002 },
-    { 0x00007010, 0x00000000 },
-    { 0x00007038, 0x000004c2 },
+    { 0x00020010, 0x00000003 },
+    { 0x00020038, 0x000004c2 },
     { 0x00008004, 0x00000000 },
     { 0x00008008, 0x00000000 },
     { 0x0000800c, 0x00000000 },
@@ -172,7 +180,7 @@ static const u32 ar5416Common_9100[][2] = {
     { 0x00008038, 0x00000000 },
     { 0x0000803c, 0x00000000 },
     { 0x00008048, 0x40000000 },
-    { 0x00008054, 0x00000000 },
+    { 0x00008054, 0x00004000 },
     { 0x00008058, 0x00000000 },
     { 0x0000805c, 0x000fc78f },
     { 0x00008060, 0x0000000f },
@@ -266,7 +274,7 @@ static const u32 ar5416Common_9100[][2] = {
     { 0x0000832c, 0x00000007 },
     { 0x00008330, 0x00000302 },
     { 0x00008334, 0x00000e00 },
-    { 0x00008338, 0x00070000 },
+    { 0x00008338, 0x00000000 },
     { 0x0000833c, 0x00000000 },
     { 0x00008340, 0x000107ff },
     { 0x00009808, 0x00000000 },
@@ -277,7 +285,7 @@ static const u32 ar5416Common_9100[][2] = {
     { 0x0000982c, 0x0000a000 },
     { 0x00009830, 0x00000000 },
     { 0x0000983c, 0x00200400 },
-    { 0x00009840, 0x206a002e },
+    { 0x00009840, 0x206a01ae },
     { 0x0000984c, 0x1284233c },
     { 0x00009854, 0x00000859 },
     { 0x00009900, 0x00000000 },
@@ -295,8 +303,6 @@ static const u32 ar5416Common_9100[][2] = {
     { 0x0000993c, 0x00000000 },
     { 0x00009948, 0x9280b212 },
     { 0x0000994c, 0x00020028 },
-    { 0x00009954, 0x5d50e188 },
-    { 0x00009958, 0x00081fff },
     { 0x0000c95c, 0x004b6a8e },
     { 0x0000c968, 0x000003ce },
     { 0x00009970, 0x190fb515 },
@@ -313,14 +319,14 @@ static const u32 ar5416Common_9100[][2] = {
     { 0x0000999c, 0x00000000 },
     { 0x000099a0, 0x00000000 },
     { 0x000099a4, 0x00000001 },
-    { 0x000099a8, 0x001fff00 },
-    { 0x000099ac, 0x00000000 },
+    { 0x000099a8, 0x201fff00 },
+    { 0x000099ac, 0x006f0000 },
     { 0x000099b0, 0x03051000 },
     { 0x000099dc, 0x00000000 },
     { 0x000099e0, 0x00000200 },
     { 0x000099e4, 0xaaaaaaaa },
     { 0x000099e8, 0x3c466478 },
-    { 0x000099ec, 0x000000aa },
+    { 0x000099ec, 0x0cc80caa },
     { 0x000099fc, 0x00001042 },
     { 0x00009b00, 0x00000000 },
     { 0x00009b04, 0x00000001 },
@@ -391,11 +397,11 @@ static const u32 ar5416Common_9100[][2] = {
     { 0x0000a218, 0x009c4060 },
     { 0x0000a220, 0x018830c6 },
     { 0x0000a224, 0x00000400 },
-    { 0x0000a228, 0x00000bb5 },
-    { 0x0000a22c, 0x00000011 },
+    { 0x0000a228, 0x001a0bb5 },
+    { 0x0000a22c, 0x00000000 },
     { 0x0000a234, 0x20202020 },
     { 0x0000a238, 0x20202020 },
-    { 0x0000a23c, 0x13c889af },
+    { 0x0000a23c, 0x13c889ae },
     { 0x0000a240, 0x38490a20 },
     { 0x0000a244, 0x00007bb6 },
     { 0x0000a248, 0x0fff3ffc },
@@ -405,13 +411,13 @@ static const u32 ar5416Common_9100[][2] = {
     { 0x0000a258, 0x0cc75380 },
     { 0x0000a25c, 0x0f0f0f01 },
     { 0x0000a260, 0xdfa91f01 },
-    { 0x0000a268, 0x00000000 },
+    { 0x0000a268, 0x00000001 },
     { 0x0000a26c, 0x0ebae9c6 },
     { 0x0000b26c, 0x0ebae9c6 },
     { 0x0000c26c, 0x0ebae9c6 },
     { 0x0000d270, 0x00820820 },
     { 0x0000a278, 0x1ce739ce },
-    { 0x0000a27c, 0x051701ce },
+    { 0x0000a27c, 0x050701ce },
     { 0x0000a338, 0x00000000 },
     { 0x0000a33c, 0x00000000 },
     { 0x0000a340, 0x00000000 },
@@ -420,7 +426,7 @@ static const u32 ar5416Common_9100[][2] = {
     { 0x0000a34c, 0x3fffffff },
     { 0x0000a350, 0x3fffffff },
     { 0x0000a354, 0x0003ffff },
-    { 0x0000a358, 0x79a8aa1f },
+    { 0x0000a358, 0x79a8aa33 },
     { 0x0000d35c, 0x07ffffef },
     { 0x0000d360, 0x0fffffe7 },
     { 0x0000d364, 0x17ffffe5 },
@@ -432,7 +438,7 @@ static const u32 ar5416Common_9100[][2] = {
     { 0x0000d37c, 0x7fffffe2 },
     { 0x0000d380, 0x7f3c7bba },
     { 0x0000d384, 0xf3307ff0 },
-    { 0x0000a388, 0x08000000 },
+    { 0x0000a388, 0x0c000000 },
     { 0x0000a38c, 0x20202020 },
     { 0x0000a390, 0x20202020 },
     { 0x0000a394, 0x1ce739ce },
@@ -529,13 +535,13 @@ static const u32 ar5416BB_RfGain_9100[][3] = {
 };
 
 static const u32 ar5416Bank1_9100[][2] = {
-    { 0x000098b0, 0x02108421 },
-    { 0x000098ec, 0x00000008 },
+    { 0x000098b0, 0x02108421},
+    { 0x000098ec, 0x00000008},
 };
 
 static const u32 ar5416Bank2_9100[][2] = {
-    { 0x000098b0, 0x0e73ff17 },
-    { 0x000098e0, 0x00000420 },
+    { 0x000098b0, 0x0e73ff17},
+    { 0x000098e0, 0x00000420},
 };
 
 static const u32 ar5416Bank3_9100[][3] = {
@@ -543,7 +549,6 @@ static const u32 ar5416Bank3_9100[][3] = {
 };
 
 static const u32 ar5416Bank6_9100[][3] = {
-
     { 0x0000989c, 0x00000000, 0x00000000 },
     { 0x0000989c, 0x00000000, 0x00000000 },
     { 0x0000989c, 0x00000000, 0x00000000 },
@@ -555,7 +560,7 @@ static const u32 ar5416Bank6_9100[][3] = {
     { 0x0000989c, 0x00ff0000, 0x00ff0000 },
     { 0x0000989c, 0x00ff0000, 0x00ff0000 },
     { 0x0000989c, 0x00ff0000, 0x00ff0000 },
-    { 0x0000989c, 0x40ff0000, 0x40ff0000 },
+    { 0x0000989c, 0x00ff0000, 0x00ff0000 },
     { 0x0000989c, 0x005f0000, 0x005f0000 },
     { 0x0000989c, 0x00870000, 0x00870000 },
     { 0x0000989c, 0x00f90000, 0x00f90000 },
@@ -566,15 +571,15 @@ static const u32 ar5416Bank6_9100[][3] = {
     { 0x0000989c, 0x00110000, 0x00110000 },
     { 0x0000989c, 0x006100a8, 0x006100a8 },
     { 0x0000989c, 0x004210a2, 0x004210a2 },
-    { 0x0000989c, 0x0014008f, 0x0014008f },
-    { 0x0000989c, 0x00c40003, 0x00c40003 },
+    { 0x0000989c, 0x0014000f, 0x0014000f },
+    { 0x0000989c, 0x00c40002, 0x00c40002 },
     { 0x0000989c, 0x003000f2, 0x003000f2 },
     { 0x0000989c, 0x00440016, 0x00440016 },
     { 0x0000989c, 0x00410040, 0x00410040 },
-    { 0x0000989c, 0x0001805e, 0x0001805e },
-    { 0x0000989c, 0x0000c0ab, 0x0000c0ab },
-    { 0x0000989c, 0x000000f1, 0x000000f1 },
-    { 0x0000989c, 0x00002081, 0x00002081 },
+    { 0x0000989c, 0x000180d6, 0x000180d6 },
+    { 0x0000989c, 0x0000c0aa, 0x0000c0aa },
+    { 0x0000989c, 0x000000b1, 0x000000b1 },
+    { 0x0000989c, 0x00002000, 0x00002000 },
     { 0x0000989c, 0x000000d4, 0x000000d4 },
     { 0x000098d0, 0x0000000f, 0x0010000f },
 };
@@ -602,7 +607,7 @@ static const u32 ar5416Bank6TPC_9100[][3] = {
     { 0x0000989c, 0x00110000, 0x00110000 },
     { 0x0000989c, 0x006100a8, 0x006100a8 },
     { 0x0000989c, 0x00423022, 0x00423022 },
-    { 0x0000989c, 0x201400df, 0x201400df },
+    { 0x0000989c, 0x2014008f, 0x2014008f },
     { 0x0000989c, 0x00c40002, 0x00c40002 },
     { 0x0000989c, 0x003000f2, 0x003000f2 },
     { 0x0000989c, 0x00440016, 0x00440016 },
@@ -610,7 +615,7 @@ static const u32 ar5416Bank6TPC_9100[][3] = {
     { 0x0000989c, 0x0001805e, 0x0001805e },
     { 0x0000989c, 0x0000c0ab, 0x0000c0ab },
     { 0x0000989c, 0x000000e1, 0x000000e1 },
-    { 0x0000989c, 0x00007081, 0x00007081 },
+    { 0x0000989c, 0x00007080, 0x00007080 },
     { 0x0000989c, 0x000000d4, 0x000000d4 },
     { 0x000098d0, 0x0000000f, 0x0010000f },
 };
@@ -622,43 +627,38 @@ static const u32 ar5416Bank7_9100[][2] = {
 };
 
 static const u32 ar5416Addac_9100[][2] = {
-    {0x0000989c,  0x00000000 },
-    {0x0000989c,  0x00000003 },
-    {0x0000989c,  0x00000000 },
-    {0x0000989c,  0x0000000c },
-    {0x0000989c,  0x00000000 },
-    {0x0000989c,  0x00000030 },
-    {0x0000989c,  0x00000000 },
-    {0x0000989c,  0x00000000 },
-    {0x0000989c,  0x00000000 },
-    {0x0000989c,  0x00000000 },
-    {0x0000989c,  0x00000000 },
-    {0x0000989c,  0x00000000 },
-    {0x0000989c,  0x00000000 },
-    {0x0000989c,  0x00000000 },
-    {0x0000989c,  0x00000000 },
-    {0x0000989c,  0x00000000 },
-    {0x0000989c,  0x00000000 },
-    {0x0000989c,  0x00000000 },
-    {0x0000989c,  0x00000060 },
-    {0x0000989c,  0x00000000 },
-    {0x0000989c,  0x00000000 },
-    {0x0000989c,  0x00000000 },
-    {0x0000989c,  0x00000000 },
-    {0x0000989c,  0x00000000 },
-    {0x0000989c,  0x00000000 },
-    {0x0000989c,  0x00000000 },
-    {0x0000989c,  0x00000000 },
-    {0x0000989c,  0x00000000 },
-    {0x0000989c,  0x00000000 },
-    {0x0000989c,  0x00000000 },
-    {0x0000989c,  0x00000000 },
-    {0x0000989c,  0x00000058 },
-    {0x0000989c,  0x00000000 },
-    {0x0000989c,  0x00000000 },
-    {0x0000989c,  0x00000000 },
-    {0x0000989c,  0x00000000 },
-    {0x000098cc,  0x00000000 },
+    {0x0000989c, 0x00000000 },
+    {0x0000989c, 0x00000000 },
+    {0x0000989c, 0x00000000 },
+    {0x0000989c, 0x00000000 },
+    {0x0000989c, 0x00000000 },
+    {0x0000989c, 0x00000000 },
+    {0x0000989c, 0x00000000 },
+    {0x0000989c, 0x00000010 },
+    {0x0000989c, 0x00000000 },
+    {0x0000989c, 0x00000000 },
+    {0x0000989c, 0x00000000 },
+    {0x0000989c, 0x00000000 },
+    {0x0000989c, 0x00000000 },
+    {0x0000989c, 0x00000000 },
+    {0x0000989c, 0x00000000 },
+    {0x0000989c, 0x00000000 },
+    {0x0000989c, 0x00000000 },
+    {0x0000989c, 0x00000000 },
+    {0x0000989c, 0x00000000 },
+    {0x0000989c, 0x00000000 },
+    {0x0000989c, 0x00000000 },
+    {0x0000989c, 0x000000c0 },
+    {0x0000989c, 0x00000015 },
+    {0x0000989c, 0x00000000 },
+    {0x0000989c, 0x00000000 },
+    {0x0000989c, 0x00000000 },
+    {0x0000989c, 0x00000000 },
+    {0x0000989c, 0x00000000 },
+    {0x0000989c, 0x00000000 },
+    {0x0000989c, 0x00000000 },
+    {0x0000989c, 0x00000000 },
+    {0x000098cc, 0x00000000 },
 };
 
 static const u32 ar5416Modes[][6] = {
@@ -674,48 +674,38 @@ static const u32 ar5416Modes[][6] = {
     { 0x00009828, 0x0a020001, 0x0a020001, 0x0a020001, 0x0a020001, 0x0a020001 },
     { 0x00009834, 0x00000e0e, 0x00000e0e, 0x00000e0e, 0x00000e0e, 0x00000e0e },
     { 0x00009838, 0x00000007, 0x00000007, 0x00000007, 0x00000007, 0x00000007 },
-    { 0x00009844, 0x0372161e, 0x0372161e, 0x037216a0, 0x037216a0, 0x037216a0 },
+    { 0x00009844, 0x1372161e, 0x1372161e, 0x137216a0, 0x137216a0, 0x137216a0 },
     { 0x00009848, 0x001a6a65, 0x001a6a65, 0x00197a68, 0x00197a68, 0x00197a68 },
     { 0x0000a848, 0x001a6a65, 0x001a6a65, 0x00197a68, 0x00197a68, 0x00197a68 },
     { 0x0000b848, 0x001a6a65, 0x001a6a65, 0x00197a68, 0x00197a68, 0x00197a68 },
-    { 0x00009850, 0x6d48b4e2, 0x6d48b4e2, 0x6d48b0e2, 0x6d48b0e2, 0x6d48b0e2 },
-    { 0x00009858, 0x7ec82d2e, 0x7ec82d2e, 0x7ec86d2e, 0x7ec84d2e, 0x7ec82d2e },
-    { 0x0000985c, 0x3139605e, 0x3139605e, 0x3139605e, 0x3139605e, 0x3139605e },
-    { 0x00009860, 0x00048d18, 0x00048d18, 0x00048d20, 0x00048d20, 0x00048d18 },
+    { 0x00009850, 0x6c48b4e0, 0x6c48b4e0, 0x6c48b0de, 0x6c48b0de, 0x6c48b0de },
+    { 0x00009858, 0x7ec82d2e, 0x7ec82d2e, 0x7ec82d2e, 0x7ec82d2e, 0x7ec82d2e },
+    { 0x0000985c, 0x31395d5e, 0x31395d5e, 0x31395d5e, 0x31395d5e, 0x31395d5e },
+    { 0x00009860, 0x00049d18, 0x00049d18, 0x00049d18, 0x00049d18, 0x00049d18 },
     { 0x0000c864, 0x0001ce00, 0x0001ce00, 0x0001ce00, 0x0001ce00, 0x0001ce00 },
-    { 0x00009868, 0x409a40d0, 0x409a40d0, 0x409a40d0, 0x409a40d0, 0x409a40d0 },
+    { 0x00009868, 0x409a4190, 0x409a4190, 0x409a4190, 0x409a4190, 0x409a4190 },
     { 0x0000986c, 0x050cb081, 0x050cb081, 0x050cb081, 0x050cb081, 0x050cb081 },
-    { 0x00009914, 0x000007d0, 0x000007d0, 0x00000898, 0x00000898, 0x000007d0 },
-    { 0x00009918, 0x0000000a, 0x00000014, 0x00000016, 0x0000000b, 0x00000016 },
-    { 0x00009924, 0xd00a8a07, 0xd00a8a07, 0xd00a8a11, 0xd00a8a0d, 0xd00a8a0d },
-    { 0x00009940, 0x00754604, 0x00754604, 0xfff81204, 0xfff81204, 0xfff81204 },
-    { 0x00009944, 0xdfb81020, 0xdfb81020, 0xdfb81020, 0xdfb81020, 0xdfb81020 },
-    { 0x00009954, 0x5f3ca3de, 0x5f3ca3de, 0xe250a51e, 0xe250a51e, 0xe250a51e },
-    { 0x00009958, 0x2108ecff, 0x2108ecff, 0x3388ffff, 0x3388ffff, 0x3388ffff },
-#ifdef TB243
-    { 0x00009960, 0x00000900, 0x00000900, 0x00009b40, 0x00009b40, 0x00012d80 },
-    { 0x0000a960, 0x00000900, 0x00000900, 0x00009b40, 0x00009b40, 0x00012d80 },
-    { 0x0000b960, 0x00000900, 0x00000900, 0x00009b40, 0x00009b40, 0x00012d80 },
-    { 0x00009964, 0x00000000, 0x00000000, 0x00002210, 0x00002210, 0x00001120 },
-#else
-    { 0x00009960, 0x0001bfc0, 0x0001bfc0, 0x0001bfc0, 0x0001bfc0, 0x0001bfc0 },
-    { 0x0000a960, 0x0001bfc0, 0x0001bfc0, 0x0001bfc0, 0x0001bfc0, 0x0001bfc0 },
-    { 0x0000b960, 0x0001bfc0, 0x0001bfc0, 0x0001bfc0, 0x0001bfc0, 0x0001bfc0 },
-    { 0x00009964, 0x00001120, 0x00001120, 0x00001120, 0x00001120, 0x00001120 },
-#endif
-    { 0x0000c9bc, 0x001a0600, 0x001a0600, 0x001a1000, 0x001a0c00, 0x001a0c00 },
+    { 0x00009914, 0x000007d0, 0x00000fa0, 0x00001130, 0x00000898, 0x000007d0 },
+    { 0x00009918, 0x000001b8, 0x00000370, 0x00000268, 0x00000134, 0x00000134 },
+    { 0x00009924, 0xd0058a0b, 0xd0058a0b, 0xd0058a0b, 0xd0058a0b, 0xd0058a0b },
+    { 0x00009944, 0xffb81020, 0xffb81020, 0xffb81020, 0xffb81020, 0xffb81020 },
+    { 0x00009960, 0x00000900, 0x00000900, 0x00012d80, 0x00012d80, 0x00012d80 },
+    { 0x0000a960, 0x00000900, 0x00000900, 0x00012d80, 0x00012d80, 0x00012d80 },
+    { 0x0000b960, 0x00000900, 0x00000900, 0x00012d80, 0x00012d80, 0x00012d80 },
+    { 0x00009964, 0x00000000, 0x00000000, 0x00001120, 0x00001120, 0x00001120 },
+    { 0x0000c9bc, 0x001a0a00, 0x001a0a00, 0x001a0a00, 0x001a0a00, 0x001a0a00 },
     { 0x000099c0, 0x038919be, 0x038919be, 0x038919be, 0x038919be, 0x038919be },
     { 0x000099c4, 0x06336f77, 0x06336f77, 0x06336f77, 0x06336f77, 0x06336f77 },
-    { 0x000099c8, 0x60f65329, 0x60f65329, 0x60f65329, 0x60f65329, 0x60f65329 },
+    { 0x000099c8, 0x60f6532c, 0x60f6532c, 0x60f6532c, 0x60f6532c, 0x60f6532c },
     { 0x000099cc, 0x08f186c8, 0x08f186c8, 0x08f186c8, 0x08f186c8, 0x08f186c8 },
     { 0x000099d0, 0x00046384, 0x00046384, 0x00046384, 0x00046384, 0x00046384 },
     { 0x000099d4, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 },
     { 0x000099d8, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 },
     { 0x0000a204, 0x00000880, 0x00000880, 0x00000880, 0x00000880, 0x00000880 },
     { 0x0000a208, 0xd6be4788, 0xd6be4788, 0xd03e4788, 0xd03e4788, 0xd03e4788 },
-    { 0x0000a20c, 0x002fc160, 0x002fc160, 0x002ac120, 0x002ac120, 0x002ac120 },
-    { 0x0000b20c, 0x002fc160, 0x002fc160, 0x002ac120, 0x002ac120, 0x002ac120 },
-    { 0x0000c20c, 0x002fc160, 0x002fc160, 0x002ac120, 0x002ac120, 0x002ac120 },
+    { 0x0000a20c, 0x002ec1e0, 0x002ec1e0, 0x002ac120, 0x002ac120, 0x002ac120 },
+    { 0x0000b20c, 0x002ec1e0, 0x002ec1e0, 0x002ac120, 0x002ac120, 0x002ac120 },
+    { 0x0000c20c, 0x002ec1e0, 0x002ec1e0, 0x002ac120, 0x002ac120, 0x002ac120 },
     { 0x0000a21c, 0x1883800a, 0x1883800a, 0x1883800a, 0x1883800a, 0x1883800a },
     { 0x0000a230, 0x00000000, 0x00000000, 0x00000210, 0x00000108, 0x00000000 },
     { 0x0000a274, 0x0a1a9caa, 0x0a1a9caa, 0x0a1a7caa, 0x0a1a7caa, 0x0a1a7caa },
@@ -817,8 +807,10 @@ static const u32 ar5416Common[][2] = {
     { 0x000013fc, 0x00000000 },
     { 0x0000143c, 0x00000000 },
     { 0x0000147c, 0x00000000 },
-    { 0x00020010, 0x00000003 },
-    { 0x00020038, 0x000004c2 },
+    { 0x00004030, 0x00000002 },
+    { 0x0000403c, 0x00000002 },
+    { 0x00007010, 0x00000000 },
+    { 0x00007038, 0x000004c2 },
     { 0x00008004, 0x00000000 },
     { 0x00008008, 0x00000000 },
     { 0x0000800c, 0x00000000 },
@@ -827,7 +819,7 @@ static const u32 ar5416Common[][2] = {
     { 0x00008038, 0x00000000 },
     { 0x0000803c, 0x00000000 },
     { 0x00008048, 0x40000000 },
-    { 0x00008054, 0x00004000 },
+    { 0x00008054, 0x00000000 },
     { 0x00008058, 0x00000000 },
     { 0x0000805c, 0x000fc78f },
     { 0x00008060, 0x0000000f },
@@ -862,7 +854,7 @@ static const u32 ar5416Common[][2] = {
     { 0x00008134, 0x00000000 },
     { 0x00008138, 0x00000000 },
     { 0x0000813c, 0x00000000 },
-    { 0x00008144, 0x00000000 },
+    { 0x00008144, 0xffffffff },
     { 0x00008168, 0x00000000 },
     { 0x0000816c, 0x00000000 },
     { 0x00008170, 0x32143320 },
@@ -921,7 +913,7 @@ static const u32 ar5416Common[][2] = {
     { 0x0000832c, 0x00000007 },
     { 0x00008330, 0x00000302 },
     { 0x00008334, 0x00000e00 },
-    { 0x00008338, 0x00000000 },
+    { 0x00008338, 0x00070000 },
     { 0x0000833c, 0x00000000 },
     { 0x00008340, 0x000107ff },
     { 0x00009808, 0x00000000 },
@@ -932,7 +924,7 @@ static const u32 ar5416Common[][2] = {
     { 0x0000982c, 0x0000a000 },
     { 0x00009830, 0x00000000 },
     { 0x0000983c, 0x00200400 },
-    { 0x00009840, 0x206a01ae },
+    { 0x00009840, 0x206a002e },
     { 0x0000984c, 0x1284233c },
     { 0x00009854, 0x00000859 },
     { 0x00009900, 0x00000000 },
@@ -950,6 +942,8 @@ static const u32 ar5416Common[][2] = {
     { 0x0000993c, 0x00000000 },
     { 0x00009948, 0x9280b212 },
     { 0x0000994c, 0x00020028 },
+    { 0x00009954, 0x5d50e188 },
+    { 0x00009958, 0x00081fff },
     { 0x0000c95c, 0x004b6a8e },
     { 0x0000c968, 0x000003ce },
     { 0x00009970, 0x190fb515 },
@@ -966,14 +960,14 @@ static const u32 ar5416Common[][2] = {
     { 0x0000999c, 0x00000000 },
     { 0x000099a0, 0x00000000 },
     { 0x000099a4, 0x00000001 },
-    { 0x000099a8, 0x201fff00 },
-    { 0x000099ac, 0x006f0000 },
+    { 0x000099a8, 0x001fff00 },
+    { 0x000099ac, 0x00000000 },
     { 0x000099b0, 0x03051000 },
     { 0x000099dc, 0x00000000 },
     { 0x000099e0, 0x00000200 },
     { 0x000099e4, 0xaaaaaaaa },
     { 0x000099e8, 0x3c466478 },
-    { 0x000099ec, 0x0cc80caa },
+    { 0x000099ec, 0x000000aa },
     { 0x000099fc, 0x00001042 },
     { 0x00009b00, 0x00000000 },
     { 0x00009b04, 0x00000001 },
@@ -1044,11 +1038,11 @@ static const u32 ar5416Common[][2] = {
     { 0x0000a218, 0x009c4060 },
     { 0x0000a220, 0x018830c6 },
     { 0x0000a224, 0x00000400 },
-    { 0x0000a228, 0x001a0bb5 },
-    { 0x0000a22c, 0x00000000 },
+    { 0x0000a228, 0x00000bb5 },
+    { 0x0000a22c, 0x00000011 },
     { 0x0000a234, 0x20202020 },
     { 0x0000a238, 0x20202020 },
-    { 0x0000a23c, 0x13c889ae },
+    { 0x0000a23c, 0x13c889af },
     { 0x0000a240, 0x38490a20 },
     { 0x0000a244, 0x00007bb6 },
     { 0x0000a248, 0x0fff3ffc },
@@ -1058,13 +1052,13 @@ static const u32 ar5416Common[][2] = {
     { 0x0000a258, 0x0cc75380 },
     { 0x0000a25c, 0x0f0f0f01 },
     { 0x0000a260, 0xdfa91f01 },
-    { 0x0000a268, 0x00000001 },
+    { 0x0000a268, 0x00000000 },
     { 0x0000a26c, 0x0ebae9c6 },
     { 0x0000b26c, 0x0ebae9c6 },
     { 0x0000c26c, 0x0ebae9c6 },
     { 0x0000d270, 0x00820820 },
     { 0x0000a278, 0x1ce739ce },
-    { 0x0000a27c, 0x050701ce },
+    { 0x0000a27c, 0x051701ce },
     { 0x0000a338, 0x00000000 },
     { 0x0000a33c, 0x00000000 },
     { 0x0000a340, 0x00000000 },
@@ -1073,7 +1067,7 @@ static const u32 ar5416Common[][2] = {
     { 0x0000a34c, 0x3fffffff },
     { 0x0000a350, 0x3fffffff },
     { 0x0000a354, 0x0003ffff },
-    { 0x0000a358, 0x79a8aa33 },
+    { 0x0000a358, 0x79a8aa1f },
     { 0x0000d35c, 0x07ffffef },
     { 0x0000d360, 0x0fffffe7 },
     { 0x0000d364, 0x17ffffe5 },
@@ -1085,7 +1079,7 @@ static const u32 ar5416Common[][2] = {
     { 0x0000d37c, 0x7fffffe2 },
     { 0x0000d380, 0x7f3c7bba },
     { 0x0000d384, 0xf3307ff0 },
-    { 0x0000a388, 0x0c000000 },
+    { 0x0000a388, 0x08000000 },
     { 0x0000a38c, 0x20202020 },
     { 0x0000a390, 0x20202020 },
     { 0x0000a394, 0x1ce739ce },
@@ -1182,13 +1176,13 @@ static const u32 ar5416BB_RfGain[][3] = {
 };
 
 static const u32 ar5416Bank1[][2] = {
-    { 0x000098b0, 0x02108421},
-    { 0x000098ec, 0x00000008},
+    { 0x000098b0, 0x02108421 },
+    { 0x000098ec, 0x00000008 },
 };
 
 static const u32 ar5416Bank2[][2] = {
-    { 0x000098b0, 0x0e73ff17},
-    { 0x000098e0, 0x00000420},
+    { 0x000098b0, 0x0e73ff17 },
+    { 0x000098e0, 0x00000420 },
 };
 
 static const u32 ar5416Bank3[][3] = {
@@ -1196,7 +1190,6 @@ static const u32 ar5416Bank3[][3] = {
 };
 
 static const u32 ar5416Bank6[][3] = {
-
     { 0x0000989c, 0x00000000, 0x00000000 },
     { 0x0000989c, 0x00000000, 0x00000000 },
     { 0x0000989c, 0x00000000, 0x00000000 },
@@ -1208,7 +1201,7 @@ static const u32 ar5416Bank6[][3] = {
     { 0x0000989c, 0x00ff0000, 0x00ff0000 },
     { 0x0000989c, 0x00ff0000, 0x00ff0000 },
     { 0x0000989c, 0x00ff0000, 0x00ff0000 },
-    { 0x0000989c, 0x00ff0000, 0x00ff0000 },
+    { 0x0000989c, 0x40ff0000, 0x40ff0000 },
     { 0x0000989c, 0x005f0000, 0x005f0000 },
     { 0x0000989c, 0x00870000, 0x00870000 },
     { 0x0000989c, 0x00f90000, 0x00f90000 },
@@ -1219,22 +1212,20 @@ static const u32 ar5416Bank6[][3] = {
     { 0x0000989c, 0x00110000, 0x00110000 },
     { 0x0000989c, 0x006100a8, 0x006100a8 },
     { 0x0000989c, 0x004210a2, 0x004210a2 },
-    { 0x0000989c, 0x0014000f, 0x0014000f },
-    { 0x0000989c, 0x00c40002, 0x00c40002 },
+    { 0x0000989c, 0x0014008f, 0x0014008f },
+    { 0x0000989c, 0x00c40003, 0x00c40003 },
     { 0x0000989c, 0x003000f2, 0x003000f2 },
     { 0x0000989c, 0x00440016, 0x00440016 },
     { 0x0000989c, 0x00410040, 0x00410040 },
-    { 0x0000989c, 0x000180d6, 0x000180d6 },
-    { 0x0000989c, 0x0000c0aa, 0x0000c0aa },
-    { 0x0000989c, 0x000000b1, 0x000000b1 },
-    { 0x0000989c, 0x00002000, 0x00002000 },
+    { 0x0000989c, 0x0001805e, 0x0001805e },
+    { 0x0000989c, 0x0000c0ab, 0x0000c0ab },
+    { 0x0000989c, 0x000000f1, 0x000000f1 },
+    { 0x0000989c, 0x00002081, 0x00002081 },
     { 0x0000989c, 0x000000d4, 0x000000d4 },
     { 0x000098d0, 0x0000000f, 0x0010000f },
 };
 
-
 static const u32 ar5416Bank6TPC[][3] = {
-
     { 0x0000989c, 0x00000000, 0x00000000 },
     { 0x0000989c, 0x00000000, 0x00000000 },
     { 0x0000989c, 0x00000000, 0x00000000 },
@@ -1257,7 +1248,7 @@ static const u32 ar5416Bank6TPC[][3] = {
     { 0x0000989c, 0x00110000, 0x00110000 },
     { 0x0000989c, 0x006100a8, 0x006100a8 },
     { 0x0000989c, 0x00423022, 0x00423022 },
-    { 0x0000989c, 0x2014008f, 0x2014008f },
+    { 0x0000989c, 0x201400df, 0x201400df },
     { 0x0000989c, 0x00c40002, 0x00c40002 },
     { 0x0000989c, 0x003000f2, 0x003000f2 },
     { 0x0000989c, 0x00440016, 0x00440016 },
@@ -1265,7 +1256,7 @@ static const u32 ar5416Bank6TPC[][3] = {
     { 0x0000989c, 0x0001805e, 0x0001805e },
     { 0x0000989c, 0x0000c0ab, 0x0000c0ab },
     { 0x0000989c, 0x000000e1, 0x000000e1 },
-    { 0x0000989c, 0x00007080, 0x00007080 },
+    { 0x0000989c, 0x00007081, 0x00007081 },
     { 0x0000989c, 0x000000d4, 0x000000d4 },
     { 0x000098d0, 0x0000000f, 0x0010000f },
 };
@@ -1277,38 +1268,43 @@ static const u32 ar5416Bank7[][2] = {
 };
 
 static const u32 ar5416Addac[][2] = {
-    {0x0000989c, 0x00000000 },
-    {0x0000989c, 0x00000000 },
-    {0x0000989c, 0x00000000 },
-    {0x0000989c, 0x00000000 },
-    {0x0000989c, 0x00000000 },
-    {0x0000989c, 0x00000000 },
-    {0x0000989c, 0x00000000 },
-    {0x0000989c, 0x00000010 },
-    {0x0000989c, 0x00000000 },
-    {0x0000989c, 0x00000000 },
-    {0x0000989c, 0x00000000 },
-    {0x0000989c, 0x00000000 },
-    {0x0000989c, 0x00000000 },
-    {0x0000989c, 0x00000000 },
-    {0x0000989c, 0x00000000 },
-    {0x0000989c, 0x00000000 },
-    {0x0000989c, 0x00000000 },
-    {0x0000989c, 0x00000000 },
-    {0x0000989c, 0x00000000 },
-    {0x0000989c, 0x00000000 },
-    {0x0000989c, 0x00000000 },
-    {0x0000989c, 0x000000c0 },
-    {0x0000989c, 0x00000015 },
-    {0x0000989c, 0x00000000 },
-    {0x0000989c, 0x00000000 },
-    {0x0000989c, 0x00000000 },
-    {0x0000989c, 0x00000000 },
-    {0x0000989c, 0x00000000 },
-    {0x0000989c, 0x00000000 },
-    {0x0000989c, 0x00000000 },
-    {0x0000989c, 0x00000000 },
-    {0x000098cc, 0x00000000 },
+    {0x0000989c,  0x00000000 },
+    {0x0000989c,  0x00000003 },
+    {0x0000989c,  0x00000000 },
+    {0x0000989c,  0x0000000c },
+    {0x0000989c,  0x00000000 },
+    {0x0000989c,  0x00000030 },
+    {0x0000989c,  0x00000000 },
+    {0x0000989c,  0x00000000 },
+    {0x0000989c,  0x00000000 },
+    {0x0000989c,  0x00000000 },
+    {0x0000989c,  0x00000000 },
+    {0x0000989c,  0x00000000 },
+    {0x0000989c,  0x00000000 },
+    {0x0000989c,  0x00000000 },
+    {0x0000989c,  0x00000000 },
+    {0x0000989c,  0x00000000 },
+    {0x0000989c,  0x00000000 },
+    {0x0000989c,  0x00000000 },
+    {0x0000989c,  0x00000060 },
+    {0x0000989c,  0x00000000 },
+    {0x0000989c,  0x00000000 },
+    {0x0000989c,  0x00000000 },
+    {0x0000989c,  0x00000000 },
+    {0x0000989c,  0x00000000 },
+    {0x0000989c,  0x00000000 },
+    {0x0000989c,  0x00000000 },
+    {0x0000989c,  0x00000000 },
+    {0x0000989c,  0x00000000 },
+    {0x0000989c,  0x00000000 },
+    {0x0000989c,  0x00000000 },
+    {0x0000989c,  0x00000000 },
+    {0x0000989c,  0x00000058 },
+    {0x0000989c,  0x00000000 },
+    {0x0000989c,  0x00000000 },
+    {0x0000989c,  0x00000000 },
+    {0x0000989c,  0x00000000 },
+    {0x000098c4,  0x00000000 },
 };
 
 static const u32 ar5416Modes_9160[][6] = {
diff --git a/drivers/net/wireless/ath9k/reg.h b/drivers/net/wireless/ath9k/reg.h
index 91442da..cef1570 100644
--- a/drivers/net/wireless/ath9k/reg.h
+++ b/drivers/net/wireless/ath9k/reg.h
@@ -158,14 +158,6 @@
 #define AR_CST_TIMEOUT_LIMIT      0xFFFF0000
 #define AR_CST_TIMEOUT_LIMIT_S    16
 
-#define AR_SREV_VERSION_9100                  0x014
-
-#define AR_SREV_9100(ah) ((ah->hw_version.macVersion) == AR_SREV_VERSION_9100)
-#define AR_SREV_5416_V20_OR_LATER(_ah) \
-	(AR_SREV_9100((_ah)) || AR_SREV_5416_20_OR_LATER(_ah))
-#define AR_SREV_5416_V22_OR_LATER(_ah) \
-	(AR_SREV_9100((_ah)) || AR_SREV_5416_22_OR_LATER(_ah))
-
 #define AR_ISR               0x0080
 #define AR_ISR_RXOK          0x00000001
 #define AR_ISR_RXDESC        0x00000002
@@ -729,31 +721,36 @@
 #define AR_SREV_REVISION2        	      0x00000F00
 #define AR_SREV_REVISION2_S     	      8
 
-#define AR_SREV_VERSION_5416_PCI               0xD
-#define AR_SREV_VERSION_5416_PCIE              0xC
-#define AR_SREV_REVISION_5416_10               0
-#define AR_SREV_REVISION_5416_20               1
-#define AR_SREV_REVISION_5416_22               2
-#define AR_SREV_VERSION_9160        	      0x40
-#define AR_SREV_REVISION_9160_10    	      0
-#define AR_SREV_REVISION_9160_11    	      1
-#define AR_SREV_VERSION_9280                0x80
-#define AR_SREV_REVISION_9280_10            0
-#define AR_SREV_REVISION_9280_20            1
-#define AR_SREV_REVISION_9280_21            2
-#define AR_SREV_VERSION_9285                  0xC0
-#define AR_SREV_REVISION_9285_10              0
-#define AR_SREV_REVISION_9285_11              1
-#define AR_SREV_REVISION_9285_12              2
-
-#define AR_SREV_9100_OR_LATER(_ah) \
-	(((_ah)->hw_version.macVersion >= AR_SREV_VERSION_5416_PCIE))
+#define AR_SREV_VERSION_5416_PCI	0xD
+#define AR_SREV_VERSION_5416_PCIE	0xC
+#define AR_SREV_REVISION_5416_10	0
+#define AR_SREV_REVISION_5416_20	1
+#define AR_SREV_REVISION_5416_22	2
+#define AR_SREV_VERSION_9100		0x014
+#define AR_SREV_VERSION_9160		0x40
+#define AR_SREV_REVISION_9160_10	0
+#define AR_SREV_REVISION_9160_11	1
+#define AR_SREV_VERSION_9280		0x80
+#define AR_SREV_REVISION_9280_10	0
+#define AR_SREV_REVISION_9280_20	1
+#define AR_SREV_REVISION_9280_21	2
+#define AR_SREV_VERSION_9285		0xC0
+#define AR_SREV_REVISION_9285_10	0
+#define AR_SREV_REVISION_9285_11	1
+#define AR_SREV_REVISION_9285_12	2
+
+#define AR_SREV_9100(ah) ((ah->hw_version.macVersion) == AR_SREV_VERSION_9100)
+#define AR_SREV_5416_V20_OR_LATER(_ah) \
+	(AR_SREV_9100(_ah) || AR_SREV_5416_20_OR_LATER(_ah))
+#define AR_SREV_5416_V22_OR_LATER(_ah) \
+	(AR_SREV_9100(_ah) || AR_SREV_5416_22_OR_LATER(_ah))
+
 #define AR_SREV_5416_20_OR_LATER(_ah) \
 	(((_ah)->hw_version.macVersion >= AR_SREV_VERSION_9160) || \
-		((_ah)->hw_version.macRev >= AR_SREV_REVISION_5416_20))
+	 ((_ah)->hw_version.macRev >= AR_SREV_REVISION_5416_20))
 #define AR_SREV_5416_22_OR_LATER(_ah) \
 	(((_ah)->hw_version.macVersion >= AR_SREV_VERSION_9160) || \
-		((_ah)->hw_version.macRev >= AR_SREV_REVISION_5416_22))
+	 ((_ah)->hw_version.macRev >= AR_SREV_REVISION_5416_22))
 #define AR_SREV_9160(_ah) \
 	(((_ah)->hw_version.macVersion == AR_SREV_VERSION_9160))
 #define AR_SREV_9160_10_OR_LATER(_ah) \
@@ -778,14 +775,14 @@
 #define AR_SREV_9285_10_OR_LATER(_ah) \
 	(((_ah)->hw_version.macVersion >= AR_SREV_VERSION_9285))
 #define AR_SREV_9285_11(_ah) \
-	(AR_SREV_9280(ah) && \
+	(AR_SREV_9285(ah) && \
 	 ((_ah)->hw_version.macRev == AR_SREV_REVISION_9285_11))
 #define AR_SREV_9285_11_OR_LATER(_ah) \
 	(((_ah)->hw_version.macVersion > AR_SREV_VERSION_9285) || \
 	 (AR_SREV_9285(ah) && ((_ah)->hw_version.macRev >= \
 			       AR_SREV_REVISION_9285_11)))
 #define AR_SREV_9285_12(_ah) \
-	(AR_SREV_9280(ah) && \
+	(AR_SREV_9285(ah) && \
 	 ((_ah)->hw_version.macRev == AR_SREV_REVISION_9285_12))
 #define AR_SREV_9285_12_OR_LATER(_ah) \
 	(((_ah)->hw_version.macVersion > AR_SREV_VERSION_9285) || \

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

* [ath9k-devel] [RFC] ath9k: use correct init values for ar9100 devices
@ 2009-03-04  5:35     ` Sujith
  0 siblings, 0 replies; 27+ messages in thread
From: Sujith @ 2009-03-04  5:35 UTC (permalink / raw)
  To: ath9k-devel

Sujith Manoharan wrote:
> I'll check the initval arrays and update.
> 

Does this patch help ? I haven't tested on 9100, but 5416 works fine.

diff --git a/drivers/net/wireless/ath9k/hw.c b/drivers/net/wireless/ath9k/hw.c
index eb750a5..d7b3c44 100644
--- a/drivers/net/wireless/ath9k/hw.c
+++ b/drivers/net/wireless/ath9k/hw.c
@@ -760,7 +760,7 @@ static struct ath_hw *ath9k_hw_do_attach(u16 devid, struct ath_softc *sc,
 			INIT_INI_ARRAY(&ah->iniAddac, ar5416Addac_9160,
 				       ARRAY_SIZE(ar5416Addac_9160), 2);
 		}
-	} else if (AR_SREV_9100_OR_LATER(ah)) {
+	} else if (AR_SREV_9100(ah)) {
 		INIT_INI_ARRAY(&ah->iniModes, ar5416Modes_9100,
 			       ARRAY_SIZE(ar5416Modes_9100), 6);
 		INIT_INI_ARRAY(&ah->iniCommon, ar5416Common_9100,
diff --git a/drivers/net/wireless/ath9k/initvals.h b/drivers/net/wireless/ath9k/initvals.h
index d492363..0b579b4 100644
--- a/drivers/net/wireless/ath9k/initvals.h
+++ b/drivers/net/wireless/ath9k/initvals.h
@@ -27,38 +27,48 @@ static const u32 ar5416Modes_9100[][6] = {
     { 0x00009828, 0x0a020001, 0x0a020001, 0x0a020001, 0x0a020001, 0x0a020001 },
     { 0x00009834, 0x00000e0e, 0x00000e0e, 0x00000e0e, 0x00000e0e, 0x00000e0e },
     { 0x00009838, 0x00000007, 0x00000007, 0x00000007, 0x00000007, 0x00000007 },
-    { 0x00009844, 0x1372161e, 0x1372161e, 0x137216a0, 0x137216a0, 0x137216a0 },
+    { 0x00009844, 0x0372161e, 0x0372161e, 0x037216a0, 0x037216a0, 0x037216a0 },
     { 0x00009848, 0x001a6a65, 0x001a6a65, 0x00197a68, 0x00197a68, 0x00197a68 },
     { 0x0000a848, 0x001a6a65, 0x001a6a65, 0x00197a68, 0x00197a68, 0x00197a68 },
     { 0x0000b848, 0x001a6a65, 0x001a6a65, 0x00197a68, 0x00197a68, 0x00197a68 },
-    { 0x00009850, 0x6c48b4e0, 0x6c48b4e0, 0x6c48b0de, 0x6c48b0de, 0x6c48b0de },
-    { 0x00009858, 0x7ec82d2e, 0x7ec82d2e, 0x7ec82d2e, 0x7ec82d2e, 0x7ec82d2e },
-    { 0x0000985c, 0x31395d5e, 0x31395d5e, 0x31395d5e, 0x31395d5e, 0x31395d5e },
-    { 0x00009860, 0x00049d18, 0x00049d18, 0x00049d18, 0x00049d18, 0x00049d18 },
+    { 0x00009850, 0x6d48b4e2, 0x6d48b4e2, 0x6d48b0e2, 0x6d48b0e2, 0x6d48b0e2 },
+    { 0x00009858, 0x7ec82d2e, 0x7ec82d2e, 0x7ec86d2e, 0x7ec84d2e, 0x7ec82d2e },
+    { 0x0000985c, 0x3139605e, 0x3139605e, 0x3139605e, 0x3139605e, 0x3139605e },
+    { 0x00009860, 0x00048d18, 0x00048d18, 0x00048d20, 0x00048d20, 0x00048d18 },
     { 0x0000c864, 0x0001ce00, 0x0001ce00, 0x0001ce00, 0x0001ce00, 0x0001ce00 },
-    { 0x00009868, 0x409a4190, 0x409a4190, 0x409a4190, 0x409a4190, 0x409a4190 },
+    { 0x00009868, 0x409a40d0, 0x409a40d0, 0x409a40d0, 0x409a40d0, 0x409a40d0 },
     { 0x0000986c, 0x050cb081, 0x050cb081, 0x050cb081, 0x050cb081, 0x050cb081 },
-    { 0x00009914, 0x000007d0, 0x00000fa0, 0x00001130, 0x00000898, 0x000007d0 },
-    { 0x00009918, 0x000001b8, 0x00000370, 0x00000268, 0x00000134, 0x00000134 },
-    { 0x00009924, 0xd0058a0b, 0xd0058a0b, 0xd0058a0b, 0xd0058a0b, 0xd0058a0b },
-    { 0x00009944, 0xffb81020, 0xffb81020, 0xffb81020, 0xffb81020, 0xffb81020 },
-    { 0x00009960, 0x00000900, 0x00000900, 0x00012d80, 0x00012d80, 0x00012d80 },
-    { 0x0000a960, 0x00000900, 0x00000900, 0x00012d80, 0x00012d80, 0x00012d80 },
-    { 0x0000b960, 0x00000900, 0x00000900, 0x00012d80, 0x00012d80, 0x00012d80 },
-    { 0x00009964, 0x00000000, 0x00000000, 0x00001120, 0x00001120, 0x00001120 },
-    { 0x0000c9bc, 0x001a0a00, 0x001a0a00, 0x001a0a00, 0x001a0a00, 0x001a0a00 },
+    { 0x00009914, 0x000007d0, 0x000007d0, 0x00000898, 0x00000898, 0x000007d0 },
+    { 0x00009918, 0x0000000a, 0x00000014, 0x00000016, 0x0000000b, 0x00000016 },
+    { 0x00009924, 0xd00a8a07, 0xd00a8a07, 0xd00a8a11, 0xd00a8a0d, 0xd00a8a0d },
+    { 0x00009940, 0x00754604, 0x00754604, 0xfff81204, 0xfff81204, 0xfff81204 },
+    { 0x00009944, 0xdfb81020, 0xdfb81020, 0xdfb81020, 0xdfb81020, 0xdfb81020 },
+    { 0x00009954, 0x5f3ca3de, 0x5f3ca3de, 0xe250a51e, 0xe250a51e, 0xe250a51e },
+    { 0x00009958, 0x2108ecff, 0x2108ecff, 0x3388ffff, 0x3388ffff, 0x3388ffff },
+#ifdef TB243
+    { 0x00009960, 0x00000900, 0x00000900, 0x00009b40, 0x00009b40, 0x00012d80 },
+    { 0x0000a960, 0x00000900, 0x00000900, 0x00009b40, 0x00009b40, 0x00012d80 },
+    { 0x0000b960, 0x00000900, 0x00000900, 0x00009b40, 0x00009b40, 0x00012d80 },
+    { 0x00009964, 0x00000000, 0x00000000, 0x00002210, 0x00002210, 0x00001120 },
+#else
+    { 0x00009960, 0x0001bfc0, 0x0001bfc0, 0x0001bfc0, 0x0001bfc0, 0x0001bfc0 },
+    { 0x0000a960, 0x0001bfc0, 0x0001bfc0, 0x0001bfc0, 0x0001bfc0, 0x0001bfc0 },
+    { 0x0000b960, 0x0001bfc0, 0x0001bfc0, 0x0001bfc0, 0x0001bfc0, 0x0001bfc0 },
+    { 0x00009964, 0x00001120, 0x00001120, 0x00001120, 0x00001120, 0x00001120 },
+#endif
+    { 0x0000c9bc, 0x001a0600, 0x001a0600, 0x001a1000, 0x001a0c00, 0x001a0c00 },
     { 0x000099c0, 0x038919be, 0x038919be, 0x038919be, 0x038919be, 0x038919be },
     { 0x000099c4, 0x06336f77, 0x06336f77, 0x06336f77, 0x06336f77, 0x06336f77 },
-    { 0x000099c8, 0x60f6532c, 0x60f6532c, 0x60f6532c, 0x60f6532c, 0x60f6532c },
+    { 0x000099c8, 0x60f65329, 0x60f65329, 0x60f65329, 0x60f65329, 0x60f65329 },
     { 0x000099cc, 0x08f186c8, 0x08f186c8, 0x08f186c8, 0x08f186c8, 0x08f186c8 },
     { 0x000099d0, 0x00046384, 0x00046384, 0x00046384, 0x00046384, 0x00046384 },
     { 0x000099d4, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 },
     { 0x000099d8, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 },
     { 0x0000a204, 0x00000880, 0x00000880, 0x00000880, 0x00000880, 0x00000880 },
     { 0x0000a208, 0xd6be4788, 0xd6be4788, 0xd03e4788, 0xd03e4788, 0xd03e4788 },
-    { 0x0000a20c, 0x002ec1e0, 0x002ec1e0, 0x002ac120, 0x002ac120, 0x002ac120 },
-    { 0x0000b20c, 0x002ec1e0, 0x002ec1e0, 0x002ac120, 0x002ac120, 0x002ac120 },
-    { 0x0000c20c, 0x002ec1e0, 0x002ec1e0, 0x002ac120, 0x002ac120, 0x002ac120 },
+    { 0x0000a20c, 0x002fc160, 0x002fc160, 0x002ac120, 0x002ac120, 0x002ac120 },
+    { 0x0000b20c, 0x002fc160, 0x002fc160, 0x002ac120, 0x002ac120, 0x002ac120 },
+    { 0x0000c20c, 0x002fc160, 0x002fc160, 0x002ac120, 0x002ac120, 0x002ac120 },
     { 0x0000a21c, 0x1883800a, 0x1883800a, 0x1883800a, 0x1883800a, 0x1883800a },
     { 0x0000a230, 0x00000000, 0x00000000, 0x00000210, 0x00000108, 0x00000000 },
     { 0x0000a274, 0x0a1a9caa, 0x0a1a9caa, 0x0a1a7caa, 0x0a1a7caa, 0x0a1a7caa },
@@ -160,10 +170,8 @@ static const u32 ar5416Common_9100[][2] = {
     { 0x000013fc, 0x00000000 },
     { 0x0000143c, 0x00000000 },
     { 0x0000147c, 0x00000000 },
-    { 0x00004030, 0x00000002 },
-    { 0x0000403c, 0x00000002 },
-    { 0x00007010, 0x00000000 },
-    { 0x00007038, 0x000004c2 },
+    { 0x00020010, 0x00000003 },
+    { 0x00020038, 0x000004c2 },
     { 0x00008004, 0x00000000 },
     { 0x00008008, 0x00000000 },
     { 0x0000800c, 0x00000000 },
@@ -172,7 +180,7 @@ static const u32 ar5416Common_9100[][2] = {
     { 0x00008038, 0x00000000 },
     { 0x0000803c, 0x00000000 },
     { 0x00008048, 0x40000000 },
-    { 0x00008054, 0x00000000 },
+    { 0x00008054, 0x00004000 },
     { 0x00008058, 0x00000000 },
     { 0x0000805c, 0x000fc78f },
     { 0x00008060, 0x0000000f },
@@ -266,7 +274,7 @@ static const u32 ar5416Common_9100[][2] = {
     { 0x0000832c, 0x00000007 },
     { 0x00008330, 0x00000302 },
     { 0x00008334, 0x00000e00 },
-    { 0x00008338, 0x00070000 },
+    { 0x00008338, 0x00000000 },
     { 0x0000833c, 0x00000000 },
     { 0x00008340, 0x000107ff },
     { 0x00009808, 0x00000000 },
@@ -277,7 +285,7 @@ static const u32 ar5416Common_9100[][2] = {
     { 0x0000982c, 0x0000a000 },
     { 0x00009830, 0x00000000 },
     { 0x0000983c, 0x00200400 },
-    { 0x00009840, 0x206a002e },
+    { 0x00009840, 0x206a01ae },
     { 0x0000984c, 0x1284233c },
     { 0x00009854, 0x00000859 },
     { 0x00009900, 0x00000000 },
@@ -295,8 +303,6 @@ static const u32 ar5416Common_9100[][2] = {
     { 0x0000993c, 0x00000000 },
     { 0x00009948, 0x9280b212 },
     { 0x0000994c, 0x00020028 },
-    { 0x00009954, 0x5d50e188 },
-    { 0x00009958, 0x00081fff },
     { 0x0000c95c, 0x004b6a8e },
     { 0x0000c968, 0x000003ce },
     { 0x00009970, 0x190fb515 },
@@ -313,14 +319,14 @@ static const u32 ar5416Common_9100[][2] = {
     { 0x0000999c, 0x00000000 },
     { 0x000099a0, 0x00000000 },
     { 0x000099a4, 0x00000001 },
-    { 0x000099a8, 0x001fff00 },
-    { 0x000099ac, 0x00000000 },
+    { 0x000099a8, 0x201fff00 },
+    { 0x000099ac, 0x006f0000 },
     { 0x000099b0, 0x03051000 },
     { 0x000099dc, 0x00000000 },
     { 0x000099e0, 0x00000200 },
     { 0x000099e4, 0xaaaaaaaa },
     { 0x000099e8, 0x3c466478 },
-    { 0x000099ec, 0x000000aa },
+    { 0x000099ec, 0x0cc80caa },
     { 0x000099fc, 0x00001042 },
     { 0x00009b00, 0x00000000 },
     { 0x00009b04, 0x00000001 },
@@ -391,11 +397,11 @@ static const u32 ar5416Common_9100[][2] = {
     { 0x0000a218, 0x009c4060 },
     { 0x0000a220, 0x018830c6 },
     { 0x0000a224, 0x00000400 },
-    { 0x0000a228, 0x00000bb5 },
-    { 0x0000a22c, 0x00000011 },
+    { 0x0000a228, 0x001a0bb5 },
+    { 0x0000a22c, 0x00000000 },
     { 0x0000a234, 0x20202020 },
     { 0x0000a238, 0x20202020 },
-    { 0x0000a23c, 0x13c889af },
+    { 0x0000a23c, 0x13c889ae },
     { 0x0000a240, 0x38490a20 },
     { 0x0000a244, 0x00007bb6 },
     { 0x0000a248, 0x0fff3ffc },
@@ -405,13 +411,13 @@ static const u32 ar5416Common_9100[][2] = {
     { 0x0000a258, 0x0cc75380 },
     { 0x0000a25c, 0x0f0f0f01 },
     { 0x0000a260, 0xdfa91f01 },
-    { 0x0000a268, 0x00000000 },
+    { 0x0000a268, 0x00000001 },
     { 0x0000a26c, 0x0ebae9c6 },
     { 0x0000b26c, 0x0ebae9c6 },
     { 0x0000c26c, 0x0ebae9c6 },
     { 0x0000d270, 0x00820820 },
     { 0x0000a278, 0x1ce739ce },
-    { 0x0000a27c, 0x051701ce },
+    { 0x0000a27c, 0x050701ce },
     { 0x0000a338, 0x00000000 },
     { 0x0000a33c, 0x00000000 },
     { 0x0000a340, 0x00000000 },
@@ -420,7 +426,7 @@ static const u32 ar5416Common_9100[][2] = {
     { 0x0000a34c, 0x3fffffff },
     { 0x0000a350, 0x3fffffff },
     { 0x0000a354, 0x0003ffff },
-    { 0x0000a358, 0x79a8aa1f },
+    { 0x0000a358, 0x79a8aa33 },
     { 0x0000d35c, 0x07ffffef },
     { 0x0000d360, 0x0fffffe7 },
     { 0x0000d364, 0x17ffffe5 },
@@ -432,7 +438,7 @@ static const u32 ar5416Common_9100[][2] = {
     { 0x0000d37c, 0x7fffffe2 },
     { 0x0000d380, 0x7f3c7bba },
     { 0x0000d384, 0xf3307ff0 },
-    { 0x0000a388, 0x08000000 },
+    { 0x0000a388, 0x0c000000 },
     { 0x0000a38c, 0x20202020 },
     { 0x0000a390, 0x20202020 },
     { 0x0000a394, 0x1ce739ce },
@@ -529,13 +535,13 @@ static const u32 ar5416BB_RfGain_9100[][3] = {
 };
 
 static const u32 ar5416Bank1_9100[][2] = {
-    { 0x000098b0, 0x02108421 },
-    { 0x000098ec, 0x00000008 },
+    { 0x000098b0, 0x02108421},
+    { 0x000098ec, 0x00000008},
 };
 
 static const u32 ar5416Bank2_9100[][2] = {
-    { 0x000098b0, 0x0e73ff17 },
-    { 0x000098e0, 0x00000420 },
+    { 0x000098b0, 0x0e73ff17},
+    { 0x000098e0, 0x00000420},
 };
 
 static const u32 ar5416Bank3_9100[][3] = {
@@ -543,7 +549,6 @@ static const u32 ar5416Bank3_9100[][3] = {
 };
 
 static const u32 ar5416Bank6_9100[][3] = {
-
     { 0x0000989c, 0x00000000, 0x00000000 },
     { 0x0000989c, 0x00000000, 0x00000000 },
     { 0x0000989c, 0x00000000, 0x00000000 },
@@ -555,7 +560,7 @@ static const u32 ar5416Bank6_9100[][3] = {
     { 0x0000989c, 0x00ff0000, 0x00ff0000 },
     { 0x0000989c, 0x00ff0000, 0x00ff0000 },
     { 0x0000989c, 0x00ff0000, 0x00ff0000 },
-    { 0x0000989c, 0x40ff0000, 0x40ff0000 },
+    { 0x0000989c, 0x00ff0000, 0x00ff0000 },
     { 0x0000989c, 0x005f0000, 0x005f0000 },
     { 0x0000989c, 0x00870000, 0x00870000 },
     { 0x0000989c, 0x00f90000, 0x00f90000 },
@@ -566,15 +571,15 @@ static const u32 ar5416Bank6_9100[][3] = {
     { 0x0000989c, 0x00110000, 0x00110000 },
     { 0x0000989c, 0x006100a8, 0x006100a8 },
     { 0x0000989c, 0x004210a2, 0x004210a2 },
-    { 0x0000989c, 0x0014008f, 0x0014008f },
-    { 0x0000989c, 0x00c40003, 0x00c40003 },
+    { 0x0000989c, 0x0014000f, 0x0014000f },
+    { 0x0000989c, 0x00c40002, 0x00c40002 },
     { 0x0000989c, 0x003000f2, 0x003000f2 },
     { 0x0000989c, 0x00440016, 0x00440016 },
     { 0x0000989c, 0x00410040, 0x00410040 },
-    { 0x0000989c, 0x0001805e, 0x0001805e },
-    { 0x0000989c, 0x0000c0ab, 0x0000c0ab },
-    { 0x0000989c, 0x000000f1, 0x000000f1 },
-    { 0x0000989c, 0x00002081, 0x00002081 },
+    { 0x0000989c, 0x000180d6, 0x000180d6 },
+    { 0x0000989c, 0x0000c0aa, 0x0000c0aa },
+    { 0x0000989c, 0x000000b1, 0x000000b1 },
+    { 0x0000989c, 0x00002000, 0x00002000 },
     { 0x0000989c, 0x000000d4, 0x000000d4 },
     { 0x000098d0, 0x0000000f, 0x0010000f },
 };
@@ -602,7 +607,7 @@ static const u32 ar5416Bank6TPC_9100[][3] = {
     { 0x0000989c, 0x00110000, 0x00110000 },
     { 0x0000989c, 0x006100a8, 0x006100a8 },
     { 0x0000989c, 0x00423022, 0x00423022 },
-    { 0x0000989c, 0x201400df, 0x201400df },
+    { 0x0000989c, 0x2014008f, 0x2014008f },
     { 0x0000989c, 0x00c40002, 0x00c40002 },
     { 0x0000989c, 0x003000f2, 0x003000f2 },
     { 0x0000989c, 0x00440016, 0x00440016 },
@@ -610,7 +615,7 @@ static const u32 ar5416Bank6TPC_9100[][3] = {
     { 0x0000989c, 0x0001805e, 0x0001805e },
     { 0x0000989c, 0x0000c0ab, 0x0000c0ab },
     { 0x0000989c, 0x000000e1, 0x000000e1 },
-    { 0x0000989c, 0x00007081, 0x00007081 },
+    { 0x0000989c, 0x00007080, 0x00007080 },
     { 0x0000989c, 0x000000d4, 0x000000d4 },
     { 0x000098d0, 0x0000000f, 0x0010000f },
 };
@@ -622,43 +627,38 @@ static const u32 ar5416Bank7_9100[][2] = {
 };
 
 static const u32 ar5416Addac_9100[][2] = {
-    {0x0000989c,  0x00000000 },
-    {0x0000989c,  0x00000003 },
-    {0x0000989c,  0x00000000 },
-    {0x0000989c,  0x0000000c },
-    {0x0000989c,  0x00000000 },
-    {0x0000989c,  0x00000030 },
-    {0x0000989c,  0x00000000 },
-    {0x0000989c,  0x00000000 },
-    {0x0000989c,  0x00000000 },
-    {0x0000989c,  0x00000000 },
-    {0x0000989c,  0x00000000 },
-    {0x0000989c,  0x00000000 },
-    {0x0000989c,  0x00000000 },
-    {0x0000989c,  0x00000000 },
-    {0x0000989c,  0x00000000 },
-    {0x0000989c,  0x00000000 },
-    {0x0000989c,  0x00000000 },
-    {0x0000989c,  0x00000000 },
-    {0x0000989c,  0x00000060 },
-    {0x0000989c,  0x00000000 },
-    {0x0000989c,  0x00000000 },
-    {0x0000989c,  0x00000000 },
-    {0x0000989c,  0x00000000 },
-    {0x0000989c,  0x00000000 },
-    {0x0000989c,  0x00000000 },
-    {0x0000989c,  0x00000000 },
-    {0x0000989c,  0x00000000 },
-    {0x0000989c,  0x00000000 },
-    {0x0000989c,  0x00000000 },
-    {0x0000989c,  0x00000000 },
-    {0x0000989c,  0x00000000 },
-    {0x0000989c,  0x00000058 },
-    {0x0000989c,  0x00000000 },
-    {0x0000989c,  0x00000000 },
-    {0x0000989c,  0x00000000 },
-    {0x0000989c,  0x00000000 },
-    {0x000098cc,  0x00000000 },
+    {0x0000989c, 0x00000000 },
+    {0x0000989c, 0x00000000 },
+    {0x0000989c, 0x00000000 },
+    {0x0000989c, 0x00000000 },
+    {0x0000989c, 0x00000000 },
+    {0x0000989c, 0x00000000 },
+    {0x0000989c, 0x00000000 },
+    {0x0000989c, 0x00000010 },
+    {0x0000989c, 0x00000000 },
+    {0x0000989c, 0x00000000 },
+    {0x0000989c, 0x00000000 },
+    {0x0000989c, 0x00000000 },
+    {0x0000989c, 0x00000000 },
+    {0x0000989c, 0x00000000 },
+    {0x0000989c, 0x00000000 },
+    {0x0000989c, 0x00000000 },
+    {0x0000989c, 0x00000000 },
+    {0x0000989c, 0x00000000 },
+    {0x0000989c, 0x00000000 },
+    {0x0000989c, 0x00000000 },
+    {0x0000989c, 0x00000000 },
+    {0x0000989c, 0x000000c0 },
+    {0x0000989c, 0x00000015 },
+    {0x0000989c, 0x00000000 },
+    {0x0000989c, 0x00000000 },
+    {0x0000989c, 0x00000000 },
+    {0x0000989c, 0x00000000 },
+    {0x0000989c, 0x00000000 },
+    {0x0000989c, 0x00000000 },
+    {0x0000989c, 0x00000000 },
+    {0x0000989c, 0x00000000 },
+    {0x000098cc, 0x00000000 },
 };
 
 static const u32 ar5416Modes[][6] = {
@@ -674,48 +674,38 @@ static const u32 ar5416Modes[][6] = {
     { 0x00009828, 0x0a020001, 0x0a020001, 0x0a020001, 0x0a020001, 0x0a020001 },
     { 0x00009834, 0x00000e0e, 0x00000e0e, 0x00000e0e, 0x00000e0e, 0x00000e0e },
     { 0x00009838, 0x00000007, 0x00000007, 0x00000007, 0x00000007, 0x00000007 },
-    { 0x00009844, 0x0372161e, 0x0372161e, 0x037216a0, 0x037216a0, 0x037216a0 },
+    { 0x00009844, 0x1372161e, 0x1372161e, 0x137216a0, 0x137216a0, 0x137216a0 },
     { 0x00009848, 0x001a6a65, 0x001a6a65, 0x00197a68, 0x00197a68, 0x00197a68 },
     { 0x0000a848, 0x001a6a65, 0x001a6a65, 0x00197a68, 0x00197a68, 0x00197a68 },
     { 0x0000b848, 0x001a6a65, 0x001a6a65, 0x00197a68, 0x00197a68, 0x00197a68 },
-    { 0x00009850, 0x6d48b4e2, 0x6d48b4e2, 0x6d48b0e2, 0x6d48b0e2, 0x6d48b0e2 },
-    { 0x00009858, 0x7ec82d2e, 0x7ec82d2e, 0x7ec86d2e, 0x7ec84d2e, 0x7ec82d2e },
-    { 0x0000985c, 0x3139605e, 0x3139605e, 0x3139605e, 0x3139605e, 0x3139605e },
-    { 0x00009860, 0x00048d18, 0x00048d18, 0x00048d20, 0x00048d20, 0x00048d18 },
+    { 0x00009850, 0x6c48b4e0, 0x6c48b4e0, 0x6c48b0de, 0x6c48b0de, 0x6c48b0de },
+    { 0x00009858, 0x7ec82d2e, 0x7ec82d2e, 0x7ec82d2e, 0x7ec82d2e, 0x7ec82d2e },
+    { 0x0000985c, 0x31395d5e, 0x31395d5e, 0x31395d5e, 0x31395d5e, 0x31395d5e },
+    { 0x00009860, 0x00049d18, 0x00049d18, 0x00049d18, 0x00049d18, 0x00049d18 },
     { 0x0000c864, 0x0001ce00, 0x0001ce00, 0x0001ce00, 0x0001ce00, 0x0001ce00 },
-    { 0x00009868, 0x409a40d0, 0x409a40d0, 0x409a40d0, 0x409a40d0, 0x409a40d0 },
+    { 0x00009868, 0x409a4190, 0x409a4190, 0x409a4190, 0x409a4190, 0x409a4190 },
     { 0x0000986c, 0x050cb081, 0x050cb081, 0x050cb081, 0x050cb081, 0x050cb081 },
-    { 0x00009914, 0x000007d0, 0x000007d0, 0x00000898, 0x00000898, 0x000007d0 },
-    { 0x00009918, 0x0000000a, 0x00000014, 0x00000016, 0x0000000b, 0x00000016 },
-    { 0x00009924, 0xd00a8a07, 0xd00a8a07, 0xd00a8a11, 0xd00a8a0d, 0xd00a8a0d },
-    { 0x00009940, 0x00754604, 0x00754604, 0xfff81204, 0xfff81204, 0xfff81204 },
-    { 0x00009944, 0xdfb81020, 0xdfb81020, 0xdfb81020, 0xdfb81020, 0xdfb81020 },
-    { 0x00009954, 0x5f3ca3de, 0x5f3ca3de, 0xe250a51e, 0xe250a51e, 0xe250a51e },
-    { 0x00009958, 0x2108ecff, 0x2108ecff, 0x3388ffff, 0x3388ffff, 0x3388ffff },
-#ifdef TB243
-    { 0x00009960, 0x00000900, 0x00000900, 0x00009b40, 0x00009b40, 0x00012d80 },
-    { 0x0000a960, 0x00000900, 0x00000900, 0x00009b40, 0x00009b40, 0x00012d80 },
-    { 0x0000b960, 0x00000900, 0x00000900, 0x00009b40, 0x00009b40, 0x00012d80 },
-    { 0x00009964, 0x00000000, 0x00000000, 0x00002210, 0x00002210, 0x00001120 },
-#else
-    { 0x00009960, 0x0001bfc0, 0x0001bfc0, 0x0001bfc0, 0x0001bfc0, 0x0001bfc0 },
-    { 0x0000a960, 0x0001bfc0, 0x0001bfc0, 0x0001bfc0, 0x0001bfc0, 0x0001bfc0 },
-    { 0x0000b960, 0x0001bfc0, 0x0001bfc0, 0x0001bfc0, 0x0001bfc0, 0x0001bfc0 },
-    { 0x00009964, 0x00001120, 0x00001120, 0x00001120, 0x00001120, 0x00001120 },
-#endif
-    { 0x0000c9bc, 0x001a0600, 0x001a0600, 0x001a1000, 0x001a0c00, 0x001a0c00 },
+    { 0x00009914, 0x000007d0, 0x00000fa0, 0x00001130, 0x00000898, 0x000007d0 },
+    { 0x00009918, 0x000001b8, 0x00000370, 0x00000268, 0x00000134, 0x00000134 },
+    { 0x00009924, 0xd0058a0b, 0xd0058a0b, 0xd0058a0b, 0xd0058a0b, 0xd0058a0b },
+    { 0x00009944, 0xffb81020, 0xffb81020, 0xffb81020, 0xffb81020, 0xffb81020 },
+    { 0x00009960, 0x00000900, 0x00000900, 0x00012d80, 0x00012d80, 0x00012d80 },
+    { 0x0000a960, 0x00000900, 0x00000900, 0x00012d80, 0x00012d80, 0x00012d80 },
+    { 0x0000b960, 0x00000900, 0x00000900, 0x00012d80, 0x00012d80, 0x00012d80 },
+    { 0x00009964, 0x00000000, 0x00000000, 0x00001120, 0x00001120, 0x00001120 },
+    { 0x0000c9bc, 0x001a0a00, 0x001a0a00, 0x001a0a00, 0x001a0a00, 0x001a0a00 },
     { 0x000099c0, 0x038919be, 0x038919be, 0x038919be, 0x038919be, 0x038919be },
     { 0x000099c4, 0x06336f77, 0x06336f77, 0x06336f77, 0x06336f77, 0x06336f77 },
-    { 0x000099c8, 0x60f65329, 0x60f65329, 0x60f65329, 0x60f65329, 0x60f65329 },
+    { 0x000099c8, 0x60f6532c, 0x60f6532c, 0x60f6532c, 0x60f6532c, 0x60f6532c },
     { 0x000099cc, 0x08f186c8, 0x08f186c8, 0x08f186c8, 0x08f186c8, 0x08f186c8 },
     { 0x000099d0, 0x00046384, 0x00046384, 0x00046384, 0x00046384, 0x00046384 },
     { 0x000099d4, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 },
     { 0x000099d8, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 },
     { 0x0000a204, 0x00000880, 0x00000880, 0x00000880, 0x00000880, 0x00000880 },
     { 0x0000a208, 0xd6be4788, 0xd6be4788, 0xd03e4788, 0xd03e4788, 0xd03e4788 },
-    { 0x0000a20c, 0x002fc160, 0x002fc160, 0x002ac120, 0x002ac120, 0x002ac120 },
-    { 0x0000b20c, 0x002fc160, 0x002fc160, 0x002ac120, 0x002ac120, 0x002ac120 },
-    { 0x0000c20c, 0x002fc160, 0x002fc160, 0x002ac120, 0x002ac120, 0x002ac120 },
+    { 0x0000a20c, 0x002ec1e0, 0x002ec1e0, 0x002ac120, 0x002ac120, 0x002ac120 },
+    { 0x0000b20c, 0x002ec1e0, 0x002ec1e0, 0x002ac120, 0x002ac120, 0x002ac120 },
+    { 0x0000c20c, 0x002ec1e0, 0x002ec1e0, 0x002ac120, 0x002ac120, 0x002ac120 },
     { 0x0000a21c, 0x1883800a, 0x1883800a, 0x1883800a, 0x1883800a, 0x1883800a },
     { 0x0000a230, 0x00000000, 0x00000000, 0x00000210, 0x00000108, 0x00000000 },
     { 0x0000a274, 0x0a1a9caa, 0x0a1a9caa, 0x0a1a7caa, 0x0a1a7caa, 0x0a1a7caa },
@@ -817,8 +807,10 @@ static const u32 ar5416Common[][2] = {
     { 0x000013fc, 0x00000000 },
     { 0x0000143c, 0x00000000 },
     { 0x0000147c, 0x00000000 },
-    { 0x00020010, 0x00000003 },
-    { 0x00020038, 0x000004c2 },
+    { 0x00004030, 0x00000002 },
+    { 0x0000403c, 0x00000002 },
+    { 0x00007010, 0x00000000 },
+    { 0x00007038, 0x000004c2 },
     { 0x00008004, 0x00000000 },
     { 0x00008008, 0x00000000 },
     { 0x0000800c, 0x00000000 },
@@ -827,7 +819,7 @@ static const u32 ar5416Common[][2] = {
     { 0x00008038, 0x00000000 },
     { 0x0000803c, 0x00000000 },
     { 0x00008048, 0x40000000 },
-    { 0x00008054, 0x00004000 },
+    { 0x00008054, 0x00000000 },
     { 0x00008058, 0x00000000 },
     { 0x0000805c, 0x000fc78f },
     { 0x00008060, 0x0000000f },
@@ -862,7 +854,7 @@ static const u32 ar5416Common[][2] = {
     { 0x00008134, 0x00000000 },
     { 0x00008138, 0x00000000 },
     { 0x0000813c, 0x00000000 },
-    { 0x00008144, 0x00000000 },
+    { 0x00008144, 0xffffffff },
     { 0x00008168, 0x00000000 },
     { 0x0000816c, 0x00000000 },
     { 0x00008170, 0x32143320 },
@@ -921,7 +913,7 @@ static const u32 ar5416Common[][2] = {
     { 0x0000832c, 0x00000007 },
     { 0x00008330, 0x00000302 },
     { 0x00008334, 0x00000e00 },
-    { 0x00008338, 0x00000000 },
+    { 0x00008338, 0x00070000 },
     { 0x0000833c, 0x00000000 },
     { 0x00008340, 0x000107ff },
     { 0x00009808, 0x00000000 },
@@ -932,7 +924,7 @@ static const u32 ar5416Common[][2] = {
     { 0x0000982c, 0x0000a000 },
     { 0x00009830, 0x00000000 },
     { 0x0000983c, 0x00200400 },
-    { 0x00009840, 0x206a01ae },
+    { 0x00009840, 0x206a002e },
     { 0x0000984c, 0x1284233c },
     { 0x00009854, 0x00000859 },
     { 0x00009900, 0x00000000 },
@@ -950,6 +942,8 @@ static const u32 ar5416Common[][2] = {
     { 0x0000993c, 0x00000000 },
     { 0x00009948, 0x9280b212 },
     { 0x0000994c, 0x00020028 },
+    { 0x00009954, 0x5d50e188 },
+    { 0x00009958, 0x00081fff },
     { 0x0000c95c, 0x004b6a8e },
     { 0x0000c968, 0x000003ce },
     { 0x00009970, 0x190fb515 },
@@ -966,14 +960,14 @@ static const u32 ar5416Common[][2] = {
     { 0x0000999c, 0x00000000 },
     { 0x000099a0, 0x00000000 },
     { 0x000099a4, 0x00000001 },
-    { 0x000099a8, 0x201fff00 },
-    { 0x000099ac, 0x006f0000 },
+    { 0x000099a8, 0x001fff00 },
+    { 0x000099ac, 0x00000000 },
     { 0x000099b0, 0x03051000 },
     { 0x000099dc, 0x00000000 },
     { 0x000099e0, 0x00000200 },
     { 0x000099e4, 0xaaaaaaaa },
     { 0x000099e8, 0x3c466478 },
-    { 0x000099ec, 0x0cc80caa },
+    { 0x000099ec, 0x000000aa },
     { 0x000099fc, 0x00001042 },
     { 0x00009b00, 0x00000000 },
     { 0x00009b04, 0x00000001 },
@@ -1044,11 +1038,11 @@ static const u32 ar5416Common[][2] = {
     { 0x0000a218, 0x009c4060 },
     { 0x0000a220, 0x018830c6 },
     { 0x0000a224, 0x00000400 },
-    { 0x0000a228, 0x001a0bb5 },
-    { 0x0000a22c, 0x00000000 },
+    { 0x0000a228, 0x00000bb5 },
+    { 0x0000a22c, 0x00000011 },
     { 0x0000a234, 0x20202020 },
     { 0x0000a238, 0x20202020 },
-    { 0x0000a23c, 0x13c889ae },
+    { 0x0000a23c, 0x13c889af },
     { 0x0000a240, 0x38490a20 },
     { 0x0000a244, 0x00007bb6 },
     { 0x0000a248, 0x0fff3ffc },
@@ -1058,13 +1052,13 @@ static const u32 ar5416Common[][2] = {
     { 0x0000a258, 0x0cc75380 },
     { 0x0000a25c, 0x0f0f0f01 },
     { 0x0000a260, 0xdfa91f01 },
-    { 0x0000a268, 0x00000001 },
+    { 0x0000a268, 0x00000000 },
     { 0x0000a26c, 0x0ebae9c6 },
     { 0x0000b26c, 0x0ebae9c6 },
     { 0x0000c26c, 0x0ebae9c6 },
     { 0x0000d270, 0x00820820 },
     { 0x0000a278, 0x1ce739ce },
-    { 0x0000a27c, 0x050701ce },
+    { 0x0000a27c, 0x051701ce },
     { 0x0000a338, 0x00000000 },
     { 0x0000a33c, 0x00000000 },
     { 0x0000a340, 0x00000000 },
@@ -1073,7 +1067,7 @@ static const u32 ar5416Common[][2] = {
     { 0x0000a34c, 0x3fffffff },
     { 0x0000a350, 0x3fffffff },
     { 0x0000a354, 0x0003ffff },
-    { 0x0000a358, 0x79a8aa33 },
+    { 0x0000a358, 0x79a8aa1f },
     { 0x0000d35c, 0x07ffffef },
     { 0x0000d360, 0x0fffffe7 },
     { 0x0000d364, 0x17ffffe5 },
@@ -1085,7 +1079,7 @@ static const u32 ar5416Common[][2] = {
     { 0x0000d37c, 0x7fffffe2 },
     { 0x0000d380, 0x7f3c7bba },
     { 0x0000d384, 0xf3307ff0 },
-    { 0x0000a388, 0x0c000000 },
+    { 0x0000a388, 0x08000000 },
     { 0x0000a38c, 0x20202020 },
     { 0x0000a390, 0x20202020 },
     { 0x0000a394, 0x1ce739ce },
@@ -1182,13 +1176,13 @@ static const u32 ar5416BB_RfGain[][3] = {
 };
 
 static const u32 ar5416Bank1[][2] = {
-    { 0x000098b0, 0x02108421},
-    { 0x000098ec, 0x00000008},
+    { 0x000098b0, 0x02108421 },
+    { 0x000098ec, 0x00000008 },
 };
 
 static const u32 ar5416Bank2[][2] = {
-    { 0x000098b0, 0x0e73ff17},
-    { 0x000098e0, 0x00000420},
+    { 0x000098b0, 0x0e73ff17 },
+    { 0x000098e0, 0x00000420 },
 };
 
 static const u32 ar5416Bank3[][3] = {
@@ -1196,7 +1190,6 @@ static const u32 ar5416Bank3[][3] = {
 };
 
 static const u32 ar5416Bank6[][3] = {
-
     { 0x0000989c, 0x00000000, 0x00000000 },
     { 0x0000989c, 0x00000000, 0x00000000 },
     { 0x0000989c, 0x00000000, 0x00000000 },
@@ -1208,7 +1201,7 @@ static const u32 ar5416Bank6[][3] = {
     { 0x0000989c, 0x00ff0000, 0x00ff0000 },
     { 0x0000989c, 0x00ff0000, 0x00ff0000 },
     { 0x0000989c, 0x00ff0000, 0x00ff0000 },
-    { 0x0000989c, 0x00ff0000, 0x00ff0000 },
+    { 0x0000989c, 0x40ff0000, 0x40ff0000 },
     { 0x0000989c, 0x005f0000, 0x005f0000 },
     { 0x0000989c, 0x00870000, 0x00870000 },
     { 0x0000989c, 0x00f90000, 0x00f90000 },
@@ -1219,22 +1212,20 @@ static const u32 ar5416Bank6[][3] = {
     { 0x0000989c, 0x00110000, 0x00110000 },
     { 0x0000989c, 0x006100a8, 0x006100a8 },
     { 0x0000989c, 0x004210a2, 0x004210a2 },
-    { 0x0000989c, 0x0014000f, 0x0014000f },
-    { 0x0000989c, 0x00c40002, 0x00c40002 },
+    { 0x0000989c, 0x0014008f, 0x0014008f },
+    { 0x0000989c, 0x00c40003, 0x00c40003 },
     { 0x0000989c, 0x003000f2, 0x003000f2 },
     { 0x0000989c, 0x00440016, 0x00440016 },
     { 0x0000989c, 0x00410040, 0x00410040 },
-    { 0x0000989c, 0x000180d6, 0x000180d6 },
-    { 0x0000989c, 0x0000c0aa, 0x0000c0aa },
-    { 0x0000989c, 0x000000b1, 0x000000b1 },
-    { 0x0000989c, 0x00002000, 0x00002000 },
+    { 0x0000989c, 0x0001805e, 0x0001805e },
+    { 0x0000989c, 0x0000c0ab, 0x0000c0ab },
+    { 0x0000989c, 0x000000f1, 0x000000f1 },
+    { 0x0000989c, 0x00002081, 0x00002081 },
     { 0x0000989c, 0x000000d4, 0x000000d4 },
     { 0x000098d0, 0x0000000f, 0x0010000f },
 };
 
-
 static const u32 ar5416Bank6TPC[][3] = {
-
     { 0x0000989c, 0x00000000, 0x00000000 },
     { 0x0000989c, 0x00000000, 0x00000000 },
     { 0x0000989c, 0x00000000, 0x00000000 },
@@ -1257,7 +1248,7 @@ static const u32 ar5416Bank6TPC[][3] = {
     { 0x0000989c, 0x00110000, 0x00110000 },
     { 0x0000989c, 0x006100a8, 0x006100a8 },
     { 0x0000989c, 0x00423022, 0x00423022 },
-    { 0x0000989c, 0x2014008f, 0x2014008f },
+    { 0x0000989c, 0x201400df, 0x201400df },
     { 0x0000989c, 0x00c40002, 0x00c40002 },
     { 0x0000989c, 0x003000f2, 0x003000f2 },
     { 0x0000989c, 0x00440016, 0x00440016 },
@@ -1265,7 +1256,7 @@ static const u32 ar5416Bank6TPC[][3] = {
     { 0x0000989c, 0x0001805e, 0x0001805e },
     { 0x0000989c, 0x0000c0ab, 0x0000c0ab },
     { 0x0000989c, 0x000000e1, 0x000000e1 },
-    { 0x0000989c, 0x00007080, 0x00007080 },
+    { 0x0000989c, 0x00007081, 0x00007081 },
     { 0x0000989c, 0x000000d4, 0x000000d4 },
     { 0x000098d0, 0x0000000f, 0x0010000f },
 };
@@ -1277,38 +1268,43 @@ static const u32 ar5416Bank7[][2] = {
 };
 
 static const u32 ar5416Addac[][2] = {
-    {0x0000989c, 0x00000000 },
-    {0x0000989c, 0x00000000 },
-    {0x0000989c, 0x00000000 },
-    {0x0000989c, 0x00000000 },
-    {0x0000989c, 0x00000000 },
-    {0x0000989c, 0x00000000 },
-    {0x0000989c, 0x00000000 },
-    {0x0000989c, 0x00000010 },
-    {0x0000989c, 0x00000000 },
-    {0x0000989c, 0x00000000 },
-    {0x0000989c, 0x00000000 },
-    {0x0000989c, 0x00000000 },
-    {0x0000989c, 0x00000000 },
-    {0x0000989c, 0x00000000 },
-    {0x0000989c, 0x00000000 },
-    {0x0000989c, 0x00000000 },
-    {0x0000989c, 0x00000000 },
-    {0x0000989c, 0x00000000 },
-    {0x0000989c, 0x00000000 },
-    {0x0000989c, 0x00000000 },
-    {0x0000989c, 0x00000000 },
-    {0x0000989c, 0x000000c0 },
-    {0x0000989c, 0x00000015 },
-    {0x0000989c, 0x00000000 },
-    {0x0000989c, 0x00000000 },
-    {0x0000989c, 0x00000000 },
-    {0x0000989c, 0x00000000 },
-    {0x0000989c, 0x00000000 },
-    {0x0000989c, 0x00000000 },
-    {0x0000989c, 0x00000000 },
-    {0x0000989c, 0x00000000 },
-    {0x000098cc, 0x00000000 },
+    {0x0000989c,  0x00000000 },
+    {0x0000989c,  0x00000003 },
+    {0x0000989c,  0x00000000 },
+    {0x0000989c,  0x0000000c },
+    {0x0000989c,  0x00000000 },
+    {0x0000989c,  0x00000030 },
+    {0x0000989c,  0x00000000 },
+    {0x0000989c,  0x00000000 },
+    {0x0000989c,  0x00000000 },
+    {0x0000989c,  0x00000000 },
+    {0x0000989c,  0x00000000 },
+    {0x0000989c,  0x00000000 },
+    {0x0000989c,  0x00000000 },
+    {0x0000989c,  0x00000000 },
+    {0x0000989c,  0x00000000 },
+    {0x0000989c,  0x00000000 },
+    {0x0000989c,  0x00000000 },
+    {0x0000989c,  0x00000000 },
+    {0x0000989c,  0x00000060 },
+    {0x0000989c,  0x00000000 },
+    {0x0000989c,  0x00000000 },
+    {0x0000989c,  0x00000000 },
+    {0x0000989c,  0x00000000 },
+    {0x0000989c,  0x00000000 },
+    {0x0000989c,  0x00000000 },
+    {0x0000989c,  0x00000000 },
+    {0x0000989c,  0x00000000 },
+    {0x0000989c,  0x00000000 },
+    {0x0000989c,  0x00000000 },
+    {0x0000989c,  0x00000000 },
+    {0x0000989c,  0x00000000 },
+    {0x0000989c,  0x00000058 },
+    {0x0000989c,  0x00000000 },
+    {0x0000989c,  0x00000000 },
+    {0x0000989c,  0x00000000 },
+    {0x0000989c,  0x00000000 },
+    {0x000098c4,  0x00000000 },
 };
 
 static const u32 ar5416Modes_9160[][6] = {
diff --git a/drivers/net/wireless/ath9k/reg.h b/drivers/net/wireless/ath9k/reg.h
index 91442da..cef1570 100644
--- a/drivers/net/wireless/ath9k/reg.h
+++ b/drivers/net/wireless/ath9k/reg.h
@@ -158,14 +158,6 @@
 #define AR_CST_TIMEOUT_LIMIT      0xFFFF0000
 #define AR_CST_TIMEOUT_LIMIT_S    16
 
-#define AR_SREV_VERSION_9100                  0x014
-
-#define AR_SREV_9100(ah) ((ah->hw_version.macVersion) == AR_SREV_VERSION_9100)
-#define AR_SREV_5416_V20_OR_LATER(_ah) \
-	(AR_SREV_9100((_ah)) || AR_SREV_5416_20_OR_LATER(_ah))
-#define AR_SREV_5416_V22_OR_LATER(_ah) \
-	(AR_SREV_9100((_ah)) || AR_SREV_5416_22_OR_LATER(_ah))
-
 #define AR_ISR               0x0080
 #define AR_ISR_RXOK          0x00000001
 #define AR_ISR_RXDESC        0x00000002
@@ -729,31 +721,36 @@
 #define AR_SREV_REVISION2        	      0x00000F00
 #define AR_SREV_REVISION2_S     	      8
 
-#define AR_SREV_VERSION_5416_PCI               0xD
-#define AR_SREV_VERSION_5416_PCIE              0xC
-#define AR_SREV_REVISION_5416_10               0
-#define AR_SREV_REVISION_5416_20               1
-#define AR_SREV_REVISION_5416_22               2
-#define AR_SREV_VERSION_9160        	      0x40
-#define AR_SREV_REVISION_9160_10    	      0
-#define AR_SREV_REVISION_9160_11    	      1
-#define AR_SREV_VERSION_9280                0x80
-#define AR_SREV_REVISION_9280_10            0
-#define AR_SREV_REVISION_9280_20            1
-#define AR_SREV_REVISION_9280_21            2
-#define AR_SREV_VERSION_9285                  0xC0
-#define AR_SREV_REVISION_9285_10              0
-#define AR_SREV_REVISION_9285_11              1
-#define AR_SREV_REVISION_9285_12              2
-
-#define AR_SREV_9100_OR_LATER(_ah) \
-	(((_ah)->hw_version.macVersion >= AR_SREV_VERSION_5416_PCIE))
+#define AR_SREV_VERSION_5416_PCI	0xD
+#define AR_SREV_VERSION_5416_PCIE	0xC
+#define AR_SREV_REVISION_5416_10	0
+#define AR_SREV_REVISION_5416_20	1
+#define AR_SREV_REVISION_5416_22	2
+#define AR_SREV_VERSION_9100		0x014
+#define AR_SREV_VERSION_9160		0x40
+#define AR_SREV_REVISION_9160_10	0
+#define AR_SREV_REVISION_9160_11	1
+#define AR_SREV_VERSION_9280		0x80
+#define AR_SREV_REVISION_9280_10	0
+#define AR_SREV_REVISION_9280_20	1
+#define AR_SREV_REVISION_9280_21	2
+#define AR_SREV_VERSION_9285		0xC0
+#define AR_SREV_REVISION_9285_10	0
+#define AR_SREV_REVISION_9285_11	1
+#define AR_SREV_REVISION_9285_12	2
+
+#define AR_SREV_9100(ah) ((ah->hw_version.macVersion) == AR_SREV_VERSION_9100)
+#define AR_SREV_5416_V20_OR_LATER(_ah) \
+	(AR_SREV_9100(_ah) || AR_SREV_5416_20_OR_LATER(_ah))
+#define AR_SREV_5416_V22_OR_LATER(_ah) \
+	(AR_SREV_9100(_ah) || AR_SREV_5416_22_OR_LATER(_ah))
+
 #define AR_SREV_5416_20_OR_LATER(_ah) \
 	(((_ah)->hw_version.macVersion >= AR_SREV_VERSION_9160) || \
-		((_ah)->hw_version.macRev >= AR_SREV_REVISION_5416_20))
+	 ((_ah)->hw_version.macRev >= AR_SREV_REVISION_5416_20))
 #define AR_SREV_5416_22_OR_LATER(_ah) \
 	(((_ah)->hw_version.macVersion >= AR_SREV_VERSION_9160) || \
-		((_ah)->hw_version.macRev >= AR_SREV_REVISION_5416_22))
+	 ((_ah)->hw_version.macRev >= AR_SREV_REVISION_5416_22))
 #define AR_SREV_9160(_ah) \
 	(((_ah)->hw_version.macVersion == AR_SREV_VERSION_9160))
 #define AR_SREV_9160_10_OR_LATER(_ah) \
@@ -778,14 +775,14 @@
 #define AR_SREV_9285_10_OR_LATER(_ah) \
 	(((_ah)->hw_version.macVersion >= AR_SREV_VERSION_9285))
 #define AR_SREV_9285_11(_ah) \
-	(AR_SREV_9280(ah) && \
+	(AR_SREV_9285(ah) && \
 	 ((_ah)->hw_version.macRev == AR_SREV_REVISION_9285_11))
 #define AR_SREV_9285_11_OR_LATER(_ah) \
 	(((_ah)->hw_version.macVersion > AR_SREV_VERSION_9285) || \
 	 (AR_SREV_9285(ah) && ((_ah)->hw_version.macRev >= \
 			       AR_SREV_REVISION_9285_11)))
 #define AR_SREV_9285_12(_ah) \
-	(AR_SREV_9280(ah) && \
+	(AR_SREV_9285(ah) && \
 	 ((_ah)->hw_version.macRev == AR_SREV_REVISION_9285_12))
 #define AR_SREV_9285_12_OR_LATER(_ah) \
 	(((_ah)->hw_version.macVersion > AR_SREV_VERSION_9285) || \

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

* [ath9k-devel] [RFC] ath9k: use correct init values for ar9100 devices
  2009-03-04  5:35     ` [ath9k-devel] " Sujith
  (?)
@ 2009-03-04 13:38     ` Gabor Juhos
  2009-03-04 14:21         ` Sujith
  -1 siblings, 1 reply; 27+ messages in thread
From: Gabor Juhos @ 2009-03-04 13:38 UTC (permalink / raw)
  To: ath9k-devel

Sujith ?rta:
> Sujith Manoharan wrote:
>> I'll check the initval arrays and update.
>>
> 
> Does this patch help ? I haven't tested on 9100, but 5416 works fine.

Sure, this helps because the ar9100 are using the right initvals with this.
Although I have a few comments below.

> 
> diff --git a/drivers/net/wireless/ath9k/hw.c b/drivers/net/wireless/ath9k/hw.c
> index eb750a5..d7b3c44 100644
> --- a/drivers/net/wireless/ath9k/hw.c
> +++ b/drivers/net/wireless/ath9k/hw.c
> @@ -760,7 +760,7 @@ static struct ath_hw *ath9k_hw_do_attach(u16 devid, struct ath_softc *sc,
>  			INIT_INI_ARRAY(&ah->iniAddac, ar5416Addac_9160,
>  				       ARRAY_SIZE(ar5416Addac_9160), 2);
>  		}
> -	} else if (AR_SREV_9100_OR_LATER(ah)) {
> +	} else if (AR_SREV_9100(ah)) {

Yeah, this looks better if the *_9100 arrays must be used exclusively with the
AR9100 devices.

>  		INIT_INI_ARRAY(&ah->iniModes, ar5416Modes_9100,
>  			       ARRAY_SIZE(ar5416Modes_9100), 6);
>  		INIT_INI_ARRAY(&ah->iniCommon, ar5416Common_9100,
> diff --git a/drivers/net/wireless/ath9k/initvals.h b/drivers/net/wireless/ath9k/initvals.h
> index d492363..0b579b4 100644
> --- a/drivers/net/wireless/ath9k/initvals.h
> +++ b/drivers/net/wireless/ath9k/initvals.h
> @@ -27,38 +27,48 @@ static const u32 ar5416Modes_9100[][6] = {
>      { 0x00009828, 0x0a020001, 0x0a020001, 0x0a020001, 0x0a020001, 0x0a020001 },
>      { 0x00009834, 0x00000e0e, 0x00000e0e, 0x00000e0e, 0x00000e0e, 0x00000e0e },
>      { 0x00009838, 0x00000007, 0x00000007, 0x00000007, 0x00000007, 0x00000007 },
> -    { 0x00009844, 0x1372161e, 0x1372161e, 0x137216a0, 0x137216a0, 0x137216a0 },
> +    { 0x00009844, 0x0372161e, 0x0372161e, 0x037216a0, 0x037216a0, 0x037216a0 },
>      { 0x00009848, 0x001a6a65, 0x001a6a65, 0x00197a68, 0x00197a68, 0x00197a68 },
>      { 0x0000a848, 0x001a6a65, 0x001a6a65, 0x00197a68, 0x00197a68, 0x00197a68 },
>      { 0x0000b848, 0x001a6a65, 0x001a6a65, 0x00197a68, 0x00197a68, 0x00197a68 },
> -    { 0x00009850, 0x6c48b4e0, 0x6c48b4e0, 0x6c48b0de, 0x6c48b0de, 0x6c48b0de },
> -    { 0x00009858, 0x7ec82d2e, 0x7ec82d2e, 0x7ec82d2e, 0x7ec82d2e, 0x7ec82d2e },
> -    { 0x0000985c, 0x31395d5e, 0x31395d5e, 0x31395d5e, 0x31395d5e, 0x31395d5e },
> -    { 0x00009860, 0x00049d18, 0x00049d18, 0x00049d18, 0x00049d18, 0x00049d18 },
> +    { 0x00009850, 0x6d48b4e2, 0x6d48b4e2, 0x6d48b0e2, 0x6d48b0e2, 0x6d48b0e2 },
> +    { 0x00009858, 0x7ec82d2e, 0x7ec82d2e, 0x7ec86d2e, 0x7ec84d2e, 0x7ec82d2e },
> +    { 0x0000985c, 0x3139605e, 0x3139605e, 0x3139605e, 0x3139605e, 0x3139605e },
> +    { 0x00009860, 0x00048d18, 0x00048d18, 0x00048d20, 0x00048d20, 0x00048d18 },
>      { 0x0000c864, 0x0001ce00, 0x0001ce00, 0x0001ce00, 0x0001ce00, 0x0001ce00 },
> -    { 0x00009868, 0x409a4190, 0x409a4190, 0x409a4190, 0x409a4190, 0x409a4190 },
> +    { 0x00009868, 0x409a40d0, 0x409a40d0, 0x409a40d0, 0x409a40d0, 0x409a40d0 },
>      { 0x0000986c, 0x050cb081, 0x050cb081, 0x050cb081, 0x050cb081, 0x050cb081 },
> -    { 0x00009914, 0x000007d0, 0x00000fa0, 0x00001130, 0x00000898, 0x000007d0 },
> -    { 0x00009918, 0x000001b8, 0x00000370, 0x00000268, 0x00000134, 0x00000134 },
> -    { 0x00009924, 0xd0058a0b, 0xd0058a0b, 0xd0058a0b, 0xd0058a0b, 0xd0058a0b },
> -    { 0x00009944, 0xffb81020, 0xffb81020, 0xffb81020, 0xffb81020, 0xffb81020 },
> -    { 0x00009960, 0x00000900, 0x00000900, 0x00012d80, 0x00012d80, 0x00012d80 },
> -    { 0x0000a960, 0x00000900, 0x00000900, 0x00012d80, 0x00012d80, 0x00012d80 },
> -    { 0x0000b960, 0x00000900, 0x00000900, 0x00012d80, 0x00012d80, 0x00012d80 },
> -    { 0x00009964, 0x00000000, 0x00000000, 0x00001120, 0x00001120, 0x00001120 },
> -    { 0x0000c9bc, 0x001a0a00, 0x001a0a00, 0x001a0a00, 0x001a0a00, 0x001a0a00 },
> +    { 0x00009914, 0x000007d0, 0x000007d0, 0x00000898, 0x00000898, 0x000007d0 },
> +    { 0x00009918, 0x0000000a, 0x00000014, 0x00000016, 0x0000000b, 0x00000016 },
> +    { 0x00009924, 0xd00a8a07, 0xd00a8a07, 0xd00a8a11, 0xd00a8a0d, 0xd00a8a0d },
> +    { 0x00009940, 0x00754604, 0x00754604, 0xfff81204, 0xfff81204, 0xfff81204 },
> +    { 0x00009944, 0xdfb81020, 0xdfb81020, 0xdfb81020, 0xdfb81020, 0xdfb81020 },
> +    { 0x00009954, 0x5f3ca3de, 0x5f3ca3de, 0xe250a51e, 0xe250a51e, 0xe250a51e },
> +    { 0x00009958, 0x2108ecff, 0x2108ecff, 0x3388ffff, 0x3388ffff, 0x3388ffff },
> +#ifdef TB243
> +    { 0x00009960, 0x00000900, 0x00000900, 0x00009b40, 0x00009b40, 0x00012d80 },
> +    { 0x0000a960, 0x00000900, 0x00000900, 0x00009b40, 0x00009b40, 0x00012d80 },
> +    { 0x0000b960, 0x00000900, 0x00000900, 0x00009b40, 0x00009b40, 0x00012d80 },
> +    { 0x00009964, 0x00000000, 0x00000000, 0x00002210, 0x00002210, 0x00001120 },
> +#else
> +    { 0x00009960, 0x0001bfc0, 0x0001bfc0, 0x0001bfc0, 0x0001bfc0, 0x0001bfc0 },
> +    { 0x0000a960, 0x0001bfc0, 0x0001bfc0, 0x0001bfc0, 0x0001bfc0, 0x0001bfc0 },
> +    { 0x0000b960, 0x0001bfc0, 0x0001bfc0, 0x0001bfc0, 0x0001bfc0, 0x0001bfc0 },
> +    { 0x00009964, 0x00001120, 0x00001120, 0x00001120, 0x00001120, 0x00001120 },
> +#endif
> +    { 0x0000c9bc, 0x001a0600, 0x001a0600, 0x001a1000, 0x001a0c00, 0x001a0c00 },
>      { 0x000099c0, 0x038919be, 0x038919be, 0x038919be, 0x038919be, 0x038919be },
>      { 0x000099c4, 0x06336f77, 0x06336f77, 0x06336f77, 0x06336f77, 0x06336f77 },
> -    { 0x000099c8, 0x60f6532c, 0x60f6532c, 0x60f6532c, 0x60f6532c, 0x60f6532c },
> +    { 0x000099c8, 0x60f65329, 0x60f65329, 0x60f65329, 0x60f65329, 0x60f65329 },
>      { 0x000099cc, 0x08f186c8, 0x08f186c8, 0x08f186c8, 0x08f186c8, 0x08f186c8 },
>      { 0x000099d0, 0x00046384, 0x00046384, 0x00046384, 0x00046384, 0x00046384 },
>      { 0x000099d4, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 },
>      { 0x000099d8, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 },
>      { 0x0000a204, 0x00000880, 0x00000880, 0x00000880, 0x00000880, 0x00000880 },
>      { 0x0000a208, 0xd6be4788, 0xd6be4788, 0xd03e4788, 0xd03e4788, 0xd03e4788 },
> -    { 0x0000a20c, 0x002ec1e0, 0x002ec1e0, 0x002ac120, 0x002ac120, 0x002ac120 },
> -    { 0x0000b20c, 0x002ec1e0, 0x002ec1e0, 0x002ac120, 0x002ac120, 0x002ac120 },
> -    { 0x0000c20c, 0x002ec1e0, 0x002ec1e0, 0x002ac120, 0x002ac120, 0x002ac120 },
> +    { 0x0000a20c, 0x002fc160, 0x002fc160, 0x002ac120, 0x002ac120, 0x002ac120 },
> +    { 0x0000b20c, 0x002fc160, 0x002fc160, 0x002ac120, 0x002ac120, 0x002ac120 },
> +    { 0x0000c20c, 0x002fc160, 0x002fc160, 0x002ac120, 0x002ac120, 0x002ac120 },
>      { 0x0000a21c, 0x1883800a, 0x1883800a, 0x1883800a, 0x1883800a, 0x1883800a },
>      { 0x0000a230, 0x00000000, 0x00000000, 0x00000210, 0x00000108, 0x00000000 },
>      { 0x0000a274, 0x0a1a9caa, 0x0a1a9caa, 0x0a1a7caa, 0x0a1a7caa, 0x0a1a7caa },
> @@ -160,10 +170,8 @@ static const u32 ar5416Common_9100[][2] = {
>      { 0x000013fc, 0x00000000 },
>      { 0x0000143c, 0x00000000 },
>      { 0x0000147c, 0x00000000 },
> -    { 0x00004030, 0x00000002 },
> -    { 0x0000403c, 0x00000002 },
> -    { 0x00007010, 0x00000000 },
> -    { 0x00007038, 0x000004c2 },
> +    { 0x00020010, 0x00000003 },
> +    { 0x00020038, 0x000004c2 },
>      { 0x00008004, 0x00000000 },
>      { 0x00008008, 0x00000000 },
>      { 0x0000800c, 0x00000000 },
> @@ -172,7 +180,7 @@ static const u32 ar5416Common_9100[][2] = {
>      { 0x00008038, 0x00000000 },
>      { 0x0000803c, 0x00000000 },
>      { 0x00008048, 0x40000000 },
> -    { 0x00008054, 0x00000000 },
> +    { 0x00008054, 0x00004000 },
>      { 0x00008058, 0x00000000 },
>      { 0x0000805c, 0x000fc78f },
>      { 0x00008060, 0x0000000f },
> @@ -266,7 +274,7 @@ static const u32 ar5416Common_9100[][2] = {
>      { 0x0000832c, 0x00000007 },
>      { 0x00008330, 0x00000302 },
>      { 0x00008334, 0x00000e00 },
> -    { 0x00008338, 0x00070000 },
> +    { 0x00008338, 0x00000000 },
>      { 0x0000833c, 0x00000000 },
>      { 0x00008340, 0x000107ff },
>      { 0x00009808, 0x00000000 },
> @@ -277,7 +285,7 @@ static const u32 ar5416Common_9100[][2] = {
>      { 0x0000982c, 0x0000a000 },
>      { 0x00009830, 0x00000000 },
>      { 0x0000983c, 0x00200400 },
> -    { 0x00009840, 0x206a002e },
> +    { 0x00009840, 0x206a01ae },
>      { 0x0000984c, 0x1284233c },
>      { 0x00009854, 0x00000859 },
>      { 0x00009900, 0x00000000 },
> @@ -295,8 +303,6 @@ static const u32 ar5416Common_9100[][2] = {
>      { 0x0000993c, 0x00000000 },
>      { 0x00009948, 0x9280b212 },
>      { 0x0000994c, 0x00020028 },
> -    { 0x00009954, 0x5d50e188 },
> -    { 0x00009958, 0x00081fff },
>      { 0x0000c95c, 0x004b6a8e },
>      { 0x0000c968, 0x000003ce },
>      { 0x00009970, 0x190fb515 },
> @@ -313,14 +319,14 @@ static const u32 ar5416Common_9100[][2] = {
>      { 0x0000999c, 0x00000000 },
>      { 0x000099a0, 0x00000000 },
>      { 0x000099a4, 0x00000001 },
> -    { 0x000099a8, 0x001fff00 },
> -    { 0x000099ac, 0x00000000 },
> +    { 0x000099a8, 0x201fff00 },
> +    { 0x000099ac, 0x006f0000 },
>      { 0x000099b0, 0x03051000 },
>      { 0x000099dc, 0x00000000 },
>      { 0x000099e0, 0x00000200 },
>      { 0x000099e4, 0xaaaaaaaa },
>      { 0x000099e8, 0x3c466478 },
> -    { 0x000099ec, 0x000000aa },
> +    { 0x000099ec, 0x0cc80caa },
>      { 0x000099fc, 0x00001042 },
>      { 0x00009b00, 0x00000000 },
>      { 0x00009b04, 0x00000001 },
> @@ -391,11 +397,11 @@ static const u32 ar5416Common_9100[][2] = {
>      { 0x0000a218, 0x009c4060 },
>      { 0x0000a220, 0x018830c6 },
>      { 0x0000a224, 0x00000400 },
> -    { 0x0000a228, 0x00000bb5 },
> -    { 0x0000a22c, 0x00000011 },
> +    { 0x0000a228, 0x001a0bb5 },
> +    { 0x0000a22c, 0x00000000 },
>      { 0x0000a234, 0x20202020 },
>      { 0x0000a238, 0x20202020 },
> -    { 0x0000a23c, 0x13c889af },
> +    { 0x0000a23c, 0x13c889ae },
>      { 0x0000a240, 0x38490a20 },
>      { 0x0000a244, 0x00007bb6 },
>      { 0x0000a248, 0x0fff3ffc },
> @@ -405,13 +411,13 @@ static const u32 ar5416Common_9100[][2] = {
>      { 0x0000a258, 0x0cc75380 },
>      { 0x0000a25c, 0x0f0f0f01 },
>      { 0x0000a260, 0xdfa91f01 },
> -    { 0x0000a268, 0x00000000 },
> +    { 0x0000a268, 0x00000001 },
>      { 0x0000a26c, 0x0ebae9c6 },
>      { 0x0000b26c, 0x0ebae9c6 },
>      { 0x0000c26c, 0x0ebae9c6 },
>      { 0x0000d270, 0x00820820 },
>      { 0x0000a278, 0x1ce739ce },
> -    { 0x0000a27c, 0x051701ce },
> +    { 0x0000a27c, 0x050701ce },
>      { 0x0000a338, 0x00000000 },
>      { 0x0000a33c, 0x00000000 },
>      { 0x0000a340, 0x00000000 },
> @@ -420,7 +426,7 @@ static const u32 ar5416Common_9100[][2] = {
>      { 0x0000a34c, 0x3fffffff },
>      { 0x0000a350, 0x3fffffff },
>      { 0x0000a354, 0x0003ffff },
> -    { 0x0000a358, 0x79a8aa1f },
> +    { 0x0000a358, 0x79a8aa33 },
>      { 0x0000d35c, 0x07ffffef },
>      { 0x0000d360, 0x0fffffe7 },
>      { 0x0000d364, 0x17ffffe5 },
> @@ -432,7 +438,7 @@ static const u32 ar5416Common_9100[][2] = {
>      { 0x0000d37c, 0x7fffffe2 },
>      { 0x0000d380, 0x7f3c7bba },
>      { 0x0000d384, 0xf3307ff0 },
> -    { 0x0000a388, 0x08000000 },
> +    { 0x0000a388, 0x0c000000 },
>      { 0x0000a38c, 0x20202020 },
>      { 0x0000a390, 0x20202020 },
>      { 0x0000a394, 0x1ce739ce },
> @@ -529,13 +535,13 @@ static const u32 ar5416BB_RfGain_9100[][3] = {
>  };
>  
>  static const u32 ar5416Bank1_9100[][2] = {
> -    { 0x000098b0, 0x02108421 },
> -    { 0x000098ec, 0x00000008 },
> +    { 0x000098b0, 0x02108421},
> +    { 0x000098ec, 0x00000008},
>  };
>  
>  static const u32 ar5416Bank2_9100[][2] = {
> -    { 0x000098b0, 0x0e73ff17 },
> -    { 0x000098e0, 0x00000420 },
> +    { 0x000098b0, 0x0e73ff17},
> +    { 0x000098e0, 0x00000420},
>  };
>  
>  static const u32 ar5416Bank3_9100[][3] = {
> @@ -543,7 +549,6 @@ static const u32 ar5416Bank3_9100[][3] = {
>  };
>  
>  static const u32 ar5416Bank6_9100[][3] = {
> -
>      { 0x0000989c, 0x00000000, 0x00000000 },
>      { 0x0000989c, 0x00000000, 0x00000000 },
>      { 0x0000989c, 0x00000000, 0x00000000 },
> @@ -555,7 +560,7 @@ static const u32 ar5416Bank6_9100[][3] = {
>      { 0x0000989c, 0x00ff0000, 0x00ff0000 },
>      { 0x0000989c, 0x00ff0000, 0x00ff0000 },
>      { 0x0000989c, 0x00ff0000, 0x00ff0000 },
> -    { 0x0000989c, 0x40ff0000, 0x40ff0000 },
> +    { 0x0000989c, 0x00ff0000, 0x00ff0000 },
>      { 0x0000989c, 0x005f0000, 0x005f0000 },
>      { 0x0000989c, 0x00870000, 0x00870000 },
>      { 0x0000989c, 0x00f90000, 0x00f90000 },
> @@ -566,15 +571,15 @@ static const u32 ar5416Bank6_9100[][3] = {
>      { 0x0000989c, 0x00110000, 0x00110000 },
>      { 0x0000989c, 0x006100a8, 0x006100a8 },
>      { 0x0000989c, 0x004210a2, 0x004210a2 },
> -    { 0x0000989c, 0x0014008f, 0x0014008f },
> -    { 0x0000989c, 0x00c40003, 0x00c40003 },
> +    { 0x0000989c, 0x0014000f, 0x0014000f },
> +    { 0x0000989c, 0x00c40002, 0x00c40002 },
>      { 0x0000989c, 0x003000f2, 0x003000f2 },
>      { 0x0000989c, 0x00440016, 0x00440016 },
>      { 0x0000989c, 0x00410040, 0x00410040 },
> -    { 0x0000989c, 0x0001805e, 0x0001805e },
> -    { 0x0000989c, 0x0000c0ab, 0x0000c0ab },
> -    { 0x0000989c, 0x000000f1, 0x000000f1 },
> -    { 0x0000989c, 0x00002081, 0x00002081 },
> +    { 0x0000989c, 0x000180d6, 0x000180d6 },
> +    { 0x0000989c, 0x0000c0aa, 0x0000c0aa },
> +    { 0x0000989c, 0x000000b1, 0x000000b1 },
> +    { 0x0000989c, 0x00002000, 0x00002000 },
>      { 0x0000989c, 0x000000d4, 0x000000d4 },
>      { 0x000098d0, 0x0000000f, 0x0010000f },
>  };
> @@ -602,7 +607,7 @@ static const u32 ar5416Bank6TPC_9100[][3] = {
>      { 0x0000989c, 0x00110000, 0x00110000 },
>      { 0x0000989c, 0x006100a8, 0x006100a8 },
>      { 0x0000989c, 0x00423022, 0x00423022 },
> -    { 0x0000989c, 0x201400df, 0x201400df },
> +    { 0x0000989c, 0x2014008f, 0x2014008f },
>      { 0x0000989c, 0x00c40002, 0x00c40002 },
>      { 0x0000989c, 0x003000f2, 0x003000f2 },
>      { 0x0000989c, 0x00440016, 0x00440016 },
> @@ -610,7 +615,7 @@ static const u32 ar5416Bank6TPC_9100[][3] = {
>      { 0x0000989c, 0x0001805e, 0x0001805e },
>      { 0x0000989c, 0x0000c0ab, 0x0000c0ab },
>      { 0x0000989c, 0x000000e1, 0x000000e1 },
> -    { 0x0000989c, 0x00007081, 0x00007081 },
> +    { 0x0000989c, 0x00007080, 0x00007080 },
>      { 0x0000989c, 0x000000d4, 0x000000d4 },
>      { 0x000098d0, 0x0000000f, 0x0010000f },
>  };
> @@ -622,43 +627,38 @@ static const u32 ar5416Bank7_9100[][2] = {
>  };
>  
>  static const u32 ar5416Addac_9100[][2] = {
> -    {0x0000989c,  0x00000000 },
> -    {0x0000989c,  0x00000003 },
> -    {0x0000989c,  0x00000000 },
> -    {0x0000989c,  0x0000000c },
> -    {0x0000989c,  0x00000000 },
> -    {0x0000989c,  0x00000030 },
> -    {0x0000989c,  0x00000000 },
> -    {0x0000989c,  0x00000000 },
> -    {0x0000989c,  0x00000000 },
> -    {0x0000989c,  0x00000000 },
> -    {0x0000989c,  0x00000000 },
> -    {0x0000989c,  0x00000000 },
> -    {0x0000989c,  0x00000000 },
> -    {0x0000989c,  0x00000000 },
> -    {0x0000989c,  0x00000000 },
> -    {0x0000989c,  0x00000000 },
> -    {0x0000989c,  0x00000000 },
> -    {0x0000989c,  0x00000000 },
> -    {0x0000989c,  0x00000060 },
> -    {0x0000989c,  0x00000000 },
> -    {0x0000989c,  0x00000000 },
> -    {0x0000989c,  0x00000000 },
> -    {0x0000989c,  0x00000000 },
> -    {0x0000989c,  0x00000000 },
> -    {0x0000989c,  0x00000000 },
> -    {0x0000989c,  0x00000000 },
> -    {0x0000989c,  0x00000000 },
> -    {0x0000989c,  0x00000000 },
> -    {0x0000989c,  0x00000000 },
> -    {0x0000989c,  0x00000000 },
> -    {0x0000989c,  0x00000000 },
> -    {0x0000989c,  0x00000058 },
> -    {0x0000989c,  0x00000000 },
> -    {0x0000989c,  0x00000000 },
> -    {0x0000989c,  0x00000000 },
> -    {0x0000989c,  0x00000000 },
> -    {0x000098cc,  0x00000000 },
> +    {0x0000989c, 0x00000000 },
> +    {0x0000989c, 0x00000000 },
> +    {0x0000989c, 0x00000000 },
> +    {0x0000989c, 0x00000000 },
> +    {0x0000989c, 0x00000000 },
> +    {0x0000989c, 0x00000000 },
> +    {0x0000989c, 0x00000000 },
> +    {0x0000989c, 0x00000010 },
> +    {0x0000989c, 0x00000000 },
> +    {0x0000989c, 0x00000000 },
> +    {0x0000989c, 0x00000000 },
> +    {0x0000989c, 0x00000000 },
> +    {0x0000989c, 0x00000000 },
> +    {0x0000989c, 0x00000000 },
> +    {0x0000989c, 0x00000000 },
> +    {0x0000989c, 0x00000000 },
> +    {0x0000989c, 0x00000000 },
> +    {0x0000989c, 0x00000000 },
> +    {0x0000989c, 0x00000000 },
> +    {0x0000989c, 0x00000000 },
> +    {0x0000989c, 0x00000000 },
> +    {0x0000989c, 0x000000c0 },
> +    {0x0000989c, 0x00000015 },
> +    {0x0000989c, 0x00000000 },
> +    {0x0000989c, 0x00000000 },
> +    {0x0000989c, 0x00000000 },
> +    {0x0000989c, 0x00000000 },
> +    {0x0000989c, 0x00000000 },
> +    {0x0000989c, 0x00000000 },
> +    {0x0000989c, 0x00000000 },
> +    {0x0000989c, 0x00000000 },
> +    {0x000098cc, 0x00000000 },
>  };
>  
>  static const u32 ar5416Modes[][6] = {
> @@ -674,48 +674,38 @@ static const u32 ar5416Modes[][6] = {
>      { 0x00009828, 0x0a020001, 0x0a020001, 0x0a020001, 0x0a020001, 0x0a020001 },
>      { 0x00009834, 0x00000e0e, 0x00000e0e, 0x00000e0e, 0x00000e0e, 0x00000e0e },
>      { 0x00009838, 0x00000007, 0x00000007, 0x00000007, 0x00000007, 0x00000007 },
> -    { 0x00009844, 0x0372161e, 0x0372161e, 0x037216a0, 0x037216a0, 0x037216a0 },
> +    { 0x00009844, 0x1372161e, 0x1372161e, 0x137216a0, 0x137216a0, 0x137216a0 },
>      { 0x00009848, 0x001a6a65, 0x001a6a65, 0x00197a68, 0x00197a68, 0x00197a68 },
>      { 0x0000a848, 0x001a6a65, 0x001a6a65, 0x00197a68, 0x00197a68, 0x00197a68 },
>      { 0x0000b848, 0x001a6a65, 0x001a6a65, 0x00197a68, 0x00197a68, 0x00197a68 },
> -    { 0x00009850, 0x6d48b4e2, 0x6d48b4e2, 0x6d48b0e2, 0x6d48b0e2, 0x6d48b0e2 },
> -    { 0x00009858, 0x7ec82d2e, 0x7ec82d2e, 0x7ec86d2e, 0x7ec84d2e, 0x7ec82d2e },
> -    { 0x0000985c, 0x3139605e, 0x3139605e, 0x3139605e, 0x3139605e, 0x3139605e },
> -    { 0x00009860, 0x00048d18, 0x00048d18, 0x00048d20, 0x00048d20, 0x00048d18 },
> +    { 0x00009850, 0x6c48b4e0, 0x6c48b4e0, 0x6c48b0de, 0x6c48b0de, 0x6c48b0de },
> +    { 0x00009858, 0x7ec82d2e, 0x7ec82d2e, 0x7ec82d2e, 0x7ec82d2e, 0x7ec82d2e },
> +    { 0x0000985c, 0x31395d5e, 0x31395d5e, 0x31395d5e, 0x31395d5e, 0x31395d5e },
> +    { 0x00009860, 0x00049d18, 0x00049d18, 0x00049d18, 0x00049d18, 0x00049d18 },
>      { 0x0000c864, 0x0001ce00, 0x0001ce00, 0x0001ce00, 0x0001ce00, 0x0001ce00 },
> -    { 0x00009868, 0x409a40d0, 0x409a40d0, 0x409a40d0, 0x409a40d0, 0x409a40d0 },
> +    { 0x00009868, 0x409a4190, 0x409a4190, 0x409a4190, 0x409a4190, 0x409a4190 },
>      { 0x0000986c, 0x050cb081, 0x050cb081, 0x050cb081, 0x050cb081, 0x050cb081 },
> -    { 0x00009914, 0x000007d0, 0x000007d0, 0x00000898, 0x00000898, 0x000007d0 },
> -    { 0x00009918, 0x0000000a, 0x00000014, 0x00000016, 0x0000000b, 0x00000016 },
> -    { 0x00009924, 0xd00a8a07, 0xd00a8a07, 0xd00a8a11, 0xd00a8a0d, 0xd00a8a0d },
> -    { 0x00009940, 0x00754604, 0x00754604, 0xfff81204, 0xfff81204, 0xfff81204 },
> -    { 0x00009944, 0xdfb81020, 0xdfb81020, 0xdfb81020, 0xdfb81020, 0xdfb81020 },
> -    { 0x00009954, 0x5f3ca3de, 0x5f3ca3de, 0xe250a51e, 0xe250a51e, 0xe250a51e },
> -    { 0x00009958, 0x2108ecff, 0x2108ecff, 0x3388ffff, 0x3388ffff, 0x3388ffff },
> -#ifdef TB243
> -    { 0x00009960, 0x00000900, 0x00000900, 0x00009b40, 0x00009b40, 0x00012d80 },
> -    { 0x0000a960, 0x00000900, 0x00000900, 0x00009b40, 0x00009b40, 0x00012d80 },
> -    { 0x0000b960, 0x00000900, 0x00000900, 0x00009b40, 0x00009b40, 0x00012d80 },
> -    { 0x00009964, 0x00000000, 0x00000000, 0x00002210, 0x00002210, 0x00001120 },
> -#else
> -    { 0x00009960, 0x0001bfc0, 0x0001bfc0, 0x0001bfc0, 0x0001bfc0, 0x0001bfc0 },
> -    { 0x0000a960, 0x0001bfc0, 0x0001bfc0, 0x0001bfc0, 0x0001bfc0, 0x0001bfc0 },
> -    { 0x0000b960, 0x0001bfc0, 0x0001bfc0, 0x0001bfc0, 0x0001bfc0, 0x0001bfc0 },
> -    { 0x00009964, 0x00001120, 0x00001120, 0x00001120, 0x00001120, 0x00001120 },
> -#endif
> -    { 0x0000c9bc, 0x001a0600, 0x001a0600, 0x001a1000, 0x001a0c00, 0x001a0c00 },
> +    { 0x00009914, 0x000007d0, 0x00000fa0, 0x00001130, 0x00000898, 0x000007d0 },
> +    { 0x00009918, 0x000001b8, 0x00000370, 0x00000268, 0x00000134, 0x00000134 },
> +    { 0x00009924, 0xd0058a0b, 0xd0058a0b, 0xd0058a0b, 0xd0058a0b, 0xd0058a0b },
> +    { 0x00009944, 0xffb81020, 0xffb81020, 0xffb81020, 0xffb81020, 0xffb81020 },
> +    { 0x00009960, 0x00000900, 0x00000900, 0x00012d80, 0x00012d80, 0x00012d80 },
> +    { 0x0000a960, 0x00000900, 0x00000900, 0x00012d80, 0x00012d80, 0x00012d80 },
> +    { 0x0000b960, 0x00000900, 0x00000900, 0x00012d80, 0x00012d80, 0x00012d80 },
> +    { 0x00009964, 0x00000000, 0x00000000, 0x00001120, 0x00001120, 0x00001120 },
> +    { 0x0000c9bc, 0x001a0a00, 0x001a0a00, 0x001a0a00, 0x001a0a00, 0x001a0a00 },
>      { 0x000099c0, 0x038919be, 0x038919be, 0x038919be, 0x038919be, 0x038919be },
>      { 0x000099c4, 0x06336f77, 0x06336f77, 0x06336f77, 0x06336f77, 0x06336f77 },
> -    { 0x000099c8, 0x60f65329, 0x60f65329, 0x60f65329, 0x60f65329, 0x60f65329 },
> +    { 0x000099c8, 0x60f6532c, 0x60f6532c, 0x60f6532c, 0x60f6532c, 0x60f6532c },
>      { 0x000099cc, 0x08f186c8, 0x08f186c8, 0x08f186c8, 0x08f186c8, 0x08f186c8 },
>      { 0x000099d0, 0x00046384, 0x00046384, 0x00046384, 0x00046384, 0x00046384 },
>      { 0x000099d4, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 },
>      { 0x000099d8, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 },
>      { 0x0000a204, 0x00000880, 0x00000880, 0x00000880, 0x00000880, 0x00000880 },
>      { 0x0000a208, 0xd6be4788, 0xd6be4788, 0xd03e4788, 0xd03e4788, 0xd03e4788 },
> -    { 0x0000a20c, 0x002fc160, 0x002fc160, 0x002ac120, 0x002ac120, 0x002ac120 },
> -    { 0x0000b20c, 0x002fc160, 0x002fc160, 0x002ac120, 0x002ac120, 0x002ac120 },
> -    { 0x0000c20c, 0x002fc160, 0x002fc160, 0x002ac120, 0x002ac120, 0x002ac120 },
> +    { 0x0000a20c, 0x002ec1e0, 0x002ec1e0, 0x002ac120, 0x002ac120, 0x002ac120 },
> +    { 0x0000b20c, 0x002ec1e0, 0x002ec1e0, 0x002ac120, 0x002ac120, 0x002ac120 },
> +    { 0x0000c20c, 0x002ec1e0, 0x002ec1e0, 0x002ac120, 0x002ac120, 0x002ac120 },
>      { 0x0000a21c, 0x1883800a, 0x1883800a, 0x1883800a, 0x1883800a, 0x1883800a },
>      { 0x0000a230, 0x00000000, 0x00000000, 0x00000210, 0x00000108, 0x00000000 },
>      { 0x0000a274, 0x0a1a9caa, 0x0a1a9caa, 0x0a1a7caa, 0x0a1a7caa, 0x0a1a7caa },
> @@ -817,8 +807,10 @@ static const u32 ar5416Common[][2] = {
>      { 0x000013fc, 0x00000000 },
>      { 0x0000143c, 0x00000000 },
>      { 0x0000147c, 0x00000000 },
> -    { 0x00020010, 0x00000003 },
> -    { 0x00020038, 0x000004c2 },
> +    { 0x00004030, 0x00000002 },
> +    { 0x0000403c, 0x00000002 },
> +    { 0x00007010, 0x00000000 },
> +    { 0x00007038, 0x000004c2 },
>      { 0x00008004, 0x00000000 },
>      { 0x00008008, 0x00000000 },
>      { 0x0000800c, 0x00000000 },
> @@ -827,7 +819,7 @@ static const u32 ar5416Common[][2] = {
>      { 0x00008038, 0x00000000 },
>      { 0x0000803c, 0x00000000 },
>      { 0x00008048, 0x40000000 },
> -    { 0x00008054, 0x00004000 },
> +    { 0x00008054, 0x00000000 },
>      { 0x00008058, 0x00000000 },
>      { 0x0000805c, 0x000fc78f },
>      { 0x00008060, 0x0000000f },
> @@ -862,7 +854,7 @@ static const u32 ar5416Common[][2] = {
>      { 0x00008134, 0x00000000 },
>      { 0x00008138, 0x00000000 },
>      { 0x0000813c, 0x00000000 },
> -    { 0x00008144, 0x00000000 },
> +    { 0x00008144, 0xffffffff },
>      { 0x00008168, 0x00000000 },
>      { 0x0000816c, 0x00000000 },
>      { 0x00008170, 0x32143320 },
> @@ -921,7 +913,7 @@ static const u32 ar5416Common[][2] = {
>      { 0x0000832c, 0x00000007 },
>      { 0x00008330, 0x00000302 },
>      { 0x00008334, 0x00000e00 },
> -    { 0x00008338, 0x00000000 },
> +    { 0x00008338, 0x00070000 },
>      { 0x0000833c, 0x00000000 },
>      { 0x00008340, 0x000107ff },
>      { 0x00009808, 0x00000000 },
> @@ -932,7 +924,7 @@ static const u32 ar5416Common[][2] = {
>      { 0x0000982c, 0x0000a000 },
>      { 0x00009830, 0x00000000 },
>      { 0x0000983c, 0x00200400 },
> -    { 0x00009840, 0x206a01ae },
> +    { 0x00009840, 0x206a002e },
>      { 0x0000984c, 0x1284233c },
>      { 0x00009854, 0x00000859 },
>      { 0x00009900, 0x00000000 },
> @@ -950,6 +942,8 @@ static const u32 ar5416Common[][2] = {
>      { 0x0000993c, 0x00000000 },
>      { 0x00009948, 0x9280b212 },
>      { 0x0000994c, 0x00020028 },
> +    { 0x00009954, 0x5d50e188 },
> +    { 0x00009958, 0x00081fff },
>      { 0x0000c95c, 0x004b6a8e },
>      { 0x0000c968, 0x000003ce },
>      { 0x00009970, 0x190fb515 },
> @@ -966,14 +960,14 @@ static const u32 ar5416Common[][2] = {
>      { 0x0000999c, 0x00000000 },
>      { 0x000099a0, 0x00000000 },
>      { 0x000099a4, 0x00000001 },
> -    { 0x000099a8, 0x201fff00 },
> -    { 0x000099ac, 0x006f0000 },
> +    { 0x000099a8, 0x001fff00 },
> +    { 0x000099ac, 0x00000000 },
>      { 0x000099b0, 0x03051000 },
>      { 0x000099dc, 0x00000000 },
>      { 0x000099e0, 0x00000200 },
>      { 0x000099e4, 0xaaaaaaaa },
>      { 0x000099e8, 0x3c466478 },
> -    { 0x000099ec, 0x0cc80caa },
> +    { 0x000099ec, 0x000000aa },
>      { 0x000099fc, 0x00001042 },
>      { 0x00009b00, 0x00000000 },
>      { 0x00009b04, 0x00000001 },
> @@ -1044,11 +1038,11 @@ static const u32 ar5416Common[][2] = {
>      { 0x0000a218, 0x009c4060 },
>      { 0x0000a220, 0x018830c6 },
>      { 0x0000a224, 0x00000400 },
> -    { 0x0000a228, 0x001a0bb5 },
> -    { 0x0000a22c, 0x00000000 },
> +    { 0x0000a228, 0x00000bb5 },
> +    { 0x0000a22c, 0x00000011 },
>      { 0x0000a234, 0x20202020 },
>      { 0x0000a238, 0x20202020 },
> -    { 0x0000a23c, 0x13c889ae },
> +    { 0x0000a23c, 0x13c889af },
>      { 0x0000a240, 0x38490a20 },
>      { 0x0000a244, 0x00007bb6 },
>      { 0x0000a248, 0x0fff3ffc },
> @@ -1058,13 +1052,13 @@ static const u32 ar5416Common[][2] = {
>      { 0x0000a258, 0x0cc75380 },
>      { 0x0000a25c, 0x0f0f0f01 },
>      { 0x0000a260, 0xdfa91f01 },
> -    { 0x0000a268, 0x00000001 },
> +    { 0x0000a268, 0x00000000 },
>      { 0x0000a26c, 0x0ebae9c6 },
>      { 0x0000b26c, 0x0ebae9c6 },
>      { 0x0000c26c, 0x0ebae9c6 },
>      { 0x0000d270, 0x00820820 },
>      { 0x0000a278, 0x1ce739ce },
> -    { 0x0000a27c, 0x050701ce },
> +    { 0x0000a27c, 0x051701ce },
>      { 0x0000a338, 0x00000000 },
>      { 0x0000a33c, 0x00000000 },
>      { 0x0000a340, 0x00000000 },
> @@ -1073,7 +1067,7 @@ static const u32 ar5416Common[][2] = {
>      { 0x0000a34c, 0x3fffffff },
>      { 0x0000a350, 0x3fffffff },
>      { 0x0000a354, 0x0003ffff },
> -    { 0x0000a358, 0x79a8aa33 },
> +    { 0x0000a358, 0x79a8aa1f },
>      { 0x0000d35c, 0x07ffffef },
>      { 0x0000d360, 0x0fffffe7 },
>      { 0x0000d364, 0x17ffffe5 },
> @@ -1085,7 +1079,7 @@ static const u32 ar5416Common[][2] = {
>      { 0x0000d37c, 0x7fffffe2 },
>      { 0x0000d380, 0x7f3c7bba },
>      { 0x0000d384, 0xf3307ff0 },
> -    { 0x0000a388, 0x0c000000 },
> +    { 0x0000a388, 0x08000000 },
>      { 0x0000a38c, 0x20202020 },
>      { 0x0000a390, 0x20202020 },
>      { 0x0000a394, 0x1ce739ce },
> @@ -1182,13 +1176,13 @@ static const u32 ar5416BB_RfGain[][3] = {
>  };
>  
>  static const u32 ar5416Bank1[][2] = {
> -    { 0x000098b0, 0x02108421},
> -    { 0x000098ec, 0x00000008},
> +    { 0x000098b0, 0x02108421 },
> +    { 0x000098ec, 0x00000008 },
>  };
>  
>  static const u32 ar5416Bank2[][2] = {
> -    { 0x000098b0, 0x0e73ff17},
> -    { 0x000098e0, 0x00000420},
> +    { 0x000098b0, 0x0e73ff17 },
> +    { 0x000098e0, 0x00000420 },
>  };
>  
>  static const u32 ar5416Bank3[][3] = {
> @@ -1196,7 +1190,6 @@ static const u32 ar5416Bank3[][3] = {
>  };
>  
>  static const u32 ar5416Bank6[][3] = {
> -
>      { 0x0000989c, 0x00000000, 0x00000000 },
>      { 0x0000989c, 0x00000000, 0x00000000 },
>      { 0x0000989c, 0x00000000, 0x00000000 },
> @@ -1208,7 +1201,7 @@ static const u32 ar5416Bank6[][3] = {
>      { 0x0000989c, 0x00ff0000, 0x00ff0000 },
>      { 0x0000989c, 0x00ff0000, 0x00ff0000 },
>      { 0x0000989c, 0x00ff0000, 0x00ff0000 },
> -    { 0x0000989c, 0x00ff0000, 0x00ff0000 },
> +    { 0x0000989c, 0x40ff0000, 0x40ff0000 },
>      { 0x0000989c, 0x005f0000, 0x005f0000 },
>      { 0x0000989c, 0x00870000, 0x00870000 },
>      { 0x0000989c, 0x00f90000, 0x00f90000 },
> @@ -1219,22 +1212,20 @@ static const u32 ar5416Bank6[][3] = {
>      { 0x0000989c, 0x00110000, 0x00110000 },
>      { 0x0000989c, 0x006100a8, 0x006100a8 },
>      { 0x0000989c, 0x004210a2, 0x004210a2 },
> -    { 0x0000989c, 0x0014000f, 0x0014000f },
> -    { 0x0000989c, 0x00c40002, 0x00c40002 },
> +    { 0x0000989c, 0x0014008f, 0x0014008f },
> +    { 0x0000989c, 0x00c40003, 0x00c40003 },
>      { 0x0000989c, 0x003000f2, 0x003000f2 },
>      { 0x0000989c, 0x00440016, 0x00440016 },
>      { 0x0000989c, 0x00410040, 0x00410040 },
> -    { 0x0000989c, 0x000180d6, 0x000180d6 },
> -    { 0x0000989c, 0x0000c0aa, 0x0000c0aa },
> -    { 0x0000989c, 0x000000b1, 0x000000b1 },
> -    { 0x0000989c, 0x00002000, 0x00002000 },
> +    { 0x0000989c, 0x0001805e, 0x0001805e },
> +    { 0x0000989c, 0x0000c0ab, 0x0000c0ab },
> +    { 0x0000989c, 0x000000f1, 0x000000f1 },
> +    { 0x0000989c, 0x00002081, 0x00002081 },
>      { 0x0000989c, 0x000000d4, 0x000000d4 },
>      { 0x000098d0, 0x0000000f, 0x0010000f },
>  };
>  
> -
>  static const u32 ar5416Bank6TPC[][3] = {
> -
>      { 0x0000989c, 0x00000000, 0x00000000 },
>      { 0x0000989c, 0x00000000, 0x00000000 },
>      { 0x0000989c, 0x00000000, 0x00000000 },
> @@ -1257,7 +1248,7 @@ static const u32 ar5416Bank6TPC[][3] = {
>      { 0x0000989c, 0x00110000, 0x00110000 },
>      { 0x0000989c, 0x006100a8, 0x006100a8 },
>      { 0x0000989c, 0x00423022, 0x00423022 },
> -    { 0x0000989c, 0x2014008f, 0x2014008f },
> +    { 0x0000989c, 0x201400df, 0x201400df },
>      { 0x0000989c, 0x00c40002, 0x00c40002 },
>      { 0x0000989c, 0x003000f2, 0x003000f2 },
>      { 0x0000989c, 0x00440016, 0x00440016 },
> @@ -1265,7 +1256,7 @@ static const u32 ar5416Bank6TPC[][3] = {
>      { 0x0000989c, 0x0001805e, 0x0001805e },
>      { 0x0000989c, 0x0000c0ab, 0x0000c0ab },
>      { 0x0000989c, 0x000000e1, 0x000000e1 },
> -    { 0x0000989c, 0x00007080, 0x00007080 },
> +    { 0x0000989c, 0x00007081, 0x00007081 },
>      { 0x0000989c, 0x000000d4, 0x000000d4 },
>      { 0x000098d0, 0x0000000f, 0x0010000f },
>  };
> @@ -1277,38 +1268,43 @@ static const u32 ar5416Bank7[][2] = {
>  };
>  
>  static const u32 ar5416Addac[][2] = {
> -    {0x0000989c, 0x00000000 },
> -    {0x0000989c, 0x00000000 },
> -    {0x0000989c, 0x00000000 },
> -    {0x0000989c, 0x00000000 },
> -    {0x0000989c, 0x00000000 },
> -    {0x0000989c, 0x00000000 },
> -    {0x0000989c, 0x00000000 },
> -    {0x0000989c, 0x00000010 },
> -    {0x0000989c, 0x00000000 },
> -    {0x0000989c, 0x00000000 },
> -    {0x0000989c, 0x00000000 },
> -    {0x0000989c, 0x00000000 },
> -    {0x0000989c, 0x00000000 },
> -    {0x0000989c, 0x00000000 },
> -    {0x0000989c, 0x00000000 },
> -    {0x0000989c, 0x00000000 },
> -    {0x0000989c, 0x00000000 },
> -    {0x0000989c, 0x00000000 },
> -    {0x0000989c, 0x00000000 },
> -    {0x0000989c, 0x00000000 },
> -    {0x0000989c, 0x00000000 },
> -    {0x0000989c, 0x000000c0 },
> -    {0x0000989c, 0x00000015 },
> -    {0x0000989c, 0x00000000 },
> -    {0x0000989c, 0x00000000 },
> -    {0x0000989c, 0x00000000 },
> -    {0x0000989c, 0x00000000 },
> -    {0x0000989c, 0x00000000 },
> -    {0x0000989c, 0x00000000 },
> -    {0x0000989c, 0x00000000 },
> -    {0x0000989c, 0x00000000 },
> -    {0x000098cc, 0x00000000 },
> +    {0x0000989c,  0x00000000 },
> +    {0x0000989c,  0x00000003 },
> +    {0x0000989c,  0x00000000 },
> +    {0x0000989c,  0x0000000c },
> +    {0x0000989c,  0x00000000 },
> +    {0x0000989c,  0x00000030 },
> +    {0x0000989c,  0x00000000 },
> +    {0x0000989c,  0x00000000 },
> +    {0x0000989c,  0x00000000 },
> +    {0x0000989c,  0x00000000 },
> +    {0x0000989c,  0x00000000 },
> +    {0x0000989c,  0x00000000 },
> +    {0x0000989c,  0x00000000 },
> +    {0x0000989c,  0x00000000 },
> +    {0x0000989c,  0x00000000 },
> +    {0x0000989c,  0x00000000 },
> +    {0x0000989c,  0x00000000 },
> +    {0x0000989c,  0x00000000 },
> +    {0x0000989c,  0x00000060 },
> +    {0x0000989c,  0x00000000 },
> +    {0x0000989c,  0x00000000 },
> +    {0x0000989c,  0x00000000 },
> +    {0x0000989c,  0x00000000 },
> +    {0x0000989c,  0x00000000 },
> +    {0x0000989c,  0x00000000 },
> +    {0x0000989c,  0x00000000 },
> +    {0x0000989c,  0x00000000 },
> +    {0x0000989c,  0x00000000 },
> +    {0x0000989c,  0x00000000 },
> +    {0x0000989c,  0x00000000 },
> +    {0x0000989c,  0x00000000 },
> +    {0x0000989c,  0x00000058 },
> +    {0x0000989c,  0x00000000 },
> +    {0x0000989c,  0x00000000 },
> +    {0x0000989c,  0x00000000 },
> +    {0x0000989c,  0x00000000 },
> +    {0x000098c4,  0x00000000 },

Apart from the last line, this patch simply swaps the two initval sets as i see
it. Would not be simpler to rename them, and then change this line only?

>  };
>  
>  static const u32 ar5416Modes_9160[][6] = {
> diff --git a/drivers/net/wireless/ath9k/reg.h b/drivers/net/wireless/ath9k/reg.h
> index 91442da..cef1570 100644
> --- a/drivers/net/wireless/ath9k/reg.h
> +++ b/drivers/net/wireless/ath9k/reg.h
> @@ -158,14 +158,6 @@
>  #define AR_CST_TIMEOUT_LIMIT      0xFFFF0000
>  #define AR_CST_TIMEOUT_LIMIT_S    16
>  
> -#define AR_SREV_VERSION_9100                  0x014
> -
> -#define AR_SREV_9100(ah) ((ah->hw_version.macVersion) == AR_SREV_VERSION_9100)
> -#define AR_SREV_5416_V20_OR_LATER(_ah) \
> -	(AR_SREV_9100((_ah)) || AR_SREV_5416_20_OR_LATER(_ah))
> -#define AR_SREV_5416_V22_OR_LATER(_ah) \
> -	(AR_SREV_9100((_ah)) || AR_SREV_5416_22_OR_LATER(_ah))
> -
>  #define AR_ISR               0x0080
>  #define AR_ISR_RXOK          0x00000001
>  #define AR_ISR_RXDESC        0x00000002
> @@ -729,31 +721,36 @@
>  #define AR_SREV_REVISION2        	      0x00000F00
>  #define AR_SREV_REVISION2_S     	      8
>  
> -#define AR_SREV_VERSION_5416_PCI               0xD
> -#define AR_SREV_VERSION_5416_PCIE              0xC
> -#define AR_SREV_REVISION_5416_10               0
> -#define AR_SREV_REVISION_5416_20               1
> -#define AR_SREV_REVISION_5416_22               2
> -#define AR_SREV_VERSION_9160        	      0x40
> -#define AR_SREV_REVISION_9160_10    	      0
> -#define AR_SREV_REVISION_9160_11    	      1
> -#define AR_SREV_VERSION_9280                0x80
> -#define AR_SREV_REVISION_9280_10            0
> -#define AR_SREV_REVISION_9280_20            1
> -#define AR_SREV_REVISION_9280_21            2
> -#define AR_SREV_VERSION_9285                  0xC0
> -#define AR_SREV_REVISION_9285_10              0
> -#define AR_SREV_REVISION_9285_11              1
> -#define AR_SREV_REVISION_9285_12              2
> -
> -#define AR_SREV_9100_OR_LATER(_ah) \
> -	(((_ah)->hw_version.macVersion >= AR_SREV_VERSION_5416_PCIE))
> +#define AR_SREV_VERSION_5416_PCI	0xD
> +#define AR_SREV_VERSION_5416_PCIE	0xC
> +#define AR_SREV_REVISION_5416_10	0
> +#define AR_SREV_REVISION_5416_20	1
> +#define AR_SREV_REVISION_5416_22	2
> +#define AR_SREV_VERSION_9100		0x014

0x14?

> +#define AR_SREV_VERSION_9160		0x40
> +#define AR_SREV_REVISION_9160_10	0
> +#define AR_SREV_REVISION_9160_11	1
> +#define AR_SREV_VERSION_9280		0x80
> +#define AR_SREV_REVISION_9280_10	0
> +#define AR_SREV_REVISION_9280_20	1
> +#define AR_SREV_REVISION_9280_21	2
> +#define AR_SREV_VERSION_9285		0xC0
> +#define AR_SREV_REVISION_9285_10	0
> +#define AR_SREV_REVISION_9285_11	1
> +#define AR_SREV_REVISION_9285_12	2
> +
> +#define AR_SREV_9100(ah) ((ah->hw_version.macVersion) == AR_SREV_VERSION_9100)
> +#define AR_SREV_5416_V20_OR_LATER(_ah) \
> +	(AR_SREV_9100(_ah) || AR_SREV_5416_20_OR_LATER(_ah))
> +#define AR_SREV_5416_V22_OR_LATER(_ah) \
> +	(AR_SREV_9100(_ah) || AR_SREV_5416_22_OR_LATER(_ah))
> +
>  #define AR_SREV_5416_20_OR_LATER(_ah) \
>  	(((_ah)->hw_version.macVersion >= AR_SREV_VERSION_9160) || \
> -		((_ah)->hw_version.macRev >= AR_SREV_REVISION_5416_20))
> +	 ((_ah)->hw_version.macRev >= AR_SREV_REVISION_5416_20))
>  #define AR_SREV_5416_22_OR_LATER(_ah) \
>  	(((_ah)->hw_version.macVersion >= AR_SREV_VERSION_9160) || \
> -		((_ah)->hw_version.macRev >= AR_SREV_REVISION_5416_22))
> +	 ((_ah)->hw_version.macRev >= AR_SREV_REVISION_5416_22))
>  #define AR_SREV_9160(_ah) \
>  	(((_ah)->hw_version.macVersion == AR_SREV_VERSION_9160))
>  #define AR_SREV_9160_10_OR_LATER(_ah) \

Still looks weird for me, but you probably know this whole revision mystery
better than me, so I won't argue against it, if they remain as this.

> @@ -778,14 +775,14 @@
>  #define AR_SREV_9285_10_OR_LATER(_ah) \
>  	(((_ah)->hw_version.macVersion >= AR_SREV_VERSION_9285))
>  #define AR_SREV_9285_11(_ah) \
> -	(AR_SREV_9280(ah) && \
> +	(AR_SREV_9285(ah) && \
>  	 ((_ah)->hw_version.macRev == AR_SREV_REVISION_9285_11))
>  #define AR_SREV_9285_11_OR_LATER(_ah) \
>  	(((_ah)->hw_version.macVersion > AR_SREV_VERSION_9285) || \
>  	 (AR_SREV_9285(ah) && ((_ah)->hw_version.macRev >= \
>  			       AR_SREV_REVISION_9285_11)))
>  #define AR_SREV_9285_12(_ah) \
> -	(AR_SREV_9280(ah) && \
> +	(AR_SREV_9285(ah) && \
>  	 ((_ah)->hw_version.macRev == AR_SREV_REVISION_9285_12))
>  #define AR_SREV_9285_12_OR_LATER(_ah) \
>  	(((_ah)->hw_version.macVersion > AR_SREV_VERSION_9285) || \
> 

Although it is not relevant for the AR9100 issue, but i should have noticed this
two as well. :)

Regards,
Gabor

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

* Re: [RFC] ath9k: use correct init values for ar9100 devices
  2009-03-04  4:30   ` [ath9k-devel] " Sujith
@ 2009-03-04 13:41     ` Gabor Juhos
  -1 siblings, 0 replies; 27+ messages in thread
From: Gabor Juhos @ 2009-03-04 13:41 UTC (permalink / raw)
  To: Sujith; +Cc: John W. Linville, ath9k-devel, linux-wireless, Imre Kaloz

Sujith =EDrta:
> Gabor Juhos wrote:
>> 1. In some cases the ethernet interface goes down for a short time
>> after'ifconfig wlan0 up'.
>> 2. Sometimes the device simply reboots itself after 'ifconfig wlan0 =
up'.
>>
>> After I have added some printk statements into the code, I noticed t=
hat the
>> ar5416 and ar9100 devices use the same initval arrays currently. I a=
ssume
>> that they requires different initialization, because we have differe=
nt
>> arrays for them.
>>
>=20
> Yep, this is a bug, and AR_SREV_9100_OR_LATER is probably wrong.

Ok.

>=20
>> Although I have no detailed knowledge about the evolution of the ath=
9k devices,
>> but the version checking macros for ther AR5416 cards seemed weird e=
nough, so I
>> have replaced them. Unfortunately, this leaded to very bad performan=
ce with the
>> ar5416 cards I have, but the driver was working on the ar913x boards=
=2E
>>
>> After some digging, I have found an interesting ifdef statement in S=
am's current
>> HAL. In his ar5416Common initval array, this ifdef conditionally sel=
ects the
>> right RTC register offsets for the ar5416/ar9100 devices. The strang=
e thing,
>> that in the ath9k driver the ar5416 specific RTC register offsets ar=
e used in
>> the ar5416Common_ar9100 array, while the ar9100 specific offsets are=
 used in the
>> ar5416Common.
>>
>=20
> I'll check the initval arrays and update.
>=20
>> +#define AR_SREV_5416(_ah) \
>> +       (((_ah)->hw_version.macVersion =3D=3D AR_SREV_VERSION_5416_P=
CIE) || \
>> +       ((_ah)->hw_version.macVersion =3D=3D AR_SREV_VERSION_5416_PC=
I))
>> +#define AR_SREV_5416_V20_OR_LATER(_ah) \
>> +       (((_ah)->hw_version.macVersion > AR_SREV_VERSION_5416_PCIE) =
|| \
>> +       ((AR_SREV_5416(_ah)) && \
>> +       ((_ah)->hw_version.macRev >=3D AR_SREV_REVISION_5416_20)))
>> +#define AR_SREV_5416_V22_OR_LATER(_ah) \
>> +       (((_ah)->hw_version.macVersion > AR_SREV_VERSION_5416_PCIE) =
|| \
>> +       ((AR_SREV_5416(_ah)) && \
>> +       ((_ah)->hw_version.macRev >=3D AR_SREV_REVISION_5416_22)))
>> +
>=20
> Hm, the 5416_V1, 5416_V2 macros have to check 3 different HW (5416, 9=
100, 9160).

I don't see any 5416_V1 macro here. The AR_SREV_5416 should check the s=
ilicon
revision of the AR5416 cards only. But if we would be consistent, we sh=
ould have
a _V10_OR_LATER although i don't see where it would be useful. The _V20=
_OR_LATER
and the _V22_OR_LATER macro I proposed above will cover the 9100 and 91=
60 chips.

>=20
>> +#define AR_SREV_9100(ah) \
>> +       ((ah->hw_version.macVersion) =3D=3D AR_SREV_VERSION_9100)
>>  #define AR_SREV_9100_OR_LATER(_ah) \
>> -       (((_ah)->hw_version.macVersion >=3D AR_SREV_VERSION_5416_PCI=
E))
>> -#define AR_SREV_5416_20_OR_LATER(_ah) \
>> -       (((_ah)->hw_version.macVersion >=3D AR_SREV_VERSION_9160) ||=
 \
>> -               ((_ah)->hw_version.macRev >=3D AR_SREV_REVISION_5416=
_20))
>> -#define AR_SREV_5416_22_OR_LATER(_ah) \
>> -       (((_ah)->hw_version.macVersion >=3D AR_SREV_VERSION_9160) ||=
 \
>> -               ((_ah)->hw_version.macRev >=3D AR_SREV_REVISION_5416=
_22))
>> +       ((_ah)->hw_version.macVersion >=3D AR_SREV_VERSION_9100)
>> +
>>  #define AR_SREV_9160(_ah) \
>>         (((_ah)->hw_version.macVersion =3D=3D AR_SREV_VERSION_9160))
>>  #define AR_SREV_9160_10_OR_LATER(_ah) \
>> --
>> 1.5.3.2
>>

Regards,
Gabor
--
To unsubscribe from this list: send the line "unsubscribe linux-wireles=
s" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [ath9k-devel] [RFC] ath9k: use correct init values for ar9100 devices
@ 2009-03-04 13:41     ` Gabor Juhos
  0 siblings, 0 replies; 27+ messages in thread
From: Gabor Juhos @ 2009-03-04 13:41 UTC (permalink / raw)
  To: ath9k-devel

Sujith ?rta:
> Gabor Juhos wrote:
>> 1. In some cases the ethernet interface goes down for a short time
>> after'ifconfig wlan0 up'.
>> 2. Sometimes the device simply reboots itself after 'ifconfig wlan0 up'.
>>
>> After I have added some printk statements into the code, I noticed that the
>> ar5416 and ar9100 devices use the same initval arrays currently. I assume
>> that they requires different initialization, because we have different
>> arrays for them.
>>
> 
> Yep, this is a bug, and AR_SREV_9100_OR_LATER is probably wrong.

Ok.

> 
>> Although I have no detailed knowledge about the evolution of the ath9k devices,
>> but the version checking macros for ther AR5416 cards seemed weird enough, so I
>> have replaced them. Unfortunately, this leaded to very bad performance with the
>> ar5416 cards I have, but the driver was working on the ar913x boards.
>>
>> After some digging, I have found an interesting ifdef statement in Sam's current
>> HAL. In his ar5416Common initval array, this ifdef conditionally selects the
>> right RTC register offsets for the ar5416/ar9100 devices. The strange thing,
>> that in the ath9k driver the ar5416 specific RTC register offsets are used in
>> the ar5416Common_ar9100 array, while the ar9100 specific offsets are used in the
>> ar5416Common.
>>
> 
> I'll check the initval arrays and update.
> 
>> +#define AR_SREV_5416(_ah) \
>> +       (((_ah)->hw_version.macVersion == AR_SREV_VERSION_5416_PCIE) || \
>> +       ((_ah)->hw_version.macVersion == AR_SREV_VERSION_5416_PCI))
>> +#define AR_SREV_5416_V20_OR_LATER(_ah) \
>> +       (((_ah)->hw_version.macVersion > AR_SREV_VERSION_5416_PCIE) || \
>> +       ((AR_SREV_5416(_ah)) && \
>> +       ((_ah)->hw_version.macRev >= AR_SREV_REVISION_5416_20)))
>> +#define AR_SREV_5416_V22_OR_LATER(_ah) \
>> +       (((_ah)->hw_version.macVersion > AR_SREV_VERSION_5416_PCIE) || \
>> +       ((AR_SREV_5416(_ah)) && \
>> +       ((_ah)->hw_version.macRev >= AR_SREV_REVISION_5416_22)))
>> +
> 
> Hm, the 5416_V1, 5416_V2 macros have to check 3 different HW (5416, 9100, 9160).

I don't see any 5416_V1 macro here. The AR_SREV_5416 should check the silicon
revision of the AR5416 cards only. But if we would be consistent, we should have
a _V10_OR_LATER although i don't see where it would be useful. The _V20_OR_LATER
and the _V22_OR_LATER macro I proposed above will cover the 9100 and 9160 chips.

> 
>> +#define AR_SREV_9100(ah) \
>> +       ((ah->hw_version.macVersion) == AR_SREV_VERSION_9100)
>>  #define AR_SREV_9100_OR_LATER(_ah) \
>> -       (((_ah)->hw_version.macVersion >= AR_SREV_VERSION_5416_PCIE))
>> -#define AR_SREV_5416_20_OR_LATER(_ah) \
>> -       (((_ah)->hw_version.macVersion >= AR_SREV_VERSION_9160) || \
>> -               ((_ah)->hw_version.macRev >= AR_SREV_REVISION_5416_20))
>> -#define AR_SREV_5416_22_OR_LATER(_ah) \
>> -       (((_ah)->hw_version.macVersion >= AR_SREV_VERSION_9160) || \
>> -               ((_ah)->hw_version.macRev >= AR_SREV_REVISION_5416_22))
>> +       ((_ah)->hw_version.macVersion >= AR_SREV_VERSION_9100)
>> +
>>  #define AR_SREV_9160(_ah) \
>>         (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9160))
>>  #define AR_SREV_9160_10_OR_LATER(_ah) \
>> --
>> 1.5.3.2
>>

Regards,
Gabor

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

* Re: [ath9k-devel] [RFC] ath9k: use correct init values for ar9100 devices
  2009-03-04 13:38     ` Gabor Juhos
@ 2009-03-04 14:21         ` Sujith
  0 siblings, 0 replies; 27+ messages in thread
From: Sujith @ 2009-03-04 14:21 UTC (permalink / raw)
  To: Gabor Juhos; +Cc: ath9k-devel, linux-wireless, John W. Linville

Gabor Juhos wrote:
> Apart from the last line, this patch simply swaps the two initval sets as i see
> it. Would not be simpler to rename them, and then change this line only?
> 

I didn't bother to check if the initvals were to be swapped or not.
The patch was a line-by-line copy of the latest initvals. :-)
Figured this would also make it easier to roll out future updates.

> > +#define AR_SREV_VERSION_9100		0x014
> 
> 0x14?

Yep, this can be fixed.

Sujith

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

* [ath9k-devel] [RFC] ath9k: use correct init values for ar9100 devices
@ 2009-03-04 14:21         ` Sujith
  0 siblings, 0 replies; 27+ messages in thread
From: Sujith @ 2009-03-04 14:21 UTC (permalink / raw)
  To: ath9k-devel

Gabor Juhos wrote:
> Apart from the last line, this patch simply swaps the two initval sets as i see
> it. Would not be simpler to rename them, and then change this line only?
> 

I didn't bother to check if the initvals were to be swapped or not.
The patch was a line-by-line copy of the latest initvals. :-)
Figured this would also make it easier to roll out future updates.

> > +#define AR_SREV_VERSION_9100		0x014
> 
> 0x14?

Yep, this can be fixed.

Sujith

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

* Re: [ath9k-devel] [RFC] ath9k: use correct init values for ar9100 devices
  2009-03-04 13:41     ` [ath9k-devel] " Gabor Juhos
@ 2009-03-04 14:29       ` Sujith
  -1 siblings, 0 replies; 27+ messages in thread
From: Sujith @ 2009-03-04 14:29 UTC (permalink / raw)
  To: Gabor Juhos; +Cc: ath9k-devel, linux-wireless, John W. Linville

Gabor Juhos wrote:
> >> +#define AR_SREV_5416(_ah) \
> >> +       (((_ah)->hw_version.macVersion == AR_SREV_VERSION_5416_PCIE) || \
> >> +       ((_ah)->hw_version.macVersion == AR_SREV_VERSION_5416_PCI))
> >> +#define AR_SREV_5416_V20_OR_LATER(_ah) \
> >> +       (((_ah)->hw_version.macVersion > AR_SREV_VERSION_5416_PCIE) || \
> >> +       ((AR_SREV_5416(_ah)) && \
> >> +       ((_ah)->hw_version.macRev >= AR_SREV_REVISION_5416_20)))
> >> +#define AR_SREV_5416_V22_OR_LATER(_ah) \
> >> +       (((_ah)->hw_version.macVersion > AR_SREV_VERSION_5416_PCIE) || \
> >> +       ((AR_SREV_5416(_ah)) && \
> >> +       ((_ah)->hw_version.macRev >= AR_SREV_REVISION_5416_22)))
> >> +
> > 
> > Hm, the 5416_V1, 5416_V2 macros have to check 3 different HW (5416, 9100, 9160).
> 
> I don't see any 5416_V1 macro here. The AR_SREV_5416 should check the silicon
> revision of the AR5416 cards only. But if we would be consistent, we should have
> a _V10_OR_LATER although i don't see where it would be useful. The _V20_OR_LATER
> and the _V22_OR_LATER macro I proposed above will cover the 9100 and 9160 chips.
> 

I meant the AR_SREV_5416_V20_OR_LATER and AR_SREV_5416_V22_OR_LATER macros.
Yes, the naming implies that they are meant for AR5416 chipsets only, but they
do handle AR9100 and AR9160 chipsets.

The proposed macros don't have the AR9100 and AR9160 macVersion checks, no ?

Sujith

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

* [ath9k-devel] [RFC] ath9k: use correct init values for ar9100 devices
@ 2009-03-04 14:29       ` Sujith
  0 siblings, 0 replies; 27+ messages in thread
From: Sujith @ 2009-03-04 14:29 UTC (permalink / raw)
  To: ath9k-devel

Gabor Juhos wrote:
> >> +#define AR_SREV_5416(_ah) \
> >> +       (((_ah)->hw_version.macVersion == AR_SREV_VERSION_5416_PCIE) || \
> >> +       ((_ah)->hw_version.macVersion == AR_SREV_VERSION_5416_PCI))
> >> +#define AR_SREV_5416_V20_OR_LATER(_ah) \
> >> +       (((_ah)->hw_version.macVersion > AR_SREV_VERSION_5416_PCIE) || \
> >> +       ((AR_SREV_5416(_ah)) && \
> >> +       ((_ah)->hw_version.macRev >= AR_SREV_REVISION_5416_20)))
> >> +#define AR_SREV_5416_V22_OR_LATER(_ah) \
> >> +       (((_ah)->hw_version.macVersion > AR_SREV_VERSION_5416_PCIE) || \
> >> +       ((AR_SREV_5416(_ah)) && \
> >> +       ((_ah)->hw_version.macRev >= AR_SREV_REVISION_5416_22)))
> >> +
> > 
> > Hm, the 5416_V1, 5416_V2 macros have to check 3 different HW (5416, 9100, 9160).
> 
> I don't see any 5416_V1 macro here. The AR_SREV_5416 should check the silicon
> revision of the AR5416 cards only. But if we would be consistent, we should have
> a _V10_OR_LATER although i don't see where it would be useful. The _V20_OR_LATER
> and the _V22_OR_LATER macro I proposed above will cover the 9100 and 9160 chips.
> 

I meant the AR_SREV_5416_V20_OR_LATER and AR_SREV_5416_V22_OR_LATER macros.
Yes, the naming implies that they are meant for AR5416 chipsets only, but they
do handle AR9100 and AR9160 chipsets.

The proposed macros don't have the AR9100 and AR9160 macVersion checks, no ?

Sujith

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

* Re: [ath9k-devel] [RFC] ath9k: use correct init values for ar9100 devices
  2009-03-04 14:29       ` Sujith
@ 2009-03-04 14:57         ` Gabor Juhos
  -1 siblings, 0 replies; 27+ messages in thread
From: Gabor Juhos @ 2009-03-04 14:57 UTC (permalink / raw)
  To: Sujith; +Cc: ath9k-devel, linux-wireless, John W. Linville

Sujith =EDrta:
> Gabor Juhos wrote:
>>>> +#define AR_SREV_5416(_ah) \
>>>> +       (((_ah)->hw_version.macVersion =3D=3D AR_SREV_VERSION_5416=
_PCIE) || \
>>>> +       ((_ah)->hw_version.macVersion =3D=3D AR_SREV_VERSION_5416_=
PCI))
>>>> +#define AR_SREV_5416_V20_OR_LATER(_ah) \
>>>> +       (((_ah)->hw_version.macVersion > AR_SREV_VERSION_5416_PCIE=
) || \
>>>> +       ((AR_SREV_5416(_ah)) && \
>>>> +       ((_ah)->hw_version.macRev >=3D AR_SREV_REVISION_5416_20)))
>>>> +#define AR_SREV_5416_V22_OR_LATER(_ah) \
>>>> +       (((_ah)->hw_version.macVersion > AR_SREV_VERSION_5416_PCIE=
) || \
>>>> +       ((AR_SREV_5416(_ah)) && \
>>>> +       ((_ah)->hw_version.macRev >=3D AR_SREV_REVISION_5416_22)))
>>>> +
>>> Hm, the 5416_V1, 5416_V2 macros have to check 3 different HW (5416,=
 9100, 9160).
>> I don't see any 5416_V1 macro here. The AR_SREV_5416 should check th=
e silicon
>> revision of the AR5416 cards only. But if we would be consistent, we=
 should have
>> a _V10_OR_LATER although i don't see where it would be useful. The _=
V20_OR_LATER
>> and the _V22_OR_LATER macro I proposed above will cover the 9100 and=
 9160 chips.
>>
>=20
> I meant the AR_SREV_5416_V20_OR_LATER and AR_SREV_5416_V22_OR_LATER m=
acros.
> Yes, the naming implies that they are meant for AR5416 chipsets only,=
 but they
> do handle AR9100 and AR9160 chipsets.
>=20
> The proposed macros don't have the AR9100 and AR9160 macVersion check=
s, no ?

You are right, they don't have such version checks explicitly, but

AR_SREV_VERSION_9100 > AR_SREV_VERSION_5416_PCIE and
AR_SREV_VERSION_9160 > AR_SREV_VERSION_5416_PCIE

Maybe this looks cleaner:

#define AR_SREV_5416_V20_OR_LATER(_ah) \
	(((_ah)->hw_version.macVersion >=3D AR_SREV_VERSION_9100) || \
	 ((AR_SREV_5416(_ah)) && \
	 ((_ah)->hw_version.macRev >=3D AR_SREV_REVISION_5416_20)))

#define AR_SREV_5416_V22_OR_LATER(_ah) \
	(((_ah)->hw_version.macVersion >=3D AR_SREV_VERSION_9100) || \
	 ((AR_SREV_5416(_ah)) && \
	 ((_ah)->hw_version.macRev >=3D AR_SREV_REVISION_5416_22)))

or in this form:

#define AR_SREV_5416_V20_OR_LATER(_ah) \
	(((AR_SREV_5416(_ah)) && \
	 ((_ah)->hw_version.macRev >=3D AR_SREV_REVISION_5416_20)) || \
	 ((_ah)->hw_version.macVersion >=3D AR_SREV_VERSION_9100))

#define AR_SREV_5416_V22_OR_LATER(_ah) \
	(((AR_SREV_5416(_ah)) && \
	 ((_ah)->hw_version.macRev >=3D AR_SREV_REVISION_5416_22)) || \
	 ((_ah)->hw_version.macVersion >=3D AR_SREV_VERSION_9100))


Regards,
Gabor

--
To unsubscribe from this list: send the line "unsubscribe linux-wireles=
s" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [ath9k-devel] [RFC] ath9k: use correct init values for ar9100 devices
@ 2009-03-04 14:57         ` Gabor Juhos
  0 siblings, 0 replies; 27+ messages in thread
From: Gabor Juhos @ 2009-03-04 14:57 UTC (permalink / raw)
  To: ath9k-devel

Sujith ?rta:
> Gabor Juhos wrote:
>>>> +#define AR_SREV_5416(_ah) \
>>>> +       (((_ah)->hw_version.macVersion == AR_SREV_VERSION_5416_PCIE) || \
>>>> +       ((_ah)->hw_version.macVersion == AR_SREV_VERSION_5416_PCI))
>>>> +#define AR_SREV_5416_V20_OR_LATER(_ah) \
>>>> +       (((_ah)->hw_version.macVersion > AR_SREV_VERSION_5416_PCIE) || \
>>>> +       ((AR_SREV_5416(_ah)) && \
>>>> +       ((_ah)->hw_version.macRev >= AR_SREV_REVISION_5416_20)))
>>>> +#define AR_SREV_5416_V22_OR_LATER(_ah) \
>>>> +       (((_ah)->hw_version.macVersion > AR_SREV_VERSION_5416_PCIE) || \
>>>> +       ((AR_SREV_5416(_ah)) && \
>>>> +       ((_ah)->hw_version.macRev >= AR_SREV_REVISION_5416_22)))
>>>> +
>>> Hm, the 5416_V1, 5416_V2 macros have to check 3 different HW (5416, 9100, 9160).
>> I don't see any 5416_V1 macro here. The AR_SREV_5416 should check the silicon
>> revision of the AR5416 cards only. But if we would be consistent, we should have
>> a _V10_OR_LATER although i don't see where it would be useful. The _V20_OR_LATER
>> and the _V22_OR_LATER macro I proposed above will cover the 9100 and 9160 chips.
>>
> 
> I meant the AR_SREV_5416_V20_OR_LATER and AR_SREV_5416_V22_OR_LATER macros.
> Yes, the naming implies that they are meant for AR5416 chipsets only, but they
> do handle AR9100 and AR9160 chipsets.
> 
> The proposed macros don't have the AR9100 and AR9160 macVersion checks, no ?

You are right, they don't have such version checks explicitly, but

AR_SREV_VERSION_9100 > AR_SREV_VERSION_5416_PCIE and
AR_SREV_VERSION_9160 > AR_SREV_VERSION_5416_PCIE

Maybe this looks cleaner:

#define AR_SREV_5416_V20_OR_LATER(_ah) \
	(((_ah)->hw_version.macVersion >= AR_SREV_VERSION_9100) || \
	 ((AR_SREV_5416(_ah)) && \
	 ((_ah)->hw_version.macRev >= AR_SREV_REVISION_5416_20)))

#define AR_SREV_5416_V22_OR_LATER(_ah) \
	(((_ah)->hw_version.macVersion >= AR_SREV_VERSION_9100) || \
	 ((AR_SREV_5416(_ah)) && \
	 ((_ah)->hw_version.macRev >= AR_SREV_REVISION_5416_22)))

or in this form:

#define AR_SREV_5416_V20_OR_LATER(_ah) \
	(((AR_SREV_5416(_ah)) && \
	 ((_ah)->hw_version.macRev >= AR_SREV_REVISION_5416_20)) || \
	 ((_ah)->hw_version.macVersion >= AR_SREV_VERSION_9100))

#define AR_SREV_5416_V22_OR_LATER(_ah) \
	(((AR_SREV_5416(_ah)) && \
	 ((_ah)->hw_version.macRev >= AR_SREV_REVISION_5416_22)) || \
	 ((_ah)->hw_version.macVersion >= AR_SREV_VERSION_9100))


Regards,
Gabor

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

* Re: [ath9k-devel] [RFC] ath9k: use correct init values for ar9100 devices
  2009-03-04 14:21         ` Sujith
@ 2009-03-04 16:20           ` Gabor Juhos
  -1 siblings, 0 replies; 27+ messages in thread
From: Gabor Juhos @ 2009-03-04 16:20 UTC (permalink / raw)
  To: Sujith; +Cc: ath9k-devel, linux-wireless, John W. Linville

Sujith =EDrta:
> Gabor Juhos wrote:
>> Apart from the last line, this patch simply swaps the two initval se=
ts as i see
>> it. Would not be simpler to rename them, and then change this line o=
nly?
>>
>=20
> I didn't bother to check if the initvals were to be swapped or not.

Well, I was curious, so I did it. :)

After some cut&paste job, here is the diff between the original and the=
 new
initvals from your patch:

diff --git a/drivers/net/wireless/ath9k/initvals.h
b/drivers/net/wireless/ath9k/initvals.h
index d492363..d5a8aec 100644
--- a/drivers/net/wireless/ath9k/initvals.h
+++ b/drivers/net/wireless/ath9k/initvals.h
@@ -658,7 +657,7 @@ static const u32 ar5416Addac_9100[][2] =3D {
     {0x0000989c,  0x00000000 },
     {0x0000989c,  0x00000000 },
     {0x0000989c,  0x00000000 },
-    {0x000098cc,  0x00000000 },
+    {0x000098c4,  0x00000000 },
 };

 static const u32 ar5416Modes[][6] =3D {
@@ -862,7 +861,7 @@ static const u32 ar5416Common[][2] =3D {
     { 0x00008134, 0x00000000 },
     { 0x00008138, 0x00000000 },
     { 0x0000813c, 0x00000000 },
-    { 0x00008144, 0x00000000 },
+    { 0x00008144, 0xffffffff },
     { 0x00008168, 0x00000000 },
     { 0x0000816c, 0x00000000 },
     { 0x00008170, 0x32143320 },

> The patch was a line-by-line copy of the latest initvals. :-)
> Figured this would also make it easier to roll out future updates.

Ok. This version will cause more noise, but it is fine for me.

>=20
>>> +#define AR_SREV_VERSION_9100		0x014
>> 0x14?
>=20
> Yep, this can be fixed.

I have to send a new patch, or you will take care of it?

Regards,
Gabor

--
To unsubscribe from this list: send the line "unsubscribe linux-wireles=
s" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [ath9k-devel] [RFC] ath9k: use correct init values for ar9100 devices
@ 2009-03-04 16:20           ` Gabor Juhos
  0 siblings, 0 replies; 27+ messages in thread
From: Gabor Juhos @ 2009-03-04 16:20 UTC (permalink / raw)
  To: ath9k-devel

Sujith ?rta:
> Gabor Juhos wrote:
>> Apart from the last line, this patch simply swaps the two initval sets as i see
>> it. Would not be simpler to rename them, and then change this line only?
>>
> 
> I didn't bother to check if the initvals were to be swapped or not.

Well, I was curious, so I did it. :)

After some cut&paste job, here is the diff between the original and the new
initvals from your patch:

diff --git a/drivers/net/wireless/ath9k/initvals.h
b/drivers/net/wireless/ath9k/initvals.h
index d492363..d5a8aec 100644
--- a/drivers/net/wireless/ath9k/initvals.h
+++ b/drivers/net/wireless/ath9k/initvals.h
@@ -658,7 +657,7 @@ static const u32 ar5416Addac_9100[][2] = {
     {0x0000989c,  0x00000000 },
     {0x0000989c,  0x00000000 },
     {0x0000989c,  0x00000000 },
-    {0x000098cc,  0x00000000 },
+    {0x000098c4,  0x00000000 },
 };

 static const u32 ar5416Modes[][6] = {
@@ -862,7 +861,7 @@ static const u32 ar5416Common[][2] = {
     { 0x00008134, 0x00000000 },
     { 0x00008138, 0x00000000 },
     { 0x0000813c, 0x00000000 },
-    { 0x00008144, 0x00000000 },
+    { 0x00008144, 0xffffffff },
     { 0x00008168, 0x00000000 },
     { 0x0000816c, 0x00000000 },
     { 0x00008170, 0x32143320 },

> The patch was a line-by-line copy of the latest initvals. :-)
> Figured this would also make it easier to roll out future updates.

Ok. This version will cause more noise, but it is fine for me.

> 
>>> +#define AR_SREV_VERSION_9100		0x014
>> 0x14?
> 
> Yep, this can be fixed.

I have to send a new patch, or you will take care of it?

Regards,
Gabor

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

* Re: [ath9k-devel] [RFC] ath9k: use correct init values for ar9100 devices
  2009-03-04 16:20           ` Gabor Juhos
@ 2009-03-05  1:49             ` Sujith
  -1 siblings, 0 replies; 27+ messages in thread
From: Sujith @ 2009-03-05  1:49 UTC (permalink / raw)
  To: Gabor Juhos; +Cc: ath9k-devel, linux-wireless, John W. Linville

Gabor Juhos wrote:
> Well, I was curious, so I did it. :)
> 
> After some cut&paste job, here is the diff between the original and the new
> initvals from your patch:
> 
> diff --git a/drivers/net/wireless/ath9k/initvals.h
> b/drivers/net/wireless/ath9k/initvals.h
> index d492363..d5a8aec 100644
> --- a/drivers/net/wireless/ath9k/initvals.h
> +++ b/drivers/net/wireless/ath9k/initvals.h
> @@ -658,7 +657,7 @@ static const u32 ar5416Addac_9100[][2] = {
>      {0x0000989c,  0x00000000 },
>      {0x0000989c,  0x00000000 },
>      {0x0000989c,  0x00000000 },
> -    {0x000098cc,  0x00000000 },
> +    {0x000098c4,  0x00000000 },
>  };
> 
>  static const u32 ar5416Modes[][6] = {
> @@ -862,7 +861,7 @@ static const u32 ar5416Common[][2] = {
>      { 0x00008134, 0x00000000 },
>      { 0x00008138, 0x00000000 },
>      { 0x0000813c, 0x00000000 },
> -    { 0x00008144, 0x00000000 },
> +    { 0x00008144, 0xffffffff },
>      { 0x00008168, 0x00000000 },
>      { 0x0000816c, 0x00000000 },
>      { 0x00008170, 0x32143320 },
> 

Heh. :-)
Dunno if those 2 values make any difference.

> >>> +#define AR_SREV_VERSION_9100		0x014
> >> 0x14?
> > 
> > Yep, this can be fixed.
> 
> I have to send a new patch, or you will take care of it?

Feel free to send a patch fixing this, and the macro cleanup.
I'll just update the initvals, fix the check for AR9100 in HW attach 
and the typo for AR9285 chipsets.

Sujith

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

* [ath9k-devel] [RFC] ath9k: use correct init values for ar9100 devices
@ 2009-03-05  1:49             ` Sujith
  0 siblings, 0 replies; 27+ messages in thread
From: Sujith @ 2009-03-05  1:49 UTC (permalink / raw)
  To: ath9k-devel

Gabor Juhos wrote:
> Well, I was curious, so I did it. :)
> 
> After some cut&paste job, here is the diff between the original and the new
> initvals from your patch:
> 
> diff --git a/drivers/net/wireless/ath9k/initvals.h
> b/drivers/net/wireless/ath9k/initvals.h
> index d492363..d5a8aec 100644
> --- a/drivers/net/wireless/ath9k/initvals.h
> +++ b/drivers/net/wireless/ath9k/initvals.h
> @@ -658,7 +657,7 @@ static const u32 ar5416Addac_9100[][2] = {
>      {0x0000989c,  0x00000000 },
>      {0x0000989c,  0x00000000 },
>      {0x0000989c,  0x00000000 },
> -    {0x000098cc,  0x00000000 },
> +    {0x000098c4,  0x00000000 },
>  };
> 
>  static const u32 ar5416Modes[][6] = {
> @@ -862,7 +861,7 @@ static const u32 ar5416Common[][2] = {
>      { 0x00008134, 0x00000000 },
>      { 0x00008138, 0x00000000 },
>      { 0x0000813c, 0x00000000 },
> -    { 0x00008144, 0x00000000 },
> +    { 0x00008144, 0xffffffff },
>      { 0x00008168, 0x00000000 },
>      { 0x0000816c, 0x00000000 },
>      { 0x00008170, 0x32143320 },
> 

Heh. :-)
Dunno if those 2 values make any difference.

> >>> +#define AR_SREV_VERSION_9100		0x014
> >> 0x14?
> > 
> > Yep, this can be fixed.
> 
> I have to send a new patch, or you will take care of it?

Feel free to send a patch fixing this, and the macro cleanup.
I'll just update the initvals, fix the check for AR9100 in HW attach 
and the typo for AR9285 chipsets.

Sujith

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

* Re: [ath9k-devel] [RFC] ath9k: use correct init values for ar9100 devices
  2009-03-04 14:57         ` Gabor Juhos
@ 2009-03-05  1:51           ` Sujith
  -1 siblings, 0 replies; 27+ messages in thread
From: Sujith @ 2009-03-05  1:51 UTC (permalink / raw)
  To: Gabor Juhos; +Cc: ath9k-devel, linux-wireless, John W. Linville

Gabor Juhos wrote:
> #define AR_SREV_5416_V20_OR_LATER(_ah) \
> 	(((AR_SREV_5416(_ah)) && \
> 	 ((_ah)->hw_version.macRev >= AR_SREV_REVISION_5416_20)) || \
> 	 ((_ah)->hw_version.macVersion >= AR_SREV_VERSION_9100))
> 
> #define AR_SREV_5416_V22_OR_LATER(_ah) \
> 	(((AR_SREV_5416(_ah)) && \
> 	 ((_ah)->hw_version.macRev >= AR_SREV_REVISION_5416_22)) || \
> 	 ((_ah)->hw_version.macVersion >= AR_SREV_VERSION_9100))

Agreed, this is cleaner.

Sujith

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

* [ath9k-devel] [RFC] ath9k: use correct init values for ar9100 devices
@ 2009-03-05  1:51           ` Sujith
  0 siblings, 0 replies; 27+ messages in thread
From: Sujith @ 2009-03-05  1:51 UTC (permalink / raw)
  To: ath9k-devel

Gabor Juhos wrote:
> #define AR_SREV_5416_V20_OR_LATER(_ah) \
> 	(((AR_SREV_5416(_ah)) && \
> 	 ((_ah)->hw_version.macRev >= AR_SREV_REVISION_5416_20)) || \
> 	 ((_ah)->hw_version.macVersion >= AR_SREV_VERSION_9100))
> 
> #define AR_SREV_5416_V22_OR_LATER(_ah) \
> 	(((AR_SREV_5416(_ah)) && \
> 	 ((_ah)->hw_version.macRev >= AR_SREV_REVISION_5416_22)) || \
> 	 ((_ah)->hw_version.macVersion >= AR_SREV_VERSION_9100))

Agreed, this is cleaner.

Sujith

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

* Re: [ath9k-devel] [RFC] ath9k: use correct init values for ar9100 devices
  2009-03-05  1:51           ` Sujith
@ 2009-03-05  2:15             ` Luis R. Rodriguez
  -1 siblings, 0 replies; 27+ messages in thread
From: Luis R. Rodriguez @ 2009-03-05  2:15 UTC (permalink / raw)
  To: Sujith; +Cc: Gabor Juhos, ath9k-devel, linux-wireless, John W. Linville

I'm a bit confused by this thread now, can a v2 patch be posted
explaining clearly what's being done for each thing? Initval patches
can hurt the eyes.

  Luis

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

* [ath9k-devel] [RFC] ath9k: use correct init values for ar9100 devices
@ 2009-03-05  2:15             ` Luis R. Rodriguez
  0 siblings, 0 replies; 27+ messages in thread
From: Luis R. Rodriguez @ 2009-03-05  2:15 UTC (permalink / raw)
  To: ath9k-devel

I'm a bit confused by this thread now, can a v2 patch be posted
explaining clearly what's being done for each thing? Initval patches
can hurt the eyes.

  Luis

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

* Re: [ath9k-devel] [RFC] ath9k: use correct init values for ar9100 devices
  2009-03-05  1:49             ` Sujith
@ 2009-03-05 10:43               ` Gabor Juhos
  -1 siblings, 0 replies; 27+ messages in thread
From: Gabor Juhos @ 2009-03-05 10:43 UTC (permalink / raw)
  To: Sujith; +Cc: ath9k-devel, linux-wireless, John W. Linville

Sujith =EDrta:
> Gabor Juhos wrote:
>> Well, I was curious, so I did it. :)
>>
>> After some cut&paste job, here is the diff between the original and =
the new
>> initvals from your patch:
>>
>> diff --git a/drivers/net/wireless/ath9k/initvals.h
>> b/drivers/net/wireless/ath9k/initvals.h
>> index d492363..d5a8aec 100644
>> --- a/drivers/net/wireless/ath9k/initvals.h
>> +++ b/drivers/net/wireless/ath9k/initvals.h
>> @@ -658,7 +657,7 @@ static const u32 ar5416Addac_9100[][2] =3D {
>>      {0x0000989c,  0x00000000 },
>>      {0x0000989c,  0x00000000 },
>>      {0x0000989c,  0x00000000 },
>> -    {0x000098cc,  0x00000000 },
>> +    {0x000098c4,  0x00000000 },
>>  };
>>
>>  static const u32 ar5416Modes[][6] =3D {
>> @@ -862,7 +861,7 @@ static const u32 ar5416Common[][2] =3D {
>>      { 0x00008134, 0x00000000 },
>>      { 0x00008138, 0x00000000 },
>>      { 0x0000813c, 0x00000000 },
>> -    { 0x00008144, 0x00000000 },
>> +    { 0x00008144, 0xffffffff },
>>      { 0x00008168, 0x00000000 },
>>      { 0x0000816c, 0x00000000 },
>>      { 0x00008170, 0x32143320 },
>>
>=20
> Heh. :-)
> Dunno if those 2 values make any difference.

Indeed, these 2 values does not make too much difference.

The first one reverts this commit:
http://git.kernel.org/?p=3Dlinux/kernel/git/linville/wireless-testing.g=
it;a=3Dcommitdiff;h=3D6753ddb4bebecab1039a2a2c8d51d6656d0d0513

With the second one we will use the same initial value (which is in the
ar5416Common_9100, ar5416Common_9160  ar5416Common_9280_2 and
ar5416Common_9285_1_2 arrays currently) for the AR_PHY_ERR_EIFS_MASK re=
gister.

Hm, the ar5416Common_9280 and ar5416Common_9285 arrays are using 0x0000=
0000 for
the same register. By any chance, these values would be wrong in them a=
lso?

>=20
>>>>> +#define AR_SREV_VERSION_9100		0x014
>>>> 0x14?
>>> Yep, this can be fixed.
>> I have to send a new patch, or you will take care of it?
>=20
> Feel free to send a patch fixing this, and the macro cleanup.
> I'll just update the initvals, fix the check for AR9100 in HW attach=20

Well, the _AR9100_OR_LATER would be the right one, simply the macro its=
elf is
wrong. According to Luis' request, I would send a new patchset, then we=
 can
discuss it further based on that.

> and the typo for AR9285 chipsets.

This one can go with a separated patch?

Regards,
Gabor
--
To unsubscribe from this list: send the line "unsubscribe linux-wireles=
s" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* [ath9k-devel] [RFC] ath9k: use correct init values for ar9100 devices
@ 2009-03-05 10:43               ` Gabor Juhos
  0 siblings, 0 replies; 27+ messages in thread
From: Gabor Juhos @ 2009-03-05 10:43 UTC (permalink / raw)
  To: ath9k-devel

Sujith ?rta:
> Gabor Juhos wrote:
>> Well, I was curious, so I did it. :)
>>
>> After some cut&paste job, here is the diff between the original and the new
>> initvals from your patch:
>>
>> diff --git a/drivers/net/wireless/ath9k/initvals.h
>> b/drivers/net/wireless/ath9k/initvals.h
>> index d492363..d5a8aec 100644
>> --- a/drivers/net/wireless/ath9k/initvals.h
>> +++ b/drivers/net/wireless/ath9k/initvals.h
>> @@ -658,7 +657,7 @@ static const u32 ar5416Addac_9100[][2] = {
>>      {0x0000989c,  0x00000000 },
>>      {0x0000989c,  0x00000000 },
>>      {0x0000989c,  0x00000000 },
>> -    {0x000098cc,  0x00000000 },
>> +    {0x000098c4,  0x00000000 },
>>  };
>>
>>  static const u32 ar5416Modes[][6] = {
>> @@ -862,7 +861,7 @@ static const u32 ar5416Common[][2] = {
>>      { 0x00008134, 0x00000000 },
>>      { 0x00008138, 0x00000000 },
>>      { 0x0000813c, 0x00000000 },
>> -    { 0x00008144, 0x00000000 },
>> +    { 0x00008144, 0xffffffff },
>>      { 0x00008168, 0x00000000 },
>>      { 0x0000816c, 0x00000000 },
>>      { 0x00008170, 0x32143320 },
>>
> 
> Heh. :-)
> Dunno if those 2 values make any difference.

Indeed, these 2 values does not make too much difference.

The first one reverts this commit:
http://git.kernel.org/?p=linux/kernel/git/linville/wireless-testing.git;a=commitdiff;h=6753ddb4bebecab1039a2a2c8d51d6656d0d0513

With the second one we will use the same initial value (which is in the
ar5416Common_9100, ar5416Common_9160  ar5416Common_9280_2 and
ar5416Common_9285_1_2 arrays currently) for the AR_PHY_ERR_EIFS_MASK register.

Hm, the ar5416Common_9280 and ar5416Common_9285 arrays are using 0x00000000 for
the same register. By any chance, these values would be wrong in them also?

> 
>>>>> +#define AR_SREV_VERSION_9100		0x014
>>>> 0x14?
>>> Yep, this can be fixed.
>> I have to send a new patch, or you will take care of it?
> 
> Feel free to send a patch fixing this, and the macro cleanup.
> I'll just update the initvals, fix the check for AR9100 in HW attach 

Well, the _AR9100_OR_LATER would be the right one, simply the macro itself is
wrong. According to Luis' request, I would send a new patchset, then we can
discuss it further based on that.

> and the typo for AR9285 chipsets.

This one can go with a separated patch?

Regards,
Gabor

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

* Re: [ath9k-devel] [RFC] ath9k: use correct init values for ar9100 devices
  2009-03-05 10:43               ` Gabor Juhos
@ 2009-03-05 15:00                 ` Sujith
  -1 siblings, 0 replies; 27+ messages in thread
From: Sujith @ 2009-03-05 15:00 UTC (permalink / raw)
  To: Gabor Juhos; +Cc: ath9k-devel, linux-wireless, John W. Linville

Gabor Juhos wrote:
> >> @@ -658,7 +657,7 @@ static const u32 ar5416Addac_9100[][2] = {
> >>      {0x0000989c,  0x00000000 },
> >>      {0x0000989c,  0x00000000 },
> >>      {0x0000989c,  0x00000000 },
> >> -    {0x000098cc,  0x00000000 },
> >> +    {0x000098c4,  0x00000000 },
> >>  };
> >>
> >>  static const u32 ar5416Modes[][6] = {
> >> @@ -862,7 +861,7 @@ static const u32 ar5416Common[][2] = {
> >>      { 0x00008134, 0x00000000 },
> >>      { 0x00008138, 0x00000000 },
> >>      { 0x0000813c, 0x00000000 },
> >> -    { 0x00008144, 0x00000000 },
> >> +    { 0x00008144, 0xffffffff },
> >>      { 0x00008168, 0x00000000 },
> >>      { 0x0000816c, 0x00000000 },
> >>      { 0x00008170, 0x32143320 },
> >>
> > 
> > Heh. :-)
> > Dunno if those 2 values make any difference.
> 
> Indeed, these 2 values does not make too much difference.
> 
> The first one reverts this commit:
> http://git.kernel.org/?p=linux/kernel/git/linville/wireless-testing.git;a=commitdiff;h=6753ddb4bebecab1039a2a2c8d51d6656d0d0513
> 
> With the second one we will use the same initial value (which is in the
> ar5416Common_9100, ar5416Common_9160  ar5416Common_9280_2 and
> ar5416Common_9285_1_2 arrays currently) for the AR_PHY_ERR_EIFS_MASK register.
> 
> Hm, the ar5416Common_9280 and ar5416Common_9285 arrays are using 0x00000000 for
> the same register. By any chance, these values would be wrong in them also?

We would be updating the initvals for all chipsets shortly,
so if any value in the existing arrays is wrong, it would be fixed.

> > Feel free to send a patch fixing this, and the macro cleanup.
> > I'll just update the initvals, fix the check for AR9100 in HW attach 
> 
> Well, the _AR9100_OR_LATER would be the right one, simply the macro itself is
> wrong. According to Luis' request, I would send a new patchset, then we can
> discuss it further based on that.

Sure, either way those initvals are meant only for AR91xx chipsets.

> > and the typo for AR9285 chipsets.
> 
> This one can go with a separated patch?

Sure.

Sujith

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

* [ath9k-devel] [RFC] ath9k: use correct init values for ar9100 devices
@ 2009-03-05 15:00                 ` Sujith
  0 siblings, 0 replies; 27+ messages in thread
From: Sujith @ 2009-03-05 15:00 UTC (permalink / raw)
  To: ath9k-devel

Gabor Juhos wrote:
> >> @@ -658,7 +657,7 @@ static const u32 ar5416Addac_9100[][2] = {
> >>      {0x0000989c,  0x00000000 },
> >>      {0x0000989c,  0x00000000 },
> >>      {0x0000989c,  0x00000000 },
> >> -    {0x000098cc,  0x00000000 },
> >> +    {0x000098c4,  0x00000000 },
> >>  };
> >>
> >>  static const u32 ar5416Modes[][6] = {
> >> @@ -862,7 +861,7 @@ static const u32 ar5416Common[][2] = {
> >>      { 0x00008134, 0x00000000 },
> >>      { 0x00008138, 0x00000000 },
> >>      { 0x0000813c, 0x00000000 },
> >> -    { 0x00008144, 0x00000000 },
> >> +    { 0x00008144, 0xffffffff },
> >>      { 0x00008168, 0x00000000 },
> >>      { 0x0000816c, 0x00000000 },
> >>      { 0x00008170, 0x32143320 },
> >>
> > 
> > Heh. :-)
> > Dunno if those 2 values make any difference.
> 
> Indeed, these 2 values does not make too much difference.
> 
> The first one reverts this commit:
> http://git.kernel.org/?p=linux/kernel/git/linville/wireless-testing.git;a=commitdiff;h=6753ddb4bebecab1039a2a2c8d51d6656d0d0513
> 
> With the second one we will use the same initial value (which is in the
> ar5416Common_9100, ar5416Common_9160  ar5416Common_9280_2 and
> ar5416Common_9285_1_2 arrays currently) for the AR_PHY_ERR_EIFS_MASK register.
> 
> Hm, the ar5416Common_9280 and ar5416Common_9285 arrays are using 0x00000000 for
> the same register. By any chance, these values would be wrong in them also?

We would be updating the initvals for all chipsets shortly,
so if any value in the existing arrays is wrong, it would be fixed.

> > Feel free to send a patch fixing this, and the macro cleanup.
> > I'll just update the initvals, fix the check for AR9100 in HW attach 
> 
> Well, the _AR9100_OR_LATER would be the right one, simply the macro itself is
> wrong. According to Luis' request, I would send a new patchset, then we can
> discuss it further based on that.

Sure, either way those initvals are meant only for AR91xx chipsets.

> > and the typo for AR9285 chipsets.
> 
> This one can go with a separated patch?

Sure.

Sujith

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

end of thread, other threads:[~2009-03-05 15:01 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-03-03 18:10 [RFC] ath9k: use correct init values for ar9100 devices Gabor Juhos
2009-03-03 18:10 ` [ath9k-devel] " Gabor Juhos
2009-03-04  4:30 ` Sujith
2009-03-04  4:30   ` [ath9k-devel] " Sujith
2009-03-04  5:35   ` Sujith
2009-03-04  5:35     ` [ath9k-devel] " Sujith
2009-03-04 13:38     ` Gabor Juhos
2009-03-04 14:21       ` Sujith
2009-03-04 14:21         ` Sujith
2009-03-04 16:20         ` Gabor Juhos
2009-03-04 16:20           ` Gabor Juhos
2009-03-05  1:49           ` Sujith
2009-03-05  1:49             ` Sujith
2009-03-05 10:43             ` Gabor Juhos
2009-03-05 10:43               ` Gabor Juhos
2009-03-05 15:00               ` Sujith
2009-03-05 15:00                 ` Sujith
2009-03-04 13:41   ` Gabor Juhos
2009-03-04 13:41     ` [ath9k-devel] " Gabor Juhos
2009-03-04 14:29     ` Sujith
2009-03-04 14:29       ` Sujith
2009-03-04 14:57       ` Gabor Juhos
2009-03-04 14:57         ` Gabor Juhos
2009-03-05  1:51         ` Sujith
2009-03-05  1:51           ` Sujith
2009-03-05  2:15           ` Luis R. Rodriguez
2009-03-05  2:15             ` Luis R. Rodriguez

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.