Skip to contentSkip to conversation

ath9k: use correct init values for ar9100 devices

RFC In review Gabor Juhos 4 participants 14 messages Mar 3, 2009 – Mar 5, 2009 Networking drivers (wireless)

lore
Share & tools
lore
#0 lore raw

RFC 1/1 ath9k: use correct init values for ar9100 devices

Changes-licensed-under: ISC

---
 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

drivers/net/wireless/ath9k/initvals.h +22 -22
index d492363..4eb8b59 100644
@@ -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 },
drivers/net/wireless/ath9k/reg.h +17 -15
index 8d85106..22a14a4 100644
@@ -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) \
Signature · 1 line
1.5.3.2
#1 lore raw
Quoted 9 lines · Gabor Juhos

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.

Quoted 5 lines

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.

Quoted 7 lines

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.

drivers/net/wireless/ath9k/reg.h line 753

Quoted 12 lines
drivers/net/wireless/ath9k/reg.h +12 -0
+#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).

Quoted 22 lines
drivers/net/wireless/ath9k/reg.h +4 -8
+#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

#2 lore raw

RFC 1/1 ath9k: use correct init values for ar9100 devices

Quoted 2 lines · Sujith Manoharan

I'll check the initval arrays and update.

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

drivers/net/wireless/ath9k/hw.c +1 -1
index eb750a5..d7b3c44 100644
@@ -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,
drivers/net/wireless/ath9k/initvals.h +178 -182

649 lines not on this page · raw message

drivers/net/wireless/ath9k/reg.h +28 -31

87 lines not on this page · raw message

#3 lore raw

Sujith ?rta:

Quoted 5 lines
Quoted 2 lines · Sujith Manoharan

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.

