From owner-svn-src-all@FreeBSD.ORG Thu Aug 12 06:08:36 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E7AC8106566B; Thu, 12 Aug 2010 06:08:36 +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 D6DDA8FC14; Thu, 12 Aug 2010 06:08:36 +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 o7C68afn092488; Thu, 12 Aug 2010 06:08:36 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7C68asp092486; Thu, 12 Aug 2010 06:08:36 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201008120608.o7C68asp092486@svn.freebsd.org> From: Adrian Chadd Date: Thu, 12 Aug 2010 06:08:36 +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: r211207 - head/sys/dev/ath/ath_hal/ar5416 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Aug 2010 06:08:37 -0000 Author: adrian Date: Thu Aug 12 06:08:36 2010 New Revision: 211207 URL: http://svn.freebsd.org/changeset/base/211207 Log: Internal NF calibration should not occur in parallel with any other calibration. Ensure that the NF calibration completes before continuing with the rest of the calibration setup process. Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c Thu Aug 12 06:06:14 2010 (r211206) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c Thu Aug 12 06:08:36 2010 (r211207) @@ -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" @@ -220,7 +222,16 @@ ar5416InitCal(struct ath_hal *ah, const * triggered at the same time. */ 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 + */ + 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; + } + /* Initialize list pointers */ cal->cal_list = cal->cal_last = cal->cal_curr = AH_NULL;