summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoradrian <adrian@FreeBSD.org>2012-08-27 20:10:38 +0000
committeradrian <adrian@FreeBSD.org>2012-08-27 20:10:38 +0000
commitbbc1ae0d1bd1587bbea358847dc9be31db4689c6 (patch)
tree48989572d76962c5222bf319ff6197d303e53810
parentad14f7cf222728c6baee6d45084cee06e88ad96d (diff)
downloadFreeBSD-src-bbc1ae0d1bd1587bbea358847dc9be31db4689c6.zip
FreeBSD-src-bbc1ae0d1bd1587bbea358847dc9be31db4689c6.tar.gz
Ensure that all firstep values are available in ANI.
The comparison assumes maxFirstepLevel is a count, rather than a maximum value. The array is 3 entries in size however 'maxFirstepLevel' is 2. This bug also exists in the AR5212 HAL.
-rw-r--r--sys/dev/ath/ath_hal/ar5416/ar5416_ani.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c b/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c
index 1b7ad00..bea7eca 100644
--- a/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c
+++ b/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c
@@ -422,7 +422,7 @@ ar5416AniOfdmErrTrigger(struct ath_hal *ah)
* If weak sig detect is already off, as last resort,
* raise firstep level
*/
- if (aniState->firstepLevel+1 < params->maxFirstepLevel) {
+ if (aniState->firstepLevel < params->maxFirstepLevel) {
if (ar5416AniControl(ah, HAL_ANI_FIRSTEP_LEVEL,
aniState->firstepLevel + 1))
return;
@@ -436,7 +436,7 @@ ar5416AniOfdmErrTrigger(struct ath_hal *ah)
ar5416AniControl(ah,
HAL_ANI_OFDM_WEAK_SIGNAL_DETECTION,
AH_TRUE);
- if (aniState->firstepLevel+1 < params->maxFirstepLevel)
+ if (aniState->firstepLevel < params->maxFirstepLevel)
if (ar5416AniControl(ah, HAL_ANI_FIRSTEP_LEVEL,
aniState->firstepLevel + 1))
return;
@@ -490,7 +490,7 @@ ar5416AniCckErrTrigger(struct ath_hal *ah)
* Beacon signal in mid and high range,
* raise firstep level.
*/
- if (aniState->firstepLevel+1 < params->maxFirstepLevel)
+ if (aniState->firstepLevel < params->maxFirstepLevel)
ar5416AniControl(ah, HAL_ANI_FIRSTEP_LEVEL,
aniState->firstepLevel + 1);
} else {
@@ -954,6 +954,8 @@ ar5416AniPoll(struct ath_hal *ah, const struct ieee80211_channel *chan)
if (listenTime < 0) {
ahp->ah_stats.ast_ani_lneg++;
/* restart ANI period if listenTime is invalid */
+ HALDEBUG(ah, HAL_DEBUG_ANI, "%s: invalid listenTime\n",
+ __func__);
ar5416AniRestart(ah, aniState);
}
/* XXX beware of overflow? */
@@ -973,6 +975,8 @@ ar5416AniPoll(struct ath_hal *ah, const struct ieee80211_channel *chan)
aniState->cckPhyErrCount <= aniState->listenTime *
params->cckTrigLow/1000)
ar5416AniLowerImmunity(ah);
+ HALDEBUG(ah, HAL_DEBUG_ANI, "%s: lower immunity\n",
+ __func__);
ar5416AniRestart(ah, aniState);
} else if (aniState->listenTime > params->period) {
updateMIBStats(ah, aniState);
OpenPOWER on IntegriCloud