diff options
author | Felix Fietkau <nbd@openwrt.org> | 2010-09-22 06:34:54 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-09-27 15:57:42 -0400 |
commit | a42acef0dd3548ffda03d245d41b95250354017e (patch) | |
tree | e2fcceb50c211c3b3fdabb8dde2e7837c176274d /drivers/net | |
parent | e17f83eafd37129f9e09425136e59bc4333bdb9c (diff) |
ath9k_hw: simplify revision checks for AR9287
Since AR9287 v1.0 was never sold (and the initvals removed), its revision
checks can be simplified similar to AR9280
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/ar5008_phy.c | 6 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/ar9002_calib.c | 4 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/eeprom.h | 2 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/hw.c | 4 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/reg.h | 9 |
5 files changed, 9 insertions, 16 deletions
diff --git a/drivers/net/wireless/ath/ath9k/ar5008_phy.c b/drivers/net/wireless/ath/ath9k/ar5008_phy.c index 79dfe9dded52..525671f52b45 100644 --- a/drivers/net/wireless/ath/ath9k/ar5008_phy.c +++ b/drivers/net/wireless/ath/ath9k/ar5008_phy.c | |||
@@ -669,7 +669,7 @@ static void ar5008_hw_override_ini(struct ath_hw *ah, | |||
669 | if (!AR_SREV_9271(ah)) | 669 | if (!AR_SREV_9271(ah)) |
670 | val &= ~AR_PCU_MISC_MODE2_HWWAR1; | 670 | val &= ~AR_PCU_MISC_MODE2_HWWAR1; |
671 | 671 | ||
672 | if (AR_SREV_9287_10_OR_LATER(ah)) | 672 | if (AR_SREV_9287_11_OR_LATER(ah)) |
673 | val = val & (~AR_PCU_MISC_MODE2_HWWAR2); | 673 | val = val & (~AR_PCU_MISC_MODE2_HWWAR2); |
674 | 674 | ||
675 | REG_WRITE(ah, AR_PCU_MISC_MODE2, val); | 675 | REG_WRITE(ah, AR_PCU_MISC_MODE2, val); |
@@ -820,11 +820,11 @@ static int ar5008_hw_process_ini(struct ath_hw *ah, | |||
820 | REGWRITE_BUFFER_FLUSH(ah); | 820 | REGWRITE_BUFFER_FLUSH(ah); |
821 | DISABLE_REGWRITE_BUFFER(ah); | 821 | DISABLE_REGWRITE_BUFFER(ah); |
822 | 822 | ||
823 | if (AR_SREV_9280(ah) || AR_SREV_9287_10_OR_LATER(ah)) | 823 | if (AR_SREV_9280(ah) || AR_SREV_9287_11_OR_LATER(ah)) |
824 | REG_WRITE_ARRAY(&ah->iniModesRxGain, modesIndex, regWrites); | 824 | REG_WRITE_ARRAY(&ah->iniModesRxGain, modesIndex, regWrites); |
825 | 825 | ||
826 | if (AR_SREV_9280(ah) || AR_SREV_9285_12_OR_LATER(ah) || | 826 | if (AR_SREV_9280(ah) || AR_SREV_9285_12_OR_LATER(ah) || |
827 | AR_SREV_9287_10_OR_LATER(ah)) | 827 | AR_SREV_9287_11_OR_LATER(ah)) |
828 | REG_WRITE_ARRAY(&ah->iniModesTxGain, modesIndex, regWrites); | 828 | REG_WRITE_ARRAY(&ah->iniModesTxGain, modesIndex, regWrites); |
829 | 829 | ||
830 | if (AR_SREV_9271_10(ah)) | 830 | if (AR_SREV_9271_10(ah)) |
diff --git a/drivers/net/wireless/ath/ath9k/ar9002_calib.c b/drivers/net/wireless/ath/ath9k/ar9002_calib.c index 5d0815145b78..d7d1d55362e6 100644 --- a/drivers/net/wireless/ath/ath9k/ar9002_calib.c +++ b/drivers/net/wireless/ath/ath9k/ar9002_calib.c | |||
@@ -833,7 +833,7 @@ static bool ar9002_hw_init_cal(struct ath_hw *ah, struct ath9k_channel *chan) | |||
833 | return false; | 833 | return false; |
834 | } else { | 834 | } else { |
835 | if (AR_SREV_9280_20_OR_LATER(ah)) { | 835 | if (AR_SREV_9280_20_OR_LATER(ah)) { |
836 | if (!AR_SREV_9287_10_OR_LATER(ah)) | 836 | if (!AR_SREV_9287_11_OR_LATER(ah)) |
837 | REG_CLR_BIT(ah, AR_PHY_ADC_CTL, | 837 | REG_CLR_BIT(ah, AR_PHY_ADC_CTL, |
838 | AR_PHY_ADC_CTL_OFF_PWDADC); | 838 | AR_PHY_ADC_CTL_OFF_PWDADC); |
839 | REG_SET_BIT(ah, AR_PHY_AGC_CONTROL, | 839 | REG_SET_BIT(ah, AR_PHY_AGC_CONTROL, |
@@ -856,7 +856,7 @@ static bool ar9002_hw_init_cal(struct ath_hw *ah, struct ath9k_channel *chan) | |||
856 | } | 856 | } |
857 | 857 | ||
858 | if (AR_SREV_9280_20_OR_LATER(ah)) { | 858 | if (AR_SREV_9280_20_OR_LATER(ah)) { |
859 | if (!AR_SREV_9287_10_OR_LATER(ah)) | 859 | if (!AR_SREV_9287_11_OR_LATER(ah)) |
860 | REG_SET_BIT(ah, AR_PHY_ADC_CTL, | 860 | REG_SET_BIT(ah, AR_PHY_ADC_CTL, |
861 | AR_PHY_ADC_CTL_OFF_PWDADC); | 861 | AR_PHY_ADC_CTL_OFF_PWDADC); |
862 | REG_CLR_BIT(ah, AR_PHY_AGC_CONTROL, | 862 | REG_CLR_BIT(ah, AR_PHY_AGC_CONTROL, |
diff --git a/drivers/net/wireless/ath/ath9k/eeprom.h b/drivers/net/wireless/ath/ath9k/eeprom.h index 3030564a0f21..dacb45e1b906 100644 --- a/drivers/net/wireless/ath/ath9k/eeprom.h +++ b/drivers/net/wireless/ath/ath9k/eeprom.h | |||
@@ -101,7 +101,7 @@ | |||
101 | #define AR5416_VER_MASK (eep->baseEepHeader.version & AR5416_EEP_VER_MINOR_MASK) | 101 | #define AR5416_VER_MASK (eep->baseEepHeader.version & AR5416_EEP_VER_MINOR_MASK) |
102 | #define OLC_FOR_AR9280_20_LATER (AR_SREV_9280_20_OR_LATER(ah) && \ | 102 | #define OLC_FOR_AR9280_20_LATER (AR_SREV_9280_20_OR_LATER(ah) && \ |
103 | ah->eep_ops->get_eeprom(ah, EEP_OL_PWRCTRL)) | 103 | ah->eep_ops->get_eeprom(ah, EEP_OL_PWRCTRL)) |
104 | #define OLC_FOR_AR9287_10_LATER (AR_SREV_9287_10_OR_LATER(ah) && \ | 104 | #define OLC_FOR_AR9287_10_LATER (AR_SREV_9287_11_OR_LATER(ah) && \ |
105 | ah->eep_ops->get_eeprom(ah, EEP_OL_PWRCTRL)) | 105 | ah->eep_ops->get_eeprom(ah, EEP_OL_PWRCTRL)) |
106 | 106 | ||
107 | #define AR_EEPROM_RFSILENT_GPIO_SEL 0x001c | 107 | #define AR_EEPROM_RFSILENT_GPIO_SEL 0x001c |
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c index 1f41b4513c52..25ed65ac992c 100644 --- a/drivers/net/wireless/ath/ath9k/hw.c +++ b/drivers/net/wireless/ath/ath9k/hw.c | |||
@@ -1989,7 +1989,7 @@ int ath9k_hw_fill_cap_info(struct ath_hw *ah) | |||
1989 | if (AR_SREV_9300_20_OR_LATER(ah)) | 1989 | if (AR_SREV_9300_20_OR_LATER(ah)) |
1990 | pCap->hw_caps |= ATH9K_HW_CAP_RAC_SUPPORTED; | 1990 | pCap->hw_caps |= ATH9K_HW_CAP_RAC_SUPPORTED; |
1991 | 1991 | ||
1992 | if (AR_SREV_9287_10_OR_LATER(ah) || AR_SREV_9271(ah)) | 1992 | if (AR_SREV_9287_11_OR_LATER(ah) || AR_SREV_9271(ah)) |
1993 | pCap->hw_caps |= ATH9K_HW_CAP_SGI_20; | 1993 | pCap->hw_caps |= ATH9K_HW_CAP_SGI_20; |
1994 | 1994 | ||
1995 | if (AR_SREV_9285(ah)) | 1995 | if (AR_SREV_9285(ah)) |
@@ -2073,7 +2073,7 @@ u32 ath9k_hw_gpio_get(struct ath_hw *ah, u32 gpio) | |||
2073 | return MS_REG_READ(AR9300, gpio) != 0; | 2073 | return MS_REG_READ(AR9300, gpio) != 0; |
2074 | else if (AR_SREV_9271(ah)) | 2074 | else if (AR_SREV_9271(ah)) |
2075 | return MS_REG_READ(AR9271, gpio) != 0; | 2075 | return MS_REG_READ(AR9271, gpio) != 0; |
2076 | else if (AR_SREV_9287_10_OR_LATER(ah)) | 2076 | else if (AR_SREV_9287_11_OR_LATER(ah)) |
2077 | return MS_REG_READ(AR9287, gpio) != 0; | 2077 | return MS_REG_READ(AR9287, gpio) != 0; |
2078 | else if (AR_SREV_9285_12_OR_LATER(ah)) | 2078 | else if (AR_SREV_9285_12_OR_LATER(ah)) |
2079 | return MS_REG_READ(AR9285, gpio) != 0; | 2079 | return MS_REG_READ(AR9285, gpio) != 0; |
diff --git a/drivers/net/wireless/ath/ath9k/reg.h b/drivers/net/wireless/ath/ath9k/reg.h index 7ff814d4a792..6d01e501b9b4 100644 --- a/drivers/net/wireless/ath/ath9k/reg.h +++ b/drivers/net/wireless/ath/ath9k/reg.h | |||
@@ -831,18 +831,11 @@ | |||
831 | 831 | ||
832 | #define AR_SREV_9287(_ah) \ | 832 | #define AR_SREV_9287(_ah) \ |
833 | (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9287)) | 833 | (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9287)) |
834 | #define AR_SREV_9287_10_OR_LATER(_ah) \ | 834 | #define AR_SREV_9287_11_OR_LATER(_ah) \ |
835 | (((_ah)->hw_version.macVersion >= AR_SREV_VERSION_9287)) | 835 | (((_ah)->hw_version.macVersion >= AR_SREV_VERSION_9287)) |
836 | #define AR_SREV_9287_10(_ah) \ | ||
837 | (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9287) && \ | ||
838 | ((_ah)->hw_version.macRev == AR_SREV_REVISION_9287_10)) | ||
839 | #define AR_SREV_9287_11(_ah) \ | 836 | #define AR_SREV_9287_11(_ah) \ |
840 | (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9287) && \ | 837 | (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9287) && \ |
841 | ((_ah)->hw_version.macRev == AR_SREV_REVISION_9287_11)) | 838 | ((_ah)->hw_version.macRev == AR_SREV_REVISION_9287_11)) |
842 | #define AR_SREV_9287_11_OR_LATER(_ah) \ | ||
843 | (((_ah)->hw_version.macVersion > AR_SREV_VERSION_9287) || \ | ||
844 | (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9287) && \ | ||
845 | ((_ah)->hw_version.macRev >= AR_SREV_REVISION_9287_11))) | ||
846 | #define AR_SREV_9287_12(_ah) \ | 839 | #define AR_SREV_9287_12(_ah) \ |
847 | (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9287) && \ | 840 | (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9287) && \ |
848 | ((_ah)->hw_version.macRev == AR_SREV_REVISION_9287_12)) | 841 | ((_ah)->hw_version.macRev == AR_SREV_REVISION_9287_12)) |