aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath9k/beacon.c
diff options
context:
space:
mode:
authorSujith <Sujith.Manoharan@atheros.com>2009-03-02 23:46:53 -0500
committerJohn W. Linville <linville@tuxdriver.com>2009-03-05 14:39:41 -0500
commit9546aae0863c12a3d00b1ed5cbd316520733200b (patch)
treeb8984d25a39e44a9681851e324f85c6963dd8798 /drivers/net/wireless/ath9k/beacon.c
parent9fc9ab0a6929c9f137747df0ecf294e9582607f9 (diff)
ath9k: Cleanup beacon stuck processing
We never use SC_OP_NO_RESET, it is not configurable at all. Remove all code that deals with this flag and make beacon stuck processing simple. Signed-off-by: Sujith <Sujith.Manoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath9k/beacon.c')
-rw-r--r--drivers/net/wireless/ath9k/beacon.c83
1 files changed, 14 insertions, 69 deletions
diff --git a/drivers/net/wireless/ath9k/beacon.c b/drivers/net/wireless/ath9k/beacon.c
index c3044891a935..349904c761e4 100644
--- a/drivers/net/wireless/ath9k/beacon.c
+++ b/drivers/net/wireless/ath9k/beacon.c
@@ -49,13 +49,6 @@ static int ath_beaconq_config(struct ath_softc *sc)
49 } 49 }
50} 50}
51 51
52static void ath_bstuck_process(struct ath_softc *sc)
53{
54 DPRINTF(sc, ATH_DBG_BEACON, "stuck beacon; resetting (bmiss count %u)\n",
55 sc->beacon.bmisscnt);
56 ath_reset(sc, false);
57}
58
59/* 52/*
60 * Associates the beacon frame buffer with a transmit descriptor. Will set 53 * Associates the beacon frame buffer with a transmit descriptor. Will set
61 * up all required antenna switch parameters, rate codes, and channel flags. 54 * up all required antenna switch parameters, rate codes, and channel flags.
@@ -401,83 +394,37 @@ void ath_beacon_tasklet(unsigned long data)
401 struct ath_hw *ah = sc->sc_ah; 394 struct ath_hw *ah = sc->sc_ah;
402 struct ath_buf *bf = NULL; 395 struct ath_buf *bf = NULL;
403 int slot, if_id; 396 int slot, if_id;
404 u32 bfaddr, show_cycles = 0, bc = 0, tsftu; 397 u32 bfaddr, bc = 0, tsftu;
405 u32 rx_clear = 0, rx_frame = 0, tx_frame = 0;
406 u64 tsf; 398 u64 tsf;
407 u16 intval; 399 u16 intval;
408 400
409 if (sc->sc_flags & SC_OP_NO_RESET) {
410 show_cycles = ath9k_hw_GetMibCycleCountsPct(ah,
411 &rx_clear, &rx_frame, &tx_frame);
412 }
413
414 /* 401 /*
415 * Check if the previous beacon has gone out. If 402 * Check if the previous beacon has gone out. If
416 * not don't try to post another, skip this period 403 * not don't try to post another, skip this period
417 * and wait for the next. Missed beacons indicate 404 * and wait for the next. Missed beacons indicate
418 * a problem and should not occur. If we miss too 405 * a problem and should not occur. If we miss too
419 * many consecutive beacons reset the device. 406 * many consecutive beacons reset the device.
420 *
421 * FIXME: Clean up this mess !!
422 */ 407 */
423 if (ath9k_hw_numtxpending(ah, sc->beacon.beaconq) != 0) { 408 if (ath9k_hw_numtxpending(ah, sc->beacon.beaconq) != 0) {
424 sc->beacon.bmisscnt++; 409 sc->beacon.bmisscnt++;
425 /* XXX: doth needs the chanchange IE countdown decremented. 410
426 * We should consider adding a mac80211 call to indicate
427 * a beacon miss so appropriate action could be taken
428 * (in that layer).
429 */
430 if (sc->beacon.bmisscnt < BSTUCK_THRESH) { 411 if (sc->beacon.bmisscnt < BSTUCK_THRESH) {
431 if (sc->sc_flags & SC_OP_NO_RESET) { 412 DPRINTF(sc, ATH_DBG_BEACON,
432 DPRINTF(sc, ATH_DBG_BEACON, 413 "missed %u consecutive beacons\n",
433 "missed %u consecutive beacons\n", 414 sc->beacon.bmisscnt);
434 sc->beacon.bmisscnt);
435 if (show_cycles) {
436 /*
437 * Display cycle counter stats from HW
438 * to aide in debug of stickiness.
439 */
440 DPRINTF(sc, ATH_DBG_BEACON,
441 "busy times: rx_clear=%d, "
442 "rx_frame=%d, tx_frame=%d\n",
443 rx_clear, rx_frame,
444 tx_frame);
445 } else {
446 DPRINTF(sc, ATH_DBG_BEACON,
447 "unable to obtain "
448 "busy times\n");
449 }
450 } else {
451 DPRINTF(sc, ATH_DBG_BEACON,
452 "missed %u consecutive beacons\n",
453 sc->beacon.bmisscnt);
454 }
455 } else if (sc->beacon.bmisscnt >= BSTUCK_THRESH) { 415 } else if (sc->beacon.bmisscnt >= BSTUCK_THRESH) {
456 if (sc->sc_flags & SC_OP_NO_RESET) { 416 DPRINTF(sc, ATH_DBG_BEACON,
457 if (sc->beacon.bmisscnt == BSTUCK_THRESH) { 417 "beacon is officially stuck\n");
458 DPRINTF(sc, ATH_DBG_BEACON, 418 ath_reset(sc, false);
459 "beacon is officially "
460 "stuck\n");
461 }
462 } else {
463 DPRINTF(sc, ATH_DBG_BEACON,
464 "beacon is officially stuck\n");
465 ath_bstuck_process(sc);
466 }
467 } 419 }
420
468 return; 421 return;
469 } 422 }
470 423
471 if (sc->beacon.bmisscnt != 0) { 424 if (sc->beacon.bmisscnt != 0) {
472 if (sc->sc_flags & SC_OP_NO_RESET) { 425 DPRINTF(sc, ATH_DBG_BEACON,
473 DPRINTF(sc, ATH_DBG_BEACON, 426 "resume beacon xmit after %u misses\n",
474 "resume beacon xmit after %u misses\n", 427 sc->beacon.bmisscnt);
475 sc->beacon.bmisscnt);
476 } else {
477 DPRINTF(sc, ATH_DBG_BEACON,
478 "resume beacon xmit after %u misses\n",
479 sc->beacon.bmisscnt);
480 }
481 sc->beacon.bmisscnt = 0; 428 sc->beacon.bmisscnt = 0;
482 } 429 }
483 430
@@ -497,8 +444,7 @@ void ath_beacon_tasklet(unsigned long data)
497 444
498 DPRINTF(sc, ATH_DBG_BEACON, 445 DPRINTF(sc, ATH_DBG_BEACON,
499 "slot %d [tsf %llu tsftu %u intval %u] if_id %d\n", 446 "slot %d [tsf %llu tsftu %u intval %u] if_id %d\n",
500 slot, (unsigned long long)tsf, tsftu, 447 slot, tsf, tsftu, intval, if_id);
501 intval, if_id);
502 448
503 bfaddr = 0; 449 bfaddr = 0;
504 if (if_id != ATH_IF_ID_ANY) { 450 if (if_id != ATH_IF_ID_ANY) {
@@ -508,6 +454,7 @@ void ath_beacon_tasklet(unsigned long data)
508 bc = 1; 454 bc = 1;
509 } 455 }
510 } 456 }
457
511 /* 458 /*
512 * Handle slot time change when a non-ERP station joins/leaves 459 * Handle slot time change when a non-ERP station joins/leaves
513 * an 11g network. The 802.11 layer notifies us via callback, 460 * an 11g network. The 802.11 layer notifies us via callback,
@@ -524,7 +471,6 @@ void ath_beacon_tasklet(unsigned long data)
524 * interval has passed. When bursting slot is always left 471 * interval has passed. When bursting slot is always left
525 * set to ATH_BCBUF so this check is a noop. 472 * set to ATH_BCBUF so this check is a noop.
526 */ 473 */
527 /* XXX locking */
528 if (sc->beacon.updateslot == UPDATE) { 474 if (sc->beacon.updateslot == UPDATE) {
529 sc->beacon.updateslot = COMMIT; /* commit next beacon */ 475 sc->beacon.updateslot = COMMIT; /* commit next beacon */
530 sc->beacon.slotupdate = slot; 476 sc->beacon.slotupdate = slot;
@@ -541,7 +487,6 @@ void ath_beacon_tasklet(unsigned long data)
541 if (!ath9k_hw_stoptxdma(ah, sc->beacon.beaconq)) { 487 if (!ath9k_hw_stoptxdma(ah, sc->beacon.beaconq)) {
542 DPRINTF(sc, ATH_DBG_FATAL, 488 DPRINTF(sc, ATH_DBG_FATAL,
543 "beacon queue %u did not stop?\n", sc->beacon.beaconq); 489 "beacon queue %u did not stop?\n", sc->beacon.beaconq);
544 /* NB: the HAL still stops DMA, so proceed */
545 } 490 }
546 491
547 /* NB: cabq traffic should already be queued and primed */ 492 /* NB: cabq traffic should already be queued and primed */