/home/hillier_g/checkout/most4linux/most-kernel/most-txbuf.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_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>            /* copy_from_user() */
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 /* MOST_TXBUF */

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