Lines Matching defs:bf

154 static	void ath_edma_rxbuf_free(struct ath_softc *sc, struct ath_buf *bf);
210 struct ath_buf *bf;
219 bf = re->m_fifo[i];
225 (uintmax_t)bf->bf_daddr);
226 ath_hal_putrxbuf(sc->sc_ah, bf->bf_daddr, qtype);
417 struct ath_buf *bf;
448 bf = re->m_fifo[re->m_fifo_head];
450 if (bf == NULL) {
451 device_printf(sc->sc_dev, "%s: Q%d: NULL bf?\n",
456 m = bf->bf_m;
457 ds = bf->bf_desc;
463 bus_dmamap_sync(sc->sc_dmat, bf->bf_dmamap,
465 rs = &bf->bf_status.ds_rxstat;
466 bf->bf_rxstatus = ath_hal_rxprocdesc(ah, ds, bf->bf_daddr,
468 if (bf->bf_rxstatus == HAL_EINPROGRESS)
472 ath_printrxbuf(sc, bf, 0, bf->bf_rxstatus == HAL_OK);
490 bus_dmamap_unload(sc->sc_dmat, bf->bf_dmamap);
497 TAILQ_INSERT_TAIL(&sc->sc_rx_rxlist[qtype], bf, bf_list);
530 struct ath_buf *bf;
536 bf = TAILQ_FIRST(&sc->sc_rx_rxlist[HAL_RX_QUEUE_LP]);
537 TAILQ_REMOVE(&sc->sc_rx_rxlist[HAL_RX_QUEUE_LP], bf, bf_list);
539 ath_edma_rxbuf_free(sc, bf);
542 bf = TAILQ_FIRST(&sc->sc_rx_rxlist[HAL_RX_QUEUE_HP]);
543 TAILQ_REMOVE(&sc->sc_rx_rxlist[HAL_RX_QUEUE_HP], bf, bf_list);
545 ath_edma_rxbuf_free(sc, bf);
555 struct ath_buf *bf, *next;
581 TAILQ_FOREACH_SAFE(bf, &rxlist, bf_list, next) {
585 m_adj(bf->bf_m, sc->sc_rx_statuslen);
589 rs = &bf->bf_status.ds_rxstat;
590 m = bf->bf_m;
591 bf->bf_m = NULL;
592 if (ath_rx_pkt(sc, rs, bf->bf_rxstatus, tsf, nf, qtype, bf, m))
607 bf = TAILQ_FIRST(&rxlist);
608 TAILQ_REMOVE(&rxlist, bf, bf_list);
610 ath_edma_rxbuf_free(sc, bf);
677 ath_edma_rxbuf_init(struct ath_softc *sc, struct ath_buf *bf)
706 bf->bf_desc = mtod(m, struct ath_desc *);
707 bf->bf_lastds = bf->bf_desc; /* XXX only really for TX? */
708 bf->bf_m = m;
717 memset(bf->bf_desc, '\0', sc->sc_rx_statuslen);
723 bf->bf_dmamap, m, bf->bf_segs, &bf->bf_nseg, BUS_DMA_NOWAIT);
736 bf->bf_daddr = bf->bf_segs[0].ds_addr;
745 bus_dmamap_sync(sc->sc_dmat, bf->bf_dmamap,
758 struct ath_buf *bf;
764 bf = TAILQ_FIRST(&sc->sc_rxbuf);
766 if (bf == NULL) {
773 TAILQ_REMOVE(&sc->sc_rxbuf, bf, bf_list);
776 error = ath_edma_rxbuf_init(sc, bf);
779 "%s: bf=%p, rxbuf alloc failed! error=%d\n",
781 bf,
783 TAILQ_INSERT_TAIL(&sc->sc_rxbuf, bf, bf_list);
787 return (bf);
791 ath_edma_rxbuf_free(struct ath_softc *sc, struct ath_buf *bf)
800 if (bf->bf_m) {
801 bus_dmamap_unload(sc->sc_dmat, bf->bf_dmamap);
802 m_freem(bf->bf_m);
803 bf->bf_m = NULL;
807 TAILQ_INSERT_TAIL(&sc->sc_rxbuf, bf, bf_list);
820 struct ath_buf *bf;
845 bf = ath_edma_rxbuf_alloc(sc);
847 if (bf == NULL) {
857 re->m_fifo[re->m_fifo_tail] = bf;
864 bf->bf_desc,
865 (uintmax_t) bf->bf_daddr);
866 ath_hal_putrxbuf(sc->sc_ah, bf->bf_daddr, qtype);
894 struct ath_buf *bf = re->m_fifo[i];
897 ath_printrxbuf(sc, bf, 0, HAL_OK);