• Home
  • Raw
  • Download

Lines Matching refs:sc

50 static void ath_tx_send_normal(struct ath_softc *sc, struct ath_txq *txq,
52 static void ath_tx_complete(struct ath_softc *sc, struct sk_buff *skb,
55 static void ath_tx_complete_buf(struct ath_softc *sc, struct ath_buf *bf,
59 static void ath_tx_txqaddbuf(struct ath_softc *sc, struct ath_txq *txq,
61 static void ath_tx_rc_status(struct ath_softc *sc, struct ath_buf *bf,
64 static void ath_tx_update_baw(struct ath_softc *sc, struct ath_atx_tid *tid,
66 static struct ath_buf *ath_tx_setup_buffer(struct ath_softc *sc,
101 void ath_txq_unlock_complete(struct ath_softc *sc, struct ath_txq *txq) in ath_txq_unlock_complete() argument
104 struct ieee80211_hw *hw = sc->hw; in ath_txq_unlock_complete()
116 void ath_tx_queue_tid(struct ath_softc *sc, struct ath_atx_tid *tid) in ath_tx_queue_tid() argument
121 ieee80211_schedule_txq(sc->hw, queue); in ath_tx_queue_tid()
126 struct ath_softc *sc = hw->priv; in ath9k_wake_tx_queue() local
127 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath9k_wake_tx_queue()
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
173 txq = sc->tx.txq_map[q]; in ath_txq_skb_done()
180 ath_get_skb_tid(struct ath_softc *sc, struct ath_node *an, struct sk_buff *skb) in ath_get_skb_tid() argument
190 struct ath_softc *sc = tid->an->sc; in ath_tid_pull() local
191 struct ieee80211_hw *hw = sc->hw; in ath_tid_pull()
211 if (tid->txq == sc->tx.txq_map[q]) { in ath_tid_pull()
232 static void ath_tx_flush_tid(struct ath_softc *sc, struct ath_atx_tid *tid) in ath_tx_flush_tid() argument
250 ath_txq_skb_done(sc, txq, skb); in ath_tx_flush_tid()
251 ieee80211_free_txskb(sc->hw, skb); in ath_tx_flush_tid()
256 ath_tx_update_baw(sc, tid, bf); 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()
271 static void ath_tx_update_baw(struct ath_softc *sc, struct ath_atx_tid *tid, in ath_tx_update_baw() argument
294 static void ath_tx_addto_baw(struct ath_softc *sc, struct ath_atx_tid *tid, in ath_tx_addto_baw() argument
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()
360 dma_sync_single_for_device(sc->dev, bf->bf_buf_addr, in ath_tx_set_retry()
364 static struct ath_buf *ath_tx_get_buffer(struct ath_softc *sc) in ath_tx_get_buffer() argument
368 spin_lock_bh(&sc->tx.txbuflock); in ath_tx_get_buffer()
370 if (unlikely(list_empty(&sc->tx.txbuf))) { in ath_tx_get_buffer()
371 spin_unlock_bh(&sc->tx.txbuflock); in ath_tx_get_buffer()
375 bf = list_first_entry(&sc->tx.txbuf, struct ath_buf, list); in ath_tx_get_buffer()
378 spin_unlock_bh(&sc->tx.txbuflock); in ath_tx_get_buffer()
383 static void ath_tx_return_buffer(struct ath_softc *sc, struct ath_buf *bf) in ath_tx_return_buffer() argument
385 spin_lock_bh(&sc->tx.txbuflock); in ath_tx_return_buffer()
386 list_add_tail(&bf->list, &sc->tx.txbuf); in ath_tx_return_buffer()
387 spin_unlock_bh(&sc->tx.txbuflock); in ath_tx_return_buffer()
390 static struct ath_buf* ath_clone_txbuf(struct ath_softc *sc, struct ath_buf *bf) in ath_clone_txbuf() argument
394 tbf = ath_tx_get_buffer(sc); in ath_clone_txbuf()
402 memcpy(tbf->bf_desc, bf->bf_desc, sc->sc_ah->caps.tx_desc_len); in ath_clone_txbuf()
409 static void ath_tx_count_frames(struct ath_softc *sc, struct ath_buf *bf, in ath_tx_count_frames() argument
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()
516 if (sc->sc_ah->opmode == NL80211_IFTYPE_STATION) in ath_tx_complete_aggr()
523 ath_tx_count_frames(sc, bf, ts, txok, &nframes, &nbad); in ath_tx_complete_aggr()
552 ath_tx_set_retry(sc, txq, bf->bf_mpdu, in ath_tx_complete_aggr()
576 ath_tx_update_baw(sc, tid, bf); in ath_tx_complete_aggr()
580 ath_tx_rc_status(sc, bf, ts, nframes, nbad, txok); in ath_tx_complete_aggr()
583 ath_dynack_sample_tx_ts(sc->sc_ah, in ath_tx_complete_aggr()
588 ath_tx_complete_buf(sc, bf, txq, &bf_head, sta, ts, in ath_tx_complete_aggr()
599 tbf = ath_clone_txbuf(sc, bf_last); in ath_tx_complete_aggr()
606 ath_tx_update_baw(sc, tid, bf); in ath_tx_complete_aggr()
608 ath_tx_complete_buf(sc, bf, txq, in ath_tx_complete_aggr()
636 ath_tx_queue_tid(sc, tid); 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()
654 ath9k_queue_reset(sc, RESET_TYPE_TX_ERROR); in ath_tx_complete_aggr()
663 static void ath_tx_count_airtime(struct ath_softc *sc, in ath_tx_count_airtime() argument
674 int rate_dur = ath9k_hw_get_duration(sc->sc_ah, bf->bf_desc, i); in ath_tx_count_airtime()
681 static void ath_tx_process_buffer(struct ath_softc *sc, struct ath_txq *txq, in ath_tx_process_buffer() argument
685 struct ieee80211_hw *hw = sc->hw; in ath_tx_process_buffer()
700 ts->duration = ath9k_hw_get_duration(sc->sc_ah, bf->bf_desc, in ath_tx_process_buffer()
707 tid = ath_get_skb_tid(sc, an, bf->bf_mpdu); in ath_tx_process_buffer()
708 ath_tx_count_airtime(sc, sta, bf, ts, tid->tidno); in ath_tx_process_buffer()
718 ath_tx_rc_status(sc, bf, ts, 1, txok ? 0 : 1, txok); in ath_tx_process_buffer()
719 ath_dynack_sample_tx_ts(sc->sc_ah, bf->bf_mpdu, ts, 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()
752 static u32 ath_lookup_rate(struct ath_softc *sc, struct ath_buf *bf, in ath_lookup_rate() argument
792 frmlen = sc->tx.max_aggr_framelen[q][modeidx][rates[i].idx]; in ath_lookup_rate()
809 bt_aggr_limit = ath9k_btcoex_aggr_limit(sc, max_4ms_framelen); in ath_lookup_rate()
823 static int ath_compute_num_delims(struct ath_softc *sc, struct ath_atx_tid *tid, in ath_compute_num_delims() argument
844 !(sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_EDMA)) in ath_compute_num_delims()
851 if (first_subfrm && !AR_SREV_9580_10_OR_LATER(sc->sc_ah) && in ath_compute_num_delims()
852 (sc->sc_ah->ent_mode & AR_ENT_OTP_MIN_PKT_SIZE_DISABLE)) in ath_compute_num_delims()
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()
918 ieee80211_free_txskb(sc->hw, skb); in ath_tx_get_tid_subframe()
967 ath_tx_update_baw(sc, tid, bf); 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()
973 ath_tx_addto_baw(sc, tid, bf); 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
998 aggr_limit = ath_lookup_rate(sc, bf, tid); in ath_tx_form_aggr()
1025 ndelim = ath_compute_num_delims(sc, tid, bf_first, fi->framelen, in ath_tx_form_aggr()
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()
1069 u32 ath_pkt_duration(struct ath_softc *sc, u8 rix, int pktlen, in ath_pkt_duration() argument
1109 void ath_update_max_aggr_framelen(struct ath_softc *sc, int queue, int txop) in ath_update_max_aggr_framelen() argument
1118 cur_ht20 = sc->tx.max_aggr_framelen[queue][MCS_HT20]; in ath_update_max_aggr_framelen()
1119 cur_ht20_sgi = sc->tx.max_aggr_framelen[queue][MCS_HT20_SGI]; in ath_update_max_aggr_framelen()
1120 cur_ht40 = sc->tx.max_aggr_framelen[queue][MCS_HT40]; in ath_update_max_aggr_framelen()
1121 cur_ht40_sgi = sc->tx.max_aggr_framelen[queue][MCS_HT40_SGI]; in ath_update_max_aggr_framelen()
1130 static u8 ath_get_rate_txpower(struct ath_softc *sc, struct ath_buf *bf, in ath_get_rate_txpower() argument
1137 struct ath_hw *ah = sc->sc_ah; in ath_get_rate_txpower()
1139 if (sc->tx99_state || !ah->tpc_enabled) in ath_get_rate_txpower()
1204 static void ath_buf_set_rate(struct ath_softc *sc, struct ath_buf *bf, in ath_buf_set_rate() argument
1207 struct ath_hw *ah = sc->sc_ah; in ath_buf_set_rate()
1215 u32 rts_thresh = sc->hw->wiphy->rts_threshold; in ath_buf_set_rate()
1268 info->rates[i].ChSel = ath_txchainmask_reduction(sc, in ath_buf_set_rate()
1270 info->rates[i].PktDuration = ath_pkt_duration(sc, rix, len, in ath_buf_set_rate()
1275 info->txpower[i] = ath_get_rate_txpower(sc, bf, rix, in ath_buf_set_rate()
1299 info->rates[i].ChSel = ath_txchainmask_reduction(sc, in ath_buf_set_rate()
1302 info->rates[i].PktDuration = ath9k_hw_computetxtime(sc->sc_ah, in ath_buf_set_rate()
1306 info->txpower[i] = ath_get_rate_txpower(sc, bf, rix, false, in ath_buf_set_rate()
1311 if (bf_isaggr(bf) && (len > sc->sc_ah->caps.rts_aggr_limit)) in ath_buf_set_rate()
1342 static void ath_tx_fill_desc(struct ath_softc *sc, struct ath_buf *bf, in ath_tx_fill_desc() argument
1345 struct ath_hw *ah = sc->sc_ah; in ath_tx_fill_desc()
1348 u32 rts_thresh = sc->hw->wiphy->rts_threshold; in ath_tx_fill_desc()
1366 info.link = (sc->tx99_state) ? bf->bf_daddr : 0; in ath_tx_fill_desc()
1371 if (!sc->tx99_state) in ath_tx_fill_desc()
1374 txq == sc->tx.uapsdq) in ath_tx_fill_desc()
1405 ath_buf_set_rate(sc, bf, &info, len, rts); in ath_tx_fill_desc()
1435 ath_tx_form_burst(struct ath_softc *sc, struct ath_txq *txq, in ath_tx_form_burst() argument
1454 ret = ath_tx_get_tid_subframe(sc, txq, tid, &bf); in ath_tx_form_burst()
1468 static int ath_tx_sched_aggr(struct ath_softc *sc, struct ath_txq *txq, in ath_tx_sched_aggr() argument
1479 ret = ath_tx_get_tid_subframe(sc, txq, tid, &bf); in ath_tx_sched_aggr()
1493 aggr_len = ath_tx_form_aggr(sc, txq, tid, &bf_q, bf); in ath_tx_sched_aggr()
1495 ath_tx_form_burst(sc, txq, tid, &bf_q, bf); in ath_tx_sched_aggr()
1505 ath_tx_fill_desc(sc, bf, txq, aggr_len); in ath_tx_sched_aggr()
1506 ath_tx_txqaddbuf(sc, txq, &bf_q, false); in ath_tx_sched_aggr()
1510 int ath_tx_aggr_start(struct ath_softc *sc, struct ieee80211_sta *sta, in ath_tx_aggr_start() argument
1513 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath_tx_aggr_start()
1525 ath_txq_lock(sc, txq); in ath_tx_aggr_start()
1545 ath_txq_unlock_complete(sc, txq); in ath_tx_aggr_start()
1550 void ath_tx_aggr_stop(struct ath_softc *sc, struct ieee80211_sta *sta, u16 tid) in ath_tx_aggr_stop() argument
1552 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath_tx_aggr_stop()
1559 ath_txq_lock(sc, txq); in ath_tx_aggr_stop()
1561 ath_tx_flush_tid(sc, txtid); in ath_tx_aggr_stop()
1562 ath_txq_unlock_complete(sc, txq); in ath_tx_aggr_stop()
1565 void ath_tx_aggr_sleep(struct ieee80211_sta *sta, struct ath_softc *sc, in ath_tx_aggr_sleep() argument
1568 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath_tx_aggr_sleep()
1583 void ath_tx_aggr_wakeup(struct ath_softc *sc, struct ath_node *an) in ath_tx_aggr_wakeup() argument
1585 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath_tx_aggr_wakeup()
1596 ath_txq_lock(sc, txq); in ath_tx_aggr_wakeup()
1599 ath_tx_queue_tid(sc, tid); in ath_tx_aggr_wakeup()
1600 ath_txq_schedule(sc, txq); in ath_tx_aggr_wakeup()
1602 ath_txq_unlock_complete(sc, txq); in ath_tx_aggr_wakeup()
1609 ath9k_set_moredata(struct ath_softc *sc, struct ath_buf *bf, bool val) in ath9k_set_moredata() argument
1618 dma_sync_single_for_device(sc->dev, bf->bf_buf_addr, in ath9k_set_moredata()
1629 struct ath_softc *sc = hw->priv; in ath9k_release_buffered_frames() local
1631 struct ath_txq *txq = sc->tx.uapsdq; in ath9k_release_buffered_frames()
1647 ath_txq_lock(sc, tid->txq); in ath9k_release_buffered_frames()
1649 ret = ath_tx_get_tid_subframe(sc, sc->tx.uapsdq, in ath9k_release_buffered_frames()
1654 ath9k_set_moredata(sc, bf, true); in ath9k_release_buffered_frames()
1665 TX_STAT_INC(sc, txq->axq_qnum, a_queued_hw); in ath9k_release_buffered_frames()
1670 ath_txq_unlock_complete(sc, tid->txq); in ath9k_release_buffered_frames()
1677 ath9k_set_moredata(sc, bf_tail, false); in ath9k_release_buffered_frames()
1683 ath_txq_lock(sc, txq); in ath9k_release_buffered_frames()
1684 ath_tx_fill_desc(sc, bf, txq, 0); in ath9k_release_buffered_frames()
1685 ath_tx_txqaddbuf(sc, txq, &bf_q, false); in ath9k_release_buffered_frames()
1686 ath_txq_unlock(sc, txq); in ath9k_release_buffered_frames()
1693 struct ath_txq *ath_txq_setup(struct ath_softc *sc, int qtype, int subtype) in ath_txq_setup() argument
1695 struct ath_hw *ah = sc->sc_ah; in ath_txq_setup()
1744 if (!ATH_TXQ_SETUP(sc, axq_qnum)) { in ath_txq_setup()
1745 struct ath_txq *txq = &sc->tx.txq[axq_qnum]; in ath_txq_setup()
1756 sc->tx.txqsetup |= 1<<axq_qnum; in ath_txq_setup()
1762 return &sc->tx.txq[axq_qnum]; in ath_txq_setup()
1765 int ath_txq_update(struct ath_softc *sc, int qnum, in ath_txq_update() argument
1768 struct ath_hw *ah = sc->sc_ah; in ath_txq_update()
1772 BUG_ON(sc->tx.txq[qnum].axq_qnum != qnum); in ath_txq_update()
1782 ath_err(ath9k_hw_common(sc->sc_ah), in ath_txq_update()
1792 int ath_cabq_update(struct ath_softc *sc) in ath_cabq_update() argument
1795 struct ath_beacon_config *cur_conf = &sc->cur_chan->beacon; in ath_cabq_update()
1796 int qnum = sc->beacon.cabq->axq_qnum; in ath_cabq_update()
1798 ath9k_hw_get_txq_props(sc->sc_ah, qnum, &qi); in ath_cabq_update()
1802 ath_txq_update(sc, qnum, &qi); in ath_cabq_update()
1807 static void ath_drain_txq_list(struct ath_softc *sc, struct ath_txq *txq, in ath_drain_txq_list() argument
1824 ath_tx_return_buffer(sc, bf); in ath_drain_txq_list()
1830 ath_tx_process_buffer(sc, txq, &ts, bf, &bf_head); in ath_drain_txq_list()
1840 void ath_draintxq(struct ath_softc *sc, struct ath_txq *txq) in ath_draintxq() argument
1843 ath_txq_lock(sc, txq); in ath_draintxq()
1845 if (sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_EDMA) { in ath_draintxq()
1849 ath_drain_txq_list(sc, txq, &txq->txq_fifo[idx]); in ath_draintxq()
1858 ath_drain_txq_list(sc, txq, &txq->axq_q); in ath_draintxq()
1860 ath_txq_unlock_complete(sc, txq); in ath_draintxq()
1864 bool ath_drain_all_txq(struct ath_softc *sc) in ath_drain_all_txq() argument
1866 struct ath_hw *ah = sc->sc_ah; in ath_drain_all_txq()
1867 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath_drain_all_txq()
1879 if (!ATH_TXQ_SETUP(sc, i)) in ath_drain_all_txq()
1882 if (!sc->tx.txq[i].axq_depth) in ath_drain_all_txq()
1885 if (ath9k_hw_numtxpending(ah, sc->tx.txq[i].axq_qnum)) in ath_drain_all_txq()
1890 RESET_STAT_INC(sc, RESET_TX_DMA_ERROR); in ath_drain_all_txq()
1896 if (!ATH_TXQ_SETUP(sc, i)) in ath_drain_all_txq()
1899 txq = &sc->tx.txq[i]; 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
1917 struct ieee80211_hw *hw = sc->hw; in ath_txq_schedule()
1918 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath_txq_schedule()
1930 spin_lock_bh(&sc->chan_lock); in ath_txq_schedule()
1933 if (sc->cur_chan->stopped) in ath_txq_schedule()
1941 ret = ath_tx_sched_aggr(sc, txq, tid); in ath_txq_schedule()
1950 spin_unlock_bh(&sc->chan_lock); in ath_txq_schedule()
1954 void ath_txq_schedule_all(struct ath_softc *sc) in ath_txq_schedule_all() argument
1960 txq = sc->tx.txq_map[i]; in ath_txq_schedule_all()
1963 ath_txq_schedule(sc, txq); in ath_txq_schedule_all()
1976 static void ath_tx_txqaddbuf(struct ath_softc *sc, struct ath_txq *txq, in ath_tx_txqaddbuf() argument
1979 struct ath_hw *ah = sc->sc_ah; in ath_tx_txqaddbuf()
2019 TX_STAT_INC(sc, txq->axq_qnum, puttxbuf); in ath_tx_txqaddbuf()
2025 if (!edma || sc->tx99_state) { in ath_tx_txqaddbuf()
2026 TX_STAT_INC(sc, txq->axq_qnum, txstart); in ath_tx_txqaddbuf()
2043 static void ath_tx_send_normal(struct ath_softc *sc, struct ath_txq *txq, in ath_tx_send_normal() argument
2056 ath_tx_addto_baw(sc, tid, bf); in ath_tx_send_normal()
2061 ath_tx_fill_desc(sc, bf, txq, fi->framelen); in ath_tx_send_normal()
2062 ath_tx_txqaddbuf(sc, txq, &bf_head, false); in ath_tx_send_normal()
2063 TX_STAT_INC(sc, txq->axq_qnum, queued); in ath_tx_send_normal()
2101 struct ath_softc *sc = hw->priv; in setup_frame_info() local
2103 txpower = sc->cur_chan->cur_txpower; in setup_frame_info()
2125 u8 ath_txchainmask_reduction(struct ath_softc *sc, u8 chainmask, u32 rate) in ath_txchainmask_reduction() argument
2127 struct ath_hw *ah = sc->sc_ah; in ath_txchainmask_reduction()
2144 static struct ath_buf *ath_tx_setup_buffer(struct ath_softc *sc, in ath_tx_setup_buffer() argument
2149 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath_tx_setup_buffer()
2156 bf = ath_tx_get_buffer(sc); in ath_tx_setup_buffer()
2180 bf->bf_buf_addr = dma_map_single(sc->dev, skb->data, in ath_tx_setup_buffer()
2182 if (unlikely(dma_mapping_error(sc->dev, bf->bf_buf_addr))) { in ath_tx_setup_buffer()
2185 ath_err(ath9k_hw_common(sc->sc_ah), in ath_tx_setup_buffer()
2187 ath_tx_return_buffer(sc, bf); in ath_tx_setup_buffer()
2226 struct ath_softc *sc = hw->priv; in ath_tx_prepare() local
2241 ath_assign_seq(ath9k_hw_common(sc->sc_ah), skb); in ath_tx_prepare()
2272 struct ath_softc *sc = hw->priv; in ath_tx_start() local
2294 txq = sc->tx.uapsdq; in ath_tx_start()
2298 tid = ath_get_skb_tid(sc, an, skb); in ath_tx_start()
2301 ath_txq_lock(sc, txq); in ath_tx_start()
2302 if (txq == sc->tx.txq_map[q]) { in ath_tx_start()
2307 bf = ath_tx_setup_buffer(sc, txq, tid, skb); in ath_tx_start()
2309 ath_txq_skb_done(sc, txq, skb); in ath_tx_start()
2313 ieee80211_free_txskb(sc->hw, skb); in ath_tx_start()
2323 ath_tx_send_normal(sc, txq, tid, skb); in ath_tx_start()
2326 ath_txq_unlock(sc, txq); in ath_tx_start()
2334 struct ath_softc *sc = hw->priv; in ath_tx_cabq() local
2336 .txq = sc->beacon.cabq in ath_tx_cabq()
2346 sc->cur_chan->beacon.beacon_interval * 1000 * in ath_tx_cabq()
2347 sc->cur_chan->beacon.dtim_period / ATH_BCBUF; in ath_tx_cabq()
2355 bf = ath_tx_setup_buffer(sc, txctl.txq, NULL, skb); in ath_tx_cabq()
2361 ath_buf_set_rate(sc, bf, &info, fi->framelen, false); in ath_tx_cabq()
2383 ath9k_set_moredata(sc, bf, false); in ath_tx_cabq()
2386 ath_txq_lock(sc, txctl.txq); in ath_tx_cabq()
2387 ath_tx_fill_desc(sc, bf, txctl.txq, 0); in ath_tx_cabq()
2388 ath_tx_txqaddbuf(sc, txctl.txq, &bf_q, false); in ath_tx_cabq()
2389 TX_STAT_INC(sc, txctl.txq->axq_qnum, queued); in ath_tx_cabq()
2390 ath_txq_unlock(sc, txctl.txq); in ath_tx_cabq()
2397 static void ath_tx_complete(struct ath_softc *sc, struct sk_buff *skb, in ath_tx_complete() argument
2402 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath_tx_complete()
2409 if (sc->sc_ah->caldata) in ath_tx_complete()
2410 set_bit(PAPRD_PACKET_SENT, &sc->sc_ah->caldata->cal_flags); in ath_tx_complete()
2432 spin_lock_irqsave(&sc->sc_pm_lock, flags); in ath_tx_complete()
2433 if ((sc->ps_flags & PS_WAIT_FOR_TX_ACK) && !txq->axq_depth) { in ath_tx_complete()
2434 sc->ps_flags &= ~PS_WAIT_FOR_TX_ACK; in ath_tx_complete()
2437 sc->ps_flags & (PS_WAIT_FOR_BEACON | in ath_tx_complete()
2442 spin_unlock_irqrestore(&sc->sc_pm_lock, flags); in ath_tx_complete()
2444 ath_txq_skb_done(sc, txq, skb); in ath_tx_complete()
2449 static void ath_tx_complete_buf(struct ath_softc *sc, struct ath_buf *bf, in ath_tx_complete_buf() argument
2465 dma_unmap_single(sc->dev, bf->bf_buf_addr, skb->len, DMA_TO_DEVICE); in ath_tx_complete_buf()
2467 if (sc->tx99_state) in ath_tx_complete_buf()
2476 complete(&sc->paprd_complete); in ath_tx_complete_buf()
2478 ath_debug_stat_tx(sc, bf, ts, txq, tx_flags); in ath_tx_complete_buf()
2479 ath_tx_complete(sc, skb, tx_flags, txq, sta); in ath_tx_complete_buf()
2490 spin_lock_irqsave(&sc->tx.txbuflock, flags); in ath_tx_complete_buf()
2491 list_splice_tail_init(bf_q, &sc->tx.txbuf); in ath_tx_complete_buf()
2492 spin_unlock_irqrestore(&sc->tx.txbuflock, flags); in ath_tx_complete_buf()
2495 static void ath_tx_rc_status(struct ath_softc *sc, struct ath_buf *bf, in ath_tx_rc_status() argument
2502 struct ieee80211_hw *hw = sc->hw; in ath_tx_rc_status()
2503 struct ath_hw *ah = sc->sc_ah; in ath_tx_rc_status()
2537 ah->tx_trig_level >= sc->sc_ah->config.max_txtrig_level) in ath_tx_rc_status()
2553 static void ath_tx_processq(struct ath_softc *sc, struct ath_txq *txq) in ath_tx_processq() argument
2555 struct ath_hw *ah = sc->sc_ah; in ath_tx_processq()
2564 txq->axq_qnum, ath9k_hw_gettxbuf(sc->sc_ah, txq->axq_qnum), in ath_tx_processq()
2567 ath_txq_lock(sc, txq); in ath_tx_processq()
2574 ath_txq_schedule(sc, txq); in ath_tx_processq()
2605 TX_STAT_INC(sc, txq->axq_qnum, txprocdesc); in ath_tx_processq()
2620 ath_tx_return_buffer(sc, bf_held); in ath_tx_processq()
2623 ath_tx_process_buffer(sc, txq, &ts, bf, &bf_head); in ath_tx_processq()
2625 ath_txq_unlock_complete(sc, txq); in ath_tx_processq()
2628 void ath_tx_tasklet(struct ath_softc *sc) in ath_tx_tasklet() argument
2630 struct ath_hw *ah = sc->sc_ah; in ath_tx_tasklet()
2636 if (ATH_TXQ_SETUP(sc, i) && (qcumask & (1 << i))) in ath_tx_tasklet()
2637 ath_tx_processq(sc, &sc->tx.txq[i]); in ath_tx_tasklet()
2642 void ath_tx_edma_tasklet(struct ath_softc *sc) in ath_tx_edma_tasklet() argument
2645 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath_tx_edma_tasklet()
2646 struct ath_hw *ah = sc->sc_ah; in ath_tx_edma_tasklet()
2667 if (ts.qid == sc->beacon.beaconq) { in ath_tx_edma_tasklet()
2668 sc->beacon.tx_processed = true; in ath_tx_edma_tasklet()
2669 sc->beacon.tx_last = !(ts.ts_status & ATH9K_TXERR_MASK); in ath_tx_edma_tasklet()
2672 ath_chanctx_event(sc, NULL, in ath_tx_edma_tasklet()
2676 ath9k_csa_update(sc); in ath_tx_edma_tasklet()
2680 txq = &sc->tx.txq[ts.qid]; in ath_tx_edma_tasklet()
2682 ath_txq_lock(sc, txq); in ath_tx_edma_tasklet()
2684 TX_STAT_INC(sc, txq->axq_qnum, txprocdesc); in ath_tx_edma_tasklet()
2688 ath_txq_unlock(sc, txq); in ath_tx_edma_tasklet()
2695 ath_tx_return_buffer(sc, bf); in ath_tx_edma_tasklet()
2712 ath_tx_txqaddbuf(sc, txq, &bf_q, true); in ath_tx_edma_tasklet()
2721 ath_tx_process_buffer(sc, txq, &ts, bf, &bf_head); in ath_tx_edma_tasklet()
2722 ath_txq_unlock_complete(sc, txq); in ath_tx_edma_tasklet()
2731 static int ath_txstatus_setup(struct ath_softc *sc, int size) in ath_txstatus_setup() argument
2733 struct ath_descdma *dd = &sc->txsdma; in ath_txstatus_setup()
2734 u8 txs_len = sc->sc_ah->caps.txs_len; in ath_txstatus_setup()
2737 dd->dd_desc = dmam_alloc_coherent(sc->dev, dd->dd_desc_len, in ath_txstatus_setup()
2745 static int ath_tx_edma_init(struct ath_softc *sc) in ath_tx_edma_init() argument
2749 err = ath_txstatus_setup(sc, ATH_TXSTATUS_RING_SIZE); in ath_tx_edma_init()
2751 ath9k_hw_setup_statusring(sc->sc_ah, sc->txsdma.dd_desc, in ath_tx_edma_init()
2752 sc->txsdma.dd_desc_paddr, in ath_tx_edma_init()
2758 int ath_tx_init(struct ath_softc *sc, int nbufs) in ath_tx_init() argument
2760 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath_tx_init()
2763 spin_lock_init(&sc->tx.txbuflock); in ath_tx_init()
2765 error = ath_descdma_setup(sc, &sc->tx.txdma, &sc->tx.txbuf, in ath_tx_init()
2773 error = ath_descdma_setup(sc, &sc->beacon.bdma, &sc->beacon.bbuf, in ath_tx_init()
2781 if (sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_EDMA) in ath_tx_init()
2782 error = ath_tx_edma_init(sc); in ath_tx_init()
2787 void ath_tx_node_init(struct ath_softc *sc, struct ath_node *an) in ath_tx_node_init() argument
2804 tid->txq = sc->tx.txq_map[acno]; in ath_tx_node_init()
2811 void ath_tx_node_cleanup(struct ath_softc *sc, struct ath_node *an) in ath_tx_node_cleanup() argument
2823 ath_txq_lock(sc, txq); in ath_tx_node_cleanup()
2828 ath_tid_drain(sc, txq, tid); in ath_tx_node_cleanup()
2831 ath_txq_unlock(sc, txq); in ath_tx_node_cleanup()
2842 int ath9k_tx99_send(struct ath_softc *sc, struct sk_buff *skb, in ath9k_tx99_send() argument
2847 struct ath_common *common = ath9k_hw_common(sc->sc_ah); in ath9k_tx99_send()
2869 bf = ath_tx_setup_buffer(sc, txctl->txq, NULL, skb); in ath9k_tx99_send()
2875 ath_set_rates(sc->tx99_vif, NULL, bf); in ath9k_tx99_send()
2877 ath9k_hw_set_desc_link(sc->sc_ah, bf->bf_desc, bf->bf_daddr); in ath9k_tx99_send()
2878 ath9k_hw_tx99_start(sc->sc_ah, txctl->txq->axq_qnum); in ath9k_tx99_send()
2880 ath_tx_send_normal(sc, txctl->txq, NULL, skb); in ath9k_tx99_send()