From owner-svn-src-user@FreeBSD.ORG Tue Jul 13 16:21:35 2010 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 810651065674; Tue, 13 Jul 2010 16:21:35 +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 557398FC16; Tue, 13 Jul 2010 16:21:35 +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 o6DGLZdQ089404; Tue, 13 Jul 2010 16:21:35 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6DGLZXp089401; Tue, 13 Jul 2010 16:21:35 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201007131621.o6DGLZXp089401@svn.freebsd.org> From: Adrian Chadd Date: Tue, 13 Jul 2010 16:21:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r210001 - user/adrian/if_ath_devel/sys/dev/ath/ath_hal/ar5416 X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jul 2010 16:21:35 -0000 Author: adrian Date: Tue Jul 13 16:21:35 2010 New Revision: 210001 URL: http://svn.freebsd.org/changeset/base/210001 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: user/adrian/if_ath_devel/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c user/adrian/if_ath_devel/sys/dev/ath/ath_hal/ar5416/ar9285_reset.c Modified: user/adrian/if_ath_devel/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c ============================================================================== --- user/adrian/if_ath_devel/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Tue Jul 13 16:16:41 2010 (r210000) +++ user/adrian/if_ath_devel/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Tue Jul 13 16:21:35 2010 (r210001) @@ -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: user/adrian/if_ath_devel/sys/dev/ath/ath_hal/ar5416/ar9285_reset.c ============================================================================== --- user/adrian/if_ath_devel/sys/dev/ath/ath_hal/ar5416/ar9285_reset.c Tue Jul 13 16:16:41 2010 (r210000) +++ user/adrian/if_ath_devel/sys/dev/ath/ath_hal/ar5416/ar9285_reset.c Tue Jul 13 16:21:35 2010 (r210001) @@ -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));