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