aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath9k/hw.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/hw.c')
-rw-r--r--drivers/net/wireless/ath/ath9k/hw.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c
index b4a8af1a544c..034b6fdf01f3 100644
--- a/drivers/net/wireless/ath/ath9k/hw.c
+++ b/drivers/net/wireless/ath/ath9k/hw.c
@@ -297,18 +297,25 @@ static void ath9k_hw_disablepcie(struct ath_hw *ah)
297 REG_WRITE(ah, AR_PCIE_SERDES2, 0x00000000); 297 REG_WRITE(ah, AR_PCIE_SERDES2, 0x00000000);
298} 298}
299 299
300/* This should work for all families including legacy */
300static bool ath9k_hw_chip_test(struct ath_hw *ah) 301static bool ath9k_hw_chip_test(struct ath_hw *ah)
301{ 302{
302 struct ath_common *common = ath9k_hw_common(ah); 303 struct ath_common *common = ath9k_hw_common(ah);
303 u32 regAddr[2] = { AR_STA_ID0, AR_PHY_BASE + (8 << 2) }; 304 u32 regAddr[2] = { AR_STA_ID0 };
304 u32 regHold[2]; 305 u32 regHold[2];
305 u32 patternData[4] = { 0x55555555, 306 u32 patternData[4] = { 0x55555555,
306 0xaaaaaaaa, 307 0xaaaaaaaa,
307 0x66666666, 308 0x66666666,
308 0x99999999 }; 309 0x99999999 };
309 int i, j; 310 int i, j, loop_max;
310 311
311 for (i = 0; i < 2; i++) { 312 if (!AR_SREV_9300_20_OR_LATER(ah)) {
313 loop_max = 2;
314 regAddr[1] = AR_PHY_BASE + (8 << 2);
315 } else
316 loop_max = 1;
317
318 for (i = 0; i < loop_max; i++) {
312 u32 addr = regAddr[i]; 319 u32 addr = regAddr[i];
313 u32 wrData, rdData; 320 u32 wrData, rdData;
314 321