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,
56 struct ath_txq *txq, struct list_head *bf_q,
59 static void ath_tx_txqaddbuf(struct ath_softc *sc, struct ath_txq *txq,
67 struct ath_txq *txq,
101 void ath_txq_unlock_complete(struct ath_softc *sc, struct ath_txq *txq) in ath_txq_unlock_complete() argument
102 __releases(&txq->axq_lock) in ath_txq_unlock_complete()
109 skb_queue_splice_init(&txq->complete_q, &q); in ath_txq_unlock_complete()
110 spin_unlock_bh(&txq->axq_lock); in ath_txq_unlock_complete()
129 struct ath_txq *txq = tid->txq; in ath9k_wake_tx_queue() local
135 ath_txq_lock(sc, txq); in ath9k_wake_tx_queue()
136 ath_txq_schedule(sc, txq); in ath9k_wake_tx_queue()
137 ath_txq_unlock(sc, txq); in ath9k_wake_tx_queue()
164 static void ath_txq_skb_done(struct ath_softc *sc, struct ath_txq *txq, in ath_txq_skb_done() argument
168 int q = fi->txq; in ath_txq_skb_done()
173 txq = sc->tx.txq_map[q]; in ath_txq_skb_done()
174 if (WARN_ON(--txq->pending_frames < 0)) in ath_txq_skb_done()
175 txq->pending_frames = 0; in ath_txq_skb_done()
189 struct ieee80211_txq *txq = container_of((void*)tid, struct ieee80211_txq, drv_priv); in ath_tid_pull() local
193 .txq = tid->txq, in ath_tid_pull()
200 skb = ieee80211_tx_dequeue(hw, txq); in ath_tid_pull()
211 if (tid->txq == sc->tx.txq_map[q]) { in ath_tid_pull()
213 fi->txq = q; in ath_tid_pull()
214 ++tid->txq->pending_frames; in ath_tid_pull()
234 struct ath_txq *txq = tid->txq; in ath_tx_flush_tid() local
250 ath_txq_skb_done(sc, txq, skb); in ath_tx_flush_tid()
261 ath_tx_complete_buf(sc, bf, txq, &bf_head, NULL, &ts, 0); in ath_tx_flush_tid()
265 ath_txq_unlock(sc, txq); in ath_tx_flush_tid()
267 ath_txq_lock(sc, txq); in ath_tx_flush_tid()
316 static void ath_tid_drain(struct ath_softc *sc, struct ath_txq *txq, in ath_tid_drain() argument
335 ath_tx_complete(sc, skb, ATH_TX_ERROR, txq, NULL); in ath_tid_drain()
340 ath_tx_complete_buf(sc, bf, txq, &bf_head, NULL, &ts, 0); in ath_tid_drain()
344 static void ath_tx_set_retry(struct ath_softc *sc, struct ath_txq *txq, in ath_tx_set_retry() argument
352 TX_STAT_INC(sc, txq->axq_qnum, a_retries); in ath_tx_set_retry()
439 static void ath_tx_complete_aggr(struct ath_softc *sc, struct ath_txq *txq, in ath_tx_complete_aggr() argument
479 ath_tx_complete_buf(sc, bf, txq, &bf_head, NULL, ts, 0); in ath_tx_complete_aggr()
552 ath_tx_set_retry(sc, txq, bf->bf_mpdu, in ath_tx_complete_aggr()
588 ath_tx_complete_buf(sc, bf, txq, &bf_head, sta, ts, in ath_tx_complete_aggr()
608 ath_tx_complete_buf(sc, bf, txq, in ath_tx_complete_aggr()
648 ath_txq_unlock(sc, txq); in ath_tx_complete_aggr()
650 ath_txq_lock(sc, txq); in ath_tx_complete_aggr()
681 static void ath_tx_process_buffer(struct ath_softc *sc, struct ath_txq *txq, in ath_tx_process_buffer() argument
694 txq->axq_tx_inprogress = false; in ath_tx_process_buffer()
696 txq->axq_depth--; in ath_tx_process_buffer()
698 txq->axq_ampdu_depth--; in ath_tx_process_buffer()
722 ath_tx_complete_buf(sc, bf, txq, bf_head, sta, ts, txok); in ath_tx_process_buffer()
724 ath_tx_complete_aggr(sc, txq, bf, bf_head, sta, tid, ts, txok); in ath_tx_process_buffer()
727 ath_txq_schedule(sc, txq); in ath_tx_process_buffer()
760 int q = tid->txq->mac80211_qnum; in ath_lookup_rate()
894 ath_tx_get_tid_subframe(struct ath_softc *sc, struct ath_txq *txq, in ath_tx_get_tid_subframe() argument
912 bf = ath_tx_setup_buffer(sc, txq, tid, skb); in ath_tx_get_tid_subframe()
917 ath_txq_skb_done(sc, txq, skb); in ath_tx_get_tid_subframe()
968 ath_tx_complete_buf(sc, bf, txq, &bf_head, NULL, &ts, 0); in ath_tx_get_tid_subframe()
983 ath_tx_form_aggr(struct ath_softc *sc, struct ath_txq *txq, in ath_tx_form_aggr() argument
1041 ret = ath_tx_get_tid_subframe(sc, txq, tid, &bf); in ath_tx_form_aggr()
1056 TX_STAT_INC(sc, txq->axq_qnum, a_aggr); in ath_tx_form_aggr()
1348 struct ath_txq *txq, int len) in ath_tx_fill_desc() argument
1359 info.qcu = txq->axq_qnum; in ath_tx_fill_desc()
1379 txq == sc->tx.uapsdq) in ath_tx_fill_desc()
1440 ath_tx_form_burst(struct ath_softc *sc, struct ath_txq *txq, in ath_tx_form_burst() argument
1459 ret = ath_tx_get_tid_subframe(sc, txq, tid, &bf); in ath_tx_form_burst()
1473 static int ath_tx_sched_aggr(struct ath_softc *sc, struct ath_txq *txq, in ath_tx_sched_aggr() argument
1484 ret = ath_tx_get_tid_subframe(sc, txq, tid, &bf); in ath_tx_sched_aggr()
1490 if ((aggr && txq->axq_ampdu_depth >= ATH_AGGR_MIN_QDEPTH) || in ath_tx_sched_aggr()
1491 (!aggr && txq->axq_depth >= ATH_NON_AGGR_MIN_QDEPTH)) { in ath_tx_sched_aggr()
1498 aggr_len = ath_tx_form_aggr(sc, txq, tid, &bf_q, bf); in ath_tx_sched_aggr()
1500 ath_tx_form_burst(sc, txq, tid, &bf_q, bf); in ath_tx_sched_aggr()
1510 ath_tx_fill_desc(sc, bf, txq, aggr_len); in ath_tx_sched_aggr()
1511 ath_tx_txqaddbuf(sc, txq, &bf_q, false); in ath_tx_sched_aggr()
1520 struct ath_txq *txq; in ath_tx_aggr_start() local
1528 txq = txtid->txq; in ath_tx_aggr_start()
1530 ath_txq_lock(sc, txq); in ath_tx_aggr_start()
1550 ath_txq_unlock_complete(sc, txq); in ath_tx_aggr_start()
1560 struct ath_txq *txq = txtid->txq; in ath_tx_aggr_stop() local
1564 ath_txq_lock(sc, txq); in ath_tx_aggr_stop()
1567 ath_txq_unlock_complete(sc, txq); in ath_tx_aggr_stop()
1592 struct ath_txq *txq; in ath_tx_aggr_wakeup() local
1599 txq = tid->txq; in ath_tx_aggr_wakeup()
1601 ath_txq_lock(sc, txq); in ath_tx_aggr_wakeup()
1605 ath_txq_schedule(sc, txq); in ath_tx_aggr_wakeup()
1607 ath_txq_unlock_complete(sc, txq); in ath_tx_aggr_wakeup()
1636 struct ath_txq *txq = sc->tx.uapsdq; in ath9k_release_buffered_frames() local
1652 ath_txq_lock(sc, tid->txq); in ath9k_release_buffered_frames()
1670 TX_STAT_INC(sc, txq->axq_qnum, a_queued_hw); in ath9k_release_buffered_frames()
1675 ath_txq_unlock_complete(sc, tid->txq); in ath9k_release_buffered_frames()
1688 ath_txq_lock(sc, txq); in ath9k_release_buffered_frames()
1689 ath_tx_fill_desc(sc, bf, txq, 0); in ath9k_release_buffered_frames()
1690 ath_tx_txqaddbuf(sc, txq, &bf_q, false); in ath9k_release_buffered_frames()
1691 ath_txq_unlock(sc, txq); in ath9k_release_buffered_frames()
1750 struct ath_txq *txq = &sc->tx.txq[axq_qnum]; in ath_txq_setup() local
1752 txq->axq_qnum = axq_qnum; in ath_txq_setup()
1753 txq->mac80211_qnum = -1; in ath_txq_setup()
1754 txq->axq_link = NULL; in ath_txq_setup()
1755 __skb_queue_head_init(&txq->complete_q); in ath_txq_setup()
1756 INIT_LIST_HEAD(&txq->axq_q); in ath_txq_setup()
1757 spin_lock_init(&txq->axq_lock); in ath_txq_setup()
1758 txq->axq_depth = 0; in ath_txq_setup()
1759 txq->axq_ampdu_depth = 0; in ath_txq_setup()
1760 txq->axq_tx_inprogress = false; in ath_txq_setup()
1763 txq->txq_headidx = txq->txq_tailidx = 0; in ath_txq_setup()
1765 INIT_LIST_HEAD(&txq->txq_fifo[i]); in ath_txq_setup()
1767 return &sc->tx.txq[axq_qnum]; in ath_txq_setup()
1777 BUG_ON(sc->tx.txq[qnum].axq_qnum != qnum); in ath_txq_update()
1812 static void ath_drain_txq_list(struct ath_softc *sc, struct ath_txq *txq, in ath_drain_txq_list() argument
1835 ath_tx_process_buffer(sc, txq, &ts, bf, &bf_head); in ath_drain_txq_list()
1845 void ath_draintxq(struct ath_softc *sc, struct ath_txq *txq) in ath_draintxq() argument
1848 ath_txq_lock(sc, txq); in ath_draintxq()
1851 int idx = txq->txq_tailidx; in ath_draintxq()
1853 while (!list_empty(&txq->txq_fifo[idx])) { in ath_draintxq()
1854 ath_drain_txq_list(sc, txq, &txq->txq_fifo[idx]); in ath_draintxq()
1858 txq->txq_tailidx = idx; in ath_draintxq()
1861 txq->axq_link = NULL; in ath_draintxq()
1862 txq->axq_tx_inprogress = false; in ath_draintxq()
1863 ath_drain_txq_list(sc, txq, &txq->axq_q); in ath_draintxq()
1865 ath_txq_unlock_complete(sc, txq); in ath_draintxq()
1873 struct ath_txq *txq; in ath_drain_all_txq() local
1887 if (!sc->tx.txq[i].axq_depth) in ath_drain_all_txq()
1890 if (ath9k_hw_numtxpending(ah, sc->tx.txq[i].axq_qnum)) in ath_drain_all_txq()
1904 txq = &sc->tx.txq[i]; in ath_drain_all_txq()
1905 ath_draintxq(sc, txq); in ath_drain_all_txq()
1911 void ath_tx_cleanupq(struct ath_softc *sc, struct ath_txq *txq) in ath_tx_cleanupq() argument
1913 ath9k_hw_releasetxqueue(sc->sc_ah, txq->axq_qnum); in ath_tx_cleanupq()
1914 sc->tx.txqsetup &= ~(1<<txq->axq_qnum); in ath_tx_cleanupq()
1920 void ath_txq_schedule(struct ath_softc *sc, struct ath_txq *txq) in ath_txq_schedule() argument
1928 if (txq->mac80211_qnum < 0) in ath_txq_schedule()
1934 ieee80211_txq_schedule_start(hw, txq->mac80211_qnum); in ath_txq_schedule()
1941 while ((queue = ieee80211_next_txq(hw, txq->mac80211_qnum))) { in ath_txq_schedule()
1946 ret = ath_tx_sched_aggr(sc, txq, tid); in ath_txq_schedule()
1956 ieee80211_txq_schedule_end(hw, txq->mac80211_qnum); in ath_txq_schedule()
1961 struct ath_txq *txq; in ath_txq_schedule_all() local
1965 txq = sc->tx.txq_map[i]; in ath_txq_schedule_all()
1967 spin_lock_bh(&txq->axq_lock); in ath_txq_schedule_all()
1968 ath_txq_schedule(sc, txq); in ath_txq_schedule_all()
1969 spin_unlock_bh(&txq->axq_lock); in ath_txq_schedule_all()
1981 static void ath_tx_txqaddbuf(struct ath_softc *sc, struct ath_txq *txq, in ath_tx_txqaddbuf() argument
2003 txq->axq_qnum, txq->axq_depth); in ath_tx_txqaddbuf()
2005 if (edma && list_empty(&txq->txq_fifo[txq->txq_headidx])) { in ath_tx_txqaddbuf()
2006 list_splice_tail_init(head, &txq->txq_fifo[txq->txq_headidx]); in ath_tx_txqaddbuf()
2007 INCR(txq->txq_headidx, ATH_TXFIFO_DEPTH); in ath_tx_txqaddbuf()
2010 list_splice_tail_init(head, &txq->axq_q); in ath_tx_txqaddbuf()
2012 if (txq->axq_link) { in ath_tx_txqaddbuf()
2013 ath9k_hw_set_desc_link(ah, txq->axq_link, bf->bf_daddr); in ath_tx_txqaddbuf()
2015 txq->axq_qnum, txq->axq_link, in ath_tx_txqaddbuf()
2020 txq->axq_link = bf_last->bf_desc; in ath_tx_txqaddbuf()
2024 TX_STAT_INC(sc, txq->axq_qnum, puttxbuf); in ath_tx_txqaddbuf()
2025 ath9k_hw_puttxbuf(ah, txq->axq_qnum, bf->bf_daddr); in ath_tx_txqaddbuf()
2027 txq->axq_qnum, ito64(bf->bf_daddr), bf->bf_desc); in ath_tx_txqaddbuf()
2031 TX_STAT_INC(sc, txq->axq_qnum, txstart); in ath_tx_txqaddbuf()
2032 ath9k_hw_txstart(ah, txq->axq_qnum); in ath_tx_txqaddbuf()
2037 txq->axq_depth++; in ath_tx_txqaddbuf()
2039 txq->axq_ampdu_depth++; in ath_tx_txqaddbuf()
2048 static void ath_tx_send_normal(struct ath_softc *sc, struct ath_txq *txq, in ath_tx_send_normal() argument
2066 ath_tx_fill_desc(sc, bf, txq, fi->framelen); in ath_tx_send_normal()
2067 ath_tx_txqaddbuf(sc, txq, &bf_head, false); in ath_tx_send_normal()
2068 TX_STAT_INC(sc, txq->axq_qnum, queued); in ath_tx_send_normal()
2115 fi->txq = -1; in setup_frame_info()
2154 struct ath_txq *txq, in ath_tx_setup_buffer() argument
2282 struct ath_txq *txq = txctl->txq; in ath_tx_start() local
2303 txq = sc->tx.uapsdq; in ath_tx_start()
2310 ath_txq_lock(sc, txq); in ath_tx_start()
2311 if (txq == sc->tx.txq_map[q]) { in ath_tx_start()
2312 fi->txq = q; in ath_tx_start()
2313 ++txq->pending_frames; in ath_tx_start()
2316 bf = ath_tx_setup_buffer(sc, txq, tid, skb); in ath_tx_start()
2318 ath_txq_skb_done(sc, txq, skb); in ath_tx_start()
2332 ath_tx_send_normal(sc, txq, tid, skb); in ath_tx_start()
2335 ath_txq_unlock(sc, txq); in ath_tx_start()
2345 .txq = sc->beacon.cabq in ath_tx_cabq()
2364 bf = ath_tx_setup_buffer(sc, txctl.txq, NULL, skb); in ath_tx_cabq()
2395 ath_txq_lock(sc, txctl.txq); in ath_tx_cabq()
2396 ath_tx_fill_desc(sc, bf, txctl.txq, 0); in ath_tx_cabq()
2397 ath_tx_txqaddbuf(sc, txctl.txq, &bf_q, false); in ath_tx_cabq()
2398 TX_STAT_INC(sc, txctl.txq->axq_qnum, queued); in ath_tx_cabq()
2399 ath_txq_unlock(sc, txctl.txq); in ath_tx_cabq()
2407 int tx_flags, struct ath_txq *txq, in ath_tx_complete() argument
2442 if ((sc->ps_flags & PS_WAIT_FOR_TX_ACK) && !txq->axq_depth) { in ath_tx_complete()
2453 ath_txq_skb_done(sc, txq, skb); in ath_tx_complete()
2455 __skb_queue_tail(&txq->complete_q, skb); in ath_tx_complete()
2459 struct ath_txq *txq, struct list_head *bf_q, in ath_tx_complete_buf() argument
2487 ath_debug_stat_tx(sc, bf, ts, txq, tx_flags); in ath_tx_complete_buf()
2488 ath_tx_complete(sc, skb, tx_flags, txq, sta); in ath_tx_complete_buf()
2571 static void ath_tx_processq(struct ath_softc *sc, struct ath_txq *txq) in ath_tx_processq() argument
2582 txq->axq_qnum, ath9k_hw_gettxbuf(sc->sc_ah, txq->axq_qnum), in ath_tx_processq()
2583 txq->axq_link); in ath_tx_processq()
2585 ath_txq_lock(sc, txq); in ath_tx_processq()
2590 if (list_empty(&txq->axq_q)) { in ath_tx_processq()
2591 txq->axq_link = NULL; in ath_tx_processq()
2592 ath_txq_schedule(sc, txq); in ath_tx_processq()
2595 bf = list_first_entry(&txq->axq_q, struct ath_buf, list); in ath_tx_processq()
2608 if (list_is_last(&bf_held->list, &txq->axq_q)) in ath_tx_processq()
2623 TX_STAT_INC(sc, txq->axq_qnum, txprocdesc); in ath_tx_processq()
2634 &txq->axq_q, lastbf->list.prev); in ath_tx_processq()
2641 ath_tx_process_buffer(sc, txq, &ts, bf, &bf_head); in ath_tx_processq()
2643 ath_txq_unlock_complete(sc, txq); in ath_tx_processq()
2655 ath_tx_processq(sc, &sc->tx.txq[i]); in ath_tx_tasklet()
2665 struct ath_txq *txq; in ath_tx_edma_tasklet() local
2698 txq = &sc->tx.txq[ts.qid]; in ath_tx_edma_tasklet()
2700 ath_txq_lock(sc, txq); in ath_tx_edma_tasklet()
2702 TX_STAT_INC(sc, txq->axq_qnum, txprocdesc); in ath_tx_edma_tasklet()
2704 fifo_list = &txq->txq_fifo[txq->txq_tailidx]; in ath_tx_edma_tasklet()
2706 ath_txq_unlock(sc, txq); in ath_tx_edma_tasklet()
2722 INCR(txq->txq_tailidx, ATH_TXFIFO_DEPTH); in ath_tx_edma_tasklet()
2724 if (!list_empty(&txq->axq_q)) { in ath_tx_edma_tasklet()
2728 txq->axq_link = NULL; in ath_tx_edma_tasklet()
2729 list_splice_tail_init(&txq->axq_q, &bf_q); in ath_tx_edma_tasklet()
2730 ath_tx_txqaddbuf(sc, txq, &bf_q, true); in ath_tx_edma_tasklet()
2739 ath_tx_process_buffer(sc, txq, &ts, bf, &bf_head); in ath_tx_edma_tasklet()
2740 ath_txq_unlock_complete(sc, txq); in ath_tx_edma_tasklet()
2822 tid->txq = sc->tx.txq_map[acno]; in ath_tx_node_init()
2832 struct ath_txq *txq; in ath_tx_node_cleanup() local
2839 txq = tid->txq; in ath_tx_node_cleanup()
2841 ath_txq_lock(sc, txq); in ath_tx_node_cleanup()
2846 ath_tid_drain(sc, txq, tid); in ath_tx_node_cleanup()
2849 ath_txq_unlock(sc, txq); in ath_tx_node_cleanup()
2887 bf = ath_tx_setup_buffer(sc, txctl->txq, NULL, skb); in ath9k_tx99_send()
2896 ath9k_hw_tx99_start(sc->sc_ah, txctl->txq->axq_qnum); in ath9k_tx99_send()
2898 ath_tx_send_normal(sc, txctl->txq, NULL, skb); in ath9k_tx99_send()