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)
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to