Lines Matching full:bf
3156 struct ath_buf *bf; in _ath_getbuf_locked() local
3161 bf = TAILQ_FIRST(&sc->sc_txbuf_mgmt); in _ath_getbuf_locked()
3163 bf = TAILQ_FIRST(&sc->sc_txbuf); in _ath_getbuf_locked()
3165 if (bf == NULL) { in _ath_getbuf_locked()
3168 if (bf->bf_flags & ATH_BUF_BUSY) { in _ath_getbuf_locked()
3170 bf = NULL; in _ath_getbuf_locked()
3174 if (bf != NULL && (bf->bf_flags & ATH_BUF_BUSY) == 0) { in _ath_getbuf_locked()
3176 TAILQ_REMOVE(&sc->sc_txbuf_mgmt, bf, bf_list); in _ath_getbuf_locked()
3178 TAILQ_REMOVE(&sc->sc_txbuf, bf, bf_list); in _ath_getbuf_locked()
3194 bf = NULL; in _ath_getbuf_locked()
3196 if (bf == NULL) { in _ath_getbuf_locked()
3206 bf->bf_flags = 0; in _ath_getbuf_locked()
3208 bf->bf_flags |= ATH_BUF_MGMT; in _ath_getbuf_locked()
3210 bf->bf_flags &= (~ATH_BUF_MGMT); in _ath_getbuf_locked()
3212 /* Valid bf here; clear some basic fields */ in _ath_getbuf_locked()
3213 bf->bf_next = NULL; /* XXX just to be sure */ in _ath_getbuf_locked()
3214 bf->bf_last = NULL; /* XXX again, just to be sure */ in _ath_getbuf_locked()
3215 bf->bf_comp = NULL; /* XXX again, just to be sure */ in _ath_getbuf_locked()
3216 bzero(&bf->bf_state, sizeof(bf->bf_state)); in _ath_getbuf_locked()
3222 bf->bf_descid = sc->sc_txbuf_descid; in _ath_getbuf_locked()
3226 return bf; in _ath_getbuf_locked()
3244 ath_buf_clone(struct ath_softc *sc, struct ath_buf *bf) in ath_buf_clone() argument
3249 (bf->bf_flags & ATH_BUF_MGMT) ? in ath_buf_clone()
3256 tbf->bf_nseg = bf->bf_nseg; in ath_buf_clone()
3257 tbf->bf_flags = bf->bf_flags & ATH_BUF_FLAGS_CLONE; in ath_buf_clone()
3258 tbf->bf_status = bf->bf_status; in ath_buf_clone()
3259 tbf->bf_m = bf->bf_m; in ath_buf_clone()
3260 tbf->bf_node = bf->bf_node; in ath_buf_clone()
3261 KASSERT((bf->bf_node != NULL), ("%s: bf_node=NULL!", __func__)); in ath_buf_clone()
3266 tbf->bf_comp = bf->bf_comp; in ath_buf_clone()
3277 if (bf->bf_m != NULL) { in ath_buf_clone()
3281 bus_dmamap_sync(sc->sc_dmat, bf->bf_dmamap, in ath_buf_clone()
3283 bus_dmamap_unload(sc->sc_dmat, bf->bf_dmamap); in ath_buf_clone()
3286 bf->bf_m = NULL; in ath_buf_clone()
3287 bf->bf_node = NULL; in ath_buf_clone()
3290 memcpy(&tbf->bf_state, &bf->bf_state, sizeof(bf->bf_state)); in ath_buf_clone()
3298 struct ath_buf *bf; in ath_getbuf() local
3301 bf = _ath_getbuf_locked(sc, btype); in ath_getbuf()
3306 if (bf == NULL && btype == ATH_BUFTYPE_MGMT) in ath_getbuf()
3307 bf = _ath_getbuf_locked(sc, ATH_BUFTYPE_NORMAL); in ath_getbuf()
3309 if (bf == NULL) { in ath_getbuf()
3313 return bf; in ath_getbuf()
3328 struct ath_buf *bf; in ath_transmit() local
3418 bf = ath_getbuf(sc, ATH_BUFTYPE_MGMT); in ath_transmit()
3420 bf = ath_getbuf(sc, ATH_BUFTYPE_NORMAL); in ath_transmit()
3422 if (bf == NULL) { in ath_transmit()
3482 struct ath_buf *fbf = bf; in ath_transmit()
3519 if (ath_tx_start(sc, ni, bf, m)) { in ath_transmit()
3523 bf->bf_m = NULL; in ath_transmit()
3524 bf->bf_node = NULL; in ath_transmit()
3526 ath_returnbuf_head(sc, bf); in ath_transmit()
3564 bf = TAILQ_FIRST(&frags); in ath_transmit()
3565 KASSERT(bf != NULL, ("no buf for txfrag")); in ath_transmit()
3566 TAILQ_REMOVE(&frags, bf, bf_list); in ath_transmit()
4220 struct ath_buf *bf) in ath_tx_update_stats() argument
4222 struct ieee80211_node *ni = bf->bf_node; in ath_tx_update_stats()
4239 pri = M_WME_GETAC(bf->bf_m); in ath_tx_update_stats()
4243 if ((bf->bf_state.bfs_txflags & HAL_TXDESC_NOACK) == 0) in ath_tx_update_stats()
4257 if (bf->bf_m->m_flags & M_FF) in ath_tx_update_stats()
4289 ath_tx_default_comp(struct ath_softc *sc, struct ath_buf *bf, int fail) in ath_tx_default_comp() argument
4291 struct ath_tx_status *ts = &bf->bf_status.ds_txstat; in ath_tx_default_comp()
4297 st = ((bf->bf_state.bfs_txflags & HAL_TXDESC_NOACK) == 0) ? in ath_tx_default_comp()
4301 if (bf->bf_state.bfs_dobaw) in ath_tx_default_comp()
4303 "%s: bf %p: seqno %d: dobaw should've been cleared!\n", in ath_tx_default_comp()
4305 bf, in ath_tx_default_comp()
4306 SEQNO(bf->bf_state.bfs_seqno)); in ath_tx_default_comp()
4308 if (bf->bf_next != NULL) in ath_tx_default_comp()
4310 "%s: bf %p: seqno %d: bf_next not NULL!\n", in ath_tx_default_comp()
4312 bf, in ath_tx_default_comp()
4313 SEQNO(bf->bf_state.bfs_seqno)); in ath_tx_default_comp()
4330 if (bf->bf_node) { in ath_tx_default_comp()
4332 ath_tx_update_tim(sc, bf->bf_node, 0); in ath_tx_default_comp()
4342 ath_tx_freebuf(sc, bf, st); in ath_tx_default_comp()
4381 * bf pointer should be treated as invalid after this function is called.
4385 struct ath_tx_status *ts, struct ath_buf *bf) in ath_tx_process_buf_completion() argument
4387 struct ieee80211_node *ni = bf->bf_node; in ath_tx_process_buf_completion()
4395 ath_tx_update_stats(sc, ts, bf); in ath_tx_process_buf_completion()
4406 if (bf->bf_comp == NULL) { in ath_tx_process_buf_completion()
4408 (bf->bf_state.bfs_txflags & HAL_TXDESC_NOACK) == 0) { in ath_tx_process_buf_completion()
4417 bf->bf_state.bfs_rc, ts, in ath_tx_process_buf_completion()
4418 bf->bf_state.bfs_pktlen, in ath_tx_process_buf_completion()
4419 bf->bf_state.bfs_pktlen, in ath_tx_process_buf_completion()
4423 ath_tx_default_comp(sc, bf, 0); in ath_tx_process_buf_completion()
4425 bf->bf_comp(sc, bf, 0); in ath_tx_process_buf_completion()
4437 struct ath_buf *bf; in ath_tx_processq() local
4463 bf = TAILQ_FIRST(&txq->axq_q); in ath_tx_processq()
4464 if (bf == NULL) { in ath_tx_processq()
4468 ds = bf->bf_lastds; /* XXX must be setup correctly! */ in ath_tx_processq()
4469 ts = &bf->bf_status.ds_txstat; in ath_tx_processq()
4474 ath_printtxbuf(sc, bf, txq->axq_qnum, 0, in ath_tx_processq()
4477 ath_printtxbuf(sc, bf, txq->axq_qnum, 0, in ath_tx_processq()
4491 "ath_tx_processq: txq=%u, bf=%p ds=%p, HAL_EINPROGRESS", in ath_tx_processq()
4492 txq->axq_qnum, bf, ds); in ath_tx_processq()
4496 ATH_TXQ_REMOVE(txq, bf, bf_list); in ath_tx_processq()
4501 if (txq->axq_qnum != bf->bf_state.bfs_tx_queue) { in ath_tx_processq()
4503 "%s: TXQ=%d: bf=%p, bfs_tx_queue=%d\n", in ath_tx_processq()
4506 bf, in ath_tx_processq()
4507 bf->bf_state.bfs_tx_queue); in ath_tx_processq()
4509 if (txq->axq_qnum != bf->bf_last->bf_state.bfs_tx_queue) { in ath_tx_processq()
4514 bf->bf_last, in ath_tx_processq()
4515 bf->bf_last->bf_state.bfs_tx_queue); in ath_tx_processq()
4529 bf->bf_last->bf_flags |= ATH_BUF_BUSY; in ath_tx_processq()
4533 bf->bf_last->bf_flags |= ATH_BUF_BUSY; in ath_tx_processq()
4535 if (bf->bf_state.bfs_aggr) in ath_tx_processq()
4538 ni = bf->bf_node; in ath_tx_processq()
4541 "ath_tx_processq: txq=%u, bf=%p, ds=%p, ni=%p, ts_status=0x%08x", in ath_tx_processq()
4542 txq->axq_qnum, bf, ds, ni, ts->ts_status); in ath_tx_processq()
4549 ((bf->bf_state.bfs_txflags & HAL_TXDESC_NOACK) == 0)) { in ath_tx_processq()
4562 ath_tx_process_buf_completion(sc, txq, ts, bf); in ath_tx_processq()
4564 /* XXX at this point, bf and ni may be totally invalid */ in ath_tx_processq()
4784 ath_returnbuf_tail(struct ath_softc *sc, struct ath_buf *bf) in ath_returnbuf_tail() argument
4789 if (bf->bf_flags & ATH_BUF_MGMT) in ath_returnbuf_tail()
4790 TAILQ_INSERT_TAIL(&sc->sc_txbuf_mgmt, bf, bf_list); in ath_returnbuf_tail()
4792 TAILQ_INSERT_TAIL(&sc->sc_txbuf, bf, bf_list); in ath_returnbuf_tail()
4805 ath_returnbuf_head(struct ath_softc *sc, struct ath_buf *bf) in ath_returnbuf_head() argument
4810 if (bf->bf_flags & ATH_BUF_MGMT) in ath_returnbuf_head()
4811 TAILQ_INSERT_HEAD(&sc->sc_txbuf_mgmt, bf, bf_list); in ath_returnbuf_head()
4813 TAILQ_INSERT_HEAD(&sc->sc_txbuf, bf, bf_list); in ath_returnbuf_head()
4851 ath_txq_addholdingbuf(struct ath_softc *sc, struct ath_buf *bf) in ath_txq_addholdingbuf() argument
4855 txq = &sc->sc_txq[bf->bf_state.bfs_tx_queue]; in ath_txq_addholdingbuf()
4863 if (bf->bf_state.bfs_tx_queue > HAL_NUM_TX_QUEUES) { in ath_txq_addholdingbuf()
4864 device_printf(sc->sc_dev, "%s: bf=%p: invalid tx queue (%d)\n", in ath_txq_addholdingbuf()
4866 bf, in ath_txq_addholdingbuf()
4867 bf->bf_state.bfs_tx_queue); in ath_txq_addholdingbuf()
4868 bf->bf_flags &= ~ATH_BUF_BUSY; in ath_txq_addholdingbuf()
4869 ath_returnbuf_tail(sc, bf); in ath_txq_addholdingbuf()
4873 txq->axq_holdingbf = bf; in ath_txq_addholdingbuf()
4894 ath_freebuf(struct ath_softc *sc, struct ath_buf *bf) in ath_freebuf() argument
4898 txq = &sc->sc_txq[bf->bf_state.bfs_tx_queue]; in ath_freebuf()
4900 KASSERT((bf->bf_node == NULL), ("%s: bf->bf_node != NULL\n", __func__)); in ath_freebuf()
4901 KASSERT((bf->bf_m == NULL), ("%s: bf->bf_m != NULL\n", __func__)); in ath_freebuf()
4906 if (bf->bf_flags & ATH_BUF_BUSY) { in ath_freebuf()
4908 ath_txq_addholdingbuf(sc, bf); in ath_freebuf()
4917 ath_returnbuf_tail(sc, bf); in ath_freebuf()
4928 ath_tx_freebuf(struct ath_softc *sc, struct ath_buf *bf, int status) in ath_tx_freebuf() argument
4930 struct ieee80211_node *ni = bf->bf_node; in ath_tx_freebuf()
4931 struct mbuf *m0 = bf->bf_m; in ath_tx_freebuf()
4938 if (bf->bf_m != NULL) { in ath_tx_freebuf()
4939 bus_dmamap_sync(sc->sc_dmat, bf->bf_dmamap, in ath_tx_freebuf()
4941 bus_dmamap_unload(sc->sc_dmat, bf->bf_dmamap); in ath_tx_freebuf()
4944 bf->bf_node = NULL; in ath_tx_freebuf()
4945 bf->bf_m = NULL; in ath_tx_freebuf()
4948 ath_freebuf(sc, bf); in ath_tx_freebuf()
4957 struct ath_buf *bf; in ath_tx_draintxq_get_one() local
4965 bf = TAILQ_FIRST(&txq->fifo.axq_q); in ath_tx_draintxq_get_one()
4966 if (bf != NULL) { in ath_tx_draintxq_get_one()
4971 if (bf->bf_flags & ATH_BUF_FIFOEND) { in ath_tx_draintxq_get_one()
4981 ATH_TXQ_REMOVE(&txq->fifo, bf, bf_list); in ath_tx_draintxq_get_one()
4982 return (bf); in ath_tx_draintxq_get_one()
5000 bf = TAILQ_FIRST(&txq->axq_q); in ath_tx_draintxq_get_one()
5001 if (bf == NULL) { in ath_tx_draintxq_get_one()
5005 ATH_TXQ_REMOVE(txq, bf, bf_list); in ath_tx_draintxq_get_one()
5006 return (bf); in ath_tx_draintxq_get_one()
5015 struct ath_buf *bf; in ath_tx_draintxq() local
5024 bf = ath_tx_draintxq_get_one(sc, txq); in ath_tx_draintxq()
5025 if (bf == NULL) { in ath_tx_draintxq()
5029 if (bf->bf_state.bfs_aggr) in ath_tx_draintxq()
5044 bf->bf_lastds, in ath_tx_draintxq()
5045 &bf->bf_status.ds_txstat) == HAL_OK); in ath_tx_draintxq()
5047 ath_printtxbuf(sc, bf, txq->axq_qnum, ix, status); in ath_tx_draintxq()
5048 ieee80211_dump_pkt(ic, mtod(bf->bf_m, const uint8_t *), in ath_tx_draintxq()
5049 bf->bf_m->m_len, 0, -1); in ath_tx_draintxq()
5062 bf->bf_flags &= ~ATH_BUF_BUSY; in ath_tx_draintxq()
5063 if (bf->bf_comp) in ath_tx_draintxq()
5064 bf->bf_comp(sc, bf, 1); in ath_tx_draintxq()
5066 ath_tx_default_comp(sc, bf, 1); in ath_tx_draintxq()
5152 struct ath_buf *bf; in ath_tx_dump() local
5160 TAILQ_FOREACH(bf, &txq->axq_q, bf_list) { in ath_tx_dump()
5161 ath_printtxbuf(sc, bf, txq->axq_qnum, i, in ath_tx_dump()
5162 ath_hal_txprocdesc(ah, bf->bf_lastds, in ath_tx_dump()
5163 &bf->bf_status.ds_txstat) == HAL_OK); in ath_tx_dump()
5226 struct ath_buf *bf = TAILQ_FIRST(&sc->sc_bbuf); in ath_legacy_tx_drain() local
5227 if (bf != NULL && bf->bf_m != NULL) { in ath_legacy_tx_drain()
5228 ath_printtxbuf(sc, bf, sc->sc_bhalq, 0, in ath_legacy_tx_drain()
5229 ath_hal_txprocdesc(ah, bf->bf_lastds, in ath_legacy_tx_drain()
5230 &bf->bf_status.ds_txstat) == HAL_OK); in ath_legacy_tx_drain()
5232 mtod(bf->bf_m, const uint8_t *), bf->bf_m->m_len, in ath_legacy_tx_drain()