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
156 static void ath_txq_skb_done(struct ath_softc *sc, struct ath_txq *txq, in ath_txq_skb_done() argument
161 int q = fi->txq; in ath_txq_skb_done()
166 txq = sc->tx.txq_map[q]; in ath_txq_skb_done()
167 if (WARN_ON(--txq->pending_frames < 0)) in ath_txq_skb_done()
168 txq->pending_frames = 0; in ath_txq_skb_done()
170 if (txq->stopped && in ath_txq_skb_done()
171 txq->pending_frames < sc->tx.txq_max_pending[q]) { in ath_txq_skb_done()
176 txq->stopped = false; in ath_txq_skb_done()
211 struct ath_txq *txq = tid->ac->txq; in ath_tx_tid_change_state() local
227 bf = ath_tx_setup_buffer(sc, txq, tid, skb); in ath_tx_tid_change_state()
230 ath_txq_skb_done(sc, txq, skb); in ath_tx_tid_change_state()
240 struct ath_txq *txq = tid->ac->txq; in ath_tx_flush_tid() local
256 ath_txq_skb_done(sc, txq, skb); in ath_tx_flush_tid()
267 ath_tx_complete_buf(sc, bf, txq, &bf_head, &ts, 0); in ath_tx_flush_tid()
271 ath_txq_unlock(sc, txq); in ath_tx_flush_tid()
273 ath_txq_lock(sc, txq); in ath_tx_flush_tid()
314 static void ath_tid_drain(struct ath_softc *sc, struct ath_txq *txq, in ath_tid_drain() argument
332 ath_tx_complete(sc, skb, ATH_TX_ERROR, txq); in ath_tid_drain()
337 ath_tx_complete_buf(sc, bf, txq, &bf_head, &ts, 0); in ath_tid_drain()
341 static void ath_tx_set_retry(struct ath_softc *sc, struct ath_txq *txq, in ath_tx_set_retry() argument
349 TX_STAT_INC(txq->axq_qnum, a_retries); in ath_tx_set_retry()
438 static void ath_tx_complete_aggr(struct ath_softc *sc, struct ath_txq *txq, in ath_tx_complete_aggr() argument
487 ath_tx_complete_buf(sc, bf, txq, &bf_head, ts, 0); in ath_tx_complete_aggr()
561 ath_tx_set_retry(sc, txq, bf->bf_mpdu, in ath_tx_complete_aggr()
597 ath_tx_complete_buf(sc, bf, txq, &bf_head, ts, in ath_tx_complete_aggr()
617 ath_tx_complete_buf(sc, bf, txq, in ath_tx_complete_aggr()
644 ath_tx_queue_tid(sc, txq, tid); in ath_tx_complete_aggr()
657 ath_txq_unlock(sc, txq); in ath_tx_complete_aggr()
659 ath_txq_lock(sc, txq); in ath_tx_complete_aggr()
674 static void ath_tx_process_buffer(struct ath_softc *sc, struct ath_txq *txq, in ath_tx_process_buffer() argument
683 txq->axq_tx_inprogress = false; in ath_tx_process_buffer()
685 txq->axq_depth--; in ath_tx_process_buffer()
687 txq->axq_ampdu_depth--; in ath_tx_process_buffer()
699 ath_tx_complete_buf(sc, bf, txq, bf_head, ts, txok); in ath_tx_process_buffer()
701 ath_tx_complete_aggr(sc, txq, bf, bf_head, ts, txok); in ath_tx_process_buffer()
704 ath_txq_schedule(sc, txq); in ath_tx_process_buffer()
737 int q = tid->ac->txq->mac80211_qnum; in ath_lookup_rate()
871 ath_tx_get_tid_subframe(struct ath_softc *sc, struct ath_txq *txq, in ath_tx_get_tid_subframe() argument
892 bf = ath_tx_setup_buffer(sc, txq, tid, skb); in ath_tx_get_tid_subframe()
898 ath_txq_skb_done(sc, txq, skb); in ath_tx_get_tid_subframe()
937 ath_tx_complete_buf(sc, bf, txq, &bf_head, &ts, 0); in ath_tx_get_tid_subframe()
948 ath_tx_form_aggr(struct ath_softc *sc, struct ath_txq *txq, in ath_tx_form_aggr() argument
1009 bf = ath_tx_get_tid_subframe(sc, txq, tid, &tid_q); in ath_tx_form_aggr()
1023 TX_STAT_INC(txq->axq_qnum, a_aggr); in ath_tx_form_aggr()
1311 struct ath_txq *txq, int len) in ath_tx_fill_desc() argument
1322 info.qcu = txq->axq_qnum; in ath_tx_fill_desc()
1342 txq == sc->tx.uapsdq) in ath_tx_fill_desc()
1403 ath_tx_form_burst(struct ath_softc *sc, struct ath_txq *txq, in ath_tx_form_burst() argument
1425 bf = ath_tx_get_tid_subframe(sc, txq, tid, &tid_q); in ath_tx_form_burst()
1437 static bool ath_tx_sched_aggr(struct ath_softc *sc, struct ath_txq *txq, in ath_tx_sched_aggr() argument
1452 bf = ath_tx_get_tid_subframe(sc, txq, tid, &tid_q); in ath_tx_sched_aggr()
1458 if ((aggr && txq->axq_ampdu_depth >= ATH_AGGR_MIN_QDEPTH) || in ath_tx_sched_aggr()
1459 (!aggr && txq->axq_depth >= ATH_NON_AGGR_MIN_QDEPTH)) { in ath_tx_sched_aggr()
1466 last = ath_tx_form_aggr(sc, txq, tid, &bf_q, bf, in ath_tx_sched_aggr()
1469 ath_tx_form_burst(sc, txq, tid, &bf_q, bf, tid_q); in ath_tx_sched_aggr()
1479 ath_tx_fill_desc(sc, bf, txq, aggr_len); in ath_tx_sched_aggr()
1480 ath_tx_txqaddbuf(sc, txq, &bf_q, false); in ath_tx_sched_aggr()
1488 struct ath_txq *txq; in ath_tx_aggr_start() local
1494 txq = txtid->ac->txq; in ath_tx_aggr_start()
1496 ath_txq_lock(sc, txq); in ath_tx_aggr_start()
1519 ath_txq_unlock_complete(sc, txq); in ath_tx_aggr_start()
1528 struct ath_txq *txq = txtid->ac->txq; in ath_tx_aggr_stop() local
1530 ath_txq_lock(sc, txq); in ath_tx_aggr_stop()
1534 ath_txq_unlock_complete(sc, txq); in ath_tx_aggr_stop()
1542 struct ath_txq *txq; in ath_tx_aggr_sleep() local
1550 txq = ac->txq; in ath_tx_aggr_sleep()
1552 ath_txq_lock(sc, txq); in ath_tx_aggr_sleep()
1555 ath_txq_unlock(sc, txq); in ath_tx_aggr_sleep()
1569 ath_txq_unlock(sc, txq); in ath_tx_aggr_sleep()
1579 struct ath_txq *txq; in ath_tx_aggr_wakeup() local
1586 txq = ac->txq; in ath_tx_aggr_wakeup()
1588 ath_txq_lock(sc, txq); in ath_tx_aggr_wakeup()
1592 ath_tx_queue_tid(sc, txq, tid); in ath_tx_aggr_wakeup()
1593 ath_txq_schedule(sc, txq); in ath_tx_aggr_wakeup()
1596 ath_txq_unlock_complete(sc, txq); in ath_tx_aggr_wakeup()
1605 struct ath_txq *txq; in ath_tx_aggr_resume() local
1609 txq = tid->ac->txq; in ath_tx_aggr_resume()
1611 ath_txq_lock(sc, txq); in ath_tx_aggr_resume()
1616 ath_tx_queue_tid(sc, txq, tid); in ath_tx_aggr_resume()
1617 ath_txq_schedule(sc, txq); in ath_tx_aggr_resume()
1620 ath_txq_unlock_complete(sc, txq); in ath_tx_aggr_resume()
1631 struct ath_txq *txq = sc->tx.uapsdq; in ath9k_release_buffered_frames() local
1648 ath_txq_lock(sc, tid->ac->txq); in ath9k_release_buffered_frames()
1667 TX_STAT_INC(txq->axq_qnum, a_queued_hw); in ath9k_release_buffered_frames()
1672 ath_txq_unlock_complete(sc, tid->ac->txq); in ath9k_release_buffered_frames()
1682 ath_txq_lock(sc, txq); in ath9k_release_buffered_frames()
1683 ath_tx_fill_desc(sc, bf, txq, 0); in ath9k_release_buffered_frames()
1684 ath_tx_txqaddbuf(sc, txq, &bf_q, false); in ath9k_release_buffered_frames()
1685 ath_txq_unlock(sc, txq); in ath9k_release_buffered_frames()
1744 struct ath_txq *txq = &sc->tx.txq[axq_qnum]; in ath_txq_setup() local
1746 txq->axq_qnum = axq_qnum; in ath_txq_setup()
1747 txq->mac80211_qnum = -1; in ath_txq_setup()
1748 txq->axq_link = NULL; in ath_txq_setup()
1749 __skb_queue_head_init(&txq->complete_q); in ath_txq_setup()
1750 INIT_LIST_HEAD(&txq->axq_q); in ath_txq_setup()
1751 spin_lock_init(&txq->axq_lock); in ath_txq_setup()
1752 txq->axq_depth = 0; in ath_txq_setup()
1753 txq->axq_ampdu_depth = 0; in ath_txq_setup()
1754 txq->axq_tx_inprogress = false; in ath_txq_setup()
1757 txq->txq_headidx = txq->txq_tailidx = 0; in ath_txq_setup()
1759 INIT_LIST_HEAD(&txq->txq_fifo[i]); in ath_txq_setup()
1761 return &sc->tx.txq[axq_qnum]; in ath_txq_setup()
1771 BUG_ON(sc->tx.txq[qnum].axq_qnum != qnum); in ath_txq_update()
1806 static void ath_drain_txq_list(struct ath_softc *sc, struct ath_txq *txq, in ath_drain_txq_list() argument
1829 ath_tx_process_buffer(sc, txq, &ts, bf, &bf_head); in ath_drain_txq_list()
1839 void ath_draintxq(struct ath_softc *sc, struct ath_txq *txq) in ath_draintxq() argument
1841 ath_txq_lock(sc, txq); in ath_draintxq()
1844 int idx = txq->txq_tailidx; in ath_draintxq()
1846 while (!list_empty(&txq->txq_fifo[idx])) { in ath_draintxq()
1847 ath_drain_txq_list(sc, txq, &txq->txq_fifo[idx]); in ath_draintxq()
1851 txq->txq_tailidx = idx; in ath_draintxq()
1854 txq->axq_link = NULL; in ath_draintxq()
1855 txq->axq_tx_inprogress = false; in ath_draintxq()
1856 ath_drain_txq_list(sc, txq, &txq->axq_q); in ath_draintxq()
1858 ath_txq_unlock_complete(sc, txq); in ath_draintxq()
1865 struct ath_txq *txq; in ath_drain_all_txq() local
1879 if (!sc->tx.txq[i].axq_depth) in ath_drain_all_txq()
1882 if (ath9k_hw_numtxpending(ah, sc->tx.txq[i].axq_qnum)) in ath_drain_all_txq()
1898 txq = &sc->tx.txq[i]; in ath_drain_all_txq()
1899 txq->stopped = false; in ath_drain_all_txq()
1900 ath_draintxq(sc, txq); in ath_drain_all_txq()
1906 void ath_tx_cleanupq(struct ath_softc *sc, struct ath_txq *txq) in ath_tx_cleanupq() argument
1908 ath9k_hw_releasetxqueue(sc->sc_ah, txq->axq_qnum); in ath_tx_cleanupq()
1909 sc->tx.txqsetup &= ~(1<<txq->axq_qnum); in ath_tx_cleanupq()
1915 void ath_txq_schedule(struct ath_softc *sc, struct ath_txq *txq) in ath_txq_schedule() argument
1923 if (txq->mac80211_qnum < 0) in ath_txq_schedule()
1930 ac_list = &sc->cur_chan->acq[txq->mac80211_qnum]; in ath_txq_schedule()
1958 if (ath_tx_sched_aggr(sc, txq, tid, &stop)) in ath_txq_schedule()
1966 ath_tx_queue_tid(sc, txq, tid); in ath_txq_schedule()
1996 struct ath_txq *txq; in ath_txq_schedule_all() local
2000 txq = sc->tx.txq_map[i]; in ath_txq_schedule_all()
2002 spin_lock_bh(&txq->axq_lock); in ath_txq_schedule_all()
2003 ath_txq_schedule(sc, txq); in ath_txq_schedule_all()
2004 spin_unlock_bh(&txq->axq_lock); in ath_txq_schedule_all()
2016 static void ath_tx_txqaddbuf(struct ath_softc *sc, struct ath_txq *txq, in ath_tx_txqaddbuf() argument
2038 txq->axq_qnum, txq->axq_depth); in ath_tx_txqaddbuf()
2040 if (edma && list_empty(&txq->txq_fifo[txq->txq_headidx])) { in ath_tx_txqaddbuf()
2041 list_splice_tail_init(head, &txq->txq_fifo[txq->txq_headidx]); in ath_tx_txqaddbuf()
2042 INCR(txq->txq_headidx, ATH_TXFIFO_DEPTH); in ath_tx_txqaddbuf()
2045 list_splice_tail_init(head, &txq->axq_q); in ath_tx_txqaddbuf()
2047 if (txq->axq_link) { in ath_tx_txqaddbuf()
2048 ath9k_hw_set_desc_link(ah, txq->axq_link, bf->bf_daddr); in ath_tx_txqaddbuf()
2050 txq->axq_qnum, txq->axq_link, in ath_tx_txqaddbuf()
2055 txq->axq_link = bf_last->bf_desc; in ath_tx_txqaddbuf()
2059 TX_STAT_INC(txq->axq_qnum, puttxbuf); in ath_tx_txqaddbuf()
2060 ath9k_hw_puttxbuf(ah, txq->axq_qnum, bf->bf_daddr); in ath_tx_txqaddbuf()
2062 txq->axq_qnum, ito64(bf->bf_daddr), bf->bf_desc); in ath_tx_txqaddbuf()
2066 TX_STAT_INC(txq->axq_qnum, txstart); in ath_tx_txqaddbuf()
2067 ath9k_hw_txstart(ah, txq->axq_qnum); in ath_tx_txqaddbuf()
2072 txq->axq_depth++; in ath_tx_txqaddbuf()
2074 txq->axq_ampdu_depth++; in ath_tx_txqaddbuf()
2083 static void ath_tx_send_normal(struct ath_softc *sc, struct ath_txq *txq, in ath_tx_send_normal() argument
2101 ath_tx_fill_desc(sc, bf, txq, fi->framelen); in ath_tx_send_normal()
2102 ath_tx_txqaddbuf(sc, txq, &bf_head, false); in ath_tx_send_normal()
2103 TX_STAT_INC(txq->axq_qnum, queued); in ath_tx_send_normal()
2147 fi->txq = -1; in setup_frame_info()
2185 struct ath_txq *txq, in ath_tx_setup_buffer() argument
2315 struct ath_txq *txq = txctl->txq; in ath_tx_start() local
2341 ath_txq_lock(sc, txq); in ath_tx_start()
2342 if (txq == sc->tx.txq_map[q]) { in ath_tx_start()
2343 fi->txq = q; in ath_tx_start()
2344 if (++txq->pending_frames > sc->tx.txq_max_pending[q] && in ath_tx_start()
2345 !txq->stopped) { in ath_tx_start()
2350 txq->stopped = true; in ath_tx_start()
2372 ath_txq_unlock(sc, txq); in ath_tx_start()
2373 txq = sc->tx.uapsdq; in ath_tx_start()
2374 ath_txq_lock(sc, txq); in ath_tx_start()
2376 WARN_ON(tid->ac->txq != txctl->txq); in ath_tx_start()
2385 TX_STAT_INC(txq->axq_qnum, a_queued_sw); in ath_tx_start()
2388 ath_tx_queue_tid(sc, txq, tid); in ath_tx_start()
2390 ath_txq_schedule(sc, txq); in ath_tx_start()
2394 bf = ath_tx_setup_buffer(sc, txq, tid, skb); in ath_tx_start()
2396 ath_txq_skb_done(sc, txq, skb); in ath_tx_start()
2410 ath_tx_send_normal(sc, txq, tid, skb); in ath_tx_start()
2413 ath_txq_unlock(sc, txq); in ath_tx_start()
2423 .txq = sc->beacon.cabq in ath_tx_cabq()
2443 bf = ath_tx_setup_buffer(sc, txctl.txq, NULL, skb); in ath_tx_cabq()
2479 ath_txq_lock(sc, txctl.txq); in ath_tx_cabq()
2480 ath_tx_fill_desc(sc, bf, txctl.txq, 0); in ath_tx_cabq()
2481 ath_tx_txqaddbuf(sc, txctl.txq, &bf_q, false); in ath_tx_cabq()
2482 TX_STAT_INC(txctl.txq->axq_qnum, queued); in ath_tx_cabq()
2483 ath_txq_unlock(sc, txctl.txq); in ath_tx_cabq()
2491 int tx_flags, struct ath_txq *txq) in ath_tx_complete() argument
2523 if ((sc->ps_flags & PS_WAIT_FOR_TX_ACK) && !txq->axq_depth) { in ath_tx_complete()
2534 __skb_queue_tail(&txq->complete_q, skb); in ath_tx_complete()
2535 ath_txq_skb_done(sc, txq, skb); in ath_tx_complete()
2539 struct ath_txq *txq, struct list_head *bf_q, in ath_tx_complete_buf() argument
2566 ath_debug_stat_tx(sc, bf, ts, txq, tx_flags); in ath_tx_complete_buf()
2567 ath_tx_complete(sc, skb, tx_flags, txq); in ath_tx_complete_buf()
2638 static void ath_tx_processq(struct ath_softc *sc, struct ath_txq *txq) in ath_tx_processq() argument
2649 txq->axq_qnum, ath9k_hw_gettxbuf(sc->sc_ah, txq->axq_qnum), in ath_tx_processq()
2650 txq->axq_link); in ath_tx_processq()
2652 ath_txq_lock(sc, txq); in ath_tx_processq()
2657 if (list_empty(&txq->axq_q)) { in ath_tx_processq()
2658 txq->axq_link = NULL; in ath_tx_processq()
2659 ath_txq_schedule(sc, txq); in ath_tx_processq()
2662 bf = list_first_entry(&txq->axq_q, struct ath_buf, list); in ath_tx_processq()
2675 if (list_is_last(&bf_held->list, &txq->axq_q)) in ath_tx_processq()
2690 TX_STAT_INC(txq->axq_qnum, txprocdesc); in ath_tx_processq()
2701 &txq->axq_q, lastbf->list.prev); in ath_tx_processq()
2708 ath_tx_process_buffer(sc, txq, &ts, bf, &bf_head); in ath_tx_processq()
2710 ath_txq_unlock_complete(sc, txq); in ath_tx_processq()
2721 ath_tx_processq(sc, &sc->tx.txq[i]); in ath_tx_tasklet()
2730 struct ath_txq *txq; in ath_tx_edma_tasklet() local
2762 txq = &sc->tx.txq[ts.qid]; in ath_tx_edma_tasklet()
2764 ath_txq_lock(sc, txq); in ath_tx_edma_tasklet()
2766 TX_STAT_INC(txq->axq_qnum, txprocdesc); in ath_tx_edma_tasklet()
2768 fifo_list = &txq->txq_fifo[txq->txq_tailidx]; in ath_tx_edma_tasklet()
2770 ath_txq_unlock(sc, txq); in ath_tx_edma_tasklet()
2786 INCR(txq->txq_tailidx, ATH_TXFIFO_DEPTH); in ath_tx_edma_tasklet()
2788 if (!list_empty(&txq->axq_q)) { in ath_tx_edma_tasklet()
2792 txq->axq_link = NULL; in ath_tx_edma_tasklet()
2793 list_splice_tail_init(&txq->axq_q, &bf_q); in ath_tx_edma_tasklet()
2794 ath_tx_txqaddbuf(sc, txq, &bf_q, true); in ath_tx_edma_tasklet()
2803 ath_tx_process_buffer(sc, txq, &ts, bf, &bf_head); in ath_tx_edma_tasklet()
2804 ath_txq_unlock_complete(sc, txq); in ath_tx_edma_tasklet()
2896 ac->txq = sc->tx.txq_map[acno]; in ath_tx_node_init()
2905 struct ath_txq *txq; in ath_tx_node_cleanup() local
2912 txq = ac->txq; in ath_tx_node_cleanup()
2914 ath_txq_lock(sc, txq); in ath_tx_node_cleanup()
2926 ath_tid_drain(sc, txq, tid); in ath_tx_node_cleanup()
2929 ath_txq_unlock(sc, txq); in ath_tx_node_cleanup()
2962 bf = ath_tx_setup_buffer(sc, txctl->txq, NULL, skb); in ath9k_tx99_send()
2971 ath9k_hw_tx99_start(sc->sc_ah, txctl->txq->axq_qnum); in ath9k_tx99_send()
2973 ath_tx_send_normal(sc, txctl->txq, NULL, skb); in ath9k_tx99_send()