Lines Matching refs:rxb
124 struct ocelot_fdma_rx_buf *rxb) in ocelot_fdma_rx_alloc_page() argument
140 rxb->page = page; in ocelot_fdma_rx_alloc_page()
141 rxb->page_offset = 0; in ocelot_fdma_rx_alloc_page()
142 rxb->dma_addr = mapping; in ocelot_fdma_rx_alloc_page()
151 struct ocelot_fdma_rx_buf *rxb; in ocelot_fdma_alloc_rx_buffs() local
161 rxb = &rx_ring->bufs[idx]; in ocelot_fdma_alloc_rx_buffs()
163 if (unlikely(!rxb->page)) { in ocelot_fdma_alloc_rx_buffs()
164 if (unlikely(!ocelot_fdma_rx_alloc_page(ocelot, rxb))) { in ocelot_fdma_alloc_rx_buffs()
173 dma_addr = rxb->dma_addr + rxb->page_offset; in ocelot_fdma_alloc_rx_buffs()
271 static bool ocelot_fdma_add_rx_frag(struct ocelot_fdma_rx_buf *rxb, u32 stat, in ocelot_fdma_add_rx_frag() argument
275 struct page *page = rxb->page; in ocelot_fdma_add_rx_frag()
281 rxb->page_offset, size, OCELOT_FDMA_RX_SIZE); in ocelot_fdma_add_rx_frag()
289 rxb->page_offset ^= OCELOT_FDMA_RX_SIZE; in ocelot_fdma_add_rx_frag()
316 struct ocelot_fdma_rx_buf *rxb, in ocelot_fdma_get_skb() argument
323 void *buff_addr = page_address(rxb->page) + in ocelot_fdma_get_skb()
324 rxb->page_offset; in ocelot_fdma_get_skb()
335 dma_sync_single_range_for_cpu(ocelot->dev, rxb->dma_addr, in ocelot_fdma_get_skb()
336 rxb->page_offset, OCELOT_FDMA_RX_SIZE, in ocelot_fdma_get_skb()
339 if (ocelot_fdma_add_rx_frag(rxb, stat, skb, first)) { in ocelot_fdma_get_skb()
341 ocelot_fdma_reuse_rx_page(ocelot, rxb); in ocelot_fdma_get_skb()
344 dma_unmap_page(ocelot->dev, rxb->dma_addr, PAGE_SIZE, in ocelot_fdma_get_skb()
349 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()