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 RA 0x80
65 #define PME 0x40
66 #define MCE 0x20
67 #define TNE 0x08
68 #define RNE 0x04
69 #define TXD 0x02
70 #define RXD 0x01
71
72
73
74
75 #define APD 0x80
76 #define PSEL 0x40
77 #define LBCK 0x20
78 #define FDUP 0x10
79 #define FBUS 0x08
80 #define EN_16 0x04
81 #define LED 0x02
82
83
84
85
86 #define IE 0x80
87 #define IS 0x60
88 #define TNEM 0x08
89 #define RNEM 0x04
90 #define TXDM 0x02
91 #define RXDM 0x01
92
93
94
95
96 #define NCL 0x80
97 #define ID 0x40
98 #define LCL 0x20
99 #define ECL 0x10
100 #define 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 0x20
115 #define IOB 0x1f
116
117
118
119
120 #define RA 0x80
121 #define WB 0x40
122 #define LINK 0x20
123 #define POLARITY 0x10
124 #define NO_EEPROM 0x0c
125 #define HS 0x08
126 #define PNP 0x04
127 #define DRAM 0x02
128 #define _0WS 0x01
129
130
131
132
133
134 #define ROK 0x80
135 #define IAM 0x10
136 #define MCM 0x08
137 #define DBE 0x04
138 #define CRC 0x02
139 #define PLL 0x01
140
141
142
143
144
145 #define SQEE 0x40
146 #define SED 0x20
147 #define QMODE 0x10
148 #define LAB 0x08
149 #define PAD 0x04
150 #define IFC 0x02
151 #define ISA 0x01
152
153
154
155
156
157 #define VSTS 0x80
158 #define MAC_CTU 0x40
159 #define MAC_SQE 0x20
160 #define MAC_NCL 0x10
161 #define MAC_LCL 0x08
162 #define MAC_ID 0x04
163 #define MAC_COLL 0x03
164 #define MAC_XCOLL 0x03
165 #define MAC_MCOLL 0x02
166 #define MAC_OCOLL 0x01
167 #define MAC_NOCOLL 0x00
168 #define MAC_XUR 0x03
169 #define MAC_TXE 0x7f
170
171
172
173
174
175 #define EISA_ID0 iobase + 0x0c80
176 #define EISA_ID1 iobase + 0x0c81
177 #define EISA_ID2 iobase + 0x0c82
178 #define EISA_ID3 iobase + 0x0c83
179 #define EISA_CR iobase + 0x0c84
180
181
182
183
184 #define EEPROM_MEMB 0x00
185 #define EEPROM_IOB 0x01
186 #define EEPROM_EISA_ID0 0x02
187 #define EEPROM_EISA_ID1 0x03
188 #define EEPROM_EISA_ID2 0x04
189 #define EEPROM_EISA_ID3 0x05
190 #define EEPROM_MISC0 0x06
191 #define EEPROM_MISC1 0x07
192 #define EEPROM_PNAME7 0x08
193 #define EEPROM_PNAME6 0x09
194 #define EEPROM_PNAME5 0x0a
195 #define EEPROM_PNAME4 0x0b
196 #define EEPROM_PNAME3 0x0c
197 #define EEPROM_PNAME2 0x0d
198 #define EEPROM_PNAME1 0x0e
199 #define EEPROM_PNAME0 0x0f
200 #define EEPROM_SWFLAGS 0x10
201 #define EEPROM_HWCAT 0x11
202 #define EEPROM_NETMAN2 0x12
203 #define EEPROM_REVLVL 0x13
204 #define EEPROM_NETMAN0 0x14
205 #define EEPROM_NETMAN1 0x15
206 #define EEPROM_CHIPVER 0x16
207 #define EEPROM_SETUP 0x17
208 #define EEPROM_PADDR0 0x18
209 #define EEPROM_PADDR1 0x19
210 #define EEPROM_PADDR2 0x1a
211 #define EEPROM_PADDR3 0x1b
212 #define EEPROM_PADDR4 0x1c
213 #define EEPROM_PADDR5 0x1d
214 #define EEPROM_PA_CRC 0x1e
215 #define EEPROM_CHKSUM 0x1f
216
217
218
219
220 #define EEPROM_MAX 32
221
222
223
224
225 #define RBE_SHADOW 0x0100
226 #define READ_AHEAD 0x0080
227 #define IRQ_SEL2 0x0070
228 #define IRQ_SEL 0x0060
229 #define FAST_BUS 0x0008
230 #define ENA_16 0x0004
231 #define WRITE_BEHIND 0x0002
232 #define _0WS_ENA 0x0001
233
234
235
236
237 #define NETMAN_POL 0x04
238 #define NETMAN_LINK 0x02
239 #define NETMAN_CCE 0x01
240
241
242
243
244 #define SW_SQE 0x10
245 #define SW_LAB 0x08
246 #define SW_INIT 0x04
247 #define SW_TIMEOUT 0x02
248 #define SW_REMOTE 0x01
249
250
251
252
253 #define SETUP_APD 0x80
254 #define SETUP_PS 0x40
255 #define SETUP_MP 0x20
256 #define SETUP_1TP 0x10
257 #define SETUP_1COAX 0x00
258 #define SETUP_DRAM 0x02
259
260
261
262
263 #define MGMT_CCE 0x01
264
265
266
267
268 #define LeMAC 0x11
269 #define LeMAC2 0x12
270
271
272
273
274
275 #define EEPROM_WAIT_TIME 1000
276 #define EISA_EN 0x0001
277
278 #define HASH_TABLE_LEN 512
279
280 #define XCT 0x80
281 #define PRELOAD 16
282
283 #define MASK_INTERRUPTS 1
284 #define UNMASK_INTERRUPTS 0
285
286
287
288
289 #include <linux/sockios.h>
290
291 #define EWRK3IOCTL SIOCDEVPRIVATE
292
293 struct ewrk3_ioctl {
294 unsigned short cmd;
295 unsigned short len;
296 unsigned char *data;
297 };
298
299
300
301
302 #define EWRK3_GET_HWADDR 0x01
303 #define EWRK3_SET_HWADDR 0x02
304 #define EWRK3_SET_PROM 0x03
305 #define EWRK3_CLR_PROM 0x04
306 #define EWRK3_SAY_BOO 0x05
307 #define EWRK3_GET_MCA 0x06
308 #define EWRK3_SET_MCA 0x07
309 #define EWRK3_CLR_MCA 0x08
310 #define EWRK3_MCA_EN 0x09
311 #define EWRK3_GET_STATS 0x0a
312 #define EWRK3_CLR_STATS 0x0b
313 #define EWRK3_GET_CSR 0x0c
314 #define EWRK3_SET_CSR 0x0d
315 #define EWRK3_GET_EEPROM 0x0e
316 #define EWRK3_SET_EEPROM 0x0f
317 #define EWRK3_GET_CMR 0x10
318 #define EWRK3_CLR_TX_CUT_THRU 0x11
319 #define EWRK3_SET_TX_CUT_THRU 0x12