1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 #define EWRK3_CSR iobase+0x00
19 #define EWRK3_CR iobase+0x01
20 #define EWRK3_ICR iobase+0x02
21 #define EWRK3_TSR iobase+0x03
22 #define EWRK3_RSVD1 iobase+0x04
23 #define EWRK3_RSVD2 iobase+0x05
24 #define EWRK3_FMQ iobase+0x06
25 #define EWRK3_FMQC iobase+0x07
26 #define EWRK3_RQ iobase+0x08
27 #define EWRK3_RQC iobase+0x09
28 #define EWRK3_TQ iobase+0x0a
29 #define EWRK3_TQC iobase+0x0b
30 #define EWRK3_TDQ iobase+0x0c
31 #define EWRK3_TDQC iobase+0x0d
32 #define EWRK3_PIR1 iobase+0x0e
33 #define EWRK3_PIR2 iobase+0x0f
34 #define EWRK3_DATA iobase+0x10
35 #define EWRK3_IOPR iobase+0x11
36 #define EWRK3_IOBR iobase+0x12
37 #define EWRK3_MPR iobase+0x13
38 #define EWRK3_MBR iobase+0x14
39 #define EWRK3_APROM iobase+0x15
40 #define EWRK3_EPROM1 iobase+0x16
41 #define EWRK3_EPROM2 iobase+0x17
42 #define EWRK3_PAR0 iobase+0x18
43 #define EWRK3_PAR1 iobase+0x19
44 #define EWRK3_PAR2 iobase+0x1a
45 #define EWRK3_PAR3 iobase+0x1b
46 #define EWRK3_PAR4 iobase+0x1c
47 #define EWRK3_PAR5 iobase+0x1d
48 #define EWRK3_CMR iobase+0x1e
49
50
51
52
53 #define PAGE0_FMQ 0x000
54 #define PAGE0_RQ 0x080
55 #define PAGE0_TQ 0x100
56 #define PAGE0_TDQ 0x180
57 #define PAGE0_HTE 0x200
58 #define PAGE0_RSVD 0x240
59 #define PAGE0_USRD 0x600
60
61
62
63
64 #define CSR_RA 0x80
65 #define CSR_PME 0x40
66 #define CSR_MCE 0x20
67 #define CSR_TNE 0x08
68 #define CSR_RNE 0x04
69 #define CSR_TXD 0x02
70 #define CSR_RXD 0x01
71
72
73
74
75 #define CR_APD 0x80
76 #define CR_PSEL 0x40
77 #define CR_LBCK 0x20
78 #define CR_FDUP 0x10
79 #define CR_FBUS 0x08
80 #define CR_EN_16 0x04
81 #define CR_LED 0x02
82
83
84
85
86 #define ICR_IE 0x80
87 #define ICR_IS 0x60
88 #define ICR_TNEM 0x08
89 #define ICR_RNEM 0x04
90 #define ICR_TXDM 0x02
91 #define ICR_RXDM 0x01
92
93
94
95
96 #define TSR_NCL 0x80
97 #define TSR_ID 0x40
98 #define TSR_LCL 0x20
99 #define TSR_ECL 0x10
100 #define TSR_RCNTR 0x0f
101
102
103
104
105 #define EEPROM_INIT 0xc0
106 #define EEPROM_WR_EN 0xc8
107 #define EEPROM_WR 0xd0
108 #define EEPROM_WR_DIS 0xd8
109 #define EEPROM_RD 0xe0
110
111
112
113
114 #define EISA_REGS_EN 0x20
115 #define EISA_IOB 0x1f
116
117
118
119
120 #define CMR_RA 0x80
121 #define CMR_WB 0x40
122 #define CMR_LINK 0x20
123 #define CMR_POLARITY 0x10
124 #define CMR_NO_EEPROM 0x0c
125 #define CMR_HS 0x08
126 #define CMR_PNP 0x04
127 #define CMR_DRAM 0x02
128 #define CMR_0WS 0x01
129
130
131
132
133
134 #define R_ROK 0x80
135 #define R_IAM 0x10
136 #define R_MCM 0x08
137 #define R_DBE 0x04
138 #define R_CRC 0x02
139 #define R_PLL 0x01
140
141
142
143
144
145 #define TCR_SQEE 0x40
146 #define TCR_SED 0x20
147 #define TCR_QMODE 0x10
148 #define TCR_LAB 0x08
149 #define TCR_PAD 0x04
150 #define TCR_IFC 0x02
151 #define TCR_ISA 0x01
152
153
154
155
156
157 #define T_VSTS 0x80
158 #define T_CTU 0x40
159 #define T_SQE 0x20
160 #define T_NCL 0x10
161 #define T_LCL 0x08
162 #define T_ID 0x04
163 #define T_COLL 0x03
164 #define T_XCOLL 0x03
165 #define T_MCOLL 0x02
166 #define T_OCOLL 0x01
167 #define T_NOCOLL 0x00
168 #define T_XUR 0x03
169 #define T_TXE 0x7f
170
171
172
173
174
175 #define EISA_ID iobase + 0x0c80
176 #define EISA_ID0 iobase + 0x0c80
177 #define EISA_ID1 iobase + 0x0c81
178 #define EISA_ID2 iobase + 0x0c82
179 #define EISA_ID3 iobase + 0x0c83
180 #define EISA_CR iobase + 0x0c84
181
182
183
184
185 #define EEPROM_MEMB 0x00
186 #define EEPROM_IOB 0x01
187 #define EEPROM_EISA_ID0 0x02
188 #define EEPROM_EISA_ID1 0x03
189 #define EEPROM_EISA_ID2 0x04
190 #define EEPROM_EISA_ID3 0x05
191 #define EEPROM_MISC0 0x06
192 #define EEPROM_MISC1 0x07
193 #define EEPROM_PNAME7 0x08
194 #define EEPROM_PNAME6 0x09
195 #define EEPROM_PNAME5 0x0a
196 #define EEPROM_PNAME4 0x0b
197 #define EEPROM_PNAME3 0x0c
198 #define EEPROM_PNAME2 0x0d
199 #define EEPROM_PNAME1 0x0e
200 #define EEPROM_PNAME0 0x0f
201 #define EEPROM_SWFLAGS 0x10
202 #define EEPROM_HWCAT 0x11
203 #define EEPROM_NETMAN2 0x12
204 #define EEPROM_REVLVL 0x13
205 #define EEPROM_NETMAN0 0x14
206 #define EEPROM_NETMAN1 0x15
207 #define EEPROM_CHIPVER 0x16
208 #define EEPROM_SETUP 0x17
209 #define EEPROM_PADDR0 0x18
210 #define EEPROM_PADDR1 0x19
211 #define EEPROM_PADDR2 0x1a
212 #define EEPROM_PADDR3 0x1b
213 #define EEPROM_PADDR4 0x1c
214 #define EEPROM_PADDR5 0x1d
215 #define EEPROM_PA_CRC 0x1e
216 #define EEPROM_CHKSUM 0x1f
217
218
219
220
221 #define EEPROM_MAX 32
222
223
224
225
226 #define RBE_SHADOW 0x0100
227 #define READ_AHEAD 0x0080
228 #define IRQ_SEL2 0x0070
229 #define IRQ_SEL 0x0060
230 #define FAST_BUS 0x0008
231 #define ENA_16 0x0004
232 #define WRITE_BEHIND 0x0002
233 #define _0WS_ENA 0x0001
234
235
236
237
238 #define NETMAN_POL 0x04
239 #define NETMAN_LINK 0x02
240 #define NETMAN_CCE 0x01
241
242
243
244
245 #define SW_SQE 0x10
246 #define SW_LAB 0x08
247 #define SW_INIT 0x04
248 #define SW_TIMEOUT 0x02
249 #define SW_REMOTE 0x01
250
251
252
253
254 #define SETUP_APD 0x80
255 #define SETUP_PS 0x40
256 #define SETUP_MP 0x20
257 #define SETUP_1TP 0x10
258 #define SETUP_1COAX 0x00
259 #define SETUP_DRAM 0x02
260
261
262
263
264 #define MGMT_CCE 0x01
265
266
267
268
269 #define LeMAC 0x11
270 #define LeMAC2 0x12
271
272
273
274
275
276 #define EEPROM_WAIT_TIME 1000
277 #define EISA_EN 0x0001
278
279 #define HASH_TABLE_LEN 512
280
281 #define XCT 0x80
282 #define PRELOAD 16
283
284 #define MASK_INTERRUPTS 1
285 #define UNMASK_INTERRUPTS 0
286
287 #define EEPROM_OFFSET(a) ((u_short)((u_long)(a)))
288
289
290
291
292 #include <linux/sockios.h>
293
294 #define EWRK3IOCTL SIOCDEVPRIVATE
295
296 struct ewrk3_ioctl {
297 unsigned short cmd;
298 unsigned short len;
299 unsigned char *data;
300 };
301
302
303
304
305 #define EWRK3_GET_HWADDR 0x01
306 #define EWRK3_SET_HWADDR 0x02
307 #define EWRK3_SET_PROM 0x03
308 #define EWRK3_CLR_PROM 0x04
309 #define EWRK3_SAY_BOO 0x05
310 #define EWRK3_GET_MCA 0x06
311 #define EWRK3_SET_MCA 0x07
312 #define EWRK3_CLR_MCA 0x08
313 #define EWRK3_MCA_EN 0x09
314 #define EWRK3_GET_STATS 0x0a
315 #define EWRK3_CLR_STATS 0x0b
316 #define EWRK3_GET_CSR 0x0c
317 #define EWRK3_SET_CSR 0x0d
318 #define EWRK3_GET_EEPROM 0x0e
319 #define EWRK3_SET_EEPROM 0x0f
320 #define EWRK3_GET_CMR 0x10
321 #define EWRK3_CLR_TX_CUT_THRU 0x11
322 #define EWRK3_SET_TX_CUT_THRU 0x12