aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/wireless/ath/ath5k/ath5k.h2
-rw-r--r--drivers/net/wireless/ath/ath5k/base.c18
2 files changed, 13 insertions, 7 deletions
diff --git a/drivers/net/wireless/ath/ath5k/ath5k.h b/drivers/net/wireless/ath/ath5k/ath5k.h
index 131e8b36fea..d6f9afebf92 100644
--- a/drivers/net/wireless/ath/ath5k/ath5k.h
+++ b/drivers/net/wireless/ath/ath5k/ath5k.h
@@ -204,6 +204,7 @@
204#define AR5K_TUNE_TPC_TXPOWER false 204#define AR5K_TUNE_TPC_TXPOWER false
205#define ATH5K_TUNE_CALIBRATION_INTERVAL_FULL 10000 /* 10 sec */ 205#define ATH5K_TUNE_CALIBRATION_INTERVAL_FULL 10000 /* 10 sec */
206#define ATH5K_TUNE_CALIBRATION_INTERVAL_ANI 1000 /* 1 sec */ 206#define ATH5K_TUNE_CALIBRATION_INTERVAL_ANI 1000 /* 1 sec */
207#define ATH5K_TUNE_CALIBRATION_INTERVAL_NF 60000 /* 60 sec */
207 208
208#define AR5K_INIT_CARR_SENSE_EN 1 209#define AR5K_INIT_CARR_SENSE_EN 1
209 210
@@ -1118,6 +1119,7 @@ struct ath5k_hw {
1118 /* Calibration timestamp */ 1119 /* Calibration timestamp */
1119 unsigned long ah_cal_next_full; 1120 unsigned long ah_cal_next_full;
1120 unsigned long ah_cal_next_ani; 1121 unsigned long ah_cal_next_ani;
1122 unsigned long ah_cal_next_nf;
1121 1123
1122 /* Calibration mask */ 1124 /* Calibration mask */
1123 u8 ah_cal_mask; 1125 u8 ah_cal_mask;
diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c
index 78a0c420c49..c1a438ccfde 100644
--- a/drivers/net/wireless/ath/ath5k/base.c
+++ b/drivers/net/wireless/ath/ath5k/base.c
@@ -2803,14 +2803,16 @@ ath5k_tasklet_calibrate(unsigned long data)
2803 ieee80211_frequency_to_channel( 2803 ieee80211_frequency_to_channel(
2804 sc->curchan->center_freq)); 2804 sc->curchan->center_freq));
2805 2805
2806 /* TODO: We don't need to run noise floor calibration as often
2807 * as I/Q calibration.*/
2808
2809 /* Noise floor calibration interrupts rx/tx path while I/Q calibration 2806 /* Noise floor calibration interrupts rx/tx path while I/Q calibration
2810 * doesn't. Stop queues so that calibration doesn't interfere with tx */ 2807 * doesn't. We stop the queues so that calibration doesn't interfere
2811 ieee80211_stop_queues(sc->hw); 2808 * with TX and don't run it as often */
2812 ath5k_hw_update_noise_floor(ah); 2809 if (time_is_before_eq_jiffies(ah->ah_cal_next_nf)) {
2813 ieee80211_wake_queues(sc->hw); 2810 ah->ah_cal_next_nf = jiffies +
2811 msecs_to_jiffies(ATH5K_TUNE_CALIBRATION_INTERVAL_NF);
2812 ieee80211_stop_queues(sc->hw);
2813 ath5k_hw_update_noise_floor(ah);
2814 ieee80211_wake_queues(sc->hw);
2815 }
2814 2816
2815 ah->ah_cal_mask &= ~AR5K_CALIBRATION_FULL; 2817 ah->ah_cal_mask &= ~AR5K_CALIBRATION_FULL;
2816} 2818}
@@ -2931,6 +2933,8 @@ ath5k_reset(struct ath5k_softc *sc, struct ieee80211_channel *chan)
2931 2933
2932 ah->ah_cal_next_full = jiffies; 2934 ah->ah_cal_next_full = jiffies;
2933 ah->ah_cal_next_ani = jiffies; 2935 ah->ah_cal_next_ani = jiffies;
2936 ah->ah_cal_next_nf = jiffies;
2937
2934 /* 2938 /*
2935 * Change channels and update the h/w rate map if we're switching; 2939 * Change channels and update the h/w rate map if we're switching;
2936 * e.g. 11a to 11b/g. 2940 * e.g. 11a to 11b/g.