Lines Matching +full:len +full:- +full:or +full:- +full:define

9  * Copyright (C) 1999-2003 Ralph Metzler & Marcus Metzler
12 * This program is free software; you can redistribute it and/or
15 * of the License, or (at your option) any later version.
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 #define _DVB_RINGBUFFER_H_
30 * struct dvb_ringbuffer - Describes a ring buffer used at DVB framework
52 #define DVB_RINGBUFFER_PKTHDRSIZE 3
55 * dvb_ringbuffer_init - initialize ring buffer, lock and queue
59 * @len: bytes from ring buffer into @buf
62 size_t len);
65 * dvb_ringbuffer_empty - test whether buffer is empty
72 * dvb_ringbuffer_free - returns the number of free bytes in the buffer
81 * dvb_ringbuffer_avail - returns the number of bytes waiting in the buffer
90 * dvb_ringbuffer_reset - resets the ringbuffer to initial state
105 * dvb_ringbuffer_flush - flush buffer
112 * dvb_ringbuffer_flush_spinlock_wakeup- flush buffer protected by spinlock
113 * and wake-up waiting task(s)
120 * DVB_RINGBUFFER_PEEK - peek at byte @offs in the buffer
125 #define DVB_RINGBUFFER_PEEK(rbuf, offs) \
126 ((rbuf)->data[((rbuf)->pread + (offs)) % (rbuf)->size])
129 * DVB_RINGBUFFER_SKIP - advance read ptr by @num bytes
134 #define DVB_RINGBUFFER_SKIP(rbuf, num) {\
135 (rbuf)->pread = ((rbuf)->pread + (num)) % (rbuf)->size;\
139 * dvb_ringbuffer_read_user - Reads a buffer into a user pointer
143 * @len: bytes from ring buffer into @buf
148 * Return: number of bytes transferred or -EFAULT
151 u8 __user *buf, size_t len);
154 * dvb_ringbuffer_read - Reads a buffer into a pointer
158 * @len: bytes from ring buffer into @buf
162 * Return: number of bytes transferred or -EFAULT
165 u8 *buf, size_t len);
172 * DVB_RINGBUFFER_WRITE_BYTE - write single byte to ring buffer
177 #define DVB_RINGBUFFER_WRITE_BYTE(rbuf, byte) \
178 { (rbuf)->data[(rbuf)->pwrite] = (byte); \
179 (rbuf)->pwrite = ((rbuf)->pwrite + 1) % (rbuf)->size; }
182 * dvb_ringbuffer_write - Writes a buffer into the ringbuffer
186 * @len: bytes from ring buffer into @buf
190 * return: number of bytes transferred or -EFAULT
193 size_t len);
196 * dvb_ringbuffer_write_user - Writes a buffer received via a user pointer
200 * @len: bytes from ring buffer into @buf
205 * Return: number of bytes transferred or -EFAULT
208 const u8 __user *buf, size_t len);
211 * dvb_ringbuffer_pkt_write - Write a packet into the ringbuffer.
215 * @len: Length of buffer (currently limited to 65535 bytes max).
217 * Return: Number of bytes written, or -EFAULT, -ENOMEM, -EINVAL.
220 size_t len);
223 * dvb_ringbuffer_pkt_read_user - Read from a packet in the ringbuffer.
229 * @len: Size of destination buffer.
231 * Return: Number of bytes read, or -EFAULT.
242 size_t len);
245 * dvb_ringbuffer_pkt_read - Read from a packet in the ringbuffer.
253 * @len: Size of destination buffer.
255 * Return: Number of bytes read, or -EFAULT.
258 int offset, u8 *buf, size_t len);
261 * dvb_ringbuffer_pkt_dispose - Dispose of a packet in the ring buffer.
269 * dvb_ringbuffer_pkt_next - Get the index of the next packet in a ringbuffer.
272 * @idx: Previous packet index, or -1 to return the first packet index.
275 * returns Packet index (if >=0), or -1 if no packets available.