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()
444 struct ath_rxbuf *bf, *tbf; in ath_startrecv() local
456 list_for_each_entry_safe(bf, tbf, &sc->rx.rxbuf, list) { in ath_startrecv()
457 ath_rx_buf_link(sc, bf, false); in ath_startrecv()
464 bf = list_first_entry(&sc->rx.rxbuf, struct ath_rxbuf, list); in ath_startrecv()
465 ath9k_hw_putrxbuf(ah, bf->bf_daddr); in ath_startrecv()
636 struct ath_rxbuf *bf; in ath_edma_get_buffers() local
643 bf = SKB_CB_ATHBUF(skb); in ath_edma_get_buffers()
644 BUG_ON(!bf); in ath_edma_get_buffers()
646 dma_sync_single_for_cpu(sc->dev, bf->bf_buf_addr, in ath_edma_get_buffers()
652 dma_sync_single_for_device(sc->dev, bf->bf_buf_addr, in ath_edma_get_buffers()
660 list_add_tail(&bf->list, &sc->rx.rxbuf); in ath_edma_get_buffers()
665 bf = SKB_CB_ATHBUF(skb); in ath_edma_get_buffers()
666 BUG_ON(!bf); in ath_edma_get_buffers()
669 list_add_tail(&bf->list, &sc->rx.rxbuf); in ath_edma_get_buffers()
673 bf = NULL; in ath_edma_get_buffers()
676 *dest = bf; in ath_edma_get_buffers()
684 struct ath_rxbuf *bf = NULL; in ath_edma_get_next_rx_buf() local
686 while (ath_edma_get_buffers(sc, qtype, rs, &bf)) { in ath_edma_get_next_rx_buf()
687 if (!bf) in ath_edma_get_next_rx_buf()
690 return bf; in ath_edma_get_next_rx_buf()
701 struct ath_rxbuf *bf; in ath_get_next_rx_buf() local
709 bf = list_first_entry(&sc->rx.rxbuf, struct ath_rxbuf, list); in ath_get_next_rx_buf()
710 if (bf == sc->rx.buf_hold) in ath_get_next_rx_buf()
713 ds = bf->bf_desc; in ath_get_next_rx_buf()
733 if (list_is_last(&bf->list, &sc->rx.rxbuf)) { in ath_get_next_rx_buf()
738 tbf = list_entry(bf->list.next, struct ath_rxbuf, list); in ath_get_next_rx_buf()
771 list_del(&bf->list); in ath_get_next_rx_buf()
772 if (!bf->bf_mpdu) in ath_get_next_rx_buf()
773 return bf; in ath_get_next_rx_buf()
780 dma_sync_single_for_cpu(sc->dev, bf->bf_buf_addr, in ath_get_next_rx_buf()
784 return bf; in ath_get_next_rx_buf()
1062 struct ath_rxbuf *bf; in ath_rx_tasklet() local
1093 bf = ath_edma_get_next_rx_buf(sc, &rs, qtype); in ath_rx_tasklet()
1095 bf = ath_get_next_rx_buf(sc, &rs); in ath_rx_tasklet()
1097 if (!bf) in ath_rx_tasklet()
1100 skb = bf->bf_mpdu; in ath_rx_tasklet()
1143 dma_unmap_single(sc->dev, bf->bf_buf_addr, in ath_rx_tasklet()
1146 bf->bf_mpdu = requeue_skb; in ath_rx_tasklet()
1147 bf->bf_buf_addr = new_buf_addr; in ath_rx_tasklet()
1220 list_add_tail(&bf->list, &sc->rx.rxbuf); in ath_rx_tasklet()
1223 ath_rx_buf_relink(sc, bf, flush); in ath_rx_tasklet()