00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef MOST_RXBUF
00022 #define MOST_RXBUF
00023
00031 #ifdef HAVE_CONFIG_H
00032 #include "config/config.h"
00033 #endif
00034 #ifndef USP_TEST
00035 # include <asm/uaccess.h>
00036 # include <linux/module.h>
00037 # include <linux/wait.h>
00038 # include "most-common.h"
00039 #else
00040 # include "usp-test.h"
00041 #endif
00042
00043 #include "most-constants.h"
00044 #include "most-common.h"
00045
00061 struct rx_buffer {
00062 unsigned char *buffer;
00063 unsigned char *readptr[MOST_SYNC_OPENS];
00066 unsigned int reader_count;
00067 unsigned char *writeptr;
00068 unsigned int frame_count;
00070 unsigned int bytes_per_frame;
00071 };
00072
00081 struct rx_buffer *rxbuf_alloc(unsigned int reader_count,
00082 unsigned int frame_count,
00083 unsigned int bytes_per_frame);
00084
00090 void rxbuf_free(struct rx_buffer *ring);
00091
00103 ssize_t rxbuf_get(struct rx_buffer *ring,
00104 unsigned int reader_index,
00105 struct frame_part frame_part,
00106 unsigned char *buffer,
00107 size_t bytes,
00108 struct rtnrt_memcopy_desc *copy);
00109
00116 bool rxbuf_is_empty(struct rx_buffer *ring, int reader_index);
00117
00128 ssize_t rxbuf_put(struct rx_buffer *ring,
00129 unsigned char *buffer,
00130 size_t bytes);
00131
00141 void rxbuf_print_debug(struct rx_buffer *ring, bool data);
00142
00143
00144 #endif
00145
00146