if_ath_tx.c (235461) | if_ath_tx.c (235491) |
---|---|
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 235461 2012-05-15 04:55:15Z adrian $"); | 31__FBSDID("$FreeBSD: head/sys/dev/ath/if_ath_tx.c 235491 2012-05-15 23:39:37Z 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 --- 2628 unchanged lines hidden (view full) --- 2668/* 2669 * Suspend the queue because we need to TX a BAR. 2670 */ 2671static void 2672ath_tx_tid_bar_suspend(struct ath_softc *sc, struct ath_tid *tid) 2673{ 2674 ATH_TXQ_LOCK_ASSERT(sc->sc_ac2q[tid->ac]); 2675 | 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 --- 2628 unchanged lines hidden (view full) --- 2668/* 2669 * Suspend the queue because we need to TX a BAR. 2670 */ 2671static void 2672ath_tx_tid_bar_suspend(struct ath_softc *sc, struct ath_tid *tid) 2673{ 2674 ATH_TXQ_LOCK_ASSERT(sc->sc_ac2q[tid->ac]); 2675 |
2676 DPRINTF(sc, ATH_DEBUG_SW_TX_BAW, | 2676 DPRINTF(sc, ATH_DEBUG_SW_TX_BAR, |
2677 "%s: tid=%p, called\n", 2678 __func__, 2679 tid); 2680 2681 /* We shouldn't be called when bar_tx is 1 */ 2682 if (tid->bar_tx) { 2683 device_printf(sc->sc_dev, "%s: bar_tx is 1?!\n", 2684 __func__); --- 14 unchanged lines hidden (view full) --- 2699 * We've finished with BAR handling - either we succeeded or 2700 * failed. Either way, unsuspend TX. 2701 */ 2702static void 2703ath_tx_tid_bar_unsuspend(struct ath_softc *sc, struct ath_tid *tid) 2704{ 2705 ATH_TXQ_LOCK_ASSERT(sc->sc_ac2q[tid->ac]); 2706 | 2677 "%s: tid=%p, called\n", 2678 __func__, 2679 tid); 2680 2681 /* We shouldn't be called when bar_tx is 1 */ 2682 if (tid->bar_tx) { 2683 device_printf(sc->sc_dev, "%s: bar_tx is 1?!\n", 2684 __func__); --- 14 unchanged lines hidden (view full) --- 2699 * We've finished with BAR handling - either we succeeded or 2700 * failed. Either way, unsuspend TX. 2701 */ 2702static void 2703ath_tx_tid_bar_unsuspend(struct ath_softc *sc, struct ath_tid *tid) 2704{ 2705 ATH_TXQ_LOCK_ASSERT(sc->sc_ac2q[tid->ac]); 2706 |
2707 DPRINTF(sc, ATH_DEBUG_SW_TX_BAW, | 2707 DPRINTF(sc, ATH_DEBUG_SW_TX_BAR, |
2708 "%s: tid=%p, called\n", 2709 __func__, 2710 tid); 2711 2712 if (tid->bar_tx == 0 || tid->bar_wait == 0) { 2713 device_printf(sc->sc_dev, "%s: bar_tx=%d, bar_wait=%d: ?\n", 2714 __func__, tid->bar_tx, tid->bar_wait); 2715 } --- 11 unchanged lines hidden (view full) --- 2727ath_tx_tid_bar_tx_ready(struct ath_softc *sc, struct ath_tid *tid) 2728{ 2729 2730 ATH_TXQ_LOCK_ASSERT(sc->sc_ac2q[tid->ac]); 2731 2732 if (tid->bar_wait == 0 || tid->hwq_depth > 0) 2733 return (0); 2734 | 2708 "%s: tid=%p, called\n", 2709 __func__, 2710 tid); 2711 2712 if (tid->bar_tx == 0 || tid->bar_wait == 0) { 2713 device_printf(sc->sc_dev, "%s: bar_tx=%d, bar_wait=%d: ?\n", 2714 __func__, tid->bar_tx, tid->bar_wait); 2715 } --- 11 unchanged lines hidden (view full) --- 2727ath_tx_tid_bar_tx_ready(struct ath_softc *sc, struct ath_tid *tid) 2728{ 2729 2730 ATH_TXQ_LOCK_ASSERT(sc->sc_ac2q[tid->ac]); 2731 2732 if (tid->bar_wait == 0 || tid->hwq_depth > 0) 2733 return (0); 2734 |
2735 DPRINTF(sc, ATH_DEBUG_SW_TX_BAR, "%s: tid=%p (%d), bar ready\n", 2736 __func__, tid, tid->tid); 2737 |
|
2735 return (1); 2736} 2737 2738/* 2739 * Check whether the current TID is ready to have a BAR 2740 * TXed and if so, do the TX. 2741 * 2742 * Since the TID/TXQ lock can't be held during a call to --- 6 unchanged lines hidden (view full) --- 2749 */ 2750static void 2751ath_tx_tid_bar_tx(struct ath_softc *sc, struct ath_tid *tid) 2752{ 2753 struct ieee80211_tx_ampdu *tap; 2754 2755 ATH_TXQ_LOCK_ASSERT(sc->sc_ac2q[tid->ac]); 2756 | 2738 return (1); 2739} 2740 2741/* 2742 * Check whether the current TID is ready to have a BAR 2743 * TXed and if so, do the TX. 2744 * 2745 * Since the TID/TXQ lock can't be held during a call to --- 6 unchanged lines hidden (view full) --- 2752 */ 2753static void 2754ath_tx_tid_bar_tx(struct ath_softc *sc, struct ath_tid *tid) 2755{ 2756 struct ieee80211_tx_ampdu *tap; 2757 2758 ATH_TXQ_LOCK_ASSERT(sc->sc_ac2q[tid->ac]); 2759 |
2757 DPRINTF(sc, ATH_DEBUG_SW_TX_BAW, | 2760 DPRINTF(sc, ATH_DEBUG_SW_TX_BAR, |
2758 "%s: tid=%p, called\n", 2759 __func__, 2760 tid); 2761 2762 tap = ath_tx_get_tx_tid(tid->an, tid->tid); 2763 2764 /* 2765 * This is an error condition! --- 5 unchanged lines hidden (view full) --- 2771 tid, 2772 tid->bar_tx, 2773 tid->bar_wait); 2774 return; 2775 } 2776 2777 /* Don't do anything if we still have pending frames */ 2778 if (tid->hwq_depth > 0) { | 2761 "%s: tid=%p, called\n", 2762 __func__, 2763 tid); 2764 2765 tap = ath_tx_get_tx_tid(tid->an, tid->tid); 2766 2767 /* 2768 * This is an error condition! --- 5 unchanged lines hidden (view full) --- 2774 tid, 2775 tid->bar_tx, 2776 tid->bar_wait); 2777 return; 2778 } 2779 2780 /* Don't do anything if we still have pending frames */ 2781 if (tid->hwq_depth > 0) { |
2779 DPRINTF(sc, ATH_DEBUG_SW_TX_BAW, | 2782 DPRINTF(sc, ATH_DEBUG_SW_TX_BAR, |
2780 "%s: tid=%p, hwq_depth=%d, waiting\n", 2781 __func__, 2782 tid, 2783 tid->hwq_depth); 2784 return; 2785 } 2786 2787 /* We're now about to TX */ 2788 tid->bar_tx = 1; 2789 2790 /* 2791 * Calculate new BAW left edge, now that all frames have either 2792 * succeeded or failed. 2793 * 2794 * XXX verify this is _actually_ the valid value to begin at! 2795 */ | 2783 "%s: tid=%p, hwq_depth=%d, waiting\n", 2784 __func__, 2785 tid, 2786 tid->hwq_depth); 2787 return; 2788 } 2789 2790 /* We're now about to TX */ 2791 tid->bar_tx = 1; 2792 2793 /* 2794 * Calculate new BAW left edge, now that all frames have either 2795 * succeeded or failed. 2796 * 2797 * XXX verify this is _actually_ the valid value to begin at! 2798 */ |
2796 DPRINTF(sc, ATH_DEBUG_SW_TX_BAW, | 2799 DPRINTF(sc, ATH_DEBUG_SW_TX_BAR, |
2797 "%s: tid=%p, new BAW left edge=%d\n", 2798 __func__, 2799 tid, 2800 tap->txa_start); 2801 2802 /* Try sending the BAR frame */ 2803 /* We can't hold the lock here! */ 2804 --- 55 unchanged lines hidden (view full) --- 2860 __func__, ni, bf, 2861 bf->bf_state.bfs_addedbaw, 2862 bf->bf_state.bfs_dobaw, 2863 bf->bf_state.bfs_need_seqno, 2864 bf->bf_state.bfs_seqno_assigned, 2865 SEQNO(bf->bf_state.bfs_seqno), 2866 bf->bf_state.bfs_retries); 2867 device_printf(sc->sc_dev, | 2800 "%s: tid=%p, new BAW left edge=%d\n", 2801 __func__, 2802 tid, 2803 tap->txa_start); 2804 2805 /* Try sending the BAR frame */ 2806 /* We can't hold the lock here! */ 2807 --- 55 unchanged lines hidden (view full) --- 2863 __func__, ni, bf, 2864 bf->bf_state.bfs_addedbaw, 2865 bf->bf_state.bfs_dobaw, 2866 bf->bf_state.bfs_need_seqno, 2867 bf->bf_state.bfs_seqno_assigned, 2868 SEQNO(bf->bf_state.bfs_seqno), 2869 bf->bf_state.bfs_retries); 2870 device_printf(sc->sc_dev, |
2868 "%s: node %p: bf=%p: tid txq_depth=%d hwq_depth=%d\n", | 2871 "%s: node %p: bf=%p: tid txq_depth=%d hwq_depth=%d, bar_wait=%d\n", |
2869 __func__, ni, bf, 2870 tid->axq_depth, | 2872 __func__, ni, bf, 2873 tid->axq_depth, |
2871 tid->hwq_depth); | 2874 tid->hwq_depth, 2875 tid->bar_wait); |
2872 device_printf(sc->sc_dev, 2873 "%s: node %p: bf=%p: tid %d: txq_depth=%d, " 2874 "txq_aggr_depth=%d, sched=%d, paused=%d, " 2875 "hwq_depth=%d, incomp=%d, baw_head=%d, " 2876 "baw_tail=%d txa_start=%d, ni_txseqs=%d\n", 2877 __func__, ni, bf, tid->tid, txq->axq_depth, 2878 txq->axq_aggr_depth, tid->sched, tid->paused, 2879 tid->hwq_depth, tid->incomp, tid->baw_head, --- 1555 unchanged lines hidden (view full) --- 4435 int status) 4436{ 4437 struct ath_softc *sc = ni->ni_ic->ic_ifp->if_softc; 4438 int tid = tap->txa_tid; 4439 struct ath_node *an = ATH_NODE(ni); 4440 struct ath_tid *atid = &an->an_tid[tid]; 4441 int attempts = tap->txa_attempts; 4442 | 2876 device_printf(sc->sc_dev, 2877 "%s: node %p: bf=%p: tid %d: txq_depth=%d, " 2878 "txq_aggr_depth=%d, sched=%d, paused=%d, " 2879 "hwq_depth=%d, incomp=%d, baw_head=%d, " 2880 "baw_tail=%d txa_start=%d, ni_txseqs=%d\n", 2881 __func__, ni, bf, tid->tid, txq->axq_depth, 2882 txq->axq_aggr_depth, tid->sched, tid->paused, 2883 tid->hwq_depth, tid->incomp, tid->baw_head, --- 1555 unchanged lines hidden (view full) --- 4439 int status) 4440{ 4441 struct ath_softc *sc = ni->ni_ic->ic_ifp->if_softc; 4442 int tid = tap->txa_tid; 4443 struct ath_node *an = ATH_NODE(ni); 4444 struct ath_tid *atid = &an->an_tid[tid]; 4445 int attempts = tap->txa_attempts; 4446 |
4443 DPRINTF(sc, ATH_DEBUG_SW_TX_CTRL, 4444 "%s: called; status=%d\n", __func__, status); | 4447 DPRINTF(sc, ATH_DEBUG_SW_TX_BAR, 4448 "%s: called; status=%d, attempts=%d\n", 4449 __func__, 4450 status, 4451 attempts); |
4445 4446 /* Note: This may update the BAW details */ 4447 sc->sc_bar_response(ni, tap, status); 4448 4449 /* Unpause the TID */ 4450 /* 4451 * XXX if this is attempt=50, the TID will be downgraded 4452 * XXX to a non-aggregate session. So we must unpause the --- 33 unchanged lines hidden --- | 4452 4453 /* Note: This may update the BAW details */ 4454 sc->sc_bar_response(ni, tap, status); 4455 4456 /* Unpause the TID */ 4457 /* 4458 * XXX if this is attempt=50, the TID will be downgraded 4459 * XXX to a non-aggregate session. So we must unpause the --- 33 unchanged lines hidden --- |