ath9k_hw: simplify revision checks for AR9280
PATCH 1/3 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 <[email protected]>
--- drivers/net/wireless/ath/ath9k/ar5008_phy.c | 14 +++++++------- drivers/net/wireless/ath/ath9k/ar9002_calib.c | 6 +++--- drivers/net/wireless/ath/ath9k/ar9002_hw.c | 2 +- drivers/net/wireless/ath/ath9k/eeprom_4k.c | 4 ++-- drivers/net/wireless/ath/ath9k/eeprom_9287.c | 6 +++--- drivers/net/wireless/ath/ath9k/eeprom_def.c | 18 +++++++++--------- drivers/net/wireless/ath/ath9k/hw.c | 15 +++++++-------- drivers/net/wireless/ath/ath9k/init.c | 2 +- drivers/net/wireless/ath/ath9k/recv.c | 2 +- drivers/net/wireless/ath/ath9k/reg.h | 9 ++------- 10 files changed, 36 insertions(+), 42 deletions(-)
drivers/net/wireless/ath/ath9k/ar5008_phy.c +7 -7
@@ -118,7 +118,7 @@ static void ar5008_hw_force_bias(struct ath_hw *ah, u16 synth_freq)if (!AR_SREV_5416 (ah) || synth_freq >=3000 )return ; -BUG_ON (AR_SREV_9280_10_OR_LATER (ah)); +BUG_ON (AR_SREV_9280_20_OR_LATER (ah));if (synth_freq <2412 ) new_bias =0 ;
@@ -454,7 +454,7 @@ static int ar5008_hw_rf_alloc_ext_banks(struct ath_hw *ah)struct ath_common *common =ath9k_hw_common (ah); -BUG_ON (AR_SREV_9280_10_OR_LATER (ah)); +BUG_ON (AR_SREV_9280_20_OR_LATER (ah));ATH_ALLOC_BANK (ah->analogBank0Data, ah->iniBank0.ia_rows);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) bank =NULL ; \ }while (0 ); -BUG_ON (AR_SREV_9280_10_OR_LATER (ah)); +BUG_ON (AR_SREV_9280_20_OR_LATER (ah));ATH_FREE_BANK (ah->analogBank0Data);ATH_FREE_BANK (ah->analogBank1Data);
@@ -525,7 +525,7 @@ static bool ar5008_hw_set_rf_regs(struct ath_hw *ah,* for single chip devices, that is AR9280 or anything * after that. */ -if (AR_SREV_9280_10_OR_LATER (ah)) +if (AR_SREV_9280_20_OR_LATER (ah))return true;/* Setup rf parameters */
@@ -663,7 +663,7 @@ static void ar5008_hw_override_ini(struct ath_hw *ah,*/ REG_SET_BIT (ah,AR_DIAG_SW , (AR_DIAG_RX_DIS |AR_DIAG_RX_ABORT )); -if (AR_SREV_9280_10_OR_LATER (ah)) { +if (AR_SREV_9280_20_OR_LATER (ah)) { val =REG_READ (ah,AR_PCU_MISC_MODE2 );if (!AR_SREV_9271 (ah))
@@ -676,7 +676,7 @@ static void ar5008_hw_override_ini(struct ath_hw *ah, }if (!AR_SREV_5416_20_OR_LATER (ah) || -AR_SREV_9280_10_OR_LATER (ah)) +AR_SREV_9280_20_OR_LATER (ah))return ;/* * Disable BB clock gating
@@ -900,7 +900,7 @@ static void ar5008_hw_set_rfmode(struct ath_hw *ah, struct ath9k_channel *chan) rfMode |= (IS_CHAN_B (chan) ||IS_CHAN_G (chan)) ?AR_PHY_MODE_DYNAMIC :AR_PHY_MODE_OFDM ; -if (!AR_SREV_9280_10_OR_LATER (ah)) +if (!AR_SREV_9280_20_OR_LATER (ah)) rfMode |= (IS_CHAN_5GHZ (chan)) ?AR_PHY_MODE_RF5GHZ :AR_PHY_MODE_RF2GHZ ;
drivers/net/wireless/ath/ath9k/ar9002_calib.c +3 -3
@@ -841,7 +841,7 @@ static bool ar9002_hw_init_cal(struct ath_hw *ah, struct ath9k_channel *chan)if (!ar9285_hw_clc (ah, chan))return false; }else { -if (AR_SREV_9280_10_OR_LATER (ah)) { +if (AR_SREV_9280_20_OR_LATER (ah)) {if (!AR_SREV_9287_10_OR_LATER (ah))REG_CLR_BIT (ah,AR_PHY_ADC_CTL ,AR_PHY_ADC_CTL_OFF_PWDADC );
@@ -864,7 +864,7 @@ static bool ar9002_hw_init_cal(struct ath_hw *ah, struct ath9k_channel *chan)return false; } -if (AR_SREV_9280_10_OR_LATER (ah)) { +if (AR_SREV_9280_20_OR_LATER (ah)) {if (!AR_SREV_9287_10_OR_LATER (ah))REG_SET_BIT (ah,AR_PHY_ADC_CTL ,AR_PHY_ADC_CTL_OFF_PWDADC );
@@ -976,7 +976,7 @@ static void ar9002_hw_init_cal_settings(struct ath_hw *ah) }if (AR_SREV_9160_10_OR_LATER (ah)) { -if (AR_SREV_9280_10_OR_LATER (ah)) { +if (AR_SREV_9280_20_OR_LATER (ah)) { ah->iq_caldata.calData = &iq_cal_single_sample; ah->adcgain_caldata.calData = &adc_gain_cal_single_sample;
drivers/net/wireless/ath/ath9k/ar9002_hw.c +1 -1
@@ -569,7 +569,7 @@ void ar9002_hw_attach_ops(struct ath_hw *ah) ops->config_pci_powersave = ar9002_hw_configpcipowersave;ar5008_hw_attach_phy_ops (ah); -if (AR_SREV_9280_10_OR_LATER (ah)) +if (AR_SREV_9280_20_OR_LATER (ah))ar9002_hw_attach_phy_ops (ah);ar9002_hw_attach_calib_ops (ah);
drivers/net/wireless/ath/ath9k/eeprom_4k.c +2 -2
@@ -333,7 +333,7 @@ static void ath9k_hw_get_4k_gain_boundaries_pdadcs(struct ath_hw *ah, }if (i ==0 ) { -if (AR_SREV_9280_10_OR_LATER (ah)) +if (AR_SREV_9280_20_OR_LATER (ah)) ss = (int16_t )(0 - (minPwrT4[i] /2 ));else ss =0 ;
@@ -761,7 +761,7 @@ static void ath9k_hw_4k_set_txpower(struct ath_hw *ah, regulatory->max_power_level = ratesArray[i]; -if (AR_SREV_9280_10_OR_LATER (ah)) { +if (AR_SREV_9280_20_OR_LATER (ah)) {for (i =0 ; i < Ar5416RateSize; i++) ratesArray[i] -=AR5416_PWR_TABLE_OFFSET_DB *2 ; }
drivers/net/wireless/ath/ath9k/eeprom_9287.c +3 -3
@@ -324,7 +324,7 @@ static void ath9k_hw_get_ar9287_gain_boundaries_pdadcs(struct ath_hw *ah, minDelta =0 ;if (i ==0 ) { -if (AR_SREV_9280_10_OR_LATER (ah)) +if (AR_SREV_9280_20_OR_LATER (ah)) ss = (int16_t )(0 - (minPwrT4[i] /2 ));else ss =0 ;
@@ -883,7 +883,7 @@ static void ath9k_hw_ar9287_set_txpower(struct ath_hw *ah, ratesArray[i] =AR9287_MAX_RATE_POWER ; } -if (AR_SREV_9280_10_OR_LATER (ah)) { +if (AR_SREV_9280_20_OR_LATER (ah)) {for (i =0 ; i < Ar5416RateSize; i++) ratesArray[i] -=AR9287_PWR_TABLE_OFFSET_DB *2 ; }
@@ -977,7 +977,7 @@ static void ath9k_hw_ar9287_set_txpower(struct ath_hw *ah,else i = rate6mb; -if (AR_SREV_9280_10_OR_LATER (ah)) +if (AR_SREV_9280_20_OR_LATER (ah)) regulatory->max_power_level = ratesArray[i] +AR9287_PWR_TABLE_OFFSET_DB *2 ;else
drivers/net/wireless/ath/ath9k/eeprom_def.c +9 -9
@@ -223,7 +223,7 @@ static int ath9k_hw_def_check_eeprom(struct ath_hw *ah) }/* Enable fixup for AR_AN_TOP2 if necessary */ -if (AR_SREV_9280_10_OR_LATER (ah) && +if (AR_SREV_9280_20_OR_LATER (ah) && (eep->baseEepHeader.version &0xff ) >0x0a && eep->baseEepHeader.pwdclkind ==0 ) ah->need_an_top2_fixup =1 ;
@@ -317,7 +317,7 @@ static void ath9k_hw_def_set_gain(struct ath_hw *ah,if (AR5416_VER_MASK >=AR5416_EEP_MINOR_VER_3 ) { txRxAttenLocal = pModal->txRxAttenCh[i]; -if (AR_SREV_9280_10_OR_LATER (ah)) { +if (AR_SREV_9280_20_OR_LATER (ah)) {REG_RMW_FIELD (ah,AR_PHY_GAIN_2GHZ + regChainOffset,AR_PHY_GAIN_2GHZ_XATTEN1_MARGIN , pModal->bswMargin[i]);
@@ -344,7 +344,7 @@ static void ath9k_hw_def_set_gain(struct ath_hw *ah, } } -if (AR_SREV_9280_10_OR_LATER (ah)) { +if (AR_SREV_9280_20_OR_LATER (ah)) {REG_RMW_FIELD (ah,AR_PHY_RXGAIN + regChainOffset,AR9280_PHY_RXGAIN_TXRX_ATTEN , txRxAttenLocal);
@@ -408,7 +408,7 @@ static void ath9k_hw_def_set_board_values(struct ath_hw *ah, regChainOffset, i); } -if (AR_SREV_9280_10_OR_LATER (ah)) { +if (AR_SREV_9280_20_OR_LATER (ah)) {if (IS_CHAN_2GHZ (chan)) { ath9k_hw_analog_shift_rmw(ah, AR_AN_RF2G1_CH0, AR_AN_RF2G1_CH0_OB,
@@ -461,7 +461,7 @@ static void ath9k_hw_def_set_board_values(struct ath_hw *ah,REG_RMW_FIELD (ah,AR_PHY_DESIRED_SZ ,AR_PHY_DESIRED_SZ_ADC , pModal->adcDesiredSize); -if (!AR_SREV_9280_10_OR_LATER (ah)) +if (!AR_SREV_9280_20_OR_LATER (ah))REG_RMW_FIELD (ah,AR_PHY_DESIRED_SZ ,AR_PHY_DESIRED_SZ_PGA , pModal->pgaDesiredSize);
@@ -478,7 +478,7 @@ static void ath9k_hw_def_set_board_values(struct ath_hw *ah,REG_RMW_FIELD (ah,AR_PHY_RF_CTL3 ,AR_PHY_TX_END_TO_A2_RX_ON , pModal->txEndToRxOn); -if (AR_SREV_9280_10_OR_LATER (ah)) { +if (AR_SREV_9280_20_OR_LATER (ah)) {REG_RMW_FIELD (ah,AR_PHY_CCA ,AR9280_PHY_CCA_THRESH62 , pModal->thresh62); 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, }if (i ==0 ) { -if (AR_SREV_9280_10_OR_LATER (ah)) +if (AR_SREV_9280_20_OR_LATER (ah)) ss = (int16_t )(0 - (minPwrT4[i] /2 ));else ss =0 ;
@@ -1291,7 +1291,7 @@ static void ath9k_hw_def_set_txpower(struct ath_hw *ah, ratesArray[i] =AR5416_MAX_RATE_POWER ; } -if (AR_SREV_9280_10_OR_LATER (ah)) { +if (AR_SREV_9280_20_OR_LATER (ah)) {for (i =0 ; i < Ar5416RateSize; i++) {int8_t pwr_table_offset;
@@ -1395,7 +1395,7 @@ static void ath9k_hw_def_set_txpower(struct ath_hw *ah,else if (IS_CHAN_HT20 (chan)) i = rateHt20_0; -if (AR_SREV_9280_10_OR_LATER (ah)) +if (AR_SREV_9280_20_OR_LATER (ah)) regulatory->max_power_level = ratesArray[i] +AR5416_PWR_TABLE_OFFSET_DB *2 ;else
drivers/net/wireless/ath/ath9k/hw.c +7 -8
@@ -565,7 +565,7 @@ static int __ath9k_hw_init(struct ath_hw *ah)ath9k_hw_init_cal_settings (ah); ah->ani_function =ATH9K_ANI_ALL ; -if (AR_SREV_9280_10_OR_LATER (ah) && !AR_SREV_9300_20_OR_LATER (ah)) +if (AR_SREV_9280_20_OR_LATER (ah) && !AR_SREV_9300_20_OR_LATER (ah)) ah->ani_function &= ~ATH9K_ANI_NOISE_IMMUNITY_LEVEL ;if (!AR_SREV_9300_20_OR_LATER (ah)) ah->ani_function &= ~ATH9K_ANI_MRC_CCK ;
@@ -1312,7 +1312,7 @@ int ath9k_hw_reset(struct ath_hw *ah, struct ath9k_channel *chan,if (tsf)ath9k_hw_settsf64 (ah, tsf); -if (AR_SREV_9280_10_OR_LATER (ah)) +if (AR_SREV_9280_20_OR_LATER (ah))REG_SET_BIT (ah,AR_GPIO_INPUT_EN_VAL ,AR_GPIO_JTAG_DISABLE );if (!AR_SREV_9300_20_OR_LATER (ah))
@@ -1857,8 +1857,7 @@ int ath9k_hw_fill_cap_info(struct ath_hw *ah)/* Use rx_chainmask from EEPROM. */ pCap->rx_chainmask = ah->eep_ops->get_eeprom (ah,EEP_RX_MASK ); -if (!(AR_SREV_9280 (ah) && (ah->hw_version.macRev ==0 ))) - ah->misc_mode |=AR_PCU_MIC_NEW_LOC_ENA ; + ah->misc_mode |=AR_PCU_MIC_NEW_LOC_ENA ; pCap->low_2ghz_chan =2312 ; pCap->high_2ghz_chan =2732 ;
@@ -1896,7 +1895,7 @@ int ath9k_hw_fill_cap_info(struct ath_hw *ah) pCap->num_gpio_pins =AR7010_NUM_GPIO ; else if (AR_SREV_9285_10_OR_LATER(ah)) pCap->num_gpio_pins = AR9285_NUM_GPIO; - else if (AR_SREV_9280_10_OR_LATER(ah)) + else if (AR_SREV_9280_20_OR_LATER(ah)) pCap->num_gpio_pins = AR928X_NUM_GPIO; else pCap->num_gpio_pins = AR_NUM_GPIO;
@@ -1953,7 +1952,7 @@ int ath9k_hw_fill_cap_info(struct ath_hw *ah) pCap->num_antcfg_2ghz = ah->eep_ops->get_num_ant_config (ah,ATH9K_HAL_FREQ_BAND_2GHZ ); -if (AR_SREV_9280_10_OR_LATER (ah) && +if (AR_SREV_9280_20_OR_LATER (ah) &&ath9k_hw_btcoex_supported (ah)) { btcoex_hw->btactive_gpio =ATH_BTACTIVE_GPIO ; btcoex_hw->wlanactive_gpio =ATH_WLANACTIVE_GPIO ;
@@ -2078,7 +2077,7 @@ u32 ath9k_hw_gpio_get(struct ath_hw *ah, u32 gpio)return MS_REG_READ (AR9287 , gpio) !=0 ; else if (AR_SREV_9285_10_OR_LATER(ah)) return MS_REG_READ(AR9285, gpio) != 0; - else if (AR_SREV_9280_10_OR_LATER(ah)) + else if (AR_SREV_9280_20_OR_LATER(ah)) return MS_REG_READ(AR928X, gpio) != 0; else 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)int used;/* chipsets >= AR9280 are single-chip */ -if (AR_SREV_9280_10_OR_LATER (ah)) { +if (AR_SREV_9280_20_OR_LATER (ah)) { used = snprintf(hw_name, len, "Atheros AR%s Rev:%x", ath9k_hw_mac_bb_name(ah->hw_version.macVersion),
drivers/net/wireless/ath/ath9k/init.c +1 -1
@@ -211,7 +211,7 @@ static void setup_ht_cap(struct ath_softc *sc,else max_streams =2 ; -if (AR_SREV_9280_10_OR_LATER (ah)) { +if (AR_SREV_9280_20_OR_LATER (ah)) {if (max_streams >=2 ) ht_info->cap |=IEEE80211_HT_CAP_TX_STBC ; ht_info->cap |= (1 <<IEEE80211_HT_CAP_RX_STBC_SHIFT );
drivers/net/wireless/ath/ath9k/recv.c +1 -1
@@ -454,7 +454,7 @@ u32 ath_calcrxfilter(struct ath_softc *sc)else rfilt |=ATH9K_RX_FILTER_BEACON ; -if ((AR_SREV_9280_10_OR_LATER (sc->sc_ah) || +if ((AR_SREV_9280_20_OR_LATER (sc->sc_ah) ||AR_SREV_9285_10_OR_LATER (sc->sc_ah)) && (sc->sc_ah->opmode ==NL80211_IFTYPE_AP ) && (sc->rx.rxfilter &FIF_PSPOLL ))
drivers/net/wireless/ath/ath9k/reg.h +2 -7
@@ -819,15 +819,10 @@ ((_ah)->hw_version.macRev == AR_SREV_REVISION_9160_11))#define AR_SREV_9280 (_ah) \ (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9280)) -#define AR_SREV_9280_10_OR_LATER (_ah) \ +#define AR_SREV_9280_20_OR_LATER (_ah) \ (((_ah)->hw_version.macVersion >= AR_SREV_VERSION_9280))#define AR_SREV_9280_20 (_ah) \ - (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9280) && \ - ((_ah)->hw_version.macRev >= AR_SREV_REVISION_9280_20)) -#define AR_SREV_9280_20_OR_LATER (_ah) \ - (((_ah)->hw_version.macVersion > AR_SREV_VERSION_9280) || \ - (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9280) && \ - ((_ah)->hw_version.macRev >= AR_SREV_REVISION_9280_20))) + (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9280))#define AR_SREV_9285 (_ah) \ (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9285))
Signature · 1 line
1.7.2.2
PATCH 2/3 ath9k_hw: simplify revision checks for AR9285
Since AR9285 v1.0 and v1.1 were never sold (and the initvals removed), its revision checks can be simplified similar to AR9280
Signed-off-by Felix Fietkau <[email protected]>
--- drivers/net/wireless/ath/ath9k/ar5008_phy.c | 2 +- drivers/net/wireless/ath/ath9k/ar9002_calib.c | 11 +---------- drivers/net/wireless/ath/ath9k/eeprom_4k.c | 6 ------ drivers/net/wireless/ath/ath9k/hw.c | 8 ++++---- drivers/net/wireless/ath/ath9k/recv.c | 2 +- drivers/net/wireless/ath/ath9k/reg.h | 16 +--------------- 6 files changed, 8 insertions(+), 37 deletions(-)
drivers/net/wireless/ath/ath9k/ar5008_phy.c +1 -1
@@ -701,7 +701,7 @@ static void ar5008_hw_set_channel_regs(struct ath_hw *ah,u32 phymode;u32 enableDacFifo =0 ; -if (AR_SREV_9285_10_OR_LATER (ah)) +if (AR_SREV_9285_12_OR_LATER (ah)) enableDacFifo = (REG_READ (ah,AR_PHY_TURBO ) &AR_PHY_FC_ENABLE_DAC_FIFO );
drivers/net/wireless/ath/ath9k/ar9002_calib.c +1 -10
@@ -567,11 +567,6 @@ static inline void ar9285_hw_pa_cal(struct ath_hw *ah, bool is_reset) AR5416_EEP_TXGAIN_HIGH_POWER)return ; -if (AR_SREV_9285_11 (ah)) { -REG_WRITE (ah,AR9285_AN_TOP4 , (AR9285_AN_TOP4_DEFAULT |0x14 )); -udelay (10 ); - } -for (i =0 ; i <ARRAY_SIZE (regList); i++) regList[i][1 ] =REG_READ (ah, regList[i][0 ]);
@@ -651,10 +646,6 @@ static inline void ar9285_hw_pa_cal(struct ath_hw *ah, bool is_reset)REG_WRITE (ah, regList[i][0 ], regList[i][1 ]);REG_RMW_FIELD (ah,AR9285_AN_RF2G6 ,AR9285_AN_RF2G6_CCOMP , ccomp_org); - -if (AR_SREV_9285_11 (ah)) -REG_WRITE (ah,AR9285_AN_TOP4 ,AR9285_AN_TOP4_DEFAULT ); - }static void ar9002_hw_pa_cal (struct ath_hw *ah,bool is_reset)
@@ -664,7 +655,7 @@ static void ar9002_hw_pa_cal(struct ath_hw *ah, bool is_reset)ar9271_hw_pa_cal (ah, is_reset); else ah->pacal_info.skipcount--; - }else if (AR_SREV_9285_11_OR_LATER (ah)) { + }else if (AR_SREV_9285_12_OR_LATER (ah)) {if (is_reset || !ah->pacal_info.skipcount)ar9285_hw_pa_cal (ah, is_reset);else
drivers/net/wireless/ath/ath9k/eeprom_4k.c +0 -6
@@ -909,9 +909,6 @@ static void ath9k_hw_4k_set_gain(struct ath_hw *ah, AR9280_PHY_RXGAIN_TXRX_ATTEN, txRxAttenLocal);REG_RMW_FIELD (ah,AR_PHY_RXGAIN +0x1000 ,AR9280_PHY_RXGAIN_TXRX_MARGIN , pModal->rxTxMarginCh[0 ]); - -if (AR_SREV_9285_11 (ah)) -REG_WRITE (ah,AR9285_AN_TOP4 , (AR9285_AN_TOP4_DEFAULT |0x14 )); }/*
@@ -1109,9 +1106,6 @@ static void ath9k_hw_4k_set_board_values(struct ath_hw *ah, } -if (AR_SREV_9285_11 (ah)) -REG_WRITE (ah,AR9285_AN_TOP4 ,AR9285_AN_TOP4_DEFAULT ); -REG_RMW_FIELD (ah,AR_PHY_SETTLING ,AR_PHY_SETTLING_SWITCH , pModal->switchSettling); REG_RMW_FIELD(ah, AR_PHY_DESIRED_SZ, AR_PHY_DESIRED_SZ_ADC,
drivers/net/wireless/ath/ath9k/hw.c +4 -4
@@ -1190,7 +1190,7 @@ bool ath9k_hw_check_alive(struct ath_hw *ah)int count =50 ;u32 reg; -if (AR_SREV_9285_10_OR_LATER (ah)) +if (AR_SREV_9285_12_OR_LATER (ah))return true; do {
@@ -1787,7 +1787,7 @@ int ath9k_hw_fill_cap_info(struct ath_hw *ah) regulatory->current_rd = eeval; eeval = ah->eep_ops->get_eeprom (ah,EEP_REG_1 ); -if (AR_SREV_9285_10_OR_LATER (ah)) +if (AR_SREV_9285_12_OR_LATER (ah)) eeval |=AR9285_RDEXT_DEFAULT ; regulatory->current_rd_ext = eeval;
@@ -1893,7 +1893,7 @@ int ath9k_hw_fill_cap_info(struct ath_hw *ah) pCap->num_gpio_pins =AR9271_NUM_GPIO ; else if (AR_DEVID_7010(ah)) pCap->num_gpio_pins = AR7010_NUM_GPIO; - else if (AR_SREV_9285_10_OR_LATER(ah)) + else if (AR_SREV_9285_12_OR_LATER(ah)) pCap->num_gpio_pins = AR9285_NUM_GPIO; else if (AR_SREV_9280_20_OR_LATER(ah)) pCap->num_gpio_pins = AR928X_NUM_GPIO;
@@ -2075,7 +2075,7 @@ u32 ath9k_hw_gpio_get(struct ath_hw *ah, u32 gpio)return MS_REG_READ (AR9271 , gpio) !=0 ; else if (AR_SREV_9287_10_OR_LATER(ah)) return MS_REG_READ(AR9287, gpio) != 0; - else if (AR_SREV_9285_10_OR_LATER(ah)) + else if (AR_SREV_9285_12_OR_LATER(ah)) return MS_REG_READ(AR9285, gpio) != 0; else if (AR_SREV_9280_20_OR_LATER(ah)) return MS_REG_READ(AR928X, gpio) != 0;
drivers/net/wireless/ath/ath9k/recv.c +1 -1
@@ -455,7 +455,7 @@ u32 ath_calcrxfilter(struct ath_softc *sc) rfilt |=ATH9K_RX_FILTER_BEACON ;if ((AR_SREV_9280_20_OR_LATER (sc->sc_ah) || -AR_SREV_9285_10_OR_LATER (sc->sc_ah)) && +AR_SREV_9285_12_OR_LATER (sc->sc_ah)) && (sc->sc_ah->opmode ==NL80211_IFTYPE_AP ) && (sc->rx.rxfilter &FIF_PSPOLL )) rfilt |=ATH9K_RX_FILTER_PSPOLL ;
drivers/net/wireless/ath/ath9k/reg.h +1 -15
@@ -826,22 +826,8 @@#define AR_SREV_9285 (_ah) \ (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9285)) -#define AR_SREV_9285_10_OR_LATER (_ah) \ - (((_ah)->hw_version.macVersion >= AR_SREV_VERSION_9285)) -#define AR_SREV_9285_11 (_ah) \ - (AR_SREV_9285(ah) && \ - ((_ah)->hw_version.macRev == AR_SREV_REVISION_9285_11)) -#define AR_SREV_9285_11_OR_LATER (_ah) \ - (((_ah)->hw_version.macVersion > AR_SREV_VERSION_9285) || \ - (AR_SREV_9285(ah) && ((_ah)->hw_version.macRev >= \ - AR_SREV_REVISION_9285_11))) -#define AR_SREV_9285_12 (_ah) \ - (AR_SREV_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) || \ - (AR_SREV_9285(ah) && ((_ah)->hw_version.macRev >= \ - AR_SREV_REVISION_9285_12))) + (((_ah)->hw_version.macVersion >= AR_SREV_VERSION_9285))#define AR_SREV_9287 (_ah) \ (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9287))
Signature · 1 line
1.7.2.2
PATCH 3/3 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 <[email protected]>
--- drivers/net/wireless/ath/ath9k/ar5008_phy.c | 6 +++--- drivers/net/wireless/ath/ath9k/ar9002_calib.c | 4 ++-- drivers/net/wireless/ath/ath9k/eeprom.h | 2 +- drivers/net/wireless/ath/ath9k/hw.c | 4 ++-- drivers/net/wireless/ath/ath9k/reg.h | 9 +-------- 5 files changed, 9 insertions(+), 16 deletions(-)
drivers/net/wireless/ath/ath9k/ar5008_phy.c +3 -3
@@ -669,7 +669,7 @@ static void ar5008_hw_override_ini(struct ath_hw *ah,if (!AR_SREV_9271 (ah)) val &= ~AR_PCU_MISC_MODE2_HWWAR1 ; -if (AR_SREV_9287_10_OR_LATER (ah)) +if (AR_SREV_9287_11_OR_LATER (ah)) val = val & (~AR_PCU_MISC_MODE2_HWWAR2 );REG_WRITE (ah,AR_PCU_MISC_MODE2 , val);
@@ -820,11 +820,11 @@ static int ar5008_hw_process_ini(struct ath_hw *ah,REGWRITE_BUFFER_FLUSH (ah);DISABLE_REGWRITE_BUFFER (ah); -if (AR_SREV_9280 (ah) ||AR_SREV_9287_10_OR_LATER (ah)) +if (AR_SREV_9280 (ah) ||AR_SREV_9287_11_OR_LATER (ah))REG_WRITE_ARRAY (&ah->iniModesRxGain, modesIndex, regWrites);if (AR_SREV_9280 (ah) ||AR_SREV_9285_12_OR_LATER (ah) || -AR_SREV_9287_10_OR_LATER (ah)) +AR_SREV_9287_11_OR_LATER (ah))REG_WRITE_ARRAY (&ah->iniModesTxGain, modesIndex, regWrites);if (AR_SREV_9271_10 (ah))
drivers/net/wireless/ath/ath9k/ar9002_calib.c +2 -2
@@ -833,7 +833,7 @@ static bool ar9002_hw_init_cal(struct ath_hw *ah, struct ath9k_channel *chan)return false; }else {if (AR_SREV_9280_20_OR_LATER (ah)) { -if (!AR_SREV_9287_10_OR_LATER (ah)) +if (!AR_SREV_9287_11_OR_LATER (ah))REG_CLR_BIT (ah,AR_PHY_ADC_CTL ,AR_PHY_ADC_CTL_OFF_PWDADC ); 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) }if (AR_SREV_9280_20_OR_LATER (ah)) { -if (!AR_SREV_9287_10_OR_LATER (ah)) +if (!AR_SREV_9287_11_OR_LATER (ah))REG_SET_BIT (ah,AR_PHY_ADC_CTL ,AR_PHY_ADC_CTL_OFF_PWDADC ); REG_CLR_BIT(ah, AR_PHY_AGC_CONTROL,
drivers/net/wireless/ath/ath9k/eeprom.h +1 -1
@@ -101,7 +101,7 @@#define AR5416_VER_MASK (eep->baseEepHeader.version & AR5416_EEP_VER_MINOR_MASK)#define OLC_FOR_AR9280_20_LATER (AR_SREV_9280_20_OR_LATER(ah) && \ ah->eep_ops->get_eeprom(ah, EEP_OL_PWRCTRL)) -#define OLC_FOR_AR9287_10_LATER (AR_SREV_9287_10_OR_LATER(ah) && \ +#define OLC_FOR_AR9287_10_LATER (AR_SREV_9287_11_OR_LATER(ah) && \ ah->eep_ops->get_eeprom(ah, EEP_OL_PWRCTRL))#define AR_EEPROM_RFSILENT_GPIO_SEL 0x001c
drivers/net/wireless/ath/ath9k/hw.c +2 -2
@@ -1989,7 +1989,7 @@ int ath9k_hw_fill_cap_info(struct ath_hw *ah)if (AR_SREV_9300_20_OR_LATER (ah)) pCap->hw_caps |=ATH9K_HW_CAP_RAC_SUPPORTED ; -if (AR_SREV_9287_10_OR_LATER (ah) ||AR_SREV_9271 (ah)) +if (AR_SREV_9287_11_OR_LATER (ah) ||AR_SREV_9271 (ah)) pCap->hw_caps |=ATH9K_HW_CAP_SGI_20 ;if (AR_SREV_9285 (ah))
@@ -2073,7 +2073,7 @@ u32 ath9k_hw_gpio_get(struct ath_hw *ah, u32 gpio)return MS_REG_READ (AR9300 , gpio) !=0 ; else if (AR_SREV_9271(ah)) return MS_REG_READ(AR9271, gpio) != 0; - else if (AR_SREV_9287_10_OR_LATER(ah)) + else if (AR_SREV_9287_11_OR_LATER(ah)) return MS_REG_READ(AR9287, gpio) != 0; else if (AR_SREV_9285_12_OR_LATER(ah)) return MS_REG_READ(AR9285, gpio) != 0;
drivers/net/wireless/ath/ath9k/reg.h +1 -8
@@ -831,18 +831,11 @@#define AR_SREV_9287 (_ah) \ (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9287)) -#define AR_SREV_9287_10_OR_LATER (_ah) \ +#define AR_SREV_9287_11_OR_LATER (_ah) \ (((_ah)->hw_version.macVersion >= AR_SREV_VERSION_9287)) -#define AR_SREV_9287_10 (_ah) \ - (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9287) && \ - ((_ah)->hw_version.macRev == AR_SREV_REVISION_9287_10))#define AR_SREV_9287_11 (_ah) \ (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9287) && \ ((_ah)->hw_version.macRev == AR_SREV_REVISION_9287_11)) -#define AR_SREV_9287_11_OR_LATER (_ah) \ - (((_ah)->hw_version.macVersion > AR_SREV_VERSION_9287) || \ - (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9287) && \ - ((_ah)->hw_version.macRev >= AR_SREV_REVISION_9287_11)))#define AR_SREV_9287_12 (_ah) \ (((_ah)->hw_version.macVersion == AR_SREV_VERSION_9287) && \ ((_ah)->hw_version.macRev == AR_SREV_REVISION_9287_12))
Signature · 1 line
1.7.2.2