Lines Matching refs:wr_idx
216 u32 wr_idx, rd_idx, hbuf_depth, empty; in mei_dma_ring_empty_slots() local
227 wr_idx = READ_ONCE(ctrl->hbuf_wr_idx); in mei_dma_ring_empty_slots()
229 if (rd_idx > wr_idx) in mei_dma_ring_empty_slots()
230 empty = rd_idx - wr_idx; in mei_dma_ring_empty_slots()
232 empty = hbuf_depth - (wr_idx - rd_idx); in mei_dma_ring_empty_slots()
248 u32 wr_idx, rem, slots; in mei_dma_ring_write() local
255 wr_idx = READ_ONCE(ctrl->hbuf_wr_idx) & (hbuf_depth - 1); in mei_dma_ring_write()
258 if (wr_idx + slots > hbuf_depth) { in mei_dma_ring_write()
259 buf += mei_dma_copy_to(dev, buf, wr_idx, hbuf_depth - wr_idx); in mei_dma_ring_write()
260 rem = slots - (hbuf_depth - wr_idx); in mei_dma_ring_write()
261 wr_idx = 0; in mei_dma_ring_write()
266 mei_dma_copy_to(dev, buf, wr_idx, rem); in mei_dma_ring_write()