36#define HAL_EP_RND(x, mul) \
37 ((((x)%(mul)) >= ((mul)/2)) ? ((x) + ((mul) - 1)) / (mul) : (x)/(mul))
38#define BEACON_RSSI(ahp) \
39 HAL_EP_RND(ahp->ah_stats.ast_nodestats.ns_avgbrssi, \
40 HAL_RSSI_EP_MULTIPLIER)
62 (AH5212(ah)->ah_procPhyErr & HAL_ANI_ENA)
63#define ANI_ENA_RSSI(ah) \
64 (AH5212(ah)->ah_procPhyErr & HAL_RSSI_ANI_ENA)
66#define ah_mibStats ah_stats.ast_mibstats
74 "OfdmPhyErrBase 0x%x cckPhyErrBase 0x%x\n",
109 return AH5212(ah)->ah_curani;
131 "OFDM Trigger %d is too high for hw counters, using max\n",
138 "CCK Trigger %d is too high for hw counters, using max\n",
158 AH_PRIVATE(ah)->ah_caps.halHwPhyCounterSupport;
234 params = aniState->
params;
244 "%s: level out of range (%u > %u)\n",
260 else if (level < aniState->noiseImmunityLevel)
266 static const TABLE m1ThreshLow = { 127, 50 };
267 static const TABLE m2ThreshLow = { 127, 40 };
268 static const TABLE m1Thresh = { 127, 0x4d };
269 static const TABLE m2Thresh = { 127, 0x40 };
270 static const TABLE m2CountThr = { 31, 16 };
271 static const TABLE m2CountThrLow = { 63, 48 };
272 u_int on = param ? 1 : 0;
300 static const TABLE weakSigThrCck = { 8, 6 };
301 u_int high = param ? 1 : 0;
317 "%s: level out of range (%u > %u)\n",
325 else if (level < aniState->firstepLevel)
335 "%s: level out of range (%u > %u)\n",
343 else if (level < aniState->spurImmunityLevel)
376#ifdef AH_PRIVATE_DIAG
394 const struct ieee80211_channel *chan =
AH_PRIVATE(ah)->ah_curchan;
404 params = aniState->
params;
431 "%s: rssi %d OWSD off\n", __func__, rssi);
445 "%s: rssi %d raise ST %u\n", __func__, rssi,
458 "%s: rssi %d OWSD on\n", __func__, rssi);
465 "%s: rssi %d raise ST %u\n", __func__, rssi,
477 if (IEEE80211_IS_CHAN_CCK(chan)) {
480 "%s: rssi %d OWSD off\n",
488 "%s: rssi %d zero ST (was %u)\n",
504 const struct ieee80211_channel *chan =
AH_PRIVATE(ah)->ah_curchan;
515 params = aniState->
params;
533 "%s: rssi %d raise ST %u\n", __func__, rssi,
544 if (IEEE80211_IS_CHAN_B(chan) ||
545 IEEE80211_IS_CHAN_G(chan)) {
548 "%s: rssi %d zero ST (was %u)\n",
599 if (IEEE80211_IS_CHAN_2GHZ(chan))
609 __func__, chan->ic_freq, chan->ic_flags, restore, opmode,
613 __func__, chan->ic_freq, chan->ic_flags, restore, opmode,
688 uint32_t phyCnt1, phyCnt2;
691 "filtofdm 0x%x filtcck 0x%x\n",
726 uint32_t ofdmPhyErrCnt, cckPhyErrCnt;
763 params = aniState->
params;
791 params = aniState->
params;
807 "%s: rssi %d OWSD on\n", __func__, rssi);
815 "%s: rssi %d lower ST %u\n", __func__, rssi,
827 "%s: rssi %d lower ST %u\n", __func__, rssi,
856#define CLOCK_RATE 44000
936 uint32_t phyCnt1, phyCnt2;
937 int32_t ofdmPhyErrCnt, cckPhyErrCnt;
950 if (ofdmPhyErrCnt < 0) {
952 ofdmPhyErrCnt, phyCnt1);
960 if (cckPhyErrCnt < 0) {
962 cckPhyErrCnt, phyCnt2);
972 const struct ieee80211_channel *chan)
999 if (listenTime < 0) {
1012 params = aniState->
params;
1033 "%s: OFDM err %u listenTime %u\n", __func__,
1040 "%s: CCK err %u listenTime %u\n", __func__,
void ath_hal_survey_add_sample(struct ath_hal *ah, HAL_SURVEY_SAMPLE *hs)
@ HAL_ANI_OFDM_WEAK_SIGNAL_DETECTION
@ HAL_ANI_NOISE_IMMUNITY_LEVEL
@ HAL_ANI_SPUR_IMMUNITY_LEVEL
@ HAL_ANI_CCK_WEAK_SIGNAL_THR
#define OS_REG_SET_BIT(_a, _r, _f)
static OS_INLINE HAL_CHANNEL_INTERNAL * ath_hal_checkchannel(struct ath_hal *ah, const struct ieee80211_channel *c)
#define OS_REG_CLR_BIT(_a, _r, _f)
#define OS_REG_RMW_FIELD(_a, _r, _f, _v)
#define HALDEBUG(_ah, __m,...)
#define CHANNEL_ANI_SETUP
void ath_hal_printf(struct ath_hal *, const char *,...)
#define OS_MEMZERO(_a, _n)
#define OS_REG_WRITE(_ah, _reg, _val)
#define OS_MARK(_ah, _id, _v)
#define OS_MEMCPY(_d, _s, _n)
#define OS_REG_READ(_ah, _reg)
HAL_BOOL ar5212GetMibCycleCounts(struct ath_hal *, HAL_SURVEY_SAMPLE *)
void ar5212EnableMibCounters(struct ath_hal *)
void ar5212DisableMibCounters(struct ath_hal *)
void ar5212SetRxFilter(struct ath_hal *ah, uint32_t bits)
void ar5212UpdateMibCounters(struct ath_hal *ah, HAL_MIB_STATS *stats)
uint32_t ar5212GetRxFilter(struct ath_hal *ah)
static void ar5212AniCckErrTrigger(struct ath_hal *ah)
void ar5212AniReset(struct ath_hal *ah, const struct ieee80211_channel *chan, HAL_OPMODE opmode, int restore)
HAL_BOOL ar5212AniSetParams(struct ath_hal *ah, const struct ar5212AniParams *params24, const struct ar5212AniParams *params5)
static void updateMIBStats(struct ath_hal *ah, struct ar5212AniState *aniState)
void ar5212AniPhyErrReport(struct ath_hal *ah, const struct ath_rx_status *rs)
void ar5212AniPoll(struct ath_hal *ah, const struct ieee80211_channel *chan)
static int32_t ar5212AniGetListenTime(struct ath_hal *ah)
void ar5212AniAttach(struct ath_hal *ah, const struct ar5212AniParams *params24, const struct ar5212AniParams *params5, HAL_BOOL enable)
HAL_ANI_STATS * ar5212AniGetCurrentStats(struct ath_hal *ah)
static void enableAniMIBCounters(struct ath_hal *ah, const struct ar5212AniParams *params)
struct ar5212AniState * ar5212AniGetCurrentState(struct ath_hal *ah)
void ar5212RxMonitor(struct ath_hal *ah, const HAL_NODE_STATS *stats, const struct ieee80211_channel *chan)
void ar5212ProcessMibIntr(struct ath_hal *ah, const HAL_NODE_STATS *stats)
static void ar5212AniLowerImmunity(struct ath_hal *ah)
HAL_BOOL ar5212AniControl(struct ath_hal *ah, HAL_ANI_CMD cmd, int param)
static void disableAniMIBCounters(struct ath_hal *ah)
static void ar5212AniOfdmErrTrigger(struct ath_hal *ah)
void ar5212AniDetach(struct ath_hal *ah)
static void ar5212AniRestart(struct ath_hal *ah, struct ar5212AniState *aniState)
static void setPhyErrBase(struct ath_hal *ah, struct ar5212AniParams *params)
#define AR_PHY_SFCORR_M2COUNT_THR
#define AR_PHY_TIMING5_CYCPWR_THR1
#define AR_PHY_CCK_DETECT
#define AR_PHY_SFCORR_LOW_M2_THRESH_LOW
#define AR_PHY_FIND_SIG_FIRPWR
#define AR_PHY_SFCORR_LOW_M1_THRESH_LOW
#define AR_PHY_AGC_CTL1_COARSE_LOW
#define AR_PHY_SFCORR_LOW_M2COUNT_THR_LOW
#define AR_PHY_SFCORR_LOW
#define AR_PHY_AGC_CTL1_COARSE_HIGH
#define AR_PHY_DESIRED_SZ
#define AR_PHY_SFCORR_M1_THRESH
#define AR_PHY_SFCORR_M2_THRESH
#define AR_PHY_SFCORR_LOW_USE_SELF_CORR_LOW
#define AR_PHY_CCK_DETECT_WEAK_SIG_THR_CCK
#define AR_PHY_FIND_SIG_FIRSTEP
#define AR_PHY_DESIRED_SZ_TOT_DES
#define AR_PHY_ERR_CCK_TIMING
#define AR_MIBCNT_INTRMASK
#define AR_PHY_ERR_OFDM_TIMING
uint32_t ast_ani_spurdown
uint32_t ast_ani_ofdmerrs
HAL_NODE_STATS ast_nodestats
uint32_t ast_ani_stepdown
int maxNoiseImmunityLevel
uint8_t ofdmWeakSigDetectOff
uint8_t noiseImmunityLevel
uint8_t spurImmunityLevel
const struct ar5212AniParams * params
uint8_t cckWeakSigThreshold
HAL_BOOL ah_hasHwPhyCounters
struct ar5212AniParams ah_aniParams24
struct ar5212AniState * ah_curani
struct ar5212AniParams ah_aniParams5
struct ar5212AniState ah_ani[AH_MAXCHAN]
void __ahdecl(* ah_setRxFilter)(struct ath_hal *, uint32_t)
uint32_t __ahdecl(* ah_getRxFilter)(struct ath_hal *)