Lines Matching refs:bf
99 static void arn_tx_complete_buf(struct arn_softc *sc, struct ath_buf *bf,
103 static void arn_buf_set_rate(struct arn_softc *sc, struct ath_buf *bf);
105 struct ath_buf *bf, int txok);
106 static void arn_tx_rc_status(struct ath_buf *bf, struct ath_desc *ds,
215 struct ath_buf *bf; in arn_tx_flush_tid() local
232 bf = list_head(&tid->buf_q); in arn_tx_flush_tid()
233 ASSERT(!bf_isretried(bf)); in arn_tx_flush_tid()
234 list_remove(&tid->buf_q, bf); in arn_tx_flush_tid()
235 list_insert_tail(&list, bf); in arn_tx_flush_tid()
262 struct ath_buf *bf) in arn_tx_addto_baw() argument
266 if (bf_isretried(bf)) in arn_tx_addto_baw()
269 index = ATH_BA_INDEX(tid->seq_start, bf->bf_seqno); in arn_tx_addto_baw()
273 tid->tx_buf[cindex] = bf; in arn_tx_addto_baw()
293 struct ath_buf *bf; in arn_tid_drain() local
303 bf = list_head(&tid->buf_q); in arn_tid_drain()
304 list_remove(&tid->buf_q, bf); in arn_tid_drain()
305 list_insert_tail(&list, bf); in arn_tid_drain()
307 if (bf_isretried(bf)) in arn_tid_drain()
308 arn_tx_update_baw(sc, tid, bf->bf_seqno); in arn_tid_drain()
311 arn_tx_complete_buf(sc, bf, &list, 0, 0); in arn_tid_drain()
320 arn_tx_set_retry(struct arn_softc *sc, struct ath_buf *bf) in arn_tx_set_retry() argument
323 wh = (struct ieee80211_frame *)bf->bf_dma.mem_va; in arn_tx_set_retry()
325 bf->bf_state.bf_type |= BUF_RETRY; in arn_tx_set_retry()
326 bf->bf_retries++; in arn_tx_set_retry()
332 arn_clone_txbuf(struct arn_softc *sc, struct ath_buf *bf) in arn_clone_txbuf() argument
345 tbf->bf_daddr = bf->bf_daddr; /* physical addr of desc */ in arn_clone_txbuf()
346 tbf->bf_dma = bf->bf_dma; /* dma area for buf */ in arn_clone_txbuf()
347 *(tbf->bf_desc) = *(bf->bf_desc); /* virtual addr of desc */ in arn_clone_txbuf()
348 tbf->bf_state = bf->bf_state; /* buffer state */ in arn_clone_txbuf()
355 struct ath_buf *bf, list_t *bf_q, int txok) in arn_tx_complete_aggr() argument
360 struct ath_buf *bf_next, *bf_last = bf->bf_lastbf; in arn_tx_complete_aggr()
370 tid = ATH_AN_2_TID(an, bf->bf_tidno); in arn_tx_complete_aggr()
372 isaggr = bf_isaggr(bf); in arn_tx_complete_aggr()
398 nbad = arn_tx_num_badfrms(sc, bf, txok); in arn_tx_complete_aggr()
399 while (bf) { in arn_tx_complete_aggr()
401 bf_next = bf->bf_next; in arn_tx_complete_aggr()
403 if (ATH_BA_ISSET(ba, ATH_BA_INDEX(seq_st, bf->bf_seqno))) { in arn_tx_complete_aggr()
415 if (bf->bf_retries < ATH_MAX_SW_RETRIES) { in arn_tx_complete_aggr()
416 arn_tx_set_retry(sc, bf); in arn_tx_complete_aggr()
419 bf->bf_state.bf_type |= BUF_XRETRY; in arn_tx_complete_aggr()
439 list_remove(bf_q, bf); in arn_tx_complete_aggr()
440 list_insert_tail(&list, bf); in arn_tx_complete_aggr()
449 arn_tx_update_baw(sc, tid, bf->bf_seqno); in arn_tx_complete_aggr()
453 ath_tx_rc_status(bf, ds, nbad, txok, B_TRUE); in arn_tx_complete_aggr()
456 ath_tx_rc_status(bf, ds, nbad, txok, B_FALSE); in arn_tx_complete_aggr()
459 ath_tx_complete_buf(sc, bf, list, !txfail, sendbar); in arn_tx_complete_aggr()
462 if (bf->bf_next == NULL && in arn_tx_complete_aggr()
474 ath9k_hw_cleartxdesc(sc->sc_ah, bf->bf_desc); in arn_tx_complete_aggr()
490 bf = bf_next; in arn_tx_complete_aggr()
519 arn_lookup_rate(struct arn_softc *sc, struct ath_buf *bf, in arn_lookup_rate() argument
530 rates = (struct ath9k_tx_rate *)bf->rates; in arn_lookup_rate()
531 tx_info_priv = (struct ath_tx_info_priv *)&bf->tx_info_priv; in arn_lookup_rate()
583 struct ath_buf *bf, uint16_t frmlen) in arn_compute_num_delims() argument
586 struct ath9k_tx_rate *rates = (struct ath9k_tx_rate *)bf->rates; in arn_compute_num_delims()
601 if (bf->bf_keytype != ATH9K_KEY_TYPE_CLEAR) in arn_compute_num_delims()
649 struct ath_buf *bf, *bf_first, *bf_prev = NULL; in arn_tx_form_aggr() local
658 bf = list_head(&tid->buf_q); in arn_tx_form_aggr()
661 if (!BAW_WITHIN(tid->seq_start, tid->baw_size, bf->bf_seqno)) { in arn_tx_form_aggr()
667 aggr_limit = arn_lookup_rate(sc, bf, tid); in arn_tx_form_aggr()
672 al_delta = ATH_AGGR_DELIM_SZ + bf->bf_frmlen; in arn_tx_form_aggr()
695 arn_compute_num_delims(sc, tid, bf_first, bf->bf_frmlen); in arn_tx_form_aggr()
698 bf->bf_next = NULL; in arn_tx_form_aggr()
699 bf->bf_desc->ds_link = 0; in arn_tx_form_aggr()
702 arn_tx_addto_baw(sc, tid, bf); in arn_tx_form_aggr()
703 ath9k_hw_set11n_aggr_middle(sc->sc_ah, bf->bf_desc, ndelim); in arn_tx_form_aggr()
704 list_remove(&tid->buf_q, bf); in arn_tx_form_aggr()
705 list_insert_tail(bf_q, bf); in arn_tx_form_aggr()
707 bf_prev->bf_next = bf; in arn_tx_form_aggr()
708 bf_prev->bf_desc->ds_link = bf->bf_daddr; in arn_tx_form_aggr()
710 bf_prev = bf; in arn_tx_form_aggr()
724 struct ath_buf *bf; in arn_tx_sched_aggr() local
745 bf = list_head(&bf_q); in arn_tx_sched_aggr()
746 bf->bf_lastbf = list_object(&bf_q, bf->bf_node.list_prev); in arn_tx_sched_aggr()
749 if (bf->bf_nframes == 1) { in arn_tx_sched_aggr()
750 bf->bf_state.bf_type &= ~BUF_AGGR; in arn_tx_sched_aggr()
751 ath9k_hw_clr11n_aggr(sc->sc_ah, bf->bf_desc); in arn_tx_sched_aggr()
752 ath_buf_set_rate(sc, bf); in arn_tx_sched_aggr()
758 bf->bf_state.bf_type |= BUF_AGGR; in arn_tx_sched_aggr()
759 ath_buf_set_rate(sc, bf); in arn_tx_sched_aggr()
760 ath9k_hw_set11n_aggr_first(sc->sc_ah, bf->bf_desc, bf->bf_al); in arn_tx_sched_aggr()
763 ath9k_hw_set11n_aggr_last(sc->sc_ah, bf->bf_lastbf->bf_desc); in arn_tx_sched_aggr()
797 struct ath_buf *bf; in arn_tx_aggr_stop() local
817 bf = list_head(&txtid->buf_q); in arn_tx_aggr_stop()
818 if (!bf_isretried(bf)) { in arn_tx_aggr_stop()
826 list_remove(&txtid->buf_q, bf); in arn_tx_aggr_stop()
827 list_insert_tail(&list, bf); in arn_tx_aggr_stop()
828 arn_tx_update_baw(sc, txtid, bf->bf_seqno); in arn_tx_aggr_stop()
1000 struct ath_buf *bf, in assign_aggr_tid_seqno() argument
1021 bf->bf_tidno = qwh->i_qos[0] & IEEE80211_QOS_TID; in assign_aggr_tid_seqno()
1038 tid = ATH_AN_2_TID(an, bf->bf_tidno); in assign_aggr_tid_seqno()
1042 bf->bf_seqno = tid->seq_next; in assign_aggr_tid_seqno()
1053 arn_tx_num_badfrms(struct arn_softc *sc, struct ath_buf *bf, int txok) in arn_tx_num_badfrms() argument
1055 struct ath_buf *bf_last = bf->bf_lastbf; in arn_tx_num_badfrms()
1066 isaggr = bf_isaggr(bf); in arn_tx_num_badfrms()
1072 while (bf) { in arn_tx_num_badfrms()
1073 ba_index = ATH_BA_INDEX(seq_st, bf->bf_seqno); in arn_tx_num_badfrms()
1077 bf = bf->bf_next; in arn_tx_num_badfrms()
1089 struct ath_buf *bf; in arn_tx_send_ht_normal() local
1091 bf = list_head(list); in arn_tx_send_ht_normal()
1092 bf->bf_state.bf_type &= ~BUF_AMPDU; in arn_tx_send_ht_normal()
1097 bf->bf_nframes = 1; in arn_tx_send_ht_normal()
1098 bf->bf_lastbf = bf; in arn_tx_send_ht_normal()
1099 ath_buf_set_rate(sc, bf); in arn_tx_send_ht_normal()
1112 struct ath_buf *bf; in arn_tx_txqaddbuf() local
1122 bf = list_head(list); in arn_tx_txqaddbuf()
1134 ath9k_hw_puttxbuf(sc->sc_ah, txq->axq_qnum, bf->bf_daddr); in arn_tx_txqaddbuf()
1137 txq->axq_qnum, ito64(bf->bf_daddr), bf->bf_desc)); in arn_tx_txqaddbuf()
1139 *txq->axq_link = bf->bf_daddr; in arn_tx_txqaddbuf()
1142 ito64(bf->bf_daddr), bf->bf_desc)); in arn_tx_txqaddbuf()
1144 txq->axq_link = &(bf->bf_lastbf->bf_desc->ds_link); in arn_tx_txqaddbuf()
1152 struct ath_buf *bf = NULL; in arn_tx_get_buffer() local
1155 bf = list_head(&sc->sc_txbuf_list); in arn_tx_get_buffer()
1157 if (bf != NULL) in arn_tx_get_buffer()
1158 list_remove(&sc->sc_txbuf_list, bf); in arn_tx_get_buffer()
1166 return (bf); in arn_tx_get_buffer()
1193 ath_tx_setup_buffer(struct arn_softc *sc, struct ath_buf *bf, in ath_tx_setup_buffer() argument
1201 ATH_TXBUF_RESET(bf); in ath_tx_setup_buffer()
1203 bf->rates[i].idx = -1; in ath_tx_setup_buffer()
1204 bf->rates[i].flags = 0; in ath_tx_setup_buffer()
1205 bf->rates[i].count = 1; in ath_tx_setup_buffer()
1208 bf->bf_in = in; in ath_tx_setup_buffer()
1210 bf->bf_frmlen = pktlen; in ath_tx_setup_buffer()
1214 (bf->bf_state.bf_type |= BUF_DATA) : in ath_tx_setup_buffer()
1215 (bf->bf_state.bf_type &= ~BUF_DATA); in ath_tx_setup_buffer()
1217 (bf->bf_state.bf_type |= BUF_BAR) : in ath_tx_setup_buffer()
1218 (bf->bf_state.bf_type &= ~BUF_BAR); in ath_tx_setup_buffer()
1220 (bf->bf_state.bf_type |= BUF_PSPOLL) : in ath_tx_setup_buffer()
1221 (bf->bf_state.bf_type &= ~BUF_PSPOLL); in ath_tx_setup_buffer()
1229 (bf->bf_state.bf_type |= BUF_SHORT_PREAMBLE) : in ath_tx_setup_buffer()
1230 (bf->bf_state.bf_type &= ~BUF_SHORT_PREAMBLE); in ath_tx_setup_buffer()
1232 bf->bf_flags = setup_tx_flags(sc, wh, pktlen); in ath_tx_setup_buffer()
1235 bf->bf_keytype = keytype; in ath_tx_setup_buffer()
1241 assign_aggr_tid_seqno(sc, bf, wh); in ath_tx_setup_buffer()
1255 ath_pkt_duration(struct arn_softc *sc, uint8_t rix, struct ath_buf *bf, in ath_pkt_duration() argument
1263 pktlen = bf_isaggr(bf) ? bf->bf_al : bf->bf_frmlen; in ath_pkt_duration()
1291 struct ath_buf *bf, in ath_buf_set_rate() argument
1296 struct ath_desc *ds = bf->bf_desc; in ath_buf_set_rate()
1297 struct ath_desc *lastds = bf->bf_desc; /* temp workground */ in ath_buf_set_rate()
1306 rates = bf->rates; in ath_buf_set_rate()
1324 flags = (bf->bf_flags & (ATH9K_TXDESC_RTSENA | ATH9K_TXDESC_CTSENA)); in ath_buf_set_rate()
1332 !(bf->bf_flags & ATH9K_TXDESC_NOACK) && in ath_buf_set_rate()
1349 if ((ah->ah_caps.hw_caps & ATH9K_HW_CAP_HT) && bf_isdata(bf)) { in ath_buf_set_rate()
1357 (!bf_isaggr(bf) || (bf_isaggr(bf) && bf->bf_al < 8192))) { in ath_buf_set_rate()
1364 if (bf_isaggr(bf) && (bf->bf_al > ah->ah_caps.rts_aggr_limit)) in ath_buf_set_rate()
1373 (bf_isshpreamble(bf) ? rt->info[cix].short_preamble : 0); in ath_buf_set_rate()
1382 (bf_isshpreamble(bf) ? in ath_buf_set_rate()
1395 series[i].PktDuration = ath_pkt_duration(sc, rix, bf, in ath_buf_set_rate()
1398 bf_isshpreamble(bf)); in ath_buf_set_rate()
1425 ath9k_hw_set11n_ratescenario(ah, ds, lastds, !bf_ispspoll(bf), in ath_buf_set_rate()
1434 ath_tx_complete(struct arn_softc *sc, struct ath_buf *bf, in ath_tx_complete() argument
1437 boolean_t is_data = bf_isdata(bf); in ath_tx_complete()
1444 bf->rates[0].count = tx_status->retries + 1; in ath_tx_complete()
1446 arn_tx_status(sc, bf, is_data); in ath_tx_complete()
1451 ath_tx_complete_buf(struct arn_softc *sc, struct ath_buf *bf, in ath_tx_complete_buf() argument
1461 tx_status.retries = bf->bf_retries; in ath_tx_complete_buf()
1470 if (bf_isxretried(bf)) in ath_tx_complete_buf()
1475 ath_tx_complete(sc, bf, &tx_status); in ath_tx_complete_buf()
1653 struct ath_buf *bf; in arn_tx_draintxq() local
1660 bf = list_head(&txq->axq_list); in arn_tx_draintxq()
1661 if (bf == NULL) { in arn_tx_draintxq()
1666 list_remove(&txq->axq_list, bf); in arn_tx_draintxq()
1668 bf->bf_in = NULL; in arn_tx_draintxq()
1670 list_insert_tail(&sc->sc_txbuf_list, bf); in arn_tx_draintxq()
1857 struct ath_buf *bf, mblk_t *mp) in arn_tx_start() argument
1927 dest = bf->bf_dma.mem_va; in arn_tx_start()
1933 mbslen = (uintptr_t)dest - (uintptr_t)bf->bf_dma.mem_va; in arn_tx_start()
1940 ath_tx_setup_buffer(sc, bf, in, wh, pktlen, keytype); in arn_tx_start()
1943 ds = bf->bf_desc; in arn_tx_start()
1947 arn_get_rate(sc, bf, wh); in arn_tx_start()
1992 ds->ds_data = bf->bf_dma.cookie.dmac_address; in arn_tx_start()
2003 bf->bf_flags /* flags */); in arn_tx_start()
2020 ath_buf_set_rate(sc, bf, wh); in arn_tx_start()
2022 ARN_DMA_SYNC(bf->bf_dma, DDI_DMA_SYNC_FORDEV); in arn_tx_start()
2025 list_insert_tail(&txq->axq_list, bf); in arn_tx_start()
2027 (void) ath9k_hw_puttxbuf(ah, txq->axq_qnum, bf->bf_daddr); in arn_tx_start()
2029 *txq->axq_link = bf->bf_daddr; in arn_tx_start()
2056 struct ath_buf *bf = NULL; in arn_tx() local
2071 bf = arn_tx_get_buffer(sc); in arn_tx()
2072 if (bf == NULL) { in arn_tx()
2122 error = arn_tx_start(sc, in, bf, mp); in arn_tx()
2127 if (bf != NULL) { in arn_tx()
2129 list_insert_tail(&sc->sc_txbuf_list, bf); in arn_tx()
2144 arn_printtxbuf(struct ath_buf *bf, int done) in arn_printtxbuf() argument
2146 struct ath_desc *ds = bf->bf_desc; in arn_printtxbuf()
2151 ds, bf->bf_daddr, in arn_printtxbuf()
2160 ath_tx_rc_status(struct ath_buf *bf, in ath_tx_rc_status() argument
2167 (struct ath_tx_info_priv *)&bf->tx_info_priv; in ath_tx_rc_status()
2172 (bf->bf_flags & ATH9K_TXDESC_NOACK) == 0) { in ath_tx_rc_status()
2173 if (bf_isdata(bf)) { in ath_tx_rc_status()
2176 tx_info_priv->n_frames = bf->bf_nframes; in ath_tx_rc_status()
2189 struct ath_buf *bf; in arn_tx_processq() local
2200 bf = list_head(&txq->axq_list); in arn_tx_processq()
2201 if (bf == NULL) { in arn_tx_processq()
2207 ds = bf->bf_desc; /* last decriptor */ in arn_tx_processq()
2212 arn_printtxbuf(bf, status == 0); in arn_tx_processq()
2219 list_remove(&txq->axq_list, bf); in arn_tx_processq()
2221 in = bf->bf_in; in arn_tx_processq()
2252 (bf->bf_flags & ATH9K_TXDESC_NOACK) == 0) { in arn_tx_processq()
2268 if (!bf_isampdu(bf)) { in arn_tx_processq()
2273 bf->bf_retries = ds->ds_txstat.ts_longretry; in arn_tx_processq()
2275 bf->bf_state.bf_type |= BUF_XRETRY; in arn_tx_processq()
2278 ath_tx_rc_status(bf, ds, nbad, B_TRUE, txok); in arn_tx_processq()
2280 ath_tx_complete_buf(sc, bf, txok, 0); in arn_tx_processq()
2285 bf->bf_in = NULL; in arn_tx_processq()
2287 list_insert_tail(&sc->sc_txbuf_list, bf); in arn_tx_processq()
2414 bf = list_head(&tid->buf_q); in arn_tx_node_cleanup()
2415 while (bf != NULL) { in arn_tx_node_cleanup()
2416 if (bf->bf_in == in) in arn_tx_node_cleanup()
2417 bf->bf_in = NULL; in arn_tx_node_cleanup()
2419 bf = list_next(&txq->axq_list, bf); in arn_tx_node_cleanup()