/home/hillier_g/checkout/most4linux/most-kernel/most-netservice.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_NETSERVICE_H
00022 #define MOST_NETSERVICE_H
00023 
00034 #ifdef __KERNEL__
00035 #   include <linux/cdev.h>
00036 #endif
00037 
00038 #include <asm/types.h>
00039 #include <asm/ioctl.h>
00040 
00041 /*
00042  * types and constants for userspace and kernelspace ----------------------- 
00043  */
00044 
00049 #define MOST_NETS_IOCTL_MAGIC                           'g'
00050 
00054 struct single_transfer_arg {
00055     __u32   address;          
00058     __u8    value;            
00059 };
00060 
00065 struct block_transfer_arg {
00066     __u32   address;          
00069     __u8    count;            
00071     __u8    *data;            
00074 };
00075 
00076 
00080 enum most_nets_interrupt {
00081     MNS_INT  = (1<<0),        
00082     MNS_AINT = (1<<1)         
00083 };
00084 
00088 struct interrupt_set_arg {
00089     __u32   signo;            
00091     __u32   sigmask;          
00095 };
00096 
00102 #define MOST_NETS_WRITEREG \
00103     _IOW(MOST_NETS_IOCTL_MAGIC,  0, struct single_transfer_arg)
00104 
00111 #define MOST_NETS_READREG \
00112     _IOWR(MOST_NETS_IOCTL_MAGIC, 1, struct single_transfer_arg)
00113 
00122 #define MOST_NETS_READREG_BLOCK \
00123     _IOWR(MOST_NETS_IOCTL_MAGIC, 2, struct block_transfer_arg)
00124 
00132 #define MOST_NETS_WRITEREG_BLOCK \
00133     _IOW(MOST_NETS_IOCTL_MAGIC, 3, struct block_transfer_arg)
00134 
00140 #define MOST_NETS_READ_INT \
00141     _IO(MOST_NETS_IOCTL_MAGIC, 4)
00142 
00170 #define MOST_NETS_IRQ_SET \
00171     _IOW(MOST_NETS_IOCTL_MAGIC, 5, struct interrupt_set_arg)
00172 
00185 #define MOST_NETS_IRQ_RESET \
00186     _IOW(MOST_NETS_IOCTL_MAGIC, 6, unsigned char)
00187 
00191 #define MOST_NETS_RESET \
00192     _IO(MOST_NETS_IOCTL_MAGIC, 7)
00193 
00197 #define MOST_NETS_MAXIOCTL                  7
00198 
00199 
00200 #ifdef __KERNEL__
00201 
00202 /*
00203  * constants --------------------------------------------------------------- 
00204  */
00205 
00209 #define MOST_NETS_MINOR_OFFSET              0
00210 
00215 #define NETS_BUFSIZ                         256
00216 
00226 #define MAX_OPEN_PROCESSES                  1
00227 
00228 
00229 /*
00230  * type definitions -------------------------------------------------------- 
00231  */
00232 
00240 struct most_nets_dev {
00241     struct cdev            cdev;                
00243     struct most_dev        *most_dev;           
00245     unsigned char          buffer[NETS_BUFSIZ]; 
00246     atomic_t               open_count;          
00247     struct task_struct     *task;               
00251     int                    signo;               
00255     int                    signo_async;         
00256     unsigned int           intmask;             
00258     unsigned char          intstatus;           
00264 };
00265 
00266 
00267 
00268 #endif /* __KERNEL__ */
00269 
00270 #endif /* MOST_NETSERVICE_H */
00271 
00272 
00273 /* 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