]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
ath9k: Choose correct ANI calibration period
authorSujith <Sujith.Manoharan@atheros.com>
Tue, 2 Dec 2008 13:07:54 +0000 (18:37 +0530)
committerJohn W. Linville <linville@tuxdriver.com>
Fri, 5 Dec 2008 14:35:50 +0000 (09:35 -0500)
ANI can't be turned on/off dynamically yet, but the calculation
of the calibration period is wrong anyway. This patch fixes it.

Reported-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/ath9k/main.c

index 3d7111e9b8d8d60c305976a25593d59aa5d759c7..26c47577e183b909c9ad766da03f5d4b8d288017 100644 (file)
@@ -421,8 +421,9 @@ static void ath_ani_calibrate(unsigned long data)
        * The interval must be the shortest necessary to satisfy ANI,
        * short calibration and long calibration.
        */
-
-       cal_interval = ATH_ANI_POLLINTERVAL;
+       cal_interval = ATH_LONG_CALINTERVAL;
+       if (sc->sc_ah->ah_config.enable_ani)
+               cal_interval = min(cal_interval, (u32)ATH_ANI_POLLINTERVAL);
        if (!sc->sc_ani.sc_caldone)
                cal_interval = min(cal_interval, (u32)ATH_SHORT_CALINTERVAL);