Add an AR5416 aware version of the "current RSSI" function.

Pre-11n devices and AR5416 use AR_PHY(263) for current RX RSSI.
AR9130 and later have a fourth calibration register (for doing
ADC calibration) and thus the register has moved to AR_PHY(271).

This isn't currently used by any of the active code; I'm committing
this for completeness and in case any third party code attempts to
use it for legacy reasons.
This commit is contained in:
Adrian Chadd 2011-10-04 00:32:10 +00:00
parent 1ed7864a7d
commit a57433b96b
3 changed files with 15 additions and 0 deletions

View File

@ -190,6 +190,7 @@ extern void ar5416SetLedState(struct ath_hal *ah, HAL_LED_STATE state);
extern uint64_t ar5416GetTsf64(struct ath_hal *ah);
extern void ar5416SetTsf64(struct ath_hal *ah, uint64_t tsf64);
extern void ar5416ResetTsf(struct ath_hal *ah);
extern uint32_t ar5416GetCurRssi(struct ath_hal *ah);
extern HAL_BOOL ar5416SetAntennaSwitch(struct ath_hal *, HAL_ANT_SETTING);
extern HAL_BOOL ar5416SetDecompMask(struct ath_hal *, uint16_t, int);
extern void ar5416SetCoverageClass(struct ath_hal *, uint8_t, int);

View File

@ -143,6 +143,14 @@ ar5416ResetTsf(struct ath_hal *ah)
OS_REG_WRITE(ah, AR_RESET_TSF, AR_RESET_TSF_ONCE);
}
uint32_t
ar5416GetCurRssi(struct ath_hal *ah)
{
if (AR_SREV_OWL(ah))
return (OS_REG_READ(ah, AR_PHY_CURRENT_RSSI) & 0xff);
return (OS_REG_READ(ah, AR9130_PHY_CURRENT_RSSI) & 0xff);
}
HAL_BOOL
ar5416SetAntennaSwitch(struct ath_hal *ah, HAL_ANT_SETTING settings)
{

View File

@ -156,8 +156,14 @@
#define AR_PHY_CAL_MEAS_0(_i) (0x9c10 + ((_i) << 12))
#define AR_PHY_CAL_MEAS_1(_i) (0x9c14 + ((_i) << 12))
#define AR_PHY_CAL_MEAS_2(_i) (0x9c18 + ((_i) << 12))
/* This is AR9130 and later */
#define AR_PHY_CAL_MEAS_3(_i) (0x9c1c + ((_i) << 12))
/*
* AR5416 still uses AR_PHY(263) for current RSSI;
* AR9130 and later uses AR_PHY(271).
*/
#define AR9130_PHY_CURRENT_RSSI 0x9c3c /* rssi of current frame rx'd */
#define AR_PHY_CCA 0x9864
#define AR_PHY_MINCCA_PWR 0x0FF80000