From owner-svn-src-head@FreeBSD.ORG Sun Mar 20 09:08:46 2011 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 4BA071065673; Sun, 20 Mar 2011 09:08:46 +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 32C388FC0C; Sun, 20 Mar 2011 09:08:46 +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 p2K98k87050505; Sun, 20 Mar 2011 09:08:46 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2K98kxv050503; Sun, 20 Mar 2011 09:08:46 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201103200908.p2K98kxv050503@svn.freebsd.org> From: Adrian Chadd Date: Sun, 20 Mar 2011 09:08:46 +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: r219794 - head/sys/dev/ath/ath_hal/ar5416 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: Sun, 20 Mar 2011 09:08:46 -0000 Author: adrian Date: Sun Mar 20 09:08:45 2011 New Revision: 219794 URL: http://svn.freebsd.org/changeset/base/219794 Log: Cave in and disable the ADC DC gain/offset calibrations if they're not needed. These calibrations are only applicable if the chip operating mode engages both interleaved RX ADCs (ie, it's compensating for the differences in DC gain and DC offset -between- the two ADCs.) Otherwise the chip reads values of 0x0 for the secondary ADC (as I guess it's not enabled here) and thus writes potentially bogus info into the chip. I've tested this on the AR9160 and AR9280; both behave themselves in 11g mode with these calibrations disabled. 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 Sun Mar 20 08:47:59 2011 (r219793) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c Sun Mar 20 09:08:45 2011 (r219794) @@ -72,9 +72,12 @@ ar5416IsCalSupp(struct ath_hal *ah, cons return !IEEE80211_IS_CHAN_B(chan); case ADC_GAIN_CAL: case ADC_DC_CAL: - /* Run ADC Gain Cal for non-CCK & non 2GHz-HT20 only */ - return !IEEE80211_IS_CHAN_B(chan) && - !(IEEE80211_IS_CHAN_2GHZ(chan) && IEEE80211_IS_CHAN_HT20(chan)); + /* Run ADC Gain Cal for either 5ghz any or 2ghz HT40 */ + if (IEEE80211_IS_CHAN_2GHZ(chan)) + return AH_FALSE; + if (IEEE80211_IS_CHAN_HT20(chan)) + return AH_FALSE; + return AH_TRUE; } return AH_FALSE; }