/home/hillier_g/checkout/most4linux/most-kernel/most-rxbuf.h

Go to the documentation of this file.
00001 /*
00002  *  Copyright(c) Siemens AG, Muenchen, Germany, 2005, 2006, 2007
00003  *                           Bernhard Walle <bernhard.walle@gmx.de>
00004  *                           Gernot Hillier <gernot.hillier@siemens.com>
00005  *
00006  * ----------------------------------------------------------------------------
00007  * This program is free software; you can redistribute it and/or modify
00008  * it under the terms of the GNU General Public License version 2 as 
00009  * published by the Free Software Foundation;
00010  *
00011  * This program is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License
00017  * along with this program; if not, write to the Free Software
00018  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
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>            /* copy_from_user() */
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 /* MOST_RXBUF */
00145 
00146 /* vim: set ts=4 et sw=4: */

Generated on Fri Mar 9 14:48:58 2007 for MOST Linux Drivers (Linux and RTAI) by  doxygen 1.5.0