Lines Matching refs:rd_idx
171 u32 rd_idx, rem, slots; in mei_dma_ring_read() local
182 rd_idx = READ_ONCE(ctrl->dbuf_rd_idx) & (dbuf_depth - 1); in mei_dma_ring_read()
189 if (rd_idx + slots > dbuf_depth) { in mei_dma_ring_read()
190 buf += mei_dma_copy_from(dev, buf, rd_idx, dbuf_depth - rd_idx); in mei_dma_ring_read()
191 rem = slots - (dbuf_depth - rd_idx); in mei_dma_ring_read()
192 rd_idx = 0; in mei_dma_ring_read()
197 mei_dma_copy_from(dev, buf, rd_idx, rem); in mei_dma_ring_read()
216 u32 wr_idx, rd_idx, hbuf_depth, empty; in mei_dma_ring_empty_slots() local
226 rd_idx = READ_ONCE(ctrl->hbuf_rd_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()