ath9k: use ath9k_hw_fbin2freq instead of FBIN2FREQ
authorGabor Juhos <juhosg@openwrt.org>
Mon, 16 Apr 2012 20:46:32 +0000 (22:46 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Tue, 17 Apr 2012 18:57:13 +0000 (14:57 -0400)
The FBIN2FREQ macro and the ath9k_hw_fbin2freq function
does the same thing. Remove the macro, and use the inline
function instead.

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
drivers/net/wireless/ath/ath9k/ar9003_eeprom.h
drivers/net/wireless/ath/ath9k/ar9003_phy.c

index f233313..1188db2 100644 (file)
@@ -4056,7 +4056,7 @@ static u8 ar9003_hw_eeprom_get_tgt_pwr(struct ath_hw *ah,
         * targetpower piers stored on eeprom
         */
        for (i = 0; i < numPiers; i++) {
-               freqArray[i] = FBIN2FREQ(pFreqBin[i], is2GHz);
+               freqArray[i] = ath9k_hw_fbin2freq(pFreqBin[i], is2GHz);
                targetPowerArray[i] = pEepromTargetPwr[i].tPow2x[rateIndex];
        }
 
@@ -4092,7 +4092,7 @@ static u8 ar9003_hw_eeprom_get_ht20_tgt_pwr(struct ath_hw *ah,
         * from targetpower piers stored on eeprom
         */
        for (i = 0; i < numPiers; i++) {
-               freqArray[i] = FBIN2FREQ(pFreqBin[i], is2GHz);
+               freqArray[i] = ath9k_hw_fbin2freq(pFreqBin[i], is2GHz);
                targetPowerArray[i] = pEepromTargetPwr[i].tPow2x[rateIndex];
        }
 
@@ -4128,7 +4128,7 @@ static u8 ar9003_hw_eeprom_get_ht40_tgt_pwr(struct ath_hw *ah,
         * targetpower piers stored on eeprom
         */
        for (i = 0; i < numPiers; i++) {
-               freqArray[i] = FBIN2FREQ(pFreqBin[i], is2GHz);
+               freqArray[i] = ath9k_hw_fbin2freq(pFreqBin[i], is2GHz);
                targetPowerArray[i] = pEepromTargetPwr[i].tPow2x[rateIndex];
        }
 
@@ -4153,7 +4153,7 @@ static u8 ar9003_hw_eeprom_get_cck_tgt_pwr(struct ath_hw *ah,
         * targetpower piers stored on eeprom
         */
        for (i = 0; i < numPiers; i++) {
-               freqArray[i] = FBIN2FREQ(pFreqBin[i], 1);
+               freqArray[i] = ath9k_hw_fbin2freq(pFreqBin[i], 1);
                targetPowerArray[i] = pEepromTargetPwr[i].tPow2x[rateIndex];
        }
 
@@ -4450,7 +4450,7 @@ static int ar9003_hw_cal_pier_get(struct ath_hw *ah,
                is2GHz = 1;
        }
 
-       *pfrequency = FBIN2FREQ(*pCalPier, is2GHz);
+       *pfrequency = ath9k_hw_fbin2freq(*pCalPier, is2GHz);
        *pcorrection = pCalPierStruct->refPower;
        *ptemperature = pCalPierStruct->tempMeas;
        *pvoltage = pCalPierStruct->voltMeas;
index bb223fe..2505ac4 100644 (file)
@@ -42,7 +42,6 @@
 #define AR9300_EEPMISC_WOW           0x02
 #define AR9300_CUSTOMER_DATA_SIZE    20
 
-#define FBIN2FREQ(x, y) ((y) ? (2300 + x) : (4800 + 5 * x))
 #define AR9300_MAX_CHAINS            3
 #define AR9300_ANT_16S               25
 #define AR9300_FUTURE_MODAL_SZ       6
index 4c9bc9f..bbda25f 100644 (file)
@@ -208,11 +208,12 @@ static void ar9003_hw_spur_mitigate_mrc_cck(struct ath_hw *ah,
                        continue;
                negative = 0;
                if (AR_SREV_9485(ah) || AR_SREV_9340(ah) || AR_SREV_9330(ah))
-                       cur_bb_spur = FBIN2FREQ(spur_fbin_ptr[i],
-                                       IS_CHAN_2GHZ(chan)) - synth_freq;
+                       cur_bb_spur = ath9k_hw_fbin2freq(spur_fbin_ptr[i],
+                                                        IS_CHAN_2GHZ(chan));
                else
-                       cur_bb_spur = spur_freq[i] - synth_freq;
+                       cur_bb_spur = spur_freq[i];
 
+               cur_bb_spur -= synth_freq;
                if (cur_bb_spur < 0) {
                        negative = 1;
                        cur_bb_spur = -cur_bb_spur;
@@ -442,7 +443,8 @@ static void ar9003_hw_spur_mitigate_ofdm(struct ath_hw *ah,
        ar9003_hw_spur_ofdm_clear(ah);
 
        for (i = 0; i < AR_EEPROM_MODAL_SPURS && spurChansPtr[i]; i++) {
-               freq_offset = FBIN2FREQ(spurChansPtr[i], mode) - synth_freq;
+               freq_offset = ath9k_hw_fbin2freq(spurChansPtr[i], mode);
+               freq_offset -= synth_freq;
                if (abs(freq_offset) < range) {
                        ar9003_hw_spur_ofdm_work(ah, chan, freq_offset);
                        break;