From owner-svn-src-user@FreeBSD.ORG Thu Nov 3 04:18:34 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1F417106566C; Thu, 3 Nov 2011 04:18:34 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E9D0B8FC15; Thu, 3 Nov 2011 04:18:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id pA34IXbH052408; Thu, 3 Nov 2011 04:18:33 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA34IXUJ052406; Thu, 3 Nov 2011 04:18:33 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201111030418.pA34IXUJ052406@svn.freebsd.org> From: Adrian Chadd Date: Thu, 3 Nov 2011 04:18:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r227049 - user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar5416 X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Nov 2011 04:18:34 -0000 Author: adrian Date: Thu Nov 3 04:18:33 2011 New Revision: 227049 URL: http://svn.freebsd.org/changeset/base/227049 Log: Add the other half of the ANI changes - when lowering immunity - * if in hostap mode, lower firstep first; * just skip ani control modifications that fail and fall through to the next one, so the ANI code doesn't get "stuck" on a level change that can't occur. Obtained from: Atheros Modified: user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c Modified: user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c ============================================================================== --- user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c Thu Nov 3 03:07:41 2011 (r227048) +++ user/adrian/if_ath_tx/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c Thu Nov 3 04:18:33 2011 (r227049) @@ -726,6 +726,19 @@ ar5416AniLowerImmunity(struct ath_hal *a aniState = ahp->ah_curani; params = aniState->params; + + /* + * In the case of AP mode operation, we cannot bucketize beacons + * according to RSSI. Instead, lower Firstep level, down to min, and + * simply return. + */ + if (AH_PRIVATE(ah)->ah_opmode == HAL_M_HOSTAP) { + if (aniState->firstepLevel > 0) { + if (ar5416AniControl(ah, HAL_ANI_FIRSTEP_LEVEL, + aniState->firstepLevel - 1)) + return; + } + } if (ANI_ENA_RSSI(ah)) { int32_t rssi = BEACON_RSSI(ahp); if (rssi > params->rssiThrHigh) { @@ -740,41 +753,41 @@ ar5416AniLowerImmunity(struct ath_hal *a * detection or lower firstep level. */ if (aniState->ofdmWeakSigDetectOff) { - ar5416AniControl(ah, + if (ar5416AniControl(ah, HAL_ANI_OFDM_WEAK_SIGNAL_DETECTION, - AH_TRUE); - return; + AH_TRUE)) + return; } if (aniState->firstepLevel > 0) { - ar5416AniControl(ah, HAL_ANI_FIRSTEP_LEVEL, - aniState->firstepLevel - 1); - return; + if (ar5416AniControl(ah, HAL_ANI_FIRSTEP_LEVEL, + aniState->firstepLevel - 1)) + return; } } else { /* * Beacon rssi is low, reduce firstep level. */ if (aniState->firstepLevel > 0) { - ar5416AniControl(ah, HAL_ANI_FIRSTEP_LEVEL, - aniState->firstepLevel - 1); - return; + if (ar5416AniControl(ah, HAL_ANI_FIRSTEP_LEVEL, + aniState->firstepLevel - 1)) + return; } } } /* then lower spur immunity level, down to zero */ if (aniState->spurImmunityLevel > 0) { - ar5416AniControl(ah, HAL_ANI_SPUR_IMMUNITY_LEVEL, - aniState->spurImmunityLevel - 1); - return; + if (ar5416AniControl(ah, HAL_ANI_SPUR_IMMUNITY_LEVEL, + aniState->spurImmunityLevel - 1)) + return; } /* * if all else fails, lower noise immunity level down to a min value * zero for now */ if (aniState->noiseImmunityLevel > 0) { - ar5416AniControl(ah, HAL_ANI_NOISE_IMMUNITY_LEVEL, - aniState->noiseImmunityLevel - 1); - return; + if (ar5416AniControl(ah, HAL_ANI_NOISE_IMMUNITY_LEVEL, + aniState->noiseImmunityLevel - 1)) + return; } }