aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2010-08-02 09:53:15 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-08-16 15:26:39 -0400
commit6044474ed86484b899d46e040ade3872e83fc9f7 (patch)
tree582272aedaacaeaf57d5bf8e3e517cf5f2e07731 /drivers/net/wireless
parent70cf15335eb35d562a4ec6d8860611c87f775cf2 (diff)
ath9k: shorten the calibration interval during strong interference
When the noise floor limits are being bypassed because of strong interference, sensitivity is also reduced. In order to recover from this as quickly as possible, trigger a long periodic calibration every second instead of every 30 seconds, until the NF median is within limits again. This is especially important if the interference lasts for a while, since it takes multiple clean NF calibrations to bring the median back to normal. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r--drivers/net/wireless/ath/ath9k/ath9k.h1
-rw-r--r--drivers/net/wireless/ath/ath9k/main.c9
2 files changed, 8 insertions, 2 deletions
diff --git a/drivers/net/wireless/ath/ath9k/ath9k.h b/drivers/net/wireless/ath/ath9k/ath9k.h
index 07f26ee7a723..def0cd308fdd 100644
--- a/drivers/net/wireless/ath/ath9k/ath9k.h
+++ b/drivers/net/wireless/ath/ath9k/ath9k.h
@@ -423,6 +423,7 @@ int ath_beaconq_config(struct ath_softc *sc);
423#define ATH_AP_SHORT_CALINTERVAL 100 /* 100 ms */ 423#define ATH_AP_SHORT_CALINTERVAL 100 /* 100 ms */
424#define ATH_ANI_POLLINTERVAL_OLD 100 /* 100 ms */ 424#define ATH_ANI_POLLINTERVAL_OLD 100 /* 100 ms */
425#define ATH_ANI_POLLINTERVAL_NEW 1000 /* 1000 ms */ 425#define ATH_ANI_POLLINTERVAL_NEW 1000 /* 1000 ms */
426#define ATH_LONG_CALINTERVAL_INT 1000 /* 1000 ms */
426#define ATH_LONG_CALINTERVAL 30000 /* 30 seconds */ 427#define ATH_LONG_CALINTERVAL 30000 /* 30 seconds */
427#define ATH_RESTART_CALINTERVAL 1200000 /* 20 minutes */ 428#define ATH_RESTART_CALINTERVAL 1200000 /* 20 minutes */
428 429
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index 2ab3df22fbb5..a3b0ea90439d 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -396,7 +396,12 @@ void ath_ani_calibrate(unsigned long data)
396 bool shortcal = false; 396 bool shortcal = false;
397 bool aniflag = false; 397 bool aniflag = false;
398 unsigned int timestamp = jiffies_to_msecs(jiffies); 398 unsigned int timestamp = jiffies_to_msecs(jiffies);
399 u32 cal_interval, short_cal_interval; 399 u32 cal_interval, short_cal_interval, long_cal_interval;
400
401 if (ah->caldata && ah->caldata->nfcal_interference)
402 long_cal_interval = ATH_LONG_CALINTERVAL_INT;
403 else
404 long_cal_interval = ATH_LONG_CALINTERVAL;
400 405
401 short_cal_interval = (ah->opmode == NL80211_IFTYPE_AP) ? 406 short_cal_interval = (ah->opmode == NL80211_IFTYPE_AP) ?
402 ATH_AP_SHORT_CALINTERVAL : ATH_STA_SHORT_CALINTERVAL; 407 ATH_AP_SHORT_CALINTERVAL : ATH_STA_SHORT_CALINTERVAL;
@@ -408,7 +413,7 @@ void ath_ani_calibrate(unsigned long data)
408 ath9k_ps_wakeup(sc); 413 ath9k_ps_wakeup(sc);
409 414
410 /* Long calibration runs independently of short calibration. */ 415 /* Long calibration runs independently of short calibration. */
411 if ((timestamp - common->ani.longcal_timer) >= ATH_LONG_CALINTERVAL) { 416 if ((timestamp - common->ani.longcal_timer) >= long_cal_interval) {
412 longcal = true; 417 longcal = true;
413 ath_print(common, ATH_DBG_ANI, "longcal @%lu\n", jiffies); 418 ath_print(common, ATH_DBG_ANI, "longcal @%lu\n", jiffies);
414 common->ani.longcal_timer = timestamp; 419 common->ani.longcal_timer = timestamp;