00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
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
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
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
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
00269
00270 #endif
00271
00272
00273