40#define HAL_EP_RND(x, mul) \
41 ((((x)%(mul)) >= ((mul)/2)) ? ((x) + ((mul) - 1)) / (mul) : (x)/(mul))
42#define BEACON_RSSI(ahp) \
43 HAL_EP_RND(ahp->ah_stats.ast_nodestats.ns_avgbrssi, \
44 HAL_RSSI_EP_MULTIPLIER)
66 (AH5212(ah)->ah_procPhyErr & HAL_ANI_ENA)
67#define ANI_ENA_RSSI(ah) \
68 (AH5212(ah)->ah_procPhyErr & HAL_RSSI_ANI_ENA)
70#define ah_mibStats ah_stats.ast_mibstats
78 "OfdmPhyErrBase 0x%x cckPhyErrBase 0x%x\n",
112 "OFDM Trigger %d is too high for hw counters, using max\n",
119 "CCK Trigger %d is too high for hw counters, using max\n",
187 params = aniState->
params;
219 if (((1 << cmd) &
AH5416(ah)->ah_ani_function) == 0) {
233 "%s: immunity level out of range (%u > %u)\n",
249 else if (level < aniState->noiseImmunityLevel)
255 static const TABLE m1ThreshLow = { 127, 50 };
256 static const TABLE m2ThreshLow = { 127, 40 };
257 static const TABLE m1Thresh = { 127, 0x4d };
258 static const TABLE m2Thresh = { 127, 0x40 };
259 static const TABLE m2CountThr = { 31, 16 };
260 static const TABLE m2CountThrLow = { 63, 48 };
261 u_int on = param ? 1 : 0;
263 HALDEBUG(ah,
HAL_DEBUG_ANI,
"%s: HAL_ANI_OFDM_WEAK_SIGNAL_DETECTION: %s\n", __func__, on ?
"enabled" :
"disabled");
301 static const TABLE weakSigThrCck = { 8, 6 };
302 u_int high = param ? 1 : 0;
304 HALDEBUG(ah,
HAL_DEBUG_ANI,
"%s: HAL_ANI_CCK_WEAK_SIGNAL_THR: %s\n", __func__, high ?
"high" :
"low");
320 "%s: firstep level out of range (%u > %u)\n",
328 else if (level < aniState->firstepLevel)
339 "%s: spur immunity level out of range (%u > %u)\n",
348 else if (level < aniState->spurImmunityLevel)
353#ifdef AH_PRIVATE_DIAG
371 const struct ieee80211_channel *chan =
AH_PRIVATE(ah)->ah_curchan;
381 params = aniState->
params;
450 if (IEEE80211_IS_CHAN_CCK(chan)) {
468 const struct ieee80211_channel *chan =
AH_PRIVATE(ah)->ah_curchan;
479 params = aniState->
params;
502 if (IEEE80211_IS_CHAN_CCK(chan)) {
523 "%s: Writing ofdmbase=%u cckbase=%u\n", __func__,
555 if (IEEE80211_IS_CHAN_2GHZ(chan))
565 __func__, chan->ic_freq, chan->ic_flags, restore, opmode,
569 __func__, chan->ic_freq, chan->ic_flags, restore, opmode,
595 if (IEEE80211_IS_CHAN_2GHZ(chan))
596 AH5416(ah)->ah_ani_function =
599 AH5416(ah)->ah_ani_function = 0;
656 uint32_t phyCnt1, phyCnt2;
659 "filtofdm 0x%x filtcck 0x%x\n",
696 uint32_t ofdmPhyErrCnt, cckPhyErrCnt;
733 params = aniState->
params;
799#define CLOCK_RATE 44000
884 uint32_t phyCnt1, phyCnt2;
885 int32_t ofdmPhyErrCnt, cckPhyErrCnt;
896 if (ofdmPhyErrCnt < 0) {
898 ofdmPhyErrCnt, phyCnt1);
906 if (cckPhyErrCnt < 0) {
908 cckPhyErrCnt, phyCnt2);
918 const struct ieee80211_channel *chan)
946 if (listenTime < 0) {
961 params = aniState->
params;
982 "%s: OFDM err %u listenTime %u\n", __func__,
989 "%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)
void ar5212EnableMibCounters(struct ath_hal *)
void ar5212DisableMibCounters(struct ath_hal *)
void ar5212UpdateMibCounters(struct ath_hal *ah, HAL_MIB_STATS *stats)
#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
HAL_BOOL ar5416GetMibCycleCounts(struct ath_hal *ah, HAL_SURVEY_SAMPLE *hsample)
void ar5416AniReset(struct ath_hal *ah, const struct ieee80211_channel *chan, HAL_OPMODE opmode, int restore)
void ar5416AniDetach(struct ath_hal *ah)
static void updateMIBStats(struct ath_hal *ah, struct ar5212AniState *aniState)
void ar5416AniPoll(struct ath_hal *ah, const struct ieee80211_channel *chan)
void ar5416ProcessMibIntr(struct ath_hal *ah, const HAL_NODE_STATS *stats)
static void ar5416AniOfdmErrTrigger(struct ath_hal *ah)
static void ar5416AniCckErrTrigger(struct ath_hal *ah)
HAL_BOOL ar5416AniControl(struct ath_hal *ah, HAL_ANI_CMD cmd, int param)
static int32_t ar5416AniGetListenTime(struct ath_hal *ah)
static void enableAniMIBCounters(struct ath_hal *ah, const struct ar5212AniParams *params)
void ar5416RxMonitor(struct ath_hal *ah, const HAL_NODE_STATS *stats, const struct ieee80211_channel *chan)
static void ar5416AniLowerImmunity(struct ath_hal *ah)
static void ar5416AniRestart(struct ath_hal *ah, struct ar5212AniState *aniState)
void ar5416AniAttach(struct ath_hal *ah, const struct ar5212AniParams *params24, const struct ar5212AniParams *params5, HAL_BOOL enable)
static void disableAniMIBCounters(struct ath_hal *ah)
static void setPhyErrBase(struct ath_hal *ah, struct ar5212AniParams *params)
#define AR_PHY_SFCORR_EXT_M1_THRESH
#define AR_PHY_SFCORR_EXT_M2_THRESH_LOW
#define AR_PHY_SFCORR_EXT
#define AR_PHY_SFCORR_EXT_M2_THRESH
#define AR_PHY_SFCORR_EXT_M1_THRESH_LOW
#define AR_PHY_ERR_MASK_1
#define AR_SLP_MIB_PENDING
#define AR_PHY_ERR_MASK_2
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
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 *)