Lines Matching refs:pread
44 rbuf->pread=rbuf->pwrite=0; in dvb_ringbuffer_init()
58 return (rbuf->pread==rbuf->pwrite); in dvb_ringbuffer_empty()
67 free = rbuf->pread - rbuf->pwrite; in dvb_ringbuffer_free()
79 avail = rbuf->pwrite - rbuf->pread; in dvb_ringbuffer_avail()
89 rbuf->pread = rbuf->pwrite; in dvb_ringbuffer_flush()
96 rbuf->pread = rbuf->pwrite = 0; in dvb_ringbuffer_reset()
116 split = (rbuf->pread + len > rbuf->size) ? rbuf->size - rbuf->pread : 0; in dvb_ringbuffer_read_user()
118 if (copy_to_user(buf, rbuf->data+rbuf->pread, split)) in dvb_ringbuffer_read_user()
122 rbuf->pread = 0; in dvb_ringbuffer_read_user()
124 if (copy_to_user(buf, rbuf->data+rbuf->pread, todo)) in dvb_ringbuffer_read_user()
127 rbuf->pread = (rbuf->pread + todo) % rbuf->size; in dvb_ringbuffer_read_user()
137 split = (rbuf->pread + len > rbuf->size) ? rbuf->size - rbuf->pread : 0; in dvb_ringbuffer_read()
139 memcpy(buf, rbuf->data+rbuf->pread, split); in dvb_ringbuffer_read()
142 rbuf->pread = 0; in dvb_ringbuffer_read()
144 memcpy(buf, rbuf->data+rbuf->pread, todo); in dvb_ringbuffer_read()
146 rbuf->pread = (rbuf->pread + todo) % rbuf->size; in dvb_ringbuffer_read()
262 idx = rbuf->pread; in dvb_ringbuffer_pkt_next()
269 consumed = (idx - rbuf->pread) % rbuf->size; in dvb_ringbuffer_pkt_next()