aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless
diff options
context:
space:
mode:
authorBruno Randolf <br1@einfach.org>2010-03-25 01:49:14 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-03-31 14:39:09 -0400
commita9167f96428b832bf94c89908e000e16c4eb7d5b (patch)
tree1bde9db61684f3a2aa979c56d80b9e2e3e4fc7a9 /drivers/net/wireless
parente65e1d7713da89d98f01c3f4267b2c9ecb03c16f (diff)
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')
-rw-r--r--drivers/net/wireless/ath/ath5k/ath5k.h2
-rw-r--r--drivers/net/wireless/ath/ath5k/phy.c20
2 files changed, 7 insertions, 15 deletions
diff --git a/drivers/net/wireless/ath/ath5k/ath5k.h b/drivers/net/wireless/ath/ath5k/ath5k.h
index d84ccde11171..3f56d9ee21de 100644
--- a/drivers/net/wireless/ath/ath5k/ath5k.h
+++ b/drivers/net/wireless/ath/ath5k/ath5k.h
@@ -1100,7 +1100,7 @@ struct ath5k_hw {
1100 s32 ah_noise_floor; 1100 s32 ah_noise_floor;
1101 1101
1102 /* Calibration timestamp */ 1102 /* Calibration timestamp */
1103 unsigned long ah_cal_tstamp; 1103 unsigned long ah_cal_next_full;
1104 1104
1105 /* Calibration mask */ 1105 /* Calibration mask */
1106 u8 ah_cal_mask; 1106 u8 ah_cal_mask;
diff --git a/drivers/net/wireless/ath/ath5k/phy.c b/drivers/net/wireless/ath/ath5k/phy.c
index 075873f98428..69053bfebbb9 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)
1105void 1105void
1106ath5k_hw_calibration_poll(struct ath5k_hw *ah) 1106ath5k_hw_calibration_poll(struct ath5k_hw *ah)
1107{ 1107{
1108 /* Calibration interval in jiffies */ 1108 if (time_is_before_eq_jiffies(ah->ah_cal_next_full)) {
1109 unsigned long cal_intval; 1109 ah->ah_cal_next_full = jiffies +
1110 1110 msecs_to_jiffies(ATH5K_TUNE_CALIBRATION_INTERVAL_FULL);
1111 cal_intval = msecs_to_jiffies(ATH5K_TUNE_CALIBRATION_INTERVAL_FULL);
1112
1113 /* Initialize timestamp if needed */
1114 if (!ah->ah_cal_tstamp)
1115 ah->ah_cal_tstamp = jiffies;
1116
1117 /* For now we always do full calibration
1118 * Mark software interrupt mask and fire software
1119 * interrupt (bit gets auto-cleared) */
1120 if (time_is_before_eq_jiffies(ah->ah_cal_tstamp + cal_intval)) {
1121 ah->ah_cal_tstamp = jiffies;
1122 tasklet_schedule(&ah->ah_sc->calib); 1111 tasklet_schedule(&ah->ah_sc->calib);
1123 } 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); */
1124} 1116}
1125 1117
1126static int sign_extend(int val, const int nbits) 1118static int sign_extend(int val, const int nbits)