aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath5k/phy.c
diff options
context:
space:
mode:
authorBruno Randolf <br1@einfach.org>2010-03-25 14:49:14 +0900
committerJohn W. Linville <linville@tuxdriver.com>2010-03-31 14:39:09 -0400
commita9167f96428b832bf94c89908e000e16c4eb7d5b (patch)
tree1bde9db61684f3a2aa979c56d80b9e2e3e4fc7a9 /drivers/net/wireless/ath/ath5k/phy.c
parente65e1d7713da89d98f01c3f4267b2c9ecb03c16f (diff)
downloadkernel_samsung_espresso10-a9167f96428b832bf94c89908e000e16c4eb7d5b.zip
kernel_samsung_espresso10-a9167f96428b832bf94c89908e000e16c4eb7d5b.tar.gz
kernel_samsung_espresso10-a9167f96428b832bf94c89908e000e16c4eb7d5b.tar.bz2
ath5k: optimize ath5k_hw_calibration_poll
Optimize ath5k_hw_calibration_poll() since it is called on every singe interrupt. Signed-off-by: Bruno Randolf <br1@einfach.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath5k/phy.c')
-rw-r--r--drivers/net/wireless/ath/ath5k/phy.c20
1 files changed, 6 insertions, 14 deletions
diff --git a/drivers/net/wireless/ath/ath5k/phy.c b/drivers/net/wireless/ath/ath5k/phy.c
index 075873f..69053bf 100644
--- a/drivers/net/wireless/ath/ath5k/phy.c
+++ b/drivers/net/wireless/ath/ath5k/phy.c
@@ -1105,22 +1105,14 @@ int ath5k_hw_channel(struct ath5k_hw *ah, struct ieee80211_channel *channel)
void
ath5k_hw_calibration_poll(struct ath5k_hw *ah)
{
- /* Calibration interval in jiffies */
- unsigned long cal_intval;
-
- cal_intval = msecs_to_jiffies(ATH5K_TUNE_CALIBRATION_INTERVAL_FULL);
-
- /* Initialize timestamp if needed */
- if (!ah->ah_cal_tstamp)
- ah->ah_cal_tstamp = jiffies;
-
- /* For now we always do full calibration
- * Mark software interrupt mask and fire software
- * interrupt (bit gets auto-cleared) */
- if (time_is_before_eq_jiffies(ah->ah_cal_tstamp + cal_intval)) {
- ah->ah_cal_tstamp = jiffies;
+ if (time_is_before_eq_jiffies(ah->ah_cal_next_full)) {
+ ah->ah_cal_next_full = jiffies +
+ msecs_to_jiffies(ATH5K_TUNE_CALIBRATION_INTERVAL_FULL);
tasklet_schedule(&ah->ah_sc->calib);
}
+ /* we could use SWI to generate enough interrupts to meet our
+ * calibration interval requirements, if necessary:
+ * AR5K_REG_ENABLE_BITS(ah, AR5K_CR, AR5K_CR_SWI); */
}
static int sign_extend(int val, const int nbits)