Lines Matching refs:rxb
123 struct ocelot_fdma_rx_buf *rxb) in ocelot_fdma_rx_alloc_page() argument
139 rxb->page = page; in ocelot_fdma_rx_alloc_page()
140 rxb->page_offset = 0; in ocelot_fdma_rx_alloc_page()
141 rxb->dma_addr = mapping; in ocelot_fdma_rx_alloc_page()
150 struct ocelot_fdma_rx_buf *rxb; in ocelot_fdma_alloc_rx_buffs() local
160 rxb = &rx_ring->bufs[idx]; in ocelot_fdma_alloc_rx_buffs()
162 if (unlikely(!rxb->page)) { in ocelot_fdma_alloc_rx_buffs()
163 if (unlikely(!ocelot_fdma_rx_alloc_page(ocelot, rxb))) { in ocelot_fdma_alloc_rx_buffs()
172 dma_addr = rxb->dma_addr + rxb->page_offset; in ocelot_fdma_alloc_rx_buffs()
270 static bool ocelot_fdma_add_rx_frag(struct ocelot_fdma_rx_buf *rxb, u32 stat, in ocelot_fdma_add_rx_frag() argument
274 struct page *page = rxb->page; in ocelot_fdma_add_rx_frag()
280 rxb->page_offset, size, OCELOT_FDMA_RX_SIZE); in ocelot_fdma_add_rx_frag()
288 rxb->page_offset ^= OCELOT_FDMA_RX_SIZE; in ocelot_fdma_add_rx_frag()
315 struct ocelot_fdma_rx_buf *rxb, in ocelot_fdma_get_skb() argument
322 void *buff_addr = page_address(rxb->page) + in ocelot_fdma_get_skb()
323 rxb->page_offset; in ocelot_fdma_get_skb()
334 dma_sync_single_range_for_cpu(ocelot->dev, rxb->dma_addr, in ocelot_fdma_get_skb()
335 rxb->page_offset, OCELOT_FDMA_RX_SIZE, in ocelot_fdma_get_skb()
338 if (ocelot_fdma_add_rx_frag(rxb, stat, skb, first)) { in ocelot_fdma_get_skb()
340 ocelot_fdma_reuse_rx_page(ocelot, rxb); in ocelot_fdma_get_skb()
343 dma_unmap_page(ocelot->dev, rxb->dma_addr, PAGE_SIZE, in ocelot_fdma_get_skb()
348 rxb->page = NULL; in ocelot_fdma_get_skb()
393 struct ocelot_fdma_rx_buf *rxb; in ocelot_fdma_rx_get() local
420 rxb = &rx_ring->bufs[idx]; in ocelot_fdma_rx_get()
422 skb = ocelot_fdma_get_skb(ocelot, stat, rxb, skb); in ocelot_fdma_rx_get()
703 struct ocelot_fdma_rx_buf *rxb; in ocelot_fdma_free_rx_ring() local
711 rxb = &rx_ring->bufs[idx]; in ocelot_fdma_free_rx_ring()
712 dma_unmap_page(ocelot->dev, rxb->dma_addr, PAGE_SIZE, in ocelot_fdma_free_rx_ring()
714 __free_page(rxb->page); in ocelot_fdma_free_rx_ring()