99 // Bit 4 SRC/SINK 1 = SRC 0 = SINK |
100 // Bit 4 SRC/SINK 1 = SRC 0 = SINK |
100 // Bit 5 INTB 1 ISA has here INTB 0 |
101 // Bit 5 INTB 1 ISA has here INTB 0 |
101 // Bit 6 INTB 0 ISA has here INTB 1 |
102 // Bit 6 INTB 0 ISA has here INTB 1 |
102 // Bit 7 ENIO 1 = Enable 0 = high resistance |
103 // Bit 7 ENIO 1 = Enable 0 = high resistance |
103 // Bit 8-15 dont care |
104 // Bit 8-15 dont care |
|
105 // +---------------------------------------+ |
|
106 // | 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | |
|
107 // +---------------------------------------+ |
|
108 // | | | | | | | | | |
|
109 // +---------------------------------------+ |
|
110 // |
|
111 // +---------------------------------------+ |
|
112 // | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | |
|
113 // +---------------------------------------+ |
|
114 // |ENIO|INTB|INTB|SRC/| | | | | |
|
115 // | | 0| 1|SINK| | | | | |
|
116 // +---------------------------------------+ |
|
117 // | | | `-- 0 SINK |
|
118 // | | | 1 SOURCE |
|
119 // | `----`------ 00 INT off |
|
120 // | 01 INT on pattern |
|
121 // | 10 INT on masked change |
|
122 // | 11 INT off |
|
123 // `----------------- 0 IO enable |
|
124 // 1 IO disable (high resistance) |
104 /*********************************************************/ |
125 /*********************************************************/ |
105 /* The ME8100_ID_REG_X contains on PCI boards static 81h */ |
126 /* The ME8100_ID_REG_X contains on PCI boards static 81h */ |
106 /*********************************************************/ |
127 /*********************************************************/ |
|
128 |
|
129 /* Some definitions to be written to the CTRL register */ |
|
130 #define ME8100_CTL_ENIO 0x80 |
|
131 #define ME8100_CTL_SOURCE 0x10 |
|
132 #define ME8100_CTL_SINK 0x00 |
|
133 |
|
134 #define ME8100_CTL_IRQ_PATTERN 0x40 |
|
135 #define ME8100_CTL_IRQ_MASK 0x60 |
107 |
136 |
108 /* ME8100 Register Set A */ |
137 /* ME8100 Register Set A */ |
109 #define ME8100_ID_REG_A 0x00 //(r, ) |
138 #define ME8100_ID_REG_A 0x00 //(r, ) |
110 #define ME8100_CTRL_REG_A 0x00 //( ,w) |
139 #define ME8100_CTRL_REG_A 0x00 //( ,w) |
111 #define ME8100_RES_INT_REG_A 0x02 //(r, ) |
140 #define ME8100_RES_INT_REG_A 0x02 //(r, ) |
112 #define ME8100_DI_REG_A 0x04 //(r, ) |
141 #define ME8100_DI_REG_A 0x04 //(r, ) |
113 #define ME8100_DO_REG_A 0x06 //( ,w) |
142 #define ME8100_DO_REG_A 0x06 //( ,w) |
114 #define ME8100_PATTERN_REG_A 0x08 //( ,w) |
143 #define ME8100_PATTERN_REG_A 0x08 //( ,w) |
115 #define ME8100_MASK_REG_A 0x0A //( ,w) |
144 #define ME8100_MASK_REG_A 0x0A //( ,w) |
116 #define ME8100_INT_DI_REG_A 0x0A //(r, ) |
145 #define ME8100_INT_DI_REG_A 0x0A //(r, ) |
|
146 |
117 |
147 |
118 /* ME8100 Register Set B */ |
148 /* ME8100 Register Set B */ |
119 #define ME8100_ID_REG_B 0x0C //(r, ) |
149 #define ME8100_ID_REG_B 0x0C //(r, ) |
120 #define ME8100_CTRL_REG_B 0x0C //( ,w) |
150 #define ME8100_CTRL_REG_B 0x0C //( ,w) |
121 #define ME8100_RES_INT_REG_B 0x0E //(r, ) |
151 #define ME8100_RES_INT_REG_B 0x0E //(r, ) |
176 int int_count_1; /* Count of interrupt 1 */ |
207 int int_count_1; /* Count of interrupt 1 */ |
177 int int_count_2; /* Count of interrupt 2 */ |
208 int int_count_2; /* Count of interrupt 2 */ |
178 int board_in_use; /* Indicates if board is already in use */ |
209 int board_in_use; /* Indicates if board is already in use */ |
179 spinlock_t use_lock; /* Guards board in use */ |
210 spinlock_t use_lock; /* Guards board in use */ |
180 struct file *file_ptr; /* Pointer to file structure of path */ |
211 struct file *file_ptr; /* Pointer to file structure of path */ |
|
212 struct fasync_struct *fasync_ptr; /* .hs */ |
181 } me8100_info_type; |
213 } me8100_info_type; |
182 |
214 |
|
215 #endif /* __KERNEL__ */ |
183 |
216 |
184 /* ME8100 IOCTL's */ |
217 /* ME8100 IOCTL's */ |
185 #define ME8100_IOCTL_MAXNR 29 |
218 #define ME8100_IOCTL_MAXNR 29 |
186 #define ME8100_MAGIC 'o' |
219 #define ME8100_MAGIC 'o' |
187 #define ME8100_READ_ID_A _IOR(ME8100_MAGIC, 0, unsigned short) |
220 #define ME8100_READ_ID_A _IOR(ME8100_MAGIC, 0, unsigned short) |
215 #define ME8100_INT_OCCUR _IOR(ME8100_MAGIC, 25, me8100_int_occur_type) |
248 #define ME8100_INT_OCCUR _IOR(ME8100_MAGIC, 25, me8100_int_occur_type) |
216 #define ME8100_SETUP_ICSR _IOW(ME8100_MAGIC, 26, unsigned char) |
249 #define ME8100_SETUP_ICSR _IOW(ME8100_MAGIC, 26, unsigned char) |
217 #define ME8100_READ_ICSR _IOR(ME8100_MAGIC, 27, unsigned char) |
250 #define ME8100_READ_ICSR _IOR(ME8100_MAGIC, 27, unsigned char) |
218 #define ME8100_GET_BOARD_INFO _IOR(ME8100_MAGIC, 28, me8100_info_type) |
251 #define ME8100_GET_BOARD_INFO _IOR(ME8100_MAGIC, 28, me8100_info_type) |
219 #define ME8100_GET_INT_COUNT _IOR(ME8100_MAGIC, 29, me8100_int_occur_type) |
252 #define ME8100_GET_INT_COUNT _IOR(ME8100_MAGIC, 29, me8100_int_occur_type) |
|
253 |