From owner-svn-src-all@FreeBSD.ORG Fri Mar 11 11:07:54 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 55EBE106567B; Fri, 11 Mar 2011 11:07:54 +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 417518FC24; Fri, 11 Mar 2011 11:07:54 +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 p2BB7sg2076201; Fri, 11 Mar 2011 11:07:54 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2BB7s17076197; Fri, 11 Mar 2011 11:07:54 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201103111107.p2BB7s17076197@svn.freebsd.org> From: Adrian Chadd Date: Fri, 11 Mar 2011 11:07:54 +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: r219479 - in head/sys/dev/ath/ath_hal: ar5416 ar9002 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: Fri, 11 Mar 2011 11:07:54 -0000 Author: adrian Date: Fri Mar 11 11:07:53 2011 New Revision: 219479 URL: http://svn.freebsd.org/changeset/base/219479 Log: Remove the ar9285FillVpdTable() and just use ar5416FillVpdTable(). Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416.h head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c head/sys/dev/ath/ath_hal/ar9002/ar9285_reset.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416.h Fri Mar 11 10:11:22 2011 (r219478) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416.h Fri Mar 11 11:07:53 2011 (r219479) @@ -233,6 +233,9 @@ extern void ar5416RestoreChainMask(struc /* TX power setup related routines in ar5416_reset.c */ extern HAL_BOOL getLowerUpperIndex(uint8_t target, uint8_t *pList, uint16_t listSize, uint16_t *indexL, uint16_t *indexR); +extern HAL_BOOL ar5416FillVpdTable(uint8_t pwrMin, uint8_t pwrMax, + uint8_t *pPwrList, uint8_t *pVpdList, uint16_t numIntercepts, + uint8_t *pRetVpdList); extern void ar5416GetGainBoundariesAndPdadcs(struct ath_hal *ah, const struct ieee80211_channel *chan, CAL_DATA_PER_FREQ *pRawDataSet, uint8_t * bChans, uint16_t availPiers, Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Fri Mar 11 10:11:22 2011 (r219478) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Fri Mar 11 11:07:53 2011 (r219479) @@ -67,9 +67,6 @@ static uint16_t ar5416GetMaxEdgePower(ui static int16_t interpolate(uint16_t target, uint16_t srcLeft, uint16_t srcRight, int16_t targetLeft, int16_t targetRight); static void ar5416Set11nRegs(struct ath_hal *ah, const struct ieee80211_channel *chan); -static HAL_BOOL ar5416FillVpdTable(uint8_t pwrMin, uint8_t pwrMax, - uint8_t *pPwrList, uint8_t *pVpdList, - uint16_t numIntercepts, uint8_t *pRetVpdList); /* * Places the device in and out of reset and then places sane @@ -2350,7 +2347,7 @@ getLowerUpperIndex(uint8_t target, uint8 * Fill the Vpdlist for indices Pmax-Pmin * Note: pwrMin, pwrMax and Vpdlist are all in dBm * 4 */ -static HAL_BOOL +HAL_BOOL ar5416FillVpdTable(uint8_t pwrMin, uint8_t pwrMax, uint8_t *pPwrList, uint8_t *pVpdList, uint16_t numIntercepts, uint8_t *pRetVpdList) { Modified: head/sys/dev/ath/ath_hal/ar9002/ar9285_reset.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar9002/ar9285_reset.c Fri Mar 11 10:11:22 2011 (r219478) +++ head/sys/dev/ath/ath_hal/ar9002/ar9285_reset.c Fri Mar 11 11:07:53 2011 (r219479) @@ -59,8 +59,6 @@ static HAL_BOOL ar9285SetPowerCalTable(s int16_t *pTxPowerIndexOffset); static int16_t interpolate(uint16_t target, uint16_t srcLeft, uint16_t srcRight, int16_t targetLeft, int16_t targetRight); -static HAL_BOOL ar9285FillVpdTable(uint8_t, uint8_t, uint8_t *, uint8_t *, - uint16_t, uint8_t *); static void ar9285GetGainBoundariesAndPdadcs(struct ath_hal *ah, const struct ieee80211_channel *chan, CAL_DATA_PER_FREQ_4K *pRawDataSet, uint8_t * bChans, uint16_t availPiers, @@ -667,7 +665,7 @@ ar9285GetGainBoundariesAndPdadcs(struct for (i = 0; i < numXpdGains; i++) { minPwrT4[i] = pRawDataSet[idxL].pwrPdg[i][0]; maxPwrT4[i] = pRawDataSet[idxL].pwrPdg[i][4]; - ar9285FillVpdTable(minPwrT4[i], maxPwrT4[i], + ar5416FillVpdTable(minPwrT4[i], maxPwrT4[i], pRawDataSet[idxL].pwrPdg[i], pRawDataSet[idxL].vpdPdg[i], AR5416_PD_GAIN_ICEPTS, vpdTableI[i]); @@ -687,9 +685,9 @@ ar9285GetGainBoundariesAndPdadcs(struct HALASSERT(maxPwrT4[i] > minPwrT4[i]); /* Fill pier Vpds */ - ar9285FillVpdTable(minPwrT4[i], maxPwrT4[i], pPwrL, pVpdL, + ar5416FillVpdTable(minPwrT4[i], maxPwrT4[i], pPwrL, pVpdL, AR5416_PD_GAIN_ICEPTS, vpdTableL[i]); - ar9285FillVpdTable(minPwrT4[i], maxPwrT4[i], pPwrR, pVpdR, + ar5416FillVpdTable(minPwrT4[i], maxPwrT4[i], pPwrR, pVpdR, AR5416_PD_GAIN_ICEPTS, vpdTableR[i]); /* Interpolate the final vpd */ @@ -782,37 +780,7 @@ ar9285GetGainBoundariesAndPdadcs(struct } return; } -/* - * XXX same as ar5416FillVpdTable - */ -static HAL_BOOL -ar9285FillVpdTable(uint8_t pwrMin, uint8_t pwrMax, uint8_t *pPwrList, - uint8_t *pVpdList, uint16_t numIntercepts, uint8_t *pRetVpdList) -{ - uint16_t i, k; - uint8_t currPwr = pwrMin; - uint16_t idxL, idxR; - - HALASSERT(pwrMax > pwrMin); - for (i = 0; i <= (pwrMax - pwrMin) / 2; i++) { - getLowerUpperIndex(currPwr, pPwrList, numIntercepts, - &(idxL), &(idxR)); - if (idxR < 1) - idxR = 1; /* extrapolate below */ - if (idxL == numIntercepts - 1) - idxL = (uint16_t)(numIntercepts - 2); /* extrapolate above */ - if (pPwrList[idxL] == pPwrList[idxR]) - k = pVpdList[idxL]; - else - k = (uint16_t)( ((currPwr - pPwrList[idxL]) * pVpdList[idxR] + (pPwrList[idxR] - currPwr) * pVpdList[idxL]) / - (pPwrList[idxR] - pPwrList[idxL]) ); - HALASSERT(k < 256); - pRetVpdList[i] = (uint8_t)k; - currPwr += 2; /* half dB steps */ - } - return AH_TRUE; -} static int16_t interpolate(uint16_t target, uint16_t srcLeft, uint16_t srcRight, int16_t targetLeft, int16_t targetRight)