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_BROM iobase+(0x048 << lp->bus)
27#define DE4X5_SROM iobase+(0x048 << lp->bus)
28#define DE4X5_MII iobase+(0x048 << lp->bus)
29#define DE4X5_DDR iobase+(0x050 << lp->bus)
30#define DE4X5_FDR iobase+(0x058 << lp->bus)
31#define DE4X5_GPT iobase+(0x058 << lp->bus)
32#define DE4X5_GEP iobase+(0x060 << lp->bus)
33#define DE4X5_SISR iobase+(0x060 << lp->bus)
34#define DE4X5_SICR iobase+(0x068 << lp->bus)
35#define DE4X5_STRR iobase+(0x070 << lp->bus)
36#define DE4X5_SIGR iobase+(0x078 << lp->bus)
37
38
39
40
41#define EISA_ID iobase+0x0c80
42#define EISA_ID0 iobase+0x0c80
43#define EISA_ID1 iobase+0x0c81
44#define EISA_ID2 iobase+0x0c82
45#define EISA_ID3 iobase+0x0c83
46#define EISA_CR iobase+0x0c84
47#define EISA_REG0 iobase+0x0c88
48#define EISA_REG1 iobase+0x0c89
49#define EISA_REG2 iobase+0x0c8a
50#define EISA_REG3 iobase+0x0c8f
51#define EISA_APROM iobase+0x0c90
52
53
54
55
56#define PCI_CFID iobase+0x0008
57#define PCI_CFCS iobase+0x000c
58#define PCI_CFRV iobase+0x0018
59#define PCI_CFLT iobase+0x001c
60#define PCI_CBIO iobase+0x0028
61#define PCI_CBMA iobase+0x002c
62#define PCI_CBER iobase+0x0030
63#define PCI_CFIT iobase+0x003c
64#define PCI_CFDA iobase+0x0040
65#define PCI_CFDD iobase+0x0041
66#define PCI_CFPM iobase+0x0043
67
68
69
70
71#define ER0_BSW 0x80
72#define ER0_BMW 0x40
73#define ER0_EPT 0x20
74#define ER0_ISTS 0x10
75#define ER0_LI 0x08
76#define ER0_INTL 0x06
77#define ER0_INTT 0x01
78
79
80
81
82#define ER1_IAM 0xe0
83#define ER1_IAE 0x10
84#define ER1_UPIN 0x0f
85
86
87
88
89#define ER2_BRS 0xc0
90#define ER2_BRA 0x3c
91
92
93
94
95#define ER3_BWE 0x40
96#define ER3_BRE 0x04
97#define ER3_LSR 0x02
98
99
100
101
102
103
104#define CFID_DID 0xff00
105#define CFID_VID 0x00ff
106#define DC21040_DID 0x0200
107#define DC21040_VID 0x1011
108#define DC21041_DID 0x1400
109#define DC21041_VID 0x1011
110#define DC21140_DID 0x0900
111#define DC21140_VID 0x1011
112#define DC2114x_DID 0x1900
113#define DC2114x_VID 0x1011
114
115
116
117
118#define DC21040 DC21040_DID
119#define DC21041 DC21041_DID
120#define DC21140 DC21140_DID
121#define DC2114x DC2114x_DID
122#define DC21142 (DC2114x_DID | 0x0010)
123#define DC21143 (DC2114x_DID | 0x0030)
124#define DC2114x_BRK 0x0020
125
126#define is_DC21040 ((vendor == DC21040_VID) && (device == DC21040_DID))
127#define is_DC21041 ((vendor == DC21041_VID) && (device == DC21041_DID))
128#define is_DC21140 ((vendor == DC21140_VID) && (device == DC21140_DID))
129#define is_DC2114x ((vendor == DC2114x_VID) && (device == DC2114x_DID))
130#define is_DC21142 ((vendor == DC2114x_VID) && (device == DC21142))
131#define is_DC21143 ((vendor == DC2114x_VID) && (device == DC21143))
132
133
134
135
136#define CFCS_DPE 0x80000000
137#define CFCS_SSE 0x40000000
138#define CFCS_RMA 0x20000000
139#define CFCS_RTA 0x10000000
140#define CFCS_DST 0x06000000
141#define CFCS_DPR 0x01000000
142#define CFCS_FBB 0x00800000
143#define CFCS_SEE 0x00000100
144#define CFCS_PER 0x00000040
145#define CFCS_MO 0x00000004
146#define CFCS_MSA 0x00000002
147#define CFCS_IOSA 0x00000001
148
149
150
151
152#define CFRV_BC 0xff000000
153#define CFRV_SC 0x00ff0000
154#define CFRV_RN 0x000000f0
155#define CFRV_SN 0x0000000f
156#define BASE_CLASS 0x02000000
157#define SUB_CLASS 0x00000000
158#define STEP_NUMBER 0x00000020
159#define REV_NUMBER 0x00000003
160#define CFRV_MASK 0xffff0000
161
162
163
164
165#define CFLT_BC 0x0000ff00
166
167
168
169
170#define CBIO_MASK -128
171#define CBIO_IOSI 0x00000001
172
173
174
175
176#define CCIS_ROMI 0xf0000000
177#define CCIS_ASO 0x0ffffff8
178#define CCIS_ASI 0x00000007
179
180
181
182
183#define SSID_SSID 0xffff0000
184#define SSID_SVID 0x0000ffff
185
186
187
188
189#define CBER_MASK 0xfffffc00
190#define CBER_ROME 0x00000001
191
192
193
194
195#define CFIT_MXLT 0xff000000
196#define CFIT_MNGT 0x00ff0000
197#define CFIT_IRQP 0x0000ff00
198#define CFIT_IRQL 0x000000ff
199
200
201
202
203#define SLEEP 0x80
204#define SNOOZE 0x40
205#define WAKEUP 0x00
206
207#define PCI_CFDA_DSU 0x41
208#define PCI_CFDA_PSM 0x43
209
210
211
212
213#define BMR_RML 0x00200000
214#define BMR_DBO 0x00100000
215#define BMR_TAP 0x000e0000
216#define BMR_DAS 0x00010000
217#define BMR_CAL 0x0000c000
218#define BMR_PBL 0x00003f00
219#define BMR_BLE 0x00000080
220#define BMR_DSL 0x0000007c
221#define BMR_BAR 0x00000002
222#define BMR_SWR 0x00000001
223
224
225#define TAP_NOPOLL 0x00000000
226#define TAP_200US 0x00020000
227#define TAP_800US 0x00040000
228#define TAP_1_6MS 0x00060000
229#define TAP_12_8US 0x00080000
230#define TAP_25_6US 0x000a0000
231#define TAP_51_2US 0x000c0000
232#define TAP_102_4US 0x000e0000
233
234#define CAL_NOUSE 0x00000000
235#define CAL_8LONG 0x00004000
236#define CAL_16LONG 0x00008000
237#define CAL_32LONG 0x0000c000
238
239#define PBL_0 0x00000000
240#define PBL_1 0x00000100
241#define PBL_2 0x00000200
242#define PBL_4 0x00000400
243#define PBL_8 0x00000800
244#define PBL_16 0x00001000
245#define PBL_32 0x00002000
246
247#define DSL_0 0x00000000
248#define DSL_1 0x00000004
249#define DSL_2 0x00000008
250#define DSL_4 0x00000010
251#define DSL_8 0x00000020
252#define DSL_16 0x00000040
253#define DSL_32 0x00000080
254
255
256
257
258#define TPD 0x00000001
259
260
261
262
263#define RPD 0x00000001
264
265
266
267
268#define RRBA 0xfffffffc
269
270
271
272
273#define TRBA 0xfffffffc
274
275
276
277
278#define STS_GPI 0x04000000
279#define STS_BE 0x03800000
280#define STS_TS 0x00700000
281#define STS_RS 0x000e0000
282#define STS_NIS 0x00010000
283#define STS_AIS 0x00008000
284#define STS_ER 0x00004000
285#define STS_FBE 0x00002000
286#define STS_SE 0x00002000
287#define STS_LNF 0x00001000
288#define STS_FD 0x00000800
289#define STS_TM 0x00000800
290#define STS_ETI 0x00000400
291#define STS_AT 0x00000400
292#define STS_RWT 0x00000200
293#define STS_RPS 0x00000100
294#define STS_RU 0x00000080
295#define STS_RI 0x00000040
296#define STS_UNF 0x00000020
297#define STS_LNP 0x00000010
298#define STS_ANC 0x00000010
299#define STS_TJT 0x00000008
300#define STS_TU 0x00000004
301#define STS_TPS 0x00000002
302#define STS_TI 0x00000001
303
304#define EB_PAR 0x00000000
305#define EB_MA 0x00800000
306#define EB_TA 0x01000000
307#define EB_RES0 0x01800000
308#define EB_RES1 0x02000000
309
310#define TS_STOP 0x00000000
311#define TS_FTD 0x00100000
312#define TS_WEOT 0x00200000
313#define TS_QDAT 0x00300000
314#define TS_RES 0x00400000
315#define TS_SPKT 0x00500000
316#define TS_SUSP 0x00600000
317#define TS_CLTD 0x00700000
318
319#define RS_STOP 0x00000000
320#define RS_FRD 0x00020000
321#define RS_CEOR 0x00040000
322#define RS_WFRP 0x00060000
323#define RS_SUSP 0x00080000
324#define RS_CLRD 0x000a0000
325#define RS_FLUSH 0x000c0000
326#define RS_QRFS 0x000e0000
327
328#define INT_CANCEL 0x0001ffff
329
330
331
332
333#define OMR_SC 0x80000000
334#define OMR_RA 0x40000000
335#define OMR_SDP 0x02000000
336#define OMR_SCR 0x01000000
337#define OMR_PCS 0x00800000
338#define OMR_TTM 0x00400000
339#define OMR_SF 0x00200000
340#define OMR_HBD 0x00080000
341#define OMR_PS 0x00040000
342#define OMR_CA 0x00020000
343#define OMR_BP 0x00010000
344#define OMR_TR 0x0000c000
345#define OMR_ST 0x00002000
346#define OMR_FC 0x00001000
347#define OMR_OM 0x00000c00
348#define OMR_FDX 0x00000200
349#define OMR_FKD 0x00000100
350#define OMR_PM 0x00000080
351#define OMR_PR 0x00000040
352#define OMR_SB 0x00000020
353#define OMR_IF 0x00000010
354#define OMR_PB 0x00000008
355#define OMR_HO 0x00000004
356#define OMR_SR 0x00000002
357#define OMR_HP 0x00000001
358
359#define TR_72 0x00000000
360#define TR_96 0x00004000
361#define TR_128 0x00008000
362#define TR_160 0x0000c000
363
364#define OMR_DEF (OMR_SDP)
365#define OMR_SIA (OMR_SDP | OMR_TTM)
366#define OMR_SYM (OMR_SDP | OMR_SCR | OMR_PCS | OMR_HBD | OMR_PS)
367#define OMR_MII_10 (OMR_SDP | OMR_TTM | OMR_PS)
368#define OMR_MII_100 (OMR_SDP | OMR_HBD | OMR_PS)
369
370
371
372
373#define IMR_GPM 0x04000000
374#define IMR_NIM 0x00010000
375#define IMR_AIM 0x00008000
376#define IMR_ERM 0x00004000
377#define IMR_FBM 0x00002000
378#define IMR_SEM 0x00002000
379#define IMR_LFM 0x00001000
380#define IMR_FDM 0x00000800
381#define IMR_TMM 0x00000800
382#define IMR_ETM 0x00000400
383#define IMR_ATM 0x00000400
384#define IMR_RWM 0x00000200
385#define IMR_RSM 0x00000100
386#define IMR_RUM 0x00000080
387#define IMR_RIM 0x00000040
388#define IMR_UNM 0x00000020
389#define IMR_ANM 0x00000010
390#define IMR_LPM 0x00000010
391#define IMR_TJM 0x00000008
392#define IMR_TUM 0x00000004
393#define IMR_TSM 0x00000002
394#define IMR_TIM 0x00000001
395
396
397
398
399#define MFC_FOCO 0x10000000
400#define MFC_FOC 0x0ffe0000
401#define MFC_OVFL 0x00010000
402#define MFC_CNTR 0x0000ffff
403#define MFC_FOCM 0x1ffe0000
404
405
406
407
408#define APROM_DN 0x80000000
409#define APROM_DT 0x000000ff
410
411
412
413
414#define BROM_MODE 0x00008000
415#define BROM_RD 0x00004000
416#define BROM_WR 0x00002000
417#define BROM_BR 0x00001000
418#define BROM_SR 0x00000800
419#define BROM_REG 0x00000400
420#define BROM_DT 0x000000ff
421
422
423
424
425#define MII_MDI 0x00080000
426#define MII_MDO 0x00060000
427#define MII_MRD 0x00040000
428#define MII_MWR 0x00000000
429#define MII_MDT 0x00020000
430#define MII_MDC 0x00010000
431#define MII_RD 0x00004000
432#define MII_WR 0x00002000
433#define MII_SEL 0x00000800
434
435#define SROM_MODE 0x00008000
436#define SROM_RD 0x00004000
437#define SROM_WR 0x00002000
438#define SROM_BR 0x00001000
439#define SROM_SR 0x00000800
440#define SROM_REG 0x00000400
441#define SROM_DT 0x000000ff
442
443#define DT_OUT 0x00000008
444#define DT_IN 0x00000004
445#define DT_CLK 0x00000002
446#define DT_CS 0x00000001
447
448#define MII_PREAMBLE 0xffffffff
449#define MII_TEST 0xaaaaaaaa
450#define MII_STRD 0x06
451#define MII_STWR 0x0a
452
453#define MII_CR 0x00
454#define MII_SR 0x01
455#define MII_ID0 0x02
456#define MII_ID1 0x03
457#define MII_ANA 0x04
458#define MII_ANLPA 0x05
459#define MII_ANE 0x06
460#define MII_ANP 0x07
461
462#define DE4X5_MAX_MII 32
463
464
465
466
467#define MII_CR_RST 0x8000
468#define MII_CR_LPBK 0x4000
469#define MII_CR_SPD 0x2000
470#define MII_CR_10 0x0000
471#define MII_CR_100 0x2000
472#define MII_CR_ASSE 0x1000
473#define MII_CR_PD 0x0800
474#define MII_CR_ISOL 0x0400
475#define MII_CR_RAN 0x0200
476#define MII_CR_FDM 0x0100
477#define MII_CR_CTE 0x0080
478
479
480
481
482#define MII_SR_T4C 0x8000
483#define MII_SR_TXFD 0x4000
484#define MII_SR_TXHD 0x2000
485#define MII_SR_TFD 0x1000
486#define MII_SR_THD 0x0800
487#define MII_SR_ASSC 0x0020
488#define MII_SR_RFD 0x0010
489#define MII_SR_ANC 0x0008
490#define MII_SR_LKS 0x0004
491#define MII_SR_JABD 0x0002
492#define MII_SR_XC 0x0001
493
494
495
496
497#define MII_ANA_TAF 0x03e0
498#define MII_ANA_T4AM 0x0200
499#define MII_ANA_TXAM 0x0180
500#define MII_ANA_FDAM 0x0140
501#define MII_ANA_HDAM 0x02a0
502#define MII_ANA_100M 0x0380
503#define MII_ANA_10M 0x0060
504#define MII_ANA_CSMA 0x0001
505
506
507
508
509#define MII_ANLPA_NP 0x8000
510#define MII_ANLPA_ACK 0x4000
511#define MII_ANLPA_RF 0x2000
512#define MII_ANLPA_TAF 0x03e0
513#define MII_ANLPA_T4AM 0x0200
514#define MII_ANLPA_TXAM 0x0180
515#define MII_ANLPA_FDAM 0x0140
516#define MII_ANLPA_HDAM 0x02a0
517#define MII_ANLPA_100M 0x0380
518#define MII_ANLPA_10M 0x0060
519#define MII_ANLPA_CSMA 0x0001
520
521
522
523
524#define MEDIA_NWAY 0x0080
525#define MEDIA_MII 0x0040
526#define MEDIA_FIBRE 0x0008
527#define MEDIA_AUI 0x0004
528#define MEDIA_TP 0x0002
529#define MEDIA_BNC 0x0001
530
531
532
533
534#define SROM_SSVID 0x0000
535#define SROM_SSID 0x0002
536#define SROM_CISPL 0x0004
537#define SROM_CISPH 0x0006
538#define SROM_IDCRC 0x0010
539#define SROM_RSVD2 0x0011
540#define SROM_SFV 0x0012
541#define SROM_CCNT 0x0013
542#define SROM_HWADD 0x0014
543#define SROM_MRSVD 0x007c
544#define SROM_CRC 0x007e
545
546
547
548
549#define SROM_10BT 0x0000
550#define SROM_10BTN 0x0100
551#define SROM_10BTF 0x0204
552#define SROM_10BTNLP 0x0400
553#define SROM_10B2 0x0001
554#define SROM_10B5 0x0002
555#define SROM_100BTH 0x0003
556#define SROM_100BTF 0x0205
557#define SROM_100BT4 0x0006
558#define SROM_100BFX 0x0007
559#define SROM_M10BT 0x0009
560#define SROM_M10BTF 0x020a
561#define SROM_M100BT 0x000d
562#define SROM_M100BTF 0x020e
563#define SROM_M100BT4 0x000f
564#define SROM_M100BF 0x0010
565#define SROM_M100BFF 0x0211
566#define SROM_PDA 0x0800
567#define SROM_PAO 0x8800
568#define SROM_NSMI 0xffff
569
570
571
572
573#define SROM_10BASET 0x0000
574#define SROM_10BASE2 0x0001
575#define SROM_10BASE5 0x0002
576#define SROM_100BASET 0x0003
577#define SROM_10BASETF 0x0004
578#define SROM_100BASETF 0x0005
579#define SROM_100BASET4 0x0006
580#define SROM_100BASEF 0x0007
581#define SROM_100BASEFF 0x0008
582
583#define BLOCK_LEN 0x7f
584#define EXT_FIELD 0x40
585#define MEDIA_CODE 0x3f
586
587
588
589
590#define COMPACT_FI 0x80
591#define COMPACT_LEN 0x04
592#define COMPACT_MC 0x3f
593
594
595
596
597#define BLOCK0_FI 0x80
598#define BLOCK0_MCS 0x80
599#define BLOCK0_MC 0x3f
600
601
602
603
604#define FDR_FDACV 0x0000ffff
605
606
607
608
609#define GPT_CON 0x00010000
610#define GPT_VAL 0x0000ffff
611
612
613
614
615
616#define GEP_LNP 0x00000080
617#define GEP_SLNK 0x00000040
618#define GEP_SDET 0x00000020
619#define GEP_HRST 0x00000010
620#define GEP_FDXD 0x00000008
621#define GEP_PHYL 0x00000004
622#define GEP_FLED 0x00000002
623#define GEP_MODE 0x00000001
624#define GEP_INIT 0x0000011f
625#define GEP_CTRL 0x00000100
626
627
628
629
630#define CSR13 0x00000001
631#define CSR14 0x0003ff7f
632#define CSR15 0x00000008
633
634
635
636
637#define SISR_LPC 0xffff0000
638#define SISR_LPN 0x00008000
639#define SISR_ANS 0x00007000
640#define SISR_NSN 0x00000800
641#define SISR_TRF 0x00000800
642#define SISR_NSND 0x00000400
643#define SISR_ANR_FDS 0x00000400
644#define SISR_TRA 0x00000200
645#define SISR_NRA 0x00000200
646#define SISR_ARA 0x00000100
647#define SISR_SRA 0x00000100
648#define SISR_DAO 0x00000080
649#define SISR_DAZ 0x00000040
650#define SISR_DSP 0x00000020
651#define SISR_DSD 0x00000010
652#define SISR_APS 0x00000008
653#define SISR_LKF 0x00000004
654#define SISR_LS10 0x00000004
655#define SISR_NCR 0x00000002
656#define SISR_LS100 0x00000002
657#define SISR_PAUI 0x00000001
658#define SISR_MRA 0x00000001
659
660#define ANS_NDIS 0x00000000
661#define ANS_TDIS 0x00001000
662#define ANS_ADET 0x00002000
663#define ANS_ACK 0x00003000
664#define ANS_CACK 0x00004000
665#define ANS_NWOK 0x00005000
666#define ANS_LCHK 0x00006000
667
668#define SISR_RST 0x00000301
669#define SISR_ANR 0x00001301
670
671
672
673
674#define SICR_SDM 0xffff0000
675#define SICR_OE57 0x00008000
676#define SICR_OE24 0x00004000
677#define SICR_OE13 0x00002000
678#define SICR_IE 0x00001000
679#define SICR_EXT 0x00000000
680#define SICR_D_SIA 0x00000400
681#define SICR_DPLL 0x00000800
682#define SICR_APLL 0x00000a00
683#define SICR_D_RxM 0x00000c00
684#define SICR_M_RxM 0x00000d00
685#define SICR_LNKT 0x00000e00
686#define SICR_SEL 0x00000f00
687#define SICR_ASE 0x00000080
688#define SICR_SIM 0x00000040
689#define SICR_ENI 0x00000020
690#define SICR_EDP 0x00000010
691#define SICR_AUI 0x00000008
692#define SICR_CAC 0x00000004
693#define SICR_PS 0x00000002
694#define SICR_SRL 0x00000001
695#define SIA_RESET 0x00000000
696
697
698
699
700#define STRR_TAS 0x00008000
701#define STRR_SPP 0x00004000
702#define STRR_APE 0x00002000
703#define STRR_LTE 0x00001000
704#define STRR_SQE 0x00000800
705#define STRR_CLD 0x00000400
706#define STRR_CSQ 0x00000200
707#define STRR_RSQ 0x00000100
708#define STRR_ANE 0x00000080
709#define STRR_HDE 0x00000040
710#define STRR_CPEN 0x00000030
711#define STRR_LSE 0x00000008
712#define STRR_DREN 0x00000004
713#define STRR_LBK 0x00000002
714#define STRR_ECEN 0x00000001
715#define STRR_RESET 0xffffffff
716
717
718
719
720#define SIGR_RMI 0x40000000
721#define SIGR_GI1 0x20000000
722#define SIGR_GI0 0x10000000
723#define SIGR_CWE 0x08000000
724#define SIGR_RME 0x04000000
725#define SIGR_GEI1 0x02000000
726#define SIGR_GEI0 0x01000000
727#define SIGR_LGS3 0x00800000
728#define SIGR_LGS2 0x00400000
729#define SIGR_LGS1 0x00200000
730#define SIGR_LGS0 0x00100000
731#define SIGR_MD 0x000f0000
732#define SIGR_LV2 0x00008000
733#define SIGR_LE2 0x00004000
734#define SIGR_FRL 0x00002000
735#define SIGR_DPST 0x00001000
736#define SIGR_LSD 0x00000800
737#define SIGR_FLF 0x00000400
738#define SIGR_FUSQ 0x00000200
739#define SIGR_TSCK 0x00000100
740#define SIGR_LV1 0x00000080
741#define SIGR_LE1 0x00000040
742#define SIGR_RWR 0x00000020
743#define SIGR_RWD 0x00000010
744#define SIGR_ABM 0x00000008
745#define SIGR_JCK 0x00000004
746#define SIGR_HUJ 0x00000002
747#define SIGR_JBD 0x00000001
748#define SIGR_RESET 0xffff0000
749
750
751
752
753#define R_OWN 0x80000000
754#define RD_FF 0x40000000
755#define RD_FL 0x3fff0000
756#define RD_ES 0x00008000
757#define RD_LE 0x00004000
758#define RD_DT 0x00003000
759#define RD_RF 0x00000800
760#define RD_MF 0x00000400
761#define RD_FS 0x00000200
762#define RD_LS 0x00000100
763#define RD_TL 0x00000080
764#define RD_CS 0x00000040
765#define RD_FT 0x00000020
766#define RD_RJ 0x00000010
767#define RD_RE 0x00000008
768#define RD_DB 0x00000004
769#define RD_CE 0x00000002
770#define RD_OF 0x00000001
771
772#define RD_RER 0x02000000
773#define RD_RCH 0x01000000
774#define RD_RBS2 0x003ff800
775#define RD_RBS1 0x000007ff
776
777
778
779
780#define T_OWN 0x80000000
781#define TD_ES 0x00008000
782#define TD_TO 0x00004000
783#define TD_LO 0x00000800
784#define TD_NC 0x00000400
785#define TD_LC 0x00000200
786#define TD_EC 0x00000100
787#define TD_HF 0x00000080
788#define TD_CC 0x00000078
789#define TD_LF 0x00000004
790#define TD_UF 0x00000002
791#define TD_DE 0x00000001
792
793#define TD_IC 0x80000000
794#define TD_LS 0x40000000
795#define TD_FS 0x20000000
796#define TD_FT1 0x10000000
797#define TD_SET 0x08000000
798#define TD_AC 0x04000000
799#define TD_TER 0x02000000
800#define TD_TCH 0x01000000
801#define TD_DPD 0x00800000
802#define TD_FT0 0x00400000
803#define TD_TBS2 0x003ff800
804#define TD_TBS1 0x000007ff
805
806#define PERFECT_F 0x00000000
807#define HASH_F TD_FT0
808#define INVERSE_F TD_FT1
809#define HASH_O_F (TD_FT1 | TD_F0)
810
811
812
813
814
815#define TP 0x0040
816#define TP_NW 0x0002
817#define BNC 0x0004
818#define AUI 0x0008
819#define BNC_AUI 0x0010
820#define _10Mb 0x0040
821#define _100Mb 0x0080
822#define AUTO 0x4000
823
824
825
826
827#define NC 0x0000
828#define ANS 0x0020
829#define SPD_DET 0x0100
830#define INIT 0x0200
831#define EXT_SIA 0x0400
832#define ANS_SUSPECT 0x0802
833#define TP_SUSPECT 0x0803
834#define BNC_AUI_SUSPECT 0x0804
835#define EXT_SIA_SUSPECT 0x0805
836#define BNC_SUSPECT 0x0806
837#define AUI_SUSPECT 0x0807
838#define MII 0x1000
839
840#define TIMER_CB 0x80000000
841
842
843
844
845#define DEBUG_NONE 0x0000
846#define DEBUG_VERSION 0x0001
847#define DEBUG_MEDIA 0x0002
848#define DEBUG_TX 0x0004
849#define DEBUG_RX 0x0008
850#define DEBUG_SROM 0x0010
851#define DEBUG_MII 0x0020
852#define DEBUG_OPEN 0x0040
853#define DEBUG_CLOSE 0x0080
854#define DEBUG_PCICFG 0x0100
855#define DEBUG_ALL 0x01ff
856
857
858
859
860#define PCI 0
861#define EISA 1
862
863#define DE4X5_HASH_TABLE_LEN 512
864#define DE4X5_HASH_BITS 0x01ff
865
866#define SETUP_FRAME_LEN 192
867#define IMPERF_PA_OFFSET 156
868
869#define POLL_DEMAND 1
870
871#define LOST_MEDIA_THRESHOLD 3
872
873#define MASK_INTERRUPTS 1
874#define UNMASK_INTERRUPTS 0
875
876#define DE4X5_STRLEN 8
877
878#define DE4X5_INIT 0
879#define DE4X5_RUN 1
880
881#define DE4X5_SAVE_STATE 0
882#define DE4X5_RESTORE_STATE 1
883
884
885
886
887#define PERFECT 0
888#define HASH_PERF 1
889#define PERFECT_REJ 2
890#define ALL_HASH 3
891
892#define ALL 0
893#define PHYS_ADDR_ONLY 1
894
895
896
897
898#define INITIALISED 0
899#define CLOSED 1
900#define OPEN 2
901
902
903
904
905#define PDET_LINK_WAIT 1200
906#define ANS_FINISH_WAIT 1000
907
908
909
910
911
912
913#define NATIONAL_TX 0x2000
914#define BROADCOM_T4 0x03e0
915#define SEEQ_T4 0x0016
916#define CYPRESS_T4 0x0014
917
918
919
920
921#define SET_10Mb {\
922 if ((lp->phy[lp->active].id) && (!lp->useSROM || lp->useMII)) {\
923 omr = inl(DE4X5_OMR) & ~(OMR_TTM | OMR_PCS | OMR_SCR | OMR_FDX);\
924 if ((lp->tmp != MII_SR_ASSC) || (lp->autosense != AUTO)) {\
925 mii_wr(MII_CR_10|(lp->fdx?MII_CR_FDM:0), MII_CR, lp->phy[lp->active].addr, DE4X5_MII);\
926 }\
927 omr |= ((lp->fdx ? OMR_FDX : 0) | OMR_TTM);\
928 outl(omr, DE4X5_OMR);\
929 if (!lp->useSROM) lp->cache.gep = 0;\
930 } else if (lp->useSROM && !lp->useMII) {\
931 omr = (inl(DE4X5_OMR) & ~(OMR_PS | OMR_HBD | OMR_TTM | OMR_PCS | OMR_SCR | OMR_FDX));\
932 omr |= (lp->fdx ? OMR_FDX : 0);\
933 outl(omr | (lp->infoblock_csr6 & ~(OMR_SCR | OMR_HBD)), DE4X5_OMR);\
934 } else {\
935 omr = (inl(DE4X5_OMR) & ~(OMR_PS | OMR_HBD | OMR_TTM | OMR_PCS | OMR_SCR | OMR_FDX));\
936 omr |= (lp->fdx ? OMR_FDX : 0);\
937 outl(omr | OMR_SDP | OMR_TTM, DE4X5_OMR);\
938 lp->cache.gep = (lp->fdx ? 0 : GEP_FDXD);\
939 gep_wr(lp->cache.gep, dev);\
940 }\
941}
942
943#define SET_100Mb {\
944 if ((lp->phy[lp->active].id) && (!lp->useSROM || lp->useMII)) {\
945 int fdx=0;\
946 if (lp->phy[lp->active].id == NATIONAL_TX) {\
947 mii_wr(mii_rd(0x18, lp->phy[lp->active].addr, DE4X5_MII) & ~0x2000,\
948 0x18, lp->phy[lp->active].addr, DE4X5_MII);\
949 }\
950 omr = inl(DE4X5_OMR) & ~(OMR_TTM | OMR_PCS | OMR_SCR | OMR_FDX);\
951 sr = mii_rd(MII_SR, lp->phy[lp->active].addr, DE4X5_MII);\
952 if (!(sr & MII_ANA_T4AM) && lp->fdx) fdx=1;\
953 if ((lp->tmp != MII_SR_ASSC) || (lp->autosense != AUTO)) {\
954 mii_wr(MII_CR_100|(fdx?MII_CR_FDM:0), MII_CR, lp->phy[lp->active].addr, DE4X5_MII);\
955 }\
956 if (fdx) omr |= OMR_FDX;\
957 outl(omr, DE4X5_OMR);\
958 if (!lp->useSROM) lp->cache.gep = 0;\
959 } else if (lp->useSROM && !lp->useMII) {\
960 omr = (inl(DE4X5_OMR) & ~(OMR_PS | OMR_HBD | OMR_TTM | OMR_PCS | OMR_SCR | OMR_FDX));\
961 omr |= (lp->fdx ? OMR_FDX : 0);\
962 outl(omr | lp->infoblock_csr6, DE4X5_OMR);\
963 } else {\
964 omr = (inl(DE4X5_OMR) & ~(OMR_PS | OMR_HBD | OMR_TTM | OMR_PCS | OMR_SCR | OMR_FDX));\
965 omr |= (lp->fdx ? OMR_FDX : 0);\
966 outl(omr | OMR_SDP | OMR_PS | OMR_HBD | OMR_PCS | OMR_SCR, DE4X5_OMR);\
967 lp->cache.gep = (lp->fdx ? 0 : GEP_FDXD) | GEP_MODE;\
968 gep_wr(lp->cache.gep, dev);\
969 }\
970}
971
972
973#define SET_100Mb_PDET {\
974 if ((lp->phy[lp->active].id) && (!lp->useSROM || lp->useMII)) {\
975 mii_wr(MII_CR_100|MII_CR_ASSE, MII_CR, lp->phy[lp->active].addr, DE4X5_MII);\
976 omr = (inl(DE4X5_OMR) & ~(OMR_TTM | OMR_PCS | OMR_SCR | OMR_FDX));\
977 outl(omr, DE4X5_OMR);\
978 } else if (lp->useSROM && !lp->useMII) {\
979 omr = (inl(DE4X5_OMR) & ~(OMR_TTM | OMR_PCS | OMR_SCR | OMR_FDX));\
980 outl(omr, DE4X5_OMR);\
981 } else {\
982 omr = (inl(DE4X5_OMR) & ~(OMR_PS | OMR_HBD | OMR_TTM | OMR_PCS | OMR_SCR | OMR_FDX));\
983 outl(omr | OMR_SDP | OMR_PS | OMR_HBD | OMR_PCS, DE4X5_OMR);\
984 lp->cache.gep = (GEP_FDXD | GEP_MODE);\
985 gep_wr(lp->cache.gep, dev);\
986 }\
987}
988
989
990
991
992#include <linux/sockios.h>
993
994struct de4x5_ioctl {
995 unsigned short cmd;
996 unsigned short len;
997 unsigned char __user *data;
998};
999
1000
1001
1002
1003#define DE4X5_GET_HWADDR 0x01
1004#define DE4X5_SET_HWADDR 0x02
1005
1006#define DE4X5_SAY_BOO 0x05
1007#define DE4X5_GET_MCA 0x06
1008#define DE4X5_SET_MCA 0x07
1009#define DE4X5_CLR_MCA 0x08
1010#define DE4X5_MCA_EN 0x09
1011#define DE4X5_GET_STATS 0x0a
1012#define DE4X5_CLR_STATS 0x0b
1013#define DE4X5_GET_OMR 0x0c
1014#define DE4X5_SET_OMR 0x0d
1015#define DE4X5_GET_REG 0x0e
1016
1017#define MOTO_SROM_BUG (lp->active == 8 && (get_unaligned_le32(dev->dev_addr) & 0x00ffffff) == 0x3e0008)
1018