diff options
Diffstat (limited to 'drivers/net/wireless/ath9k/beacon.c')
-rw-r--r-- | drivers/net/wireless/ath9k/beacon.c | 77 |
1 files changed, 35 insertions, 42 deletions
diff --git a/drivers/net/wireless/ath9k/beacon.c b/drivers/net/wireless/ath9k/beacon.c index e80d9b9b61a..88fbfe5bb7b 100644 --- a/drivers/net/wireless/ath9k/beacon.c +++ b/drivers/net/wireless/ath9k/beacon.c | |||
@@ -41,8 +41,7 @@ static int ath_beaconq_config(struct ath_softc *sc) | |||
41 | 41 | ||
42 | if (!ath9k_hw_set_txq_props(ah, sc->sc_bhalq, &qi)) { | 42 | if (!ath9k_hw_set_txq_props(ah, sc->sc_bhalq, &qi)) { |
43 | DPRINTF(sc, ATH_DBG_FATAL, | 43 | DPRINTF(sc, ATH_DBG_FATAL, |
44 | "%s: unable to update h/w beacon queue parameters\n", | 44 | "unable to update h/w beacon queue parameters\n"); |
45 | __func__); | ||
46 | return 0; | 45 | return 0; |
47 | } else { | 46 | } else { |
48 | ath9k_hw_resettxqueue(ah, sc->sc_bhalq); /* push to h/w */ | 47 | ath9k_hw_resettxqueue(ah, sc->sc_bhalq); /* push to h/w */ |
@@ -53,8 +52,8 @@ static int ath_beaconq_config(struct ath_softc *sc) | |||
53 | static void ath_bstuck_process(struct ath_softc *sc) | 52 | static void ath_bstuck_process(struct ath_softc *sc) |
54 | { | 53 | { |
55 | DPRINTF(sc, ATH_DBG_BEACON, | 54 | DPRINTF(sc, ATH_DBG_BEACON, |
56 | "%s: stuck beacon; resetting (bmiss count %u)\n", | 55 | "stuck beacon; resetting (bmiss count %u)\n", |
57 | __func__, sc->sc_bmisscount); | 56 | sc->sc_bmisscount); |
58 | ath_reset(sc, false); | 57 | ath_reset(sc, false); |
59 | } | 58 | } |
60 | 59 | ||
@@ -76,8 +75,7 @@ static void ath_beacon_setup(struct ath_softc *sc, | |||
76 | int ctsrate = 0; | 75 | int ctsrate = 0; |
77 | int ctsduration = 0; | 76 | int ctsduration = 0; |
78 | 77 | ||
79 | DPRINTF(sc, ATH_DBG_BEACON, "%s: m %p len %u\n", | 78 | DPRINTF(sc, ATH_DBG_BEACON, "m %p len %u\n", skb, skb->len); |
80 | __func__, skb, skb->len); | ||
81 | 79 | ||
82 | /* setup descriptors */ | 80 | /* setup descriptors */ |
83 | ds = bf->bf_desc; | 81 | ds = bf->bf_desc; |
@@ -158,8 +156,8 @@ static struct ath_buf *ath_beacon_generate(struct ath_softc *sc, int if_id) | |||
158 | cabq = sc->sc_cabq; | 156 | cabq = sc->sc_cabq; |
159 | 157 | ||
160 | if (avp->av_bcbuf == NULL) { | 158 | if (avp->av_bcbuf == NULL) { |
161 | DPRINTF(sc, ATH_DBG_BEACON, "%s: avp=%p av_bcbuf=%p\n", | 159 | DPRINTF(sc, ATH_DBG_BEACON, "avp=%p av_bcbuf=%p\n", |
162 | __func__, avp, avp->av_bcbuf); | 160 | avp, avp->av_bcbuf); |
163 | return NULL; | 161 | return NULL; |
164 | } | 162 | } |
165 | 163 | ||
@@ -216,7 +214,7 @@ static struct ath_buf *ath_beacon_generate(struct ath_softc *sc, int if_id) | |||
216 | if (sc->sc_nvaps > 1) { | 214 | if (sc->sc_nvaps > 1) { |
217 | ath_tx_draintxq(sc, cabq, false); | 215 | ath_tx_draintxq(sc, cabq, false); |
218 | DPRINTF(sc, ATH_DBG_BEACON, | 216 | DPRINTF(sc, ATH_DBG_BEACON, |
219 | "%s: flush previous cabq traffic\n", __func__); | 217 | "flush previous cabq traffic\n"); |
220 | } | 218 | } |
221 | } | 219 | } |
222 | 220 | ||
@@ -253,8 +251,8 @@ static void ath_beacon_start_adhoc(struct ath_softc *sc, int if_id) | |||
253 | avp = (void *)vif->drv_priv; | 251 | avp = (void *)vif->drv_priv; |
254 | 252 | ||
255 | if (avp->av_bcbuf == NULL) { | 253 | if (avp->av_bcbuf == NULL) { |
256 | DPRINTF(sc, ATH_DBG_BEACON, "%s: avp=%p av_bcbuf=%p\n", | 254 | DPRINTF(sc, ATH_DBG_BEACON, "avp=%p av_bcbuf=%p\n", |
257 | __func__, avp, avp != NULL ? avp->av_bcbuf : NULL); | 255 | avp, avp != NULL ? avp->av_bcbuf : NULL); |
258 | return; | 256 | return; |
259 | } | 257 | } |
260 | bf = avp->av_bcbuf; | 258 | bf = avp->av_bcbuf; |
@@ -266,7 +264,7 @@ static void ath_beacon_start_adhoc(struct ath_softc *sc, int if_id) | |||
266 | /* NB: caller is known to have already stopped tx dma */ | 264 | /* NB: caller is known to have already stopped tx dma */ |
267 | ath9k_hw_puttxbuf(ah, sc->sc_bhalq, bf->bf_daddr); | 265 | ath9k_hw_puttxbuf(ah, sc->sc_bhalq, bf->bf_daddr); |
268 | ath9k_hw_txstart(ah, sc->sc_bhalq); | 266 | ath9k_hw_txstart(ah, sc->sc_bhalq); |
269 | DPRINTF(sc, ATH_DBG_BEACON, "%s: TXDP%u = %llx (%p)\n", __func__, | 267 | DPRINTF(sc, ATH_DBG_BEACON, "TXDP%u = %llx (%p)\n", |
270 | sc->sc_bhalq, ito64(bf->bf_daddr), bf->bf_desc); | 268 | sc->sc_bhalq, ito64(bf->bf_daddr), bf->bf_desc); |
271 | } | 269 | } |
272 | 270 | ||
@@ -351,8 +349,7 @@ int ath_beacon_alloc(struct ath_softc *sc, int if_id) | |||
351 | */ | 349 | */ |
352 | skb = ieee80211_beacon_get(sc->hw, vif); | 350 | skb = ieee80211_beacon_get(sc->hw, vif); |
353 | if (skb == NULL) { | 351 | if (skb == NULL) { |
354 | DPRINTF(sc, ATH_DBG_BEACON, "%s: cannot get skb\n", | 352 | DPRINTF(sc, ATH_DBG_BEACON, "cannot get skb\n"); |
355 | __func__); | ||
356 | return -ENOMEM; | 353 | return -ENOMEM; |
357 | } | 354 | } |
358 | 355 | ||
@@ -388,8 +385,7 @@ int ath_beacon_alloc(struct ath_softc *sc, int if_id) | |||
388 | val = cpu_to_le64(tsfadjust << 10); /* TU->TSF */ | 385 | val = cpu_to_le64(tsfadjust << 10); /* TU->TSF */ |
389 | 386 | ||
390 | DPRINTF(sc, ATH_DBG_BEACON, | 387 | DPRINTF(sc, ATH_DBG_BEACON, |
391 | "%s: %s beacons, bslot %d intval %u tsfadjust %llu\n", | 388 | "stagger beacons, bslot %d intval %u tsfadjust %llu\n", |
392 | __func__, "stagger", | ||
393 | avp->av_bslot, intval, (unsigned long long)tsfadjust); | 389 | avp->av_bslot, intval, (unsigned long long)tsfadjust); |
394 | 390 | ||
395 | hdr = (struct ieee80211_hdr *)skb->data; | 391 | hdr = (struct ieee80211_hdr *)skb->data; |
@@ -468,40 +464,39 @@ void ath9k_beacon_tasklet(unsigned long data) | |||
468 | if (sc->sc_bmisscount < BSTUCK_THRESH) { | 464 | if (sc->sc_bmisscount < BSTUCK_THRESH) { |
469 | if (sc->sc_flags & SC_OP_NO_RESET) { | 465 | if (sc->sc_flags & SC_OP_NO_RESET) { |
470 | DPRINTF(sc, ATH_DBG_BEACON, | 466 | DPRINTF(sc, ATH_DBG_BEACON, |
471 | "%s: missed %u consecutive beacons\n", | 467 | "missed %u consecutive beacons\n", |
472 | __func__, sc->sc_bmisscount); | 468 | sc->sc_bmisscount); |
473 | if (show_cycles) { | 469 | if (show_cycles) { |
474 | /* | 470 | /* |
475 | * Display cycle counter stats from HW | 471 | * Display cycle counter stats from HW |
476 | * to aide in debug of stickiness. | 472 | * to aide in debug of stickiness. |
477 | */ | 473 | */ |
478 | DPRINTF(sc, ATH_DBG_BEACON, | 474 | DPRINTF(sc, ATH_DBG_BEACON, |
479 | "%s: busy times: rx_clear=%d, " | 475 | "busy times: rx_clear=%d, " |
480 | "rx_frame=%d, tx_frame=%d\n", | 476 | "rx_frame=%d, tx_frame=%d\n", |
481 | __func__, rx_clear, rx_frame, | 477 | rx_clear, rx_frame, |
482 | tx_frame); | 478 | tx_frame); |
483 | } else { | 479 | } else { |
484 | DPRINTF(sc, ATH_DBG_BEACON, | 480 | DPRINTF(sc, ATH_DBG_BEACON, |
485 | "%s: unable to obtain " | 481 | "unable to obtain " |
486 | "busy times\n", __func__); | 482 | "busy times\n"); |
487 | } | 483 | } |
488 | } else { | 484 | } else { |
489 | DPRINTF(sc, ATH_DBG_BEACON, | 485 | DPRINTF(sc, ATH_DBG_BEACON, |
490 | "%s: missed %u consecutive beacons\n", | 486 | "missed %u consecutive beacons\n", |
491 | __func__, sc->sc_bmisscount); | 487 | sc->sc_bmisscount); |
492 | } | 488 | } |
493 | } else if (sc->sc_bmisscount >= BSTUCK_THRESH) { | 489 | } else if (sc->sc_bmisscount >= BSTUCK_THRESH) { |
494 | if (sc->sc_flags & SC_OP_NO_RESET) { | 490 | if (sc->sc_flags & SC_OP_NO_RESET) { |
495 | if (sc->sc_bmisscount == BSTUCK_THRESH) { | 491 | if (sc->sc_bmisscount == BSTUCK_THRESH) { |
496 | DPRINTF(sc, ATH_DBG_BEACON, | 492 | DPRINTF(sc, ATH_DBG_BEACON, |
497 | "%s: beacon is officially " | 493 | "beacon is officially " |
498 | "stuck\n", __func__); | 494 | "stuck\n"); |
499 | ath9k_hw_dmaRegDump(ah); | 495 | ath9k_hw_dmaRegDump(ah); |
500 | } | 496 | } |
501 | } else { | 497 | } else { |
502 | DPRINTF(sc, ATH_DBG_BEACON, | 498 | DPRINTF(sc, ATH_DBG_BEACON, |
503 | "%s: beacon is officially stuck\n", | 499 | "beacon is officially stuck\n"); |
504 | __func__); | ||
505 | ath_bstuck_process(sc); | 500 | ath_bstuck_process(sc); |
506 | } | 501 | } |
507 | } | 502 | } |
@@ -511,12 +506,12 @@ void ath9k_beacon_tasklet(unsigned long data) | |||
511 | if (sc->sc_bmisscount != 0) { | 506 | if (sc->sc_bmisscount != 0) { |
512 | if (sc->sc_flags & SC_OP_NO_RESET) { | 507 | if (sc->sc_flags & SC_OP_NO_RESET) { |
513 | DPRINTF(sc, ATH_DBG_BEACON, | 508 | DPRINTF(sc, ATH_DBG_BEACON, |
514 | "%s: resume beacon xmit after %u misses\n", | 509 | "resume beacon xmit after %u misses\n", |
515 | __func__, sc->sc_bmisscount); | 510 | sc->sc_bmisscount); |
516 | } else { | 511 | } else { |
517 | DPRINTF(sc, ATH_DBG_BEACON, | 512 | DPRINTF(sc, ATH_DBG_BEACON, |
518 | "%s: resume beacon xmit after %u misses\n", | 513 | "resume beacon xmit after %u misses\n", |
519 | __func__, sc->sc_bmisscount); | 514 | sc->sc_bmisscount); |
520 | } | 515 | } |
521 | sc->sc_bmisscount = 0; | 516 | sc->sc_bmisscount = 0; |
522 | } | 517 | } |
@@ -536,8 +531,8 @@ void ath9k_beacon_tasklet(unsigned long data) | |||
536 | if_id = sc->sc_bslot[(slot + 1) % ATH_BCBUF]; | 531 | if_id = sc->sc_bslot[(slot + 1) % ATH_BCBUF]; |
537 | 532 | ||
538 | DPRINTF(sc, ATH_DBG_BEACON, | 533 | DPRINTF(sc, ATH_DBG_BEACON, |
539 | "%s: slot %d [tsf %llu tsftu %u intval %u] if_id %d\n", | 534 | "slot %d [tsf %llu tsftu %u intval %u] if_id %d\n", |
540 | __func__, slot, (unsigned long long)tsf, tsftu, | 535 | slot, (unsigned long long)tsf, tsftu, |
541 | intval, if_id); | 536 | intval, if_id); |
542 | 537 | ||
543 | bfaddr = 0; | 538 | bfaddr = 0; |
@@ -580,8 +575,7 @@ void ath9k_beacon_tasklet(unsigned long data) | |||
580 | */ | 575 | */ |
581 | if (!ath9k_hw_stoptxdma(ah, sc->sc_bhalq)) { | 576 | if (!ath9k_hw_stoptxdma(ah, sc->sc_bhalq)) { |
582 | DPRINTF(sc, ATH_DBG_FATAL, | 577 | DPRINTF(sc, ATH_DBG_FATAL, |
583 | "%s: beacon queue %u did not stop?\n", | 578 | "beacon queue %u did not stop?\n", sc->sc_bhalq); |
584 | __func__, sc->sc_bhalq); | ||
585 | /* NB: the HAL still stops DMA, so proceed */ | 579 | /* NB: the HAL still stops DMA, so proceed */ |
586 | } | 580 | } |
587 | 581 | ||
@@ -658,8 +652,8 @@ void ath_beacon_config(struct ath_softc *sc, int if_id) | |||
658 | else if (intval) /* NB: can be 0 for monitor mode */ | 652 | else if (intval) /* NB: can be 0 for monitor mode */ |
659 | nexttbtt = roundup(nexttbtt, intval); | 653 | nexttbtt = roundup(nexttbtt, intval); |
660 | 654 | ||
661 | DPRINTF(sc, ATH_DBG_BEACON, "%s: nexttbtt %u intval %u (%u)\n", | 655 | DPRINTF(sc, ATH_DBG_BEACON, "nexttbtt %u intval %u (%u)\n", |
662 | __func__, nexttbtt, intval, conf.beacon_interval); | 656 | nexttbtt, intval, conf.beacon_interval); |
663 | 657 | ||
664 | /* Check for ATH9K_M_HOSTAP and sc_nostabeacons for WDS client */ | 658 | /* Check for ATH9K_M_HOSTAP and sc_nostabeacons for WDS client */ |
665 | if (sc->sc_ah->ah_opmode == ATH9K_M_STA) { | 659 | if (sc->sc_ah->ah_opmode == ATH9K_M_STA) { |
@@ -746,7 +740,7 @@ void ath_beacon_config(struct ath_softc *sc, int if_id) | |||
746 | bs.bs_sleepduration = bs.bs_dtimperiod; | 740 | bs.bs_sleepduration = bs.bs_dtimperiod; |
747 | 741 | ||
748 | DPRINTF(sc, ATH_DBG_BEACON, | 742 | DPRINTF(sc, ATH_DBG_BEACON, |
749 | "%s: tsf %llu " | 743 | "tsf %llu " |
750 | "tsf:tu %u " | 744 | "tsf:tu %u " |
751 | "intval %u " | 745 | "intval %u " |
752 | "nexttbtt %u " | 746 | "nexttbtt %u " |
@@ -758,7 +752,6 @@ void ath_beacon_config(struct ath_softc *sc, int if_id) | |||
758 | "maxdur %u " | 752 | "maxdur %u " |
759 | "next %u " | 753 | "next %u " |
760 | "timoffset %u\n", | 754 | "timoffset %u\n", |
761 | __func__, | ||
762 | (unsigned long long)tsf, tsftu, | 755 | (unsigned long long)tsf, tsftu, |
763 | bs.bs_intval, | 756 | bs.bs_intval, |
764 | bs.bs_nexttbtt, | 757 | bs.bs_nexttbtt, |
@@ -798,8 +791,8 @@ void ath_beacon_config(struct ath_softc *sc, int if_id) | |||
798 | } | 791 | } |
799 | #undef FUDGE | 792 | #undef FUDGE |
800 | DPRINTF(sc, ATH_DBG_BEACON, | 793 | DPRINTF(sc, ATH_DBG_BEACON, |
801 | "%s: IBSS nexttbtt %u intval %u (%u)\n", | 794 | "IBSS nexttbtt %u intval %u (%u)\n", |
802 | __func__, nexttbtt, | 795 | nexttbtt, |
803 | intval & ~ATH9K_BEACON_RESET_TSF, | 796 | intval & ~ATH9K_BEACON_RESET_TSF, |
804 | conf.beacon_interval); | 797 | conf.beacon_interval); |
805 | 798 | ||