Lines Matching refs:bf
37 static void ath_rx_buf_link(struct ath_softc *sc, struct ath_rxbuf *bf, in ath_rx_buf_link() argument
45 ds = bf->bf_desc; in ath_rx_buf_link()
47 ds->ds_data = bf->bf_buf_addr; in ath_rx_buf_link()
50 skb = bf->bf_mpdu; in ath_rx_buf_link()
64 *sc->rx.rxlink = bf->bf_daddr; in ath_rx_buf_link()
66 ath9k_hw_putrxbuf(ah, bf->bf_daddr); in ath_rx_buf_link()
71 static void ath_rx_buf_relink(struct ath_softc *sc, struct ath_rxbuf *bf, in ath_rx_buf_relink() argument
77 sc->rx.buf_hold = bf; in ath_rx_buf_relink()
116 struct ath_rxbuf *bf; in ath_rx_edma_buf_link() local
122 bf = list_first_entry(&sc->rx.rxbuf, struct ath_rxbuf, list); in ath_rx_edma_buf_link()
123 list_del_init(&bf->list); in ath_rx_edma_buf_link()
125 skb = bf->bf_mpdu; in ath_rx_edma_buf_link()
128 dma_sync_single_for_device(sc->dev, bf->bf_buf_addr, in ath_rx_edma_buf_link()
131 SKB_CB_ATHBUF(skb) = bf; in ath_rx_edma_buf_link()
132 ath9k_hw_addrxbuf_edma(ah, bf->bf_buf_addr, qtype); in ath_rx_edma_buf_link()
142 struct ath_rxbuf *bf, *tbf; in ath_rx_addbuffer_edma() local
149 list_for_each_entry_safe(bf, tbf, &sc->rx.rxbuf, list) in ath_rx_addbuffer_edma()
158 struct ath_rxbuf *bf; in ath_rx_remove_buffer() local
165 bf = SKB_CB_ATHBUF(skb); in ath_rx_remove_buffer()
166 BUG_ON(!bf); in ath_rx_remove_buffer()
167 list_add_tail(&bf->list, &sc->rx.rxbuf); in ath_rx_remove_buffer()
175 struct ath_rxbuf *bf; in ath_rx_edma_cleanup() local
180 list_for_each_entry(bf, &sc->rx.rxbuf, list) { in ath_rx_edma_cleanup()
181 if (bf->bf_mpdu) { in ath_rx_edma_cleanup()
182 dma_unmap_single(sc->dev, bf->bf_buf_addr, in ath_rx_edma_cleanup()
185 dev_kfree_skb_any(bf->bf_mpdu); in ath_rx_edma_cleanup()
186 bf->bf_buf_addr = 0; in ath_rx_edma_cleanup()
187 bf->bf_mpdu = NULL; in ath_rx_edma_cleanup()
203 struct ath_rxbuf *bf; in ath_rx_edma_init() local
216 bf = devm_kzalloc(sc->dev, size, GFP_KERNEL); in ath_rx_edma_init()
217 if (!bf) in ath_rx_edma_init()
222 for (i = 0; i < nbufs; i++, bf++) { in ath_rx_edma_init()
230 bf->bf_mpdu = skb; in ath_rx_edma_init()
232 bf->bf_buf_addr = dma_map_single(sc->dev, skb->data, in ath_rx_edma_init()
236 bf->bf_buf_addr))) { in ath_rx_edma_init()
238 bf->bf_mpdu = NULL; in ath_rx_edma_init()
239 bf->bf_buf_addr = 0; in ath_rx_edma_init()
246 list_add_tail(&bf->list, &sc->rx.rxbuf); in ath_rx_edma_init()
275 struct ath_rxbuf *bf; in ath_rx_init() local
300 list_for_each_entry(bf, &sc->rx.rxbuf, list) { in ath_rx_init()
308 bf->bf_mpdu = skb; in ath_rx_init()
309 bf->bf_buf_addr = dma_map_single(sc->dev, skb->data, in ath_rx_init()
313 bf->bf_buf_addr))) { in ath_rx_init()
315 bf->bf_mpdu = NULL; in ath_rx_init()
316 bf->bf_buf_addr = 0; in ath_rx_init()
336 struct ath_rxbuf *bf; in ath_rx_cleanup() local
343 list_for_each_entry(bf, &sc->rx.rxbuf, list) { in ath_rx_cleanup()
344 skb = bf->bf_mpdu; in ath_rx_cleanup()
346 dma_unmap_single(sc->dev, bf->bf_buf_addr, in ath_rx_cleanup()
350 bf->bf_buf_addr = 0; in ath_rx_cleanup()
351 bf->bf_mpdu = NULL; in ath_rx_cleanup()
445 struct ath_rxbuf *bf, *tbf; in ath_startrecv() local
457 list_for_each_entry_safe(bf, tbf, &sc->rx.rxbuf, list) { in ath_startrecv()
458 ath_rx_buf_link(sc, bf, false); in ath_startrecv()
465 bf = list_first_entry(&sc->rx.rxbuf, struct ath_rxbuf, list); in ath_startrecv()
466 ath9k_hw_putrxbuf(ah, bf->bf_daddr); in ath_startrecv()
638 struct ath_rxbuf *bf; in ath_edma_get_buffers() local
645 bf = SKB_CB_ATHBUF(skb); in ath_edma_get_buffers()
646 BUG_ON(!bf); in ath_edma_get_buffers()
648 dma_sync_single_for_cpu(sc->dev, bf->bf_buf_addr, in ath_edma_get_buffers()
654 dma_sync_single_for_device(sc->dev, bf->bf_buf_addr, in ath_edma_get_buffers()
662 list_add_tail(&bf->list, &sc->rx.rxbuf); in ath_edma_get_buffers()
667 bf = SKB_CB_ATHBUF(skb); in ath_edma_get_buffers()
668 BUG_ON(!bf); in ath_edma_get_buffers()
671 list_add_tail(&bf->list, &sc->rx.rxbuf); in ath_edma_get_buffers()
675 bf = NULL; in ath_edma_get_buffers()
678 *dest = bf; in ath_edma_get_buffers()
686 struct ath_rxbuf *bf = NULL; in ath_edma_get_next_rx_buf() local
688 while (ath_edma_get_buffers(sc, qtype, rs, &bf)) { in ath_edma_get_next_rx_buf()
689 if (!bf) in ath_edma_get_next_rx_buf()
692 return bf; in ath_edma_get_next_rx_buf()
703 struct ath_rxbuf *bf; in ath_get_next_rx_buf() local
711 bf = list_first_entry(&sc->rx.rxbuf, struct ath_rxbuf, list); in ath_get_next_rx_buf()
712 if (bf == sc->rx.buf_hold) in ath_get_next_rx_buf()
715 ds = bf->bf_desc; in ath_get_next_rx_buf()
735 if (list_is_last(&bf->list, &sc->rx.rxbuf)) { in ath_get_next_rx_buf()
740 tbf = list_entry(bf->list.next, struct ath_rxbuf, list); in ath_get_next_rx_buf()
773 list_del(&bf->list); in ath_get_next_rx_buf()
774 if (!bf->bf_mpdu) in ath_get_next_rx_buf()
775 return bf; in ath_get_next_rx_buf()
782 dma_sync_single_for_cpu(sc->dev, bf->bf_buf_addr, in ath_get_next_rx_buf()
786 return bf; in ath_get_next_rx_buf()
999 struct ath_rxbuf *bf; in ath_rx_tasklet() local
1030 bf = ath_edma_get_next_rx_buf(sc, &rs, qtype); in ath_rx_tasklet()
1032 bf = ath_get_next_rx_buf(sc, &rs); in ath_rx_tasklet()
1034 if (!bf) in ath_rx_tasklet()
1037 skb = bf->bf_mpdu; in ath_rx_tasklet()
1080 dma_unmap_single(sc->dev, bf->bf_buf_addr, in ath_rx_tasklet()
1083 bf->bf_mpdu = requeue_skb; in ath_rx_tasklet()
1084 bf->bf_buf_addr = new_buf_addr; in ath_rx_tasklet()
1156 list_add_tail(&bf->list, &sc->rx.rxbuf); in ath_rx_tasklet()
1159 ath_rx_buf_relink(sc, bf, flush); in ath_rx_tasklet()