Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 27 Aug 2012 20:10:38 +0000 (UTC)
From:      Adrian Chadd <adrian@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r239753 - head/sys/dev/ath/ath_hal/ar5416
Message-ID:  <201208272010.q7RKAcRs050551@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: adrian
Date: Mon Aug 27 20:10:38 2012
New Revision: 239753
URL: http://svn.freebsd.org/changeset/base/239753

Log:
  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.

Modified:
  head/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c

Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c
==============================================================================
--- head/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c	Mon Aug 27 20:03:08 2012	(r239752)
+++ head/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c	Mon Aug 27 20:10:38 2012	(r239753)
@@ -422,7 +422,7 @@ ar5416AniOfdmErrTrigger(struct ath_hal *
 			 * 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 *
 				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 *a
 			 * 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 
 	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 
 		    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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201208272010.q7RKAcRs050551>