diff options
author | Luis R. Rodriguez <lrodriguez@atheros.com> | 2009-10-19 02:33:41 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-10-30 16:50:37 -0400 |
commit | e68a060b5d88a72c06ec87864d20bea3f2a40629 (patch) | |
tree | 1220a9b95f86f200211b539a47a02d9c54d3e45c /drivers/net/wireless/ath | |
parent | 0a3b7bac673ee9462f5defe808609746d27af50d (diff) |
ath9k_hw: use a callback for frequency change
This avoids a branch on every channel change.
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/hw.c | 15 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/hw.h | 4 |
2 files changed, 9 insertions, 10 deletions
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c index d4dc1cbe00aa..f2b2f45d3a78 100644 --- a/drivers/net/wireless/ath/ath9k/hw.c +++ b/drivers/net/wireless/ath/ath9k/hw.c | |||
@@ -951,8 +951,11 @@ int ath9k_hw_init(struct ath_hw *ah) | |||
951 | ath9k_hw_init_cal_settings(ah); | 951 | ath9k_hw_init_cal_settings(ah); |
952 | 952 | ||
953 | ah->ani_function = ATH9K_ANI_ALL; | 953 | ah->ani_function = ATH9K_ANI_ALL; |
954 | if (AR_SREV_9280_10_OR_LATER(ah)) | 954 | if (AR_SREV_9280_10_OR_LATER(ah)) { |
955 | ah->ani_function &= ~ATH9K_ANI_NOISE_IMMUNITY_LEVEL; | 955 | ah->ani_function &= ~ATH9K_ANI_NOISE_IMMUNITY_LEVEL; |
956 | ah->ath9k_hw_rf_set_freq = &ath9k_hw_ar9280_set_channel; | ||
957 | } else | ||
958 | ah->ath9k_hw_rf_set_freq = &ath9k_hw_set_channel; | ||
956 | 959 | ||
957 | ath9k_hw_init_mode_regs(ah); | 960 | ath9k_hw_init_mode_regs(ah); |
958 | 961 | ||
@@ -1889,10 +1892,7 @@ static bool ath9k_hw_channel_change(struct ath_hw *ah, | |||
1889 | 1892 | ||
1890 | ath9k_hw_set_regs(ah, chan); | 1893 | ath9k_hw_set_regs(ah, chan); |
1891 | 1894 | ||
1892 | if (AR_SREV_9280_10_OR_LATER(ah)) | 1895 | r = ah->ath9k_hw_rf_set_freq(ah, chan); |
1893 | r = ath9k_hw_ar9280_set_channel(ah, chan); | ||
1894 | else | ||
1895 | r = ath9k_hw_set_channel(ah, chan); | ||
1896 | if (r) { | 1896 | if (r) { |
1897 | ath_print(common, ATH_DBG_FATAL, | 1897 | ath_print(common, ATH_DBG_FATAL, |
1898 | "Failed to set channel\n"); | 1898 | "Failed to set channel\n"); |
@@ -2534,10 +2534,7 @@ int ath9k_hw_reset(struct ath_hw *ah, struct ath9k_channel *chan, | |||
2534 | 2534 | ||
2535 | REG_WRITE(ah, AR_RSSI_THR, INIT_RSSI_THR); | 2535 | REG_WRITE(ah, AR_RSSI_THR, INIT_RSSI_THR); |
2536 | 2536 | ||
2537 | if (AR_SREV_9280_10_OR_LATER(ah)) | 2537 | r = ah->ath9k_hw_rf_set_freq(ah, chan); |
2538 | r = ath9k_hw_ar9280_set_channel(ah, chan); | ||
2539 | else | ||
2540 | r = ath9k_hw_set_channel(ah, chan); | ||
2541 | if (r) | 2538 | if (r) |
2542 | return r; | 2539 | return r; |
2543 | 2540 | ||
diff --git a/drivers/net/wireless/ath/ath9k/hw.h b/drivers/net/wireless/ath/ath9k/hw.h index 7f2b5d21f2f1..dcf1295f4eb4 100644 --- a/drivers/net/wireless/ath/ath9k/hw.h +++ b/drivers/net/wireless/ath/ath9k/hw.h | |||
@@ -548,7 +548,9 @@ struct ath_hw { | |||
548 | DONT_USE_32KHZ, | 548 | DONT_USE_32KHZ, |
549 | } enable_32kHz_clock; | 549 | } enable_32kHz_clock; |
550 | 550 | ||
551 | /* RF */ | 551 | /* Callback for radio frequency change */ |
552 | int (*ath9k_hw_rf_set_freq)(struct ath_hw *ah, struct ath9k_channel *chan); | ||
553 | /* Used to program the radio on non single-chip devices */ | ||
552 | u32 *analogBank0Data; | 554 | u32 *analogBank0Data; |
553 | u32 *analogBank1Data; | 555 | u32 *analogBank1Data; |
554 | u32 *analogBank2Data; | 556 | u32 *analogBank2Data; |