Commit e68a060b authored by Luis R. Rodriguez's avatar Luis R. Rodriguez Committed by John W. Linville

ath9k_hw: use a callback for frequency change

This avoids a branch on every channel change.
Signed-off-by: default avatarLuis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 0a3b7bac
...@@ -951,8 +951,11 @@ int ath9k_hw_init(struct ath_hw *ah) ...@@ -951,8 +951,11 @@ int ath9k_hw_init(struct ath_hw *ah)
ath9k_hw_init_cal_settings(ah); ath9k_hw_init_cal_settings(ah);
ah->ani_function = ATH9K_ANI_ALL; ah->ani_function = ATH9K_ANI_ALL;
if (AR_SREV_9280_10_OR_LATER(ah)) if (AR_SREV_9280_10_OR_LATER(ah)) {
ah->ani_function &= ~ATH9K_ANI_NOISE_IMMUNITY_LEVEL; ah->ani_function &= ~ATH9K_ANI_NOISE_IMMUNITY_LEVEL;
ah->ath9k_hw_rf_set_freq = &ath9k_hw_ar9280_set_channel;
} else
ah->ath9k_hw_rf_set_freq = &ath9k_hw_set_channel;
ath9k_hw_init_mode_regs(ah); ath9k_hw_init_mode_regs(ah);
...@@ -1889,10 +1892,7 @@ static bool ath9k_hw_channel_change(struct ath_hw *ah, ...@@ -1889,10 +1892,7 @@ static bool ath9k_hw_channel_change(struct ath_hw *ah,
ath9k_hw_set_regs(ah, chan); ath9k_hw_set_regs(ah, chan);
if (AR_SREV_9280_10_OR_LATER(ah)) r = ah->ath9k_hw_rf_set_freq(ah, chan);
r = ath9k_hw_ar9280_set_channel(ah, chan);
else
r = ath9k_hw_set_channel(ah, chan);
if (r) { if (r) {
ath_print(common, ATH_DBG_FATAL, ath_print(common, ATH_DBG_FATAL,
"Failed to set channel\n"); "Failed to set channel\n");
...@@ -2534,10 +2534,7 @@ int ath9k_hw_reset(struct ath_hw *ah, struct ath9k_channel *chan, ...@@ -2534,10 +2534,7 @@ int ath9k_hw_reset(struct ath_hw *ah, struct ath9k_channel *chan,
REG_WRITE(ah, AR_RSSI_THR, INIT_RSSI_THR); REG_WRITE(ah, AR_RSSI_THR, INIT_RSSI_THR);
if (AR_SREV_9280_10_OR_LATER(ah)) r = ah->ath9k_hw_rf_set_freq(ah, chan);
r = ath9k_hw_ar9280_set_channel(ah, chan);
else
r = ath9k_hw_set_channel(ah, chan);
if (r) if (r)
return r; return r;
......
...@@ -548,7 +548,9 @@ struct ath_hw { ...@@ -548,7 +548,9 @@ struct ath_hw {
DONT_USE_32KHZ, DONT_USE_32KHZ,
} enable_32kHz_clock; } enable_32kHz_clock;
/* RF */ /* Callback for radio frequency change */
int (*ath9k_hw_rf_set_freq)(struct ath_hw *ah, struct ath9k_channel *chan);
/* Used to program the radio on non single-chip devices */
u32 *analogBank0Data; u32 *analogBank0Data;
u32 *analogBank1Data; u32 *analogBank1Data;
u32 *analogBank2Data; u32 *analogBank2Data;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment