00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef MOST_TXBUF
00022 #define MOST_TXBUF
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 #else
00039 # include "usp-test.h"
00040 #endif
00041
00042 #include "most-common.h"
00043 #include "most-constants.h"
00044 #include "rt-nrt.h"
00045
00060 struct tx_buffer {
00061 unsigned char *buffer;
00062 unsigned char *writeptr[MOST_SYNC_OPENS];
00066 int writer_count;
00067 unsigned char *readptr;
00068 unsigned int full_count;
00070 rtnrt_lock_t lock;
00073 int frame_count;
00075 int bytes_per_frame;
00076 };
00077
00078
00087 struct tx_buffer *txbuf_alloc(unsigned int writer_count,
00088 unsigned int frame_count,
00089 unsigned int bytes_per_frame);
00090
00097 void txbuf_free(struct tx_buffer *ring);
00098
00109 ssize_t txbuf_get(struct tx_buffer *ring,
00110 unsigned char *buffer,
00111 size_t bytes);
00112
00127 ssize_t txbuf_put(struct tx_buffer *ring,
00128 int writer_index,
00129 struct frame_part frame_part,
00130 const char *buffer,
00131 size_t bytes,
00132 struct rtnrt_memcopy_desc *copy);
00133
00140 bool txbuf_is_full(struct tx_buffer *ring, int writer_index);
00141
00150 void txbuf_print_debug(struct tx_buffer *ring);
00151
00152
00153 #endif