Lines Matching refs:txq

50 static void ath_tx_send_normal(struct ath_softc *sc, struct ath_txq *txq,
53 int tx_flags, struct ath_txq *txq);
55 struct ath_txq *txq, struct list_head *bf_q,
57 static void ath_tx_txqaddbuf(struct ath_softc *sc, struct ath_txq *txq,
65 struct ath_txq *txq,
80 void ath_txq_lock(struct ath_softc *sc, struct ath_txq *txq) in ath_txq_lock() argument
81 __acquires(&txq->axq_lock) in ath_txq_lock()
83 spin_lock_bh(&txq->axq_lock); in ath_txq_lock()
86 void ath_txq_unlock(struct ath_softc *sc, struct ath_txq *txq) in ath_txq_unlock() argument
87 __releases(&txq->axq_lock) in ath_txq_unlock()
89 spin_unlock_bh(&txq->axq_lock); in ath_txq_unlock()
92 void ath_txq_unlock_complete(struct ath_softc *sc, struct ath_txq *txq) in ath_txq_unlock_complete() argument
93 __releases(&txq->axq_lock) in ath_txq_unlock_complete()
99 skb_queue_splice_init(&txq->complete_q, &q); in ath_txq_unlock_complete()
100 spin_unlock_bh(&txq->axq_lock); in ath_txq_unlock_complete()
106 static void ath_tx_queue_tid(struct ath_softc *sc, struct ath_txq *txq, in ath_tx_queue_tid() argument
145 static void ath_txq_skb_done(struct ath_softc *sc, struct ath_txq *txq, in ath_txq_skb_done() argument
150 int q = fi->txq; in ath_txq_skb_done()
155 txq = sc->tx.txq_map[q]; in ath_txq_skb_done()
156 if (WARN_ON(--txq->pending_frames < 0)) in ath_txq_skb_done()
157 txq->pending_frames = 0; in ath_txq_skb_done()
159 if (txq->stopped && in ath_txq_skb_done()
160 txq->pending_frames < sc->tx.txq_max_pending[q]) { in ath_txq_skb_done()
165 txq->stopped = false; in ath_txq_skb_done()
200 struct ath_txq *txq = tid->txq; in ath_tx_tid_change_state() local
216 bf = ath_tx_setup_buffer(sc, txq, tid, skb); in ath_tx_tid_change_state()
219 ath_txq_skb_done(sc, txq, skb); in ath_tx_tid_change_state()
229 struct ath_txq *txq = tid->txq; in ath_tx_flush_tid() local
245 ath_txq_skb_done(sc, txq, skb); in ath_tx_flush_tid()
256 ath_tx_complete_buf(sc, bf, txq, &bf_head, &ts, 0); in ath_tx_flush_tid()
260 ath_txq_unlock(sc, txq); in ath_tx_flush_tid()
262 ath_txq_lock(sc, txq); in ath_tx_flush_tid()
303 static void ath_tid_drain(struct ath_softc *sc, struct ath_txq *txq, in ath_tid_drain() argument
321 ath_tx_complete(sc, skb, ATH_TX_ERROR, txq); in ath_tid_drain()
326 ath_tx_complete_buf(sc, bf, txq, &bf_head, &ts, 0); in ath_tid_drain()
330 static void ath_tx_set_retry(struct ath_softc *sc, struct ath_txq *txq, in ath_tx_set_retry() argument
338 TX_STAT_INC(txq->axq_qnum, a_retries); in ath_tx_set_retry()
427 static void ath_tx_complete_aggr(struct ath_softc *sc, struct ath_txq *txq, in ath_tx_complete_aggr() argument
476 ath_tx_complete_buf(sc, bf, txq, &bf_head, ts, 0); in ath_tx_complete_aggr()
550 ath_tx_set_retry(sc, txq, bf->bf_mpdu, in ath_tx_complete_aggr()
586 ath_tx_complete_buf(sc, bf, txq, &bf_head, ts, in ath_tx_complete_aggr()
606 ath_tx_complete_buf(sc, bf, txq, in ath_tx_complete_aggr()
633 ath_tx_queue_tid(sc, txq, tid); in ath_tx_complete_aggr()
646 ath_txq_unlock(sc, txq); in ath_tx_complete_aggr()
648 ath_txq_lock(sc, txq); in ath_tx_complete_aggr()
663 static void ath_tx_process_buffer(struct ath_softc *sc, struct ath_txq *txq, in ath_tx_process_buffer() argument
672 txq->axq_tx_inprogress = false; in ath_tx_process_buffer()
674 txq->axq_depth--; in ath_tx_process_buffer()
676 txq->axq_ampdu_depth--; in ath_tx_process_buffer()
688 ath_tx_complete_buf(sc, bf, txq, bf_head, ts, txok); in ath_tx_process_buffer()
690 ath_tx_complete_aggr(sc, txq, bf, bf_head, ts, txok); in ath_tx_process_buffer()
693 ath_txq_schedule(sc, txq); in ath_tx_process_buffer()
726 int q = tid->txq->mac80211_qnum; in ath_lookup_rate()
860 ath_tx_get_tid_subframe(struct ath_softc *sc, struct ath_txq *txq, in ath_tx_get_tid_subframe() argument
881 bf = ath_tx_setup_buffer(sc, txq, tid, skb); in ath_tx_get_tid_subframe()
887 ath_txq_skb_done(sc, txq, skb); in ath_tx_get_tid_subframe()
926 ath_tx_complete_buf(sc, bf, txq, &bf_head, &ts, 0); in ath_tx_get_tid_subframe()
937 ath_tx_form_aggr(struct ath_softc *sc, struct ath_txq *txq, in ath_tx_form_aggr() argument
998 bf = ath_tx_get_tid_subframe(sc, txq, tid, &tid_q); in ath_tx_form_aggr()
1012 TX_STAT_INC(txq->axq_qnum, a_aggr); in ath_tx_form_aggr()
1300 struct ath_txq *txq, int len) in ath_tx_fill_desc() argument
1311 info.qcu = txq->axq_qnum; in ath_tx_fill_desc()
1331 txq == sc->tx.uapsdq) in ath_tx_fill_desc()
1392 ath_tx_form_burst(struct ath_softc *sc, struct ath_txq *txq, in ath_tx_form_burst() argument
1414 bf = ath_tx_get_tid_subframe(sc, txq, tid, &tid_q); in ath_tx_form_burst()
1426 static bool ath_tx_sched_aggr(struct ath_softc *sc, struct ath_txq *txq, in ath_tx_sched_aggr() argument
1441 bf = ath_tx_get_tid_subframe(sc, txq, tid, &tid_q); in ath_tx_sched_aggr()
1447 if ((aggr && txq->axq_ampdu_depth >= ATH_AGGR_MIN_QDEPTH) || in ath_tx_sched_aggr()
1448 (!aggr && txq->axq_depth >= ATH_NON_AGGR_MIN_QDEPTH)) { in ath_tx_sched_aggr()
1455 last = ath_tx_form_aggr(sc, txq, tid, &bf_q, bf, in ath_tx_sched_aggr()
1458 ath_tx_form_burst(sc, txq, tid, &bf_q, bf, tid_q); in ath_tx_sched_aggr()
1468 ath_tx_fill_desc(sc, bf, txq, aggr_len); in ath_tx_sched_aggr()
1469 ath_tx_txqaddbuf(sc, txq, &bf_q, false); in ath_tx_sched_aggr()
1477 struct ath_txq *txq; in ath_tx_aggr_start() local
1483 txq = txtid->txq; in ath_tx_aggr_start()
1485 ath_txq_lock(sc, txq); in ath_tx_aggr_start()
1508 ath_txq_unlock_complete(sc, txq); in ath_tx_aggr_start()
1517 struct ath_txq *txq = txtid->txq; in ath_tx_aggr_stop() local
1519 ath_txq_lock(sc, txq); in ath_tx_aggr_stop()
1523 ath_txq_unlock_complete(sc, txq); in ath_tx_aggr_stop()
1530 struct ath_txq *txq; in ath_tx_aggr_sleep() local
1537 txq = tid->txq; in ath_tx_aggr_sleep()
1539 ath_txq_lock(sc, txq); in ath_tx_aggr_sleep()
1542 ath_txq_unlock(sc, txq); in ath_tx_aggr_sleep()
1550 ath_txq_unlock(sc, txq); in ath_tx_aggr_sleep()
1559 struct ath_txq *txq; in ath_tx_aggr_wakeup() local
1565 txq = tid->txq; in ath_tx_aggr_wakeup()
1567 ath_txq_lock(sc, txq); in ath_tx_aggr_wakeup()
1571 ath_tx_queue_tid(sc, txq, tid); in ath_tx_aggr_wakeup()
1572 ath_txq_schedule(sc, txq); in ath_tx_aggr_wakeup()
1575 ath_txq_unlock_complete(sc, txq); in ath_tx_aggr_wakeup()
1584 struct ath_txq *txq; in ath_tx_aggr_resume() local
1588 txq = tid->txq; in ath_tx_aggr_resume()
1590 ath_txq_lock(sc, txq); in ath_tx_aggr_resume()
1595 ath_tx_queue_tid(sc, txq, tid); in ath_tx_aggr_resume()
1596 ath_txq_schedule(sc, txq); in ath_tx_aggr_resume()
1599 ath_txq_unlock_complete(sc, txq); in ath_tx_aggr_resume()
1610 struct ath_txq *txq = sc->tx.uapsdq; in ath9k_release_buffered_frames() local
1627 ath_txq_lock(sc, tid->txq); in ath9k_release_buffered_frames()
1646 TX_STAT_INC(txq->axq_qnum, a_queued_hw); in ath9k_release_buffered_frames()
1651 ath_txq_unlock_complete(sc, tid->txq); in ath9k_release_buffered_frames()
1661 ath_txq_lock(sc, txq); in ath9k_release_buffered_frames()
1662 ath_tx_fill_desc(sc, bf, txq, 0); in ath9k_release_buffered_frames()
1663 ath_tx_txqaddbuf(sc, txq, &bf_q, false); in ath9k_release_buffered_frames()
1664 ath_txq_unlock(sc, txq); in ath9k_release_buffered_frames()
1723 struct ath_txq *txq = &sc->tx.txq[axq_qnum]; in ath_txq_setup() local
1725 txq->axq_qnum = axq_qnum; in ath_txq_setup()
1726 txq->mac80211_qnum = -1; in ath_txq_setup()
1727 txq->axq_link = NULL; in ath_txq_setup()
1728 __skb_queue_head_init(&txq->complete_q); in ath_txq_setup()
1729 INIT_LIST_HEAD(&txq->axq_q); in ath_txq_setup()
1730 spin_lock_init(&txq->axq_lock); in ath_txq_setup()
1731 txq->axq_depth = 0; in ath_txq_setup()
1732 txq->axq_ampdu_depth = 0; in ath_txq_setup()
1733 txq->axq_tx_inprogress = false; in ath_txq_setup()
1736 txq->txq_headidx = txq->txq_tailidx = 0; in ath_txq_setup()
1738 INIT_LIST_HEAD(&txq->txq_fifo[i]); in ath_txq_setup()
1740 return &sc->tx.txq[axq_qnum]; in ath_txq_setup()
1750 BUG_ON(sc->tx.txq[qnum].axq_qnum != qnum); in ath_txq_update()
1785 static void ath_drain_txq_list(struct ath_softc *sc, struct ath_txq *txq, in ath_drain_txq_list() argument
1808 ath_tx_process_buffer(sc, txq, &ts, bf, &bf_head); in ath_drain_txq_list()
1818 void ath_draintxq(struct ath_softc *sc, struct ath_txq *txq) in ath_draintxq() argument
1820 ath_txq_lock(sc, txq); in ath_draintxq()
1823 int idx = txq->txq_tailidx; in ath_draintxq()
1825 while (!list_empty(&txq->txq_fifo[idx])) { in ath_draintxq()
1826 ath_drain_txq_list(sc, txq, &txq->txq_fifo[idx]); in ath_draintxq()
1830 txq->txq_tailidx = idx; in ath_draintxq()
1833 txq->axq_link = NULL; in ath_draintxq()
1834 txq->axq_tx_inprogress = false; in ath_draintxq()
1835 ath_drain_txq_list(sc, txq, &txq->axq_q); in ath_draintxq()
1837 ath_txq_unlock_complete(sc, txq); in ath_draintxq()
1844 struct ath_txq *txq; in ath_drain_all_txq() local
1858 if (!sc->tx.txq[i].axq_depth) in ath_drain_all_txq()
1861 if (ath9k_hw_numtxpending(ah, sc->tx.txq[i].axq_qnum)) in ath_drain_all_txq()
1880 txq = &sc->tx.txq[i]; in ath_drain_all_txq()
1881 txq->stopped = false; in ath_drain_all_txq()
1882 ath_draintxq(sc, txq); in ath_drain_all_txq()
1888 void ath_tx_cleanupq(struct ath_softc *sc, struct ath_txq *txq) in ath_tx_cleanupq() argument
1890 ath9k_hw_releasetxqueue(sc->sc_ah, txq->axq_qnum); in ath_tx_cleanupq()
1891 sc->tx.txqsetup &= ~(1<<txq->axq_qnum); in ath_tx_cleanupq()
1897 void ath_txq_schedule(struct ath_softc *sc, struct ath_txq *txq) in ath_txq_schedule() argument
1904 if (txq->mac80211_qnum < 0) in ath_txq_schedule()
1911 tid_list = &sc->cur_chan->acq[txq->mac80211_qnum]; in ath_txq_schedule()
1930 if (ath_tx_sched_aggr(sc, txq, tid, &stop)) in ath_txq_schedule()
1938 ath_tx_queue_tid(sc, txq, tid); in ath_txq_schedule()
1959 struct ath_txq *txq; in ath_txq_schedule_all() local
1963 txq = sc->tx.txq_map[i]; in ath_txq_schedule_all()
1965 spin_lock_bh(&txq->axq_lock); in ath_txq_schedule_all()
1966 ath_txq_schedule(sc, txq); in ath_txq_schedule_all()
1967 spin_unlock_bh(&txq->axq_lock); in ath_txq_schedule_all()
1979 static void ath_tx_txqaddbuf(struct ath_softc *sc, struct ath_txq *txq, in ath_tx_txqaddbuf() argument
2001 txq->axq_qnum, txq->axq_depth); in ath_tx_txqaddbuf()
2003 if (edma && list_empty(&txq->txq_fifo[txq->txq_headidx])) { in ath_tx_txqaddbuf()
2004 list_splice_tail_init(head, &txq->txq_fifo[txq->txq_headidx]); in ath_tx_txqaddbuf()
2005 INCR(txq->txq_headidx, ATH_TXFIFO_DEPTH); in ath_tx_txqaddbuf()
2008 list_splice_tail_init(head, &txq->axq_q); in ath_tx_txqaddbuf()
2010 if (txq->axq_link) { in ath_tx_txqaddbuf()
2011 ath9k_hw_set_desc_link(ah, txq->axq_link, bf->bf_daddr); in ath_tx_txqaddbuf()
2013 txq->axq_qnum, txq->axq_link, in ath_tx_txqaddbuf()
2018 txq->axq_link = bf_last->bf_desc; in ath_tx_txqaddbuf()
2022 TX_STAT_INC(txq->axq_qnum, puttxbuf); in ath_tx_txqaddbuf()
2023 ath9k_hw_puttxbuf(ah, txq->axq_qnum, bf->bf_daddr); in ath_tx_txqaddbuf()
2025 txq->axq_qnum, ito64(bf->bf_daddr), bf->bf_desc); in ath_tx_txqaddbuf()
2029 TX_STAT_INC(txq->axq_qnum, txstart); in ath_tx_txqaddbuf()
2030 ath9k_hw_txstart(ah, txq->axq_qnum); in ath_tx_txqaddbuf()
2035 txq->axq_depth++; in ath_tx_txqaddbuf()
2037 txq->axq_ampdu_depth++; in ath_tx_txqaddbuf()
2046 static void ath_tx_send_normal(struct ath_softc *sc, struct ath_txq *txq, in ath_tx_send_normal() argument
2064 ath_tx_fill_desc(sc, bf, txq, fi->framelen); in ath_tx_send_normal()
2065 ath_tx_txqaddbuf(sc, txq, &bf_head, false); in ath_tx_send_normal()
2066 TX_STAT_INC(txq->axq_qnum, queued); in ath_tx_send_normal()
2110 fi->txq = -1; in setup_frame_info()
2148 struct ath_txq *txq, in ath_tx_setup_buffer() argument
2278 struct ath_txq *txq = txctl->txq; in ath_tx_start() local
2304 ath_txq_lock(sc, txq); in ath_tx_start()
2305 if (txq == sc->tx.txq_map[q]) { in ath_tx_start()
2306 fi->txq = q; in ath_tx_start()
2307 if (++txq->pending_frames > sc->tx.txq_max_pending[q] && in ath_tx_start()
2308 !txq->stopped) { in ath_tx_start()
2313 txq->stopped = true; in ath_tx_start()
2335 ath_txq_unlock(sc, txq); in ath_tx_start()
2336 txq = sc->tx.uapsdq; in ath_tx_start()
2337 ath_txq_lock(sc, txq); in ath_tx_start()
2339 WARN_ON(tid->txq != txctl->txq); in ath_tx_start()
2348 TX_STAT_INC(txq->axq_qnum, a_queued_sw); in ath_tx_start()
2351 ath_tx_queue_tid(sc, txq, tid); in ath_tx_start()
2353 ath_txq_schedule(sc, txq); in ath_tx_start()
2357 bf = ath_tx_setup_buffer(sc, txq, tid, skb); in ath_tx_start()
2359 ath_txq_skb_done(sc, txq, skb); in ath_tx_start()
2373 ath_tx_send_normal(sc, txq, tid, skb); in ath_tx_start()
2376 ath_txq_unlock(sc, txq); in ath_tx_start()
2386 .txq = sc->beacon.cabq in ath_tx_cabq()
2406 bf = ath_tx_setup_buffer(sc, txctl.txq, NULL, skb); in ath_tx_cabq()
2442 ath_txq_lock(sc, txctl.txq); in ath_tx_cabq()
2443 ath_tx_fill_desc(sc, bf, txctl.txq, 0); in ath_tx_cabq()
2444 ath_tx_txqaddbuf(sc, txctl.txq, &bf_q, false); in ath_tx_cabq()
2445 TX_STAT_INC(txctl.txq->axq_qnum, queued); in ath_tx_cabq()
2446 ath_txq_unlock(sc, txctl.txq); in ath_tx_cabq()
2454 int tx_flags, struct ath_txq *txq) in ath_tx_complete() argument
2486 if ((sc->ps_flags & PS_WAIT_FOR_TX_ACK) && !txq->axq_depth) { in ath_tx_complete()
2497 __skb_queue_tail(&txq->complete_q, skb); in ath_tx_complete()
2498 ath_txq_skb_done(sc, txq, skb); in ath_tx_complete()
2502 struct ath_txq *txq, struct list_head *bf_q, in ath_tx_complete_buf() argument
2529 ath_debug_stat_tx(sc, bf, ts, txq, tx_flags); in ath_tx_complete_buf()
2530 ath_tx_complete(sc, skb, tx_flags, txq); in ath_tx_complete_buf()
2601 static void ath_tx_processq(struct ath_softc *sc, struct ath_txq *txq) in ath_tx_processq() argument
2612 txq->axq_qnum, ath9k_hw_gettxbuf(sc->sc_ah, txq->axq_qnum), in ath_tx_processq()
2613 txq->axq_link); in ath_tx_processq()
2615 ath_txq_lock(sc, txq); in ath_tx_processq()
2620 if (list_empty(&txq->axq_q)) { in ath_tx_processq()
2621 txq->axq_link = NULL; in ath_tx_processq()
2622 ath_txq_schedule(sc, txq); in ath_tx_processq()
2625 bf = list_first_entry(&txq->axq_q, struct ath_buf, list); in ath_tx_processq()
2638 if (list_is_last(&bf_held->list, &txq->axq_q)) in ath_tx_processq()
2653 TX_STAT_INC(txq->axq_qnum, txprocdesc); in ath_tx_processq()
2664 &txq->axq_q, lastbf->list.prev); in ath_tx_processq()
2671 ath_tx_process_buffer(sc, txq, &ts, bf, &bf_head); in ath_tx_processq()
2673 ath_txq_unlock_complete(sc, txq); in ath_tx_processq()
2684 ath_tx_processq(sc, &sc->tx.txq[i]); in ath_tx_tasklet()
2693 struct ath_txq *txq; in ath_tx_edma_tasklet() local
2725 txq = &sc->tx.txq[ts.qid]; in ath_tx_edma_tasklet()
2727 ath_txq_lock(sc, txq); in ath_tx_edma_tasklet()
2729 TX_STAT_INC(txq->axq_qnum, txprocdesc); in ath_tx_edma_tasklet()
2731 fifo_list = &txq->txq_fifo[txq->txq_tailidx]; in ath_tx_edma_tasklet()
2733 ath_txq_unlock(sc, txq); in ath_tx_edma_tasklet()
2749 INCR(txq->txq_tailidx, ATH_TXFIFO_DEPTH); in ath_tx_edma_tasklet()
2751 if (!list_empty(&txq->axq_q)) { in ath_tx_edma_tasklet()
2755 txq->axq_link = NULL; in ath_tx_edma_tasklet()
2756 list_splice_tail_init(&txq->axq_q, &bf_q); in ath_tx_edma_tasklet()
2757 ath_tx_txqaddbuf(sc, txq, &bf_q, true); in ath_tx_edma_tasklet()
2766 ath_tx_process_buffer(sc, txq, &ts, bf, &bf_head); in ath_tx_edma_tasklet()
2767 ath_txq_unlock_complete(sc, txq); in ath_tx_edma_tasklet()
2852 tid->txq = sc->tx.txq_map[acno]; in ath_tx_node_init()
2859 struct ath_txq *txq; in ath_tx_node_cleanup() local
2865 txq = tid->txq; in ath_tx_node_cleanup()
2867 ath_txq_lock(sc, txq); in ath_tx_node_cleanup()
2872 ath_tid_drain(sc, txq, tid); in ath_tx_node_cleanup()
2875 ath_txq_unlock(sc, txq); in ath_tx_node_cleanup()
2908 bf = ath_tx_setup_buffer(sc, txctl->txq, NULL, skb); in ath9k_tx99_send()
2917 ath9k_hw_tx99_start(sc->sc_ah, txctl->txq->axq_qnum); in ath9k_tx99_send()
2919 ath_tx_send_normal(sc, txctl->txq, NULL, skb); in ath9k_tx99_send()