Date: Thu, 29 Jul 2010 14:13:45 +0000 (UTC) From: Adrian Chadd <adrian@FreeBSD.org> To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r210607 - user/adrian/if_ath_devel/sys/dev/ath/ath_hal/ar5416 Message-ID: <201007291413.o6TEDjrL062924@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: adrian Date: Thu Jul 29 14:13:45 2010 New Revision: 210607 URL: http://svn.freebsd.org/changeset/base/210607 Log: Point out that the comment in ar5416InitCal() that NF calibration is delayed is wrong. Since it is wrong, and the current code immediately kicks off one of the periodic calibrations on interface reset, just delay the rest of the calibration setup until the NF calibration completes. 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 Thu Jul 29 14:04:29 2010 (r210606) +++ user/adrian/if_ath_devel/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c Thu Jul 29 14:13:45 2010 (r210607) @@ -169,6 +169,7 @@ ar5416InitCal(struct ath_hal *ah, const { struct ar5416PerCal *cal = &AH5416(ah)->ah_cal; HAL_CHANNEL_INTERNAL *ichan; + int i; ichan = ath_hal_checkchannel(ah, chan); HALASSERT(ichan != AH_NULL); @@ -219,7 +220,24 @@ ar5416InitCal(struct ath_hal *ah, const * higher than normal value if DC offset and noise floor cal are * triggered at the same time. */ + /* XXX this actually kicks off a NF calibration -adrian */ OS_REG_SET_BIT(ah, AR_PHY_AGC_CONTROL, AR_PHY_AGC_CONTROL_NF); + /* + * Try to make sure the above NF cal completes, just so + * it doesn't clash with subsequent percals -adrian + */ + for (i = 0; i < 100; i++) { + if (ath_hal_wait(ah, AR_PHY_AGC_CONTROL, + AR_PHY_AGC_CONTROL_NF, 0) == AH_TRUE) + break; + HALDEBUG(ah, HAL_DEBUG_ANY, "%s: (loop %d): initial NF " + "calibration didn't finish.\n", __func__, i); + } + if (i >= 100) { + HALDEBUG(ah, HAL_DEBUG_ANY, "%s: initial NF calibration did " + "not complete in time; noisy environment?\n", __func__); + return AH_FALSE; + } /* Initialize list pointers */ cal->cal_list = cal->cal_last = cal->cal_curr = AH_NULL;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201007291413.o6TEDjrL062924>