Go to the source code of this file.
Data Structures | |
struct | rx_buffer |
Functions | |
rx_buffer * | rxbuf_alloc (unsigned int reader_count, unsigned int frame_count, unsigned int bytes_per_frame) |
void | rxbuf_free (struct rx_buffer *ring) |
ssize_t | rxbuf_get (struct rx_buffer *ring, unsigned int reader_index, struct frame_part frame_part, unsigned char *buffer, size_t bytes, struct rtnrt_memcopy_desc *copy) |
bool | rxbuf_is_empty (struct rx_buffer *ring, int reader_index) |
ssize_t | rxbuf_put (struct rx_buffer *ring, unsigned char *buffer, size_t bytes) |
void | rxbuf_print_debug (struct rx_buffer *ring, bool data) |
Definition in file most-rxbuf.h.
struct rx_buffer* rxbuf_alloc | ( | unsigned int | reader_count, | |
unsigned int | frame_count, | |||
unsigned int | bytes_per_frame | |||
) |
reader_count | the number of readers | |
frame_count | the number of frames that are in the ring buffer | |
bytes_per_frame | the number of bytes needed per frame |
Definition at line 54 of file most-rxbuf.c.
References rx_buffer::buffer, rx_buffer::bytes_per_frame, rx_buffer::frame_count, ker_malloc, PR, pr_rxbuf_debug, rx_buffer::reader_count, rx_buffer::readptr, rtnrt_err, and rx_buffer::writeptr.
void rxbuf_free | ( | struct rx_buffer * | ring | ) |
Frees the ring buffer. Don't use ring
after calling this function any more.
ring | the ring buffer |
Definition at line 105 of file most-rxbuf.c.
References rx_buffer::buffer.
ssize_t rxbuf_get | ( | struct rx_buffer * | ring, | |
unsigned int | reader_index, | |||
struct frame_part | frame_part, | |||
unsigned char * | buffer, | |||
size_t | bytes, | |||
struct rtnrt_memcopy_desc * | copy | |||
) |
Reads bytes
bytes from the ring buffer.
ring | the ring buffer | |
reader_index | the index of the reader | |
frame_part | the interesting frame part | |
buffer | buffer from which the data is copied | |
bytes | the number of frames that should be copied | |
copy | the copy descriptor, see description of struct rtnrt_memcopy_desc. |
Definition at line 118 of file most-rxbuf.c.
References rx_buffer::buffer, rx_buffer::bytes_per_frame, frame_part::count, rx_buffer::frame_count, frame_part::offset, PR, pr_rxbuf_debug, rx_buffer::readptr, rtnrt_copy, rtnrt_err, rtnrt_warn, and rx_buffer::writeptr.
Referenced by most_sync_read().
Checks if data is available for reading.
ring | the ring buffer | |
reader_index | the reader index |
Definition at line 189 of file most-rxbuf.c.
References rx_buffer::readptr, and rx_buffer::writeptr.
Referenced by most_sync_read().
ssize_t rxbuf_put | ( | struct rx_buffer * | ring, | |
unsigned char * | buffer, | |||
size_t | bytes | |||
) |
Puts bytes
in the ring.
ring | the ring buffer | |
buffer | buffer from which the data is copied | |
bytes | the number of frames that should be copied. This function overwrites old frames (because it is usually called from a interrupt service routine and cannot be blocked) |
Definition at line 197 of file most-rxbuf.c.
References rx_buffer::buffer, rx_buffer::bytes_per_frame, rx_buffer::frame_count, PR, pr_rxbuf_debug, return_value_if_fails_dbg, rtnrt_err, and rx_buffer::writeptr.
Referenced by measuring_receive_isr_wakeup(), most_sync_int_handler(), and most_sync_rt_interrupt_handler().
Prints debug information (printk()) of the ring buffer. Don't call this function on large ring buffers because the whole buffer is printed in hex values and large buffers would fill the kernel ring buffer here and slowdown the whole system!
ring | the ring buffer | |
data | the data |