diff options
-rw-r--r-- | sys/dev/ath/ath_hal/ar5416/ar5416reg.h | 4 | ||||
-rw-r--r-- | sys/dev/ath/ath_hal/ar9002/ar9285_attach.c | 20 |
2 files changed, 20 insertions, 4 deletions
diff --git a/sys/dev/ath/ath_hal/ar5416/ar5416reg.h b/sys/dev/ath/ath_hal/ar5416/ar5416reg.h index 4a23b2f..18badce 100644 --- a/sys/dev/ath/ath_hal/ar5416/ar5416reg.h +++ b/sys/dev/ath/ath_hal/ar5416/ar5416reg.h @@ -634,4 +634,8 @@ #define AR_SREV_KITE_12_OR_LATER(_ah) \ (AR_SREV_KITE_12(_ah) || \ AH_PRIVATE((_ah))->ah_macRev >= AR_XSREV_REVISION_KITE_12) +#define AR_SREV_9285E_20(_ah) \ + (AR_SREV_KITE_12_OR_LATER(_ah) && \ + ((OS_REG_READ(_ah, AR_AN_SYNTH9) & 0x7) == 0x1)) + #endif /* _DEV_ATH_AR5416REG_H */ diff --git a/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c b/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c index 79e562a..39dd4cd 100644 --- a/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c +++ b/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c @@ -221,15 +221,27 @@ ar9285Attach(uint16_t devid, HAL_SOFTC sc, HAL_INI_INIT(&ahp9285->ah_ini_rxgain, ar9280Modes_original_rxgain_v2, 6); + + if (AR_SREV_9285E_20(ah)) + ath_hal_printf(ah, "[ath] AR9285E_20 detected; using XE TX gain tables\n"); + /* setup txgain table */ switch (ath_hal_eepromGet(ah, AR_EEP_TXGAIN_TYPE, AH_NULL)) { case AR5416_EEP_TXGAIN_HIGH_POWER: - HAL_INI_INIT(&ahp9285->ah_ini_txgain, - ar9285Modes_high_power_tx_gain_v2, 6); + if (AR_SREV_9285E_20(ah)) + HAL_INI_INIT(&ahp9285->ah_ini_txgain, + ar9285Modes_XE2_0_high_power, 6); + else + HAL_INI_INIT(&ahp9285->ah_ini_txgain, + ar9285Modes_high_power_tx_gain_v2, 6); break; case AR5416_EEP_TXGAIN_ORIG: - HAL_INI_INIT(&ahp9285->ah_ini_txgain, - ar9285Modes_original_tx_gain_v2, 6); + if (AR_SREV_9285E_20(ah)) + HAL_INI_INIT(&ahp9285->ah_ini_txgain, + ar9285Modes_XE2_0_normal_power, 6); + else + HAL_INI_INIT(&ahp9285->ah_ini_txgain, + ar9285Modes_original_tx_gain_v2, 6); break; default: HALASSERT(AH_FALSE); |