Lines Matching refs:rd_idx
175 u32 rd_idx, rem, slots; in mei_dma_ring_read() local
186 rd_idx = READ_ONCE(ctrl->dbuf_rd_idx) & (dbuf_depth - 1); in mei_dma_ring_read()
193 if (rd_idx + slots > dbuf_depth) { in mei_dma_ring_read()
194 buf += mei_dma_copy_from(dev, buf, rd_idx, dbuf_depth - rd_idx); in mei_dma_ring_read()
195 rem = slots - (dbuf_depth - rd_idx); in mei_dma_ring_read()
196 rd_idx = 0; in mei_dma_ring_read()
201 mei_dma_copy_from(dev, buf, rd_idx, rem); in mei_dma_ring_read()
220 u32 wr_idx, rd_idx, hbuf_depth, empty; in mei_dma_ring_empty_slots() local
230 rd_idx = READ_ONCE(ctrl->hbuf_rd_idx); in mei_dma_ring_empty_slots()
233 if (rd_idx > wr_idx) in mei_dma_ring_empty_slots()
234 empty = rd_idx - wr_idx; in mei_dma_ring_empty_slots()
236 empty = hbuf_depth - (wr_idx - rd_idx); in mei_dma_ring_empty_slots()