aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath9k/main.c
diff options
context:
space:
mode:
authorJouni Malinen <jouni.malinen@atheros.com>2009-05-19 10:01:39 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-05-20 14:46:33 -0400
commit1ffc1c61bdbe31105d99d65043bbf7ae6d24dbc7 (patch)
tree96bbca0c29039eb8ef289756b4b76938141c587e /drivers/net/wireless/ath/ath9k/main.c
parent9a23f9ca50943c1b4535d22b3acda3c31b4ad072 (diff)
ath9k: Do not try to calibrate radio when in sleep mode
When the chip is in sleep mode, there is no point trying to calibrate the radio since it will just results in incorrect values being read from registers and other potential issues. In addition, if we actually start processing calibrate, do not allow the chip to be put into sleep until we have completed the calibration step. Signed-off-by: Jouni Malinen <jouni.malinen@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/main.c')
-rw-r--r--drivers/net/wireless/ath/ath9k/main.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index 7c3a98b1957d..dd54fa727a61 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -329,6 +329,12 @@ static void ath_ani_calibrate(unsigned long data)
329 if (sc->sc_flags & SC_OP_SCANNING) 329 if (sc->sc_flags & SC_OP_SCANNING)
330 goto set_timer; 330 goto set_timer;
331 331
332 /* Only calibrate if awake */
333 if (sc->sc_ah->power_mode != ATH9K_PM_AWAKE)
334 goto set_timer;
335
336 ath9k_ps_wakeup(sc);
337
332 /* Long calibration runs independently of short calibration. */ 338 /* Long calibration runs independently of short calibration. */
333 if ((timestamp - sc->ani.longcal_timer) >= ATH_LONG_CALINTERVAL) { 339 if ((timestamp - sc->ani.longcal_timer) >= ATH_LONG_CALINTERVAL) {
334 longcal = true; 340 longcal = true;
@@ -380,6 +386,8 @@ static void ath_ani_calibrate(unsigned long data)
380 } 386 }
381 } 387 }
382 388
389 ath9k_ps_restore(sc);
390
383set_timer: 391set_timer:
384 /* 392 /*
385 * Set timer interval based on previous results. 393 * Set timer interval based on previous results.