aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath9k/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/main.c')
-rw-r--r--drivers/net/wireless/ath/ath9k/main.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index c8de50fa6378..efbf53534ade 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -268,7 +268,6 @@ void ath_paprd_calibrate(struct work_struct *work)
268 int time_left; 268 int time_left;
269 int i; 269 int i;
270 270
271 ath9k_ps_wakeup(sc);
272 skb = alloc_skb(len, GFP_KERNEL); 271 skb = alloc_skb(len, GFP_KERNEL);
273 if (!skb) 272 if (!skb)
274 return; 273 return;
@@ -289,6 +288,7 @@ void ath_paprd_calibrate(struct work_struct *work)
289 qnum = sc->tx.hwq_map[WME_AC_BE]; 288 qnum = sc->tx.hwq_map[WME_AC_BE];
290 txctl.txq = &sc->tx.txq[qnum]; 289 txctl.txq = &sc->tx.txq[qnum];
291 290
291 ath9k_ps_wakeup(sc);
292 ar9003_paprd_init_table(ah); 292 ar9003_paprd_init_table(ah);
293 for (chain = 0; chain < AR9300_MAX_CHAINS; chain++) { 293 for (chain = 0; chain < AR9300_MAX_CHAINS; chain++) {
294 if (!(ah->caps.tx_chainmask & BIT(chain))) 294 if (!(ah->caps.tx_chainmask & BIT(chain)))
@@ -310,13 +310,13 @@ void ath_paprd_calibrate(struct work_struct *work)
310 break; 310 break;
311 311
312 time_left = wait_for_completion_timeout(&sc->paprd_complete, 312 time_left = wait_for_completion_timeout(&sc->paprd_complete,
313 100); 313 msecs_to_jiffies(ATH_PAPRD_TIMEOUT));
314 if (!time_left) { 314 if (!time_left) {
315 ath_print(ath9k_hw_common(ah), ATH_DBG_CALIBRATE, 315 ath_print(ath9k_hw_common(ah), ATH_DBG_CALIBRATE,
316 "Timeout waiting for paprd training on " 316 "Timeout waiting for paprd training on "
317 "TX chain %d\n", 317 "TX chain %d\n",
318 chain); 318 chain);
319 break; 319 goto fail_paprd;
320 } 320 }
321 321
322 if (!ar9003_paprd_is_done(ah)) 322 if (!ar9003_paprd_is_done(ah))
@@ -334,6 +334,7 @@ void ath_paprd_calibrate(struct work_struct *work)
334 ath_paprd_activate(sc); 334 ath_paprd_activate(sc);
335 } 335 }
336 336
337fail_paprd:
337 ath9k_ps_restore(sc); 338 ath9k_ps_restore(sc);
338} 339}
339 340
@@ -451,6 +452,10 @@ static void ath_start_ani(struct ath_common *common)
451{ 452{
452 struct ath_hw *ah = common->ah; 453 struct ath_hw *ah = common->ah;
453 unsigned long timestamp = jiffies_to_msecs(jiffies); 454 unsigned long timestamp = jiffies_to_msecs(jiffies);
455 struct ath_softc *sc = (struct ath_softc *) common->priv;
456
457 if (!(sc->sc_flags & SC_OP_ANI_RUN))
458 return;
454 459
455 common->ani.longcal_timer = timestamp; 460 common->ani.longcal_timer = timestamp;
456 common->ani.shortcal_timer = timestamp; 461 common->ani.shortcal_timer = timestamp;
@@ -766,11 +771,13 @@ static void ath9k_bss_assoc_info(struct ath_softc *sc,
766 /* Reset rssi stats */ 771 /* Reset rssi stats */
767 sc->sc_ah->stats.avgbrssi = ATH_RSSI_DUMMY_MARKER; 772 sc->sc_ah->stats.avgbrssi = ATH_RSSI_DUMMY_MARKER;
768 773
774 sc->sc_flags |= SC_OP_ANI_RUN;
769 ath_start_ani(common); 775 ath_start_ani(common);
770 } else { 776 } else {
771 ath_print(common, ATH_DBG_CONFIG, "Bss Info DISASSOC\n"); 777 ath_print(common, ATH_DBG_CONFIG, "Bss Info DISASSOC\n");
772 common->curaid = 0; 778 common->curaid = 0;
773 /* Stop ANI */ 779 /* Stop ANI */
780 sc->sc_flags &= ~SC_OP_ANI_RUN;
774 del_timer_sync(&common->ani.timer); 781 del_timer_sync(&common->ani.timer);
775 } 782 }
776} 783}
@@ -1241,7 +1248,9 @@ static void ath9k_stop(struct ieee80211_hw *hw)
1241 1248
1242 aphy->state = ATH_WIPHY_INACTIVE; 1249 aphy->state = ATH_WIPHY_INACTIVE;
1243 1250
1244 cancel_delayed_work_sync(&sc->ath_led_blink_work); 1251 if (led_blink)
1252 cancel_delayed_work_sync(&sc->ath_led_blink_work);
1253
1245 cancel_delayed_work_sync(&sc->tx_complete_work); 1254 cancel_delayed_work_sync(&sc->tx_complete_work);
1246 cancel_work_sync(&sc->paprd_work); 1255 cancel_work_sync(&sc->paprd_work);
1247 1256
@@ -1374,8 +1383,10 @@ static int ath9k_add_interface(struct ieee80211_hw *hw,
1374 1383
1375 if (vif->type == NL80211_IFTYPE_AP || 1384 if (vif->type == NL80211_IFTYPE_AP ||
1376 vif->type == NL80211_IFTYPE_ADHOC || 1385 vif->type == NL80211_IFTYPE_ADHOC ||
1377 vif->type == NL80211_IFTYPE_MONITOR) 1386 vif->type == NL80211_IFTYPE_MONITOR) {
1387 sc->sc_flags |= SC_OP_ANI_RUN;
1378 ath_start_ani(common); 1388 ath_start_ani(common);
1389 }
1379 1390
1380out: 1391out:
1381 mutex_unlock(&sc->mutex); 1392 mutex_unlock(&sc->mutex);
@@ -1396,6 +1407,7 @@ static void ath9k_remove_interface(struct ieee80211_hw *hw,
1396 mutex_lock(&sc->mutex); 1407 mutex_lock(&sc->mutex);
1397 1408
1398 /* Stop ANI */ 1409 /* Stop ANI */
1410 sc->sc_flags &= ~SC_OP_ANI_RUN;
1399 del_timer_sync(&common->ani.timer); 1411 del_timer_sync(&common->ani.timer);
1400 1412
1401 /* Reclaim beacon resources */ 1413 /* Reclaim beacon resources */