From owner-svn-src-head@FreeBSD.ORG Fri Dec 19 18:33:53 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6B2E31065678; Fri, 19 Dec 2008 18:33:53 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5B6538FC17; Fri, 19 Dec 2008 18:33:53 +0000 (UTC) (envelope-from sam@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mBJIXrpE079576; Fri, 19 Dec 2008 18:33:53 GMT (envelope-from sam@svn.freebsd.org) Received: (from sam@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mBJIXr80079575; Fri, 19 Dec 2008 18:33:53 GMT (envelope-from sam@svn.freebsd.org) Message-Id: <200812191833.mBJIXr80079575@svn.freebsd.org> From: Sam Leffler Date: Fri, 19 Dec 2008 18:33:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r186332 - head/sys/dev/ath/ath_hal/ar5212 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Dec 2008 18:33:53 -0000 Author: sam Date: Fri Dec 19 18:33:53 2008 New Revision: 186332 URL: http://svn.freebsd.org/changeset/base/186332 Log: Correct 5212 ani support so that max noise immunity, spur immunity, and step levels are used. Noticed by: Jiri Fojtasek Reviewed by: rpaulo Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_ani.c (contents, props changed) Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_ani.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5212/ar5212_ani.c Fri Dec 19 18:27:51 2008 (r186331) +++ head/sys/dev/ath/ath_hal/ar5212/ar5212_ani.c Fri Dec 19 18:33:53 2008 (r186332) @@ -14,7 +14,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: ar5212_ani.c,v 1.7 2008/11/21 00:16:21 sam Exp $ + * $FreeBSD$ */ #include "opt_ah.h" @@ -267,7 +267,7 @@ ar5212AniControl(struct ath_hal *ah, HAL case HAL_ANI_NOISE_IMMUNITY_LEVEL: { u_int level = param; - if (level >= params->maxNoiseImmunityLevel) { + if (level > params->maxNoiseImmunityLevel) { HALDEBUG(ah, HAL_DEBUG_ANY, "%s: level out of range (%u > %u)\n", __func__, level, params->maxNoiseImmunityLevel); @@ -342,7 +342,7 @@ ar5212AniControl(struct ath_hal *ah, HAL case HAL_ANI_FIRSTEP_LEVEL: { u_int level = param; - if (level >= params->maxFirstepLevel) { + if (level > params->maxFirstepLevel) { HALDEBUG(ah, HAL_DEBUG_ANY, "%s: level out of range (%u > %u)\n", __func__, level, params->maxFirstepLevel); @@ -360,7 +360,7 @@ ar5212AniControl(struct ath_hal *ah, HAL case HAL_ANI_SPUR_IMMUNITY_LEVEL: { u_int level = param; - if (level >= params->maxSpurImmunityLevel) { + if (level > params->maxSpurImmunityLevel) { HALDEBUG(ah, HAL_DEBUG_ANY, "%s: level out of range (%u > %u)\n", __func__, level, params->maxSpurImmunityLevel); @@ -433,7 +433,7 @@ ar5212AniOfdmErrTrigger(struct ath_hal * aniState = ahp->ah_curani; params = aniState->params; /* First, raise noise immunity level, up to max */ - if (aniState->noiseImmunityLevel+1 < params->maxNoiseImmunityLevel) { + if (aniState->noiseImmunityLevel+1 <= params->maxNoiseImmunityLevel) { HALDEBUG(ah, HAL_DEBUG_ANI, "%s: raise NI to %u\n", __func__, aniState->noiseImmunityLevel + 1); ar5212AniControl(ah, HAL_ANI_NOISE_IMMUNITY_LEVEL, @@ -441,7 +441,7 @@ ar5212AniOfdmErrTrigger(struct ath_hal * return; } /* then, raise spur immunity level, up to max */ - if (aniState->spurImmunityLevel+1 < params->maxSpurImmunityLevel) { + if (aniState->spurImmunityLevel+1 <= params->maxSpurImmunityLevel) { HALDEBUG(ah, HAL_DEBUG_ANI, "%s: raise SI to %u\n", __func__, aniState->spurImmunityLevel + 1); ar5212AniControl(ah, HAL_ANI_SPUR_IMMUNITY_LEVEL, @@ -470,7 +470,7 @@ ar5212AniOfdmErrTrigger(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+1 <= params->maxFirstepLevel) { HALDEBUG(ah, HAL_DEBUG_ANI, "%s: rssi %d raise ST %u\n", __func__, rssi, aniState->firstepLevel+1); @@ -490,7 +490,7 @@ ar5212AniOfdmErrTrigger(struct ath_hal * HAL_ANI_OFDM_WEAK_SIGNAL_DETECTION, AH_TRUE); } - if (aniState->firstepLevel+1 < params->maxFirstepLevel) { + if (aniState->firstepLevel+1 <= params->maxFirstepLevel) { HALDEBUG(ah, HAL_DEBUG_ANI, "%s: rssi %d raise ST %u\n", __func__, rssi, aniState->firstepLevel+1); @@ -544,7 +544,7 @@ ar5212AniCckErrTrigger(struct ath_hal *a /* first, raise noise immunity level, up to max */ aniState = ahp->ah_curani; params = aniState->params; - if (aniState->noiseImmunityLevel+1 < params->maxNoiseImmunityLevel) { + if (aniState->noiseImmunityLevel+1 <= params->maxNoiseImmunityLevel) { HALDEBUG(ah, HAL_DEBUG_ANI, "%s: raise NI to %u\n", __func__, aniState->noiseImmunityLevel + 1); ar5212AniControl(ah, HAL_ANI_NOISE_IMMUNITY_LEVEL, @@ -559,7 +559,7 @@ ar5212AniCckErrTrigger(struct ath_hal *a * Beacon signal in mid and high range, * raise firstep level. */ - if (aniState->firstepLevel+1 < params->maxFirstepLevel) { + if (aniState->firstepLevel+1 <= params->maxFirstepLevel) { HALDEBUG(ah, HAL_DEBUG_ANI, "%s: rssi %d raise ST %u\n", __func__, rssi, aniState->firstepLevel+1);