if_ath_tx.c (233897) | if_ath_tx.c (233908) |
---|---|
1/*- 2 * Copyright (c) 2002-2009 Sam Leffler, Errno Consulting 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 14 unchanged lines hidden (view full) --- 23 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 25 * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 26 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 27 * THE POSSIBILITY OF SUCH DAMAGES. 28 */ 29 30#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2002-2009 Sam Leffler, Errno Consulting 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 14 unchanged lines hidden (view full) --- 23 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 25 * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 26 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 27 * THE POSSIBILITY OF SUCH DAMAGES. 28 */ 29 30#include <sys/cdefs.h> |
31__FBSDID("$FreeBSD: head/sys/dev/ath/if_ath_tx.c 233897 2012-04-04 22:22:50Z adrian $"); | 31__FBSDID("$FreeBSD: head/sys/dev/ath/if_ath_tx.c 233908 2012-04-04 23:45:15Z adrian $"); |
32 33/* 34 * Driver for the Atheros Wireless LAN controller. 35 * 36 * This software is derived from work of Atsushi Onoe; his contribution 37 * is greatly appreciated. 38 */ 39 --- 2553 unchanged lines hidden (view full) --- 2593 * on it. 2594 * 2595 * Since this is also called from upper layers as well as the driver, 2596 * it will get the TID lock. 2597 */ 2598static void 2599ath_tx_tid_pause(struct ath_softc *sc, struct ath_tid *tid) 2600{ | 32 33/* 34 * Driver for the Atheros Wireless LAN controller. 35 * 36 * This software is derived from work of Atsushi Onoe; his contribution 37 * is greatly appreciated. 38 */ 39 --- 2553 unchanged lines hidden (view full) --- 2593 * on it. 2594 * 2595 * Since this is also called from upper layers as well as the driver, 2596 * it will get the TID lock. 2597 */ 2598static void 2599ath_tx_tid_pause(struct ath_softc *sc, struct ath_tid *tid) 2600{ |
2601 ATH_TXQ_LOCK(sc->sc_ac2q[tid->ac]); | 2601 2602 ATH_TXQ_LOCK_ASSERT(sc->sc_ac2q[tid->ac]); |
2602 tid->paused++; 2603 DPRINTF(sc, ATH_DEBUG_SW_TX_CTRL, "%s: paused = %d\n", 2604 __func__, tid->paused); | 2603 tid->paused++; 2604 DPRINTF(sc, ATH_DEBUG_SW_TX_CTRL, "%s: paused = %d\n", 2605 __func__, tid->paused); |
2605 ATH_TXQ_UNLOCK(sc->sc_ac2q[tid->ac]); | |
2606} 2607 2608/* 2609 * Unpause the current TID, and schedule it if needed. 2610 */ 2611static void 2612ath_tx_tid_resume(struct ath_softc *sc, struct ath_tid *tid) 2613{ --- 10 unchanged lines hidden (view full) --- 2624 2625 ath_tx_tid_sched(sc, tid); 2626 /* Punt some frames to the hardware if needed */ 2627 //ath_txq_sched(sc, sc->sc_ac2q[tid->ac]); 2628 taskqueue_enqueue(sc->sc_tq, &sc->sc_txqtask); 2629} 2630 2631/* | 2606} 2607 2608/* 2609 * Unpause the current TID, and schedule it if needed. 2610 */ 2611static void 2612ath_tx_tid_resume(struct ath_softc *sc, struct ath_tid *tid) 2613{ --- 10 unchanged lines hidden (view full) --- 2624 2625 ath_tx_tid_sched(sc, tid); 2626 /* Punt some frames to the hardware if needed */ 2627 //ath_txq_sched(sc, sc->sc_ac2q[tid->ac]); 2628 taskqueue_enqueue(sc->sc_tq, &sc->sc_txqtask); 2629} 2630 2631/* |
2632 * Suspend the queue because we need to TX a BAR. 2633 */ 2634static void 2635ath_tx_tid_bar_suspend(struct ath_softc *sc, struct ath_tid *tid) 2636{ 2637 ATH_TXQ_LOCK_ASSERT(sc->sc_ac2q[tid->ac]); 2638 2639 DPRINTF(sc, ATH_DEBUG_SW_TX_BAW, 2640 "%s: tid=%p, called\n", 2641 __func__, 2642 tid); 2643 2644 /* We shouldn't be called when bar_tx is 1 */ 2645 if (tid->bar_tx) { 2646 device_printf(sc->sc_dev, "%s: bar_tx is 1?!\n", 2647 __func__); 2648 } 2649 2650 /* If we've already been called, just be patient. */ 2651 if (tid->bar_wait) 2652 return; 2653 2654 /* Wait! */ 2655 tid->bar_wait = 1; 2656 2657 /* Only one pause, no matter how many frames fail */ 2658 ath_tx_tid_pause(sc, tid); 2659} 2660 2661/* 2662 * We've finished with BAR handling - either we succeeded or 2663 * failed. Either way, unsuspend TX. 2664 */ 2665static void 2666ath_tx_tid_bar_unsuspend(struct ath_softc *sc, struct ath_tid *tid) 2667{ 2668 ATH_TXQ_LOCK_ASSERT(sc->sc_ac2q[tid->ac]); 2669 2670 DPRINTF(sc, ATH_DEBUG_SW_TX_BAW, 2671 "%s: tid=%p, called\n", 2672 __func__, 2673 tid); 2674 2675 if (tid->bar_tx == 0 || tid->bar_wait == 0) { 2676 device_printf(sc->sc_dev, "%s: bar_tx=%d, bar_wait=%d: ?\n", 2677 __func__, tid->bar_tx, tid->bar_wait); 2678 } 2679 2680 tid->bar_tx = tid->bar_wait = 0; 2681 ath_tx_tid_resume(sc, tid); 2682} 2683 2684/* 2685 * Return whether we're ready to TX a BAR frame. 2686 * 2687 * Requires the TID lock be held. 2688 */ 2689static int 2690ath_tx_tid_bar_tx_ready(struct ath_softc *sc, struct ath_tid *tid) 2691{ 2692 2693 ATH_TXQ_LOCK_ASSERT(sc->sc_ac2q[tid->ac]); 2694 2695 if (tid->bar_wait == 0 || tid->hwq_depth > 0) 2696 return (0); 2697 2698 return (1); 2699} 2700 2701/* 2702 * Check whether the current TID is ready to have a BAR 2703 * TXed and if so, do the TX. 2704 * 2705 * Since the TID/TXQ lock can't be held during a call to 2706 * ieee80211_send_bar(), we have to do the dirty thing of unlocking it, 2707 * sending the BAR and locking it again. 2708 * 2709 * Eventually, the code to send the BAR should be broken out 2710 * from this routine so the lock doesn't have to be reacquired 2711 * just to be immediately dropped by the caller. 2712 */ 2713static void 2714ath_tx_tid_bar_tx(struct ath_softc *sc, struct ath_tid *tid) 2715{ 2716 struct ieee80211_tx_ampdu *tap; 2717 2718 ATH_TXQ_LOCK_ASSERT(sc->sc_ac2q[tid->ac]); 2719 2720 DPRINTF(sc, ATH_DEBUG_SW_TX_BAW, 2721 "%s: tid=%p, called\n", 2722 __func__, 2723 tid); 2724 2725 tap = ath_tx_get_tx_tid(tid->an, tid->tid); 2726 2727 /* 2728 * This is an error condition! 2729 */ 2730 if (tid->bar_wait == 0 || tid->bar_tx == 1) { 2731 device_printf(sc->sc_dev, 2732 "%s: tid=%p, bar_tx=%d, bar_wait=%d: ?\n", 2733 __func__, 2734 tid, 2735 tid->bar_tx, 2736 tid->bar_wait); 2737 return; 2738 } 2739 2740 /* Don't do anything if we still have pending frames */ 2741 if (tid->hwq_depth > 0) { 2742 DPRINTF(sc, ATH_DEBUG_SW_TX_BAW, 2743 "%s: tid=%p, hwq_depth=%d, waiting\n", 2744 __func__, 2745 tid, 2746 tid->hwq_depth); 2747 return; 2748 } 2749 2750 /* We're now about to TX */ 2751 tid->bar_tx = 1; 2752 2753 /* 2754 * Calculate new BAW left edge, now that all frames have either 2755 * succeeded or failed. 2756 * 2757 * XXX verify this is _actually_ the valid value to begin at! 2758 */ 2759 DPRINTF(sc, ATH_DEBUG_SW_TX_BAW, 2760 "%s: tid=%p, new BAW left edge=%d\n", 2761 __func__, 2762 tid, 2763 tap->txa_start); 2764 2765 /* Try sending the BAR frame */ 2766 /* We can't hold the lock here! */ 2767 2768 ATH_TXQ_UNLOCK(sc->sc_ac2q[tid->ac]); 2769 if (ieee80211_send_bar(&tid->an->an_node, tap, tap->txa_start) == 0) { 2770 /* Success? Now we wait for notification that it's done */ 2771 ATH_TXQ_LOCK(sc->sc_ac2q[tid->ac]); 2772 return; 2773 } 2774 2775 /* Failure? For now, warn loudly and continue */ 2776 ATH_TXQ_LOCK(sc->sc_ac2q[tid->ac]); 2777 device_printf(sc->sc_dev, "%s: tid=%p, failed to TX BAR, continue!\n", 2778 __func__, tid); 2779 ath_tx_tid_bar_unsuspend(sc, tid); 2780} 2781 2782 2783/* |
|
2632 * Free any packets currently pending in the software TX queue. 2633 * 2634 * This will be called when a node is being deleted. 2635 * 2636 * It can also be called on an active node during an interface 2637 * reset or state transition. 2638 * 2639 * (From Linux/reference): --- 432 unchanged lines hidden (view full) --- 3072static void 3073ath_tx_aggr_retry_unaggr(struct ath_softc *sc, struct ath_buf *bf) 3074{ 3075 struct ieee80211_node *ni = bf->bf_node; 3076 struct ath_node *an = ATH_NODE(ni); 3077 int tid = bf->bf_state.bfs_tid; 3078 struct ath_tid *atid = &an->an_tid[tid]; 3079 struct ieee80211_tx_ampdu *tap; | 2784 * Free any packets currently pending in the software TX queue. 2785 * 2786 * This will be called when a node is being deleted. 2787 * 2788 * It can also be called on an active node during an interface 2789 * reset or state transition. 2790 * 2791 * (From Linux/reference): --- 432 unchanged lines hidden (view full) --- 3224static void 3225ath_tx_aggr_retry_unaggr(struct ath_softc *sc, struct ath_buf *bf) 3226{ 3227 struct ieee80211_node *ni = bf->bf_node; 3228 struct ath_node *an = ATH_NODE(ni); 3229 int tid = bf->bf_state.bfs_tid; 3230 struct ath_tid *atid = &an->an_tid[tid]; 3231 struct ieee80211_tx_ampdu *tap; |
3080 int txseq; | |
3081 3082 ATH_TXQ_LOCK(sc->sc_ac2q[atid->ac]); 3083 3084 tap = ath_tx_get_tx_tid(an, tid); 3085 3086 /* 3087 * If the buffer is marked as busy, we can't directly 3088 * reuse it. Instead, try to clone the buffer. --- 24 unchanged lines hidden (view full) --- 3113 ath_tx_update_baw(sc, an, atid, bf); 3114 if (! bf->bf_state.bfs_addedbaw) 3115 device_printf(sc->sc_dev, 3116 "%s: wasn't added: seqno %d\n", 3117 __func__, SEQNO(bf->bf_state.bfs_seqno)); 3118 } 3119 bf->bf_state.bfs_dobaw = 0; 3120 | 3232 3233 ATH_TXQ_LOCK(sc->sc_ac2q[atid->ac]); 3234 3235 tap = ath_tx_get_tx_tid(an, tid); 3236 3237 /* 3238 * If the buffer is marked as busy, we can't directly 3239 * reuse it. Instead, try to clone the buffer. --- 24 unchanged lines hidden (view full) --- 3264 ath_tx_update_baw(sc, an, atid, bf); 3265 if (! bf->bf_state.bfs_addedbaw) 3266 device_printf(sc->sc_dev, 3267 "%s: wasn't added: seqno %d\n", 3268 __func__, SEQNO(bf->bf_state.bfs_seqno)); 3269 } 3270 bf->bf_state.bfs_dobaw = 0; 3271 |
3121 /* Send BAR frame */ 3122 /* 3123 * This'll end up going into net80211 and back out 3124 * again, via ic->ic_raw_xmit(). 3125 */ 3126 txseq = tap->txa_start; 3127 ATH_TXQ_UNLOCK(sc->sc_ac2q[atid->ac]); | 3272 /* Suspend the TX queue and get ready to send the BAR */ 3273 ath_tx_tid_bar_suspend(sc, atid); |
3128 | 3274 |
3129 device_printf(sc->sc_dev, 3130 "%s: TID %d: send BAR; seq %d\n", __func__, tid, txseq); | 3275 /* Send the BAR if there are no other frames waiting */ 3276 if (ath_tx_tid_bar_tx_ready(sc, atid)) 3277 ath_tx_tid_bar_tx(sc, atid); |
3131 | 3278 |
3132 /* XXX TODO: send BAR */ | 3279 ATH_TXQ_UNLOCK(sc->sc_ac2q[atid->ac]); |
3133 3134 /* Free buffer, bf is free after this call */ 3135 ath_tx_default_comp(sc, bf, 0); 3136 return; 3137 } 3138 3139 /* 3140 * This increments the retry counter as well as 3141 * sets the retry flag in the ath_buf and packet 3142 * body. 3143 */ 3144 ath_tx_set_retry(sc, bf); 3145 3146 /* 3147 * Insert this at the head of the queue, so it's 3148 * retried before any current/subsequent frames. 3149 */ 3150 ATH_TXQ_INSERT_HEAD(atid, bf, bf_list); 3151 ath_tx_tid_sched(sc, atid); | 3280 3281 /* Free buffer, bf is free after this call */ 3282 ath_tx_default_comp(sc, bf, 0); 3283 return; 3284 } 3285 3286 /* 3287 * This increments the retry counter as well as 3288 * sets the retry flag in the ath_buf and packet 3289 * body. 3290 */ 3291 ath_tx_set_retry(sc, bf); 3292 3293 /* 3294 * Insert this at the head of the queue, so it's 3295 * retried before any current/subsequent frames. 3296 */ 3297 ATH_TXQ_INSERT_HEAD(atid, bf, bf_list); 3298 ath_tx_tid_sched(sc, atid); |
3299 /* Send the BAR if there are no other frames waiting */ 3300 if (ath_tx_tid_bar_tx_ready(sc, atid)) 3301 ath_tx_tid_bar_tx(sc, atid); |
|
3152 3153 ATH_TXQ_UNLOCK(sc->sc_ac2q[atid->ac]); 3154} 3155 3156/* 3157 * Common code for aggregate excessive retry/subframe retry. 3158 * If retrying, queues buffers to bf_q. If not, frees the 3159 * buffers. --- 113 unchanged lines hidden (view full) --- 3273 /* 3274 * send bar if we dropped any frames 3275 * 3276 * Keep the txq lock held for now, as we need to ensure 3277 * that ni_txseqs[] is consistent (as it's being updated 3278 * in the ifnet TX context or raw TX context.) 3279 */ 3280 if (drops) { | 3302 3303 ATH_TXQ_UNLOCK(sc->sc_ac2q[atid->ac]); 3304} 3305 3306/* 3307 * Common code for aggregate excessive retry/subframe retry. 3308 * If retrying, queues buffers to bf_q. If not, frees the 3309 * buffers. --- 113 unchanged lines hidden (view full) --- 3423 /* 3424 * send bar if we dropped any frames 3425 * 3426 * Keep the txq lock held for now, as we need to ensure 3427 * that ni_txseqs[] is consistent (as it's being updated 3428 * in the ifnet TX context or raw TX context.) 3429 */ 3430 if (drops) { |
3281 int txseq = tap->txa_start; 3282 ATH_TXQ_UNLOCK(sc->sc_ac2q[tid->ac]); 3283 device_printf(sc->sc_dev, 3284 "%s: TID %d: send BAR; seq %d\n", 3285 __func__, tid->tid, txseq); 3286 3287 /* XXX TODO: send BAR */ 3288 } else { 3289 ATH_TXQ_UNLOCK(sc->sc_ac2q[tid->ac]); | 3431 /* Suspend the TX queue and get ready to send the BAR */ 3432 ath_tx_tid_bar_suspend(sc, tid); |
3290 } 3291 | 3433 } 3434 |
3435 ATH_TXQ_UNLOCK(sc->sc_ac2q[tid->ac]); 3436 3437 /* 3438 * Send BAR if required 3439 */ 3440 ATH_TXQ_LOCK(sc->sc_ac2q[tid->ac]); 3441 if (ath_tx_tid_bar_tx_ready(sc, tid)) 3442 ath_tx_tid_bar_tx(sc, tid); 3443 ATH_TXQ_UNLOCK(sc->sc_ac2q[tid->ac]); 3444 |
|
3292 /* Complete frames which errored out */ 3293 while ((bf = TAILQ_FIRST(&bf_cq)) != NULL) { 3294 TAILQ_REMOVE(&bf_cq, bf, bf_list); 3295 ath_tx_default_comp(sc, bf, 0); 3296 } 3297} 3298 3299/* --- 23 unchanged lines hidden (view full) --- 3323 3324 if (atid->incomp == 0) { 3325 DPRINTF(sc, ATH_DEBUG_SW_TX_CTRL, 3326 "%s: TID %d: cleaned up! resume!\n", 3327 __func__, tid); 3328 atid->cleanup_inprogress = 0; 3329 ath_tx_tid_resume(sc, atid); 3330 } | 3445 /* Complete frames which errored out */ 3446 while ((bf = TAILQ_FIRST(&bf_cq)) != NULL) { 3447 TAILQ_REMOVE(&bf_cq, bf, bf_list); 3448 ath_tx_default_comp(sc, bf, 0); 3449 } 3450} 3451 3452/* --- 23 unchanged lines hidden (view full) --- 3476 3477 if (atid->incomp == 0) { 3478 DPRINTF(sc, ATH_DEBUG_SW_TX_CTRL, 3479 "%s: TID %d: cleaned up! resume!\n", 3480 __func__, tid); 3481 atid->cleanup_inprogress = 0; 3482 ath_tx_tid_resume(sc, atid); 3483 } |
3484 3485 /* Send BAR if required */ 3486 if (ath_tx_tid_bar_tx_ready(sc, atid)) 3487 ath_tx_tid_bar_tx(sc, atid); |
|
3331 ATH_TXQ_UNLOCK(sc->sc_ac2q[atid->ac]); 3332 3333 /* Handle frame completion */ 3334 while (bf) { 3335 bf_next = bf->bf_next; 3336 ath_tx_default_comp(sc, bf, 1); 3337 bf = bf_next; 3338 } --- 198 unchanged lines hidden (view full) --- 3537 if (fail == 0) 3538 ath_tx_update_ratectrl(sc, ni, rc, &ts, pktlen, nframes, 3539 nbad); 3540 3541 /* 3542 * send bar if we dropped any frames 3543 */ 3544 if (drops) { | 3488 ATH_TXQ_UNLOCK(sc->sc_ac2q[atid->ac]); 3489 3490 /* Handle frame completion */ 3491 while (bf) { 3492 bf_next = bf->bf_next; 3493 ath_tx_default_comp(sc, bf, 1); 3494 bf = bf_next; 3495 } --- 198 unchanged lines hidden (view full) --- 3694 if (fail == 0) 3695 ath_tx_update_ratectrl(sc, ni, rc, &ts, pktlen, nframes, 3696 nbad); 3697 3698 /* 3699 * send bar if we dropped any frames 3700 */ 3701 if (drops) { |
3545 device_printf(sc->sc_dev, 3546 "%s: TID %d: send BAR; seq %d\n", __func__, tid, txseq); 3547 /* XXX TODO: send BAR */ | 3702 /* Suspend the TX queue and get ready to send the BAR */ 3703 ATH_TXQ_LOCK(sc->sc_ac2q[atid->ac]); 3704 ath_tx_tid_bar_suspend(sc, atid); 3705 ATH_TXQ_UNLOCK(sc->sc_ac2q[atid->ac]); |
3548 } 3549 3550 /* Prepend all frames to the beginning of the queue */ 3551 ATH_TXQ_LOCK(sc->sc_ac2q[atid->ac]); 3552 while ((bf = TAILQ_LAST(&bf_q, ath_bufhead_s)) != NULL) { 3553 TAILQ_REMOVE(&bf_q, bf, bf_list); 3554 ATH_TXQ_INSERT_HEAD(atid, bf, bf_list); 3555 } 3556 ath_tx_tid_sched(sc, atid); 3557 ATH_TXQ_UNLOCK(sc->sc_ac2q[atid->ac]); 3558 3559 DPRINTF(sc, ATH_DEBUG_SW_TX_AGGR, 3560 "%s: txa_start now %d\n", __func__, tap->txa_start); 3561 | 3706 } 3707 3708 /* Prepend all frames to the beginning of the queue */ 3709 ATH_TXQ_LOCK(sc->sc_ac2q[atid->ac]); 3710 while ((bf = TAILQ_LAST(&bf_q, ath_bufhead_s)) != NULL) { 3711 TAILQ_REMOVE(&bf_q, bf, bf_list); 3712 ATH_TXQ_INSERT_HEAD(atid, bf, bf_list); 3713 } 3714 ath_tx_tid_sched(sc, atid); 3715 ATH_TXQ_UNLOCK(sc->sc_ac2q[atid->ac]); 3716 3717 DPRINTF(sc, ATH_DEBUG_SW_TX_AGGR, 3718 "%s: txa_start now %d\n", __func__, tap->txa_start); 3719 |
3720 /* 3721 * Send BAR if required 3722 */ 3723 ATH_TXQ_LOCK(sc->sc_ac2q[atid->ac]); 3724 if (ath_tx_tid_bar_tx_ready(sc, atid)) 3725 ath_tx_tid_bar_tx(sc, atid); 3726 ATH_TXQ_UNLOCK(sc->sc_ac2q[atid->ac]); 3727 |
|
3562 /* Do deferred completion */ 3563 while ((bf = TAILQ_FIRST(&bf_cq)) != NULL) { 3564 TAILQ_REMOVE(&bf_cq, bf, bf_list); 3565 ath_tx_default_comp(sc, bf, 0); 3566 } 3567} 3568 3569/* --- 77 unchanged lines hidden (view full) --- 3647 ath_tx_update_baw(sc, an, atid, bf); 3648 bf->bf_state.bfs_dobaw = 0; 3649 if (! bf->bf_state.bfs_addedbaw) 3650 device_printf(sc->sc_dev, 3651 "%s: wasn't added: seqno %d\n", 3652 __func__, SEQNO(bf->bf_state.bfs_seqno)); 3653 } 3654 | 3728 /* Do deferred completion */ 3729 while ((bf = TAILQ_FIRST(&bf_cq)) != NULL) { 3730 TAILQ_REMOVE(&bf_cq, bf, bf_list); 3731 ath_tx_default_comp(sc, bf, 0); 3732 } 3733} 3734 3735/* --- 77 unchanged lines hidden (view full) --- 3813 ath_tx_update_baw(sc, an, atid, bf); 3814 bf->bf_state.bfs_dobaw = 0; 3815 if (! bf->bf_state.bfs_addedbaw) 3816 device_printf(sc->sc_dev, 3817 "%s: wasn't added: seqno %d\n", 3818 __func__, SEQNO(bf->bf_state.bfs_seqno)); 3819 } 3820 |
3821 /* 3822 * Send BAR if required 3823 */ 3824 if (ath_tx_tid_bar_tx_ready(sc, atid)) 3825 ath_tx_tid_bar_tx(sc, atid); 3826 |
|
3655 ATH_TXQ_UNLOCK(sc->sc_ac2q[atid->ac]); 3656 3657 ath_tx_default_comp(sc, bf, fail); 3658 /* bf is freed at this point */ 3659} 3660 3661void 3662ath_tx_aggr_comp(struct ath_softc *sc, struct ath_buf *bf, int fail) --- 412 unchanged lines hidden (view full) --- 4075 * this can cause the initial burst of packets after the addba 4076 * negotiation to "hang", as they quickly fall outside the BAW. 4077 * 4078 * The "eventual" solution should be to tag these packets with 4079 * dobaw. Although net80211 has given us a sequence number, 4080 * it'll be "after" the left edge of the BAW and thus it'll 4081 * fall within it. 4082 */ | 3827 ATH_TXQ_UNLOCK(sc->sc_ac2q[atid->ac]); 3828 3829 ath_tx_default_comp(sc, bf, fail); 3830 /* bf is freed at this point */ 3831} 3832 3833void 3834ath_tx_aggr_comp(struct ath_softc *sc, struct ath_buf *bf, int fail) --- 412 unchanged lines hidden (view full) --- 4247 * this can cause the initial burst of packets after the addba 4248 * negotiation to "hang", as they quickly fall outside the BAW. 4249 * 4250 * The "eventual" solution should be to tag these packets with 4251 * dobaw. Although net80211 has given us a sequence number, 4252 * it'll be "after" the left edge of the BAW and thus it'll 4253 * fall within it. 4254 */ |
4255 ATH_TXQ_LOCK(sc->sc_ac2q[atid->tid]); |
|
4083 ath_tx_tid_pause(sc, atid); | 4256 ath_tx_tid_pause(sc, atid); |
4257 ATH_TXQ_UNLOCK(sc->sc_ac2q[atid->tid]); |
|
4084 4085 DPRINTF(sc, ATH_DEBUG_SW_TX_CTRL, 4086 "%s: called; dialogtoken=%d, baparamset=%d, batimeout=%d\n", 4087 __func__, dialogtoken, baparamset, batimeout); 4088 DPRINTF(sc, ATH_DEBUG_SW_TX_CTRL, 4089 "%s: txa_start=%d, ni_txseqs=%d\n", 4090 __func__, tap->txa_start, ni->ni_txseqs[tid]); 4091 --- 69 unchanged lines hidden (view full) --- 4161 struct ath_softc *sc = ni->ni_ic->ic_ifp->if_softc; 4162 int tid = WME_AC_TO_TID(tap->txa_ac); 4163 struct ath_node *an = ATH_NODE(ni); 4164 struct ath_tid *atid = &an->an_tid[tid]; 4165 4166 DPRINTF(sc, ATH_DEBUG_SW_TX_CTRL, "%s: called\n", __func__); 4167 4168 /* Pause TID traffic early, so there aren't any races */ | 4258 4259 DPRINTF(sc, ATH_DEBUG_SW_TX_CTRL, 4260 "%s: called; dialogtoken=%d, baparamset=%d, batimeout=%d\n", 4261 __func__, dialogtoken, baparamset, batimeout); 4262 DPRINTF(sc, ATH_DEBUG_SW_TX_CTRL, 4263 "%s: txa_start=%d, ni_txseqs=%d\n", 4264 __func__, tap->txa_start, ni->ni_txseqs[tid]); 4265 --- 69 unchanged lines hidden (view full) --- 4335 struct ath_softc *sc = ni->ni_ic->ic_ifp->if_softc; 4336 int tid = WME_AC_TO_TID(tap->txa_ac); 4337 struct ath_node *an = ATH_NODE(ni); 4338 struct ath_tid *atid = &an->an_tid[tid]; 4339 4340 DPRINTF(sc, ATH_DEBUG_SW_TX_CTRL, "%s: called\n", __func__); 4341 4342 /* Pause TID traffic early, so there aren't any races */ |
4343 ATH_TXQ_LOCK(sc->sc_ac2q[atid->tid]); |
|
4169 ath_tx_tid_pause(sc, atid); | 4344 ath_tx_tid_pause(sc, atid); |
4345 ATH_TXQ_UNLOCK(sc->sc_ac2q[atid->tid]); |
|
4170 4171 /* There's no need to hold the TXQ lock here */ 4172 sc->sc_addba_stop(ni, tap); 4173 4174 /* 4175 * ath_tx_cleanup will resume the TID if possible, otherwise 4176 * it'll set the cleanup flag, and it'll be unpaused once 4177 * things have been cleaned up. --- 30 unchanged lines hidden (view full) --- 4208 /* Unpause the TID */ 4209 /* 4210 * XXX if this is attempt=50, the TID will be downgraded 4211 * XXX to a non-aggregate session. So we must unpause the 4212 * XXX TID here or it'll never be done. 4213 */ 4214 if (status == 0 || attempts == 50) { 4215 ATH_TXQ_LOCK(sc->sc_ac2q[atid->ac]); | 4346 4347 /* There's no need to hold the TXQ lock here */ 4348 sc->sc_addba_stop(ni, tap); 4349 4350 /* 4351 * ath_tx_cleanup will resume the TID if possible, otherwise 4352 * it'll set the cleanup flag, and it'll be unpaused once 4353 * things have been cleaned up. --- 30 unchanged lines hidden (view full) --- 4384 /* Unpause the TID */ 4385 /* 4386 * XXX if this is attempt=50, the TID will be downgraded 4387 * XXX to a non-aggregate session. So we must unpause the 4388 * XXX TID here or it'll never be done. 4389 */ 4390 if (status == 0 || attempts == 50) { 4391 ATH_TXQ_LOCK(sc->sc_ac2q[atid->ac]); |
4216 ath_tx_tid_resume(sc, atid); | 4392 ath_tx_tid_bar_unsuspend(sc, atid); |
4217 ATH_TXQ_UNLOCK(sc->sc_ac2q[atid->ac]); 4218 } 4219} 4220 4221/* 4222 * This is called whenever the pending ADDBA request times out. 4223 * Unpause and reschedule the TID. 4224 */ --- 20 unchanged lines hidden --- | 4393 ATH_TXQ_UNLOCK(sc->sc_ac2q[atid->ac]); 4394 } 4395} 4396 4397/* 4398 * This is called whenever the pending ADDBA request times out. 4399 * Unpause and reschedule the TID. 4400 */ --- 20 unchanged lines hidden --- |