1 #if defined(CONFIG_WAVELAN)
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27 #define I82586_MEMZ (64 * 1024)
28
29 #define I82586_SCP_ADDR (I82586_MEMZ - sizeof(scp_t))
30
31 #define ADDR_LEN 6
32 #define I82586NULL 0xFFFF
33
34 #define toff(t,p,f) (unsigned short)((void *)(&((t *)((void *)0 + (p)))->f) - (void *)0)
35
36
37
38
39 typedef struct scp_t scp_t;
40 struct scp_t
41 {
42 unsigned short scp_sysbus;
43 #define SCP_SY_16BBUS (0x0 << 0)
44 #define SCP_SY_8BBUS (0x1 << 0)
45 unsigned short scp_junk[2];
46 unsigned short scp_iscpl;
47 unsigned short scp_iscph;
48 };
49
50
51
52
53 typedef struct iscp_t iscp_t;
54 struct iscp_t
55 {
56 unsigned short iscp_busy;
57
58 unsigned short iscp_offset;
59 unsigned short iscp_basel;
60 unsigned short iscp_baseh;
61 };
62
63
64
65
66
67
68
69
70 typedef struct scb_t scb_t;
71 struct scb_t
72 {
73 unsigned short scb_status;
74 #define SCB_ST_INT (0xF << 12)
75 #define SCB_ST_CX (0x1 << 15)
76 #define SCB_ST_FR (0x1 << 14)
77 #define SCB_ST_CNA (0x1 << 13)
78 #define SCB_ST_RNR (0x1 << 12)
79 #define SCB_ST_JUNK0 (0x1 << 11)
80 #define SCB_ST_CUS (0x7 << 8)
81 #define SCB_ST_CUS_IDLE (0 << 8)
82 #define SCB_ST_CUS_SUSP (1 << 8)
83 #define SCB_ST_CUS_ACTV (2 << 8)
84 #define SCB_ST_JUNK1 (0x1 << 7)
85 #define SCB_ST_RUS (0x7 << 4)
86 #define SCB_ST_RUS_IDLE (0 << 4)
87 #define SCB_ST_RUS_SUSP (1 << 4)
88 #define SCB_ST_RUS_NRES (2 << 4)
89 #define SCB_ST_RUS_RDY (4 << 4)
90 unsigned short scb_command;
91 #define SCB_CMD_ACK_CX (0x1 << 15)
92 #define SCB_CMD_ACK_FR (0x1 << 14)
93 #define SCB_CMD_ACK_CNA (0x1 << 13)
94 #define SCB_CMD_ACK_RNR (0x1 << 12)
95 #define SCB_CMD_JUNKX (0x1 << 11)
96 #define SCB_CMD_CUC (0x7 << 8)
97 #define SCB_CMD_CUC_NOP (0 << 8)
98 #define SCB_CMD_CUC_GO (1 << 8)
99 #define SCB_CMD_CUC_RES (2 << 8)
100 #define SCB_CMD_CUC_SUS (3 << 8)
101 #define SCB_CMD_CUC_ABT (4 << 8)
102 #define SCB_CMD_RESET (0x1 << 7)
103 #define SCB_CMD_RUC (0x7 << 4)
104 #define SCB_CMD_RUC_NOP (0 << 4)
105 #define SCB_CMD_RUC_GO (1 << 4)
106 #define SCB_CMD_RUC_RES (2 << 4)
107 #define SCB_CMD_RUC_SUS (3 << 4)
108 #define SCB_CMD_RUC_ABT (4 << 4)
109 unsigned short scb_cbl_offset;
110
111 unsigned short scb_rfa_offset;
112
113
114 unsigned short scb_crcerrs;
115
116 unsigned short scb_alnerrs;
117
118 unsigned short scb_rscerrs;
119 unsigned short scb_ovrnerrs;
120 };
121
122 #define scboff(p,f) toff(scb_t, p, f)
123
124
125
126
127 typedef enum acmd_e acmd_e;
128 enum acmd_e
129 {
130 acmd_nop = 0,
131 acmd_ia_setup = 1,
132
133 acmd_configure = 2,
134 acmd_mc_setup = 3,
135
136 acmd_transmit = 4,
137 acmd_tdr = 5,
138
139 acmd_dump = 6,
140 acmd_diagnose = 7,
141 };
142
143
144
145
146 typedef struct ach_t ach_t;
147 struct ach_t
148 {
149 unsigned short ac_status;
150 #define AC_SFLD_C (0x1 << 15)
151 #define AC_SFLD_B (0x1 << 14)
152 #define AC_SFLD_OK (0x1 << 13)
153 #define AC_SFLD_A (0x1 << 12)
154 #define AC_SFLD_FAIL (0x1 << 11)
155 #define AC_SFLD_S10 (0x1 << 10)
156
157 #define AC_SFLD_S9 (0x1 << 9)
158
159 #define AC_SFLD_S8 (0x1 << 8)
160
161 #define AC_SFLD_S7 (0x1 << 7)
162
163 #define AC_SFLD_S6 (0x1 << 6)
164
165 #define AC_SFLD_S5 (0x1 << 5)
166
167 #define AC_SFLD_MAXCOL (0xF << 0)
168 unsigned short ac_command;
169 #define AC_CFLD_EL (0x1 << 15)
170 #define AC_CFLD_S (0x1 << 14)
171 #define AC_CFLD_I (0x1 << 13)
172 #define AC_CFLD_CMD (0x7 << 0)
173 unsigned short ac_link;
174 };
175
176 #define acoff(p,f) toff(ach_t, p, f)
177
178
179
180
181 typedef struct ac_nop_t ac_nop_t;
182 struct ac_nop_t
183 {
184 ach_t nop_h;
185 };
186
187
188
189
190 typedef struct ac_ias_t ac_ias_t;
191 struct ac_ias_t
192 {
193 ach_t ias_h;
194 unsigned char ias_addr[ADDR_LEN];
195 };
196
197
198
199
200 typedef struct ac_cfg_t ac_cfg_t;
201 struct ac_cfg_t
202 {
203 ach_t cfg_h;
204 unsigned char cfg_byte_cnt;
205 #define AC_CFG_BYTE_CNT(v) (((v) & 0xF) << 0)
206 unsigned char cfg_fifolim;
207 #define AC_CFG_FIFOLIM(v) (((v) & 0xF) << 0)
208 unsigned char cfg_byte8;
209 #define AC_CFG_SAV_BF(v) (((v) & 0x1) << 7)
210 #define AC_CFG_SRDY(v) (((v) & 0x1) << 6)
211
212 unsigned char cfg_byte9;
213 #define AC_CFG_ELPBCK(v) (((v) & 0x1) << 7)
214 #define AC_CFG_ILPBCK(v) (((v) & 0x1) << 6)
215 #define AC_CFG_PRELEN(v) (((v) & 0x3) << 4)
216 #define AC_CFG_PLEN_2 0
217 #define AC_CFG_PLEN_4 1
218 #define AC_CFG_PLEN_8 2
219 #define AC_CFG_PLEN_16 3
220 #define AC_CFG_ALOC(v) (((v) & 0x1) << 3)
221
222 #define AC_CFG_ADDRLEN(v) (((v) & 0x7) << 0)
223 unsigned char cfg_byte10;
224 #define AC_CFG_BOFMET(v) (((v) & 0x1) << 7)
225
226 #define AC_CFG_ACR(v) (((v) & 0x7) << 4)
227 #define AC_CFG_LINPRIO(v) (((v) & 0x7) << 0)
228 unsigned char cfg_ifs;
229 unsigned char cfg_slotl;
230 unsigned char cfg_byte13;
231 #define AC_CFG_RETRYNUM(v) (((v) & 0xF) << 4)
232 #define AC_CFG_SLTTMHI(v) (((v) & 0x7) << 0)
233 unsigned char cfg_byte14;
234 #define AC_CFG_FLGPAD(v) (((v) & 0x1) << 7)
235 #define AC_CFG_BTSTF(v) (((v) & 0x1) << 6)
236 #define AC_CFG_CRC16(v) (((v) & 0x1) << 5)
237 #define AC_CFG_NCRC(v) (((v) & 0x1) << 4)
238 #define AC_CFG_TNCRS(v) (((v) & 0x1) << 3)
239 #define AC_CFG_MANCH(v) (((v) & 0x1) << 2)
240 #define AC_CFG_BCDIS(v) (((v) & 0x1) << 1)
241 #define AC_CFG_PRM(v) (((v) & 0x1) << 0)
242 unsigned char cfg_byte15;
243 #define AC_CFG_ICDS(v) (((v) & 0x1) << 7)
244
245 #define AC_CFG_CDTF(v) (((v) & 0x7) << 4)
246
247 #define AC_CFG_ICSS(v) (((v) & 0x1) << 3)
248
249 #define AC_CFG_CSTF(v) (((v) & 0x7) << 0)
250
251 unsigned short cfg_min_frm_len;
252 #define AC_CFG_MNFRM(v) (((v) & 0xFF) << 0)
253 };
254
255
256
257
258 typedef struct ac_mcs_t ac_mcs_t;
259 struct ac_mcs_t
260 {
261 ach_t mcs_h;
262 unsigned short mcs_cnt;
263 unsigned short mcs_data[3];
264 };
265
266
267
268
269 typedef struct ac_tx_t ac_tx_t;
270 struct ac_tx_t
271 {
272 ach_t tx_h;
273 unsigned short tx_tbd_offset;
274 #if 0
275 Linux packets are passed down with the destination MAC address
276 and length/type field already prepended to the data,
277 so we do not need to insert it. Consistent with this
278 we must also set the AC_CFG_ALOC(..) flag during the
279 ac_cfg_t action command.
280 unsigned char tx_addr[ADDR_LEN];
281 unsigned short tx_length;
282 #endif
283 };
284
285
286
287
288 typedef struct ac_tdr_t ac_tdr_t;
289 struct ac_tdr_t
290 {
291 ach_t tdr_h;
292 unsigned short tdr_result;
293 #define AC_TDR_LNK_OK (0x1 << 15)
294 #define AC_TDR_XCVR_PRB (0x1 << 14)
295 #define AC_TDR_ET_OPN (0x1 << 13)
296 #define AC_TDR_ET_SRT (0x1 << 12)
297 #define AC_TDR_TIME (0x7FF << 0)
298
299
300 };
301
302
303
304
305 typedef struct ac_dmp_t ac_dmp_t;
306 struct ac_dmp_t
307 {
308 ach_t dmp_h;
309 unsigned short dmp_offset;
310 };
311
312
313
314
315 #define DUMPBYTES 170
316
317
318
319
320 typedef struct ac_dgn_t ac_dgn_t;
321 struct ac_dgn_t
322 {
323 ach_t dgn_h;
324 };
325
326
327
328
329 typedef struct tbd_t tbd_t;
330 struct tbd_t
331 {
332 unsigned short tbd_status;
333 #define TBD_STATUS_EOF (0x1 << 15)
334
335 #define TBD_STATUS_ACNT (0x3FFF << 0)
336
337 unsigned short tbd_next_bd_offset;
338 unsigned short tbd_bufl;
339 unsigned short tbd_bufh;
340 };
341
342
343
344
345 typedef struct rbd_t rbd_t;
346 struct rbd_t
347 {
348 unsigned short rbd_status;
349 #define RBD_STATUS_EOF (0x1 << 15)
350
351 #define RBD_STATUS_F (0x1 << 14)
352 #define RBD_STATUS_ACNT (0x3FFF << 0)
353
354 unsigned short rbd_next_rbd_offset;
355 unsigned short rbd_bufl;
356 unsigned short rbd_bufh;
357 unsigned short rbd_el_size;
358 #define RBD_EL (0x1 << 15)
359
360 #define RBD_SIZE (0x3FFF << 0)
361
362 };
363
364 #define rbdoff(p,f) toff(rbd_t, p, f)
365
366
367
368
369 typedef struct fd_t fd_t;
370 struct fd_t
371 {
372 unsigned short fd_status;
373 #define FD_STATUS_C (0x1 << 15)
374 #define FD_STATUS_B (0x1 << 14)
375 #define FD_STATUS_OK (0x1 << 13)
376 #define FD_STATUS_S11 (0x1 << 11)
377 #define FD_STATUS_S10 (0x1 << 10)
378 #define FD_STATUS_S9 (0x1 << 9)
379 #define FD_STATUS_S8 (0x1 << 8)
380 #define FD_STATUS_S7 (0x1 << 7)
381 #define FD_STATUS_S6 (0x1 << 6)
382 unsigned short fd_command;
383 #define FD_COMMAND_EL (0x1 << 15)
384 #define FD_COMMAND_S (0x1 << 14)
385 unsigned short fd_link_offset;
386 unsigned short fd_rbd_offset;
387
388
389 #if 0
390 I think the rest is unused since we
391 have set AC_CFG_ALOC(..). However, just
392 in case, we leave the space.
393 #endif
394 unsigned char fd_dest[ADDR_LEN];
395
396 unsigned char fd_src[ADDR_LEN];
397
398 unsigned short fd_length;
399
400 };
401
402 #define fdoff(p,f) toff(fd_t, p, f)
403
404
405
406
407
408
409
410 #endif