ath9k: Fix ref power interpolation logic for AR9287 chipsets.
authorVivek Natarajan <vivek.natraj@gmail.com>
Fri, 14 Aug 2009 06:02:04 +0000 (11:32 +0530)
committerJohn W. Linville <linville@tuxdriver.com>
Thu, 20 Aug 2009 15:35:52 +0000 (11:35 -0400)
Signed-off-by: Vivek Natarajan <vnatarajan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/ath/ath9k/eeprom_9287.c

index aeb7f484b6e1471a370bca8dd412db361f417960..959097927eee20339711942ea2fedd43d4cdf686 100644 (file)
@@ -374,7 +374,6 @@ static void ar9287_eeprom_get_tx_gain_index(struct ath_hw *ah,
                            u8 *pCalChans,  u16 availPiers,
                            int8_t *pPwr)
 {
-       u8 pcdac, i = 0;
        u16  idxL = 0, idxR = 0, numPiers;
        bool match;
        struct chan_centers centers;
@@ -392,17 +391,12 @@ static void ar9287_eeprom_get_tx_gain_index(struct ath_hw *ah,
                        &idxL, &idxR);
 
        if (match) {
-               pcdac = pRawDatasetOpLoop[idxL].pcdac[0][0];
-               *pPwr = pRawDatasetOpLoop[idxL].pwrPdg[0][0];
+               *pPwr = (int8_t) pRawDatasetOpLoop[idxL].pwrPdg[0][0];
        } else {
-               pcdac = pRawDatasetOpLoop[idxR].pcdac[0][0];
-               *pPwr = (pRawDatasetOpLoop[idxL].pwrPdg[0][0] +
-                               pRawDatasetOpLoop[idxR].pwrPdg[0][0])/2;
+               *pPwr = ((int8_t) pRawDatasetOpLoop[idxL].pwrPdg[0][0] +
+                           (int8_t) pRawDatasetOpLoop[idxR].pwrPdg[0][0])/2;
        }
 
-       while ((pcdac > ah->originalGain[i]) &&
-                       (i < (AR9280_TX_GAIN_TABLE_SIZE - 1)))
-               i++;
 }
 
 static void ar9287_eeprom_olpc_set_pdadcs(struct ath_hw *ah,