aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath9k/main.c
diff options
context:
space:
mode:
authorSujith <Sujith.Manoharan@atheros.com>2009-04-13 12:26:46 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-04-22 16:54:46 -0400
commit415f738ecf41b427921b503ecfd427e26f89dc23 (patch)
tree712498294556a2089a3151c009ca9968baba6913 /drivers/net/wireless/ath/ath9k/main.c
parenta451aa66dcb14efcb7addf1d8edcac8df76a97b6 (diff)
ath9k: Initialize ANI timers
The various ANI timers have to be initialized properly when starting the calibration timer. Cc: stable@kernel.org Signed-off-by: Sujith <Sujith.Manoharan@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.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index b2d129f50339..9564b73ded51 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -407,6 +407,18 @@ set_timer:
407 mod_timer(&sc->ani.timer, jiffies + msecs_to_jiffies(cal_interval)); 407 mod_timer(&sc->ani.timer, jiffies + msecs_to_jiffies(cal_interval));
408} 408}
409 409
410static void ath_start_ani(struct ath_softc *sc)
411{
412 unsigned long timestamp = jiffies_to_msecs(jiffies);
413
414 sc->ani.longcal_timer = timestamp;
415 sc->ani.shortcal_timer = timestamp;
416 sc->ani.checkani_timer = timestamp;
417
418 mod_timer(&sc->ani.timer,
419 jiffies + msecs_to_jiffies(ATH_ANI_POLLINTERVAL));
420}
421
410/* 422/*
411 * Update tx/rx chainmask. For legacy association, 423 * Update tx/rx chainmask. For legacy association,
412 * hard code chainmask to 1x1, for 11n association, use 424 * hard code chainmask to 1x1, for 11n association, use
@@ -911,9 +923,7 @@ static void ath9k_bss_assoc_info(struct ath_softc *sc,
911 sc->nodestats.ns_avgtxrssi = ATH_RSSI_DUMMY_MARKER; 923 sc->nodestats.ns_avgtxrssi = ATH_RSSI_DUMMY_MARKER;
912 sc->nodestats.ns_avgtxrate = ATH_RATE_DUMMY_MARKER; 924 sc->nodestats.ns_avgtxrate = ATH_RATE_DUMMY_MARKER;
913 925
914 /* Start ANI */ 926 ath_start_ani(sc);
915 mod_timer(&sc->ani.timer,
916 jiffies + msecs_to_jiffies(ATH_ANI_POLLINTERVAL));
917 } else { 927 } else {
918 DPRINTF(sc, ATH_DBG_CONFIG, "Bss Info DISASSOC\n"); 928 DPRINTF(sc, ATH_DBG_CONFIG, "Bss Info DISASSOC\n");
919 sc->curaid = 0; 929 sc->curaid = 0;
@@ -2239,12 +2249,8 @@ static int ath9k_add_interface(struct ieee80211_hw *hw,
2239 2249
2240 ath9k_hw_set_interrupts(sc->sc_ah, sc->imask); 2250 ath9k_hw_set_interrupts(sc->sc_ah, sc->imask);
2241 2251
2242 if (conf->type == NL80211_IFTYPE_AP) { 2252 if (conf->type == NL80211_IFTYPE_AP)
2243 /* TODO: is this a suitable place to start ANI for AP mode? */ 2253 ath_start_ani(sc);
2244 /* Start ANI */
2245 mod_timer(&sc->ani.timer,
2246 jiffies + msecs_to_jiffies(ATH_ANI_POLLINTERVAL));
2247 }
2248 2254
2249out: 2255out:
2250 mutex_unlock(&sc->mutex); 2256 mutex_unlock(&sc->mutex);