Skip to content

Commit

Permalink
ath9k: Do not try to calibrate radio when in sleep mode
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jouni Malinen authored and John W. Linville committed May 20, 2009
1 parent 9a23f9c commit 1ffc1c6
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions drivers/net/wireless/ath/ath9k/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,12 @@ static void ath_ani_calibrate(unsigned long data)
if (sc->sc_flags & SC_OP_SCANNING)
goto set_timer;

/* Only calibrate if awake */
if (sc->sc_ah->power_mode != ATH9K_PM_AWAKE)
goto set_timer;

ath9k_ps_wakeup(sc);

/* Long calibration runs independently of short calibration. */
if ((timestamp - sc->ani.longcal_timer) >= ATH_LONG_CALINTERVAL) {
longcal = true;
Expand Down Expand Up @@ -380,6 +386,8 @@ static void ath_ani_calibrate(unsigned long data)
}
}

ath9k_ps_restore(sc);

set_timer:
/*
* Set timer interval based on previous results.
Expand Down

0 comments on commit 1ffc1c6

Please sign in to comment.