1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 #define DE4X5_BMR iobase+(0x000 << lp->bus)
17 #define DE4X5_TPD iobase+(0x008 << lp->bus)
18 #define DE4X5_RPD iobase+(0x010 << lp->bus)
19 #define DE4X5_RRBA iobase+(0x018 << lp->bus)
20 #define DE4X5_TRBA iobase+(0x020 << lp->bus)
21 #define DE4X5_STS iobase+(0x028 << lp->bus)
22 #define DE4X5_OMR iobase+(0x030 << lp->bus)
23 #define DE4X5_IMR iobase+(0x038 << lp->bus)
24 #define DE4X5_MFC iobase+(0x040 << lp->bus)
25 #define DE4X5_APROM iobase+(0x048 << lp->bus)
26 #define DE4X5_DDR iobase+(0x050 << lp->bus)
27 #define DE4X5_FDR iobase+(0x058 << lp->bus)
28 #define DE4X5_SISR iobase+(0x060 << lp->bus)
29 #define DE4X5_SICR iobase+(0x068 << lp->bus)
30 #define DE4X5_STRR iobase+(0x070 << lp->bus)
31 #define DE4X5_SIGR iobase+(0x078 << lp->bus)
32
33
34
35
36 #define EISA_ID iobase+0x0c80
37 #define EISA_ID0 iobase+0x0c80
38 #define EISA_ID1 iobase+0x0c81
39 #define EISA_ID2 iobase+0x0c82
40 #define EISA_ID3 iobase+0x0c83
41 #define EISA_CR iobase+0x0c84
42 #define EISA_REG0 iobase+0x0c88
43 #define EISA_REG1 iobase+0x0c89
44 #define EISA_REG2 iobase+0x0c8a
45 #define EISA_REG3 iobase+0x0c8f
46 #define EISA_APROM iobase+0x0c90
47
48
49
50
51 #define PCI_CFID iobase+0x0008
52 #define PCI_CFCS iobase+0x000c
53 #define PCI_CFRV iobase+0x0018
54 #define PCI_CFLT iobase+0x001c
55 #define PCI_CBIO iobase+0x0028
56 #define PCI_CBMA iobase+0x002c
57 #define PCI_CFIT iobase+0x0038
58
59
60
61
62 #define ER0_BSW 0x80
63 #define ER0_BMW 0x40
64 #define ER0_EPT 0x20
65 #define ER0_ISTS 0x10
66 #define ER0_LI 0x08
67 #define ER0_INTL 0x06
68 #define ER0_INTT 0x01
69
70
71
72
73 #define ER1_IAM 0xe0
74 #define ER1_IAE 0x10
75 #define ER1_UPIN 0x0f
76
77
78
79
80 #define ER2_BRS 0xc0
81 #define ER2_BRA 0x3c
82
83
84
85
86 #define ER3_BWE 0x40
87 #define ER3_BRE 0x04
88 #define ER3_LSR 0x02
89
90
91
92
93 #define CFID_DID 0xff00
94 #define CFID_VID 0x00ff
95 #define DC21040_DID 0x0002
96 #define DC21040_VID 0x1011
97
98
99
100
101 #define CFCS_DPE 0x80000000
102 #define CFCS_SSE 0x40000000
103 #define CFCS_RMA 0x20000000
104 #define CFCS_RTA 0x10000000
105 #define CFCS_DST 0x06000000
106 #define CFCS_DPR 0x01000000
107 #define CFCS_FBB 0x00800000
108 #define CFCS_SLE 0x00000100
109 #define CFCS_PER 0x00000040
110 #define CFCS_MO 0x00000004
111 #define CFCS_MSA 0x00000002
112 #define CFCS_IOSA 0x00000001
113
114
115
116
117 #define CFRV_BC 0xff000000
118 #define CFRV_SC 0x00ff0000
119 #define CFRV_SN 0x000000f0
120 #define CFRV_RN 0x0000000f
121 #define BASE_CLASS 0x02000000
122 #define SUB_CLASS 0x00000000
123 #define STEP_NUMBER 0x00000020
124 #define REV_NUMBER 0x00000003
125 #define CFRV_MASK 0xffff0000
126
127
128
129
130 #define CFLT_BC 0x0000ff00
131
132
133
134
135 #define CBIO_MASK 0x0000ff80
136 #define CBIO_IOSI 0x00000001
137
138
139
140
141 #define BMR_TAP 0x00060000
142 #define BMR_DAS 0x00010000
143 #define BMR_CAL 0x0000c000
144 #define BMR_PBL 0x00003f00
145 #define BMR_BLE 0x00000080
146 #define BMR_DSL 0x0000007c
147 #define BMR_BAR 0x00000002
148 #define BMR_SWR 0x00000001
149
150 #define TAP_NOPOLL 0x00000000
151 #define TAP_200US 0x00020000
152 #define TAP_800US 0x00040000
153 #define TAP_1_6MS 0x00060000
154
155 #define CAL_NOUSE 0x00000000
156 #define CAL_8LONG 0x00004000
157 #define CAL_16LONG 0x00008000
158 #define CAL_32LONG 0x0000c000
159
160 #define PBL_0 0x00000000
161 #define PBL_1 0x00000100
162 #define PBL_2 0x00000200
163 #define PBL_4 0x00000400
164 #define PBL_8 0x00000800
165 #define PBL_16 0x00001000
166 #define PBL_32 0x00002000
167
168 #define DSL_1 0x00000004
169 #define DSL_2 0x00000008
170 #define DSL_4 0x00000010
171 #define DSL_8 0x00000020
172 #define DSL_16 0x00000040
173 #define DSL_32 0x00000080
174
175
176
177
178 #define TPD 0x00000001
179
180
181
182
183 #define RPD 0x00000001
184
185
186
187
188 #define RRBA 0xfffffffc
189
190
191
192
193 #define TRBA 0xfffffffc
194
195
196
197
198 #define STS_EB 0x03800000
199 #define STS_TS 0x00700000
200 #define STS_RS 0x000e0000
201 #define STS_NIS 0x00010000
202 #define STS_AIS 0x00008000
203 #define STS_SE 0x00002000
204 #define STS_LNF 0x00001000
205 #define STS_FD 0x00000800
206 #define STS_AT 0x00000400
207 #define STS_RWT 0x00000200
208 #define STS_RPS 0x00000100
209 #define STS_RU 0x00000080
210 #define STS_RI 0x00000040
211 #define STS_UNF 0x00000020
212 #define STS_TJT 0x00000008
213 #define STS_TU 0x00000004
214 #define STS_TPS 0x00000002
215 #define STS_TI 0x00000001
216
217 #define EB_PAR 0x00000000
218 #define EB_MA 0x00800000
219 #define EB_TA 0x01000000
220 #define EB_RES0 0x01800000
221 #define EB_RES1 0x02000000
222
223 #define TS_STOP 0x00000000
224 #define TS_FTD 0x00100000
225 #define TS_WEOT 0x00200000
226 #define TS_QDAT 0x00300000
227 #define TS_RES 0x00400000
228 #define TS_SPKT 0x00500000
229 #define TS_SUSP 0x00600000
230 #define TS_CLTD 0x00700000
231
232 #define RS_STOP 0x00000000
233 #define RS_FRD 0x00020000
234 #define RS_CEOR 0x00040000
235 #define RS_WFRP 0x00060000
236 #define RS_SUSP 0x00080000
237 #define RS_CLRD 0x000a0000
238 #define RS_FLUSH 0x000c0000
239 #define RS_QRFS 0x000e0000
240
241 #define INT_CANCEL 0x0001ffff
242
243
244
245
246 #define OMR_CA 0x00020000
247 #define OMR_BP 0x00010000
248 #define OMR_TR 0x0000c000
249 #define OMR_ST 0x00002000
250 #define OMR_FC 0x00001000
251 #define OMR_OM 0x00000c00
252 #define OMR_FD 0x00000200
253 #define OMR_FKD 0x00000100
254 #define OMR_PM 0x00000080
255 #define OMR_PR 0x00000040
256 #define OMR_SB 0x00000020
257 #define OMR_IF 0x00000010
258 #define OMR_PB 0x00000008
259 #define OMR_HO 0x00000004
260 #define OMR_SR 0x00000002
261 #define OMR_HP 0x00000001
262
263 #define TR_72 0x00000000
264 #define TR_96 0x00004000
265 #define TR_128 0x00008000
266 #define TR_160 0x0000c000
267
268
269
270
271 #define IMR_NIM 0x00010000
272 #define IMR_AIM 0x00008000
273 #define IMR_SEM 0x00002000
274 #define IMR_LFM 0x00001000
275 #define IMR_FDM 0x00000800
276 #define IMR_ATM 0x00000400
277 #define IMR_RWM 0x00000200
278 #define IMR_RSM 0x00000100
279 #define IMR_RUM 0x00000080
280 #define IMR_RIM 0x00000040
281 #define IMR_UNM 0x00000020
282 #define IMR_TJM 0x00000008
283 #define IMR_TUM 0x00000004
284 #define IMR_TSM 0x00000002
285 #define IMR_TIM 0x00000001
286
287
288
289
290 #define MFC_OVFL 0x00010000
291 #define MFC_CNTR 0x0000ffff
292
293
294
295
296 #define APROM_DN 0x80000000
297 #define APROM_DT 0x000000ff
298
299
300
301
302 #define FDR_FDACV 0x0000ffff
303
304
305
306
307 #define SISR_DAO 0x00000080
308 #define SISR_DAZ 0x00000040
309 #define SISR_DSP 0x00000020
310 #define SISR_DSD 0x00000010
311 #define SISR_APS 0x00000008
312 #define SISR_LKF 0x00000004
313 #define SISR_NCR 0x00000002
314 #define SISR_PAUI 0x00000001
315
316 #define SIA_RESET 0x00000000
317
318
319
320
321 #define SICR_OE57 0x00008000
322 #define SICR_OE24 0x00004000
323 #define SICR_OE13 0x00002000
324 #define SICR_IE 0x00001000
325 #define SICR_EXT 0x00000000
326 #define SICR_D_SIA 0x00000400
327 #define SICR_DPLL 0x00000800
328 #define SICR_APLL 0x00000a00
329 #define SICR_D_RxM 0x00000c00
330 #define SICR_M_RxM 0x00000d00
331 #define SICR_LNKT 0x00000e00
332 #define SICR_SEL 0x00000f00
333 #define SICR_ASE 0x00000080
334 #define SICR_SIM 0x00000040
335 #define SICR_ENI 0x00000020
336 #define SICR_EDP 0x00000010
337 #define SICR_AUI 0x00000008
338 #define SICR_CAC 0x00000004
339 #define SICR_PS 0x00000002
340 #define SICR_SRL 0x00000001
341 #define SICR_RESET 0xffff0000
342
343
344
345
346 #define STRR_SPP 0x00004000
347 #define STRR_APE 0x00002000
348 #define STRR_LTE 0x00001000
349 #define STRR_SQE 0x00000800
350 #define STRR_CLD 0x00000400
351 #define STRR_CSQ 0x00000200
352 #define STRR_RSQ 0x00000100
353 #define STRR_CPEN 0x00000030
354 #define STRR_LSE 0x00000008
355 #define STRR_DREN 0x00000004
356 #define STRR_LBK 0x00000002
357 #define STRR_ECEN 0x00000001
358 #define STRR_RESET 0xffffffff
359
360
361
362
363 #define SIGR_FRL 0x00002000
364 #define SIGR_DPST 0x00001000
365 #define SIGR_FLF 0x00000400
366 #define SIGR_FUSQ 0x00000200
367 #define SIGR_TSCK 0x00000100
368 #define SIGR_RWR 0x00000020
369 #define SIGR_RWD 0x00000010
370 #define SIGR_JCK 0x00000004
371 #define SIGR_HUJ 0x00000002
372 #define SIGR_JBD 0x00000001
373 #define SIGR_RESET 0xffff0000
374
375
376
377
378 #define R_OWN 0x80000000
379 #define RD_FL 0x7fff0000
380 #define RD_ES 0x00008000
381 #define RD_LE 0x00004000
382 #define RD_DT 0x00003000
383 #define RD_RF 0x00000800
384 #define RD_MF 0x00000400
385 #define RD_FS 0x00000200
386 #define RD_LS 0x00000100
387 #define RD_TL 0x00000080
388 #define RD_CS 0x00000040
389 #define RD_FT 0x00000020
390 #define RD_RJ 0x00000010
391 #define RD_DB 0x00000004
392 #define RD_CE 0x00000002
393 #define RD_OF 0x00000001
394
395 #define RD_RER 0x02000000
396 #define RD_RCH 0x01000000
397 #define RD_RBS2 0x003ff800
398 #define RD_RBS1 0x000007ff
399
400
401
402
403 #define T_OWN 0x80000000
404 #define TD_ES 0x00008000
405 #define TD_TO 0x00004000
406 #define TD_LO 0x00000800
407 #define TD_NC 0x00000400
408 #define TD_LC 0x00000200
409 #define TD_EC 0x00000100
410 #define TD_HF 0x00000080
411 #define TD_CC 0x00000078
412 #define TD_LF 0x00000004
413 #define TD_UF 0x00000002
414 #define TD_DE 0x00000001
415
416 #define TD_IC 0x80000000
417 #define TD_LS 0x40000000
418 #define TD_FS 0x20000000
419 #define TD_FT1 0x10000000
420 #define TD_SET 0x08000000
421 #define TD_AC 0x04000000
422 #define TD_TER 0x02000000
423 #define TD_TCH 0x01000000
424 #define TD_DPD 0x00800000
425 #define TD_FT0 0x00400000
426 #define TD_RBS2 0x003ff800
427 #define TD_RBS1 0x000007ff
428
429 #define PERFECT_F 0x00000000
430 #define HASH_F TD_FT0
431 #define INVERSE_F TD_FT1
432 #define HASH_O_F TD_FT1| TD_F0
433
434
435
436
437 #define PCI 0
438 #define EISA 1
439
440 #define NC 0
441 #define TP 1
442 #define BNC 2
443 #define AUI 3
444
445 #define HASH_TABLE_LEN 512
446
447 #define SETUP_FRAME_LEN 192
448 #define PERF_PA_OFFSET 180
449 #define IMPERF_PA_OFFSET 156
450
451 #define POLL_DEMAND 1
452
453 #define MASK_INTERRUPTS 1
454 #define UNMASK_INTERRUPTS 0
455
456
457
458
459 #include <linux/sockios.h>
460
461 #define DE4X5IOCTL SIOCDEVPRIVATE
462
463 struct de4x5_ioctl {
464 unsigned short cmd;
465 unsigned short len;
466 unsigned char *data;
467 };
468
469
470
471
472 #define DE4X5_GET_HWADDR 0x01
473 #define DE4X5_SET_HWADDR 0x02
474 #define DE4X5_SET_PROM 0x03
475 #define DE4X5_CLR_PROM 0x04
476 #define DE4X5_SAY_BOO 0x05
477 #define DE4X5_GET_MCA 0x06
478 #define DE4X5_SET_MCA 0x07
479 #define DE4X5_CLR_MCA 0x08
480 #define DE4X5_MCA_EN 0x09
481 #define DE4X5_GET_STATS 0x0a
482 #define DE4X5_CLR_STATS 0x0b
483 #define DE4X5_GET_OMR 0x0c
484 #define DE4X5_SET_OMR 0x0d
485 #define DE4X5_GET_REG 0x0e
486
487
488