aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2010-09-22 06:34:52 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-09-27 15:57:39 -0400
commit7a37081e2e25e58701b17c41579fd06bc353b392 (patch)
tree94a4f361030b97115ff90c37f00459c8666d9fdd /drivers
parent67e0208acea29682f5766eb9f67f6f26117eef3e (diff)
ath9k_hw: simplify revision checks for AR9280
Since AR9280 v1.0 was never sold (and the initvals removed), v1.0 specific revision checks can be removed and the 'v2.0 or later' check can be simplified to a check for AR9280 or later. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/ath/ath9k/ar5008_phy.c14
-rw-r--r--drivers/net/wireless/ath/ath9k/ar9002_calib.c6
-rw-r--r--drivers/net/wireless/ath/ath9k/ar9002_hw.c2
-rw-r--r--drivers/net/wireless/ath/ath9k/eeprom_4k.c4
-rw-r--r--drivers/net/wireless/ath/ath9k/eeprom_9287.c6
-rw-r--r--drivers/net/wireless/ath/ath9k/eeprom_def.c18
-rw-r--r--drivers/net/wireless/ath/ath9k/hw.c15
-rw-r--r--drivers/net/wireless/ath/ath9k/init.c2
-rw-r--r--drivers/net/wireless/ath/ath9k/recv.c2
-rw-r--r--drivers/net/wireless/ath/ath9k/reg.h9
10 files changed, 36 insertions, 42 deletions
diff --git a/drivers/net/wireless/ath/ath9k/ar5008_phy.c b/drivers/net/wireless/ath/ath9k/ar5008_phy.c
index 3d2c8679bc8..9318ae73698 100644
--- a/drivers/net/wireless/ath/ath9k/ar5008_phy.c
+++ b/drivers/net/wireless/ath/ath9k/ar5008_phy.c
@@ -118,7 +118,7 @@ static void ar5008_hw_force_bias(struct ath_hw *ah, u16 synth_freq)
118 if (!AR_SREV_5416(ah) || synth_freq >= 3000) 118 if (!AR_SREV_5416(ah) || synth_freq >= 3000)
119 return; 119 return;
120 120
121 BUG_ON(AR_SREV_9280_10_OR_LATER(ah)); 121 BUG_ON(AR_SREV_9280_20_OR_LATER(ah));
122 122
123 if (synth_freq < 2412) 123 if (synth_freq < 2412)
124 new_bias = 0; 124 new_bias = 0;
@@ -454,7 +454,7 @@ static int ar5008_hw_rf_alloc_ext_banks(struct ath_hw *ah)
454 454
455 struct ath_common *common = ath9k_hw_common(ah); 455 struct ath_common *common = ath9k_hw_common(ah);
456 456
457 BUG_ON(AR_SREV_9280_10_OR_LATER(ah)); 457 BUG_ON(AR_SREV_9280_20_OR_LATER(ah));
458 458
459 ATH_ALLOC_BANK(ah->analogBank0Data, ah->iniBank0.ia_rows); 459 ATH_ALLOC_BANK(ah->analogBank0Data, ah->iniBank0.ia_rows);
460 ATH_ALLOC_BANK(ah->analogBank1Data, ah->iniBank1.ia_rows); 460 ATH_ALLOC_BANK(ah->analogBank1Data, ah->iniBank1.ia_rows);
@@ -484,7 +484,7 @@ static void ar5008_hw_rf_free_ext_banks(struct ath_hw *ah)
484 bank = NULL; \ 484 bank = NULL; \
485 } while (0); 485 } while (0);
486 486
487 BUG_ON(AR_SREV_9280_10_OR_LATER(ah)); 487 BUG_ON(AR_SREV_9280_20_OR_LATER(ah));
488 488
489 ATH_FREE_BANK(ah->analogBank0Data); 489 ATH_FREE_BANK(ah->analogBank0Data);
490 ATH_FREE_BANK(ah->analogBank1Data); 490 ATH_FREE_BANK(ah->analogBank1Data);
@@ -525,7 +525,7 @@ static bool ar5008_hw_set_rf_regs(struct ath_hw *ah,
525 * for single chip devices, that is AR9280 or anything 525 * for single chip devices, that is AR9280 or anything
526 * after that. 526 * after that.
527 */ 527 */
528 if (AR_SREV_9280_10_OR_LATER(ah)) 528 if (AR_SREV_9280_20_OR_LATER(ah))
529 return true; 529 return true;
530 530
531 /* Setup rf parameters */ 531 /* Setup rf parameters */
@@ -663,7 +663,7 @@ static void ar5008_hw_override_ini(struct ath_hw *ah,
663 */ 663 */
664 REG_SET_BIT(ah, AR_DIAG_SW, (AR_DIAG_RX_DIS | AR_DIAG_RX_ABORT)); 664 REG_SET_BIT(ah, AR_DIAG_SW, (AR_DIAG_RX_DIS | AR_DIAG_RX_ABORT));
665 665
666 if (AR_SREV_9280_10_OR_LATER(ah)) { 666 if (AR_SREV_9280_20_OR_LATER(ah)) {
667 val = REG_READ(ah, AR_PCU_MISC_MODE2); 667 val = REG_READ(ah, AR_PCU_MISC_MODE2);
668 668
669 if (!AR_SREV_9271(ah)) 669 if (!AR_SREV_9271(ah))
@@ -676,7 +676,7 @@ static void ar5008_hw_override_ini(struct ath_hw *ah,
676 } 676 }
677 677
678 if (!AR_SREV_5416_20_OR_LATER(ah) || 678 if (!AR_SREV_5416_20_OR_LATER(ah) ||
679 AR_SREV_9280_10_OR_LATER(ah)) 679 AR_SREV_9280_20_OR_LATER(ah))
680 return; 680 return;
681 /* 681 /*
682 * Disable BB clock gating 682 * Disable BB clock gating
@@ -900,7 +900,7 @@ static void ar5008_hw_set_rfmode(struct ath_hw *ah, struct ath9k_channel *chan)
900 rfMode |= (IS_CHAN_B(chan) || IS_CHAN_G(chan)) 900 rfMode |= (IS_CHAN_B(chan) || IS_CHAN_G(chan))
901 ? AR_PHY_MODE_DYNAMIC : AR_PHY_MODE_OFDM; 901 ? AR_PHY_MODE_DYNAMIC : AR_PHY_MODE_OFDM;
902 902
903 if (!AR_SREV_9280_10_OR_LATER(ah)) 903 if (!AR_SREV_9280_20_OR_LATER(ah))
904 rfMode |= (IS_CHAN_5GHZ(chan)) ? 904 rfMode |= (IS_CHAN_5GHZ(chan)) ?
905 AR_PHY_MODE_RF5GHZ : AR_PHY_MODE_RF2GHZ; 905 AR_PHY_MODE_RF5GHZ : AR_PHY_MODE_RF2GHZ;
906 906
diff --git a/drivers/net/wireless/ath/ath9k/ar9002_calib.c b/drivers/net/wireless/ath/ath9k/ar9002_calib.c
index fe7418aefc4..dc64afeeaa1 100644
--- a/drivers/net/wireless/ath/ath9k/ar9002_calib.c
+++ b/drivers/net/wireless/ath/ath9k/ar9002_calib.c
@@ -841,7 +841,7 @@ static bool ar9002_hw_init_cal(struct ath_hw *ah, struct ath9k_channel *chan)
841 if (!ar9285_hw_clc(ah, chan)) 841 if (!ar9285_hw_clc(ah, chan))
842 return false; 842 return false;
843 } else { 843 } else {
844 if (AR_SREV_9280_10_OR_LATER(ah)) { 844 if (AR_SREV_9280_20_OR_LATER(ah)) {
845 if (!AR_SREV_9287_10_OR_LATER(ah)) 845 if (!AR_SREV_9287_10_OR_LATER(ah))
846 REG_CLR_BIT(ah, AR_PHY_ADC_CTL, 846 REG_CLR_BIT(ah, AR_PHY_ADC_CTL,
847 AR_PHY_ADC_CTL_OFF_PWDADC); 847 AR_PHY_ADC_CTL_OFF_PWDADC);
@@ -864,7 +864,7 @@ static bool ar9002_hw_init_cal(struct ath_hw *ah, struct ath9k_channel *chan)
864 return false; 864 return false;
865 } 865 }
866 866
867 if (AR_SREV_9280_10_OR_LATER(ah)) { 867 if (AR_SREV_9280_20_OR_LATER(ah)) {
868 if (!AR_SREV_9287_10_OR_LATER(ah)) 868 if (!AR_SREV_9287_10_OR_LATER(ah))
869 REG_SET_BIT(ah, AR_PHY_ADC_CTL, 869 REG_SET_BIT(ah, AR_PHY_ADC_CTL,
870 AR_PHY_ADC_CTL_OFF_PWDADC); 870 AR_PHY_ADC_CTL_OFF_PWDADC);
@@ -976,7 +976,7 @@ static void ar9002_hw_init_cal_settings(struct ath_hw *ah)
976 } 976 }
977 977
978 if (AR_SREV_9160_10_OR_LATER(ah)) { 978 if (AR_SREV_9160_10_OR_LATER(ah)) {
979 if (AR_SREV_9280_10_OR_LATER(ah)) { 979 if (AR_SREV_9280_20_OR_LATER(ah)) {
980 ah->iq_caldata.calData = &iq_cal_single_sample; 980 ah->iq_caldata.calData = &iq_cal_single_sample;
981 ah->adcgain_caldata.calData = 981 ah->adcgain_caldata.calData =
982 &adc_gain_cal_single_sample; 982 &adc_gain_cal_single_sample;
diff --git a/drivers/net/wireless/ath/ath9k/ar9002_hw.c b/drivers/net/wireless/ath/ath9k/ar9002_hw.c
index 94392daebaa..fde45082a13 100644
--- a/drivers/net/wireless/ath/ath9k/ar9002_hw.c
+++ b/drivers/net/wireless/ath/ath9k/ar9002_hw.c
@@ -569,7 +569,7 @@ void ar9002_hw_attach_ops(struct ath_hw *ah)
569 ops->config_pci_powersave = ar9002_hw_configpcipowersave; 569 ops->config_pci_powersave = ar9002_hw_configpcipowersave;
570 570
571 ar5008_hw_attach_phy_ops(ah); 571 ar5008_hw_attach_phy_ops(ah);
572 if (AR_SREV_9280_10_OR_LATER(ah)) 572 if (AR_SREV_9280_20_OR_LATER(ah))
573 ar9002_hw_attach_phy_ops(ah); 573 ar9002_hw_attach_phy_ops(ah);
574 574
575 ar9002_hw_attach_calib_ops(ah); 575 ar9002_hw_attach_calib_ops(ah);
diff --git a/drivers/net/wireless/ath/ath9k/eeprom_4k.c b/drivers/net/wireless/ath/ath9k/eeprom_4k.c
index ead8b0dd3b5..677e0c9d048 100644
--- a/drivers/net/wireless/ath/ath9k/eeprom_4k.c
+++ b/drivers/net/wireless/ath/ath9k/eeprom_4k.c
@@ -333,7 +333,7 @@ static void ath9k_hw_get_4k_gain_boundaries_pdadcs(struct ath_hw *ah,
333 } 333 }
334 334
335 if (i == 0) { 335 if (i == 0) {
336 if (AR_SREV_9280_10_OR_LATER(ah)) 336 if (AR_SREV_9280_20_OR_LATER(ah))
337 ss = (int16_t)(0 - (minPwrT4[i] / 2)); 337 ss = (int16_t)(0 - (minPwrT4[i] / 2));
338 else 338 else
339 ss = 0; 339 ss = 0;
@@ -761,7 +761,7 @@ static void ath9k_hw_4k_set_txpower(struct ath_hw *ah,
761 761
762 regulatory->max_power_level = ratesArray[i]; 762 regulatory->max_power_level = ratesArray[i];
763 763
764 if (AR_SREV_9280_10_OR_LATER(ah)) { 764 if (AR_SREV_9280_20_OR_LATER(ah)) {
765 for (i = 0; i < Ar5416RateSize; i++) 765 for (i = 0; i < Ar5416RateSize; i++)
766 ratesArray[i] -= AR5416_PWR_TABLE_OFFSET_DB * 2; 766 ratesArray[i] -= AR5416_PWR_TABLE_OFFSET_DB * 2;
767 } 767 }
diff --git a/drivers/net/wireless/ath/ath9k/eeprom_9287.c b/drivers/net/wireless/ath/ath9k/eeprom_9287.c
index e6186515d05..966b9496a9d 100644
--- a/drivers/net/wireless/ath/ath9k/eeprom_9287.c
+++ b/drivers/net/wireless/ath/ath9k/eeprom_9287.c
@@ -324,7 +324,7 @@ static void ath9k_hw_get_ar9287_gain_boundaries_pdadcs(struct ath_hw *ah,
324 minDelta = 0; 324 minDelta = 0;
325 325
326 if (i == 0) { 326 if (i == 0) {
327 if (AR_SREV_9280_10_OR_LATER(ah)) 327 if (AR_SREV_9280_20_OR_LATER(ah))
328 ss = (int16_t)(0 - (minPwrT4[i] / 2)); 328 ss = (int16_t)(0 - (minPwrT4[i] / 2));
329 else 329 else
330 ss = 0; 330 ss = 0;
@@ -883,7 +883,7 @@ static void ath9k_hw_ar9287_set_txpower(struct ath_hw *ah,
883 ratesArray[i] = AR9287_MAX_RATE_POWER; 883 ratesArray[i] = AR9287_MAX_RATE_POWER;
884 } 884 }
885 885
886 if (AR_SREV_9280_10_OR_LATER(ah)) { 886 if (AR_SREV_9280_20_OR_LATER(ah)) {
887 for (i = 0; i < Ar5416RateSize; i++) 887 for (i = 0; i < Ar5416RateSize; i++)
888 ratesArray[i] -= AR9287_PWR_TABLE_OFFSET_DB * 2; 888 ratesArray[i] -= AR9287_PWR_TABLE_OFFSET_DB * 2;
889 } 889 }
@@ -977,7 +977,7 @@ static void ath9k_hw_ar9287_set_txpower(struct ath_hw *ah,
977 else 977 else
978 i = rate6mb; 978 i = rate6mb;
979 979
980 if (AR_SREV_9280_10_OR_LATER(ah)) 980 if (AR_SREV_9280_20_OR_LATER(ah))
981 regulatory->max_power_level = 981 regulatory->max_power_level =
982 ratesArray[i] + AR9287_PWR_TABLE_OFFSET_DB * 2; 982 ratesArray[i] + AR9287_PWR_TABLE_OFFSET_DB * 2;
983 else 983 else
diff --git a/drivers/net/wireless/ath/ath9k/eeprom_def.c b/drivers/net/wireless/ath/ath9k/eeprom_def.c
index 23f480d4c77..76b4d65472d 100644
--- a/drivers/net/wireless/ath/ath9k/eeprom_def.c
+++ b/drivers/net/wireless/ath/ath9k/eeprom_def.c
@@ -223,7 +223,7 @@ static int ath9k_hw_def_check_eeprom(struct ath_hw *ah)
223 } 223 }
224 224
225 /* Enable fixup for AR_AN_TOP2 if necessary */ 225 /* Enable fixup for AR_AN_TOP2 if necessary */
226 if (AR_SREV_9280_10_OR_LATER(ah) && 226 if (AR_SREV_9280_20_OR_LATER(ah) &&
227 (eep->baseEepHeader.version & 0xff) > 0x0a && 227 (eep->baseEepHeader.version & 0xff) > 0x0a &&
228 eep->baseEepHeader.pwdclkind == 0) 228 eep->baseEepHeader.pwdclkind == 0)
229 ah->need_an_top2_fixup = 1; 229 ah->need_an_top2_fixup = 1;
@@ -317,7 +317,7 @@ static void ath9k_hw_def_set_gain(struct ath_hw *ah,
317 if (AR5416_VER_MASK >= AR5416_EEP_MINOR_VER_3) { 317 if (AR5416_VER_MASK >= AR5416_EEP_MINOR_VER_3) {
318 txRxAttenLocal = pModal->txRxAttenCh[i]; 318 txRxAttenLocal = pModal->txRxAttenCh[i];
319 319
320 if (AR_SREV_9280_10_OR_LATER(ah)) { 320 if (AR_SREV_9280_20_OR_LATER(ah)) {
321 REG_RMW_FIELD(ah, AR_PHY_GAIN_2GHZ + regChainOffset, 321 REG_RMW_FIELD(ah, AR_PHY_GAIN_2GHZ + regChainOffset,
322 AR_PHY_GAIN_2GHZ_XATTEN1_MARGIN, 322 AR_PHY_GAIN_2GHZ_XATTEN1_MARGIN,
323 pModal->bswMargin[i]); 323 pModal->bswMargin[i]);
@@ -344,7 +344,7 @@ static void ath9k_hw_def_set_gain(struct ath_hw *ah,
344 } 344 }
345 } 345 }
346 346
347 if (AR_SREV_9280_10_OR_LATER(ah)) { 347 if (AR_SREV_9280_20_OR_LATER(ah)) {
348 REG_RMW_FIELD(ah, 348 REG_RMW_FIELD(ah,
349 AR_PHY_RXGAIN + regChainOffset, 349 AR_PHY_RXGAIN + regChainOffset,
350 AR9280_PHY_RXGAIN_TXRX_ATTEN, txRxAttenLocal); 350 AR9280_PHY_RXGAIN_TXRX_ATTEN, txRxAttenLocal);
@@ -408,7 +408,7 @@ static void ath9k_hw_def_set_board_values(struct ath_hw *ah,
408 regChainOffset, i); 408 regChainOffset, i);
409 } 409 }
410 410
411 if (AR_SREV_9280_10_OR_LATER(ah)) { 411 if (AR_SREV_9280_20_OR_LATER(ah)) {
412 if (IS_CHAN_2GHZ(chan)) { 412 if (IS_CHAN_2GHZ(chan)) {
413 ath9k_hw_analog_shift_rmw(ah, AR_AN_RF2G1_CH0, 413 ath9k_hw_analog_shift_rmw(ah, AR_AN_RF2G1_CH0,
414 AR_AN_RF2G1_CH0_OB, 414 AR_AN_RF2G1_CH0_OB,
@@ -461,7 +461,7 @@ static void ath9k_hw_def_set_board_values(struct ath_hw *ah,
461 REG_RMW_FIELD(ah, AR_PHY_DESIRED_SZ, AR_PHY_DESIRED_SZ_ADC, 461 REG_RMW_FIELD(ah, AR_PHY_DESIRED_SZ, AR_PHY_DESIRED_SZ_ADC,
462 pModal->adcDesiredSize); 462 pModal->adcDesiredSize);
463 463
464 if (!AR_SREV_9280_10_OR_LATER(ah)) 464 if (!AR_SREV_9280_20_OR_LATER(ah))
465 REG_RMW_FIELD(ah, AR_PHY_DESIRED_SZ, 465 REG_RMW_FIELD(ah, AR_PHY_DESIRED_SZ,
466 AR_PHY_DESIRED_SZ_PGA, 466 AR_PHY_DESIRED_SZ_PGA,
467 pModal->pgaDesiredSize); 467 pModal->pgaDesiredSize);
@@ -478,7 +478,7 @@ static void ath9k_hw_def_set_board_values(struct ath_hw *ah,
478 REG_RMW_FIELD(ah, AR_PHY_RF_CTL3, AR_PHY_TX_END_TO_A2_RX_ON, 478 REG_RMW_FIELD(ah, AR_PHY_RF_CTL3, AR_PHY_TX_END_TO_A2_RX_ON,
479 pModal->txEndToRxOn); 479 pModal->txEndToRxOn);
480 480
481 if (AR_SREV_9280_10_OR_LATER(ah)) { 481 if (AR_SREV_9280_20_OR_LATER(ah)) {
482 REG_RMW_FIELD(ah, AR_PHY_CCA, AR9280_PHY_CCA_THRESH62, 482 REG_RMW_FIELD(ah, AR_PHY_CCA, AR9280_PHY_CCA_THRESH62,
483 pModal->thresh62); 483 pModal->thresh62);
484 REG_RMW_FIELD(ah, AR_PHY_EXT_CCA0, 484 REG_RMW_FIELD(ah, AR_PHY_EXT_CCA0,
@@ -696,7 +696,7 @@ static void ath9k_hw_get_def_gain_boundaries_pdadcs(struct ath_hw *ah,
696 } 696 }
697 697
698 if (i == 0) { 698 if (i == 0) {
699 if (AR_SREV_9280_10_OR_LATER(ah)) 699 if (AR_SREV_9280_20_OR_LATER(ah))
700 ss = (int16_t)(0 - (minPwrT4[i] / 2)); 700 ss = (int16_t)(0 - (minPwrT4[i] / 2));
701 else 701 else
702 ss = 0; 702 ss = 0;
@@ -1291,7 +1291,7 @@ static void ath9k_hw_def_set_txpower(struct ath_hw *ah,
1291 ratesArray[i] = AR5416_MAX_RATE_POWER; 1291 ratesArray[i] = AR5416_MAX_RATE_POWER;
1292 } 1292 }
1293 1293
1294 if (AR_SREV_9280_10_OR_LATER(ah)) { 1294 if (AR_SREV_9280_20_OR_LATER(ah)) {
1295 for (i = 0; i < Ar5416RateSize; i++) { 1295 for (i = 0; i < Ar5416RateSize; i++) {
1296 int8_t pwr_table_offset; 1296 int8_t pwr_table_offset;
1297 1297
@@ -1395,7 +1395,7 @@ static void ath9k_hw_def_set_txpower(struct ath_hw *ah,
1395 else if (IS_CHAN_HT20(chan)) 1395 else if (IS_CHAN_HT20(chan))
1396 i = rateHt20_0; 1396 i = rateHt20_0;
1397 1397
1398 if (AR_SREV_9280_10_OR_LATER(ah)) 1398 if (AR_SREV_9280_20_OR_LATER(ah))
1399 regulatory->max_power_level = 1399 regulatory->max_power_level =
1400 ratesArray[i] + AR5416_PWR_TABLE_OFFSET_DB * 2; 1400 ratesArray[i] + AR5416_PWR_TABLE_OFFSET_DB * 2;
1401 else 1401 else
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c
index 0b2ff98b6f3..f2255a21163 100644
--- a/drivers/net/wireless/ath/ath9k/hw.c
+++ b/drivers/net/wireless/ath/ath9k/hw.c
@@ -565,7 +565,7 @@ static int __ath9k_hw_init(struct ath_hw *ah)
565 ath9k_hw_init_cal_settings(ah); 565 ath9k_hw_init_cal_settings(ah);
566 566
567 ah->ani_function = ATH9K_ANI_ALL; 567 ah->ani_function = ATH9K_ANI_ALL;
568 if (AR_SREV_9280_10_OR_LATER(ah) && !AR_SREV_9300_20_OR_LATER(ah)) 568 if (AR_SREV_9280_20_OR_LATER(ah) && !AR_SREV_9300_20_OR_LATER(ah))
569 ah->ani_function &= ~ATH9K_ANI_NOISE_IMMUNITY_LEVEL; 569 ah->ani_function &= ~ATH9K_ANI_NOISE_IMMUNITY_LEVEL;
570 if (!AR_SREV_9300_20_OR_LATER(ah)) 570 if (!AR_SREV_9300_20_OR_LATER(ah))
571 ah->ani_function &= ~ATH9K_ANI_MRC_CCK; 571 ah->ani_function &= ~ATH9K_ANI_MRC_CCK;
@@ -1312,7 +1312,7 @@ int ath9k_hw_reset(struct ath_hw *ah, struct ath9k_channel *chan,
1312 if (tsf) 1312 if (tsf)
1313 ath9k_hw_settsf64(ah, tsf); 1313 ath9k_hw_settsf64(ah, tsf);
1314 1314
1315 if (AR_SREV_9280_10_OR_LATER(ah)) 1315 if (AR_SREV_9280_20_OR_LATER(ah))
1316 REG_SET_BIT(ah, AR_GPIO_INPUT_EN_VAL, AR_GPIO_JTAG_DISABLE); 1316 REG_SET_BIT(ah, AR_GPIO_INPUT_EN_VAL, AR_GPIO_JTAG_DISABLE);
1317 1317
1318 if (!AR_SREV_9300_20_OR_LATER(ah)) 1318 if (!AR_SREV_9300_20_OR_LATER(ah))
@@ -1857,8 +1857,7 @@ int ath9k_hw_fill_cap_info(struct ath_hw *ah)
1857 /* Use rx_chainmask from EEPROM. */ 1857 /* Use rx_chainmask from EEPROM. */
1858 pCap->rx_chainmask = ah->eep_ops->get_eeprom(ah, EEP_RX_MASK); 1858 pCap->rx_chainmask = ah->eep_ops->get_eeprom(ah, EEP_RX_MASK);
1859 1859
1860 if (!(AR_SREV_9280(ah) && (ah->hw_version.macRev == 0))) 1860 ah->misc_mode |= AR_PCU_MIC_NEW_LOC_ENA;
1861 ah->misc_mode |= AR_PCU_MIC_NEW_LOC_ENA;
1862 1861
1863 pCap->low_2ghz_chan = 2312; 1862 pCap->low_2ghz_chan = 2312;
1864 pCap->high_2ghz_chan = 2732; 1863 pCap->high_2ghz_chan = 2732;
@@ -1896,7 +1895,7 @@ int ath9k_hw_fill_cap_info(struct ath_hw *ah)
1896 pCap->num_gpio_pins = AR7010_NUM_GPIO; 1895 pCap->num_gpio_pins = AR7010_NUM_GPIO;
1897 else if (AR_SREV_9285_10_OR_LATER(ah)) 1896 else if (AR_SREV_9285_10_OR_LATER(ah))
1898 pCap->num_gpio_pins = AR9285_NUM_GPIO; 1897 pCap->num_gpio_pins = AR9285_NUM_GPIO;
1899 else if (AR_SREV_9280_10_OR_LATER(ah)) 1898 else if (AR_SREV_9280_20_OR_LATER(ah))
1900 pCap->num_gpio_pins = AR928X_NUM_GPIO; 1899 pCap->num_gpio_pins = AR928X_NUM_GPIO;
1901 else 1900 else
1902 pCap->num_gpio_pins = AR_NUM_GPIO; 1901 pCap->num_gpio_pins = AR_NUM_GPIO;
@@ -1953,7 +1952,7 @@ int ath9k_hw_fill_cap_info(struct ath_hw *ah)
1953 pCap->num_antcfg_2ghz = 1952 pCap->num_antcfg_2ghz =
1954 ah->eep_ops->get_num_ant_config(ah, ATH9K_HAL_FREQ_BAND_2GHZ); 1953 ah->eep_ops->get_num_ant_config(ah, ATH9K_HAL_FREQ_BAND_2GHZ);
1955 1954
1956 if (AR_SREV_9280_10_OR_LATER(ah) && 1955 if (AR_SREV_9280_20_OR_LATER(ah) &&
1957 ath9k_hw_btcoex_supported(ah)) { 1956 ath9k_hw_btcoex_supported(ah)) {
1958 btcoex_hw->btactive_gpio = ATH_BTACTIVE_GPIO; 1957 btcoex_hw->btactive_gpio = ATH_BTACTIVE_GPIO;
1959 btcoex_hw->wlanactive_gpio = ATH_WLANACTIVE_GPIO; 1958 btcoex_hw->wlanactive_gpio = ATH_WLANACTIVE_GPIO;
@@ -2078,7 +2077,7 @@ u32 ath9k_hw_gpio_get(struct ath_hw *ah, u32 gpio)
2078 return MS_REG_READ(AR9287, gpio) != 0; 2077 return MS_REG_READ(AR9287, gpio) != 0;
2079 else if (AR_SREV_9285_10_OR_LATER(ah)) 2078 else if (AR_SREV_9285_10_OR_LATER(ah))
2080 return MS_REG_READ(AR9285, gpio) != 0; 2079 return MS_REG_READ(AR9285, gpio) != 0;
2081 else if (AR_SREV_9280_10_OR_LATER(ah)) 2080 else if (AR_SREV_9280_20_OR_LATER(ah))
2082 return MS_REG_READ(AR928X, gpio) != 0; 2081 return MS_REG_READ(AR928X, gpio) != 0;
2083 else 2082 else
2084 return MS_REG_READ(AR, gpio) != 0; 2083 return MS_REG_READ(AR, gpio) != 0;
@@ -2575,7 +2574,7 @@ void ath9k_hw_name(struct ath_hw *ah, char *hw_name, size_t len)
2575 int used; 2574 int used;
2576 2575
2577 /* chipsets >= AR9280 are single-chip */ 2576 /* chipsets >= AR9280 are single-chip */
2578 if (AR_SREV_9280_10_OR_LATER(ah)) { 2577 if (AR_SREV_9280_20_OR_LATER(ah)) {
2579 used = snprintf(hw_name, len, 2578 used = snprintf(hw_name, len,
2580 "Atheros AR%s Rev:%x", 2579 "Atheros AR%s Rev:%x",
2581 ath9k_hw_mac_bb_name(ah->hw_version.macVersion), 2580 ath9k_hw_mac_bb_name(ah->hw_version.macVersion),
diff --git a/drivers/net/wireless/ath/ath9k/init.c b/drivers/net/wireless/ath/ath9k/init.c
index 573899e27b3..de3393867e3 100644
--- a/drivers/net/wireless/ath/ath9k/init.c
+++ b/drivers/net/wireless/ath/ath9k/init.c
@@ -211,7 +211,7 @@ static void setup_ht_cap(struct ath_softc *sc,
211 else 211 else
212 max_streams = 2; 212 max_streams = 2;
213 213
214 if (AR_SREV_9280_10_OR_LATER(ah)) { 214 if (AR_SREV_9280_20_OR_LATER(ah)) {
215 if (max_streams >= 2) 215 if (max_streams >= 2)
216 ht_info->cap |= IEEE80211_HT_CAP_TX_STBC; 216 ht_info->cap |= IEEE80211_HT_CAP_TX_STBC;
217 ht_info->cap |= (1 << IEEE80211_HT_CAP_RX_STBC_SHIFT); 217 ht_info->cap |= (1 << IEEE80211_HT_CAP_RX_STBC_SHIFT);
diff --git a/drivers/net/wireless/ath/ath9k/recv.c b/drivers/net/wireless/ath/ath9k/recv.c
index c5e7af4f51a..7b6f66bf373 100644
--- a/drivers/net/wireless/ath/ath9k/recv.c
+++ b/drivers/net/wireless/ath/ath9k/recv.c
@@ -454,7 +454,7 @@ u32 ath_calcrxfilter(struct ath_softc *sc)
454 else 454 else
455 rfilt |= ATH9K_RX_FILTER_BEACON; 455 rfilt |= ATH9K_RX_FILTER_BEACON;
456 456
457 if ((AR_SREV_9280_10_OR_LATER(sc->sc_ah) || 457 if ((AR_SREV_9280_20_OR_LATER(sc->sc_ah) ||
458 AR_SREV_9285_10_OR_LATER(sc->sc_ah)) && 458 AR_SREV_9285_10_OR_LATER(sc->sc_ah)) &&
459 (sc->sc_ah->opmode == NL80211_IFTYPE_AP) && 459 (sc->sc_ah->opmode == NL80211_IFTYPE_AP) &&
460 (sc->rx.rxfilter & FIF_PSPOLL)) 460 (sc->rx.rxfilter & FIF_PSPOLL))
diff --git a/drivers/net/wireless/ath/ath9k/reg.h b/drivers/net/wireless/ath/ath9k/reg.h
index d01c4adab8d..cabfa0356c9 100644
--- a/drivers/net/wireless/ath/ath9k/reg.h
+++ b/drivers/net/wireless/ath/ath9k/reg.h
@@ -819,15 +819,10 @@
819 ((_ah)->hw_version.macRev == AR_SREV_REVISION_9160_11)) 819 ((_ah)->hw_version.macRev == AR_SREV_REVISION_9160_11))
820#define AR_SREV_9280(_ah) \ 820#define AR_SREV_9280(_ah) \
821 (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9280)) 821 (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9280))
822#define AR_SREV_9280_10_OR_LATER(_ah) \ 822#define AR_SREV_9280_20_OR_LATER(_ah) \
823 (((_ah)->hw_version.macVersion >= AR_SREV_VERSION_9280)) 823 (((_ah)->hw_version.macVersion >= AR_SREV_VERSION_9280))
824#define AR_SREV_9280_20(_ah) \ 824#define AR_SREV_9280_20(_ah) \
825 (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9280) && \ 825 (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9280))
826 ((_ah)->hw_version.macRev >= AR_SREV_REVISION_9280_20))
827#define AR_SREV_9280_20_OR_LATER(_ah) \
828 (((_ah)->hw_version.macVersion > AR_SREV_VERSION_9280) || \
829 (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9280) && \
830 ((_ah)->hw_version.macRev >= AR_SREV_REVISION_9280_20)))
831 826
832#define AR_SREV_9285(_ah) \ 827#define AR_SREV_9285(_ah) \
833 (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9285)) 828 (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9285))