drivers/net/wireless/ath9k/hw.c static struct ath_hw *ath9k_hw_do_attach(u16 devid, struct ath_softc *sc, · line 763

Quoted 11 lines
drivers/net/wireless/ath9k/hw.c +1 -1
index eb750a5..d7b3c44 100644
@@ -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.

Quoted 680 lines
drivers/net/wireless/ath9k/hw.c +0 -0
 		INIT_INI_ARRAY(&ah->iniModes, ar5416Modes_9100,
 			       ARRAY_SIZE(ar5416Modes_9100), 6);
 		INIT_INI_ARRAY(&ah->iniCommon, ar5416Common_9100,
drivers/net/wireless/ath9k/initvals.h +168 -182
index d492363..0b579b4 100644
@@ -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 },

drivers/net/wireless/ath9k/initvals.h static const u32 ar5416Bank7[][2] = { · line 1307

Quoted 10 lines
drivers/net/wireless/ath9k/initvals.h +10 -0
+    {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?

Quoted 41 lines
drivers/net/wireless/ath9k/initvals.h +0 -0
 };
 
 static const u32 ar5416Modes_9160[][6] = {
drivers/net/wireless/ath9k/reg.h +0 -23
index 91442da..cef1570 100644
@@ -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

drivers/net/wireless/ath9k/reg.h line 729

Quoted 10 lines
drivers/net/wireless/ath9k/reg.h +6 -4
-#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?

Quoted 19 lines
drivers/net/wireless/ath9k/reg.h +18 -0
+#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) \

drivers/net/wireless/ath9k/reg.h line 756

Quoted 10 lines
drivers/net/wireless/ath9k/reg.h +2 -2
 	(((_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.

Quoted 8 lines
drivers/net/wireless/ath9k/reg.h +1 -1
@@ -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))

drivers/net/wireless/ath9k/reg.h line 788

Quoted 10 lines
drivers/net/wireless/ath9k/reg.h +1 -1
 #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

#4 lore raw
Quoted 3 lines · Gabor Juhos

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.

Quoted 3 lines
Quoted 1 line

+#define AR_SREV_VERSION_9100 0x014

0x14?

Yep, this can be fixed.

Sujith

#5 lore raw

RFC 1/1 ath9k: use correct init values for ar9100 devices

Sujith ?rta:

Quoted 6 lines
Quoted 3 lines · Gabor Juhos

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:

(quoted diff) +0 -0

b/drivers/net/wireless/ath9k/initvals.h
index d492363..d5a8aec 100644

drivers/net/wireless/ath9k/initvals.h +2 -2
@@ -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 },
Quoted 2 lines

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.

Quoted 5 lines
Quoted 3 lines
Quoted 2 lines

+#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

#6 lore raw
Quoted 21 lines · Gabor Juhos

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:

drivers/net/wireless/ath9k/initvals.h +1 -1
index d492363..d5a8aec 100644
@@ -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] = {

drivers/net/wireless/ath9k/initvals.h static const u32 ar5416Common[][2] = { · line 867

Quoted 8 lines
drivers/net/wireless/ath9k/initvals.h +1 -1
@@ -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.

Quoted 6 lines
Quoted 4 lines
Quoted 2 lines
Quoted 1 line

+#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

#7 lore raw

Sujith ?rta:

Quoted 19 lines
Quoted 18 lines · Gabor Juhos

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:

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

drivers/net/wireless/ath9k/initvals.h static const u32 ar5416Common[][2] = { · line 867

Quoted 11 lines
drivers/net/wireless/ath9k/initvals.h +1 -1
 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?

Quoted 8 lines
Quoted 5 lines
Quoted 4 lines
Quoted 3 lines
Quoted 2 lines

+#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.

Quoted 1 line

and the typo for AR9285 chipsets.

This one can go with a separated patch?

Regards,
Gabor

#8 lore raw
Quoted 28 lines · Gabor Juhos
Quoted 8 lines
Quoted 8 lines
drivers/net/wireless/ath9k/initvals.h +1 -1
@@ -658,7 +657,7 @@ static const u32 ar5416Addac_9100[][2] = {
     {0x0000989c,  0x00000000 },
     {0x0000989c,  0x00000000 },
     {0x0000989c,  0x00000000 },
-    {0x000098cc,  0x00000000 },
+    {0x000098c4,  0x00000000 },
 };
 
Quoted 14 lines

drivers/net/wireless/ath9k/initvals.h static const u32 ar5416Common[][2] = { · line 867

Quoted 11 lines
drivers/net/wireless/ath9k/initvals.h +1 -1
 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

Quoted 6 lines

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.

Quoted 6 lines
Quoted 2 lines

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.

Quoted 3 lines
Quoted 1 line

and the typo for AR9285 chipsets.

This one can go with a separated patch?

Sure.

Sujith

#9 lore raw
In reply to Sujith

Sujith ?rta:

Quoted 5 lines
Quoted 4 lines · Gabor Juhos

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'.

Quoted 7 lines
Quoted 5 lines

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.

Quoted 16 lines
Quoted 6 lines

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.

Quoted 7 lines

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.

Quoted 14 lines

drivers/net/wireless/ath9k/reg.h line 753

Quoted 12 lines
drivers/net/wireless/ath9k/reg.h +12 -0
+#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.

Quoted 11 lines
Quoted 11 lines
drivers/net/wireless/ath9k/reg.h +2 -7
+#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))
Quoted 8 lines
Quoted 8 lines
drivers/net/wireless/ath9k/reg.h +2 -1
+       ((_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

#10 lore raw
Quoted 15 lines · Gabor Juhos
Quoted 6 lines
Quoted 6 lines
drivers/net/wireless/ath9k/reg.h +6 -0
+#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)) && \
Quoted 8 lines

drivers/net/wireless/ath9k/reg.h line 753

Quoted 6 lines
drivers/net/wireless/ath9k/reg.h +6 -0
+       ((_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).

Quoted 5 lines

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

#11 lore raw

Sujith ?rta:

Quoted 20 lines
Quoted 13 lines · Gabor Juhos
Quoted 5 lines
Quoted 5 lines
drivers/net/wireless/ath9k/reg.h +5 -0
+#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) || \
Quoted 8 lines

drivers/net/wireless/ath9k/reg.h line 753

Quoted 7 lines
drivers/net/wireless/ath9k/reg.h +7 -0
+       ((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).

Quoted 5 lines

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.

Quoted 5 lines

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

#12 lore raw
Quoted 9 lines · Gabor Juhos
#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

#13 lore raw

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