18 #include <linux/compiler.h>
20 #define ACT2000_IOCTL_SETPORT 1
21 #define ACT2000_IOCTL_GETPORT 2
22 #define ACT2000_IOCTL_SETIRQ 3
23 #define ACT2000_IOCTL_GETIRQ 4
24 #define ACT2000_IOCTL_SETBUS 5
25 #define ACT2000_IOCTL_GETBUS 6
26 #define ACT2000_IOCTL_SETPROTO 7
27 #define ACT2000_IOCTL_GETPROTO 8
28 #define ACT2000_IOCTL_SETMSN 9
29 #define ACT2000_IOCTL_GETMSN 10
30 #define ACT2000_IOCTL_LOADBOOT 11
31 #define ACT2000_IOCTL_ADDCARD 12
33 #define ACT2000_IOCTL_TEST 98
34 #define ACT2000_IOCTL_DEBUGVAR 99
36 #define ACT2000_BUS_ISA 1
37 #define ACT2000_BUS_MCA 2
38 #define ACT2000_BUS_PCMCIA 3
60 #if defined(__KERNEL__) || defined(__DEBUGVAR__)
65 #include <linux/sched.h>
66 #include <linux/string.h>
70 #include <linux/errno.h>
74 #include <linux/kernel.h>
75 #include <linux/signal.h>
76 #include <linux/slab.h>
78 #include <linux/mman.h>
81 #include <linux/wait.h>
83 #include <linux/ctype.h>
84 #include <linux/isdnif.h>
88 #define ACT2000_PORTLEN 8
90 #define ACT2000_FLAGS_RUNNING 1
91 #define ACT2000_FLAGS_PVALID 2
92 #define ACT2000_FLAGS_IVALID 4
93 #define ACT2000_FLAGS_LOADED 8
98 #define ACT2000_STATE_NULL 0
99 #define ACT2000_STATE_ICALL 1
100 #define ACT2000_STATE_OCALL 2
101 #define ACT2000_STATE_IWAIT 3
102 #define ACT2000_STATE_OWAIT 4
103 #define ACT2000_STATE_IBWAIT 5
104 #define ACT2000_STATE_OBWAIT 6
105 #define ACT2000_STATE_BWAIT 7
106 #define ACT2000_STATE_BHWAIT 8
107 #define ACT2000_STATE_BHWAIT2 9
108 #define ACT2000_STATE_DHWAIT 10
109 #define ACT2000_STATE_DHWAIT2 11
110 #define ACT2000_STATE_BSETUP 12
111 #define ACT2000_STATE_ACTIVE 13
113 #define ACT2000_MAX_QUEUED 8000
115 #define ACT2000_LOCK_TX 0
116 #define ACT2000_LOCK_RX 1
118 typedef struct act2000_chan {
119 unsigned short callref;
120 unsigned short fsm_state;
125 unsigned char l2prot;
126 unsigned char l3prot;
129 typedef struct msn_entry {
132 struct msn_entry *
next;
135 typedef struct irq_data_isa {
144 typedef union act2000_irq_data {
151 typedef struct act2000_card {
156 struct act2000_card *
next;
172 unsigned short msgnum;
174 act2000_chan bch[ACT2000_BCH];
175 char status_buf[256];
176 char *status_buf_read;
177 char *status_buf_write;
178 char *status_buf_end;
179 act2000_irq_data idat;
184 static inline void act2000_schedule_tx(act2000_card *
card)
189 static inline void act2000_schedule_rx(act2000_card *
card)
194 static inline void act2000_schedule_poll(act2000_card *
card)