diff options
author | Bruno Randolf <br1@thinktube.com> | 2010-03-25 01:49:19 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-03-31 14:39:09 -0400 |
commit | 6a8a3f6b2ac02fb8542f2b36b0ecd9c48f7d9a7e (patch) | |
tree | c59903366deb8d8517df9fa7d95da0d7b685d334 | |
parent | a9167f96428b832bf94c89908e000e16c4eb7d5b (diff) |
ath5k: move ath5k_hw_calibration_poll to base.c
It's not a phy related funtion; It has more to do with the interrupt handler
and tasklet scheduling, so it belongs to base.c.
Signed-off-by: Bruno Randolf <br1@einfach.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | drivers/net/wireless/ath/ath5k/ath5k.h | 1 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath5k/base.c | 15 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath5k/phy.c | 13 |
3 files changed, 14 insertions, 15 deletions
diff --git a/drivers/net/wireless/ath/ath5k/ath5k.h b/drivers/net/wireless/ath/ath5k/ath5k.h index 3f56d9ee21de..6334294f5f13 100644 --- a/drivers/net/wireless/ath/ath5k/ath5k.h +++ b/drivers/net/wireless/ath/ath5k/ath5k.h | |||
@@ -1254,7 +1254,6 @@ int ath5k_hw_channel(struct ath5k_hw *ah, struct ieee80211_channel *channel); | |||
1254 | void ath5k_hw_init_nfcal_hist(struct ath5k_hw *ah); | 1254 | void ath5k_hw_init_nfcal_hist(struct ath5k_hw *ah); |
1255 | int ath5k_hw_phy_calibrate(struct ath5k_hw *ah, | 1255 | int ath5k_hw_phy_calibrate(struct ath5k_hw *ah, |
1256 | struct ieee80211_channel *channel); | 1256 | struct ieee80211_channel *channel); |
1257 | void ath5k_hw_calibration_poll(struct ath5k_hw *ah); | ||
1258 | /* Spur mitigation */ | 1257 | /* Spur mitigation */ |
1259 | bool ath5k_hw_chan_has_spur_noise(struct ath5k_hw *ah, | 1258 | bool ath5k_hw_chan_has_spur_noise(struct ath5k_hw *ah, |
1260 | struct ieee80211_channel *channel); | 1259 | struct ieee80211_channel *channel); |
diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c index 539a6d5415fd..f60d84f9c55f 100644 --- a/drivers/net/wireless/ath/ath5k/base.c +++ b/drivers/net/wireless/ath/ath5k/base.c | |||
@@ -2625,6 +2625,19 @@ ath5k_stop_hw(struct ath5k_softc *sc) | |||
2625 | return ret; | 2625 | return ret; |
2626 | } | 2626 | } |
2627 | 2627 | ||
2628 | static void | ||
2629 | ath5k_intr_calibration_poll(struct ath5k_hw *ah) | ||
2630 | { | ||
2631 | if (time_is_before_eq_jiffies(ah->ah_cal_next_full)) { | ||
2632 | ah->ah_cal_next_full = jiffies + | ||
2633 | msecs_to_jiffies(ATH5K_TUNE_CALIBRATION_INTERVAL_FULL); | ||
2634 | tasklet_schedule(&ah->ah_sc->calib); | ||
2635 | } | ||
2636 | /* we could use SWI to generate enough interrupts to meet our | ||
2637 | * calibration interval requirements, if necessary: | ||
2638 | * AR5K_REG_ENABLE_BITS(ah, AR5K_CR, AR5K_CR_SWI); */ | ||
2639 | } | ||
2640 | |||
2628 | static irqreturn_t | 2641 | static irqreturn_t |
2629 | ath5k_intr(int irq, void *dev_id) | 2642 | ath5k_intr(int irq, void *dev_id) |
2630 | { | 2643 | { |
@@ -2689,7 +2702,7 @@ ath5k_intr(int irq, void *dev_id) | |||
2689 | if (unlikely(!counter)) | 2702 | if (unlikely(!counter)) |
2690 | ATH5K_WARN(sc, "too many interrupts, giving up for now\n"); | 2703 | ATH5K_WARN(sc, "too many interrupts, giving up for now\n"); |
2691 | 2704 | ||
2692 | ath5k_hw_calibration_poll(ah); | 2705 | ath5k_intr_calibration_poll(ah); |
2693 | 2706 | ||
2694 | return IRQ_HANDLED; | 2707 | return IRQ_HANDLED; |
2695 | } | 2708 | } |
diff --git a/drivers/net/wireless/ath/ath5k/phy.c b/drivers/net/wireless/ath/ath5k/phy.c index 69053bfebbb9..cb569dbffa63 100644 --- a/drivers/net/wireless/ath/ath5k/phy.c +++ b/drivers/net/wireless/ath/ath5k/phy.c | |||
@@ -1102,19 +1102,6 @@ int ath5k_hw_channel(struct ath5k_hw *ah, struct ieee80211_channel *channel) | |||
1102 | PHY calibration | 1102 | PHY calibration |
1103 | \*****************/ | 1103 | \*****************/ |
1104 | 1104 | ||
1105 | void | ||
1106 | ath5k_hw_calibration_poll(struct ath5k_hw *ah) | ||
1107 | { | ||
1108 | if (time_is_before_eq_jiffies(ah->ah_cal_next_full)) { | ||
1109 | ah->ah_cal_next_full = jiffies + | ||
1110 | msecs_to_jiffies(ATH5K_TUNE_CALIBRATION_INTERVAL_FULL); | ||
1111 | tasklet_schedule(&ah->ah_sc->calib); | ||
1112 | } | ||
1113 | /* we could use SWI to generate enough interrupts to meet our | ||
1114 | * calibration interval requirements, if necessary: | ||
1115 | * AR5K_REG_ENABLE_BITS(ah, AR5K_CR, AR5K_CR_SWI); */ | ||
1116 | } | ||
1117 | |||
1118 | static int sign_extend(int val, const int nbits) | 1105 | static int sign_extend(int val, const int nbits) |
1119 | { | 1106 | { |
1120 | int order = BIT(nbits-1); | 1107 | int order = BIT(nbits-1); |