From owner-svn-src-user@FreeBSD.ORG Wed Aug 11 05:35:42 2010 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 B15611065670; Wed, 11 Aug 2010 05:35:42 +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 A112F8FC08; Wed, 11 Aug 2010 05:35:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7B5ZfOC051855; Wed, 11 Aug 2010 05:35:41 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7B5Zff6051853; Wed, 11 Aug 2010 05:35:41 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201008110535.o7B5Zff6051853@svn.freebsd.org> From: Adrian Chadd Date: Wed, 11 Aug 2010 05:35:41 +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: r211163 - user/adrian/if_ath_devel/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: Wed, 11 Aug 2010 05:35:42 -0000 Author: adrian Date: Wed Aug 11 05:35:41 2010 New Revision: 211163 URL: http://svn.freebsd.org/changeset/base/211163 Log: Remove the ar5416 related NF Cal routines; they're in AR5212 now. Modified: user/adrian/if_ath_devel/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c Modified: user/adrian/if_ath_devel/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c ============================================================================== --- user/adrian/if_ath_devel/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c Wed Aug 11 05:30:52 2010 (r211162) +++ user/adrian/if_ath_devel/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c Wed Aug 11 05:35:41 2010 (r211163) @@ -24,6 +24,8 @@ #include "ah_eeprom_v14.h" +#include "ar5212/ar5212.h" /* for NF cal related declarations */ + #include "ar5416/ar5416.h" #include "ar5416/ar5416reg.h" #include "ar5416/ar5416phy.h" @@ -34,8 +36,6 @@ static void ar5416StartNFCal(struct ath_hal *ah); static void ar5416LoadNF(struct ath_hal *ah, const struct ieee80211_channel *); static int16_t ar5416GetNf(struct ath_hal *, struct ieee80211_channel *); -static int ar5416IsNFCalInProgress(struct ath_hal *ah); -static int ar5416WaitNfComplete(struct ath_hal *ah, int i); /* * Determine if calibration is supported by device and channel flags @@ -227,7 +227,7 @@ ar5416InitCal(struct ath_hal *ah, const * Try to make sure the above NF cal completes, just so * it doesn't clash with subsequent percals -adrian */ - if (! ar5416WaitNfComplete(ah, 10000)) { + if (! ar5212WaitNFCalComplete(ah, 10000)) { HALDEBUG(ah, HAL_DEBUG_ANY, "%s: initial NF calibration did " "not complete in time; noisy environment?\n", __func__); return AH_FALSE; @@ -412,7 +412,7 @@ ar5416PerCalibrationN(struct ath_hal *ah * the CCA registers and kick another NF calibration ; periodic * calibrations shouldn't be occuring during a NF calibration. */ - if (ar5416IsNFCalInProgress(ah)) { + if (ar5212IsNFCalInProgress(ah)) { HALDEBUG(ah, HAL_DEBUG_ANY, "%s: NF calibration in-progress; skipping\n", __func__); @@ -606,7 +606,7 @@ ar5416LoadNF(struct ath_hal *ah, const s OS_REG_SET_BIT(ah, AR_PHY_AGC_CONTROL, AR_PHY_AGC_CONTROL_NF); /* Wait for load to complete, should be fast, a few 10s of us. */ - if (! ar5416WaitNfComplete(ah, 1000)) { + if (! ar5212WaitNFCalComplete(ah, 1000)) { /* * We timed out waiting for the noisefloor to load, probably due to an * in-progress rx. Simply return here and allow the load plenty of time @@ -678,41 +678,6 @@ ar5416UpdateNFHistBuff(struct ar5212NfCa } /* - * Check whether there's an in-progress NF completion. - * - * Returns AH_TRUE if there's a in-progress NF calibration, AH_FALSE - * otherwise. - */ -static int -ar5416IsNFCalInProgress(struct ath_hal *ah) -{ - if (OS_REG_READ(ah, AR_PHY_AGC_CONTROL) & AR_PHY_AGC_CONTROL_NF) - return AH_TRUE; - return FALSE; -} - -/* - * Wait for an in-progress calibration to complete. - * - * The completion function waits "i" times 10uS. - * It returns AH_TRUE if the NF calibration completed (or was never - * in progress); AH_FALSE if it was still in progress after "i" checks. - */ -static int -ar5416WaitNfComplete(struct ath_hal *ah, int i) -{ - int j; - if (i <= 0) - i = 1; /* it should run at least once */ - for (j = 0; j < i; j++) { - if (! ar5416IsNFCalInProgress(ah)) - return AH_TRUE; - OS_DELAY(10); - } - return AH_FALSE; -} - -/* * Read the NF and check it against the noise floor threshhold */ static int16_t @@ -720,7 +685,7 @@ ar5416GetNf(struct ath_hal *ah, struct i { int16_t nf, nfThresh; - if (ar5416IsNFCalInProgress(ah)) { + if (ar5212IsNFCalInProgress(ah)) { HALDEBUG(ah, HAL_DEBUG_ANY, "%s: NF didn't complete in calibration window\n", __func__); nf = 0;