From owner-svn-src-all@FreeBSD.ORG Sat Aug 14 15:29:21 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 E7A181065698; Sat, 14 Aug 2010 15:29:21 +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 BC6178FC0A; Sat, 14 Aug 2010 15:29:21 +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 o7EFTLvx031595; Sat, 14 Aug 2010 15:29:21 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7EFTLp6031592; Sat, 14 Aug 2010 15:29:21 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201008141529.o7EFTLp6031592@svn.freebsd.org> From: Adrian Chadd Date: Sat, 14 Aug 2010 15:29:21 +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: r211307 - 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: Sat, 14 Aug 2010 15:29:22 -0000 Author: adrian Date: Sat Aug 14 15:29:21 2010 New Revision: 211307 URL: http://svn.freebsd.org/changeset/base/211307 Log: Merge in a fix for the power/(gain?) calculation. Apply it to both the 5416/9160 and 9285 code paths. Obtained from: OpenWRT r22123, 522-ath9k_pwrcal_fix.patch Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c head/sys/dev/ath/ath_hal/ar5416/ar9285_reset.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Sat Aug 14 15:28:15 2010 (r211306) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Sat Aug 14 15:29:21 2010 (r211307) @@ -2008,7 +2008,7 @@ ar5416GetGainBoundariesAndPdadcs(struct * for last gain, pdGainBoundary == Pmax_t2, so will * have to extrapolate */ - if (tgtIndex > maxIndex) { /* need to extrapolate above */ + if (tgtIndex >= maxIndex) { /* need to extrapolate above */ while ((ss <= tgtIndex) && (k < (AR5416_NUM_PDADC_VALUES - 1))) { tmpVal = (int16_t)((vpdTableI[i][sizeCurrVpdTable - 1] + (ss - maxIndex +1) * vpdStep)); Modified: head/sys/dev/ath/ath_hal/ar5416/ar9285_reset.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar9285_reset.c Sat Aug 14 15:28:15 2010 (r211306) +++ head/sys/dev/ath/ath_hal/ar5416/ar9285_reset.c Sat Aug 14 15:29:21 2010 (r211307) @@ -792,7 +792,7 @@ ar9285GetGainBoundariesAndPdadcs(struct * for last gain, pdGainBoundary == Pmax_t2, so will * have to extrapolate */ - if (tgtIndex > maxIndex) { /* need to extrapolate above */ + if (tgtIndex >= maxIndex) { /* need to extrapolate above */ while ((ss <= tgtIndex) && (k < (AR5416_NUM_PDADC_VALUES - 1))) { tmpVal = (int16_t)((vpdTableI[i][sizeCurrVpdTable - 1] + (ss - maxIndex +1) * vpdStep));