Lines Matching full:bf
152 static void ath_edma_rxbuf_free(struct ath_softc *sc, struct ath_buf *bf);
208 struct ath_buf *bf; in ath_edma_reinit_fifo() local
217 bf = re->m_fifo[i]; in ath_edma_reinit_fifo()
223 (uintmax_t)bf->bf_daddr); in ath_edma_reinit_fifo()
224 ath_hal_putrxbuf(sc->sc_ah, bf->bf_daddr, qtype); in ath_edma_reinit_fifo()
415 struct ath_buf *bf; in ath_edma_recv_proc_queue() local
446 bf = re->m_fifo[re->m_fifo_head]; in ath_edma_recv_proc_queue()
448 if (bf == NULL) { in ath_edma_recv_proc_queue()
449 device_printf(sc->sc_dev, "%s: Q%d: NULL bf?\n", in ath_edma_recv_proc_queue()
454 m = bf->bf_m; in ath_edma_recv_proc_queue()
455 ds = bf->bf_desc; in ath_edma_recv_proc_queue()
461 bus_dmamap_sync(sc->sc_dmat, bf->bf_dmamap, in ath_edma_recv_proc_queue()
463 rs = &bf->bf_status.ds_rxstat; in ath_edma_recv_proc_queue()
464 bf->bf_rxstatus = ath_hal_rxprocdesc(ah, ds, bf->bf_daddr, in ath_edma_recv_proc_queue()
466 if (bf->bf_rxstatus == HAL_EINPROGRESS) in ath_edma_recv_proc_queue()
470 ath_printrxbuf(sc, bf, 0, bf->bf_rxstatus == HAL_OK); in ath_edma_recv_proc_queue()
488 bus_dmamap_unload(sc->sc_dmat, bf->bf_dmamap); in ath_edma_recv_proc_queue()
495 TAILQ_INSERT_TAIL(&sc->sc_rx_rxlist[qtype], bf, bf_list); in ath_edma_recv_proc_queue()
528 struct ath_buf *bf; in ath_edma_flush_deferred_queue() local
534 bf = TAILQ_FIRST(&sc->sc_rx_rxlist[HAL_RX_QUEUE_LP]); in ath_edma_flush_deferred_queue()
535 TAILQ_REMOVE(&sc->sc_rx_rxlist[HAL_RX_QUEUE_LP], bf, bf_list); in ath_edma_flush_deferred_queue()
537 ath_edma_rxbuf_free(sc, bf); in ath_edma_flush_deferred_queue()
540 bf = TAILQ_FIRST(&sc->sc_rx_rxlist[HAL_RX_QUEUE_HP]); in ath_edma_flush_deferred_queue()
541 TAILQ_REMOVE(&sc->sc_rx_rxlist[HAL_RX_QUEUE_HP], bf, bf_list); in ath_edma_flush_deferred_queue()
543 ath_edma_rxbuf_free(sc, bf); in ath_edma_flush_deferred_queue()
553 struct ath_buf *bf, *next; in ath_edma_recv_proc_deferred_queue() local
579 TAILQ_FOREACH_SAFE(bf, &rxlist, bf_list, next) { in ath_edma_recv_proc_deferred_queue()
583 m_adj(bf->bf_m, sc->sc_rx_statuslen); in ath_edma_recv_proc_deferred_queue()
587 rs = &bf->bf_status.ds_rxstat; in ath_edma_recv_proc_deferred_queue()
588 m = bf->bf_m; in ath_edma_recv_proc_deferred_queue()
589 bf->bf_m = NULL; in ath_edma_recv_proc_deferred_queue()
590 if (ath_rx_pkt(sc, rs, bf->bf_rxstatus, tsf, nf, qtype, bf, m)) in ath_edma_recv_proc_deferred_queue()
605 bf = TAILQ_FIRST(&rxlist); in ath_edma_recv_proc_deferred_queue()
606 TAILQ_REMOVE(&rxlist, bf, bf_list); in ath_edma_recv_proc_deferred_queue()
608 ath_edma_rxbuf_free(sc, bf); in ath_edma_recv_proc_deferred_queue()
675 ath_edma_rxbuf_init(struct ath_softc *sc, struct ath_buf *bf) in ath_edma_rxbuf_init() argument
704 bf->bf_desc = mtod(m, struct ath_desc *); in ath_edma_rxbuf_init()
705 bf->bf_lastds = bf->bf_desc; /* XXX only really for TX? */ in ath_edma_rxbuf_init()
706 bf->bf_m = m; in ath_edma_rxbuf_init()
715 memset(bf->bf_desc, '\0', sc->sc_rx_statuslen); in ath_edma_rxbuf_init()
721 bf->bf_dmamap, m, bf->bf_segs, &bf->bf_nseg, BUS_DMA_NOWAIT); in ath_edma_rxbuf_init()
734 bf->bf_daddr = bf->bf_segs[0].ds_addr; in ath_edma_rxbuf_init()
743 bus_dmamap_sync(sc->sc_dmat, bf->bf_dmamap, in ath_edma_rxbuf_init()
756 struct ath_buf *bf; in ath_edma_rxbuf_alloc() local
762 bf = TAILQ_FIRST(&sc->sc_rxbuf); in ath_edma_rxbuf_alloc()
764 if (bf == NULL) { in ath_edma_rxbuf_alloc()
771 TAILQ_REMOVE(&sc->sc_rxbuf, bf, bf_list); in ath_edma_rxbuf_alloc()
774 error = ath_edma_rxbuf_init(sc, bf); in ath_edma_rxbuf_alloc()
777 "%s: bf=%p, rxbuf alloc failed! error=%d\n", in ath_edma_rxbuf_alloc()
779 bf, in ath_edma_rxbuf_alloc()
781 TAILQ_INSERT_TAIL(&sc->sc_rxbuf, bf, bf_list); in ath_edma_rxbuf_alloc()
785 return (bf); in ath_edma_rxbuf_alloc()
789 ath_edma_rxbuf_free(struct ath_softc *sc, struct ath_buf *bf) in ath_edma_rxbuf_free() argument
798 if (bf->bf_m) { in ath_edma_rxbuf_free()
799 bus_dmamap_unload(sc->sc_dmat, bf->bf_dmamap); in ath_edma_rxbuf_free()
800 m_freem(bf->bf_m); in ath_edma_rxbuf_free()
801 bf->bf_m = NULL; in ath_edma_rxbuf_free()
805 TAILQ_INSERT_TAIL(&sc->sc_rxbuf, bf, bf_list); in ath_edma_rxbuf_free()
818 struct ath_buf *bf; in ath_edma_rxfifo_alloc() local
843 bf = ath_edma_rxbuf_alloc(sc); in ath_edma_rxfifo_alloc()
845 if (bf == NULL) { in ath_edma_rxfifo_alloc()
855 re->m_fifo[re->m_fifo_tail] = bf; in ath_edma_rxfifo_alloc()
862 bf->bf_desc, in ath_edma_rxfifo_alloc()
863 (uintmax_t) bf->bf_daddr); in ath_edma_rxfifo_alloc()
864 ath_hal_putrxbuf(sc->sc_ah, bf->bf_daddr, qtype); in ath_edma_rxfifo_alloc()
892 struct ath_buf *bf = re->m_fifo[i]; in ath_edma_rxfifo_flush() local
895 ath_printrxbuf(sc, bf, 0, HAL_OK); in ath_edma_rxfifo_flush()