]> rtime.felk.cvut.cz Git - lisovros/linux_canprio.git/commitdiff
ath9k_hw: make spur mitigation a callback
authorLuis R. Rodriguez <lrodriguez@atheros.com>
Mon, 19 Oct 2009 06:33:43 +0000 (02:33 -0400)
committerJohn W. Linville <linville@tuxdriver.com>
Fri, 30 Oct 2009 20:50:38 +0000 (16:50 -0400)
This only differs between single-chip solutions and non single-chip
solutions.

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/ath/ath9k/hw.c
drivers/net/wireless/ath/ath9k/hw.h

index 626667c3101cb41a6f2136e8f7e25262e34a831e..f73c07dfe65f5c59eb71768272340d69a7ee70b0 100644 (file)
@@ -952,8 +952,11 @@ int ath9k_hw_init(struct ath_hw *ah)
        if (AR_SREV_9280_10_OR_LATER(ah)) {
                ah->ani_function &= ~ATH9K_ANI_NOISE_IMMUNITY_LEVEL;
                ah->ath9k_hw_rf_set_freq = &ath9k_hw_ar9280_set_channel;
-       } else
+               ah->ath9k_hw_spur_mitigate_freq = &ath9k_hw_9280_spur_mitigate;
+       } else {
                ah->ath9k_hw_rf_set_freq = &ath9k_hw_set_channel;
+               ah->ath9k_hw_spur_mitigate_freq = &ath9k_hw_spur_mitigate;
+       }
 
        ath9k_hw_init_mode_regs(ah);
 
@@ -1917,10 +1920,7 @@ static bool ath9k_hw_channel_change(struct ath_hw *ah,
        if (IS_CHAN_OFDM(chan) || IS_CHAN_HT(chan))
                ath9k_hw_set_delta_slope(ah, chan);
 
-       if (AR_SREV_9280_10_OR_LATER(ah))
-               ath9k_hw_9280_spur_mitigate(ah, chan);
-       else
-               ath9k_hw_spur_mitigate(ah, chan);
+       ah->ath9k_hw_spur_mitigate_freq(ah, chan);
 
        if (!chan->oneTimeCalsDone)
                chan->oneTimeCalsDone = true;
@@ -2053,13 +2053,8 @@ int ath9k_hw_reset(struct ath_hw *ah, struct ath9k_channel *chan,
        if (IS_CHAN_OFDM(chan) || IS_CHAN_HT(chan))
                ath9k_hw_set_delta_slope(ah, chan);
 
-       if (AR_SREV_9280_10_OR_LATER(ah))
-               ath9k_hw_9280_spur_mitigate(ah, chan);
-       else
-               ath9k_hw_spur_mitigate(ah, chan);
-
+       ah->ath9k_hw_spur_mitigate_freq(ah, chan);
        ah->eep_ops->set_board_values(ah, chan);
-
        ath9k_hw_decrease_chain_power(ah, chan);
 
        REG_WRITE(ah, AR_STA_ID0, get_unaligned_le32(common->macaddr));
index dcf1295f4eb450fbfe49e8e8b8b68da112e403d1..c7b0c4d5f75a9a208fee05a061515a040cb721b7 100644 (file)
@@ -550,6 +550,11 @@ struct ath_hw {
 
        /* Callback for radio frequency change */
        int (*ath9k_hw_rf_set_freq)(struct ath_hw *ah, struct ath9k_channel *chan);
+
+       /* Callback for baseband spur frequency */
+       void (*ath9k_hw_spur_mitigate_freq)(struct ath_hw *ah,
+                                           struct ath9k_channel *chan);
+
        /* Used to program the radio on non single-chip devices */
        u32 *analogBank0Data;
        u32 *analogBank1Data;