From owner-svn-src-all@FreeBSD.ORG Tue Sep 6 10:54:56 2011 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 B244E106564A; Tue, 6 Sep 2011 10:54:56 +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 A1E608FC16; Tue, 6 Sep 2011 10:54:56 +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 p86AsuVs081807; Tue, 6 Sep 2011 10:54:56 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p86Asu9w081805; Tue, 6 Sep 2011 10:54:56 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201109061054.p86Asu9w081805@svn.freebsd.org> From: Adrian Chadd Date: Tue, 6 Sep 2011 10:54:56 +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: r225421 - 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: Tue, 06 Sep 2011 10:54:56 -0000 Author: adrian Date: Tue Sep 6 10:54:56 2011 New Revision: 225421 URL: http://svn.freebsd.org/changeset/base/225421 Log: Fix 5ghz calibration logic when using AR9280 w/ fast clock. When the fast clock (44mhz) is enabled for 5ghz HT20, the dual ADCs aren't enabled. Trying to do the ADC calibrations here would result in calibration never completing; this resulted in IQ calibration never running and thus performance issues in 11a/11n HT20 mode. Leave it enabled for non-fastclock (40mhz) 11a mode and HT40 modes. This has been fixed in discussion with Felix Fietkau (nbd) and discussions with the Atheros baseband team. Linux ath9k now has a similar fix. Approved by: re (kib) 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 Tue Sep 6 10:49:05 2011 (r225420) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c Tue Sep 6 10:54:56 2011 (r225421) @@ -72,16 +72,17 @@ 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 either 5ghz any or 2ghz HT40 */ /* - * Merlin (AR9280) doesn't ever complete ADC calibrations - * in 5ghz non-HT40 mode (ie, HT20, 11a). For now, disable - * it for Merlin only until further information is - * available. + * Run ADC Gain Cal for either 5ghz any or 2ghz HT40. + * + * Don't run ADC calibrations for 5ghz fast clock mode + * in HT20 - only one ADC is used. */ - if (! AR_SREV_MERLIN(ah)) - if (IEEE80211_IS_CHAN_5GHZ(chan)) - return AH_TRUE; + if (IEEE80211_IS_CHAN_HT20(chan) && + (IS_5GHZ_FAST_CLOCK_EN(ah, chan))) + return AH_FALSE; + if (IEEE80211_IS_CHAN_5GHZ(chan)) + return AH_TRUE; if (IEEE80211_IS_CHAN_HT40(chan)) return AH_TRUE; return AH_FALSE;