diff options
author | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-16 18:20:36 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-16 18:20:36 -0400 |
commit | 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch) | |
tree | 0bba044c4ce775e45a88a51686b5d9f90697ea9d /drivers/net/skfp/h |
Linux-2.6.12-rc2v2.6.12-rc2
Initial git repository build. I'm not bothering with the full history,
even though we have it. We can create a separate "historical" git
archive of that later if we want to, and in the meantime it's about
3.2GB when imported into git - space that would just make the early
git days unnecessarily complicated, when we don't have a lot of good
infrastructure for it.
Let it rip!
Diffstat (limited to 'drivers/net/skfp/h')
-rw-r--r-- | drivers/net/skfp/h/cmtdef.h | 763 | ||||
-rw-r--r-- | drivers/net/skfp/h/fddi.h | 69 | ||||
-rw-r--r-- | drivers/net/skfp/h/fddimib.h | 349 | ||||
-rw-r--r-- | drivers/net/skfp/h/fplustm.h | 274 | ||||
-rw-r--r-- | drivers/net/skfp/h/hwmtm.h | 424 | ||||
-rw-r--r-- | drivers/net/skfp/h/lnkstat.h | 84 | ||||
-rw-r--r-- | drivers/net/skfp/h/mbuf.h | 54 | ||||
-rw-r--r-- | drivers/net/skfp/h/osdef1st.h | 123 | ||||
-rw-r--r-- | drivers/net/skfp/h/sba.h | 142 | ||||
-rw-r--r-- | drivers/net/skfp/h/sba_def.h | 76 | ||||
-rw-r--r-- | drivers/net/skfp/h/skfbi.h | 1919 | ||||
-rw-r--r-- | drivers/net/skfp/h/skfbiinc.h | 123 | ||||
-rw-r--r-- | drivers/net/skfp/h/smc.h | 471 | ||||
-rw-r--r-- | drivers/net/skfp/h/smt.h | 882 | ||||
-rw-r--r-- | drivers/net/skfp/h/smt_p.h | 326 | ||||
-rw-r--r-- | drivers/net/skfp/h/smtstate.h | 106 | ||||
-rw-r--r-- | drivers/net/skfp/h/supern_2.h | 1059 | ||||
-rw-r--r-- | drivers/net/skfp/h/targethw.h | 169 | ||||
-rw-r--r-- | drivers/net/skfp/h/targetos.h | 165 | ||||
-rw-r--r-- | drivers/net/skfp/h/types.h | 39 |
20 files changed, 7617 insertions, 0 deletions
diff --git a/drivers/net/skfp/h/cmtdef.h b/drivers/net/skfp/h/cmtdef.h new file mode 100644 index 000000000000..603982debc71 --- /dev/null +++ b/drivers/net/skfp/h/cmtdef.h | |||
@@ -0,0 +1,763 @@ | |||
1 | /****************************************************************************** | ||
2 | * | ||
3 | * (C)Copyright 1998,1999 SysKonnect, | ||
4 | * a business unit of Schneider & Koch & Co. Datensysteme GmbH. | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License as published by | ||
8 | * the Free Software Foundation; either version 2 of the License, or | ||
9 | * (at your option) any later version. | ||
10 | * | ||
11 | * The information in this file is provided "AS IS" without warranty. | ||
12 | * | ||
13 | ******************************************************************************/ | ||
14 | |||
15 | #ifndef _CMTDEF_ | ||
16 | #define _CMTDEF_ | ||
17 | |||
18 | /* **************************************************************** */ | ||
19 | |||
20 | /* | ||
21 | * implementation specific constants | ||
22 | * MODIIFY THE FOLLWOING THREE DEFINES | ||
23 | */ | ||
24 | #define AMDPLC /* if Amd PLC chip used */ | ||
25 | #ifdef CONC | ||
26 | #define NUMPHYS 12 /* 2 for SAS or DAS, more for Concentrator */ | ||
27 | #else | ||
28 | #ifdef CONC_II | ||
29 | #define NUMPHYS 24 /* 2 for SAS or DAS, more for Concentrator */ | ||
30 | #else | ||
31 | #define NUMPHYS 2 /* 2 for SAS or DAS, more for Concentrator */ | ||
32 | #endif | ||
33 | #endif | ||
34 | #define NUMMACS 1 /* only 1 supported at the moment */ | ||
35 | #define NUMPATHS 2 /* primary and secondary path supported */ | ||
36 | |||
37 | /* | ||
38 | * DO NOT MODIFY BEYOND THIS POINT | ||
39 | */ | ||
40 | |||
41 | /* **************************************************************** */ | ||
42 | |||
43 | #if NUMPHYS > 2 | ||
44 | #define CONCENTRATOR | ||
45 | #endif | ||
46 | |||
47 | /* | ||
48 | * Definitions for comfortable LINT usage | ||
49 | */ | ||
50 | #ifdef lint | ||
51 | #define LINT_USE(x) (x)=(x) | ||
52 | #else | ||
53 | #define LINT_USE(x) | ||
54 | #endif | ||
55 | |||
56 | #ifdef DEBUG | ||
57 | #define DB_PR(flag,a,b,c) { if (flag) printf(a,b,c) ; } | ||
58 | #else | ||
59 | #define DB_PR(flag,a,b,c) | ||
60 | #endif | ||
61 | |||
62 | #ifdef DEBUG_BRD | ||
63 | #define DB_ECM(a,b,c) DB_PR((smc->debug.d_smt&1),a,b,c) | ||
64 | #define DB_ECMN(n,a,b,c) DB_PR((smc->debug.d_ecm >=(n)),a,b,c) | ||
65 | #define DB_RMT(a,b,c) DB_PR((smc->debug.d_smt&2),a,b,c) | ||
66 | #define DB_RMTN(n,a,b,c) DB_PR((smc->debug.d_rmt >=(n)),a,b,c) | ||
67 | #define DB_CFM(a,b,c) DB_PR((smc->debug.d_smt&4),a,b,c) | ||
68 | #define DB_CFMN(n,a,b,c) DB_PR((smc->debug.d_cfm >=(n)),a,b,c) | ||
69 | #define DB_PCM(a,b,c) DB_PR((smc->debug.d_smt&8),a,b,c) | ||
70 | #define DB_PCMN(n,a,b,c) DB_PR((smc->debug.d_pcm >=(n)),a,b,c) | ||
71 | #define DB_SMT(a,b,c) DB_PR((smc->debug.d_smtf),a,b,c) | ||
72 | #define DB_SMTN(n,a,b,c) DB_PR((smc->debug.d_smtf >=(n)),a,b,c) | ||
73 | #define DB_SBA(a,b,c) DB_PR((smc->debug.d_sba),a,b,c) | ||
74 | #define DB_SBAN(n,a,b,c) DB_PR((smc->debug.d_sba >=(n)),a,b,c) | ||
75 | #define DB_ESS(a,b,c) DB_PR((smc->debug.d_ess),a,b,c) | ||
76 | #define DB_ESSN(n,a,b,c) DB_PR((smc->debug.d_ess >=(n)),a,b,c) | ||
77 | #else | ||
78 | #define DB_ECM(a,b,c) DB_PR((debug.d_smt&1),a,b,c) | ||
79 | #define DB_ECMN(n,a,b,c) DB_PR((debug.d_ecm >=(n)),a,b,c) | ||
80 | #define DB_RMT(a,b,c) DB_PR((debug.d_smt&2),a,b,c) | ||
81 | #define DB_RMTN(n,a,b,c) DB_PR((debug.d_rmt >=(n)),a,b,c) | ||
82 | #define DB_CFM(a,b,c) DB_PR((debug.d_smt&4),a,b,c) | ||
83 | #define DB_CFMN(n,a,b,c) DB_PR((debug.d_cfm >=(n)),a,b,c) | ||
84 | #define DB_PCM(a,b,c) DB_PR((debug.d_smt&8),a,b,c) | ||
85 | #define DB_PCMN(n,a,b,c) DB_PR((debug.d_pcm >=(n)),a,b,c) | ||
86 | #define DB_SMT(a,b,c) DB_PR((debug.d_smtf),a,b,c) | ||
87 | #define DB_SMTN(n,a,b,c) DB_PR((debug.d_smtf >=(n)),a,b,c) | ||
88 | #define DB_SBA(a,b,c) DB_PR((debug.d_sba),a,b,c) | ||
89 | #define DB_SBAN(n,a,b,c) DB_PR((debug.d_sba >=(n)),a,b,c) | ||
90 | #define DB_ESS(a,b,c) DB_PR((debug.d_ess),a,b,c) | ||
91 | #define DB_ESSN(n,a,b,c) DB_PR((debug.d_ess >=(n)),a,b,c) | ||
92 | #endif | ||
93 | |||
94 | #ifndef SS_NOT_DS | ||
95 | #define SK_LOC_DECL(type,var) type var | ||
96 | #else | ||
97 | #define SK_LOC_DECL(type,var) static type var | ||
98 | #endif | ||
99 | /* | ||
100 | * PHYs and PORTS | ||
101 | * Note: Don't touch the definition of PA and PB. Those might be used | ||
102 | * by some "for" loops. | ||
103 | */ | ||
104 | #define PA 0 | ||
105 | #define PB 1 | ||
106 | #if defined(SUPERNET_3) || defined(CONC_II) | ||
107 | /* | ||
108 | * The port indices have to be different, | ||
109 | * because the MAC output goes through the 2. PLC | ||
110 | * Conc II: It has to be the first port in the row. | ||
111 | */ | ||
112 | #define PS 0 /* Internal PLC which is the same as PA */ | ||
113 | #else | ||
114 | #define PS 1 | ||
115 | #endif | ||
116 | #define PM 2 /* PM .. PA+NUM_PHYS-1 */ | ||
117 | |||
118 | /* | ||
119 | * PHY types - as in path descriptor 'fddiPHYType' | ||
120 | */ | ||
121 | #define TA 0 /* A port */ | ||
122 | #define TB 1 /* B port */ | ||
123 | #define TS 2 /* S port */ | ||
124 | #define TM 3 /* M port */ | ||
125 | #define TNONE 4 | ||
126 | |||
127 | |||
128 | /* | ||
129 | * indexes in MIB | ||
130 | */ | ||
131 | #define INDEX_MAC 1 | ||
132 | #define INDEX_PATH 1 | ||
133 | #define INDEX_PORT 1 | ||
134 | |||
135 | |||
136 | /* | ||
137 | * policies | ||
138 | */ | ||
139 | #define POLICY_AA (1<<0) /* reject AA */ | ||
140 | #define POLICY_AB (1<<1) /* reject AB */ | ||
141 | #define POLICY_AS (1<<2) /* reject AS */ | ||
142 | #define POLICY_AM (1<<3) /* reject AM */ | ||
143 | #define POLICY_BA (1<<4) /* reject BA */ | ||
144 | #define POLICY_BB (1<<5) /* reject BB */ | ||
145 | #define POLICY_BS (1<<6) /* reject BS */ | ||
146 | #define POLICY_BM (1<<7) /* reject BM */ | ||
147 | #define POLICY_SA (1<<8) /* reject SA */ | ||
148 | #define POLICY_SB (1<<9) /* reject SB */ | ||
149 | #define POLICY_SS (1<<10) /* reject SS */ | ||
150 | #define POLICY_SM (1<<11) /* reject SM */ | ||
151 | #define POLICY_MA (1<<12) /* reject MA */ | ||
152 | #define POLICY_MB (1<<13) /* reject MB */ | ||
153 | #define POLICY_MS (1<<14) /* reject MS */ | ||
154 | #define POLICY_MM (1<<15) /* reject MM */ | ||
155 | |||
156 | /* | ||
157 | * commands | ||
158 | */ | ||
159 | |||
160 | /* | ||
161 | * EVENTS | ||
162 | * event classes | ||
163 | */ | ||
164 | #define EVENT_ECM 1 /* event class ECM */ | ||
165 | #define EVENT_CFM 2 /* event class CFM */ | ||
166 | #define EVENT_RMT 3 /* event class RMT */ | ||
167 | #define EVENT_SMT 4 /* event class SMT */ | ||
168 | #define EVENT_PCM 5 /* event class PCM */ | ||
169 | #define EVENT_PCMA 5 /* event class PCMA */ | ||
170 | #define EVENT_PCMB 6 /* event class PCMB */ | ||
171 | |||
172 | /* WARNING : | ||
173 | * EVENT_PCM* must be last in the above list | ||
174 | * if more than two ports are used, EVENT_PCM .. EVENT_PCMA+NUM_PHYS-1 | ||
175 | * are used ! | ||
176 | */ | ||
177 | |||
178 | #define EV_TOKEN(class,event) (((u_long)(class)<<16L)|((u_long)(event))) | ||
179 | #define EV_T_CLASS(token) ((int)((token)>>16)&0xffff) | ||
180 | #define EV_T_EVENT(token) ((int)(token)&0xffff) | ||
181 | |||
182 | /* | ||
183 | * ECM events | ||
184 | */ | ||
185 | #define EC_CONNECT 1 /* connect request */ | ||
186 | #define EC_DISCONNECT 2 /* disconnect request */ | ||
187 | #define EC_TRACE_PROP 3 /* trace propagation */ | ||
188 | #define EC_PATH_TEST 4 /* path test */ | ||
189 | #define EC_TIMEOUT_TD 5 /* timer TD_min */ | ||
190 | #define EC_TIMEOUT_TMAX 6 /* timer trace_max */ | ||
191 | #define EC_TIMEOUT_IMAX 7 /* timer I_max */ | ||
192 | #define EC_TIMEOUT_INMAX 8 /* timer IN_max */ | ||
193 | #define EC_TEST_DONE 9 /* path test done */ | ||
194 | |||
195 | /* | ||
196 | * CFM events | ||
197 | */ | ||
198 | #define CF_LOOP 1 /* cf_loop flag from PCM */ | ||
199 | #define CF_LOOP_A 1 /* cf_loop flag from PCM */ | ||
200 | #define CF_LOOP_B 2 /* cf_loop flag from PCM */ | ||
201 | #define CF_JOIN 3 /* cf_join flag from PCM */ | ||
202 | #define CF_JOIN_A 3 /* cf_join flag from PCM */ | ||
203 | #define CF_JOIN_B 4 /* cf_join flag from PCM */ | ||
204 | |||
205 | /* | ||
206 | * PCM events | ||
207 | */ | ||
208 | #define PC_START 1 | ||
209 | #define PC_STOP 2 | ||
210 | #define PC_LOOP 3 | ||
211 | #define PC_JOIN 4 | ||
212 | #define PC_SIGNAL 5 | ||
213 | #define PC_REJECT 6 | ||
214 | #define PC_MAINT 7 | ||
215 | #define PC_TRACE 8 | ||
216 | #define PC_PDR 9 | ||
217 | #define PC_ENABLE 10 | ||
218 | #define PC_DISABLE 11 | ||
219 | |||
220 | /* | ||
221 | * must be ordered as in LineStateType | ||
222 | */ | ||
223 | #define PC_QLS 12 | ||
224 | #define PC_ILS 13 | ||
225 | #define PC_MLS 14 | ||
226 | #define PC_HLS 15 | ||
227 | #define PC_LS_PDR 16 | ||
228 | #define PC_LS_NONE 17 | ||
229 | #define LS2MIB(x) ((x)-PC_QLS) | ||
230 | #define MIB2LS(x) ((x)+PC_QLS) | ||
231 | |||
232 | #define PC_TIMEOUT_TB_MAX 18 /* timer TB_max */ | ||
233 | #define PC_TIMEOUT_TB_MIN 19 /* timer TB_min */ | ||
234 | #define PC_TIMEOUT_C_MIN 20 /* timer C_Min */ | ||
235 | #define PC_TIMEOUT_T_OUT 21 /* timer T_Out */ | ||
236 | #define PC_TIMEOUT_TL_MIN 22 /* timer TL_Min */ | ||
237 | #define PC_TIMEOUT_T_NEXT 23 /* timer t_next[] */ | ||
238 | #define PC_TIMEOUT_LCT 24 | ||
239 | #define PC_NSE 25 /* NOISE hardware timer */ | ||
240 | #define PC_LEM 26 /* LEM done */ | ||
241 | |||
242 | /* | ||
243 | * RMT events meaning from | ||
244 | */ | ||
245 | #define RM_RING_OP 1 /* ring operational MAC */ | ||
246 | #define RM_RING_NON_OP 2 /* ring not operational MAC */ | ||
247 | #define RM_MY_BEACON 3 /* recvd my beacon MAC */ | ||
248 | #define RM_OTHER_BEACON 4 /* recvd other beacon MAC */ | ||
249 | #define RM_MY_CLAIM 5 /* recvd my claim MAC */ | ||
250 | #define RM_TRT_EXP 6 /* TRT exp MAC */ | ||
251 | #define RM_VALID_CLAIM 7 /* claim from dup addr MAC */ | ||
252 | #define RM_JOIN 8 /* signal rm_join CFM */ | ||
253 | #define RM_LOOP 9 /* signal rm_loop CFM */ | ||
254 | #define RM_DUP_ADDR 10 /* dup_addr_test hange SMT-NIF */ | ||
255 | #define RM_ENABLE_FLAG 11 /* enable flag */ | ||
256 | |||
257 | #define RM_TIMEOUT_NON_OP 12 /* timeout T_Non_OP */ | ||
258 | #define RM_TIMEOUT_T_STUCK 13 /* timeout T_Stuck */ | ||
259 | #define RM_TIMEOUT_ANNOUNCE 14 /* timeout T_Announce */ | ||
260 | #define RM_TIMEOUT_T_DIRECT 15 /* timeout T_Direct */ | ||
261 | #define RM_TIMEOUT_D_MAX 16 /* timeout D_Max */ | ||
262 | #define RM_TIMEOUT_POLL 17 /* claim/beacon poller */ | ||
263 | #define RM_TX_STATE_CHANGE 18 /* To restart timer for D_Max */ | ||
264 | |||
265 | /* | ||
266 | * SMT events | ||
267 | */ | ||
268 | #define SM_TIMER 1 /* timer */ | ||
269 | #define SM_FAST 2 /* smt_force_irq */ | ||
270 | |||
271 | /* PC modes */ | ||
272 | #define PM_NONE 0 | ||
273 | #define PM_PEER 1 | ||
274 | #define PM_TREE 2 | ||
275 | |||
276 | /* | ||
277 | * PCM withhold codes | ||
278 | * MIB PC-WithholdType ENUM | ||
279 | */ | ||
280 | #define PC_WH_NONE 0 /* ok */ | ||
281 | #define PC_WH_M_M 1 /* M to M */ | ||
282 | #define PC_WH_OTHER 2 /* other incompatible phys */ | ||
283 | #define PC_WH_PATH 3 /* path not available */ | ||
284 | /* | ||
285 | * LCT duration | ||
286 | */ | ||
287 | #define LC_SHORT 1 /* short LCT */ | ||
288 | #define LC_MEDIUM 2 /* medium LCT */ | ||
289 | #define LC_LONG 3 /* long LCT */ | ||
290 | #define LC_EXTENDED 4 /* extended LCT */ | ||
291 | |||
292 | /* | ||
293 | * path_test values | ||
294 | */ | ||
295 | #define PT_NONE 0 | ||
296 | #define PT_TESTING 1 /* test is running */ | ||
297 | #define PT_PASSED 2 /* test passed */ | ||
298 | #define PT_FAILED 3 /* test failed */ | ||
299 | #define PT_PENDING 4 /* path test follows */ | ||
300 | #define PT_EXITING 5 /* disconnected while in trace/leave */ | ||
301 | |||
302 | /* | ||
303 | * duplicate address test | ||
304 | * MIB DupAddressTest ENUM | ||
305 | */ | ||
306 | #define DA_NONE 0 /* */ | ||
307 | #define DA_PASSED 1 /* test passed */ | ||
308 | #define DA_FAILED 2 /* test failed */ | ||
309 | |||
310 | |||
311 | /* | ||
312 | * optical bypass | ||
313 | */ | ||
314 | #define BP_DEINSERT 0 /* disable bypass */ | ||
315 | #define BP_INSERT 1 /* enable bypass */ | ||
316 | |||
317 | /* | ||
318 | * ODL enable/disable | ||
319 | */ | ||
320 | #define PM_TRANSMIT_DISABLE 0 /* disable xmit */ | ||
321 | #define PM_TRANSMIT_ENABLE 1 /* enable xmit */ | ||
322 | |||
323 | /* | ||
324 | * parameter for config_mux | ||
325 | * note : number is index in config_endec table ! | ||
326 | */ | ||
327 | #define MUX_THRUA 0 /* through A */ | ||
328 | #define MUX_THRUB 1 /* through B */ | ||
329 | #define MUX_WRAPA 2 /* wrap A */ | ||
330 | #define MUX_WRAPB 3 /* wrap B */ | ||
331 | #define MUX_ISOLATE 4 /* isolated */ | ||
332 | #define MUX_WRAPS 5 /* SAS */ | ||
333 | |||
334 | /* | ||
335 | * MAC control | ||
336 | */ | ||
337 | #define MA_RESET 0 | ||
338 | #define MA_BEACON 1 | ||
339 | #define MA_CLAIM 2 | ||
340 | #define MA_DIRECTED 3 /* directed beacon */ | ||
341 | #define MA_TREQ 4 /* change T_Req */ | ||
342 | #define MA_OFFLINE 5 /* switch MAC to offline */ | ||
343 | |||
344 | |||
345 | /* | ||
346 | * trace prop | ||
347 | * bit map for trace propagation | ||
348 | */ | ||
349 | #define ENTITY_MAC (NUMPHYS) | ||
350 | #define ENTITY_PHY(p) (p) | ||
351 | #define ENTITY_BIT(m) (1<<(m)) | ||
352 | |||
353 | /* | ||
354 | * Resource Tag Types | ||
355 | */ | ||
356 | #define PATH_ISO 0 /* isolated */ | ||
357 | #define PATH_PRIM 3 /* primary path */ | ||
358 | #define PATH_THRU 5 /* through path */ | ||
359 | |||
360 | #define RES_MAC 2 /* resource type MAC */ | ||
361 | #define RES_PORT 4 /* resource type PORT */ | ||
362 | |||
363 | |||
364 | /* | ||
365 | * CFM state | ||
366 | * oops: MUST MATCH CF-StateType in SMT7.2 ! | ||
367 | */ | ||
368 | #define SC0_ISOLATED 0 /* isolated */ | ||
369 | #define SC1_WRAP_A 5 /* wrap A (not used) */ | ||
370 | #define SC2_WRAP_B 6 /* wrap B (not used) */ | ||
371 | #define SC4_THRU_A 12 /* through A */ | ||
372 | #define SC5_THRU_B 7 /* through B (used in SMT 6.2) */ | ||
373 | #define SC7_WRAP_S 8 /* SAS (not used) */ | ||
374 | #define SC9_C_WRAP_A 9 /* c wrap A */ | ||
375 | #define SC10_C_WRAP_B 10 /* c wrap B */ | ||
376 | #define SC11_C_WRAP_S 11 /* c wrap S */ | ||
377 | |||
378 | /* | ||
379 | * convert MIB time in units of 80nS to uS | ||
380 | */ | ||
381 | #define MIB2US(t) ((t)/12) | ||
382 | #define SEC2MIB(s) ((s)*12500000L) | ||
383 | /* | ||
384 | * SMT timer | ||
385 | */ | ||
386 | struct smt_timer { | ||
387 | struct smt_timer *tm_next ; /* linked list */ | ||
388 | struct s_smc *tm_smc ; /* pointer to context */ | ||
389 | u_long tm_delta ; /* delta time */ | ||
390 | u_long tm_token ; /* token value */ | ||
391 | u_short tm_active ; /* flag : active/inactive */ | ||
392 | u_short tm_pad ; /* pad field */ | ||
393 | } ; | ||
394 | |||
395 | /* | ||
396 | * communication structures | ||
397 | */ | ||
398 | struct mac_parameter { | ||
399 | u_long t_neg ; /* T_Neg parameter */ | ||
400 | u_long t_pri ; /* T_Pri register in MAC */ | ||
401 | } ; | ||
402 | |||
403 | /* | ||
404 | * MAC counters | ||
405 | */ | ||
406 | struct mac_counter { | ||
407 | u_long mac_nobuf_counter ; /* MAC SW counter: no buffer */ | ||
408 | u_long mac_r_restart_counter ; /* MAC SW counter: rx restarted */ | ||
409 | } ; | ||
410 | |||
411 | /* | ||
412 | * para struct context for SMT parameters | ||
413 | */ | ||
414 | struct s_pcon { | ||
415 | int pc_len ; | ||
416 | int pc_err ; | ||
417 | int pc_badset ; | ||
418 | void *pc_p ; | ||
419 | } ; | ||
420 | |||
421 | /* | ||
422 | * link error monitor | ||
423 | */ | ||
424 | #define LEM_AVG 5 | ||
425 | struct lem_counter { | ||
426 | #ifdef AM29K | ||
427 | int lem_on ; | ||
428 | u_long lem_errors ; | ||
429 | u_long lem_symbols ; | ||
430 | u_long lem_tsymbols ; | ||
431 | int lem_s_count ; | ||
432 | int lem_n_s ; | ||
433 | int lem_values ; | ||
434 | int lem_index ; | ||
435 | int lem_avg_ber[LEM_AVG] ; | ||
436 | int lem_sum ; | ||
437 | #else | ||
438 | u_short lem_float_ber ; /* 10E-nn bit error rate */ | ||
439 | u_long lem_errors ; /* accumulated error count */ | ||
440 | u_short lem_on ; | ||
441 | #endif | ||
442 | } ; | ||
443 | |||
444 | #define NUMBITS 10 | ||
445 | |||
446 | #ifdef AMDPLC | ||
447 | |||
448 | /* | ||
449 | * PLC state table | ||
450 | */ | ||
451 | struct s_plc { | ||
452 | u_short p_state ; /* current state */ | ||
453 | u_short p_bits ; /* number of bits to send */ | ||
454 | u_short p_start ; /* first bit pos */ | ||
455 | u_short p_pad ; /* padding for alignment */ | ||
456 | u_long soft_err ; /* error counter */ | ||
457 | u_long parity_err ; /* error counter */ | ||
458 | u_long ebuf_err ; /* error counter */ | ||
459 | u_long ebuf_cont ; /* continous error counter */ | ||
460 | u_long phyinv ; /* error counter */ | ||
461 | u_long vsym_ctr ; /* error counter */ | ||
462 | u_long mini_ctr ; /* error counter */ | ||
463 | u_long tpc_exp ; /* error counter */ | ||
464 | u_long np_err ; /* error counter */ | ||
465 | u_long b_pcs ; /* error counter */ | ||
466 | u_long b_tpc ; /* error counter */ | ||
467 | u_long b_tne ; /* error counter */ | ||
468 | u_long b_qls ; /* error counter */ | ||
469 | u_long b_ils ; /* error counter */ | ||
470 | u_long b_hls ; /* error counter */ | ||
471 | } ; | ||
472 | #endif | ||
473 | |||
474 | #ifdef PROTOTYP_INC | ||
475 | #include "fddi/driver.pro" | ||
476 | #else /* PROTOTYP_INC */ | ||
477 | /* | ||
478 | * function prototypes | ||
479 | */ | ||
480 | #include "h/mbuf.h" /* Type definitions for MBUFs */ | ||
481 | #include "h/smtstate.h" /* struct smt_state */ | ||
482 | |||
483 | void hwt_restart(struct s_smc *smc); /* hwt.c */ | ||
484 | SMbuf *smt_build_frame(struct s_smc *smc, int class, int type, | ||
485 | int length); /* smt.c */ | ||
486 | SMbuf *smt_get_mbuf(struct s_smc *smc); /* drvsr.c */ | ||
487 | void *sm_to_para(struct s_smc *smc, struct smt_header *sm, | ||
488 | int para); /* smt.c */ | ||
489 | |||
490 | #ifndef SK_UNUSED | ||
491 | #define SK_UNUSED(var) (void)(var) | ||
492 | #endif | ||
493 | |||
494 | void queue_event(struct s_smc *smc, int class, int event); | ||
495 | void ecm(struct s_smc *smc, int event); | ||
496 | void ecm_init(struct s_smc *smc); | ||
497 | void rmt(struct s_smc *smc, int event); | ||
498 | void rmt_init(struct s_smc *smc); | ||
499 | void pcm(struct s_smc *smc, const int np, int event); | ||
500 | void pcm_init(struct s_smc *smc); | ||
501 | void cfm(struct s_smc *smc, int event); | ||
502 | void cfm_init(struct s_smc *smc); | ||
503 | void smt_timer_start(struct s_smc *smc, struct smt_timer *timer, u_long time, | ||
504 | u_long token); | ||
505 | void smt_timer_stop(struct s_smc *smc, struct smt_timer *timer); | ||
506 | void pcm_status_state(struct s_smc *smc, int np, int *type, int *state, | ||
507 | int *remote, int *mac); | ||
508 | void plc_config_mux(struct s_smc *smc, int mux); | ||
509 | void sm_lem_evaluate(struct s_smc *smc); | ||
510 | void smt_clear_una_dna(struct s_smc *smc); | ||
511 | void mac_update_counter(struct s_smc *smc); | ||
512 | void sm_pm_ls_latch(struct s_smc *smc, int phy, int on_off); | ||
513 | void sm_ma_control(struct s_smc *smc, int mode); | ||
514 | void sm_mac_check_beacon_claim(struct s_smc *smc); | ||
515 | void config_mux(struct s_smc *smc, int mux); | ||
516 | void smt_agent_init(struct s_smc *smc); | ||
517 | void smt_timer_init(struct s_smc *smc); | ||
518 | void smt_received_pack(struct s_smc *smc, SMbuf *mb, int fs); | ||
519 | void smt_add_para(struct s_smc *smc, struct s_pcon *pcon, u_short para, | ||
520 | int index, int local); | ||
521 | void smt_swap_para(struct smt_header *sm, int len, int direction); | ||
522 | void ev_init(struct s_smc *smc); | ||
523 | void hwt_init(struct s_smc *smc); | ||
524 | u_long hwt_read(struct s_smc *smc); | ||
525 | void hwt_stop(struct s_smc *smc); | ||
526 | void hwt_start(struct s_smc *smc, u_long time); | ||
527 | void smt_send_mbuf(struct s_smc *smc, SMbuf *mb, int fc); | ||
528 | void smt_free_mbuf(struct s_smc *smc, SMbuf *mb); | ||
529 | void sm_pm_bypass_req(struct s_smc *smc, int mode); | ||
530 | void rmt_indication(struct s_smc *smc, int i); | ||
531 | void cfm_state_change(struct s_smc *smc, int c_state); | ||
532 | |||
533 | #if defined(DEBUG) || !defined(NO_SMT_PANIC) | ||
534 | void smt_panic(struct s_smc *smc, char *text); | ||
535 | #else | ||
536 | #define smt_panic(smc,text) | ||
537 | #endif /* DEBUG || !NO_SMT_PANIC */ | ||
538 | |||
539 | void smt_stat_counter(struct s_smc *smc, int stat); | ||
540 | void smt_timer_poll(struct s_smc *smc); | ||
541 | u_long smt_get_time(void); | ||
542 | u_long smt_get_tid(struct s_smc *smc); | ||
543 | void smt_timer_done(struct s_smc *smc); | ||
544 | void smt_set_defaults(struct s_smc *smc); | ||
545 | void smt_fixup_mib(struct s_smc *smc); | ||
546 | void smt_reset_defaults(struct s_smc *smc, int level); | ||
547 | void smt_agent_task(struct s_smc *smc); | ||
548 | void smt_please_reconnect(struct s_smc *smc, int reconn_time); | ||
549 | int smt_check_para(struct s_smc *smc, struct smt_header *sm, | ||
550 | const u_short list[]); | ||
551 | void driver_get_bia(struct s_smc *smc, struct fddi_addr *bia_addr); | ||
552 | |||
553 | #ifdef SUPERNET_3 | ||
554 | void drv_reset_indication(struct s_smc *smc); | ||
555 | #endif /* SUPERNET_3 */ | ||
556 | |||
557 | void smt_start_watchdog(struct s_smc *smc); | ||
558 | void smt_event(struct s_smc *smc, int event); | ||
559 | void timer_event(struct s_smc *smc, u_long token); | ||
560 | void ev_dispatcher(struct s_smc *smc); | ||
561 | void pcm_get_state(struct s_smc *smc, struct smt_state *state); | ||
562 | void ecm_state_change(struct s_smc *smc, int e_state); | ||
563 | int sm_pm_bypass_present(struct s_smc *smc); | ||
564 | void pcm_state_change(struct s_smc *smc, int plc, int p_state); | ||
565 | void rmt_state_change(struct s_smc *smc, int r_state); | ||
566 | int sm_pm_get_ls(struct s_smc *smc, int phy); | ||
567 | int pcm_get_s_port(struct s_smc *smc); | ||
568 | int pcm_rooted_station(struct s_smc *smc); | ||
569 | int cfm_get_mac_input(struct s_smc *smc); | ||
570 | int cfm_get_mac_output(struct s_smc *smc); | ||
571 | int port_to_mib(struct s_smc *smc, int p); | ||
572 | int cem_build_path(struct s_smc *smc, char *to, int path_index); | ||
573 | int sm_mac_get_tx_state(struct s_smc *smc); | ||
574 | char *get_pcmstate(struct s_smc *smc, int np); | ||
575 | int smt_action(struct s_smc *smc, int class, int code, int index); | ||
576 | u_short smt_online(struct s_smc *smc, int on); | ||
577 | void smt_force_irq(struct s_smc *smc); | ||
578 | void smt_pmf_received_pack(struct s_smc *smc, SMbuf *mb, int local); | ||
579 | void smt_send_frame(struct s_smc *smc, SMbuf *mb, int fc, int local); | ||
580 | void smt_set_timestamp(struct s_smc *smc, u_char *p); | ||
581 | void mac_set_rx_mode(struct s_smc *smc, int mode); | ||
582 | int mac_add_multicast(struct s_smc *smc, struct fddi_addr *addr, int can); | ||
583 | int mac_set_func_addr(struct s_smc *smc, u_long f_addr); | ||
584 | void mac_del_multicast(struct s_smc *smc, struct fddi_addr *addr, int can); | ||
585 | void mac_update_multicast(struct s_smc *smc); | ||
586 | void mac_clear_multicast(struct s_smc *smc); | ||
587 | void set_formac_tsync(struct s_smc *smc, long sync_bw); | ||
588 | void formac_reinit_tx(struct s_smc *smc); | ||
589 | void formac_tx_restart(struct s_smc *smc); | ||
590 | void process_receive(struct s_smc *smc); | ||
591 | void init_driver_fplus(struct s_smc *smc); | ||
592 | void rtm_irq(struct s_smc *smc); | ||
593 | void rtm_set_timer(struct s_smc *smc); | ||
594 | void ring_status_indication(struct s_smc *smc, u_long status); | ||
595 | void llc_recover_tx(struct s_smc *smc); | ||
596 | void llc_restart_tx(struct s_smc *smc); | ||
597 | void plc_clear_irq(struct s_smc *smc, int p); | ||
598 | void plc_irq(struct s_smc *smc, int np, unsigned int cmd); | ||
599 | int smt_set_mac_opvalues(struct s_smc *smc); | ||
600 | |||
601 | #ifdef TAG_MODE | ||
602 | void mac_drv_pci_fix(struct s_smc *smc, u_long fix_value); | ||
603 | void mac_do_pci_fix(struct s_smc *smc); | ||
604 | void mac_drv_clear_tx_queue(struct s_smc *smc); | ||
605 | void mac_drv_repair_descr(struct s_smc *smc); | ||
606 | u_long hwt_quick_read(struct s_smc *smc); | ||
607 | void hwt_wait_time(struct s_smc *smc, u_long start, long duration); | ||
608 | #endif | ||
609 | |||
610 | #ifdef SMT_PNMI | ||
611 | int pnmi_init(struct s_smc* smc); | ||
612 | int pnmi_process_ndis_id(struct s_smc *smc, u_long ndis_oid, void *buf, int len, | ||
613 | int *BytesAccessed, int *BytesNeeded, u_char action); | ||
614 | #endif | ||
615 | |||
616 | #ifdef SBA | ||
617 | #ifndef _H2INC | ||
618 | void sba(); | ||
619 | #endif | ||
620 | void sba_raf_received_pack(); | ||
621 | void sba_timer_poll(); | ||
622 | void smt_init_sba(); | ||
623 | #endif | ||
624 | |||
625 | #ifdef ESS | ||
626 | int ess_raf_received_pack(struct s_smc *smc, SMbuf *mb, struct smt_header *sm, | ||
627 | int fs); | ||
628 | void ess_timer_poll(struct s_smc *smc); | ||
629 | void ess_para_change(struct s_smc *smc); | ||
630 | #endif | ||
631 | |||
632 | #ifndef BOOT | ||
633 | void smt_init_evc(struct s_smc *smc); | ||
634 | void smt_srf_event(struct s_smc *smc, int code, int index, int cond); | ||
635 | #else | ||
636 | #define smt_init_evc(smc) | ||
637 | #define smt_srf_event(smc,code,index,cond) | ||
638 | #endif | ||
639 | |||
640 | #ifndef SMT_REAL_TOKEN_CT | ||
641 | void smt_emulate_token_ct(struct s_smc *smc, int mac_index); | ||
642 | #endif | ||
643 | |||
644 | #if defined(DEBUG) && !defined(BOOT) | ||
645 | void dump_smt(struct s_smc *smc, struct smt_header *sm, char *text); | ||
646 | #else | ||
647 | #define dump_smt(smc,sm,text) | ||
648 | #endif | ||
649 | |||
650 | #ifdef DEBUG | ||
651 | char* addr_to_string(struct fddi_addr *addr); | ||
652 | void dump_hex(char *p, int len); | ||
653 | #endif | ||
654 | |||
655 | #endif /* PROTOTYP_INC */ | ||
656 | |||
657 | /* PNMI default defines */ | ||
658 | #ifndef PNMI_INIT | ||
659 | #define PNMI_INIT(smc) /* Nothing */ | ||
660 | #endif | ||
661 | #ifndef PNMI_GET_ID | ||
662 | #define PNMI_GET_ID( smc, ndis_oid, buf, len, BytesWritten, BytesNeeded ) \ | ||
663 | ( 1 ? (-1) : (-1) ) | ||
664 | #endif | ||
665 | #ifndef PNMI_SET_ID | ||
666 | #define PNMI_SET_ID( smc, ndis_oid, buf, len, BytesRead, BytesNeeded, \ | ||
667 | set_type) ( 1 ? (-1) : (-1) ) | ||
668 | #endif | ||
669 | |||
670 | /* | ||
671 | * SMT_PANIC defines | ||
672 | */ | ||
673 | #ifndef SMT_PANIC | ||
674 | #define SMT_PANIC(smc,nr,msg) smt_panic (smc, msg) | ||
675 | #endif | ||
676 | |||
677 | #ifndef SMT_ERR_LOG | ||
678 | #define SMT_ERR_LOG(smc,nr,msg) SMT_PANIC (smc, nr, msg) | ||
679 | #endif | ||
680 | |||
681 | #ifndef SMT_EBASE | ||
682 | #define SMT_EBASE 100 | ||
683 | #endif | ||
684 | |||
685 | #define SMT_E0100 SMT_EBASE + 0 | ||
686 | #define SMT_E0100_MSG "cfm FSM: invalid ce_type" | ||
687 | #define SMT_E0101 SMT_EBASE + 1 | ||
688 | #define SMT_E0101_MSG "CEM: case ???" | ||
689 | #define SMT_E0102 SMT_EBASE + 2 | ||
690 | #define SMT_E0102_MSG "CEM A: invalid state" | ||
691 | #define SMT_E0103 SMT_EBASE + 3 | ||
692 | #define SMT_E0103_MSG "CEM B: invalid state" | ||
693 | #define SMT_E0104 SMT_EBASE + 4 | ||
694 | #define SMT_E0104_MSG "CEM M: invalid state" | ||
695 | #define SMT_E0105 SMT_EBASE + 5 | ||
696 | #define SMT_E0105_MSG "CEM S: invalid state" | ||
697 | #define SMT_E0106 SMT_EBASE + 6 | ||
698 | #define SMT_E0106_MSG "CFM : invalid state" | ||
699 | #define SMT_E0107 SMT_EBASE + 7 | ||
700 | #define SMT_E0107_MSG "ECM : invalid state" | ||
701 | #define SMT_E0108 SMT_EBASE + 8 | ||
702 | #define SMT_E0108_MSG "prop_actions : NAC in DAS CFM" | ||
703 | #define SMT_E0109 SMT_EBASE + 9 | ||
704 | #define SMT_E0109_MSG "ST2U.FM_SERRSF error in special frame" | ||
705 | #define SMT_E0110 SMT_EBASE + 10 | ||
706 | #define SMT_E0110_MSG "ST2U.FM_SRFRCTOV recv. count. overflow" | ||
707 | #define SMT_E0111 SMT_EBASE + 11 | ||
708 | #define SMT_E0111_MSG "ST2U.FM_SNFSLD NP & FORMAC simult. load" | ||
709 | #define SMT_E0112 SMT_EBASE + 12 | ||
710 | #define SMT_E0112_MSG "ST2U.FM_SRCVFRM single-frame recv.-mode" | ||
711 | #define SMT_E0113 SMT_EBASE + 13 | ||
712 | #define SMT_E0113_MSG "FPLUS: Buffer Memory Error" | ||
713 | #define SMT_E0114 SMT_EBASE + 14 | ||
714 | #define SMT_E0114_MSG "ST2U.FM_SERRSF error in special frame" | ||
715 | #define SMT_E0115 SMT_EBASE + 15 | ||
716 | #define SMT_E0115_MSG "ST3L: parity error in receive queue 2" | ||
717 | #define SMT_E0116 SMT_EBASE + 16 | ||
718 | #define SMT_E0116_MSG "ST3L: parity error in receive queue 1" | ||
719 | #define SMT_E0117 SMT_EBASE + 17 | ||
720 | #define SMT_E0117_MSG "E_SMT_001: RxD count for receive queue 1 = 0" | ||
721 | #define SMT_E0118 SMT_EBASE + 18 | ||
722 | #define SMT_E0118_MSG "PCM : invalid state" | ||
723 | #define SMT_E0119 SMT_EBASE + 19 | ||
724 | #define SMT_E0119_MSG "smt_add_para" | ||
725 | #define SMT_E0120 SMT_EBASE + 20 | ||
726 | #define SMT_E0120_MSG "smt_set_para" | ||
727 | #define SMT_E0121 SMT_EBASE + 21 | ||
728 | #define SMT_E0121_MSG "invalid event in dispatcher" | ||
729 | #define SMT_E0122 SMT_EBASE + 22 | ||
730 | #define SMT_E0122_MSG "RMT : invalid state" | ||
731 | #define SMT_E0123 SMT_EBASE + 23 | ||
732 | #define SMT_E0123_MSG "SBA: state machine has invalid state" | ||
733 | #define SMT_E0124 SMT_EBASE + 24 | ||
734 | #define SMT_E0124_MSG "sba_free_session() called with NULL pointer" | ||
735 | #define SMT_E0125 SMT_EBASE + 25 | ||
736 | #define SMT_E0125_MSG "SBA : invalid session pointer" | ||
737 | #define SMT_E0126 SMT_EBASE + 26 | ||
738 | #define SMT_E0126_MSG "smt_free_mbuf() called with NULL pointer\n" | ||
739 | #define SMT_E0127 SMT_EBASE + 27 | ||
740 | #define SMT_E0127_MSG "sizeof evcs" | ||
741 | #define SMT_E0128 SMT_EBASE + 28 | ||
742 | #define SMT_E0128_MSG "evc->evc_cond_state = 0" | ||
743 | #define SMT_E0129 SMT_EBASE + 29 | ||
744 | #define SMT_E0129_MSG "evc->evc_multiple = 0" | ||
745 | #define SMT_E0130 SMT_EBASE + 30 | ||
746 | #define SMT_E0130_MSG write_mdr_warning | ||
747 | #define SMT_E0131 SMT_EBASE + 31 | ||
748 | #define SMT_E0131_MSG cam_warning | ||
749 | #define SMT_E0132 SMT_EBASE + 32 | ||
750 | #define SMT_E0132_MSG "ST1L.FM_SPCEPDx parity/coding error" | ||
751 | #define SMT_E0133 SMT_EBASE + 33 | ||
752 | #define SMT_E0133_MSG "ST1L.FM_STBURx tx buffer underrun" | ||
753 | #define SMT_E0134 SMT_EBASE + 34 | ||
754 | #define SMT_E0134_MSG "ST1L.FM_SPCEPDx parity error" | ||
755 | #define SMT_E0135 SMT_EBASE + 35 | ||
756 | #define SMT_E0135_MSG "RMT: duplicate MAC address detected. Ring left!" | ||
757 | #define SMT_E0136 SMT_EBASE + 36 | ||
758 | #define SMT_E0136_MSG "Elasticity Buffer hang-up" | ||
759 | #define SMT_E0137 SMT_EBASE + 37 | ||
760 | #define SMT_E0137_MSG "SMT: queue overrun" | ||
761 | #define SMT_E0138 SMT_EBASE + 38 | ||
762 | #define SMT_E0138_MSG "RMT: duplicate MAC address detected. Ring NOT left!" | ||
763 | #endif /* _CMTDEF_ */ | ||
diff --git a/drivers/net/skfp/h/fddi.h b/drivers/net/skfp/h/fddi.h new file mode 100644 index 000000000000..c9a28a8a383b --- /dev/null +++ b/drivers/net/skfp/h/fddi.h | |||
@@ -0,0 +1,69 @@ | |||
1 | /****************************************************************************** | ||
2 | * | ||
3 | * (C)Copyright 1998,1999 SysKonnect, | ||
4 | * a business unit of Schneider & Koch & Co. Datensysteme GmbH. | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License as published by | ||
8 | * the Free Software Foundation; either version 2 of the License, or | ||
9 | * (at your option) any later version. | ||
10 | * | ||
11 | * The information in this file is provided "AS IS" without warranty. | ||
12 | * | ||
13 | ******************************************************************************/ | ||
14 | |||
15 | #ifndef _FDDI_ | ||
16 | #define _FDDI_ | ||
17 | |||
18 | struct fddi_addr { | ||
19 | u_char a[6] ; | ||
20 | } ; | ||
21 | |||
22 | #define GROUP_ADDR 0x80 /* MSB in a[0] */ | ||
23 | |||
24 | struct fddi_mac { | ||
25 | struct fddi_addr mac_dest ; | ||
26 | struct fddi_addr mac_source ; | ||
27 | u_char mac_info[4478] ; | ||
28 | } ; | ||
29 | |||
30 | #define FDDI_MAC_SIZE (12) | ||
31 | #define FDDI_RAW_MTU (4500-5) /* exl. Pr,SD, ED/FS */ | ||
32 | #define FDDI_RAW (4500) | ||
33 | |||
34 | /* | ||
35 | * FC values | ||
36 | */ | ||
37 | #define FC_VOID 0x40 /* void frame */ | ||
38 | #define FC_TOKEN 0x80 /* token */ | ||
39 | #define FC_RES_TOKEN 0xc0 /* restricted token */ | ||
40 | #define FC_SMT_INFO 0x41 /* SMT Info frame */ | ||
41 | /* | ||
42 | * FC_SMT_LAN_LOC && FC_SMT_LOC are SK specific ! | ||
43 | */ | ||
44 | #define FC_SMT_LAN_LOC 0x42 /* local SMT Info frame */ | ||
45 | #define FC_SMT_LOC 0x43 /* local SMT Info frame */ | ||
46 | #define FC_SMT_NSA 0x4f /* SMT NSA frame */ | ||
47 | #define FC_MAC 0xc0 /* MAC frame */ | ||
48 | #define FC_BEACON 0xc2 /* MAC beacon frame */ | ||
49 | #define FC_CLAIM 0xc3 /* MAC claim frame */ | ||
50 | #define FC_SYNC_LLC 0xd0 /* sync. LLC frame */ | ||
51 | #define FC_ASYNC_LLC 0x50 /* async. LLC frame */ | ||
52 | #define FC_SYNC_BIT 0x80 /* sync. bit in FC */ | ||
53 | |||
54 | #define FC_LLC_PRIOR 0x07 /* priority bits */ | ||
55 | |||
56 | #define BEACON_INFO 0 /* beacon type */ | ||
57 | #define DBEACON_INFO 1 /* beacon type DIRECTED */ | ||
58 | |||
59 | |||
60 | /* | ||
61 | * indicator bits | ||
62 | */ | ||
63 | #define C_INDICATOR (1<<0) | ||
64 | #define A_INDICATOR (1<<1) | ||
65 | #define E_INDICATOR (1<<2) | ||
66 | #define I_INDICATOR (1<<6) /* SK specific */ | ||
67 | #define L_INDICATOR (1<<7) /* SK specific */ | ||
68 | |||
69 | #endif /* _FDDI_ */ | ||
diff --git a/drivers/net/skfp/h/fddimib.h b/drivers/net/skfp/h/fddimib.h new file mode 100644 index 000000000000..d1acdc773950 --- /dev/null +++ b/drivers/net/skfp/h/fddimib.h | |||
@@ -0,0 +1,349 @@ | |||
1 | /****************************************************************************** | ||
2 | * | ||
3 | * (C)Copyright 1998,1999 SysKonnect, | ||
4 | * a business unit of Schneider & Koch & Co. Datensysteme GmbH. | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License as published by | ||
8 | * the Free Software Foundation; either version 2 of the License, or | ||
9 | * (at your option) any later version. | ||
10 | * | ||
11 | * The information in this file is provided "AS IS" without warranty. | ||
12 | * | ||
13 | ******************************************************************************/ | ||
14 | |||
15 | /* | ||
16 | * FDDI MIB | ||
17 | */ | ||
18 | |||
19 | /* | ||
20 | * typedefs | ||
21 | */ | ||
22 | |||
23 | typedef u_long Counter ; | ||
24 | typedef u_char TimeStamp[8] ; | ||
25 | typedef struct fddi_addr LongAddr ; | ||
26 | typedef u_long Timer_2 ; | ||
27 | typedef u_long Timer ; | ||
28 | typedef u_short ResId ; | ||
29 | typedef u_short SMTEnum ; | ||
30 | typedef u_char SMTFlag ; | ||
31 | |||
32 | typedef struct { | ||
33 | Counter count ; | ||
34 | TimeStamp timestamp ; | ||
35 | } SetCountType ; | ||
36 | |||
37 | /* | ||
38 | * bits for bit string "available_path" | ||
39 | */ | ||
40 | #define MIB_PATH_P (1<<0) | ||
41 | #define MIB_PATH_S (1<<1) | ||
42 | #define MIB_PATH_L (1<<2) | ||
43 | |||
44 | /* | ||
45 | * bits for bit string PermittedPaths & RequestedPaths (SIZE(8)) | ||
46 | */ | ||
47 | #define MIB_P_PATH_LOCAL (1<<0) | ||
48 | #define MIB_P_PATH_SEC_ALTER (1<<1) | ||
49 | #define MIB_P_PATH_PRIM_ALTER (1<<2) | ||
50 | #define MIB_P_PATH_CON_ALTER (1<<3) | ||
51 | #define MIB_P_PATH_SEC_PREFER (1<<4) | ||
52 | #define MIB_P_PATH_PRIM_PREFER (1<<5) | ||
53 | #define MIB_P_PATH_CON_PREFER (1<<6) | ||
54 | #define MIB_P_PATH_THRU (1<<7) | ||
55 | |||
56 | /* | ||
57 | * enum current path | ||
58 | */ | ||
59 | #define MIB_PATH_ISOLATED 0 | ||
60 | #define MIB_PATH_LOCAL 1 | ||
61 | #define MIB_PATH_SECONDARY 2 | ||
62 | #define MIB_PATH_PRIMARY 3 | ||
63 | #define MIB_PATH_CONCATENATED 4 | ||
64 | #define MIB_PATH_THRU 5 | ||
65 | |||
66 | /* | ||
67 | * enum PMDClass | ||
68 | */ | ||
69 | #define MIB_PMDCLASS_MULTI 0 | ||
70 | #define MIB_PMDCLASS_SINGLE1 1 | ||
71 | #define MIB_PMDCLASS_SINGLE2 2 | ||
72 | #define MIB_PMDCLASS_SONET 3 | ||
73 | #define MIB_PMDCLASS_LCF 4 | ||
74 | #define MIB_PMDCLASS_TP 5 | ||
75 | #define MIB_PMDCLASS_UNKNOWN 6 | ||
76 | #define MIB_PMDCLASS_UNSPEC 7 | ||
77 | |||
78 | /* | ||
79 | * enum SMTStationStatus | ||
80 | */ | ||
81 | #define MIB_SMT_STASTA_CON 0 | ||
82 | #define MIB_SMT_STASTA_SEPA 1 | ||
83 | #define MIB_SMT_STASTA_THRU 2 | ||
84 | |||
85 | |||
86 | struct fddi_mib { | ||
87 | /* | ||
88 | * private | ||
89 | */ | ||
90 | u_char fddiPRPMFPasswd[8] ; | ||
91 | struct smt_sid fddiPRPMFStation ; | ||
92 | |||
93 | #ifdef ESS | ||
94 | /* | ||
95 | * private variables for static allocation of the | ||
96 | * End Station Support | ||
97 | */ | ||
98 | u_long fddiESSPayload ; /* payload for static alloc */ | ||
99 | u_long fddiESSOverhead ; /* frame ov for static alloc */ | ||
100 | u_long fddiESSMaxTNeg ; /* maximum of T-NEG */ | ||
101 | u_long fddiESSMinSegmentSize ; /* min size of the sync frames */ | ||
102 | u_long fddiESSCategory ; /* category for the Alloc req */ | ||
103 | short fddiESSSynchTxMode ; /* send all LLC frames as sync */ | ||
104 | #endif /* ESS */ | ||
105 | #ifdef SBA | ||
106 | /* | ||
107 | * private variables for the Synchronous Bandwidth Allocator | ||
108 | */ | ||
109 | char fddiSBACommand ; /* holds the parsed SBA cmd */ | ||
110 | u_char fddiSBAAvailable ; /* SBA allocatable value */ | ||
111 | #endif /* SBA */ | ||
112 | |||
113 | /* | ||
114 | * SMT standard mib | ||
115 | */ | ||
116 | struct smt_sid fddiSMTStationId ; | ||
117 | u_short fddiSMTOpVersionId ; | ||
118 | u_short fddiSMTHiVersionId ; | ||
119 | u_short fddiSMTLoVersionId ; | ||
120 | u_char fddiSMTManufacturerData[32] ; | ||
121 | u_char fddiSMTUserData[32] ; | ||
122 | u_short fddiSMTMIBVersionId ; | ||
123 | |||
124 | /* | ||
125 | * ConfigGrp | ||
126 | */ | ||
127 | u_char fddiSMTMac_Ct ; | ||
128 | u_char fddiSMTNonMaster_Ct ; | ||
129 | u_char fddiSMTMaster_Ct ; | ||
130 | u_char fddiSMTAvailablePaths ; | ||
131 | u_short fddiSMTConfigCapabilities ; | ||
132 | u_short fddiSMTConfigPolicy ; | ||
133 | u_short fddiSMTConnectionPolicy ; | ||
134 | u_short fddiSMTTT_Notify ; | ||
135 | u_char fddiSMTStatRptPolicy ; | ||
136 | u_long fddiSMTTrace_MaxExpiration ; | ||
137 | u_short fddiSMTPORTIndexes[NUMPHYS] ; | ||
138 | u_short fddiSMTMACIndexes ; | ||
139 | u_char fddiSMTBypassPresent ; | ||
140 | |||
141 | /* | ||
142 | * StatusGrp | ||
143 | */ | ||
144 | SMTEnum fddiSMTECMState ; | ||
145 | SMTEnum fddiSMTCF_State ; | ||
146 | SMTEnum fddiSMTStationStatus ; | ||
147 | u_char fddiSMTRemoteDisconnectFlag ; | ||
148 | u_char fddiSMTPeerWrapFlag ; | ||
149 | |||
150 | /* | ||
151 | * MIBOperationGrp | ||
152 | */ | ||
153 | TimeStamp fddiSMTTimeStamp ; | ||
154 | TimeStamp fddiSMTTransitionTimeStamp ; | ||
155 | SetCountType fddiSMTSetCount ; | ||
156 | struct smt_sid fddiSMTLastSetStationId ; | ||
157 | |||
158 | struct fddi_mib_m { | ||
159 | u_short fddiMACFrameStatusFunctions ; | ||
160 | Timer_2 fddiMACT_MaxCapabilitiy ; | ||
161 | Timer_2 fddiMACTVXCapabilitiy ; | ||
162 | |||
163 | /* ConfigGrp */ | ||
164 | u_char fddiMACMultiple_N ; /* private */ | ||
165 | u_char fddiMACMultiple_P ; /* private */ | ||
166 | u_char fddiMACDuplicateAddressCond ;/* private */ | ||
167 | u_char fddiMACAvailablePaths ; | ||
168 | u_short fddiMACCurrentPath ; | ||
169 | LongAddr fddiMACUpstreamNbr ; | ||
170 | LongAddr fddiMACDownstreamNbr ; | ||
171 | LongAddr fddiMACOldUpstreamNbr ; | ||
172 | LongAddr fddiMACOldDownstreamNbr ; | ||
173 | SMTEnum fddiMACDupAddressTest ; | ||
174 | u_short fddiMACRequestedPaths ; | ||
175 | SMTEnum fddiMACDownstreamPORTType ; | ||
176 | ResId fddiMACIndex ; | ||
177 | |||
178 | /* AddressGrp */ | ||
179 | LongAddr fddiMACSMTAddress ; | ||
180 | |||
181 | /* OperationGrp */ | ||
182 | Timer_2 fddiMACT_Min ; /* private */ | ||
183 | Timer_2 fddiMACT_ReqMIB ; | ||
184 | Timer_2 fddiMACT_Req ; /* private */ | ||
185 | Timer_2 fddiMACT_Neg ; | ||
186 | Timer_2 fddiMACT_MaxMIB ; | ||
187 | Timer_2 fddiMACT_Max ; /* private */ | ||
188 | Timer_2 fddiMACTvxValueMIB ; | ||
189 | Timer_2 fddiMACTvxValue ; /* private */ | ||
190 | Timer_2 fddiMACT_Pri0 ; | ||
191 | Timer_2 fddiMACT_Pri1 ; | ||
192 | Timer_2 fddiMACT_Pri2 ; | ||
193 | Timer_2 fddiMACT_Pri3 ; | ||
194 | Timer_2 fddiMACT_Pri4 ; | ||
195 | Timer_2 fddiMACT_Pri5 ; | ||
196 | Timer_2 fddiMACT_Pri6 ; | ||
197 | |||
198 | /* CountersGrp */ | ||
199 | Counter fddiMACFrame_Ct ; | ||
200 | Counter fddiMACCopied_Ct ; | ||
201 | Counter fddiMACTransmit_Ct ; | ||
202 | Counter fddiMACToken_Ct ; | ||
203 | Counter fddiMACError_Ct ; | ||
204 | Counter fddiMACLost_Ct ; | ||
205 | Counter fddiMACTvxExpired_Ct ; | ||
206 | Counter fddiMACNotCopied_Ct ; | ||
207 | Counter fddiMACRingOp_Ct ; | ||
208 | |||
209 | Counter fddiMACSMTCopied_Ct ; /* private */ | ||
210 | Counter fddiMACSMTTransmit_Ct ; /* private */ | ||
211 | |||
212 | /* private for delta ratio */ | ||
213 | Counter fddiMACOld_Frame_Ct ; | ||
214 | Counter fddiMACOld_Copied_Ct ; | ||
215 | Counter fddiMACOld_Error_Ct ; | ||
216 | Counter fddiMACOld_Lost_Ct ; | ||
217 | Counter fddiMACOld_NotCopied_Ct ; | ||
218 | |||
219 | /* FrameErrorConditionGrp */ | ||
220 | u_short fddiMACFrameErrorThreshold ; | ||
221 | u_short fddiMACFrameErrorRatio ; | ||
222 | |||
223 | /* NotCopiedConditionGrp */ | ||
224 | u_short fddiMACNotCopiedThreshold ; | ||
225 | u_short fddiMACNotCopiedRatio ; | ||
226 | |||
227 | /* StatusGrp */ | ||
228 | SMTEnum fddiMACRMTState ; | ||
229 | SMTFlag fddiMACDA_Flag ; | ||
230 | SMTFlag fddiMACUNDA_Flag ; | ||
231 | SMTFlag fddiMACFrameErrorFlag ; | ||
232 | SMTFlag fddiMACNotCopiedFlag ; | ||
233 | SMTFlag fddiMACMA_UnitdataAvailable ; | ||
234 | SMTFlag fddiMACHardwarePresent ; | ||
235 | SMTFlag fddiMACMA_UnitdataEnable ; | ||
236 | |||
237 | } m[NUMMACS] ; | ||
238 | #define MAC0 0 | ||
239 | |||
240 | struct fddi_mib_a { | ||
241 | ResId fddiPATHIndex ; | ||
242 | u_long fddiPATHSbaPayload ; | ||
243 | u_long fddiPATHSbaOverhead ; | ||
244 | /* fddiPATHConfiguration is built on demand */ | ||
245 | /* u_long fddiPATHConfiguration ; */ | ||
246 | Timer fddiPATHT_Rmode ; | ||
247 | u_long fddiPATHSbaAvailable ; | ||
248 | Timer_2 fddiPATHTVXLowerBound ; | ||
249 | Timer_2 fddiPATHT_MaxLowerBound ; | ||
250 | Timer_2 fddiPATHMaxT_Req ; | ||
251 | } a[NUMPATHS] ; | ||
252 | #define PATH0 0 | ||
253 | |||
254 | struct fddi_mib_p { | ||
255 | /* ConfigGrp */ | ||
256 | SMTEnum fddiPORTMy_Type ; | ||
257 | SMTEnum fddiPORTNeighborType ; | ||
258 | u_char fddiPORTConnectionPolicies ; | ||
259 | struct { | ||
260 | u_char T_val ; | ||
261 | u_char R_val ; | ||
262 | } fddiPORTMacIndicated ; | ||
263 | SMTEnum fddiPORTCurrentPath ; | ||
264 | /* must be 4: is 32 bit in SMT format | ||
265 | * indices : | ||
266 | * 1 none | ||
267 | * 2 tree | ||
268 | * 3 peer | ||
269 | */ | ||
270 | u_char fddiPORTRequestedPaths[4] ; | ||
271 | u_short fddiPORTMACPlacement ; | ||
272 | u_char fddiPORTAvailablePaths ; | ||
273 | u_char fddiPORTConnectionCapabilities ; | ||
274 | SMTEnum fddiPORTPMDClass ; | ||
275 | ResId fddiPORTIndex ; | ||
276 | |||
277 | /* OperationGrp */ | ||
278 | SMTEnum fddiPORTMaint_LS ; | ||
279 | SMTEnum fddiPORTPC_LS ; | ||
280 | u_char fddiPORTBS_Flag ; | ||
281 | |||
282 | /* ErrorCtrsGrp */ | ||
283 | Counter fddiPORTLCTFail_Ct ; | ||
284 | Counter fddiPORTEBError_Ct ; | ||
285 | Counter fddiPORTOldEBError_Ct ; | ||
286 | |||
287 | /* LerGrp */ | ||
288 | Counter fddiPORTLem_Reject_Ct ; | ||
289 | Counter fddiPORTLem_Ct ; | ||
290 | u_char fddiPORTLer_Estimate ; | ||
291 | u_char fddiPORTLer_Cutoff ; | ||
292 | u_char fddiPORTLer_Alarm ; | ||
293 | |||
294 | /* StatusGrp */ | ||
295 | SMTEnum fddiPORTConnectState ; | ||
296 | SMTEnum fddiPORTPCMState ; /* real value */ | ||
297 | SMTEnum fddiPORTPCMStateX ; /* value for MIB */ | ||
298 | SMTEnum fddiPORTPC_Withhold ; | ||
299 | SMTFlag fddiPORTHardwarePresent ; | ||
300 | u_char fddiPORTLerFlag ; | ||
301 | |||
302 | u_char fddiPORTMultiple_U ; /* private */ | ||
303 | u_char fddiPORTMultiple_P ; /* private */ | ||
304 | u_char fddiPORTEB_Condition ; /* private */ | ||
305 | } p[NUMPHYS] ; | ||
306 | struct { | ||
307 | Counter fddiPRIVECF_Req_Rx ; /* ECF req received */ | ||
308 | Counter fddiPRIVECF_Reply_Rx ; /* ECF repl received */ | ||
309 | Counter fddiPRIVECF_Req_Tx ; /* ECF req transm */ | ||
310 | Counter fddiPRIVECF_Reply_Tx ; /* ECF repl transm */ | ||
311 | Counter fddiPRIVPMF_Get_Rx ; /* PMF Get rec */ | ||
312 | Counter fddiPRIVPMF_Set_Rx ; /* PMF Set rec */ | ||
313 | Counter fddiPRIVRDF_Rx ; /* RDF received */ | ||
314 | Counter fddiPRIVRDF_Tx ; /* RDF transmitted */ | ||
315 | } priv ; | ||
316 | } ; | ||
317 | |||
318 | /* | ||
319 | * OIDs for statistics | ||
320 | */ | ||
321 | #define SMT_OID_CF_STATE 1 /* fddiSMTCF_State */ | ||
322 | #define SMT_OID_PCM_STATE_A 2 /* fddiPORTPCMState port A */ | ||
323 | #define SMT_OID_PCM_STATE_B 17 /* fddiPORTPCMState port B */ | ||
324 | #define SMT_OID_RMT_STATE 3 /* fddiMACRMTState */ | ||
325 | #define SMT_OID_UNA 4 /* fddiMACUpstreamNbr */ | ||
326 | #define SMT_OID_DNA 5 /* fddiMACOldDownstreamNbr */ | ||
327 | #define SMT_OID_ERROR_CT 6 /* fddiMACError_Ct */ | ||
328 | #define SMT_OID_LOST_CT 7 /* fddiMACLost_Ct */ | ||
329 | #define SMT_OID_LEM_CT 8 /* fddiPORTLem_Ct */ | ||
330 | #define SMT_OID_LEM_CT_A 11 /* fddiPORTLem_Ct port A */ | ||
331 | #define SMT_OID_LEM_CT_B 12 /* fddiPORTLem_Ct port B */ | ||
332 | #define SMT_OID_LCT_FAIL_CT 9 /* fddiPORTLCTFail_Ct */ | ||
333 | #define SMT_OID_LCT_FAIL_CT_A 13 /* fddiPORTLCTFail_Ct port A */ | ||
334 | #define SMT_OID_LCT_FAIL_CT_B 14 /* fddiPORTLCTFail_Ct port B */ | ||
335 | #define SMT_OID_LEM_REJECT_CT 10 /* fddiPORTLem_Reject_Ct */ | ||
336 | #define SMT_OID_LEM_REJECT_CT_A 15 /* fddiPORTLem_Reject_Ct port A */ | ||
337 | #define SMT_OID_LEM_REJECT_CT_B 16 /* fddiPORTLem_Reject_Ct port B */ | ||
338 | |||
339 | /* | ||
340 | * SK MIB | ||
341 | */ | ||
342 | #define SMT_OID_ECF_REQ_RX 20 /* ECF requests received */ | ||
343 | #define SMT_OID_ECF_REPLY_RX 21 /* ECF replies received */ | ||
344 | #define SMT_OID_ECF_REQ_TX 22 /* ECF requests transmitted */ | ||
345 | #define SMT_OID_ECF_REPLY_TX 23 /* ECF replies transmitted */ | ||
346 | #define SMT_OID_PMF_GET_RX 24 /* PMF get requests received */ | ||
347 | #define SMT_OID_PMF_SET_RX 25 /* PMF set requests received */ | ||
348 | #define SMT_OID_RDF_RX 26 /* RDF received */ | ||
349 | #define SMT_OID_RDF_TX 27 /* RDF transmitted */ | ||
diff --git a/drivers/net/skfp/h/fplustm.h b/drivers/net/skfp/h/fplustm.h new file mode 100644 index 000000000000..98bbf654d12f --- /dev/null +++ b/drivers/net/skfp/h/fplustm.h | |||
@@ -0,0 +1,274 @@ | |||
1 | /****************************************************************************** | ||
2 | * | ||
3 | * (C)Copyright 1998,1999 SysKonnect, | ||
4 | * a business unit of Schneider & Koch & Co. Datensysteme GmbH. | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License as published by | ||
8 | * the Free Software Foundation; either version 2 of the License, or | ||
9 | * (at your option) any later version. | ||
10 | * | ||
11 | * The information in this file is provided "AS IS" without warranty. | ||
12 | * | ||
13 | ******************************************************************************/ | ||
14 | |||
15 | /* | ||
16 | * AMD Fplus in tag mode data structs | ||
17 | * defs for fplustm.c | ||
18 | */ | ||
19 | |||
20 | #ifndef _FPLUS_ | ||
21 | #define _FPLUS_ | ||
22 | |||
23 | #ifndef HW_PTR | ||
24 | #define HW_PTR void __iomem * | ||
25 | #endif | ||
26 | |||
27 | /* | ||
28 | * fplus error statistic structure | ||
29 | */ | ||
30 | struct err_st { | ||
31 | u_long err_valid ; /* memory status valid */ | ||
32 | u_long err_abort ; /* memory status receive abort */ | ||
33 | u_long err_e_indicator ; /* error indicator */ | ||
34 | u_long err_crc ; /* error detected (CRC or length) */ | ||
35 | u_long err_llc_frame ; /* LLC frame */ | ||
36 | u_long err_mac_frame ; /* MAC frame */ | ||
37 | u_long err_smt_frame ; /* SMT frame */ | ||
38 | u_long err_imp_frame ; /* implementer frame */ | ||
39 | u_long err_no_buf ; /* no buffer available */ | ||
40 | u_long err_too_long ; /* longer than max. buffer */ | ||
41 | u_long err_bec_stat ; /* beacon state entered */ | ||
42 | u_long err_clm_stat ; /* claim state entered */ | ||
43 | u_long err_sifg_det ; /* short interframe gap detect */ | ||
44 | u_long err_phinv ; /* PHY invalid */ | ||
45 | u_long err_tkiss ; /* token issued */ | ||
46 | u_long err_tkerr ; /* token error */ | ||
47 | } ; | ||
48 | |||
49 | /* | ||
50 | * Transmit Descriptor struct | ||
51 | */ | ||
52 | struct s_smt_fp_txd { | ||
53 | u_int txd_tbctrl ; /* transmit buffer control */ | ||
54 | u_int txd_txdscr ; /* transmit frame status word */ | ||
55 | u_int txd_tbadr ; /* physical tx buffer address */ | ||
56 | u_int txd_ntdadr ; /* physical pointer to the next TxD */ | ||
57 | #ifdef ENA_64BIT_SUP | ||
58 | u_int txd_tbadr_hi ; /* physical tx buffer addr (high dword)*/ | ||
59 | #endif | ||
60 | char far *txd_virt ; /* virtual pointer to the data frag */ | ||
61 | /* virt pointer to the next TxD */ | ||
62 | struct s_smt_fp_txd volatile far *txd_next ; | ||
63 | struct s_txd_os txd_os ; /* OS - specific struct */ | ||
64 | } ; | ||
65 | |||
66 | /* | ||
67 | * Receive Descriptor struct | ||
68 | */ | ||
69 | struct s_smt_fp_rxd { | ||
70 | u_int rxd_rbctrl ; /* receive buffer control */ | ||
71 | u_int rxd_rfsw ; /* receive frame status word */ | ||
72 | u_int rxd_rbadr ; /* physical rx buffer address */ | ||
73 | u_int rxd_nrdadr ; /* physical pointer to the next RxD */ | ||
74 | #ifdef ENA_64BIT_SUP | ||
75 | u_int rxd_rbadr_hi ; /* physical tx buffer addr (high dword)*/ | ||
76 | #endif | ||
77 | char far *rxd_virt ; /* virtual pointer to the data frag */ | ||
78 | /* virt pointer to the next RxD */ | ||
79 | struct s_smt_fp_rxd volatile far *rxd_next ; | ||
80 | struct s_rxd_os rxd_os ; /* OS - specific struct */ | ||
81 | } ; | ||
82 | |||
83 | /* | ||
84 | * Descriptor Union Definition | ||
85 | */ | ||
86 | union s_fp_descr { | ||
87 | struct s_smt_fp_txd t ; /* pointer to the TxD */ | ||
88 | struct s_smt_fp_rxd r ; /* pointer to the RxD */ | ||
89 | } ; | ||
90 | |||
91 | /* | ||
92 | * TxD Ring Control struct | ||
93 | */ | ||
94 | struct s_smt_tx_queue { | ||
95 | struct s_smt_fp_txd volatile *tx_curr_put ; /* next free TxD */ | ||
96 | struct s_smt_fp_txd volatile *tx_prev_put ; /* shadow put pointer */ | ||
97 | struct s_smt_fp_txd volatile *tx_curr_get ; /* next TxD to release*/ | ||
98 | u_short tx_free ; /* count of free TxD's */ | ||
99 | u_short tx_used ; /* count of used TxD's */ | ||
100 | HW_PTR tx_bmu_ctl ; /* BMU addr for tx start */ | ||
101 | HW_PTR tx_bmu_dsc ; /* BMU addr for curr dsc. */ | ||
102 | } ; | ||
103 | |||
104 | /* | ||
105 | * RxD Ring Control struct | ||
106 | */ | ||
107 | struct s_smt_rx_queue { | ||
108 | struct s_smt_fp_rxd volatile *rx_curr_put ; /* next RxD to queue into */ | ||
109 | struct s_smt_fp_rxd volatile *rx_prev_put ; /* shadow put pointer */ | ||
110 | struct s_smt_fp_rxd volatile *rx_curr_get ; /* next RxD to fill */ | ||
111 | u_short rx_free ; /* count of free RxD's */ | ||
112 | u_short rx_used ; /* count of used RxD's */ | ||
113 | HW_PTR rx_bmu_ctl ; /* BMU addr for rx start */ | ||
114 | HW_PTR rx_bmu_dsc ; /* BMU addr for curr dsc. */ | ||
115 | } ; | ||
116 | |||
117 | #define VOID_FRAME_OFF 0x00 | ||
118 | #define CLAIM_FRAME_OFF 0x08 | ||
119 | #define BEACON_FRAME_OFF 0x10 | ||
120 | #define DBEACON_FRAME_OFF 0x18 | ||
121 | #define RX_FIFO_OFF 0x21 /* to get a prime number for */ | ||
122 | /* the RX_FIFO_SPACE */ | ||
123 | |||
124 | #define RBC_MEM_SIZE 0x8000 | ||
125 | #define SEND_ASYNC_AS_SYNC 0x1 | ||
126 | #define SYNC_TRAFFIC_ON 0x2 | ||
127 | |||
128 | /* big FIFO memory */ | ||
129 | #define RX_FIFO_SPACE 0x4000 - RX_FIFO_OFF | ||
130 | #define TX_FIFO_SPACE 0x4000 | ||
131 | |||
132 | #define TX_SMALL_FIFO 0x0900 | ||
133 | #define TX_MEDIUM_FIFO TX_FIFO_SPACE / 2 | ||
134 | #define TX_LARGE_FIFO TX_FIFO_SPACE - TX_SMALL_FIFO | ||
135 | |||
136 | #define RX_SMALL_FIFO 0x0900 | ||
137 | #define RX_LARGE_FIFO RX_FIFO_SPACE - RX_SMALL_FIFO | ||
138 | |||
139 | struct s_smt_fifo_conf { | ||
140 | u_short rbc_ram_start ; /* FIFO start address */ | ||
141 | u_short rbc_ram_end ; /* FIFO size */ | ||
142 | u_short rx1_fifo_start ; /* rx queue start address */ | ||
143 | u_short rx1_fifo_size ; /* rx queue size */ | ||
144 | u_short rx2_fifo_start ; /* rx queue start address */ | ||
145 | u_short rx2_fifo_size ; /* rx queue size */ | ||
146 | u_short tx_s_start ; /* sync queue start address */ | ||
147 | u_short tx_s_size ; /* sync queue size */ | ||
148 | u_short tx_a0_start ; /* async queue A0 start address */ | ||
149 | u_short tx_a0_size ; /* async queue A0 size */ | ||
150 | u_short fifo_config_mode ; /* FIFO configuration mode */ | ||
151 | } ; | ||
152 | |||
153 | #define FM_ADDRX (FM_ADDET|FM_EXGPA0|FM_EXGPA1) | ||
154 | |||
155 | struct s_smt_fp { | ||
156 | u_short mdr2init ; /* mode register 2 init value */ | ||
157 | u_short mdr3init ; /* mode register 3 init value */ | ||
158 | u_short frselreg_init ; /* frame selection register init val */ | ||
159 | u_short rx_mode ; /* address mode broad/multi/promisc */ | ||
160 | u_short nsa_mode ; | ||
161 | u_short rx_prom ; | ||
162 | u_short exgpa ; | ||
163 | |||
164 | struct err_st err_stats ; /* error statistics */ | ||
165 | |||
166 | /* | ||
167 | * MAC buffers | ||
168 | */ | ||
169 | struct fddi_mac_sf { /* special frame build buffer */ | ||
170 | u_char mac_fc ; | ||
171 | struct fddi_addr mac_dest ; | ||
172 | struct fddi_addr mac_source ; | ||
173 | u_char mac_info[0x20] ; | ||
174 | } mac_sfb ; | ||
175 | |||
176 | |||
177 | /* | ||
178 | * queues | ||
179 | */ | ||
180 | #define QUEUE_S 0 | ||
181 | #define QUEUE_A0 1 | ||
182 | #define QUEUE_R1 0 | ||
183 | #define QUEUE_R2 1 | ||
184 | #define USED_QUEUES 2 | ||
185 | |||
186 | /* | ||
187 | * queue pointers; points to the queue dependent variables | ||
188 | */ | ||
189 | struct s_smt_tx_queue *tx[USED_QUEUES] ; | ||
190 | struct s_smt_rx_queue *rx[USED_QUEUES] ; | ||
191 | |||
192 | /* | ||
193 | * queue dependent variables | ||
194 | */ | ||
195 | struct s_smt_tx_queue tx_q[USED_QUEUES] ; | ||
196 | struct s_smt_rx_queue rx_q[USED_QUEUES] ; | ||
197 | |||
198 | /* | ||
199 | * FIFO configuration struct | ||
200 | */ | ||
201 | struct s_smt_fifo_conf fifo ; | ||
202 | |||
203 | /* last formac status */ | ||
204 | u_short s2u ; | ||
205 | u_short s2l ; | ||
206 | |||
207 | /* calculated FORMAC+ reg.addr. */ | ||
208 | HW_PTR fm_st1u ; | ||
209 | HW_PTR fm_st1l ; | ||
210 | HW_PTR fm_st2u ; | ||
211 | HW_PTR fm_st2l ; | ||
212 | HW_PTR fm_st3u ; | ||
213 | HW_PTR fm_st3l ; | ||
214 | |||
215 | |||
216 | /* | ||
217 | * multicast table | ||
218 | */ | ||
219 | #define FPMAX_MULTICAST 32 | ||
220 | #define SMT_MAX_MULTI 4 | ||
221 | struct { | ||
222 | struct s_fpmc { | ||
223 | struct fddi_addr a ; /* mc address */ | ||
224 | u_char n ; /* usage counter */ | ||
225 | u_char perm ; /* flag: permanent */ | ||
226 | } table[FPMAX_MULTICAST] ; | ||
227 | } mc ; | ||
228 | struct fddi_addr group_addr ; | ||
229 | u_long func_addr ; /* functional address */ | ||
230 | int smt_slots_used ; /* count of table entries for the SMT */ | ||
231 | int os_slots_used ; /* count of table entries */ | ||
232 | /* used by the os-specific module */ | ||
233 | } ; | ||
234 | |||
235 | /* | ||
236 | * modes for mac_set_rx_mode() | ||
237 | */ | ||
238 | #define RX_ENABLE_ALLMULTI 1 /* enable all multicasts */ | ||
239 | #define RX_DISABLE_ALLMULTI 2 /* disable "enable all multicasts" */ | ||
240 | #define RX_ENABLE_PROMISC 3 /* enable promiscous */ | ||
241 | #define RX_DISABLE_PROMISC 4 /* disable promiscous */ | ||
242 | #define RX_ENABLE_NSA 5 /* enable reception of NSA frames */ | ||
243 | #define RX_DISABLE_NSA 6 /* disable reception of NSA frames */ | ||
244 | |||
245 | |||
246 | /* | ||
247 | * support for byte reversal in AIX | ||
248 | * (descriptors and pointers must be byte reversed in memory | ||
249 | * CPU is big endian; M-Channel is little endian) | ||
250 | */ | ||
251 | #ifdef AIX | ||
252 | #define MDR_REV | ||
253 | #define AIX_REVERSE(x) ((((x)<<24L)&0xff000000L) + \ | ||
254 | (((x)<< 8L)&0x00ff0000L) + \ | ||
255 | (((x)>> 8L)&0x0000ff00L) + \ | ||
256 | (((x)>>24L)&0x000000ffL)) | ||
257 | #else | ||
258 | #ifndef AIX_REVERSE | ||
259 | #define AIX_REVERSE(x) (x) | ||
260 | #endif | ||
261 | #endif | ||
262 | |||
263 | #ifdef MDR_REV | ||
264 | #define MDR_REVERSE(x) ((((x)<<24L)&0xff000000L) + \ | ||
265 | (((x)<< 8L)&0x00ff0000L) + \ | ||
266 | (((x)>> 8L)&0x0000ff00L) + \ | ||
267 | (((x)>>24L)&0x000000ffL)) | ||
268 | #else | ||
269 | #ifndef MDR_REVERSE | ||
270 | #define MDR_REVERSE(x) (x) | ||
271 | #endif | ||
272 | #endif | ||
273 | |||
274 | #endif | ||
diff --git a/drivers/net/skfp/h/hwmtm.h b/drivers/net/skfp/h/hwmtm.h new file mode 100644 index 000000000000..4e360af07d77 --- /dev/null +++ b/drivers/net/skfp/h/hwmtm.h | |||
@@ -0,0 +1,424 @@ | |||
1 | /****************************************************************************** | ||
2 | * | ||
3 | * (C)Copyright 1998,1999 SysKonnect, | ||
4 | * a business unit of Schneider & Koch & Co. Datensysteme GmbH. | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License as published by | ||
8 | * the Free Software Foundation; either version 2 of the License, or | ||
9 | * (at your option) any later version. | ||
10 | * | ||
11 | * The information in this file is provided "AS IS" without warranty. | ||
12 | * | ||
13 | ******************************************************************************/ | ||
14 | |||
15 | #ifndef _HWM_ | ||
16 | #define _HWM_ | ||
17 | |||
18 | #include "h/mbuf.h" | ||
19 | |||
20 | /* | ||
21 | * MACRO for DMA synchronization: | ||
22 | * The descriptor 'desc' is flushed for the device 'flag'. | ||
23 | * Devices are the CPU (DDI_DMA_SYNC_FORCPU) and the | ||
24 | * adapter (DDI_DMA_SYNC_FORDEV). | ||
25 | * | ||
26 | * 'desc' Pointer to a Rx or Tx descriptor. | ||
27 | * 'flag' Flag for direction (view for CPU or DEVICE) that | ||
28 | * should be synchronized. | ||
29 | * | ||
30 | * Empty macros and defines are specified here. The real macro | ||
31 | * is os-specific and should be defined in osdef1st.h. | ||
32 | */ | ||
33 | #ifndef DRV_BUF_FLUSH | ||
34 | #define DRV_BUF_FLUSH(desc,flag) | ||
35 | #define DDI_DMA_SYNC_FORCPU | ||
36 | #define DDI_DMA_SYNC_FORDEV | ||
37 | #endif | ||
38 | |||
39 | /* | ||
40 | * hardware modul dependent receive modes | ||
41 | */ | ||
42 | #define RX_ENABLE_PASS_SMT 21 | ||
43 | #define RX_DISABLE_PASS_SMT 22 | ||
44 | #define RX_ENABLE_PASS_NSA 23 | ||
45 | #define RX_DISABLE_PASS_NSA 24 | ||
46 | #define RX_ENABLE_PASS_DB 25 | ||
47 | #define RX_DISABLE_PASS_DB 26 | ||
48 | #define RX_DISABLE_PASS_ALL 27 | ||
49 | #define RX_DISABLE_LLC_PROMISC 28 | ||
50 | #define RX_ENABLE_LLC_PROMISC 29 | ||
51 | |||
52 | |||
53 | #ifndef DMA_RD | ||
54 | #define DMA_RD 1 /* memory -> hw */ | ||
55 | #endif | ||
56 | #ifndef DMA_WR | ||
57 | #define DMA_WR 2 /* hw -> memory */ | ||
58 | #endif | ||
59 | #define SMT_BUF 0x80 | ||
60 | |||
61 | /* | ||
62 | * bits of the frame status byte | ||
63 | */ | ||
64 | #define EN_IRQ_EOF 0x02 /* get IRQ after end of frame transmission */ | ||
65 | #define LOC_TX 0x04 /* send frame to the local SMT */ | ||
66 | #define LAST_FRAG 0x08 /* last TxD of the frame */ | ||
67 | #define FIRST_FRAG 0x10 /* first TxD of the frame */ | ||
68 | #define LAN_TX 0x20 /* send frame to network if set */ | ||
69 | #define RING_DOWN 0x40 /* error: unable to send, ring down */ | ||
70 | #define OUT_OF_TXD 0x80 /* error: not enough TxDs available */ | ||
71 | |||
72 | |||
73 | #ifndef NULL | ||
74 | #define NULL 0 | ||
75 | #endif | ||
76 | |||
77 | #ifdef LITTLE_ENDIAN | ||
78 | #define HWM_REVERSE(x) (x) | ||
79 | #else | ||
80 | #define HWM_REVERSE(x) ((((x)<<24L)&0xff000000L) + \ | ||
81 | (((x)<< 8L)&0x00ff0000L) + \ | ||
82 | (((x)>> 8L)&0x0000ff00L) + \ | ||
83 | (((x)>>24L)&0x000000ffL)) | ||
84 | #endif | ||
85 | |||
86 | #define C_INDIC (1L<<25) | ||
87 | #define A_INDIC (1L<<26) | ||
88 | #define RD_FS_LOCAL 0x80 | ||
89 | |||
90 | /* | ||
91 | * DEBUG FLAGS | ||
92 | */ | ||
93 | #define DEBUG_SMTF 1 | ||
94 | #define DEBUG_SMT 2 | ||
95 | #define DEBUG_ECM 3 | ||
96 | #define DEBUG_RMT 4 | ||
97 | #define DEBUG_CFM 5 | ||
98 | #define DEBUG_PCM 6 | ||
99 | #define DEBUG_SBA 7 | ||
100 | #define DEBUG_ESS 8 | ||
101 | |||
102 | #define DB_HWM_RX 10 | ||
103 | #define DB_HWM_TX 11 | ||
104 | #define DB_HWM_GEN 12 | ||
105 | |||
106 | struct s_mbuf_pool { | ||
107 | #ifndef MB_OUTSIDE_SMC | ||
108 | SMbuf mb[MAX_MBUF] ; /* mbuf pool */ | ||
109 | #endif | ||
110 | SMbuf *mb_start ; /* points to the first mb */ | ||
111 | SMbuf *mb_free ; /* free queue */ | ||
112 | } ; | ||
113 | |||
114 | struct hwm_r { | ||
115 | /* | ||
116 | * hardware modul specific receive variables | ||
117 | */ | ||
118 | u_int len ; /* length of the whole frame */ | ||
119 | char *mb_pos ; /* SMbuf receive position */ | ||
120 | } ; | ||
121 | |||
122 | struct hw_modul { | ||
123 | /* | ||
124 | * All hardware modul specific variables | ||
125 | */ | ||
126 | struct s_mbuf_pool mbuf_pool ; | ||
127 | struct hwm_r r ; | ||
128 | |||
129 | union s_fp_descr volatile *descr_p ; /* points to the desriptor area */ | ||
130 | |||
131 | u_short pass_SMT ; /* pass SMT frames */ | ||
132 | u_short pass_NSA ; /* pass all NSA frames */ | ||
133 | u_short pass_DB ; /* pass Direct Beacon Frames */ | ||
134 | u_short pass_llc_promisc ; /* pass all llc frames (default ON) */ | ||
135 | |||
136 | SMbuf *llc_rx_pipe ; /* points to the first queued llc fr */ | ||
137 | SMbuf *llc_rx_tail ; /* points to the last queued llc fr */ | ||
138 | int queued_rx_frames ; /* number of queued frames */ | ||
139 | |||
140 | SMbuf *txd_tx_pipe ; /* points to first mb in the txd ring */ | ||
141 | SMbuf *txd_tx_tail ; /* points to last mb in the txd ring */ | ||
142 | int queued_txd_mb ; /* number of SMT MBufs in txd ring */ | ||
143 | |||
144 | int rx_break ; /* rev. was breaked because ind. off */ | ||
145 | int leave_isr ; /* leave fddi_isr immedeately if set */ | ||
146 | int isr_flag ; /* set, when HWM is entered from isr */ | ||
147 | /* | ||
148 | * varaibles for the current transmit frame | ||
149 | */ | ||
150 | struct s_smt_tx_queue *tx_p ; /* pointer to the transmit queue */ | ||
151 | u_long tx_descr ; /* tx descriptor for FORMAC+ */ | ||
152 | int tx_len ; /* tx frame length */ | ||
153 | SMbuf *tx_mb ; /* SMT tx MBuf pointer */ | ||
154 | char *tx_data ; /* data pointer to the SMT tx Mbuf */ | ||
155 | |||
156 | int detec_count ; /* counter for out of RxD condition */ | ||
157 | u_long rx_len_error ; /* rx len FORMAC != sum of fragments */ | ||
158 | } ; | ||
159 | |||
160 | |||
161 | /* | ||
162 | * DEBUG structs and macros | ||
163 | */ | ||
164 | |||
165 | #ifdef DEBUG | ||
166 | struct os_debug { | ||
167 | int hwm_rx ; | ||
168 | int hwm_tx ; | ||
169 | int hwm_gen ; | ||
170 | } ; | ||
171 | #endif | ||
172 | |||
173 | #ifdef DEBUG | ||
174 | #ifdef DEBUG_BRD | ||
175 | #define DB_P smc->debug | ||
176 | #else | ||
177 | #define DB_P debug | ||
178 | #endif | ||
179 | |||
180 | #define DB_RX(a,b,c,lev) if (DB_P.d_os.hwm_rx >= (lev)) printf(a,b,c) | ||
181 | #define DB_TX(a,b,c,lev) if (DB_P.d_os.hwm_tx >= (lev)) printf(a,b,c) | ||
182 | #define DB_GEN(a,b,c,lev) if (DB_P.d_os.hwm_gen >= (lev)) printf(a,b,c) | ||
183 | #else /* DEBUG */ | ||
184 | #define DB_RX(a,b,c,lev) | ||
185 | #define DB_TX(a,b,c,lev) | ||
186 | #define DB_GEN(a,b,c,lev) | ||
187 | #endif /* DEBUG */ | ||
188 | |||
189 | #ifndef SK_BREAK | ||
190 | #define SK_BREAK() | ||
191 | #endif | ||
192 | |||
193 | |||
194 | /* | ||
195 | * HWM Macros | ||
196 | */ | ||
197 | |||
198 | /* | ||
199 | * BEGIN_MANUAL_ENTRY(HWM_GET_TX_PHYS) | ||
200 | * u_long HWM_GET_TX_PHYS(txd) | ||
201 | * | ||
202 | * function MACRO (hardware module, hwmtm.h) | ||
203 | * This macro may be invoked by the OS-specific module to read | ||
204 | * the physical address of the specified TxD. | ||
205 | * | ||
206 | * para txd pointer to the TxD | ||
207 | * | ||
208 | * END_MANUAL_ENTRY | ||
209 | */ | ||
210 | #define HWM_GET_TX_PHYS(txd) (u_long)AIX_REVERSE((txd)->txd_tbadr) | ||
211 | |||
212 | /* | ||
213 | * BEGIN_MANUAL_ENTRY(HWM_GET_TX_LEN) | ||
214 | * int HWM_GET_TX_LEN(txd) | ||
215 | * | ||
216 | * function MACRO (hardware module, hwmtm.h) | ||
217 | * This macro may be invoked by the OS-specific module to read | ||
218 | * the fragment length of the specified TxD | ||
219 | * | ||
220 | * para rxd pointer to the TxD | ||
221 | * | ||
222 | * return the length of the fragment in bytes | ||
223 | * | ||
224 | * END_MANUAL_ENTRY | ||
225 | */ | ||
226 | #define HWM_GET_TX_LEN(txd) ((int)AIX_REVERSE((txd)->txd_tbctrl)& RD_LENGTH) | ||
227 | |||
228 | /* | ||
229 | * BEGIN_MANUAL_ENTRY(HWM_GET_TX_USED) | ||
230 | * txd *HWM_GET_TX_USED(smc,queue) | ||
231 | * | ||
232 | * function MACRO (hardware module, hwmtm.h) | ||
233 | * This macro may be invoked by the OS-specific module to get the | ||
234 | * number of used TxDs for the queue, specified by the index. | ||
235 | * | ||
236 | * para queue the number of the send queue: Can be specified by | ||
237 | * QUEUE_A0, QUEUE_S or (frame_status & QUEUE_A0) | ||
238 | * | ||
239 | * return number of used TxDs for this send queue | ||
240 | * | ||
241 | * END_MANUAL_ENTRY | ||
242 | */ | ||
243 | #define HWM_GET_TX_USED(smc,queue) (int) (smc)->hw.fp.tx_q[queue].tx_used | ||
244 | |||
245 | /* | ||
246 | * BEGIN_MANUAL_ENTRY(HWM_GET_CURR_TXD) | ||
247 | * txd *HWM_GET_CURR_TXD(smc,queue) | ||
248 | * | ||
249 | * function MACRO (hardware module, hwmtm.h) | ||
250 | * This macro may be invoked by the OS-specific module to get the | ||
251 | * pointer to the TxD which points to the current queue put | ||
252 | * position. | ||
253 | * | ||
254 | * para queue the number of the send queue: Can be specified by | ||
255 | * QUEUE_A0, QUEUE_S or (frame_status & QUEUE_A0) | ||
256 | * | ||
257 | * return pointer to the current TxD | ||
258 | * | ||
259 | * END_MANUAL_ENTRY | ||
260 | */ | ||
261 | #define HWM_GET_CURR_TXD(smc,queue) (struct s_smt_fp_txd volatile *)\ | ||
262 | (smc)->hw.fp.tx_q[queue].tx_curr_put | ||
263 | |||
264 | /* | ||
265 | * BEGIN_MANUAL_ENTRY(HWM_TX_CHECK) | ||
266 | * void HWM_TX_CHECK(smc,frame_status,low_water) | ||
267 | * | ||
268 | * function MACRO (hardware module, hwmtm.h) | ||
269 | * This macro is invoked by the OS-specific before it left it's | ||
270 | * driver_send function. This macro calls mac_drv_clear_txd | ||
271 | * if the free TxDs of the current transmit queue is equal or | ||
272 | * lower than the given low water mark. | ||
273 | * | ||
274 | * para frame_status status of the frame, see design description | ||
275 | * low_water low water mark of free TxD's | ||
276 | * | ||
277 | * END_MANUAL_ENTRY | ||
278 | */ | ||
279 | #ifndef HWM_NO_FLOW_CTL | ||
280 | #define HWM_TX_CHECK(smc,frame_status,low_water) {\ | ||
281 | if ((low_water)>=(smc)->hw.fp.tx_q[(frame_status)&QUEUE_A0].tx_free) {\ | ||
282 | mac_drv_clear_txd(smc) ;\ | ||
283 | }\ | ||
284 | } | ||
285 | #else | ||
286 | #define HWM_TX_CHECK(smc,frame_status,low_water) mac_drv_clear_txd(smc) | ||
287 | #endif | ||
288 | |||
289 | /* | ||
290 | * BEGIN_MANUAL_ENTRY(HWM_GET_RX_FRAG_LEN) | ||
291 | * int HWM_GET_RX_FRAG_LEN(rxd) | ||
292 | * | ||
293 | * function MACRO (hardware module, hwmtm.h) | ||
294 | * This macro may be invoked by the OS-specific module to read | ||
295 | * the fragment length of the specified RxD | ||
296 | * | ||
297 | * para rxd pointer to the RxD | ||
298 | * | ||
299 | * return the length of the fragment in bytes | ||
300 | * | ||
301 | * END_MANUAL_ENTRY | ||
302 | */ | ||
303 | #define HWM_GET_RX_FRAG_LEN(rxd) ((int)AIX_REVERSE((rxd)->rxd_rbctrl)& \ | ||
304 | RD_LENGTH) | ||
305 | |||
306 | /* | ||
307 | * BEGIN_MANUAL_ENTRY(HWM_GET_RX_PHYS) | ||
308 | * u_long HWM_GET_RX_PHYS(rxd) | ||
309 | * | ||
310 | * function MACRO (hardware module, hwmtm.h) | ||
311 | * This macro may be invoked by the OS-specific module to read | ||
312 | * the physical address of the specified RxD. | ||
313 | * | ||
314 | * para rxd pointer to the RxD | ||
315 | * | ||
316 | * return the RxD's physical pointer to the data fragment | ||
317 | * | ||
318 | * END_MANUAL_ENTRY | ||
319 | */ | ||
320 | #define HWM_GET_RX_PHYS(rxd) (u_long)AIX_REVERSE((rxd)->rxd_rbadr) | ||
321 | |||
322 | /* | ||
323 | * BEGIN_MANUAL_ENTRY(HWM_GET_RX_USED) | ||
324 | * int HWM_GET_RX_USED(smc) | ||
325 | * | ||
326 | * function MACRO (hardware module, hwmtm.h) | ||
327 | * This macro may be invoked by the OS-specific module to get | ||
328 | * the count of used RXDs in receive queue 1. | ||
329 | * | ||
330 | * return the used RXD count of receive queue 1 | ||
331 | * | ||
332 | * NOTE: Remember, because of an ASIC bug at least one RXD should be unused | ||
333 | * in the descriptor ring ! | ||
334 | * | ||
335 | * END_MANUAL_ENTRY | ||
336 | */ | ||
337 | #define HWM_GET_RX_USED(smc) ((int)(smc)->hw.fp.rx_q[QUEUE_R1].rx_used) | ||
338 | |||
339 | /* | ||
340 | * BEGIN_MANUAL_ENTRY(HWM_GET_RX_FREE) | ||
341 | * int HWM_GET_RX_FREE(smc) | ||
342 | * | ||
343 | * function MACRO (hardware module, hwmtm.h) | ||
344 | * This macro may be invoked by the OS-specific module to get | ||
345 | * the rxd_free count of receive queue 1. | ||
346 | * | ||
347 | * return the rxd_free count of receive queue 1 | ||
348 | * | ||
349 | * END_MANUAL_ENTRY | ||
350 | */ | ||
351 | #define HWM_GET_RX_FREE(smc) ((int)(smc)->hw.fp.rx_q[QUEUE_R1].rx_free-1) | ||
352 | |||
353 | /* | ||
354 | * BEGIN_MANUAL_ENTRY(HWM_GET_CURR_RXD) | ||
355 | * rxd *HWM_GET_CURR_RXD(smc) | ||
356 | * | ||
357 | * function MACRO (hardware module, hwmtm.h) | ||
358 | * This macro may be invoked by the OS-specific module to get the | ||
359 | * pointer to the RxD which points to the current queue put | ||
360 | * position. | ||
361 | * | ||
362 | * return pointer to the current RxD | ||
363 | * | ||
364 | * END_MANUAL_ENTRY | ||
365 | */ | ||
366 | #define HWM_GET_CURR_RXD(smc) (struct s_smt_fp_rxd volatile *)\ | ||
367 | (smc)->hw.fp.rx_q[QUEUE_R1].rx_curr_put | ||
368 | |||
369 | /* | ||
370 | * BEGIN_MANUAL_ENTRY(HWM_RX_CHECK) | ||
371 | * void HWM_RX_CHECK(smc,low_water) | ||
372 | * | ||
373 | * function MACRO (hardware module, hwmtm.h) | ||
374 | * This macro is invoked by the OS-specific before it left the | ||
375 | * function mac_drv_rx_complete. This macro calls mac_drv_fill_rxd | ||
376 | * if the number of used RxDs is equal or lower than the | ||
377 | * the given low water mark. | ||
378 | * | ||
379 | * para low_water low water mark of used RxD's | ||
380 | * | ||
381 | * END_MANUAL_ENTRY | ||
382 | */ | ||
383 | #ifndef HWM_NO_FLOW_CTL | ||
384 | #define HWM_RX_CHECK(smc,low_water) {\ | ||
385 | if ((low_water) >= (smc)->hw.fp.rx_q[QUEUE_R1].rx_used) {\ | ||
386 | mac_drv_fill_rxd(smc) ;\ | ||
387 | }\ | ||
388 | } | ||
389 | #else | ||
390 | #define HWM_RX_CHECK(smc,low_water) mac_drv_fill_rxd(smc) | ||
391 | #endif | ||
392 | |||
393 | #ifndef HWM_EBASE | ||
394 | #define HWM_EBASE 500 | ||
395 | #endif | ||
396 | |||
397 | #define HWM_E0001 HWM_EBASE + 1 | ||
398 | #define HWM_E0001_MSG "HWM: Wrong size of s_rxd_os struct" | ||
399 | #define HWM_E0002 HWM_EBASE + 2 | ||
400 | #define HWM_E0002_MSG "HWM: Wrong size of s_txd_os struct" | ||
401 | #define HWM_E0003 HWM_EBASE + 3 | ||
402 | #define HWM_E0003_MSG "HWM: smt_free_mbuf() called with NULL pointer" | ||
403 | #define HWM_E0004 HWM_EBASE + 4 | ||
404 | #define HWM_E0004_MSG "HWM: Parity error rx queue 1" | ||
405 | #define HWM_E0005 HWM_EBASE + 5 | ||
406 | #define HWM_E0005_MSG "HWM: Encoding error rx queue 1" | ||
407 | #define HWM_E0006 HWM_EBASE + 6 | ||
408 | #define HWM_E0006_MSG "HWM: Encoding error async tx queue" | ||
409 | #define HWM_E0007 HWM_EBASE + 7 | ||
410 | #define HWM_E0007_MSG "HWM: Encoding error sync tx queue" | ||
411 | #define HWM_E0008 HWM_EBASE + 8 | ||
412 | #define HWM_E0008_MSG "" | ||
413 | #define HWM_E0009 HWM_EBASE + 9 | ||
414 | #define HWM_E0009_MSG "HWM: Out of RxD condition detected" | ||
415 | #define HWM_E0010 HWM_EBASE + 10 | ||
416 | #define HWM_E0010_MSG "HWM: A protocol layer has tried to send a frame with an invalid frame control" | ||
417 | #define HWM_E0011 HWM_EBASE + 11 | ||
418 | #define HWM_E0011_MSG "HWM: mac_drv_clear_tx_queue was called although the hardware wasn't stopped" | ||
419 | #define HWM_E0012 HWM_EBASE + 12 | ||
420 | #define HWM_E0012_MSG "HWM: mac_drv_clear_rx_queue was called although the hardware wasn't stopped" | ||
421 | #define HWM_E0013 HWM_EBASE + 13 | ||
422 | #define HWM_E0013_MSG "HWM: mac_drv_repair_descr was called although the hardware wasn't stopped" | ||
423 | |||
424 | #endif | ||
diff --git a/drivers/net/skfp/h/lnkstat.h b/drivers/net/skfp/h/lnkstat.h new file mode 100644 index 000000000000..c73dcd96a40f --- /dev/null +++ b/drivers/net/skfp/h/lnkstat.h | |||
@@ -0,0 +1,84 @@ | |||
1 | /****************************************************************************** | ||
2 | * | ||
3 | * (C)Copyright 1998,1999 SysKonnect, | ||
4 | * a business unit of Schneider & Koch & Co. Datensysteme GmbH. | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License as published by | ||
8 | * the Free Software Foundation; either version 2 of the License, or | ||
9 | * (at your option) any later version. | ||
10 | * | ||
11 | * The information in this file is provided "AS IS" without warranty. | ||
12 | * | ||
13 | ******************************************************************************/ | ||
14 | |||
15 | /* | ||
16 | * Definition of the Error Log Structure | ||
17 | * This structure will be copied into the Error Log buffer | ||
18 | * during the NDIS General Request ReadErrorLog by the MAC Driver | ||
19 | */ | ||
20 | |||
21 | struct s_error_log { | ||
22 | |||
23 | /* | ||
24 | * place holder for token ring adapter error log (zeros) | ||
25 | */ | ||
26 | u_char reserved_0 ; /* byte 0 inside Error Log */ | ||
27 | u_char reserved_1 ; /* byte 1 */ | ||
28 | u_char reserved_2 ; /* byte 2 */ | ||
29 | u_char reserved_3 ; /* byte 3 */ | ||
30 | u_char reserved_4 ; /* byte 4 */ | ||
31 | u_char reserved_5 ; /* byte 5 */ | ||
32 | u_char reserved_6 ; /* byte 6 */ | ||
33 | u_char reserved_7 ; /* byte 7 */ | ||
34 | u_char reserved_8 ; /* byte 8 */ | ||
35 | u_char reserved_9 ; /* byte 9 */ | ||
36 | u_char reserved_10 ; /* byte 10 */ | ||
37 | u_char reserved_11 ; /* byte 11 */ | ||
38 | u_char reserved_12 ; /* byte 12 */ | ||
39 | u_char reserved_13 ; /* byte 13 */ | ||
40 | |||
41 | /* | ||
42 | * FDDI link statistics | ||
43 | */ | ||
44 | /* | ||
45 | * smt error low | ||
46 | */ | ||
47 | #define SMT_ERL_AEB (1<<15) /* A elast. buffer */ | ||
48 | #define SMT_ERL_BLC (1<<14) /* B link error condition */ | ||
49 | #define SMT_ERL_ALC (1<<13) /* A link error condition */ | ||
50 | #define SMT_ERL_NCC (1<<12) /* not copied condition */ | ||
51 | #define SMT_ERL_FEC (1<<11) /* frame error condition */ | ||
52 | |||
53 | /* | ||
54 | * smt event low | ||
55 | */ | ||
56 | #define SMT_EVL_NCE (1<<5) | ||
57 | |||
58 | u_short smt_error_low ; /* byte 14/15 */ | ||
59 | u_short smt_error_high ; /* byte 16/17 */ | ||
60 | u_short smt_event_low ; /* byte 18/19 */ | ||
61 | u_short smt_event_high ; /* byte 20/21 */ | ||
62 | u_short connection_policy_violation ; /* byte 22/23 */ | ||
63 | u_short port_event ; /* byte 24/25 */ | ||
64 | u_short set_count_low ; /* byte 26/27 */ | ||
65 | u_short set_count_high ; /* byte 28/29 */ | ||
66 | u_short aci_id_code ; /* byte 30/31 */ | ||
67 | u_short purge_frame_counter ; /* byte 32/33 */ | ||
68 | |||
69 | /* | ||
70 | * CMT and RMT state machines | ||
71 | */ | ||
72 | u_short ecm_state ; /* byte 34/35 */ | ||
73 | u_short pcm_a_state ; /* byte 36/37 */ | ||
74 | u_short pcm_b_state ; /* byte 38/39 */ | ||
75 | u_short cfm_state ; /* byte 40/41 */ | ||
76 | u_short rmt_state ; /* byte 42/43 */ | ||
77 | |||
78 | u_short not_used[30] ; /* byte 44-103 */ | ||
79 | |||
80 | u_short ucode_version_level ; /* byte 104/105 */ | ||
81 | |||
82 | u_short not_used_1 ; /* byte 106/107 */ | ||
83 | u_short not_used_2 ; /* byte 108/109 */ | ||
84 | } ; | ||
diff --git a/drivers/net/skfp/h/mbuf.h b/drivers/net/skfp/h/mbuf.h new file mode 100644 index 000000000000..b339d1f2e0e5 --- /dev/null +++ b/drivers/net/skfp/h/mbuf.h | |||
@@ -0,0 +1,54 @@ | |||
1 | /****************************************************************************** | ||
2 | * | ||
3 | * (C)Copyright 1998,1999 SysKonnect, | ||
4 | * a business unit of Schneider & Koch & Co. Datensysteme GmbH. | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License as published by | ||
8 | * the Free Software Foundation; either version 2 of the License, or | ||
9 | * (at your option) any later version. | ||
10 | * | ||
11 | * The information in this file is provided "AS IS" without warranty. | ||
12 | * | ||
13 | ******************************************************************************/ | ||
14 | |||
15 | #ifndef _MBUF_ | ||
16 | #define _MBUF_ | ||
17 | |||
18 | #ifndef PCI | ||
19 | #define M_SIZE 4550 | ||
20 | #else | ||
21 | #define M_SIZE 4504 | ||
22 | #endif | ||
23 | |||
24 | #ifndef MAX_MBUF | ||
25 | #define MAX_MBUF 4 | ||
26 | #endif | ||
27 | |||
28 | #ifndef NO_STD_MBUF | ||
29 | #define sm_next m_next | ||
30 | #define sm_off m_off | ||
31 | #define sm_len m_len | ||
32 | #define sm_data m_data | ||
33 | #define SMbuf Mbuf | ||
34 | #define mtod smtod | ||
35 | #define mtodoff smtodoff | ||
36 | #endif | ||
37 | |||
38 | struct s_mbuf { | ||
39 | struct s_mbuf *sm_next ; /* low level linked list */ | ||
40 | short sm_off ; /* offset in m_data */ | ||
41 | u_int sm_len ; /* len of data */ | ||
42 | #ifdef PCI | ||
43 | int sm_use_count ; | ||
44 | #endif | ||
45 | char sm_data[M_SIZE] ; | ||
46 | } ; | ||
47 | |||
48 | typedef struct s_mbuf SMbuf ; | ||
49 | |||
50 | /* mbuf head, to typed data */ | ||
51 | #define smtod(x,t) ((t)((x)->sm_data + (x)->sm_off)) | ||
52 | #define smtodoff(x,t,o) ((t)((x)->sm_data + (o))) | ||
53 | |||
54 | #endif /* _MBUF_ */ | ||
diff --git a/drivers/net/skfp/h/osdef1st.h b/drivers/net/skfp/h/osdef1st.h new file mode 100644 index 000000000000..5359eb53008d --- /dev/null +++ b/drivers/net/skfp/h/osdef1st.h | |||
@@ -0,0 +1,123 @@ | |||
1 | /****************************************************************************** | ||
2 | * | ||
3 | * (C)Copyright 1998,1999 SysKonnect, | ||
4 | * a business unit of Schneider & Koch & Co. Datensysteme GmbH. | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License as published by | ||
8 | * the Free Software Foundation; either version 2 of the License, or | ||
9 | * (at your option) any later version. | ||
10 | * | ||
11 | * The information in this file is provided "AS IS" without warranty. | ||
12 | * | ||
13 | ******************************************************************************/ | ||
14 | |||
15 | /* | ||
16 | * Operating system-dependent definitions that have to be defined | ||
17 | * before any other header files are included. | ||
18 | */ | ||
19 | |||
20 | // HWM (HardWare Module) Definitions | ||
21 | // ----------------------- | ||
22 | |||
23 | #ifdef __LITTLE_ENDIAN | ||
24 | #define LITTLE_ENDIAN | ||
25 | #else | ||
26 | #define BIG_ENDIAN | ||
27 | #endif | ||
28 | |||
29 | // this is set in the makefile | ||
30 | // #define PCI /* only PCI adapters supported by this driver */ | ||
31 | // #define MEM_MAPPED_IO /* use memory mapped I/O */ | ||
32 | |||
33 | |||
34 | #define USE_CAN_ADDR /* DA and SA in MAC header are canonical. */ | ||
35 | |||
36 | #define MB_OUTSIDE_SMC /* SMT Mbufs outside of smc struct. */ | ||
37 | |||
38 | // ----------------------- | ||
39 | |||
40 | |||
41 | // SMT Definitions | ||
42 | // ----------------------- | ||
43 | #define SYNC /* allow synchronous frames */ | ||
44 | |||
45 | // #define SBA /* Synchronous Bandwidth Allocator support */ | ||
46 | /* not available as free source */ | ||
47 | |||
48 | #define ESS /* SBA End Station Support */ | ||
49 | |||
50 | #define SMT_PANIC(smc, nr, msg) printk(KERN_INFO "SMT PANIC: code: %d, msg: %s\n",nr,msg) | ||
51 | |||
52 | |||
53 | #ifdef DEBUG | ||
54 | #define printf(s,args...) printk(KERN_INFO s, ## args) | ||
55 | #endif | ||
56 | |||
57 | // #define HW_PTR u_long | ||
58 | // ----------------------- | ||
59 | |||
60 | |||
61 | |||
62 | // HWM and OS-specific buffer definitions | ||
63 | // ----------------------- | ||
64 | |||
65 | // default number of receive buffers. | ||
66 | #define NUM_RECEIVE_BUFFERS 10 | ||
67 | |||
68 | // default number of transmit buffers. | ||
69 | #define NUM_TRANSMIT_BUFFERS 10 | ||
70 | |||
71 | // Number of SMT buffers (Mbufs). | ||
72 | #define NUM_SMT_BUF 4 | ||
73 | |||
74 | // Number of TXDs for asynchronous transmit queue. | ||
75 | #define HWM_ASYNC_TXD_COUNT (NUM_TRANSMIT_BUFFERS + NUM_SMT_BUF) | ||
76 | |||
77 | // Number of TXDs for synchronous transmit queue. | ||
78 | #define HWM_SYNC_TXD_COUNT HWM_ASYNC_TXD_COUNT | ||
79 | |||
80 | |||
81 | // Number of RXDs for receive queue #1. | ||
82 | // Note: Workaround for ASIC Errata #7: One extra RXD is required. | ||
83 | #if (NUM_RECEIVE_BUFFERS > 100) | ||
84 | #define SMT_R1_RXD_COUNT (1 + 100) | ||
85 | #else | ||
86 | #define SMT_R1_RXD_COUNT (1 + NUM_RECEIVE_BUFFERS) | ||
87 | #endif | ||
88 | |||
89 | // Number of RXDs for receive queue #2. | ||
90 | #define SMT_R2_RXD_COUNT 0 // Not used. | ||
91 | // ----------------------- | ||
92 | |||
93 | |||
94 | |||
95 | /* | ||
96 | * OS-specific part of the transmit/receive descriptor structure (TXD/RXD). | ||
97 | * | ||
98 | * Note: The size of these structures must follow this rule: | ||
99 | * | ||
100 | * sizeof(struct) + 2*sizeof(void*) == n * 16, n >= 1 | ||
101 | * | ||
102 | * We use the dma_addr fields under Linux to keep track of the | ||
103 | * DMA address of the packet data, for later pci_unmap_single. -DaveM | ||
104 | */ | ||
105 | |||
106 | struct s_txd_os { // os-specific part of transmit descriptor | ||
107 | struct sk_buff *skb; | ||
108 | dma_addr_t dma_addr; | ||
109 | } ; | ||
110 | |||
111 | struct s_rxd_os { // os-specific part of receive descriptor | ||
112 | struct sk_buff *skb; | ||
113 | dma_addr_t dma_addr; | ||
114 | } ; | ||
115 | |||
116 | |||
117 | /* | ||
118 | * So we do not need to make too many modifications to the generic driver | ||
119 | * parts, we take advantage of the AIX byte swapping macro interface. | ||
120 | */ | ||
121 | |||
122 | #define AIX_REVERSE(x) ((u32)le32_to_cpu((u32)(x))) | ||
123 | #define MDR_REVERSE(x) ((u32)le32_to_cpu((u32)(x))) | ||
diff --git a/drivers/net/skfp/h/sba.h b/drivers/net/skfp/h/sba.h new file mode 100644 index 000000000000..df716cd5784a --- /dev/null +++ b/drivers/net/skfp/h/sba.h | |||
@@ -0,0 +1,142 @@ | |||
1 | /****************************************************************************** | ||
2 | * | ||
3 | * (C)Copyright 1998,1999 SysKonnect, | ||
4 | * a business unit of Schneider & Koch & Co. Datensysteme GmbH. | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License as published by | ||
8 | * the Free Software Foundation; either version 2 of the License, or | ||
9 | * (at your option) any later version. | ||
10 | * | ||
11 | * The information in this file is provided "AS IS" without warranty. | ||
12 | * | ||
13 | ******************************************************************************/ | ||
14 | |||
15 | /* | ||
16 | * Synchronous Bandwith Allocation (SBA) structs | ||
17 | */ | ||
18 | |||
19 | #ifndef _SBA_ | ||
20 | #define _SBA_ | ||
21 | |||
22 | #include "h/mbuf.h" | ||
23 | #include "h/sba_def.h" | ||
24 | |||
25 | #ifdef SBA | ||
26 | |||
27 | /* Timer Cell Template */ | ||
28 | struct timer_cell { | ||
29 | struct timer_cell *next_ptr ; | ||
30 | struct timer_cell *prev_ptr ; | ||
31 | u_long start_time ; | ||
32 | struct s_sba_node_vars *node_var ; | ||
33 | } ; | ||
34 | |||
35 | /* | ||
36 | * Node variables | ||
37 | */ | ||
38 | struct s_sba_node_vars { | ||
39 | u_char change_resp_flag ; | ||
40 | u_char report_resp_flag ; | ||
41 | u_char change_req_flag ; | ||
42 | u_char report_req_flag ; | ||
43 | long change_amount ; | ||
44 | long node_overhead ; | ||
45 | long node_payload ; | ||
46 | u_long node_status ; | ||
47 | u_char deallocate_status ; | ||
48 | u_char timer_state ; | ||
49 | u_short report_cnt ; | ||
50 | long lastrep_req_tranid ; | ||
51 | struct fddi_addr mac_address ; | ||
52 | struct s_sba_sessions *node_sessions ; | ||
53 | struct timer_cell timer ; | ||
54 | } ; | ||
55 | |||
56 | /* | ||
57 | * Session variables | ||
58 | */ | ||
59 | struct s_sba_sessions { | ||
60 | u_long deallocate_status ; | ||
61 | long session_overhead ; | ||
62 | u_long min_segment_size ; | ||
63 | long session_payload ; | ||
64 | u_long session_status ; | ||
65 | u_long sba_category ; | ||
66 | long lastchg_req_tranid ; | ||
67 | u_short session_id ; | ||
68 | u_char class ; | ||
69 | u_char fddi2 ; | ||
70 | u_long max_t_neg ; | ||
71 | struct s_sba_sessions *next_session ; | ||
72 | } ; | ||
73 | |||
74 | struct s_sba { | ||
75 | |||
76 | struct s_sba_node_vars node[MAX_NODES] ; | ||
77 | struct s_sba_sessions session[MAX_SESSIONS] ; | ||
78 | |||
79 | struct s_sba_sessions *free_session ; /* points to the first */ | ||
80 | /* free session */ | ||
81 | |||
82 | struct timer_cell *tail_timer ; /* points to the last timer cell */ | ||
83 | |||
84 | /* | ||
85 | * variables for allocation actions | ||
86 | */ | ||
87 | long total_payload ; /* Total Payload */ | ||
88 | long total_overhead ; /* Total Overhead */ | ||
89 | long sba_allocatable ; /* allocatable sync bandwidth */ | ||
90 | |||
91 | /* | ||
92 | * RAF message receive parameters | ||
93 | */ | ||
94 | long msg_path_index ; /* Path Type */ | ||
95 | long msg_sba_pl_req ; /* Payload Request */ | ||
96 | long msg_sba_ov_req ; /* Overhead Request */ | ||
97 | long msg_mib_pl ; /* Current Payload for this Path */ | ||
98 | long msg_mib_ov ; /* Current Overhead for this Path*/ | ||
99 | long msg_category ; /* Category of the Allocation */ | ||
100 | u_long msg_max_t_neg ; /* longest T_Neg acceptable */ | ||
101 | u_long msg_min_seg_siz ; /* minimum segement size */ | ||
102 | struct smt_header *sm ; /* points to the rec message */ | ||
103 | struct fddi_addr *msg_alloc_addr ; /* Allocation Address */ | ||
104 | |||
105 | /* | ||
106 | * SBA variables | ||
107 | */ | ||
108 | u_long sba_t_neg ; /* holds the last T_NEG */ | ||
109 | long sba_max_alloc ; /* the parsed value of SBAAvailable */ | ||
110 | |||
111 | /* | ||
112 | * SBA state machine variables | ||
113 | */ | ||
114 | short sba_next_state ; /* the next state of the SBA */ | ||
115 | char sba_command ; /* holds the execuded SBA cmd */ | ||
116 | u_char sba_available ; /* parsed value after possible check */ | ||
117 | } ; | ||
118 | |||
119 | #endif /* SBA */ | ||
120 | |||
121 | /* | ||
122 | * variables for the End Station Support | ||
123 | */ | ||
124 | struct s_ess { | ||
125 | |||
126 | /* | ||
127 | * flags and counters | ||
128 | */ | ||
129 | u_char sync_bw_available ; /* is set if sync bw is allocated */ | ||
130 | u_char local_sba_active ; /* set when a local sba is available */ | ||
131 | char raf_act_timer_poll ; /* activate the timer to send allc req */ | ||
132 | char timer_count ; /* counts every timer function call */ | ||
133 | |||
134 | SMbuf *sba_reply_pend ; /* local reply for the sba is pending */ | ||
135 | |||
136 | /* | ||
137 | * variables for the ess bandwidth control | ||
138 | */ | ||
139 | long sync_bw ; /* holds the allocaed sync bw */ | ||
140 | u_long alloc_trans_id ; /* trans id of the last alloc req */ | ||
141 | } ; | ||
142 | #endif | ||
diff --git a/drivers/net/skfp/h/sba_def.h b/drivers/net/skfp/h/sba_def.h new file mode 100644 index 000000000000..0459a095d0cd --- /dev/null +++ b/drivers/net/skfp/h/sba_def.h | |||
@@ -0,0 +1,76 @@ | |||
1 | /****************************************************************************** | ||
2 | * | ||
3 | * (C)Copyright 1998,1999 SysKonnect, | ||
4 | * a business unit of Schneider & Koch & Co. Datensysteme GmbH. | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License as published by | ||
8 | * the Free Software Foundation; either version 2 of the License, or | ||
9 | * (at your option) any later version. | ||
10 | * | ||
11 | * The information in this file is provided "AS IS" without warranty. | ||
12 | * | ||
13 | ******************************************************************************/ | ||
14 | |||
15 | #define PHYS 0 /* physical addr */ | ||
16 | #define PERM_ADDR 0x80 /* permanet address */ | ||
17 | #define SB_STATIC 0x00000001 | ||
18 | #define MAX_PAYLOAD 1562 | ||
19 | #define PRIMARY_RING 0x00000001 | ||
20 | #ifndef NULL | ||
21 | #define NULL 0x00 | ||
22 | #endif | ||
23 | |||
24 | /*********************** SB_Input Variable Values ***********************/ | ||
25 | /* may be needed when ever the SBA state machine is called */ | ||
26 | |||
27 | #define UNKNOWN_SYNC_SOURCE 0x0001 | ||
28 | #define REQ_ALLOCATION 0x0002 | ||
29 | #define REPORT_RESP 0x0003 | ||
30 | #define CHANGE_RESP 0x0004 | ||
31 | #define TNEG 0x0005 | ||
32 | #define NIF 0x0006 | ||
33 | #define SB_STOP 0x0007 | ||
34 | #define SB_START 0x0008 | ||
35 | #define REPORT_TIMER 0x0009 | ||
36 | #define CHANGE_REQUIRED 0x000A | ||
37 | |||
38 | #define DEFAULT_OV 50 | ||
39 | |||
40 | #ifdef SBA | ||
41 | /**************************** SBA STATES *****************************/ | ||
42 | |||
43 | #define SBA_STANDBY 0x00000000 | ||
44 | #define SBA_ACTIVE 0x00000001 | ||
45 | #define SBA_RECOVERY 0x00000002 | ||
46 | #define SBA_REPORT 0x00000003 | ||
47 | #define SBA_CHANGE 0x00000004 | ||
48 | |||
49 | /**************************** OTHERS *********************************/ | ||
50 | |||
51 | #define FIFTY_PERCENT 50 /* bytes per second */ | ||
52 | #define MAX_SESSIONS 150 | ||
53 | #define TWO_MINUTES 13079 /* 9.175 ms/tick */ | ||
54 | #define FIFTY_BYTES 50 | ||
55 | #define SBA_DENIED 0x0000000D | ||
56 | #define I_NEED_ONE 0x00000000 | ||
57 | #define MAX_NODES 50 | ||
58 | /*#define T_REPORT 0x59682F00L*/ /* 120s/80ns in Hex */ | ||
59 | #define TWO_MIN 120 /* seconds */ | ||
60 | #define SBA_ST_UNKNOWN 0x00000002 | ||
61 | #define SBA_ST_ACTIVE 0x00000001 | ||
62 | #define S_CLEAR 0x00000000L | ||
63 | #define ZERO 0x00000000 | ||
64 | #define FULL 0x00000000 /* old: 0xFFFFFFFFF */ | ||
65 | #define S_SET 0x00000001L | ||
66 | #define LOW_PRIO 0x02 /* ??????? */ | ||
67 | #define OK 0x01 /* ??????? */ | ||
68 | #define NOT_OK 0x00 /* ??????? */ | ||
69 | |||
70 | /****************************************/ | ||
71 | /* deallocate_status[ni][si] values */ | ||
72 | /****************************************/ | ||
73 | #define TX_CHANGE 0X00000001L | ||
74 | #define PENDING 0x00000002L | ||
75 | #define NONE 0X00000000L | ||
76 | #endif | ||
diff --git a/drivers/net/skfp/h/skfbi.h b/drivers/net/skfp/h/skfbi.h new file mode 100644 index 000000000000..ba347d6910f1 --- /dev/null +++ b/drivers/net/skfp/h/skfbi.h | |||
@@ -0,0 +1,1919 @@ | |||
1 | /****************************************************************************** | ||
2 | * | ||
3 | * (C)Copyright 1998,1999 SysKonnect, | ||
4 | * a business unit of Schneider & Koch & Co. Datensysteme GmbH. | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License as published by | ||
8 | * the Free Software Foundation; either version 2 of the License, or | ||
9 | * (at your option) any later version. | ||
10 | * | ||
11 | * The information in this file is provided "AS IS" without warranty. | ||
12 | * | ||
13 | ******************************************************************************/ | ||
14 | |||
15 | #ifndef _SKFBI_H_ | ||
16 | #define _SKFBI_H_ | ||
17 | |||
18 | #ifdef SYNC | ||
19 | #define exist_board_far exist_board | ||
20 | #define get_board_para_far get_board_para | ||
21 | #endif | ||
22 | |||
23 | /* | ||
24 | * physical address offset + IO-Port base address | ||
25 | */ | ||
26 | #ifndef PCI | ||
27 | #define ADDR(a) ((a)+smc->hw.iop) | ||
28 | #define ADDRS(smc,a) ((a)+(smc)->hw.iop) | ||
29 | #endif | ||
30 | |||
31 | /* | ||
32 | * FDDI-Fx (x := {I(SA), E(ISA), M(CA), P(CI)}) | ||
33 | * address calculation & function defines | ||
34 | */ | ||
35 | |||
36 | #ifdef EISA | ||
37 | |||
38 | /* | ||
39 | * Configuration PROM: !! all 8-Bit IO's !! | ||
40 | * |<- MAC-Address ->| | ||
41 | * /-+--+--+--+--+-//-+--+--+--+--+-//-+--+--+--+--+-//-+--+--+--+--+-/ | ||
42 | * val: |PROD_ID0..3| | free | |00|00|5A|40| |nn|mm|00|00| | ||
43 | * /-+--+--+--+--+-//-+--+--+--+--+-//-+--+--+--+--+-//-+--+--+--+--+-/ | ||
44 | * IO- ^ ^ ^ ^ ^ | ||
45 | * port 0C80 0C83 0C88 0C90 0C98 | ||
46 | * | \ | ||
47 | * | \ | ||
48 | * | \______________________________________________ | ||
49 | * EISA Expansion Board Product ID: \ | ||
50 | * BIT: |7 6 5 4 3 2 1 0| \ | ||
51 | * | PROD_ID0 | PROD_ID1 | PROD_ID2 | PROD_ID3 | | ||
52 | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||
53 | * |0| MAN_C0 | MAN_C1 | MAN_C2 | PROD1 | PROD0 | REV1 | REV0 | | ||
54 | * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ||
55 | * ^=reserved | product numb. | revision numb | | ||
56 | * MAN_Cx = compressed manufacterer code (x:=0..2) | ||
57 | * ASCII : 'A'..'Z' : 0x41..0x5A -> compr.(c-0x40) : 0x01..0x1A (5Bits!) | ||
58 | */ | ||
59 | |||
60 | #ifndef MULT_OEM | ||
61 | #ifndef OEM_CONCEPT | ||
62 | #define MAN_C0 ('S'-0x40) | ||
63 | #define MAN_C1 ('K'-0x40) | ||
64 | #define MAN_C2 ('D'-0x40) | ||
65 | #define PROD_ID0 (u_char)((MAN_C0<<2) | (MAN_C1>>3)) | ||
66 | #define PROD_ID1 (u_char)(((MAN_C1<<5) & 0xff) | MAN_C2) | ||
67 | #define PROD_ID2 (u_char)(1) /* prod. nr. */ | ||
68 | #define PROD_ID3 (u_char)(0) /* rev. nr. */ | ||
69 | |||
70 | #ifndef OEM_USER_DATA | ||
71 | #define OEM_USER_DATA "SK-NET FDDI V2.0 Userdata" | ||
72 | #endif | ||
73 | #else /* OEM_CONCEPT */ | ||
74 | |||
75 | /* MAN_C(0|1|2) no longer present (ra). */ | ||
76 | #define PROD_ID0 (u_char)OEM_PROD_ID0 | ||
77 | #define PROD_ID1 (u_char)OEM_PROD_ID1 | ||
78 | #define PROD_ID2 (u_char)OEM_PROD_ID2 | ||
79 | #define PROD_ID3 (u_char)OEM_PROD_ID3 | ||
80 | #endif /* OEM_CONCEPT */ | ||
81 | |||
82 | #define SKLOGO PROD_ID0, PROD_ID1, PROD_ID2, PROD_ID3 | ||
83 | #endif /* MULT_OEM */ | ||
84 | |||
85 | #define SADDRL (0) /* start address SKLOGO */ | ||
86 | #define SA_MAC (0x10) /* start addr. MAC_AD within the PROM */ | ||
87 | #define PRA_OFF (4) | ||
88 | #define SA_PMD_TYPE (8) /* start addr. PMD-Type */ | ||
89 | |||
90 | #define SKFDDI_PSZ 32 /* address PROM size */ | ||
91 | |||
92 | /* | ||
93 | * address transmission from logical to physical offset address on board | ||
94 | */ | ||
95 | #define FMA(a) (0x0400|((a)<<1)) /* FORMAC+ (r/w) */ | ||
96 | #define P1A(a) (0x0800|((a)<<1)) /* PLC1 (r/w) */ | ||
97 | #define P2A(a) (0x0840|((a)<<1)) /* PLC2 (r/w) */ | ||
98 | #define TIA(a) (0x0880|((a)<<1)) /* Timer (r/w) */ | ||
99 | #define PRA(a) (0x0c80| (a)) /* configuration PROM */ | ||
100 | #define C0A(a) (0x0c84| (a)) /* config. RAM */ | ||
101 | #define C1A(a) (0x0ca0| (a)) /* IRQ-, DMA-nr., EPROM type */ | ||
102 | #define C2A(a) (0x0ca4| (a)) /* EPROM and PAGE selector */ | ||
103 | |||
104 | #define CONF C0A(0) /* config RAM (card enable bit port) */ | ||
105 | #define PGRA C2A(0) /* Flash page register */ | ||
106 | #define CDID PRA(0) /* Card ID I/O port addr. offset */ | ||
107 | |||
108 | |||
109 | /* | ||
110 | * physical address offset + slot specific IO-Port base address | ||
111 | */ | ||
112 | #define FM_A(a) (FMA(a)+smc->hw.iop) /* FORMAC Plus physical addr */ | ||
113 | #define P1_A(a) (P1A(a)+smc->hw.iop) /* PLC1 (r/w) */ | ||
114 | #define P2_A(a) (P2A(a)+smc->hw.iop) /* PLC2 (r/w) */ | ||
115 | #define TI_A(a) (TIA(a)+smc->hw.iop) /* Timer (r/w) */ | ||
116 | #define PR_A(a) (PRA(a)+smc->hw.iop) /* config. PROM */ | ||
117 | #define C0_A(a) (C0A(a)+smc->hw.iop) /* config. RAM */ | ||
118 | #define C1_A(a) (C1A(a)+smc->hw.iop) /* config. RAM */ | ||
119 | #define C2_A(a) (C2A(a)+smc->hw.iop) /* config. RAM */ | ||
120 | |||
121 | |||
122 | #define CSRA 0x0008 /* control/status register address (r/w) */ | ||
123 | #define ISRA 0x0008 /* int. source register address (upper 8Bits) */ | ||
124 | #define PLC1I 0x001a /* clear PLC1 interrupt (write only) */ | ||
125 | #define PLC2I 0x0020 /* clear PLC2 interrupt (write only) */ | ||
126 | #define CSFA 0x001c /* control/status FIFO BUSY flags (read only) */ | ||
127 | #define RQAA 0x001c /* Request reg. (write only) */ | ||
128 | #define WCTA 0x001e /* word counter (r/w) */ | ||
129 | #define FFLAG 0x005e /* FLAG/V_FULL (FIFO almost full, write only)*/ | ||
130 | |||
131 | #define CSR_A (CSRA+smc->hw.iop) /* control/status register address (r/w) */ | ||
132 | #ifdef UNIX | ||
133 | #define CSR_AS(smc) (CSRA+(smc)->hw.iop) /* control/status register address (r/w) */ | ||
134 | #endif | ||
135 | #define ISR_A (ISRA+smc->hw.iop) /* int. source register address (upper 8Bits) */ | ||
136 | #define PLC1_I (PLC1I+smc->hw.iop) /* clear PLC1 internupt (write only) */ | ||
137 | #define PLC2_I (PLC2I+smc->hw.iop) /* clear PLC2 interrupt (write only) */ | ||
138 | #define CSF_A (CSFA+smc->hw.iop) /* control/status FIFO BUSY flags (r/w) */ | ||
139 | #define RQA_A (RQAA+smc->hw.iop) /* Request reg. (write only) */ | ||
140 | #define WCT_A (WCTA+smc->hw.iop) /* word counter (r/w) */ | ||
141 | #define FFLAG_A (FFLAG+smc->hw.iop) /* FLAG/V_FULL (FIFO almost full, write only)*/ | ||
142 | |||
143 | /* | ||
144 | * control/status register CSRA bits | ||
145 | */ | ||
146 | /* write */ | ||
147 | #define CS_CRESET 0x01 /* Card reset (0=reset) */ | ||
148 | #define CS_RESET_FIFO 0x02 /* FIFO reset (0=reset) */ | ||
149 | #define CS_IMSK 0x04 /* enable IRQ (1=enable, 0=disable) */ | ||
150 | #define CS_EN_IRQ_TC 0x08 /* enable IRQ from transfer counter */ | ||
151 | #define CS_BYPASS 0x20 /* bypass switch (0=remove, 1=insert)*/ | ||
152 | #define CS_LED_0 0x40 /* switch LED 0 */ | ||
153 | #define CS_LED_1 0x80 /* switch LED 1 */ | ||
154 | /* read */ | ||
155 | #define CS_BYSTAT 0x40 /* 0=Bypass exist, 1= ..not */ | ||
156 | #define CS_SAS 0x80 /* single attachement station (=1) */ | ||
157 | |||
158 | /* | ||
159 | * control/status register CSFA bits (FIFO) | ||
160 | */ | ||
161 | #define CSF_MUX0 0x01 | ||
162 | #define CSF_MUX1 0x02 | ||
163 | #define CSF_HSREQ0 0x04 | ||
164 | #define CSF_HSREQ1 0x08 | ||
165 | #define CSF_HSREQ2 0x10 | ||
166 | #define CSF_BUSY_DMA 0x40 | ||
167 | #define CSF_BUSY_FIFO 0x80 | ||
168 | |||
169 | /* | ||
170 | * Interrupt source register ISRA (upper 8 data bits) read only & low activ. | ||
171 | */ | ||
172 | #define IS_MINTR1 0x0100 /* FORMAC ST1U/L & ~IMSK1U/L*/ | ||
173 | #define IS_MINTR2 0x0200 /* FORMAC ST2U/L & ~IMSK2U/L*/ | ||
174 | #define IS_PLINT1 0x0400 /* PLC1 */ | ||
175 | #define IS_PLINT2 0x0800 /* PLC2 */ | ||
176 | #define IS_TIMINT 0x1000 /* Timer 82C54-2 */ | ||
177 | #define IS_TC 0x2000 /* transf. counter */ | ||
178 | |||
179 | #define ALL_IRSR (IS_MINTR1|IS_MINTR2|IS_PLINT1|IS_PLINT2|IS_TIMINT|IS_TC) | ||
180 | |||
181 | /* | ||
182 | * CONFIG<0> RAM (C0_A()) | ||
183 | */ | ||
184 | #define CFG_CARD_EN 0x01 /* card enable */ | ||
185 | |||
186 | /* | ||
187 | * CONFIG<1> RAM (C1_A()) | ||
188 | */ | ||
189 | #define CFG_IRQ_SEL 0x03 /* IRQ select (4 nr.) */ | ||
190 | #define CFG_IRQ_TT 0x04 /* IRQ trigger type (LEVEL/EDGE) */ | ||
191 | #define CFG_DRQ_SEL 0x18 /* DMA requ. (4 nr.) */ | ||
192 | #define CFG_BOOT_EN 0x20 /* 0=BOOT-, 1=Application Software */ | ||
193 | #define CFG_PROG_EN 0x40 /* V_Prog for FLASH_PROM (1=on) */ | ||
194 | |||
195 | /* | ||
196 | * CONFIG<2> RAM (C2_A()) | ||
197 | */ | ||
198 | #define CFG_EPROM_SEL 0x0f /* FPROM start address selection */ | ||
199 | #define CFG_PAGE 0xf0 /* FPROM page selection */ | ||
200 | |||
201 | |||
202 | #define READ_PROM(a) ((u_char)inp(a)) | ||
203 | #define GET_PAGE(i) outp(C2_A(0),((int)(i)<<4) | (inp(C2_A(0)) & ~CFG_PAGE)) | ||
204 | #define FPROM_SW() (inp(C1_A(0)) & CFG_BOOT_EN) | ||
205 | |||
206 | #define MAX_PAGES 16 /* 16 pages */ | ||
207 | #define MAX_FADDR 0x2000 /* 8K per page */ | ||
208 | #define VPP_ON() outp(C1_A(0),inp(C1_A(0)) | CFG_PROG_EN) | ||
209 | #define VPP_OFF() outp(C1_A(0),inp(C1_A(0)) & ~CFG_PROG_EN) | ||
210 | |||
211 | #define DMA_BUSY() (inpw(CSF_A) & CSF_BUSY_DMA) | ||
212 | #define FIFO_BUSY() (inpw(CSF_A) & CSF_BUSY_FIFO) | ||
213 | #define DMA_FIFO_BUSY() (inpw(CSF_A) & (CSF_BUSY_DMA | CSF_BUSY_FIFO)) | ||
214 | #define BUS_CHECK() | ||
215 | |||
216 | #ifdef UNISYS | ||
217 | /* For UNISYS use another macro with drv_usecewait function */ | ||
218 | #define CHECK_DMA() {u_long k = 1000000; \ | ||
219 | while (k && (DMA_BUSY())) { k--; drv_usecwait(20); } \ | ||
220 | if (!k) SMT_PANIC(smc,HWM_E0003,HWM_E0003_MSG) ; } | ||
221 | #else | ||
222 | #define CHECK_DMA() {u_long k = 1000000 ;\ | ||
223 | while (k && (DMA_BUSY())) k-- ;\ | ||
224 | if (!k) SMT_PANIC(smc,HWM_E0003,HWM_E0003_MSG) ; } | ||
225 | #endif | ||
226 | |||
227 | #define CHECK_FIFO() {u_long k = 1000000 ;\ | ||
228 | while (k && (FIFO_BUSY())) k-- ;\ | ||
229 | if (!k) SMT_PANIC(smc,HWM_E0019,HWM_E0019_MSG) ; } | ||
230 | |||
231 | #define CHECK_DMA_FIFO() {u_long k = 1000000 ;\ | ||
232 | while (k && (DMA_FIFO_BUSY())) k-- ;\ | ||
233 | if (!k) SMT_PANIC(smc,HWM_E0004,HWM_E0004_MSG) ; } | ||
234 | |||
235 | #define GET_ISR() ~inpw(ISR_A) | ||
236 | #define CHECK_ISR() ~inpw(ISR_A) | ||
237 | |||
238 | #ifndef UNIX | ||
239 | #ifndef WINNT | ||
240 | #define CLI_FBI() outpw(CSR_A,(inpw(CSR_A)&\ | ||
241 | (CS_CRESET|CS_BYPASS))|CS_RESET_FIFO|smc->hw.led) | ||
242 | #else /* WINNT */ | ||
243 | #define CLI_FBI() outpw(CSR_A,(l_inpw(CSR_A)&\ | ||
244 | (CS_CRESET|CS_BYPASS))|CS_RESET_FIFO|smc->hw.led) | ||
245 | #endif /* WINNT */ | ||
246 | #else /* UNIX */ | ||
247 | #define CLI_FBI(smc) outpw(CSR_AS(smc),(inpw(CSR_AS(smc))&\ | ||
248 | (CS_CRESET|CS_BYPASS))|CS_RESET_FIFO|(smc)->hw.led) | ||
249 | #endif | ||
250 | |||
251 | #ifndef UNIX | ||
252 | #define STI_FBI() outpw(CSR_A,(inpw(CSR_A)&\ | ||
253 | (CS_CRESET|CS_BYPASS|CS_RESET_FIFO))|CS_IMSK|smc->hw.led) | ||
254 | #else | ||
255 | #define STI_FBI(smc) outpw(CSR_AS(smc),(inpw(CSR_AS(smc))&\ | ||
256 | (CS_CRESET|CS_BYPASS|CS_RESET_FIFO))|CS_IMSK|(smc)->hw.led) | ||
257 | #endif | ||
258 | |||
259 | /* EISA DMA Controller */ | ||
260 | #define DMA_WRITE_SINGLE_MASK_BIT_M 0x0a /* Master DMA Controller */ | ||
261 | #define DMA_WRITE_SINGLE_MASK_BIT_S 0xd4 /* Slave DMA Controller */ | ||
262 | #define DMA_CLEAR_BYTE_POINTER_M 0x0c | ||
263 | #define DMA_CLEAR_BYTE_POINTER_S 0xd8 | ||
264 | |||
265 | #endif /* EISA */ | ||
266 | |||
267 | #ifdef MCA | ||
268 | |||
269 | /* | ||
270 | * POS Register: !! all I/O's are 8-Bit !! | ||
271 | */ | ||
272 | #define POS_SYS_SETUP 0x94 /* system setup register */ | ||
273 | #define POS_SYSTEM 0xff /* system mode */ | ||
274 | |||
275 | #define POS_CHANNEL_POS 0x96 /* register slot ID */ | ||
276 | #define POS_CHANNEL_BIT 0x08 /* mask for -"- */ | ||
277 | |||
278 | #define POS_BASE 0x100 /* POS base address */ | ||
279 | #define POS_ID_LOW POS_BASE /* card ID low */ | ||
280 | #define POS_ID_HIGH (POS_BASE+1) /* card ID high */ | ||
281 | #define POS_102 (POS_BASE+2) /* card en., arbitration level .. */ | ||
282 | #define POS_103 (POS_BASE+3) /* FPROM addr, page */ | ||
283 | #define POS_104 (POS_BASE+4) /* I/O, IRQ */ | ||
284 | #define POS_105 (POS_BASE+5) /* POS_CHCK */ | ||
285 | #define POS_106 (POS_BASE+6) /* to read VPD */ | ||
286 | #define POS_107 (POS_BASE+7) /* added without function */ | ||
287 | |||
288 | /* FM1 card IDs */ | ||
289 | #define FM1_CARD_ID0 0x83 | ||
290 | #define FM1_CARD_ID1 0 | ||
291 | |||
292 | #define FM1_IBM_ID0 0x9c | ||
293 | #define FM1_IBM_ID1 0x8f | ||
294 | |||
295 | |||
296 | /* FM2 card IDs */ | ||
297 | #define FM2_CARD_ID0 0xab | ||
298 | #define FM2_CARD_ID1 0 | ||
299 | |||
300 | #define FM2_IBM_ID0 0x7e | ||
301 | #define FM2_IBM_ID1 0x8f | ||
302 | |||
303 | /* Board revision. */ | ||
304 | #define FM1_REV 0 | ||
305 | #define FM2_REV 1 | ||
306 | |||
307 | #define MAX_SLOT 8 | ||
308 | |||
309 | /* | ||
310 | * POS_102 | ||
311 | */ | ||
312 | #define POS_CARD_EN 0x01 /* card enable =1 */ | ||
313 | #define POS_SDAT_EN 0x02 /* enable 32-bit streaming data mode */ | ||
314 | #define POS_EN_CHKINT 0x04 /* enable int. from check line asserted */ | ||
315 | #define POS_EN_BUS_ERR 0x08 /* enable int. on invalid busmaster transf. */ | ||
316 | #define POS_FAIRNESS 0x10 /* fairnes on =1 */ | ||
317 | /* attention: arbitration level used with bit 0 POS 105 */ | ||
318 | #define POS_LARBIT 0xe0 /* arbitration level (0,0,0)->level = 0x8 | ||
319 | (1,1,1)->level = 0xf */ | ||
320 | /* | ||
321 | * POS_103 | ||
322 | */ | ||
323 | #define POS_PAGE 0x07 /* FPROM page selection */ | ||
324 | #define POS_BOOT_EN 0x08 /* boot PROM enable =1 */ | ||
325 | #define POS_MSEL 0x70 /* memory start address for FPROM mapping */ | ||
326 | #define PROG_EN 0x80 /* FM1: Vpp prog on/off */ | ||
327 | #define POS_SDR 0x80 /* FM2: Streaming data bit */ | ||
328 | |||
329 | /* | ||
330 | * POS_104 | ||
331 | */ | ||
332 | #define POS_IOSEL 0x3f /* selected I/O base address */ | ||
333 | #define POS_IRQSEL 0xc0 /* selected interrupt */ | ||
334 | |||
335 | /* | ||
336 | * POS_105 | ||
337 | */ | ||
338 | #define POS_CHCK 0x80 | ||
339 | #define POS_SYNC_ERR 0x20 /* FM2: synchronous error reporting */ | ||
340 | #define POS_PAR_DATA 0x10 /* FM2: data parity enable bit */ | ||
341 | #define POS_PAR_ADDR 0x08 /* FM2: address parity enable bit */ | ||
342 | #define POS_IRQHSEL 0x02 /* FM2: Highest bit for IRQ_selection */ | ||
343 | #define POS_HARBIT 0x01 /* Highest bit in Bus arbitration selection */ | ||
344 | |||
345 | #define SA_MAC (0) /* start addr. MAC_AD within the PROM */ | ||
346 | #define PRA_OFF (0) | ||
347 | #define SA_PMD_TYPE (8) /* start addr. PMD-Type */ | ||
348 | |||
349 | /* | ||
350 | * address transmission from logical to physical offset address on board | ||
351 | */ | ||
352 | #define FMA(a) (0x0100|((a)<<1)) /* FORMAC+ (r/w) */ | ||
353 | #define P2(a) (0x00c0|((a)<<1)) /* PLC2 (r/w) (DAS) */ | ||
354 | #define P1(a) (0x0080|((a)<<1)) /* PLC1 (r/w) */ | ||
355 | #define TI(a) (0x0060|((a)<<1)) /* Timer (r/w) */ | ||
356 | #define PR(a) (0x0040|((a)<<1)) /* configuration PROM */ | ||
357 | #define CS(a) (0x0020| (a)) /* control/status */ | ||
358 | #define FF(a) (0x0010|((a)<<1)) /* FIFO ASIC */ | ||
359 | #define CT(a) (0x0000|((a)<<1)) /* counter */ | ||
360 | |||
361 | /* | ||
362 | * counter | ||
363 | */ | ||
364 | #define ACLA CT(0) /* address counter low */ | ||
365 | #define ACHA CT(1) /* address counter high */ | ||
366 | #define BCN CT(2) /* byte counter */ | ||
367 | #define MUX CT(3) /* MUX-register */ | ||
368 | #define WCN CT(0x08) /* word counter */ | ||
369 | #define FFLG CT(0x09) /* FIFO Flags */ | ||
370 | |||
371 | /* | ||
372 | * test/control register (FM2 only) | ||
373 | */ | ||
374 | #define CNT_TST 0x018 /* Counter test control register */ | ||
375 | #define CNT_STP 0x01a /* Counter test step reg. (8 Bit) */ | ||
376 | |||
377 | /* | ||
378 | * CS register (read only) | ||
379 | */ | ||
380 | #define CSRA CS(0) /* control/status register address */ | ||
381 | #define CSFA CS(2) /* control/status FIFO BUSY ... */ | ||
382 | #define ISRA CS(4) /* first int. source register address */ | ||
383 | #define ISR2 CS(6) /* second int. source register address */ | ||
384 | #define LEDR CS(0x0c) /* LED register r/w */ | ||
385 | #define CSIL CS(0x10) /* I/O mapped POS_ID_low (100) */ | ||
386 | #define CSIH CS(0x12) /* - " - POS_ID_HIGH (101) */ | ||
387 | #define CSA CS(0x14) /* - " - POS_102 */ | ||
388 | #define CSM CS(0x0e) /* - " - POS_103 */ | ||
389 | #define CSM_FM1 CS(0x16) /* - " - POS_103 (copy in FM1) */ | ||
390 | #define CSI CS(0x18) /* - " - POS_104 */ | ||
391 | #define CSS CS(0x1a) /* - " - POS_105 */ | ||
392 | #define CSP_06 CS(0x1c) /* - " - POS_106 */ | ||
393 | #define WDOG_ST 0x1c /* Watchdog status (FM2 only) */ | ||
394 | #define WDOG_EN 0x1c /* Watchdog enabling (FM2 only, 8Bit) */ | ||
395 | #define WDOG_DIS 0x1e /* Watchdog disabling (FM2 only, 8Bit) */ | ||
396 | |||
397 | #define PGRA CSM /* Flash page register */ | ||
398 | |||
399 | |||
400 | #define WCTA FF(0) /* word counter */ | ||
401 | #define FFLAG FF(1) /* FLAG/V_FULL (FIFO almost full, write only)*/ | ||
402 | |||
403 | /* | ||
404 | * Timer register (FM2 only) | ||
405 | */ | ||
406 | #define RTM_CNT 0x28 /* RTM Counter */ | ||
407 | #define TI_DIV 0x60 /* Timer Prescaler */ | ||
408 | #define TI_CH1 0x62 /* Timer channel 1 counter */ | ||
409 | #define TI_STOP 0x64 /* Stop timer on channel 1 */ | ||
410 | #define TI_STRT 0x66 /* Start timer on channel 1 */ | ||
411 | #define TI_INI2 0x68 /* Timer: Bus master preemption */ | ||
412 | #define TI_CNT2 0x6a /* Timer */ | ||
413 | #define TI_INI3 0x6c /* Timer: Streaming data */ | ||
414 | #define TI_CNT3 0x6e /* Timer */ | ||
415 | #define WDOG_LO 0x70 /* Watchdog counter low */ | ||
416 | #define WDOG_HI 0x72 /* Watchdog counter high */ | ||
417 | #define RTM_PRE 0x74 /* restr. token prescaler */ | ||
418 | #define RTM_TIM 0x76 /* restr. token timer */ | ||
419 | |||
420 | /* | ||
421 | * Recommended Timeout values (for FM2 timer only) | ||
422 | */ | ||
423 | #define TOUT_BM_PRE 188 /* 3.76 usec */ | ||
424 | #define TOUT_S_DAT 374 /* 7.48 usec */ | ||
425 | |||
426 | /* | ||
427 | * CS register (write only) | ||
428 | */ | ||
429 | #define HSR(p) CS(0x18|(p)) /* Host request register */ | ||
430 | |||
431 | #define RTM_PUT 0x36 /* restr. token counter write */ | ||
432 | #define RTM_GET 0x28 /* - " - clear */ | ||
433 | #define RTM_CLEAR 0x34 /* - " - read */ | ||
434 | |||
435 | /* | ||
436 | * BCN Bit definitions | ||
437 | */ | ||
438 | #define BCN_BUSY 0x8000 /* DMA Busy flag */ | ||
439 | #define BCN_AZERO 0x4000 /* Almost zero flag (BCN < 4) */ | ||
440 | #define BCN_STREAM 0x2000 /* Allow streaming data (BCN >= 8) */ | ||
441 | |||
442 | /* | ||
443 | * WCN Bit definitions | ||
444 | */ | ||
445 | #define WCN_ZERO 0x2000 /* Zero flag (counted to zero) */ | ||
446 | #define WCN_AZERO 0x1000 /* Almost zero flag (BCN < 4) */ | ||
447 | |||
448 | /* | ||
449 | * CNT_TST Bit definitions | ||
450 | */ | ||
451 | #define CNT_MODE 0x01 /* Go into test mode */ | ||
452 | #define CNT_D32 0x02 /* 16/32 BIT test mode */ | ||
453 | |||
454 | /* | ||
455 | * FIFO Flag FIFO Flags/Vfull register | ||
456 | */ | ||
457 | #define FF_VFULL 0x003f /* V_full value mask */ | ||
458 | #define FFLG_FULL 0x2000 /* FULL flag */ | ||
459 | #define FFLG_A_FULL 0x1000 /* Almost full flag */ | ||
460 | #define FFLG_VFULL 0x0800 /* V_full Flag */ | ||
461 | #define FFLG_A_EMP 0x0400 /* almost empty flag */ | ||
462 | #define FFLG_EMP 0x0200 /* empty flag */ | ||
463 | #define FFLG_T_EMP 0x0100 /* totally empty flag */ | ||
464 | |||
465 | /* | ||
466 | * WDOG Watchdog status register | ||
467 | */ | ||
468 | #define WDOG_ALM 0x01 /* Watchdog alarm Bit */ | ||
469 | #define WDOG_ACT 0x02 /* Watchdog active Bit */ | ||
470 | |||
471 | /* | ||
472 | * CS(0) CONTROLS | ||
473 | */ | ||
474 | #define CS_CRESET 0x0001 | ||
475 | #define FIFO_RST 0x0002 | ||
476 | #define CS_IMSK 0x0004 | ||
477 | #define EN_IRQ_CHCK 0x0008 | ||
478 | #define EN_IRQ_TOKEN 0x0010 | ||
479 | #define EN_IRQ_TC 0x0020 | ||
480 | #define TOKEN_STATUS 0x0040 | ||
481 | #define RTM_CHANGE 0x0080 | ||
482 | |||
483 | #define CS_SAS 0x0100 | ||
484 | #define CS_BYSTAT 0x0200 /* bypass connected (0=conn.) */ | ||
485 | #define CS_BYPASS 0x0400 /* bypass on/off indication */ | ||
486 | |||
487 | /* | ||
488 | * CS(2) FIFOSTAT | ||
489 | */ | ||
490 | #define HSREQ 0x0007 | ||
491 | #define BIGDIR 0x0008 | ||
492 | #define CSF_BUSY_FIFO 0x0010 | ||
493 | #define CSF_BUSY_DMA 0x0020 | ||
494 | #define SLOT_32 0x0040 | ||
495 | |||
496 | #define LED_0 0x0001 | ||
497 | #define LED_1 0x0002 | ||
498 | #define LED_2 0x0100 | ||
499 | |||
500 | #define MAX_PAGES 8 /* pages */ | ||
501 | #define MAX_FADDR 0x4000 /* 16K per page */ | ||
502 | |||
503 | /* | ||
504 | * IRQ = ISRA || ISR2 ; | ||
505 | * | ||
506 | * ISRA = IRQ_OTH_EN && (IS_LAN | IS_BUS) ; | ||
507 | * ISR2 = IRQ_TC_EN && IS_TC ; | ||
508 | * | ||
509 | * IS_LAN = (IS_MINTR1 | IS_MINTR2 | IS_PLINT1 | IS_PLINT2 | IS_TIMINT) || | ||
510 | * (IRQ_EN_TOKEN && IS_TOKEN) ; | ||
511 | * IS_BUS = IRQ_CHCK_EN && (IS_BUSERR | IS_CHCK_L) ; | ||
512 | */ | ||
513 | /* | ||
514 | * ISRA !!! activ high !!! | ||
515 | */ | ||
516 | #define IS_MINTR1 0x0001 /* FORMAC ST1U/L & ~IMSK1U/L*/ | ||
517 | #define IS_MINTR2 0x0002 /* FORMAC ST2U/L & ~IMSK2U/L*/ | ||
518 | #define IS_PLINT1 0x0004 /* PLC1 */ | ||
519 | #define IS_PLINT2 0x0008 /* PLC2 */ | ||
520 | #define IS_TIMINT 0x0010 /* Timer 82C54-2 */ | ||
521 | #define IS_TOKEN 0x0020 /* restrictet token monitoring */ | ||
522 | #define IS_CHCK_L 0x0040 /* check line asserted */ | ||
523 | #define IS_BUSERR 0x0080 /* bus error */ | ||
524 | /* | ||
525 | * ISR2 | ||
526 | */ | ||
527 | #define IS_TC 0x0001 /* terminal count irq */ | ||
528 | #define IS_SFDBKRTN 0x0002 /* selected feedback return */ | ||
529 | #define IS_D16 0x0004 /* DS16 */ | ||
530 | #define IS_D32 0x0008 /* DS32 */ | ||
531 | #define IS_DPEI 0x0010 /* Data Parity Indication */ | ||
532 | |||
533 | #define ALL_IRSR 0x00ff | ||
534 | |||
535 | #define FM_A(a) ADDR(FMA(a)) /* FORMAC Plus physical addr */ | ||
536 | #define P1_A(a) ADDR(P1(a)) /* PLC1 (r/w) */ | ||
537 | #define P2_A(a) ADDR(P2(a)) /* PLC2 (r/w) (DAS) */ | ||
538 | #define TI_A(a) ADDR(TI(a)) /* Timer (r/w) FM1 only! */ | ||
539 | #define PR_A(a) ADDR(PR(a)) /* config. PROM */ | ||
540 | #define CS_A(a) ADDR(CS(a)) /* control/status */ | ||
541 | |||
542 | #define ISR1_A ADDR(ISRA) /* first int. source register address */ | ||
543 | #define ISR2_A ADDR(ISR2) /* second -"- */ | ||
544 | #define CSR_A ADDR(CSRA) /* control/status register address */ | ||
545 | #define CSF_A ADDR(CSFA) /* control/status FIFO BUSY flags (r/w) */ | ||
546 | |||
547 | #define CSIL_A ADDR(CSIL) /* I/O mapped POS_ID_low (102) */ | ||
548 | #define CSIH_A ADDR(CSIH) /* - " - POS_ID_HIGH (101) */ | ||
549 | #define CSA_A ADDR(CSA) /* - " - POS_102 */ | ||
550 | #define CSI_A ADDR(CSI) /* - " - POS_104 */ | ||
551 | #define CSM_A ADDR(CSM) /* - " - POS_103 */ | ||
552 | #define CSM_FM1_A ADDR(CSM_FM1) /* - " - POS_103 (2nd copy, FM1) */ | ||
553 | #define CSP_06_A ADDR(CSP_06) /* - " - POS_106 */ | ||
554 | |||
555 | #define WCT_A ADDR(WCTA) /* word counter (r/w) */ | ||
556 | #define FFLAG_A ADDR(FFLAG) /* FLAG/V_FULL (FIFO almost full, write only)*/ | ||
557 | |||
558 | #define ACL_A ADDR(ACLA) /* address counter low */ | ||
559 | #define ACH_A ADDR(ACHA) /* address counter high */ | ||
560 | #define BCN_A ADDR(BCN) /* byte counter */ | ||
561 | #define MUX_A ADDR(MUX) /* MUX-register */ | ||
562 | |||
563 | #define ISR_A ADDR(ISRA) /* Interrupt Source Register */ | ||
564 | #define FIFO_RESET_A ADDR(FIFO_RESET) /* reset the FIFO */ | ||
565 | #define FIFO_EN_A ADDR(FIFO_EN) /* enable the FIFO */ | ||
566 | |||
567 | #define WDOG_EN_A ADDR(WDOG_EN) /* reset and start the WDOG */ | ||
568 | #define WDOG_DIS_A ADDR(WDOG_DIS) /* disable the WDOG */ | ||
569 | /* | ||
570 | * all control reg. (read!) are 8 bit (except PAGE_RG_A and LEDR_A) | ||
571 | */ | ||
572 | #define HSR_A(p) ADDR(HSR(p)) /* Host request register */ | ||
573 | |||
574 | #define STAT_BYP 0 /* bypass station */ | ||
575 | #define STAT_INS 2 /* insert station */ | ||
576 | #define BYPASS(o) CS(0x10|(o)) /* o=STAT_BYP || STAT_INS */ | ||
577 | |||
578 | #define IRQ_TC_EN CS(0x0b) /* enable/disable IRQ on TC */ | ||
579 | #define IRQ_TC_DIS CS(0x0a) | ||
580 | #define IRQ_TOKEN_EN CS(9) /* enable/disable IRQ on restr. Token */ | ||
581 | #define IRQ_TOKEN_DIS CS(8) | ||
582 | #define IRQ_CHCK_EN CS(7) /* -"- IRQ after CHCK line */ | ||
583 | #define IRQ_CHCK_DIS CS(6) | ||
584 | #define IRQ_OTH_EN CS(5) /* -"- other IRQ's */ | ||
585 | #define IRQ_OTH_DIS CS(4) | ||
586 | #define FIFO_EN CS(3) /* disable (reset), enable FIFO */ | ||
587 | #define FIFO_RESET CS(2) | ||
588 | #define CARD_EN CS(1) /* disable (reset), enable card */ | ||
589 | #define CARD_DIS CS(0) | ||
590 | |||
591 | #define LEDR_A ADDR(LEDR) /* D0=green, D1=yellow, D8=L2 */ | ||
592 | #define PAGE_RG_A ADDR(CSM) /* D<2..0> */ | ||
593 | #define IRQ_CHCK_EN_A ADDR(IRQ_CHCK_EN) | ||
594 | #define IRQ_CHCK_DIS_A ADDR(IRQ_CHCK_DIS) | ||
595 | |||
596 | #define GET_PAGE(bank) outpw(PAGE_RG_A,(inpw(PAGE_RG_A) &\ | ||
597 | (~POS_PAGE)) |(int) (bank)) | ||
598 | #define VPP_ON() if (smc->hw.rev == FM1_REV) { \ | ||
599 | outpw(PAGE_RG_A, \ | ||
600 | (inpw(PAGE_RG_A) & POS_PAGE) | PROG_EN); \ | ||
601 | } | ||
602 | #define VPP_OFF() if (smc->hw.rev == FM1_REV) { \ | ||
603 | outpw(PAGE_RG_A,(inpw(PAGE_RG_A) & POS_PAGE)); \ | ||
604 | } | ||
605 | |||
606 | #define SKFDDI_PSZ 16 /* address PROM size */ | ||
607 | |||
608 | #define READ_PROM(a) ((u_char)inp(a)) | ||
609 | |||
610 | #define GET_ISR() ~inpw(ISR1_A) | ||
611 | #ifndef TCI | ||
612 | #define CHECK_ISR() ~inpw(ISR1_A) | ||
613 | #define CHECK_ISR_SMP(iop) ~inpw((iop)+ISRA) | ||
614 | #else | ||
615 | #define CHECK_ISR() (~inpw(ISR1_A) | ~inpw(ISR2_A)) | ||
616 | #define CHECK_ISR_SMP(iop) (~inpw((iop)+ISRA) | ~inpw((iop)+ISR2)) | ||
617 | #endif | ||
618 | |||
619 | #define DMA_BUSY() (inpw(CSF_A) & CSF_BUSY_DMA) | ||
620 | #define FIFO_BUSY() (inpw(CSF_A) & CSF_BUSY_FIFO) | ||
621 | #define DMA_FIFO_BUSY() (inpw(CSF_A) & (CSF_BUSY_DMA | CSF_BUSY_FIFO)) | ||
622 | #define BUS_CHECK() { int i ; \ | ||
623 | if ((i = GET_ISR()) & IS_BUSERR) \ | ||
624 | SMT_PANIC(smc,HWM_E0020,HWM_E0020_MSG) ; \ | ||
625 | if (i & IS_CHCK_L) \ | ||
626 | SMT_PANIC(smc,HWM_E0014,HWM_E0014_MSG) ; \ | ||
627 | } | ||
628 | |||
629 | #define CHECK_DMA() { u_long k = 10000 ; \ | ||
630 | while (k && (DMA_BUSY())) { \ | ||
631 | k-- ; \ | ||
632 | BUS_CHECK() ; \ | ||
633 | } \ | ||
634 | if (!k) SMT_PANIC(smc,HWM_E0003,HWM_E0003_MSG) ; } | ||
635 | |||
636 | #define CHECK_FIFO() {u_long k = 1000000 ;\ | ||
637 | while (k && (FIFO_BUSY())) k-- ;\ | ||
638 | if (!k) SMT_PANIC(smc,HWM_E0019,HWM_E0019_MSG) ; } | ||
639 | |||
640 | #define CHECK_DMA_FIFO() {u_long k = 1000000 ;\ | ||
641 | while (k && (DMA_FIFO_BUSY())) { \ | ||
642 | k-- ;\ | ||
643 | BUS_CHECK() ; \ | ||
644 | } \ | ||
645 | if (!k) SMT_PANIC(smc,HWM_E0004,HWM_E0004_MSG) ; } | ||
646 | |||
647 | #ifndef UNIX | ||
648 | #define CLI_FBI() outp(ADDR(IRQ_OTH_DIS),0) | ||
649 | #else | ||
650 | #define CLI_FBI(smc) outp(ADDRS((smc),IRQ_OTH_DIS),0) | ||
651 | #endif | ||
652 | |||
653 | #ifndef TCI | ||
654 | #define CLI_FBI_SMP(iop) outp((iop)+IRQ_OTH_DIS,0) | ||
655 | #else | ||
656 | #define CLI_FBI_SMP(iop) outp((iop)+IRQ_OTH_DIS,0) ;\ | ||
657 | outp((iop)+IRQ_TC_DIS,0) | ||
658 | #endif | ||
659 | |||
660 | #ifndef UNIX | ||
661 | #define STI_FBI() outp(ADDR(IRQ_OTH_EN),0) | ||
662 | #else | ||
663 | #define STI_FBI(smc) outp(ADDRS((smc),IRQ_OTH_EN),0) | ||
664 | #endif | ||
665 | |||
666 | /* | ||
667 | * Terminal count primitives | ||
668 | */ | ||
669 | #define CLI_TCI(smc) outp(ADDRS((smc),IRQ_TC_DIS),0) | ||
670 | #define STI_TCI(smc) outp(ADDRS((smc),IRQ_TC_EN),0) | ||
671 | #define CHECK_TC(smc,k) {(k) = 10000 ;\ | ||
672 | while ((k) && (~inpw(ISR2_A) & IS_TC)) (k)-- ;\ | ||
673 | if (!k) SMT_PANIC(smc,HWM_E0018,HWM_E0018_MSG) ; } | ||
674 | |||
675 | #endif /* MCA */ | ||
676 | |||
677 | #ifdef ISA | ||
678 | |||
679 | /* | ||
680 | * address transmission from logic NPADDR6-0 to physical offset address on board | ||
681 | */ | ||
682 | #define FMA(a) (0x8000|(((a)&0x07)<<1)|(((a)&0x78)<<7)) /* FORMAC+ (r/w) */ | ||
683 | #define PRA(a) (0x1000|(((a)&0x07)<<1)|(((a)&0x18)<<7)) /* PROM (read only)*/ | ||
684 | #define P1A(a) (0x4000|(((a)&0x07)<<1)|(((a)&0x18)<<7)) /* PLC1 (r/w) */ | ||
685 | #define P2A(a) (0x5000|(((a)&0x07)<<1)|(((a)&0x18)<<7)) /* PLC2 (r/w) */ | ||
686 | #define TIA(a) (0x6000|(((a)&0x03)<<1)) /* Timer (r/w) */ | ||
687 | |||
688 | #define ISRA 0x0000 /* int. source register address (read only) */ | ||
689 | #define ACLA 0x0000 /* address counter low address (write only) */ | ||
690 | #define ACHA 0x0002 /* address counter high address (write only) */ | ||
691 | #define TRCA 0x0004 /* transfer counter address (write only) */ | ||
692 | #define PGRA 0x0006 /* page register address (write only) */ | ||
693 | #define RQAA 0x2000 /* Request reg. (write only) */ | ||
694 | #define CSRA 0x3000 /* control/status register address (r/w) */ | ||
695 | |||
696 | /* | ||
697 | * physical address offset + IO-Port base address | ||
698 | */ | ||
699 | #define FM_A(a) (FMA(a)+smc->hw.iop) /* FORMAC Plus physical addr */ | ||
700 | #define PR_A(a) (PRA(a)+smc->hw.iop) /* PROM (read only)*/ | ||
701 | #define P1_A(a) (P1A(a)+smc->hw.iop) /* PLC1 (r/w) */ | ||
702 | #define P2_A(a) (P2A(a)+smc->hw.iop) /* PLC2 (r/w) */ | ||
703 | #define TI_A(a) (TIA(a)+smc->hw.iop) /* Timer (r/w) */ | ||
704 | |||
705 | #define ISR_A (0x0000+smc->hw.iop) /* int. source register address (read only) */ | ||
706 | #define ACL_A (0x0000+smc->hw.iop) /* address counter low address (write only) */ | ||
707 | #define ACH_A (0x0002+smc->hw.iop) /* address counter high address (write only)*/ | ||
708 | #define TRC_A (0x0004+smc->hw.iop) /* transfer counter address (write only) */ | ||
709 | #define PGR_A (0x0006+smc->hw.iop) /* page register address (write only) */ | ||
710 | #define RQA_A (0x2000+smc->hw.iop) /* Request reg. (write only) */ | ||
711 | #define CSR_A (0x3000+smc->hw.iop) /* control/status register address (r/w) */ | ||
712 | #ifdef UNIX | ||
713 | #define CSR_AS(smc) (0x3000+(smc)->hw.iop) /* control/status register address */ | ||
714 | #endif | ||
715 | #define PLC1_I (0x3400+smc->hw.iop) /* clear PLC1 interrupt bit */ | ||
716 | #define PLC2_I (0x3800+smc->hw.iop) /* clear PLC2 interrupt bit */ | ||
717 | |||
718 | #ifndef MULT_OEM | ||
719 | #ifndef OEM_CONCEPT | ||
720 | #define SKLOGO_STR "SKFDDI" | ||
721 | #else /* OEM_CONCEPT */ | ||
722 | #define SKLOGO_STR OEM_FDDI_LOGO | ||
723 | #endif /* OEM_CONCEPT */ | ||
724 | #endif /* MULT_OEM */ | ||
725 | #define SADDRL (24) /* start address SKLOGO */ | ||
726 | #define SA_MAC (0) /* start addr. MAC_AD within the PROM */ | ||
727 | #define PRA_OFF (0) | ||
728 | #define SA_PMD_TYPE (8) /* start addr. PMD-Type */ | ||
729 | |||
730 | #define CDID (PRA(SADDRL)) /* Card ID int/O port addr. offset */ | ||
731 | #define NEXT_CDID ((PRA(SADDRL+1)) - CDID) | ||
732 | |||
733 | #define SKFDDI_PSZ 32 /* address PROM size */ | ||
734 | |||
735 | #define READ_PROM(a) ((u_char)inpw(a)) | ||
736 | #define GET_PAGE(i) outpw(PGR_A,(int)(i)) | ||
737 | |||
738 | #define MAX_PAGES 16 /* 16 pages */ | ||
739 | #define MAX_FADDR 0x2000 /* 8K per page */ | ||
740 | #define VPP_OFF() outpw(CSR_A,(inpw(CSR_A) & (CS_CRESET|CS_BYPASS))) | ||
741 | #define VPP_ON() outpw(CSR_A,(inpw(CSR_A) & (CS_CRESET|CS_BYPASS)) | \ | ||
742 | CS_VPPSW) | ||
743 | |||
744 | /* | ||
745 | * control/status register CSRA bits (log. addr: 0x3000) | ||
746 | */ | ||
747 | /* write */ | ||
748 | #define CS_CRESET 0x01 /* Card reset (0=reset) */ | ||
749 | #define CS_IMSK 0x02 /* enable IRQ (1=enable, 0=disable) */ | ||
750 | #define CS_RESINT1 0x04 /* PLINT1 reset */ | ||
751 | #define CS_VPPSW 0x10 /* 12V power switch (0=off, 1=on) */ | ||
752 | #define CS_BYPASS 0x20 /* bypass switch (0=remove, 1=insert)*/ | ||
753 | #define CS_RESINT2 0x40 /* PLINT2 reset */ | ||
754 | /* read */ | ||
755 | #define CS_BUSY 0x04 /* master transfer activ (=1) */ | ||
756 | #define CS_SW_EPROM 0x08 /* 0=Application Soft. 1=BOOT-EPROM */ | ||
757 | #define CS_BYSTAT 0x40 /* 0=Bypass exist, 1= ..not */ | ||
758 | #define CS_SAS 0x80 /* single attachement station (=1) */ | ||
759 | |||
760 | /* | ||
761 | * Interrupt source register ISRA (log. addr: 0x0000) read only & low activ. | ||
762 | */ | ||
763 | #define IS_MINTR1 0x01 /* FORMAC ST1U/L && ~IMSK1U/L*/ | ||
764 | #define IS_MINTR2 0x02 /* FORMAC ST2U/L && ~IMSK2U/L*/ | ||
765 | #define IS_PLINT1 0x04 /* PLC1 */ | ||
766 | #define IS_PLINT2 0x08 /* PLC2 */ | ||
767 | #define IS_TIMINT 0x10 /* Timer 82C54-2 */ | ||
768 | |||
769 | #define ALL_IRSR (IS_MINTR1|IS_MINTR2|IS_PLINT1|IS_PLINT2|IS_TIMINT) | ||
770 | |||
771 | #define FPROM_SW() (inpw(CSR_A)&CS_SW_EPROM) | ||
772 | #define DMA_BUSY() (inpw(CSR_A)&CS_BUSY) | ||
773 | #define CHECK_FIFO() | ||
774 | #define BUS_CHECK() | ||
775 | |||
776 | /* | ||
777 | * set Host Request register (wr.) | ||
778 | */ | ||
779 | #define SET_HRQ(qup) outpw(RQA_A+((qup)<<1),0) | ||
780 | |||
781 | #ifndef UNIX | ||
782 | #ifndef WINNT | ||
783 | #define CLI_FBI() outpw(CSR_A,(inpw(CSR_A)&(CS_CRESET|CS_BYPASS|CS_VPPSW))) | ||
784 | #else | ||
785 | #define CLI_FBI() outpw(CSR_A,(l_inpw(CSR_A) & \ | ||
786 | (CS_CRESET|CS_BYPASS|CS_VPPSW))) | ||
787 | #endif | ||
788 | #else | ||
789 | #define CLI_FBI(smc) outpw(CSR_AS(smc),(inpw(CSR_AS(smc))& \ | ||
790 | (CS_CRESET|CS_BYPASS|CS_VPPSW))) | ||
791 | #endif | ||
792 | |||
793 | #ifndef UNIX | ||
794 | #define STI_FBI() outpw(CSR_A,(inpw(CSR_A) & \ | ||
795 | (CS_CRESET|CS_BYPASS|CS_VPPSW)) | CS_IMSK) | ||
796 | #else | ||
797 | #define STI_FBI(smc) outpw(CSR_AS(smc),(inpw(CSR_AS(smc)) & \ | ||
798 | (CS_CRESET|CS_BYPASS|CS_VPPSW)) | CS_IMSK) | ||
799 | #endif | ||
800 | |||
801 | #define CHECK_DMA() {unsigned k = 10000 ;\ | ||
802 | while (k && (DMA_BUSY())) k-- ;\ | ||
803 | if (!k) SMT_PANIC(smc,HWM_E0003,HWM_E0003_MSG) ; } | ||
804 | |||
805 | #define GET_ISR() ~inpw(ISR_A) | ||
806 | |||
807 | #endif /* ISA */ | ||
808 | |||
809 | /*--------------------------------------------------------------------------*/ | ||
810 | #ifdef PCI | ||
811 | |||
812 | /* | ||
813 | * (DV) = only defined for Da Vinci | ||
814 | * (ML) = only defined for Monalisa | ||
815 | */ | ||
816 | |||
817 | /* | ||
818 | * Configuration Space header | ||
819 | */ | ||
820 | #define PCI_VENDOR_ID 0x00 /* 16 bit Vendor ID */ | ||
821 | #define PCI_DEVICE_ID 0x02 /* 16 bit Device ID */ | ||
822 | #define PCI_COMMAND 0x04 /* 16 bit Command */ | ||
823 | #define PCI_STATUS 0x06 /* 16 bit Status */ | ||
824 | #define PCI_REV_ID 0x08 /* 8 bit Revision ID */ | ||
825 | #define PCI_CLASS_CODE 0x09 /* 24 bit Class Code */ | ||
826 | #define PCI_CACHE_LSZ 0x0c /* 8 bit Cache Line Size */ | ||
827 | #define PCI_LAT_TIM 0x0d /* 8 bit Latency Timer */ | ||
828 | #define PCI_HEADER_T 0x0e /* 8 bit Header Type */ | ||
829 | #define PCI_BIST 0x0f /* 8 bit Built-in selftest */ | ||
830 | #define PCI_BASE_1ST 0x10 /* 32 bit 1st Base address */ | ||
831 | #define PCI_BASE_2ND 0x14 /* 32 bit 2nd Base address */ | ||
832 | /* Byte 18..2b: Reserved */ | ||
833 | #define PCI_SUB_VID 0x2c /* 16 bit Subsystem Vendor ID */ | ||
834 | #define PCI_SUB_ID 0x2e /* 16 bit Subsystem ID */ | ||
835 | #define PCI_BASE_ROM 0x30 /* 32 bit Expansion ROM Base Address */ | ||
836 | /* Byte 34..33: Reserved */ | ||
837 | #define PCI_CAP_PTR 0x34 /* 8 bit (ML) Capabilities Ptr */ | ||
838 | /* Byte 35..3b: Reserved */ | ||
839 | #define PCI_IRQ_LINE 0x3c /* 8 bit Interrupt Line */ | ||
840 | #define PCI_IRQ_PIN 0x3d /* 8 bit Interrupt Pin */ | ||
841 | #define PCI_MIN_GNT 0x3e /* 8 bit Min_Gnt */ | ||
842 | #define PCI_MAX_LAT 0x3f /* 8 bit Max_Lat */ | ||
843 | /* Device Dependent Region */ | ||
844 | #define PCI_OUR_REG 0x40 /* 32 bit (DV) Our Register */ | ||
845 | #define PCI_OUR_REG_1 0x40 /* 32 bit (ML) Our Register 1 */ | ||
846 | #define PCI_OUR_REG_2 0x44 /* 32 bit (ML) Our Register 2 */ | ||
847 | /* Power Management Region */ | ||
848 | #define PCI_PM_CAP_ID 0x48 /* 8 bit (ML) Power Management Cap. ID */ | ||
849 | #define PCI_PM_NITEM 0x49 /* 8 bit (ML) Next Item Ptr */ | ||
850 | #define PCI_PM_CAP_REG 0x4a /* 16 bit (ML) Power Management Capabilities */ | ||
851 | #define PCI_PM_CTL_STS 0x4c /* 16 bit (ML) Power Manag. Control/Status */ | ||
852 | /* Byte 0x4e: Reserved */ | ||
853 | #define PCI_PM_DAT_REG 0x4f /* 8 bit (ML) Power Manag. Data Register */ | ||
854 | /* VPD Region */ | ||
855 | #define PCI_VPD_CAP_ID 0x50 /* 8 bit (ML) VPD Cap. ID */ | ||
856 | #define PCI_VPD_NITEM 0x51 /* 8 bit (ML) Next Item Ptr */ | ||
857 | #define PCI_VPD_ADR_REG 0x52 /* 16 bit (ML) VPD Address Register */ | ||
858 | #define PCI_VPD_DAT_REG 0x54 /* 32 bit (ML) VPD Data Register */ | ||
859 | /* Byte 58..ff: Reserved */ | ||
860 | |||
861 | /* | ||
862 | * I2C Address (PCI Config) | ||
863 | * | ||
864 | * Note: The temperature and voltage sensors are relocated on a different | ||
865 | * I2C bus. | ||
866 | */ | ||
867 | #define I2C_ADDR_VPD 0xA0 /* I2C address for the VPD EEPROM */ | ||
868 | |||
869 | /* | ||
870 | * Define Bits and Values of the registers | ||
871 | */ | ||
872 | /* PCI_VENDOR_ID 16 bit Vendor ID */ | ||
873 | /* PCI_DEVICE_ID 16 bit Device ID */ | ||
874 | /* Values for Vendor ID and Device ID shall be patched into the code */ | ||
875 | /* PCI_COMMAND 16 bit Command */ | ||
876 | #define PCI_FBTEN 0x0200 /* Bit 9: Fast Back-To-Back enable */ | ||
877 | #define PCI_SERREN 0x0100 /* Bit 8: SERR enable */ | ||
878 | #define PCI_ADSTEP 0x0080 /* Bit 7: Address Stepping */ | ||
879 | #define PCI_PERREN 0x0040 /* Bit 6: Parity Report Response enable */ | ||
880 | #define PCI_VGA_SNOOP 0x0020 /* Bit 5: VGA palette snoop */ | ||
881 | #define PCI_MWIEN 0x0010 /* Bit 4: Memory write an inv cycl ena */ | ||
882 | #define PCI_SCYCEN 0x0008 /* Bit 3: Special Cycle enable */ | ||
883 | #define PCI_BMEN 0x0004 /* Bit 2: Bus Master enable */ | ||
884 | #define PCI_MEMEN 0x0002 /* Bit 1: Memory Space Access enable */ | ||
885 | #define PCI_IOEN 0x0001 /* Bit 0: IO Space Access enable */ | ||
886 | |||
887 | /* PCI_STATUS 16 bit Status */ | ||
888 | #define PCI_PERR 0x8000 /* Bit 15: Parity Error */ | ||
889 | #define PCI_SERR 0x4000 /* Bit 14: Signaled SERR */ | ||
890 | #define PCI_RMABORT 0x2000 /* Bit 13: Received Master Abort */ | ||
891 | #define PCI_RTABORT 0x1000 /* Bit 12: Received Target Abort */ | ||
892 | #define PCI_STABORT 0x0800 /* Bit 11: Sent Target Abort */ | ||
893 | #define PCI_DEVSEL 0x0600 /* Bit 10..9: DEVSEL Timing */ | ||
894 | #define PCI_DEV_FAST (0<<9) /* fast */ | ||
895 | #define PCI_DEV_MEDIUM (1<<9) /* medium */ | ||
896 | #define PCI_DEV_SLOW (2<<9) /* slow */ | ||
897 | #define PCI_DATAPERR 0x0100 /* Bit 8: DATA Parity error detected */ | ||
898 | #define PCI_FB2BCAP 0x0080 /* Bit 7: Fast Back-to-Back Capability */ | ||
899 | #define PCI_UDF 0x0040 /* Bit 6: User Defined Features */ | ||
900 | #define PCI_66MHZCAP 0x0020 /* Bit 5: 66 MHz PCI bus clock capable */ | ||
901 | #define PCI_NEWCAP 0x0010 /* Bit 4: New cap. list implemented */ | ||
902 | |||
903 | #define PCI_ERRBITS (PCI_PERR|PCI_SERR|PCI_RMABORT|PCI_STABORT|PCI_DATAPERR) | ||
904 | |||
905 | /* PCI_REV_ID 8 bit Revision ID */ | ||
906 | /* PCI_CLASS_CODE 24 bit Class Code */ | ||
907 | /* Byte 2: Base Class (02) */ | ||
908 | /* Byte 1: SubClass (02) */ | ||
909 | /* Byte 0: Programming Interface (00) */ | ||
910 | |||
911 | /* PCI_CACHE_LSZ 8 bit Cache Line Size */ | ||
912 | /* Possible values: 0,2,4,8,16 */ | ||
913 | |||
914 | /* PCI_LAT_TIM 8 bit Latency Timer */ | ||
915 | |||
916 | /* PCI_HEADER_T 8 bit Header Type */ | ||
917 | #define PCI_HD_MF_DEV 0x80 /* Bit 7: 0= single, 1= multi-func dev */ | ||
918 | #define PCI_HD_TYPE 0x7f /* Bit 6..0: Header Layout 0= normal */ | ||
919 | |||
920 | /* PCI_BIST 8 bit Built-in selftest */ | ||
921 | #define PCI_BIST_CAP 0x80 /* Bit 7: BIST Capable */ | ||
922 | #define PCI_BIST_ST 0x40 /* Bit 6: Start BIST */ | ||
923 | #define PCI_BIST_RET 0x0f /* Bit 3..0: Completion Code */ | ||
924 | |||
925 | /* PCI_BASE_1ST 32 bit 1st Base address */ | ||
926 | #define PCI_MEMSIZE 0x800L /* use 2 kB Memory Base */ | ||
927 | #define PCI_MEMBASE_BITS 0xfffff800L /* Bit 31..11: Memory Base Address */ | ||
928 | #define PCI_MEMSIZE_BIIS 0x000007f0L /* Bit 10..4: Memory Size Req. */ | ||
929 | #define PCI_PREFEN 0x00000008L /* Bit 3: Prefetchable */ | ||
930 | #define PCI_MEM_TYP 0x00000006L /* Bit 2..1: Memory Type */ | ||
931 | #define PCI_MEM32BIT (0<<1) /* Base addr anywhere in 32 Bit range */ | ||
932 | #define PCI_MEM1M (1<<1) /* Base addr below 1 MegaByte */ | ||
933 | #define PCI_MEM64BIT (2<<1) /* Base addr anywhere in 64 Bit range */ | ||
934 | #define PCI_MEMSPACE 0x00000001L /* Bit 0: Memory Space Indic. */ | ||
935 | |||
936 | /* PCI_BASE_2ND 32 bit 2nd Base address */ | ||
937 | #define PCI_IOBASE 0xffffff00L /* Bit 31..8: I/O Base address */ | ||
938 | #define PCI_IOSIZE 0x000000fcL /* Bit 7..2: I/O Size Requirements */ | ||
939 | #define PCI_IOSPACE 0x00000001L /* Bit 0: I/O Space Indicator */ | ||
940 | |||
941 | /* PCI_SUB_VID 16 bit Subsystem Vendor ID */ | ||
942 | /* PCI_SUB_ID 16 bit Subsystem ID */ | ||
943 | |||
944 | /* PCI_BASE_ROM 32 bit Expansion ROM Base Address */ | ||
945 | #define PCI_ROMBASE 0xfffe0000L /* Bit 31..17: ROM BASE address (1st) */ | ||
946 | #define PCI_ROMBASZ 0x0001c000L /* Bit 16..14: Treat as BASE or SIZE */ | ||
947 | #define PCI_ROMSIZE 0x00003800L /* Bit 13..11: ROM Size Requirements */ | ||
948 | #define PCI_ROMEN 0x00000001L /* Bit 0: Address Decode enable */ | ||
949 | |||
950 | /* PCI_CAP_PTR 8 bit New Capabilities Pointers */ | ||
951 | /* PCI_IRQ_LINE 8 bit Interrupt Line */ | ||
952 | /* PCI_IRQ_PIN 8 bit Interrupt Pin */ | ||
953 | /* PCI_MIN_GNT 8 bit Min_Gnt */ | ||
954 | /* PCI_MAX_LAT 8 bit Max_Lat */ | ||
955 | /* Device Dependent Region */ | ||
956 | /* PCI_OUR_REG (DV) 32 bit Our Register */ | ||
957 | /* PCI_OUR_REG_1 (ML) 32 bit Our Register 1 */ | ||
958 | /* Bit 31..29: reserved */ | ||
959 | #define PCI_PATCH_DIR (3L<<27) /*(DV) Bit 28..27: Ext Patchs direction */ | ||
960 | #define PCI_PATCH_DIR_0 (1L<<27) /*(DV) Type of the pins EXT_PATCHS<1..0> */ | ||
961 | #define PCI_PATCH_DIR_1 (1L<<28) /* 0 = input */ | ||
962 | /* 1 = output */ | ||
963 | #define PCI_EXT_PATCHS (3L<<25) /*(DV) Bit 26..25: Extended Patches */ | ||
964 | #define PCI_EXT_PATCH_0 (1L<<25) /*(DV) */ | ||
965 | #define PCI_EXT_PATCH_1 (1L<<26) /* CLK for MicroWire (ML) */ | ||
966 | #define PCI_VIO (1L<<25) /*(ML) */ | ||
967 | #define PCI_EN_BOOT (1L<<24) /* Bit 24: Enable BOOT via ROM */ | ||
968 | /* 1 = Don't boot with ROM */ | ||
969 | /* 0 = Boot with ROM */ | ||
970 | #define PCI_EN_IO (1L<<23) /* Bit 23: Mapping to IO space */ | ||
971 | #define PCI_EN_FPROM (1L<<22) /* Bit 22: FLASH mapped to mem? */ | ||
972 | /* 1 = Map Flash to Memory */ | ||
973 | /* 0 = Disable all addr. decoding */ | ||
974 | #define PCI_PAGESIZE (3L<<20) /* Bit 21..20: FLASH Page Size */ | ||
975 | #define PCI_PAGE_16 (0L<<20) /* 16 k pages */ | ||
976 | #define PCI_PAGE_32K (1L<<20) /* 32 k pages */ | ||
977 | #define PCI_PAGE_64K (2L<<20) /* 64 k pages */ | ||
978 | #define PCI_PAGE_128K (3L<<20) /* 128 k pages */ | ||
979 | /* Bit 19: reserved (ML) and (DV) */ | ||
980 | #define PCI_PAGEREG (7L<<16) /* Bit 18..16: Page Register */ | ||
981 | /* Bit 15: reserved */ | ||
982 | #define PCI_FORCE_BE (1L<<14) /* Bit 14: Assert all BEs on MR */ | ||
983 | #define PCI_DIS_MRL (1L<<13) /* Bit 13: Disable Mem R Line */ | ||
984 | #define PCI_DIS_MRM (1L<<12) /* Bit 12: Disable Mem R multip */ | ||
985 | #define PCI_DIS_MWI (1L<<11) /* Bit 11: Disable Mem W & inv */ | ||
986 | #define PCI_DISC_CLS (1L<<10) /* Bit 10: Disc: cacheLsz bound */ | ||
987 | #define PCI_BURST_DIS (1L<<9) /* Bit 9: Burst Disable */ | ||
988 | #define PCI_BYTE_SWAP (1L<<8) /*(DV) Bit 8: Byte Swap in DATA */ | ||
989 | #define PCI_SKEW_DAS (0xfL<<4) /* Bit 7..4: Skew Ctrl, DAS Ext */ | ||
990 | #define PCI_SKEW_BASE (0xfL<<0) /* Bit 3..0: Skew Ctrl, Base */ | ||
991 | |||
992 | /* PCI_OUR_REG_2 (ML) 32 bit Our Register 2 (Monalisa only) */ | ||
993 | #define PCI_VPD_WR_TH (0xffL<<24) /* Bit 24..31 VPD Write Threshold */ | ||
994 | #define PCI_DEV_SEL (0x7fL<<17) /* Bit 17..23 EEPROM Device Select */ | ||
995 | #define PCI_VPD_ROM_SZ (7L<<14) /* Bit 14..16 VPD ROM Size */ | ||
996 | /* Bit 12..13 reserved */ | ||
997 | #define PCI_PATCH_DIR2 (0xfL<<8) /* Bit 8..11 Ext Patchs dir 2..5 */ | ||
998 | #define PCI_PATCH_DIR_2 (1L<<8) /* Bit 8 CS for MicroWire */ | ||
999 | #define PCI_PATCH_DIR_3 (1L<<9) | ||
1000 | #define PCI_PATCH_DIR_4 (1L<<10) | ||
1001 | #define PCI_PATCH_DIR_5 (1L<<11) | ||
1002 | #define PCI_EXT_PATCHS2 (0xfL<<4) /* Bit 4..7 Extended Patches */ | ||
1003 | #define PCI_EXT_PATCH_2 (1L<<4) /* Bit 4 CS for MicroWire */ | ||
1004 | #define PCI_EXT_PATCH_3 (1L<<5) | ||
1005 | #define PCI_EXT_PATCH_4 (1L<<6) | ||
1006 | #define PCI_EXT_PATCH_5 (1L<<7) | ||
1007 | #define PCI_EN_DUMMY_RD (1L<<3) /* Bit 3 Enable Dummy Read */ | ||
1008 | #define PCI_REV_DESC (1L<<2) /* Bit 2 Reverse Desc. Bytes */ | ||
1009 | #define PCI_USEADDR64 (1L<<1) /* Bit 1 Use 64 Bit Addresse */ | ||
1010 | #define PCI_USEDATA64 (1L<<0) /* Bit 0 Use 64 Bit Data bus ext*/ | ||
1011 | |||
1012 | /* Power Management Region */ | ||
1013 | /* PCI_PM_CAP_ID 8 bit (ML) Power Management Cap. ID */ | ||
1014 | /* PCI_PM_NITEM 8 bit (ML) Next Item Ptr */ | ||
1015 | /* PCI_PM_CAP_REG 16 bit (ML) Power Management Capabilities*/ | ||
1016 | #define PCI_PME_SUP (0x1f<<11) /* Bit 11..15 PM Manag. Event Support*/ | ||
1017 | #define PCI_PM_D2_SUB (1<<10) /* Bit 10 D2 Support Bit */ | ||
1018 | #define PCI_PM_D1_SUB (1<<9) /* Bit 9 D1 Support Bit */ | ||
1019 | /* Bit 6..8 reserved */ | ||
1020 | #define PCI_PM_DSI (1<<5) /* Bit 5 Device Specific Init.*/ | ||
1021 | #define PCI_PM_APS (1<<4) /* Bit 4 Auxialiary Power Src */ | ||
1022 | #define PCI_PME_CLOCK (1<<3) /* Bit 3 PM Event Clock */ | ||
1023 | #define PCI_PM_VER (7<<0) /* Bit 0..2 PM PCI Spec. version */ | ||
1024 | |||
1025 | /* PCI_PM_CTL_STS 16 bit (ML) Power Manag. Control/Status */ | ||
1026 | #define PCI_PME_STATUS (1<<15) /* Bit 15 PFA doesn't sup. PME#*/ | ||
1027 | #define PCI_PM_DAT_SCL (3<<13) /* Bit 13..14 dat reg Scaling factor */ | ||
1028 | #define PCI_PM_DAT_SEL (0xf<<9) /* Bit 9..12 PM data selector field */ | ||
1029 | /* Bit 7.. 2 reserved */ | ||
1030 | #define PCI_PM_STATE (3<<0) /* Bit 0.. 1 Power Management State */ | ||
1031 | #define PCI_PM_STATE_D0 (0<<0) /* D0: Operational (default) */ | ||
1032 | #define PCI_PM_STATE_D1 (1<<0) /* D1: not supported */ | ||
1033 | #define PCI_PM_STATE_D2 (2<<0) /* D2: not supported */ | ||
1034 | #define PCI_PM_STATE_D3 (3<<0) /* D3: HOT, Power Down and Reset */ | ||
1035 | |||
1036 | /* PCI_PM_DAT_REG 8 bit (ML) Power Manag. Data Register */ | ||
1037 | /* VPD Region */ | ||
1038 | /* PCI_VPD_CAP_ID 8 bit (ML) VPD Cap. ID */ | ||
1039 | /* PCI_VPD_NITEM 8 bit (ML) Next Item Ptr */ | ||
1040 | /* PCI_VPD_ADR_REG 16 bit (ML) VPD Address Register */ | ||
1041 | #define PCI_VPD_FLAG (1<<15) /* Bit 15 starts VPD rd/wd cycle*/ | ||
1042 | |||
1043 | /* PCI_VPD_DAT_REG 32 bit (ML) VPD Data Register */ | ||
1044 | |||
1045 | /* | ||
1046 | * Control Register File: | ||
1047 | * Bank 0 | ||
1048 | */ | ||
1049 | #define B0_RAP 0x0000 /* 8 bit register address port */ | ||
1050 | /* 0x0001 - 0x0003: reserved */ | ||
1051 | #define B0_CTRL 0x0004 /* 8 bit control register */ | ||
1052 | #define B0_DAS 0x0005 /* 8 Bit control register (DAS) */ | ||
1053 | #define B0_LED 0x0006 /* 8 Bit LED register */ | ||
1054 | #define B0_TST_CTRL 0x0007 /* 8 bit test control register */ | ||
1055 | #define B0_ISRC 0x0008 /* 32 bit Interrupt source register */ | ||
1056 | #define B0_IMSK 0x000c /* 32 bit Interrupt mask register */ | ||
1057 | |||
1058 | /* 0x0010 - 0x006b: formac+ (supernet_3) fequently used registers */ | ||
1059 | #define B0_CMDREG1 0x0010 /* write command reg 1 instruction */ | ||
1060 | #define B0_CMDREG2 0x0014 /* write command reg 2 instruction */ | ||
1061 | #define B0_ST1U 0x0010 /* read upper 16-bit of status reg 1 */ | ||
1062 | #define B0_ST1L 0x0014 /* read lower 16-bit of status reg 1 */ | ||
1063 | #define B0_ST2U 0x0018 /* read upper 16-bit of status reg 2 */ | ||
1064 | #define B0_ST2L 0x001c /* read lower 16-bit of status reg 2 */ | ||
1065 | |||
1066 | #define B0_MARR 0x0020 /* r/w the memory read addr register */ | ||
1067 | #define B0_MARW 0x0024 /* r/w the memory write addr register*/ | ||
1068 | #define B0_MDRU 0x0028 /* r/w upper 16-bit of mem. data reg */ | ||
1069 | #define B0_MDRL 0x002c /* r/w lower 16-bit of mem. data reg */ | ||
1070 | |||
1071 | #define B0_MDREG3 0x0030 /* r/w Mode Register 3 */ | ||
1072 | #define B0_ST3U 0x0034 /* read upper 16-bit of status reg 3 */ | ||
1073 | #define B0_ST3L 0x0038 /* read lower 16-bit of status reg 3 */ | ||
1074 | #define B0_IMSK3U 0x003c /* r/w upper 16-bit of IMSK reg 3 */ | ||
1075 | #define B0_IMSK3L 0x0040 /* r/w lower 16-bit of IMSK reg 3 */ | ||
1076 | #define B0_IVR 0x0044 /* read Interrupt Vector register */ | ||
1077 | #define B0_IMR 0x0048 /* r/w Interrupt mask register */ | ||
1078 | /* 0x4c Hidden */ | ||
1079 | |||
1080 | #define B0_CNTRL_A 0x0050 /* control register A (r/w) */ | ||
1081 | #define B0_CNTRL_B 0x0054 /* control register B (r/w) */ | ||
1082 | #define B0_INTR_MASK 0x0058 /* interrupt mask (r/w) */ | ||
1083 | #define B0_XMIT_VECTOR 0x005c /* transmit vector register (r/w) */ | ||
1084 | |||
1085 | #define B0_STATUS_A 0x0060 /* status register A (read only) */ | ||
1086 | #define B0_STATUS_B 0x0064 /* status register B (read only) */ | ||
1087 | #define B0_CNTRL_C 0x0068 /* control register C (r/w) */ | ||
1088 | #define B0_MDREG1 0x006c /* r/w Mode Register 1 */ | ||
1089 | |||
1090 | #define B0_R1_CSR 0x0070 /* 32 bit BMU control/status reg (rec q 1) */ | ||
1091 | #define B0_R2_CSR 0x0074 /* 32 bit BMU control/status reg (rec q 2)(DV)*/ | ||
1092 | #define B0_XA_CSR 0x0078 /* 32 bit BMU control/status reg (a xmit q) */ | ||
1093 | #define B0_XS_CSR 0x007c /* 32 bit BMU control/status reg (s xmit q) */ | ||
1094 | |||
1095 | /* | ||
1096 | * Bank 1 | ||
1097 | * - completely empty (this is the RAP Block window) | ||
1098 | * Note: if RAP = 1 this page is reserved | ||
1099 | */ | ||
1100 | |||
1101 | /* | ||
1102 | * Bank 2 | ||
1103 | */ | ||
1104 | #define B2_MAC_0 0x0100 /* 8 bit MAC address Byte 0 */ | ||
1105 | #define B2_MAC_1 0x0101 /* 8 bit MAC address Byte 1 */ | ||
1106 | #define B2_MAC_2 0x0102 /* 8 bit MAC address Byte 2 */ | ||
1107 | #define B2_MAC_3 0x0103 /* 8 bit MAC address Byte 3 */ | ||
1108 | #define B2_MAC_4 0x0104 /* 8 bit MAC address Byte 4 */ | ||
1109 | #define B2_MAC_5 0x0105 /* 8 bit MAC address Byte 5 */ | ||
1110 | #define B2_MAC_6 0x0106 /* 8 bit MAC address Byte 6 (== 0) (DV) */ | ||
1111 | #define B2_MAC_7 0x0107 /* 8 bit MAC address Byte 7 (== 0) (DV) */ | ||
1112 | |||
1113 | #define B2_CONN_TYP 0x0108 /* 8 bit Connector type */ | ||
1114 | #define B2_PMD_TYP 0x0109 /* 8 bit PMD type */ | ||
1115 | /* 0x010a - 0x010b: reserved */ | ||
1116 | /* Eprom registers are currently of no use */ | ||
1117 | #define B2_E_0 0x010c /* 8 bit EPROM Byte 0 */ | ||
1118 | #define B2_E_1 0x010d /* 8 bit EPROM Byte 1 */ | ||
1119 | #define B2_E_2 0x010e /* 8 bit EPROM Byte 2 */ | ||
1120 | #define B2_E_3 0x010f /* 8 bit EPROM Byte 3 */ | ||
1121 | #define B2_FAR 0x0110 /* 32 bit Flash-Prom Address Register/Counter */ | ||
1122 | #define B2_FDP 0x0114 /* 8 bit Flash-Prom Data Port */ | ||
1123 | /* 0x0115 - 0x0117: reserved */ | ||
1124 | #define B2_LD_CRTL 0x0118 /* 8 bit loader control */ | ||
1125 | #define B2_LD_TEST 0x0119 /* 8 bit loader test */ | ||
1126 | /* 0x011a - 0x011f: reserved */ | ||
1127 | #define B2_TI_INI 0x0120 /* 32 bit Timer init value */ | ||
1128 | #define B2_TI_VAL 0x0124 /* 32 bit Timer value */ | ||
1129 | #define B2_TI_CRTL 0x0128 /* 8 bit Timer control */ | ||
1130 | #define B2_TI_TEST 0x0129 /* 8 Bit Timer Test */ | ||
1131 | /* 0x012a - 0x012f: reserved */ | ||
1132 | #define B2_WDOG_INI 0x0130 /* 32 bit Watchdog init value */ | ||
1133 | #define B2_WDOG_VAL 0x0134 /* 32 bit Watchdog value */ | ||
1134 | #define B2_WDOG_CRTL 0x0138 /* 8 bit Watchdog control */ | ||
1135 | #define B2_WDOG_TEST 0x0139 /* 8 Bit Watchdog Test */ | ||
1136 | /* 0x013a - 0x013f: reserved */ | ||
1137 | #define B2_RTM_INI 0x0140 /* 32 bit RTM init value */ | ||
1138 | #define B2_RTM_VAL 0x0144 /* 32 bit RTM value */ | ||
1139 | #define B2_RTM_CRTL 0x0148 /* 8 bit RTM control */ | ||
1140 | #define B2_RTM_TEST 0x0149 /* 8 Bit RTM Test */ | ||
1141 | |||
1142 | #define B2_TOK_COUNT 0x014c /* (ML) 32 bit Token Counter */ | ||
1143 | #define B2_DESC_ADDR_H 0x0150 /* (ML) 32 bit Desciptor Base Addr Reg High */ | ||
1144 | #define B2_CTRL_2 0x0154 /* (ML) 8 bit Control Register 2 */ | ||
1145 | #define B2_IFACE_REG 0x0155 /* (ML) 8 bit Interface Register */ | ||
1146 | /* 0x0156: reserved */ | ||
1147 | #define B2_TST_CTRL_2 0x0157 /* (ML) 8 bit Test Control Register 2 */ | ||
1148 | #define B2_I2C_CTRL 0x0158 /* (ML) 32 bit I2C Control Register */ | ||
1149 | #define B2_I2C_DATA 0x015c /* (ML) 32 bit I2C Data Register */ | ||
1150 | |||
1151 | #define B2_IRQ_MOD_INI 0x0160 /* (ML) 32 bit IRQ Moderation Timer Init Reg. */ | ||
1152 | #define B2_IRQ_MOD_VAL 0x0164 /* (ML) 32 bit IRQ Moderation Timer Value */ | ||
1153 | #define B2_IRQ_MOD_CTRL 0x0168 /* (ML) 8 bit IRQ Moderation Timer Control */ | ||
1154 | #define B2_IRQ_MOD_TEST 0x0169 /* (ML) 8 bit IRQ Moderation Timer Test */ | ||
1155 | /* 0x016a - 0x017f: reserved */ | ||
1156 | |||
1157 | /* | ||
1158 | * Bank 3 | ||
1159 | */ | ||
1160 | /* | ||
1161 | * This is a copy of the Configuration register file (lower half) | ||
1162 | */ | ||
1163 | #define B3_CFG_SPC 0x180 | ||
1164 | |||
1165 | /* | ||
1166 | * Bank 4 | ||
1167 | */ | ||
1168 | #define B4_R1_D 0x0200 /* 4*32 bit current receive Descriptor */ | ||
1169 | #define B4_R1_DA 0x0210 /* 32 bit current rec desc address */ | ||
1170 | #define B4_R1_AC 0x0214 /* 32 bit current receive Address Count */ | ||
1171 | #define B4_R1_BC 0x0218 /* 32 bit current receive Byte Counter */ | ||
1172 | #define B4_R1_CSR 0x021c /* 32 bit BMU Control/Status Register */ | ||
1173 | #define B4_R1_F 0x0220 /* 32 bit flag register */ | ||
1174 | #define B4_R1_T1 0x0224 /* 32 bit Test Register 1 */ | ||
1175 | #define B4_R1_T1_TR 0x0224 /* 8 bit Test Register 1 TR */ | ||
1176 | #define B4_R1_T1_WR 0x0225 /* 8 bit Test Register 1 WR */ | ||
1177 | #define B4_R1_T1_RD 0x0226 /* 8 bit Test Register 1 RD */ | ||
1178 | #define B4_R1_T1_SV 0x0227 /* 8 bit Test Register 1 SV */ | ||
1179 | #define B4_R1_T2 0x0228 /* 32 bit Test Register 2 */ | ||
1180 | #define B4_R1_T3 0x022c /* 32 bit Test Register 3 */ | ||
1181 | #define B4_R1_DA_H 0x0230 /* (ML) 32 bit Curr Rx Desc Address High */ | ||
1182 | #define B4_R1_AC_H 0x0234 /* (ML) 32 bit Curr Addr Counter High dword */ | ||
1183 | /* 0x0238 - 0x023f: reserved */ | ||
1184 | /* Receive queue 2 is removed on Monalisa */ | ||
1185 | #define B4_R2_D 0x0240 /* 4*32 bit current receive Descriptor (q2) */ | ||
1186 | #define B4_R2_DA 0x0250 /* 32 bit current rec desc address (q2) */ | ||
1187 | #define B4_R2_AC 0x0254 /* 32 bit current receive Address Count (q2) */ | ||
1188 | #define B4_R2_BC 0x0258 /* 32 bit current receive Byte Counter (q2) */ | ||
1189 | #define B4_R2_CSR 0x025c /* 32 bit BMU Control/Status Register (q2) */ | ||
1190 | #define B4_R2_F 0x0260 /* 32 bit flag register (q2) */ | ||
1191 | #define B4_R2_T1 0x0264 /* 32 bit Test Register 1 (q2) */ | ||
1192 | #define B4_R2_T1_TR 0x0264 /* 8 bit Test Register 1 TR (q2) */ | ||
1193 | #define B4_R2_T1_WR 0x0265 /* 8 bit Test Register 1 WR (q2) */ | ||
1194 | #define B4_R2_T1_RD 0x0266 /* 8 bit Test Register 1 RD (q2) */ | ||
1195 | #define B4_R2_T1_SV 0x0267 /* 8 bit Test Register 1 SV (q2) */ | ||
1196 | #define B4_R2_T2 0x0268 /* 32 bit Test Register 2 (q2) */ | ||
1197 | #define B4_R2_T3 0x026c /* 32 bit Test Register 3 (q2) */ | ||
1198 | /* 0x0270 - 0x027c: reserved */ | ||
1199 | |||
1200 | /* | ||
1201 | * Bank 5 | ||
1202 | */ | ||
1203 | #define B5_XA_D 0x0280 /* 4*32 bit current transmit Descriptor (xa) */ | ||
1204 | #define B5_XA_DA 0x0290 /* 32 bit current tx desc address (xa) */ | ||
1205 | #define B5_XA_AC 0x0294 /* 32 bit current tx Address Count (xa) */ | ||
1206 | #define B5_XA_BC 0x0298 /* 32 bit current tx Byte Counter (xa) */ | ||
1207 | #define B5_XA_CSR 0x029c /* 32 bit BMU Control/Status Register (xa) */ | ||
1208 | #define B5_XA_F 0x02a0 /* 32 bit flag register (xa) */ | ||
1209 | #define B5_XA_T1 0x02a4 /* 32 bit Test Register 1 (xa) */ | ||
1210 | #define B5_XA_T1_TR 0x02a4 /* 8 bit Test Register 1 TR (xa) */ | ||
1211 | #define B5_XA_T1_WR 0x02a5 /* 8 bit Test Register 1 WR (xa) */ | ||
1212 | #define B5_XA_T1_RD 0x02a6 /* 8 bit Test Register 1 RD (xa) */ | ||
1213 | #define B5_XA_T1_SV 0x02a7 /* 8 bit Test Register 1 SV (xa) */ | ||
1214 | #define B5_XA_T2 0x02a8 /* 32 bit Test Register 2 (xa) */ | ||
1215 | #define B5_XA_T3 0x02ac /* 32 bit Test Register 3 (xa) */ | ||
1216 | #define B5_XA_DA_H 0x02b0 /* (ML) 32 bit Curr Tx Desc Address High */ | ||
1217 | #define B5_XA_AC_H 0x02b4 /* (ML) 32 bit Curr Addr Counter High dword */ | ||
1218 | /* 0x02b8 - 0x02bc: reserved */ | ||
1219 | #define B5_XS_D 0x02c0 /* 4*32 bit current transmit Descriptor (xs) */ | ||
1220 | #define B5_XS_DA 0x02d0 /* 32 bit current tx desc address (xs) */ | ||
1221 | #define B5_XS_AC 0x02d4 /* 32 bit current transmit Address Count(xs) */ | ||
1222 | #define B5_XS_BC 0x02d8 /* 32 bit current transmit Byte Counter (xs) */ | ||
1223 | #define B5_XS_CSR 0x02dc /* 32 bit BMU Control/Status Register (xs) */ | ||
1224 | #define B5_XS_F 0x02e0 /* 32 bit flag register (xs) */ | ||
1225 | #define B5_XS_T1 0x02e4 /* 32 bit Test Register 1 (xs) */ | ||
1226 | #define B5_XS_T1_TR 0x02e4 /* 8 bit Test Register 1 TR (xs) */ | ||
1227 | #define B5_XS_T1_WR 0x02e5 /* 8 bit Test Register 1 WR (xs) */ | ||
1228 | #define B5_XS_T1_RD 0x02e6 /* 8 bit Test Register 1 RD (xs) */ | ||
1229 | #define B5_XS_T1_SV 0x02e7 /* 8 bit Test Register 1 SV (xs) */ | ||
1230 | #define B5_XS_T2 0x02e8 /* 32 bit Test Register 2 (xs) */ | ||
1231 | #define B5_XS_T3 0x02ec /* 32 bit Test Register 3 (xs) */ | ||
1232 | #define B5_XS_DA_H 0x02f0 /* (ML) 32 bit Curr Tx Desc Address High */ | ||
1233 | #define B5_XS_AC_H 0x02f4 /* (ML) 32 bit Curr Addr Counter High dword */ | ||
1234 | /* 0x02f8 - 0x02fc: reserved */ | ||
1235 | |||
1236 | /* | ||
1237 | * Bank 6 | ||
1238 | */ | ||
1239 | /* External PLC-S registers (SN2 compatibility for DV) */ | ||
1240 | /* External registers (ML) */ | ||
1241 | #define B6_EXT_REG 0x300 | ||
1242 | |||
1243 | /* | ||
1244 | * Bank 7 | ||
1245 | */ | ||
1246 | /* DAS PLC-S Registers */ | ||
1247 | |||
1248 | /* | ||
1249 | * Bank 8 - 15 | ||
1250 | */ | ||
1251 | /* IFCP registers */ | ||
1252 | |||
1253 | /*---------------------------------------------------------------------------*/ | ||
1254 | /* Definitions of the Bits in the registers */ | ||
1255 | |||
1256 | /* B0_RAP 16 bit register address port */ | ||
1257 | #define RAP_RAP 0x0f /* Bit 3..0: 0 = block0, .., f = block15 */ | ||
1258 | |||
1259 | /* B0_CTRL 8 bit control register */ | ||
1260 | #define CTRL_FDDI_CLR (1<<7) /* Bit 7: (ML) Clear FDDI Reset */ | ||
1261 | #define CTRL_FDDI_SET (1<<6) /* Bit 6: (ML) Set FDDI Reset */ | ||
1262 | #define CTRL_HPI_CLR (1<<5) /* Bit 5: Clear HPI SM reset */ | ||
1263 | #define CTRL_HPI_SET (1<<4) /* Bit 4: Set HPI SM reset */ | ||
1264 | #define CTRL_MRST_CLR (1<<3) /* Bit 3: Clear Master reset */ | ||
1265 | #define CTRL_MRST_SET (1<<2) /* Bit 2: Set Master reset */ | ||
1266 | #define CTRL_RST_CLR (1<<1) /* Bit 1: Clear Software reset */ | ||
1267 | #define CTRL_RST_SET (1<<0) /* Bit 0: Set Software reset */ | ||
1268 | |||
1269 | /* B0_DAS 8 Bit control register (DAS) */ | ||
1270 | #define BUS_CLOCK (1<<7) /* Bit 7: (ML) Bus Clock 0/1 = 33/66MHz */ | ||
1271 | #define BUS_SLOT_SZ (1<<6) /* Bit 6: (ML) Slot Size 0/1 = 32/64 bit slot*/ | ||
1272 | /* Bit 5..4: reserved */ | ||
1273 | #define DAS_AVAIL (1<<3) /* Bit 3: 1 = DAS, 0 = SAS */ | ||
1274 | #define DAS_BYP_ST (1<<2) /* Bit 2: 1 = avail,SAS, 0 = not avail */ | ||
1275 | #define DAS_BYP_INS (1<<1) /* Bit 1: 1 = insert Bypass */ | ||
1276 | #define DAS_BYP_RMV (1<<0) /* Bit 0: 1 = remove Bypass */ | ||
1277 | |||
1278 | /* B0_LED 8 Bit LED register */ | ||
1279 | /* Bit 7..6: reserved */ | ||
1280 | #define LED_2_ON (1<<5) /* Bit 5: 1 = switch LED_2 on (left,gn)*/ | ||
1281 | #define LED_2_OFF (1<<4) /* Bit 4: 1 = switch LED_2 off */ | ||
1282 | #define LED_1_ON (1<<3) /* Bit 3: 1 = switch LED_1 on (mid,yel)*/ | ||
1283 | #define LED_1_OFF (1<<2) /* Bit 2: 1 = switch LED_1 off */ | ||
1284 | #define LED_0_ON (1<<1) /* Bit 1: 1 = switch LED_0 on (rght,gn)*/ | ||
1285 | #define LED_0_OFF (1<<0) /* Bit 0: 1 = switch LED_0 off */ | ||
1286 | /* This hardware defines are very ugly therefore we define some others */ | ||
1287 | |||
1288 | #define LED_GA_ON LED_2_ON /* S port = A port */ | ||
1289 | #define LED_GA_OFF LED_2_OFF /* S port = A port */ | ||
1290 | #define LED_MY_ON LED_1_ON | ||
1291 | #define LED_MY_OFF LED_1_OFF | ||
1292 | #define LED_GB_ON LED_0_ON | ||
1293 | #define LED_GB_OFF LED_0_OFF | ||
1294 | |||
1295 | /* B0_TST_CTRL 8 bit test control register */ | ||
1296 | #define TST_FRC_DPERR_MR (1<<7) /* Bit 7: force DATAPERR on MST RE. */ | ||
1297 | #define TST_FRC_DPERR_MW (1<<6) /* Bit 6: force DATAPERR on MST WR. */ | ||
1298 | #define TST_FRC_DPERR_TR (1<<5) /* Bit 5: force DATAPERR on TRG RE. */ | ||
1299 | #define TST_FRC_DPERR_TW (1<<4) /* Bit 4: force DATAPERR on TRG WR. */ | ||
1300 | #define TST_FRC_APERR_M (1<<3) /* Bit 3: force ADDRPERR on MST */ | ||
1301 | #define TST_FRC_APERR_T (1<<2) /* Bit 2: force ADDRPERR on TRG */ | ||
1302 | #define TST_CFG_WRITE_ON (1<<1) /* Bit 1: ena configuration reg. WR */ | ||
1303 | #define TST_CFG_WRITE_OFF (1<<0) /* Bit 0: dis configuration reg. WR */ | ||
1304 | |||
1305 | /* B0_ISRC 32 bit Interrupt source register */ | ||
1306 | /* Bit 31..28: reserved */ | ||
1307 | #define IS_I2C_READY (1L<<27) /* Bit 27: (ML) IRQ on end of I2C tx */ | ||
1308 | #define IS_IRQ_SW (1L<<26) /* Bit 26: (ML) SW forced IRQ */ | ||
1309 | #define IS_EXT_REG (1L<<25) /* Bit 25: (ML) IRQ from external reg*/ | ||
1310 | #define IS_IRQ_STAT (1L<<24) /* Bit 24: IRQ status exception */ | ||
1311 | /* PERR, RMABORT, RTABORT DATAPERR */ | ||
1312 | #define IS_IRQ_MST_ERR (1L<<23) /* Bit 23: IRQ master error */ | ||
1313 | /* RMABORT, RTABORT, DATAPERR */ | ||
1314 | #define IS_TIMINT (1L<<22) /* Bit 22: IRQ_TIMER */ | ||
1315 | #define IS_TOKEN (1L<<21) /* Bit 21: IRQ_RTM */ | ||
1316 | /* | ||
1317 | * Note: The DAS is our First Port (!=PA) | ||
1318 | */ | ||
1319 | #define IS_PLINT1 (1L<<20) /* Bit 20: IRQ_PHY_DAS */ | ||
1320 | #define IS_PLINT2 (1L<<19) /* Bit 19: IRQ_IFCP_4 */ | ||
1321 | #define IS_MINTR3 (1L<<18) /* Bit 18: IRQ_IFCP_3/IRQ_PHY */ | ||
1322 | #define IS_MINTR2 (1L<<17) /* Bit 17: IRQ_IFCP_2/IRQ_MAC_2 */ | ||
1323 | #define IS_MINTR1 (1L<<16) /* Bit 16: IRQ_IFCP_1/IRQ_MAC_1 */ | ||
1324 | /* Receive Queue 1 */ | ||
1325 | #define IS_R1_P (1L<<15) /* Bit 15: Parity Error (q1) */ | ||
1326 | #define IS_R1_B (1L<<14) /* Bit 14: End of Buffer (q1) */ | ||
1327 | #define IS_R1_F (1L<<13) /* Bit 13: End of Frame (q1) */ | ||
1328 | #define IS_R1_C (1L<<12) /* Bit 12: Encoding Error (q1) */ | ||
1329 | /* Receive Queue 2 */ | ||
1330 | #define IS_R2_P (1L<<11) /* Bit 11: (DV) Parity Error (q2) */ | ||
1331 | #define IS_R2_B (1L<<10) /* Bit 10: (DV) End of Buffer (q2) */ | ||
1332 | #define IS_R2_F (1L<<9) /* Bit 9: (DV) End of Frame (q2) */ | ||
1333 | #define IS_R2_C (1L<<8) /* Bit 8: (DV) Encoding Error (q2) */ | ||
1334 | /* Asynchronous Transmit queue */ | ||
1335 | /* Bit 7: reserved */ | ||
1336 | #define IS_XA_B (1L<<6) /* Bit 6: End of Buffer (xa) */ | ||
1337 | #define IS_XA_F (1L<<5) /* Bit 5: End of Frame (xa) */ | ||
1338 | #define IS_XA_C (1L<<4) /* Bit 4: Encoding Error (xa) */ | ||
1339 | /* Synchronous Transmit queue */ | ||
1340 | /* Bit 3: reserved */ | ||
1341 | #define IS_XS_B (1L<<2) /* Bit 2: End of Buffer (xs) */ | ||
1342 | #define IS_XS_F (1L<<1) /* Bit 1: End of Frame (xs) */ | ||
1343 | #define IS_XS_C (1L<<0) /* Bit 0: Encoding Error (xs) */ | ||
1344 | |||
1345 | /* | ||
1346 | * Define all valid interrupt source Bits from GET_ISR () | ||
1347 | */ | ||
1348 | #define ALL_IRSR 0x01ffff77L /* (DV) */ | ||
1349 | #define ALL_IRSR_ML 0x0ffff077L /* (ML) */ | ||
1350 | |||
1351 | |||
1352 | /* B0_IMSK 32 bit Interrupt mask register */ | ||
1353 | /* | ||
1354 | * The Bit definnition of this register are the same as of the interrupt | ||
1355 | * source register. These definition are directly derived from the Hardware | ||
1356 | * spec. | ||
1357 | */ | ||
1358 | /* Bit 31..28: reserved */ | ||
1359 | #define IRQ_I2C_READY (1L<<27) /* Bit 27: (ML) IRQ on end of I2C tx */ | ||
1360 | #define IRQ_SW (1L<<26) /* Bit 26: (ML) SW forced IRQ */ | ||
1361 | #define IRQ_EXT_REG (1L<<25) /* Bit 25: (ML) IRQ from external reg*/ | ||
1362 | #define IRQ_STAT (1L<<24) /* Bit 24: IRQ status exception */ | ||
1363 | /* PERR, RMABORT, RTABORT DATAPERR */ | ||
1364 | #define IRQ_MST_ERR (1L<<23) /* Bit 23: IRQ master error */ | ||
1365 | /* RMABORT, RTABORT, DATAPERR */ | ||
1366 | #define IRQ_TIMER (1L<<22) /* Bit 22: IRQ_TIMER */ | ||
1367 | #define IRQ_RTM (1L<<21) /* Bit 21: IRQ_RTM */ | ||
1368 | #define IRQ_DAS (1L<<20) /* Bit 20: IRQ_PHY_DAS */ | ||
1369 | #define IRQ_IFCP_4 (1L<<19) /* Bit 19: IRQ_IFCP_4 */ | ||
1370 | #define IRQ_IFCP_3 (1L<<18) /* Bit 18: IRQ_IFCP_3/IRQ_PHY */ | ||
1371 | #define IRQ_IFCP_2 (1L<<17) /* Bit 17: IRQ_IFCP_2/IRQ_MAC_2 */ | ||
1372 | #define IRQ_IFCP_1 (1L<<16) /* Bit 16: IRQ_IFCP_1/IRQ_MAC_1 */ | ||
1373 | /* Receive Queue 1 */ | ||
1374 | #define IRQ_R1_P (1L<<15) /* Bit 15: Parity Error (q1) */ | ||
1375 | #define IRQ_R1_B (1L<<14) /* Bit 14: End of Buffer (q1) */ | ||
1376 | #define IRQ_R1_F (1L<<13) /* Bit 13: End of Frame (q1) */ | ||
1377 | #define IRQ_R1_C (1L<<12) /* Bit 12: Encoding Error (q1) */ | ||
1378 | /* Receive Queue 2 */ | ||
1379 | #define IRQ_R2_P (1L<<11) /* Bit 11: (DV) Parity Error (q2) */ | ||
1380 | #define IRQ_R2_B (1L<<10) /* Bit 10: (DV) End of Buffer (q2) */ | ||
1381 | #define IRQ_R2_F (1L<<9) /* Bit 9: (DV) End of Frame (q2) */ | ||
1382 | #define IRQ_R2_C (1L<<8) /* Bit 8: (DV) Encoding Error (q2) */ | ||
1383 | /* Asynchronous Transmit queue */ | ||
1384 | /* Bit 7: reserved */ | ||
1385 | #define IRQ_XA_B (1L<<6) /* Bit 6: End of Buffer (xa) */ | ||
1386 | #define IRQ_XA_F (1L<<5) /* Bit 5: End of Frame (xa) */ | ||
1387 | #define IRQ_XA_C (1L<<4) /* Bit 4: Encoding Error (xa) */ | ||
1388 | /* Synchronous Transmit queue */ | ||
1389 | /* Bit 3: reserved */ | ||
1390 | #define IRQ_XS_B (1L<<2) /* Bit 2: End of Buffer (xs) */ | ||
1391 | #define IRQ_XS_F (1L<<1) /* Bit 1: End of Frame (xs) */ | ||
1392 | #define IRQ_XS_C (1L<<0) /* Bit 0: Encoding Error (xs) */ | ||
1393 | |||
1394 | /* 0x0010 - 0x006b: formac+ (supernet_3) fequently used registers */ | ||
1395 | /* B0_R1_CSR 32 bit BMU control/status reg (rec q 1 ) */ | ||
1396 | /* B0_R2_CSR 32 bit BMU control/status reg (rec q 2 ) */ | ||
1397 | /* B0_XA_CSR 32 bit BMU control/status reg (a xmit q ) */ | ||
1398 | /* B0_XS_CSR 32 bit BMU control/status reg (s xmit q ) */ | ||
1399 | /* The registers are the same as B4_R1_CSR, B4_R2_CSR, B5_Xa_CSR, B5_XS_CSR */ | ||
1400 | |||
1401 | /* B2_MAC_0 8 bit MAC address Byte 0 */ | ||
1402 | /* B2_MAC_1 8 bit MAC address Byte 1 */ | ||
1403 | /* B2_MAC_2 8 bit MAC address Byte 2 */ | ||
1404 | /* B2_MAC_3 8 bit MAC address Byte 3 */ | ||
1405 | /* B2_MAC_4 8 bit MAC address Byte 4 */ | ||
1406 | /* B2_MAC_5 8 bit MAC address Byte 5 */ | ||
1407 | /* B2_MAC_6 8 bit MAC address Byte 6 (== 0) (DV) */ | ||
1408 | /* B2_MAC_7 8 bit MAC address Byte 7 (== 0) (DV) */ | ||
1409 | |||
1410 | /* B2_CONN_TYP 8 bit Connector type */ | ||
1411 | /* B2_PMD_TYP 8 bit PMD type */ | ||
1412 | /* Values of connector and PMD type comply to SysKonnect internal std */ | ||
1413 | |||
1414 | /* The EPROM register are currently of no use */ | ||
1415 | /* B2_E_0 8 bit EPROM Byte 0 */ | ||
1416 | /* B2_E_1 8 bit EPROM Byte 1 */ | ||
1417 | /* B2_E_2 8 bit EPROM Byte 2 */ | ||
1418 | /* B2_E_3 8 bit EPROM Byte 3 */ | ||
1419 | |||
1420 | /* B2_FAR 32 bit Flash-Prom Address Register/Counter */ | ||
1421 | #define FAR_ADDR 0x1ffffL /* Bit 16..0: FPROM Address mask */ | ||
1422 | |||
1423 | /* B2_FDP 8 bit Flash-Prom Data Port */ | ||
1424 | |||
1425 | /* B2_LD_CRTL 8 bit loader control */ | ||
1426 | /* Bits are currently reserved */ | ||
1427 | |||
1428 | /* B2_LD_TEST 8 bit loader test */ | ||
1429 | #define LD_T_ON (1<<3) /* Bit 3: Loader Testmode on */ | ||
1430 | #define LD_T_OFF (1<<2) /* Bit 2: Loader Testmode off */ | ||
1431 | #define LD_T_STEP (1<<1) /* Bit 1: Decrement FPROM addr. Counter */ | ||
1432 | #define LD_START (1<<0) /* Bit 0: Start loading FPROM */ | ||
1433 | |||
1434 | /* B2_TI_INI 32 bit Timer init value */ | ||
1435 | /* B2_TI_VAL 32 bit Timer value */ | ||
1436 | /* B2_TI_CRTL 8 bit Timer control */ | ||
1437 | /* B2_TI_TEST 8 Bit Timer Test */ | ||
1438 | /* B2_WDOG_INI 32 bit Watchdog init value */ | ||
1439 | /* B2_WDOG_VAL 32 bit Watchdog value */ | ||
1440 | /* B2_WDOG_CRTL 8 bit Watchdog control */ | ||
1441 | /* B2_WDOG_TEST 8 Bit Watchdog Test */ | ||
1442 | /* B2_RTM_INI 32 bit RTM init value */ | ||
1443 | /* B2_RTM_VAL 32 bit RTM value */ | ||
1444 | /* B2_RTM_CRTL 8 bit RTM control */ | ||
1445 | /* B2_RTM_TEST 8 Bit RTM Test */ | ||
1446 | /* B2_<TIM>_CRTL 8 bit <TIM> control */ | ||
1447 | /* B2_IRQ_MOD_INI 32 bit IRQ Moderation Timer Init Reg. (ML) */ | ||
1448 | /* B2_IRQ_MOD_VAL 32 bit IRQ Moderation Timer Value (ML) */ | ||
1449 | /* B2_IRQ_MOD_CTRL 8 bit IRQ Moderation Timer Control (ML) */ | ||
1450 | /* B2_IRQ_MOD_TEST 8 bit IRQ Moderation Timer Test (ML) */ | ||
1451 | #define GET_TOK_CT (1<<4) /* Bit 4: Get the Token Counter (RTM) */ | ||
1452 | #define TIM_RES_TOK (1<<3) /* Bit 3: RTM Status: 1 == restricted */ | ||
1453 | #define TIM_ALARM (1<<3) /* Bit 3: Timer Alarm (WDOG) */ | ||
1454 | #define TIM_START (1<<2) /* Bit 2: Start Timer (TI,WDOG,RTM,IRQ_MOD)*/ | ||
1455 | #define TIM_STOP (1<<1) /* Bit 1: Stop Timer (TI,WDOG,RTM,IRQ_MOD) */ | ||
1456 | #define TIM_CL_IRQ (1<<0) /* Bit 0: Clear Timer IRQ (TI,WDOG,RTM) */ | ||
1457 | /* B2_<TIM>_TEST 8 Bit <TIM> Test */ | ||
1458 | #define TIM_T_ON (1<<2) /* Bit 2: Test mode on (TI,WDOG,RTM,IRQ_MOD) */ | ||
1459 | #define TIM_T_OFF (1<<1) /* Bit 1: Test mode off (TI,WDOG,RTM,IRQ_MOD) */ | ||
1460 | #define TIM_T_STEP (1<<0) /* Bit 0: Test step (TI,WDOG,RTM,IRQ_MOD) */ | ||
1461 | |||
1462 | /* B2_TOK_COUNT 0x014c (ML) 32 bit Token Counter */ | ||
1463 | /* B2_DESC_ADDR_H 0x0150 (ML) 32 bit Desciptor Base Addr Reg High */ | ||
1464 | /* B2_CTRL_2 0x0154 (ML) 8 bit Control Register 2 */ | ||
1465 | /* Bit 7..5: reserved */ | ||
1466 | #define CTRL_CL_I2C_IRQ (1<<4) /* Bit 4: Clear I2C IRQ */ | ||
1467 | #define CTRL_ST_SW_IRQ (1<<3) /* Bit 3: Set IRQ SW Request */ | ||
1468 | #define CTRL_CL_SW_IRQ (1<<2) /* Bit 2: Clear IRQ SW Request */ | ||
1469 | #define CTRL_STOP_DONE (1<<1) /* Bit 1: Stop Master is finished */ | ||
1470 | #define CTRL_STOP_MAST (1<<0) /* Bit 0: Command Bit to stop the master*/ | ||
1471 | |||
1472 | /* B2_IFACE_REG 0x0155 (ML) 8 bit Interface Register */ | ||
1473 | /* Bit 7..3: reserved */ | ||
1474 | #define IF_I2C_DATA_DIR (1<<2) /* Bit 2: direction of IF_I2C_DATA*/ | ||
1475 | #define IF_I2C_DATA (1<<1) /* Bit 1: I2C Data Port */ | ||
1476 | #define IF_I2C_CLK (1<<0) /* Bit 0: I2C Clock Port */ | ||
1477 | |||
1478 | /* 0x0156: reserved */ | ||
1479 | /* B2_TST_CTRL_2 0x0157 (ML) 8 bit Test Control Register 2 */ | ||
1480 | /* Bit 7..4: reserved */ | ||
1481 | /* force the following error on */ | ||
1482 | /* the next master read/write */ | ||
1483 | #define TST_FRC_DPERR_MR64 (1<<3) /* Bit 3: DataPERR RD 64 */ | ||
1484 | #define TST_FRC_DPERR_MW64 (1<<2) /* Bit 2: DataPERR WR 64 */ | ||
1485 | #define TST_FRC_APERR_1M64 (1<<1) /* Bit 1: AddrPERR on 1. phase */ | ||
1486 | #define TST_FRC_APERR_2M64 (1<<0) /* Bit 0: AddrPERR on 2. phase */ | ||
1487 | |||
1488 | /* B2_I2C_CTRL 0x0158 (ML) 32 bit I2C Control Register */ | ||
1489 | #define I2C_FLAG (1L<<31) /* Bit 31: Start read/write if WR */ | ||
1490 | #define I2C_ADDR (0x7fffL<<16) /* Bit 30..16: Addr to be read/written*/ | ||
1491 | #define I2C_DEV_SEL (0x7fL<<9) /* Bit 9..15: I2C Device Select */ | ||
1492 | /* Bit 5.. 8: reserved */ | ||
1493 | #define I2C_BURST_LEN (1L<<4) /* Bit 4 Burst Len, 1/4 bytes */ | ||
1494 | #define I2C_DEV_SIZE (7L<<1) /* Bit 1.. 3: I2C Device Size */ | ||
1495 | #define I2C_025K_DEV (0L<<1) /* 0: 256 Bytes or smaller*/ | ||
1496 | #define I2C_05K_DEV (1L<<1) /* 1: 512 Bytes */ | ||
1497 | #define I2C_1K_DEV (2L<<1) /* 2: 1024 Bytes */ | ||
1498 | #define I2C_2K_DEV (3L<<1) /* 3: 2048 Bytes */ | ||
1499 | #define I2C_4K_DEV (4L<<1) /* 4: 4096 Bytes */ | ||
1500 | #define I2C_8K_DEV (5L<<1) /* 5: 8192 Bytes */ | ||
1501 | #define I2C_16K_DEV (6L<<1) /* 6: 16384 Bytes */ | ||
1502 | #define I2C_32K_DEV (7L<<1) /* 7: 32768 Bytes */ | ||
1503 | #define I2C_STOP_BIT (1<<0) /* Bit 0: Interrupt I2C transfer */ | ||
1504 | |||
1505 | /* | ||
1506 | * I2C Addresses | ||
1507 | * | ||
1508 | * The temperature sensor and the voltage sensor are on the same I2C bus. | ||
1509 | * Note: The voltage sensor (Micorwire) will be selected by PCI_EXT_PATCH_1 | ||
1510 | * in PCI_OUR_REG 1. | ||
1511 | */ | ||
1512 | #define I2C_ADDR_TEMP 0x90 /* I2C Address Temperature Sensor */ | ||
1513 | |||
1514 | /* B2_I2C_DATA 0x015c (ML) 32 bit I2C Data Register */ | ||
1515 | |||
1516 | /* B4_R1_D 4*32 bit current receive Descriptor (q1) */ | ||
1517 | /* B4_R1_DA 32 bit current rec desc address (q1) */ | ||
1518 | /* B4_R1_AC 32 bit current receive Address Count (q1) */ | ||
1519 | /* B4_R1_BC 32 bit current receive Byte Counter (q1) */ | ||
1520 | /* B4_R1_CSR 32 bit BMU Control/Status Register (q1) */ | ||
1521 | /* B4_R1_F 32 bit flag register (q1) */ | ||
1522 | /* B4_R1_T1 32 bit Test Register 1 (q1) */ | ||
1523 | /* B4_R1_T2 32 bit Test Register 2 (q1) */ | ||
1524 | /* B4_R1_T3 32 bit Test Register 3 (q1) */ | ||
1525 | /* B4_R2_D 4*32 bit current receive Descriptor (q2) */ | ||
1526 | /* B4_R2_DA 32 bit current rec desc address (q2) */ | ||
1527 | /* B4_R2_AC 32 bit current receive Address Count (q2) */ | ||
1528 | /* B4_R2_BC 32 bit current receive Byte Counter (q2) */ | ||
1529 | /* B4_R2_CSR 32 bit BMU Control/Status Register (q2) */ | ||
1530 | /* B4_R2_F 32 bit flag register (q2) */ | ||
1531 | /* B4_R2_T1 32 bit Test Register 1 (q2) */ | ||
1532 | /* B4_R2_T2 32 bit Test Register 2 (q2) */ | ||
1533 | /* B4_R2_T3 32 bit Test Register 3 (q2) */ | ||
1534 | /* B5_XA_D 4*32 bit current receive Descriptor (xa) */ | ||
1535 | /* B5_XA_DA 32 bit current rec desc address (xa) */ | ||
1536 | /* B5_XA_AC 32 bit current receive Address Count (xa) */ | ||
1537 | /* B5_XA_BC 32 bit current receive Byte Counter (xa) */ | ||
1538 | /* B5_XA_CSR 32 bit BMU Control/Status Register (xa) */ | ||
1539 | /* B5_XA_F 32 bit flag register (xa) */ | ||
1540 | /* B5_XA_T1 32 bit Test Register 1 (xa) */ | ||
1541 | /* B5_XA_T2 32 bit Test Register 2 (xa) */ | ||
1542 | /* B5_XA_T3 32 bit Test Register 3 (xa) */ | ||
1543 | /* B5_XS_D 4*32 bit current receive Descriptor (xs) */ | ||
1544 | /* B5_XS_DA 32 bit current rec desc address (xs) */ | ||
1545 | /* B5_XS_AC 32 bit current receive Address Count (xs) */ | ||
1546 | /* B5_XS_BC 32 bit current receive Byte Counter (xs) */ | ||
1547 | /* B5_XS_CSR 32 bit BMU Control/Status Register (xs) */ | ||
1548 | /* B5_XS_F 32 bit flag register (xs) */ | ||
1549 | /* B5_XS_T1 32 bit Test Register 1 (xs) */ | ||
1550 | /* B5_XS_T2 32 bit Test Register 2 (xs) */ | ||
1551 | /* B5_XS_T3 32 bit Test Register 3 (xs) */ | ||
1552 | /* B5_<xx>_CSR 32 bit BMU Control/Status Register (xx) */ | ||
1553 | #define CSR_DESC_CLEAR (1L<<21) /* Bit 21: Clear Reset for Descr */ | ||
1554 | #define CSR_DESC_SET (1L<<20) /* Bit 20: Set Reset for Descr */ | ||
1555 | #define CSR_FIFO_CLEAR (1L<<19) /* Bit 19: Clear Reset for FIFO */ | ||
1556 | #define CSR_FIFO_SET (1L<<18) /* Bit 18: Set Reset for FIFO */ | ||
1557 | #define CSR_HPI_RUN (1L<<17) /* Bit 17: Release HPI SM */ | ||
1558 | #define CSR_HPI_RST (1L<<16) /* Bit 16: Reset HPI SM to Idle */ | ||
1559 | #define CSR_SV_RUN (1L<<15) /* Bit 15: Release Supervisor SM */ | ||
1560 | #define CSR_SV_RST (1L<<14) /* Bit 14: Reset Supervisor SM */ | ||
1561 | #define CSR_DREAD_RUN (1L<<13) /* Bit 13: Release Descr Read SM */ | ||
1562 | #define CSR_DREAD_RST (1L<<12) /* Bit 12: Reset Descr Read SM */ | ||
1563 | #define CSR_DWRITE_RUN (1L<<11) /* Bit 11: Rel. Descr Write SM */ | ||
1564 | #define CSR_DWRITE_RST (1L<<10) /* Bit 10: Reset Descr Write SM */ | ||
1565 | #define CSR_TRANS_RUN (1L<<9) /* Bit 9: Release Transfer SM */ | ||
1566 | #define CSR_TRANS_RST (1L<<8) /* Bit 8: Reset Transfer SM */ | ||
1567 | /* Bit 7..5: reserved */ | ||
1568 | #define CSR_START (1L<<4) /* Bit 4: Start Rec/Xmit Queue */ | ||
1569 | #define CSR_IRQ_CL_P (1L<<3) /* Bit 3: Clear Parity IRQ, Rcv */ | ||
1570 | #define CSR_IRQ_CL_B (1L<<2) /* Bit 2: Clear EOB IRQ */ | ||
1571 | #define CSR_IRQ_CL_F (1L<<1) /* Bit 1: Clear EOF IRQ */ | ||
1572 | #define CSR_IRQ_CL_C (1L<<0) /* Bit 0: Clear ERR IRQ */ | ||
1573 | |||
1574 | #define CSR_SET_RESET (CSR_DESC_SET|CSR_FIFO_SET|CSR_HPI_RST|CSR_SV_RST|\ | ||
1575 | CSR_DREAD_RST|CSR_DWRITE_RST|CSR_TRANS_RST) | ||
1576 | #define CSR_CLR_RESET (CSR_DESC_CLEAR|CSR_FIFO_CLEAR|CSR_HPI_RUN|CSR_SV_RUN|\ | ||
1577 | CSR_DREAD_RUN|CSR_DWRITE_RUN|CSR_TRANS_RUN) | ||
1578 | |||
1579 | |||
1580 | /* B5_<xx>_F 32 bit flag register (xx) */ | ||
1581 | /* Bit 28..31: reserved */ | ||
1582 | #define F_ALM_FULL (1L<<27) /* Bit 27: (ML) FIFO almost full */ | ||
1583 | #define F_FIFO_EOF (1L<<26) /* Bit 26: (ML) Fag bit in FIFO */ | ||
1584 | #define F_WM_REACHED (1L<<25) /* Bit 25: (ML) Watermark reached */ | ||
1585 | #define F_UP_DW_USED (1L<<24) /* Bit 24: (ML) Upper Dword used (bug)*/ | ||
1586 | /* Bit 23: reserved */ | ||
1587 | #define F_FIFO_LEVEL (0x1fL<<16) /* Bit 16..22:(ML) # of Qwords in FIFO*/ | ||
1588 | /* Bit 8..15: reserved */ | ||
1589 | #define F_ML_WATER_M 0x0000ffL /* Bit 0.. 7:(ML) Watermark */ | ||
1590 | #define FLAG_WATER 0x00001fL /* Bit 4..0:(DV) Level of req data tr.*/ | ||
1591 | |||
1592 | /* B5_<xx>_T1 32 bit Test Register 1 (xx) */ | ||
1593 | /* Holds four State Machine control Bytes */ | ||
1594 | #define SM_CRTL_SV (0xffL<<24) /* Bit 31..24: Control Supervisor SM */ | ||
1595 | #define SM_CRTL_RD (0xffL<<16) /* Bit 23..16: Control Read Desc SM */ | ||
1596 | #define SM_CRTL_WR (0xffL<<8) /* Bit 15..8: Control Write Desc SM */ | ||
1597 | #define SM_CRTL_TR (0xffL<<0) /* Bit 7..0: Control Transfer SM */ | ||
1598 | |||
1599 | /* B4_<xx>_T1_TR 8 bit Test Register 1 TR (xx) */ | ||
1600 | /* B4_<xx>_T1_WR 8 bit Test Register 1 WR (xx) */ | ||
1601 | /* B4_<xx>_T1_RD 8 bit Test Register 1 RD (xx) */ | ||
1602 | /* B4_<xx>_T1_SV 8 bit Test Register 1 SV (xx) */ | ||
1603 | /* The control status byte of each machine looks like ... */ | ||
1604 | #define SM_STATE 0xf0 /* Bit 7..4: State which shall be loaded */ | ||
1605 | #define SM_LOAD 0x08 /* Bit 3: Load the SM with SM_STATE */ | ||
1606 | #define SM_TEST_ON 0x04 /* Bit 2: Switch on SM Test Mode */ | ||
1607 | #define SM_TEST_OFF 0x02 /* Bit 1: Go off the Test Mode */ | ||
1608 | #define SM_STEP 0x01 /* Bit 0: Step the State Machine */ | ||
1609 | |||
1610 | /* The coding of the states */ | ||
1611 | #define SM_SV_IDLE 0x0 /* Supervisor Idle Tr/Re */ | ||
1612 | #define SM_SV_RES_START 0x1 /* Supervisor Res_Start Tr/Re */ | ||
1613 | #define SM_SV_GET_DESC 0x3 /* Supervisor Get_Desc Tr/Re */ | ||
1614 | #define SM_SV_CHECK 0x2 /* Supervisor Check Tr/Re */ | ||
1615 | #define SM_SV_MOV_DATA 0x6 /* Supervisor Move_Data Tr/Re */ | ||
1616 | #define SM_SV_PUT_DESC 0x7 /* Supervisor Put_Desc Tr/Re */ | ||
1617 | #define SM_SV_SET_IRQ 0x5 /* Supervisor Set_Irq Tr/Re */ | ||
1618 | |||
1619 | #define SM_RD_IDLE 0x0 /* Read Desc. Idle Tr/Re */ | ||
1620 | #define SM_RD_LOAD 0x1 /* Read Desc. Load Tr/Re */ | ||
1621 | #define SM_RD_WAIT_TC 0x3 /* Read Desc. Wait_TC Tr/Re */ | ||
1622 | #define SM_RD_RST_EOF 0x6 /* Read Desc. Reset_EOF Re */ | ||
1623 | #define SM_RD_WDONE_R 0x2 /* Read Desc. Wait_Done Re */ | ||
1624 | #define SM_RD_WDONE_T 0x4 /* Read Desc. Wait_Done Tr */ | ||
1625 | |||
1626 | #define SM_TR_IDLE 0x0 /* Trans. Data Idle Tr/Re */ | ||
1627 | #define SM_TR_LOAD 0x3 /* Trans. Data Load Tr/Re */ | ||
1628 | #define SM_TR_LOAD_R_ML 0x1 /* Trans. Data Load /Re (ML) */ | ||
1629 | #define SM_TR_WAIT_TC 0x2 /* Trans. Data Wait_TC Tr/Re */ | ||
1630 | #define SM_TR_WDONE 0x4 /* Trans. Data Wait_Done Tr/Re */ | ||
1631 | |||
1632 | #define SM_WR_IDLE 0x0 /* Write Desc. Idle Tr/Re */ | ||
1633 | #define SM_WR_ABLEN 0x1 /* Write Desc. Act_Buf_Length Tr/Re */ | ||
1634 | #define SM_WR_LD_A4 0x2 /* Write Desc. Load_A4 Re */ | ||
1635 | #define SM_WR_RES_OWN 0x2 /* Write Desc. Res_OWN Tr */ | ||
1636 | #define SM_WR_WAIT_EOF 0x3 /* Write Desc. Wait_EOF Re */ | ||
1637 | #define SM_WR_LD_N2C_R 0x4 /* Write Desc. Load_N2C Re */ | ||
1638 | #define SM_WR_WAIT_TC_R 0x5 /* Write Desc. Wait_TC Re */ | ||
1639 | #define SM_WR_WAIT_TC4 0x6 /* Write Desc. Wait_TC4 Re */ | ||
1640 | #define SM_WR_LD_A_T 0x6 /* Write Desc. Load_A Tr */ | ||
1641 | #define SM_WR_LD_A_R 0x7 /* Write Desc. Load_A Re */ | ||
1642 | #define SM_WR_WAIT_TC_T 0x7 /* Write Desc. Wait_TC Tr */ | ||
1643 | #define SM_WR_LD_N2C_T 0xc /* Write Desc. Load_N2C Tr */ | ||
1644 | #define SM_WR_WDONE_T 0x9 /* Write Desc. Wait_Done Tr */ | ||
1645 | #define SM_WR_WDONE_R 0xc /* Write Desc. Wait_Done Re */ | ||
1646 | #define SM_WR_LD_D_AD 0xe /* Write Desc. Load_Dumr_A Re (ML) */ | ||
1647 | #define SM_WR_WAIT_D_TC 0xf /* Write Desc. Wait_Dumr_TC Re (ML) */ | ||
1648 | |||
1649 | /* B5_<xx>_T2 32 bit Test Register 2 (xx) */ | ||
1650 | /* Note: This register is only defined for the transmit queues */ | ||
1651 | /* Bit 31..8: reserved */ | ||
1652 | #define AC_TEST_ON (1<<7) /* Bit 7: Address Counter Test Mode on */ | ||
1653 | #define AC_TEST_OFF (1<<6) /* Bit 6: Address Counter Test Mode off*/ | ||
1654 | #define BC_TEST_ON (1<<5) /* Bit 5: Byte Counter Test Mode on */ | ||
1655 | #define BC_TEST_OFF (1<<4) /* Bit 4: Byte Counter Test Mode off */ | ||
1656 | #define TEST_STEP04 (1<<3) /* Bit 3: Inc AC/Dec BC by 4 */ | ||
1657 | #define TEST_STEP03 (1<<2) /* Bit 2: Inc AC/Dec BC by 3 */ | ||
1658 | #define TEST_STEP02 (1<<1) /* Bit 1: Inc AC/Dec BC by 2 */ | ||
1659 | #define TEST_STEP01 (1<<0) /* Bit 0: Inc AC/Dec BC by 1 */ | ||
1660 | |||
1661 | /* B5_<xx>_T3 32 bit Test Register 3 (xx) */ | ||
1662 | /* Note: This register is only defined for the transmit queues */ | ||
1663 | /* Bit 31..8: reserved */ | ||
1664 | #define T3_MUX_2 (1<<7) /* Bit 7: (ML) Mux position MSB */ | ||
1665 | #define T3_VRAM_2 (1<<6) /* Bit 6: (ML) Virtual RAM buffer addr MSB */ | ||
1666 | #define T3_LOOP (1<<5) /* Bit 5: Set Loopback (Xmit) */ | ||
1667 | #define T3_UNLOOP (1<<4) /* Bit 4: Unset Loopback (Xmit) */ | ||
1668 | #define T3_MUX (3<<2) /* Bit 3..2: Mux position */ | ||
1669 | #define T3_VRAM (3<<0) /* Bit 1..0: Virtual RAM buffer Address */ | ||
1670 | |||
1671 | /* PCI card IDs */ | ||
1672 | /* | ||
1673 | * Note: The following 4 byte definitions shall not be used! Use OEM Concept! | ||
1674 | */ | ||
1675 | #define PCI_VEND_ID0 0x48 /* PCI vendor ID (SysKonnect) */ | ||
1676 | #define PCI_VEND_ID1 0x11 /* PCI vendor ID (SysKonnect) */ | ||
1677 | /* (High byte) */ | ||
1678 | #define PCI_DEV_ID0 0x00 /* PCI device ID */ | ||
1679 | #define PCI_DEV_ID1 0x40 /* PCI device ID (High byte) */ | ||
1680 | |||
1681 | /*#define PCI_CLASS 0x02*/ /* PCI class code: network device */ | ||
1682 | #define PCI_NW_CLASS 0x02 /* PCI class code: network device */ | ||
1683 | #define PCI_SUB_CLASS 0x02 /* PCI subclass ID: FDDI device */ | ||
1684 | #define PCI_PROG_INTFC 0x00 /* PCI programming Interface (=0) */ | ||
1685 | |||
1686 | /* | ||
1687 | * address transmission from logical to physical offset address on board | ||
1688 | */ | ||
1689 | #define FMA(a) (0x0400|((a)<<2)) /* FORMAC+ (r/w) (SN3) */ | ||
1690 | #define P1(a) (0x0380|((a)<<2)) /* PLC1 (r/w) (DAS) */ | ||
1691 | #define P2(a) (0x0600|((a)<<2)) /* PLC2 (r/w) (covered by the SN3) */ | ||
1692 | #define PRA(a) (B2_MAC_0 + (a)) /* configuration PROM (MAC address) */ | ||
1693 | |||
1694 | /* | ||
1695 | * FlashProm specification | ||
1696 | */ | ||
1697 | #define MAX_PAGES 0x20000L /* Every byte has a single page */ | ||
1698 | #define MAX_FADDR 1 /* 1 byte per page */ | ||
1699 | |||
1700 | /* | ||
1701 | * Receive / Transmit Buffer Control word | ||
1702 | */ | ||
1703 | #define BMU_OWN (1UL<<31) /* OWN bit: 0 == host, 1 == adapter */ | ||
1704 | #define BMU_STF (1L<<30) /* Start of Frame ? */ | ||
1705 | #define BMU_EOF (1L<<29) /* End of Frame ? */ | ||
1706 | #define BMU_EN_IRQ_EOB (1L<<28) /* Enable "End of Buffer" IRQ */ | ||
1707 | #define BMU_EN_IRQ_EOF (1L<<27) /* Enable "End of Frame" IRQ */ | ||
1708 | #define BMU_DEV_0 (1L<<26) /* RX: don't transfer to system mem */ | ||
1709 | #define BMU_SMT_TX (1L<<25) /* TX: if set, buffer type SMT_MBuf */ | ||
1710 | #define BMU_ST_BUF (1L<<25) /* RX: copy of start of frame */ | ||
1711 | #define BMU_UNUSED (1L<<24) /* Set if the Descr is curr unused */ | ||
1712 | #define BMU_SW (3L<<24) /* 2 Bits reserved for SW usage */ | ||
1713 | #define BMU_CHECK 0x00550000L /* To identify the control word */ | ||
1714 | #define BMU_BBC 0x0000FFFFL /* R/T Buffer Byte Count */ | ||
1715 | |||
1716 | /* | ||
1717 | * physical address offset + IO-Port base address | ||
1718 | */ | ||
1719 | #ifdef MEM_MAPPED_IO | ||
1720 | #define ADDR(a) (char far *) smc->hw.iop+(a) | ||
1721 | #define ADDRS(smc,a) (char far *) (smc)->hw.iop+(a) | ||
1722 | #else | ||
1723 | #define ADDR(a) (((a)>>7) ? (outp(smc->hw.iop+B0_RAP,(a)>>7), \ | ||
1724 | (smc->hw.iop+(((a)&0x7F)|((a)>>7 ? 0x80:0)))) : \ | ||
1725 | (smc->hw.iop+(((a)&0x7F)|((a)>>7 ? 0x80:0)))) | ||
1726 | #define ADDRS(smc,a) (((a)>>7) ? (outp((smc)->hw.iop+B0_RAP,(a)>>7), \ | ||
1727 | ((smc)->hw.iop+(((a)&0x7F)|((a)>>7 ? 0x80:0)))) : \ | ||
1728 | ((smc)->hw.iop+(((a)&0x7F)|((a)>>7 ? 0x80:0)))) | ||
1729 | #endif | ||
1730 | |||
1731 | /* | ||
1732 | * Define a macro to access the configuration space | ||
1733 | */ | ||
1734 | #define PCI_C(a) ADDR(B3_CFG_SPC + (a)) /* PCI Config Space */ | ||
1735 | |||
1736 | #define EXT_R(a) ADDR(B6_EXT_REG + (a)) /* External Registers */ | ||
1737 | |||
1738 | /* | ||
1739 | * Define some values needed for the MAC address (PROM) | ||
1740 | */ | ||
1741 | #define SA_MAC (0) /* start addr. MAC_AD within the PROM */ | ||
1742 | #define PRA_OFF (0) /* offset correction when 4th byte reading */ | ||
1743 | |||
1744 | #define SKFDDI_PSZ 8 /* address PROM size */ | ||
1745 | |||
1746 | #define FM_A(a) ADDR(FMA(a)) /* FORMAC Plus physical addr */ | ||
1747 | #define P1_A(a) ADDR(P1(a)) /* PLC1 (r/w) */ | ||
1748 | #define P2_A(a) ADDR(P2(a)) /* PLC2 (r/w) (DAS) */ | ||
1749 | #define PR_A(a) ADDR(PRA(a)) /* config. PROM (MAC address) */ | ||
1750 | |||
1751 | /* | ||
1752 | * Macro to read the PROM | ||
1753 | */ | ||
1754 | #define READ_PROM(a) ((u_char)inp(a)) | ||
1755 | |||
1756 | #define GET_PAGE(bank) outpd(ADDR(B2_FAR),bank) | ||
1757 | #define VPP_ON() | ||
1758 | #define VPP_OFF() | ||
1759 | |||
1760 | /* | ||
1761 | * Note: Values of the Interrupt Source Register are defined above | ||
1762 | */ | ||
1763 | #define ISR_A ADDR(B0_ISRC) | ||
1764 | #define GET_ISR() inpd(ISR_A) | ||
1765 | #define GET_ISR_SMP(iop) inpd((iop)+B0_ISRC) | ||
1766 | #define CHECK_ISR() (inpd(ISR_A) & inpd(ADDR(B0_IMSK))) | ||
1767 | #define CHECK_ISR_SMP(iop) (inpd((iop)+B0_ISRC) & inpd((iop)+B0_IMSK)) | ||
1768 | |||
1769 | #define BUS_CHECK() | ||
1770 | |||
1771 | /* | ||
1772 | * CLI_FBI: Disable Board Interrupts | ||
1773 | * STI_FBI: Enable Board Interrupts | ||
1774 | */ | ||
1775 | #ifndef UNIX | ||
1776 | #define CLI_FBI() outpd(ADDR(B0_IMSK),0) | ||
1777 | #else | ||
1778 | #define CLI_FBI(smc) outpd(ADDRS((smc),B0_IMSK),0) | ||
1779 | #endif | ||
1780 | |||
1781 | #ifndef UNIX | ||
1782 | #define STI_FBI() outpd(ADDR(B0_IMSK),smc->hw.is_imask) | ||
1783 | #else | ||
1784 | #define STI_FBI(smc) outpd(ADDRS((smc),B0_IMSK),(smc)->hw.is_imask) | ||
1785 | #endif | ||
1786 | |||
1787 | #define CLI_FBI_SMP(iop) outpd((iop)+B0_IMSK,0) | ||
1788 | #define STI_FBI_SMP(smc,iop) outpd((iop)+B0_IMSK,(smc)->hw.is_imask) | ||
1789 | |||
1790 | #endif /* PCI */ | ||
1791 | /*--------------------------------------------------------------------------*/ | ||
1792 | |||
1793 | /* | ||
1794 | * 12 bit transfer (dword) counter: | ||
1795 | * (ISA: 2*trc = number of byte) | ||
1796 | * (EISA: 4*trc = number of byte) | ||
1797 | * (MCA: 4*trc = number of byte) | ||
1798 | */ | ||
1799 | #define MAX_TRANS (0x0fff) | ||
1800 | |||
1801 | /* | ||
1802 | * PC PIC | ||
1803 | */ | ||
1804 | #define MST_8259 (0x20) | ||
1805 | #define SLV_8259 (0xA0) | ||
1806 | |||
1807 | #define TPS (18) /* ticks per second */ | ||
1808 | |||
1809 | /* | ||
1810 | * error timer defs | ||
1811 | */ | ||
1812 | #define TN (4) /* number of supported timer = TN+1 */ | ||
1813 | #define SNPPND_TIME (5) /* buffer memory access over mem. data reg. */ | ||
1814 | |||
1815 | #define MAC_AD 0x405a0000 | ||
1816 | |||
1817 | #define MODR1 FM_A(FM_MDREG1) /* mode register 1 */ | ||
1818 | #define MODR2 FM_A(FM_MDREG2) /* mode register 2 */ | ||
1819 | |||
1820 | #define CMDR1 FM_A(FM_CMDREG1) /* command register 1 */ | ||
1821 | #define CMDR2 FM_A(FM_CMDREG2) /* command register 2 */ | ||
1822 | |||
1823 | |||
1824 | /* | ||
1825 | * function defines | ||
1826 | */ | ||
1827 | #define CLEAR(io,mask) outpw((io),inpw(io)&(~(mask))) | ||
1828 | #define SET(io,mask) outpw((io),inpw(io)|(mask)) | ||
1829 | #define GET(io,mask) (inpw(io)&(mask)) | ||
1830 | #define SETMASK(io,val,mask) outpw((io),(inpw(io) & ~(mask)) | (val)) | ||
1831 | |||
1832 | /* | ||
1833 | * PHY Port A (PA) = PLC 1 | ||
1834 | * With SuperNet 3 PHY-A and PHY S are identical. | ||
1835 | */ | ||
1836 | #define PLC(np,reg) (((np) == PA) ? P2_A(reg) : P1_A(reg)) | ||
1837 | |||
1838 | /* | ||
1839 | * set memory address register for write and read | ||
1840 | */ | ||
1841 | #define MARW(ma) outpw(FM_A(FM_MARW),(unsigned int)(ma)) | ||
1842 | #define MARR(ma) outpw(FM_A(FM_MARR),(unsigned int)(ma)) | ||
1843 | |||
1844 | /* | ||
1845 | * read/write from/to memory data register | ||
1846 | */ | ||
1847 | /* write double word */ | ||
1848 | #define MDRW(dd) outpw(FM_A(FM_MDRU),(unsigned int)((dd)>>16)) ;\ | ||
1849 | outpw(FM_A(FM_MDRL),(unsigned int)(dd)) | ||
1850 | |||
1851 | #ifndef WINNT | ||
1852 | /* read double word */ | ||
1853 | #define MDRR() (((long)inpw(FM_A(FM_MDRU))<<16) + inpw(FM_A(FM_MDRL))) | ||
1854 | |||
1855 | /* read FORMAC+ 32-bit status register */ | ||
1856 | #define GET_ST1() (((long)inpw(FM_A(FM_ST1U))<<16) + inpw(FM_A(FM_ST1L))) | ||
1857 | #define GET_ST2() (((long)inpw(FM_A(FM_ST2U))<<16) + inpw(FM_A(FM_ST2L))) | ||
1858 | #ifdef SUPERNET_3 | ||
1859 | #define GET_ST3() (((long)inpw(FM_A(FM_ST3U))<<16) + inpw(FM_A(FM_ST3L))) | ||
1860 | #endif | ||
1861 | #else | ||
1862 | /* read double word */ | ||
1863 | #define MDRR() inp2w((FM_A(FM_MDRU)),(FM_A(FM_MDRL))) | ||
1864 | |||
1865 | /* read FORMAC+ 32-bit status register */ | ||
1866 | #define GET_ST1() inp2w((FM_A(FM_ST1U)),(FM_A(FM_ST1L))) | ||
1867 | #define GET_ST2() inp2w((FM_A(FM_ST2U)),(FM_A(FM_ST2L))) | ||
1868 | #ifdef SUPERNET_3 | ||
1869 | #define GET_ST3() inp2w((FM_A(FM_ST3U)),(FM_A(FM_ST3L))) | ||
1870 | #endif | ||
1871 | #endif | ||
1872 | |||
1873 | /* Special timer macro for 82c54 */ | ||
1874 | /* timer access over data bus bit 8..15 */ | ||
1875 | #define OUT_82c54_TIMER(port,val) outpw(TI_A(port),(val)<<8) | ||
1876 | #define IN_82c54_TIMER(port) ((inpw(TI_A(port))>>8) & 0xff) | ||
1877 | |||
1878 | |||
1879 | #ifdef DEBUG | ||
1880 | #define DB_MAC(mac,st) {if (debug_mac & 0x1)\ | ||
1881 | printf("M") ;\ | ||
1882 | if (debug_mac & 0x2)\ | ||
1883 | printf("\tMAC %d status 0x%08lx\n",mac,st) ;\ | ||
1884 | if (debug_mac & 0x4)\ | ||
1885 | dp_mac(mac,st) ;\ | ||
1886 | } | ||
1887 | |||
1888 | #define DB_PLC(p,iev) { if (debug_plc & 0x1)\ | ||
1889 | printf("P") ;\ | ||
1890 | if (debug_plc & 0x2)\ | ||
1891 | printf("\tPLC %s Int 0x%04x\n", \ | ||
1892 | (p == PA) ? "A" : "B", iev) ;\ | ||
1893 | if (debug_plc & 0x4)\ | ||
1894 | dp_plc(p,iev) ;\ | ||
1895 | } | ||
1896 | |||
1897 | #define DB_TIMER() { if (debug_timer & 0x1)\ | ||
1898 | printf("T") ;\ | ||
1899 | if (debug_timer & 0x2)\ | ||
1900 | printf("\tTimer ISR\n") ;\ | ||
1901 | } | ||
1902 | |||
1903 | #else /* no DEBUG */ | ||
1904 | |||
1905 | #define DB_MAC(mac,st) | ||
1906 | #define DB_PLC(p,iev) | ||
1907 | #define DB_TIMER() | ||
1908 | |||
1909 | #endif /* no DEBUG */ | ||
1910 | |||
1911 | #define INC_PTR(sp,cp,ep) if (++cp == ep) cp = sp | ||
1912 | /* | ||
1913 | * timer defs | ||
1914 | */ | ||
1915 | #define COUNT(t) ((t)<<6) /* counter */ | ||
1916 | #define RW_OP(o) ((o)<<4) /* read/write operation */ | ||
1917 | #define TMODE(m) ((m)<<1) /* timer mode */ | ||
1918 | |||
1919 | #endif | ||
diff --git a/drivers/net/skfp/h/skfbiinc.h b/drivers/net/skfp/h/skfbiinc.h new file mode 100644 index 000000000000..79d55ad2cd2a --- /dev/null +++ b/drivers/net/skfp/h/skfbiinc.h | |||
@@ -0,0 +1,123 @@ | |||
1 | /****************************************************************************** | ||
2 | * | ||
3 | * (C)Copyright 1998,1999 SysKonnect, | ||
4 | * a business unit of Schneider & Koch & Co. Datensysteme GmbH. | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License as published by | ||
8 | * the Free Software Foundation; either version 2 of the License, or | ||
9 | * (at your option) any later version. | ||
10 | * | ||
11 | * The information in this file is provided "AS IS" without warranty. | ||
12 | * | ||
13 | ******************************************************************************/ | ||
14 | |||
15 | #ifndef _SKFBIINC_ | ||
16 | #define _SKFBIINC_ | ||
17 | |||
18 | #include "h/supern_2.h" | ||
19 | |||
20 | /* | ||
21 | * special defines for use into .asm files | ||
22 | */ | ||
23 | #define ERR_FLAGS (FS_MSRABT | FS_SEAC2 | FS_SFRMERR | FS_SFRMTY1) | ||
24 | |||
25 | #ifdef ISA | ||
26 | #define DMA_BUSY_CHECK CSRA | ||
27 | #define IMASK_FAST (IS_PLINT1 | IS_PLINT2 | IS_TIMINT) | ||
28 | #define HRQR (RQAA+(RQ_RRQ<<1)) | ||
29 | #define HRQW (RQAA+(RQ_WA2<<1)) | ||
30 | #define HRQA0 (RQAA+(RQ_WA0<<1)) | ||
31 | #define HRQSQ (RQAA+(RQ_WSQ<<1)) | ||
32 | #endif | ||
33 | |||
34 | #ifdef EISA | ||
35 | #define DMA_BUSY_CHECK CSRA | ||
36 | #define DMA_HIGH_WORD 0x0400 | ||
37 | #define DMA_MASK_M 0x0a | ||
38 | #define DMA_MODE_M 0x0b | ||
39 | #define DMA_BYTE_PTR_M 0x0c | ||
40 | #define DMA_MASK_S 0x0d4 | ||
41 | #define DMA_MODE_S 0x0d6 | ||
42 | #define DMA_BYTE_PTR_S 0x0d8 | ||
43 | #define IMASK_FAST (IS_PLINT1 | IS_PLINT2 | IS_TIMINT | IS_TC) | ||
44 | #endif /* EISA */ | ||
45 | |||
46 | #ifdef MCA | ||
47 | #define IMASK_FAST (IS_PLINT1 | IS_PLINT2 | IS_TIMINT | IS_TOKEN | \ | ||
48 | IS_CHCK_L | IS_BUSERR) | ||
49 | #endif | ||
50 | |||
51 | #ifdef PCI | ||
52 | #define IMASK_FAST (IS_PLINT1 | IS_PLINT2 | IS_TIMINT | IS_TOKEN | \ | ||
53 | IS_MINTR2 | IS_MINTR3 | IS_R1_P | \ | ||
54 | IS_R1_C | IS_XA_C | IS_XS_C) | ||
55 | #endif | ||
56 | |||
57 | #ifdef PCI | ||
58 | #define ISR_MASK (IS_MINTR1 | IS_R1_F | IS_XS_F| IS_XA_F | IMASK_FAST) | ||
59 | #else | ||
60 | #define ISR_MASK (IS_MINTR1 | IS_MINTR2 | IMASK_FAST) | ||
61 | #endif | ||
62 | |||
63 | #define FMA_FM_CMDREG1 FMA(FM_CMDREG1) | ||
64 | #define FMA_FM_CMDREG2 FMA(FM_CMDREG2) | ||
65 | #define FMA_FM_STMCHN FMA(FM_STMCHN) | ||
66 | #define FMA_FM_RPR FMA(FM_RPR) | ||
67 | #define FMA_FM_WPXA0 FMA(FM_WPXA0) | ||
68 | #define FMA_FM_WPXA2 FMA(FM_WPXA2) | ||
69 | #define FMA_FM_MARR FMA(FM_MARR) | ||
70 | #define FMA_FM_MARW FMA(FM_MARW) | ||
71 | #define FMA_FM_MDRU FMA(FM_MDRU) | ||
72 | #define FMA_FM_MDRL FMA(FM_MDRL) | ||
73 | #define FMA_ST1L FMA(FM_ST1L) | ||
74 | #define FMA_ST1U FMA(FM_ST1U) | ||
75 | #define FMA_ST2L FMA(FM_ST2L) | ||
76 | #define FMA_ST2U FMA(FM_ST2U) | ||
77 | #ifdef SUPERNET_3 | ||
78 | #define FMA_ST3L FMA(FM_ST3L) | ||
79 | #define FMA_ST3U FMA(FM_ST3U) | ||
80 | #endif | ||
81 | |||
82 | #define TMODE_RRQ RQ_RRQ | ||
83 | #define TMODE_WAQ2 RQ_WA2 | ||
84 | #define HSRA HSR(0) | ||
85 | |||
86 | |||
87 | #define FMA_FM_ST1L FMA_ST1L | ||
88 | #define FMA_FM_ST1U FMA_ST1U | ||
89 | #define FMA_FM_ST2L FMA_ST2L | ||
90 | #define FMA_FM_ST2U FMA_ST2U | ||
91 | #ifdef SUPERNET_3 | ||
92 | #define FMA_FM_ST3L FMA_ST3L | ||
93 | #define FMA_FM_ST3U FMA_ST3U | ||
94 | #endif | ||
95 | |||
96 | #define FMA_FM_SWPR FMA(FM_SWPR) | ||
97 | |||
98 | #define FMA_FM_RPXA0 FMA(FM_RPXA0) | ||
99 | |||
100 | #define FMA_FM_RPXS FMA(FM_RPXS) | ||
101 | #define FMA_FM_WPXS FMA(FM_WPXS) | ||
102 | |||
103 | #define FMA_FM_IMSK1U FMA(FM_IMSK1U) | ||
104 | #define FMA_FM_IMSK1L FMA(FM_IMSK1L) | ||
105 | |||
106 | #define FMA_FM_EAS FMA(FM_EAS) | ||
107 | #define FMA_FM_EAA0 FMA(FM_EAA0) | ||
108 | |||
109 | #define TMODE_WAQ0 RQ_WA0 | ||
110 | #define TMODE_WSQ RQ_WSQ | ||
111 | |||
112 | /* Define default for DRV_PCM_STATE_CHANGE */ | ||
113 | #ifndef DRV_PCM_STATE_CHANGE | ||
114 | #define DRV_PCM_STATE_CHANGE(smc,plc,p_state) /* nothing */ | ||
115 | #endif | ||
116 | |||
117 | /* Define default for DRV_RMT_INDICATION */ | ||
118 | #ifndef DRV_RMT_INDICATION | ||
119 | #define DRV_RMT_INDICATION(smc,i) /* nothing */ | ||
120 | #endif | ||
121 | |||
122 | #endif /* n_SKFBIINC_ */ | ||
123 | |||
diff --git a/drivers/net/skfp/h/smc.h b/drivers/net/skfp/h/smc.h new file mode 100644 index 000000000000..94325915e0d5 --- /dev/null +++ b/drivers/net/skfp/h/smc.h | |||
@@ -0,0 +1,471 @@ | |||
1 | /****************************************************************************** | ||
2 | * | ||
3 | * (C)Copyright 1998,1999 SysKonnect, | ||
4 | * a business unit of Schneider & Koch & Co. Datensysteme GmbH. | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License as published by | ||
8 | * the Free Software Foundation; either version 2 of the License, or | ||
9 | * (at your option) any later version. | ||
10 | * | ||
11 | * The information in this file is provided "AS IS" without warranty. | ||
12 | * | ||
13 | ******************************************************************************/ | ||
14 | |||
15 | #ifndef _SCMECM_ | ||
16 | #define _SCMECM_ | ||
17 | |||
18 | #if defined(PCI) && !defined(OSDEF) | ||
19 | /* | ||
20 | * In the case of the PCI bus the file osdef1st.h must be present | ||
21 | */ | ||
22 | #define OSDEF | ||
23 | #endif | ||
24 | |||
25 | #ifdef PCI | ||
26 | #ifndef SUPERNET_3 | ||
27 | #define SUPERNET_3 | ||
28 | #endif | ||
29 | #ifndef TAG_MODE | ||
30 | #define TAG_MODE | ||
31 | #endif | ||
32 | #endif | ||
33 | |||
34 | /* | ||
35 | * include all other files in required order | ||
36 | * the following files must have been included before: | ||
37 | * types.h | ||
38 | * fddi.h | ||
39 | */ | ||
40 | #ifdef OSDEF | ||
41 | #include "h/osdef1st.h" | ||
42 | #endif /* OSDEF */ | ||
43 | #ifdef OEM_CONCEPT | ||
44 | #include "oemdef.h" | ||
45 | #endif /* OEM_CONCEPT */ | ||
46 | #include "h/smt.h" | ||
47 | #include "h/cmtdef.h" | ||
48 | #include "h/fddimib.h" | ||
49 | #include "h/targethw.h" /* all target hw dependencies */ | ||
50 | #include "h/targetos.h" /* all target os dependencies */ | ||
51 | #ifdef ESS | ||
52 | #include "h/sba.h" | ||
53 | #endif | ||
54 | |||
55 | /* | ||
56 | * Event Queue | ||
57 | * queue.c | ||
58 | * events are class/value pairs | ||
59 | * class is addressee, e.g. RMT, PCM etc. | ||
60 | * value is command, e.g. line state change, ring op change etc. | ||
61 | */ | ||
62 | struct event_queue { | ||
63 | u_short class ; /* event class */ | ||
64 | u_short event ; /* event value */ | ||
65 | } ; | ||
66 | |||
67 | /* | ||
68 | * define event queue as circular buffer | ||
69 | */ | ||
70 | #ifdef CONCENTRATOR | ||
71 | #define MAX_EVENT 128 | ||
72 | #else /* nCONCENTRATOR */ | ||
73 | #define MAX_EVENT 64 | ||
74 | #endif /* nCONCENTRATOR */ | ||
75 | |||
76 | struct s_queue { | ||
77 | |||
78 | struct event_queue ev_queue[MAX_EVENT]; | ||
79 | struct event_queue *ev_put ; | ||
80 | struct event_queue *ev_get ; | ||
81 | } ; | ||
82 | |||
83 | /* | ||
84 | * ECM - Entity Coordination Management | ||
85 | * ecm.c | ||
86 | */ | ||
87 | struct s_ecm { | ||
88 | u_char path_test ; /* ECM path test variable */ | ||
89 | u_char sb_flag ; /* ECM stuck bypass */ | ||
90 | u_char DisconnectFlag ; /* jd 05-Aug-1999 Bug #10419 | ||
91 | * ECM disconnected */ | ||
92 | u_char ecm_line_state ; /* flag to dispatcher : line states */ | ||
93 | u_long trace_prop ; /* ECM Trace_Prop flag >= 16 bits !! */ | ||
94 | /* NUMPHYS note: | ||
95 | * this variable must have enough bits to hold all entiies in | ||
96 | * the station. So NUMPHYS may not be greater than 31. | ||
97 | */ | ||
98 | char ec_pad[2] ; | ||
99 | struct smt_timer ecm_timer ; /* timer */ | ||
100 | } ; | ||
101 | |||
102 | |||
103 | /* | ||
104 | * RMT - Ring Management | ||
105 | * rmt.c | ||
106 | */ | ||
107 | struct s_rmt { | ||
108 | u_char dup_addr_test ; /* state of dupl. addr. test */ | ||
109 | u_char da_flag ; /* flag : duplicate address det. */ | ||
110 | u_char loop_avail ; /* flag : MAC available for loopback */ | ||
111 | u_char sm_ma_avail ; /* flag : MAC available for SMT */ | ||
112 | u_char no_flag ; /* flag : ring not operational */ | ||
113 | u_char bn_flag ; /* flag : MAC reached beacon state */ | ||
114 | u_char jm_flag ; /* flag : jamming in NON_OP_DUP */ | ||
115 | u_char rm_join ; /* CFM flag RM_Join */ | ||
116 | u_char rm_loop ; /* CFM flag RM_Loop */ | ||
117 | |||
118 | long fast_rm_join ; /* bit mask of active ports */ | ||
119 | /* | ||
120 | * timer and flags | ||
121 | */ | ||
122 | struct smt_timer rmt_timer0 ; /* timer 0 */ | ||
123 | struct smt_timer rmt_timer1 ; /* timer 1 */ | ||
124 | struct smt_timer rmt_timer2 ; /* timer 2 */ | ||
125 | u_char timer0_exp ; /* flag : timer 0 expired */ | ||
126 | u_char timer1_exp ; /* flag : timer 1 expired */ | ||
127 | u_char timer2_exp ; /* flag : timer 2 expired */ | ||
128 | |||
129 | u_char rm_pad1[1] ; | ||
130 | } ; | ||
131 | |||
132 | /* | ||
133 | * CFM - Configuration Management | ||
134 | * cfm.c | ||
135 | * used for SAS and DAS | ||
136 | */ | ||
137 | struct s_cfm { | ||
138 | u_char cf_state; /* CFM state machine current state */ | ||
139 | u_char cf_pad[3] ; | ||
140 | } ; | ||
141 | |||
142 | /* | ||
143 | * CEM - Configuration Element Management | ||
144 | * cem.c | ||
145 | * used for Concentrator | ||
146 | */ | ||
147 | #ifdef CONCENTRATOR | ||
148 | struct s_cem { | ||
149 | int ce_state ; /* CEM state */ | ||
150 | int ce_port ; /* PA PB PM PM+1 .. */ | ||
151 | int ce_type ; /* TA TB TS TM */ | ||
152 | } ; | ||
153 | |||
154 | /* | ||
155 | * linked list of CCEs in current token path | ||
156 | */ | ||
157 | struct s_c_ring { | ||
158 | struct s_c_ring *c_next ; | ||
159 | char c_entity ; | ||
160 | } ; | ||
161 | |||
162 | struct mib_path_config { | ||
163 | u_long fddimibPATHConfigSMTIndex; | ||
164 | u_long fddimibPATHConfigPATHIndex; | ||
165 | u_long fddimibPATHConfigTokenOrder; | ||
166 | u_long fddimibPATHConfigResourceType; | ||
167 | #define SNMP_RES_TYPE_MAC 2 /* Resource is a MAC */ | ||
168 | #define SNMP_RES_TYPE_PORT 4 /* Resource is a PORT */ | ||
169 | u_long fddimibPATHConfigResourceIndex; | ||
170 | u_long fddimibPATHConfigCurrentPath; | ||
171 | #define SNMP_PATH_ISOLATED 1 /* Current path is isolated */ | ||
172 | #define SNMP_PATH_LOCAL 2 /* Current path is local */ | ||
173 | #define SNMP_PATH_SECONDARY 3 /* Current path is secondary */ | ||
174 | #define SNMP_PATH_PRIMARY 4 /* Current path is primary */ | ||
175 | #define SNMP_PATH_CONCATENATED 5 /* Current path is concatenated */ | ||
176 | #define SNMP_PATH_THRU 6 /* Current path is thru */ | ||
177 | }; | ||
178 | |||
179 | |||
180 | #endif | ||
181 | |||
182 | /* | ||
183 | * PCM connect states | ||
184 | */ | ||
185 | #define PCM_DISABLED 0 | ||
186 | #define PCM_CONNECTING 1 | ||
187 | #define PCM_STANDBY 2 | ||
188 | #define PCM_ACTIVE 3 | ||
189 | |||
190 | struct s_pcm { | ||
191 | u_char pcm_pad[3] ; | ||
192 | } ; | ||
193 | |||
194 | /* | ||
195 | * PHY struct | ||
196 | * one per physical port | ||
197 | */ | ||
198 | struct s_phy { | ||
199 | /* Inter Module Globals */ | ||
200 | struct fddi_mib_p *mib ; | ||
201 | |||
202 | u_char np ; /* index 0 .. NUMPHYS */ | ||
203 | u_char cf_join ; | ||
204 | u_char cf_loop ; | ||
205 | u_char wc_flag ; /* withhold connection flag */ | ||
206 | u_char pc_mode ; /* Holds the negotiated mode of the PCM */ | ||
207 | u_char pc_lem_fail ; /* flag : LCT failed */ | ||
208 | u_char lc_test ; | ||
209 | u_char scrub ; /* CFM flag Scrub -> PCM */ | ||
210 | char phy_name ; | ||
211 | u_char pmd_type[2] ; /* SK connector/transceiver type codes */ | ||
212 | #define PMD_SK_CONN 0 /* pmd_type[PMD_SK_CONN] = Connector */ | ||
213 | #define PMD_SK_PMD 1 /* pmd_type[PMD_SK_PMD] = Xver */ | ||
214 | u_char pmd_scramble ; /* scrambler on/off */ | ||
215 | |||
216 | /* inner Module Globals */ | ||
217 | u_char curr_ls ; /* current line state */ | ||
218 | u_char ls_flag ; | ||
219 | u_char rc_flag ; | ||
220 | u_char tc_flag ; | ||
221 | u_char td_flag ; | ||
222 | u_char bitn ; | ||
223 | u_char tr_flag ; /* trace recvd while in active */ | ||
224 | u_char twisted ; /* flag to indicate an A-A or B-B connection */ | ||
225 | u_char t_val[NUMBITS] ; /* transmit bits for signaling */ | ||
226 | u_char r_val[NUMBITS] ; /* receive bits for signaling */ | ||
227 | u_long t_next[NUMBITS] ; | ||
228 | struct smt_timer pcm_timer0 ; | ||
229 | struct smt_timer pcm_timer1 ; | ||
230 | struct smt_timer pcm_timer2 ; | ||
231 | u_char timer0_exp ; | ||
232 | u_char timer1_exp ; | ||
233 | u_char timer2_exp ; | ||
234 | u_char pcm_pad1[1] ; | ||
235 | int cem_pst ; /* CEM privae state; used for dual homing */ | ||
236 | struct lem_counter lem ; | ||
237 | #ifdef AMDPLC | ||
238 | struct s_plc plc ; | ||
239 | #endif | ||
240 | } ; | ||
241 | |||
242 | /* | ||
243 | * timer package | ||
244 | * smttimer.c | ||
245 | */ | ||
246 | struct s_timer { | ||
247 | struct smt_timer *st_queue ; | ||
248 | struct smt_timer st_fast ; | ||
249 | } ; | ||
250 | |||
251 | /* | ||
252 | * SRF types and data | ||
253 | */ | ||
254 | #define SMT_EVENT_BASE 1 | ||
255 | #define SMT_EVENT_MAC_PATH_CHANGE (SMT_EVENT_BASE+0) | ||
256 | #define SMT_EVENT_MAC_NEIGHBOR_CHANGE (SMT_EVENT_BASE+1) | ||
257 | #define SMT_EVENT_PORT_PATH_CHANGE (SMT_EVENT_BASE+2) | ||
258 | #define SMT_EVENT_PORT_CONNECTION (SMT_EVENT_BASE+3) | ||
259 | |||
260 | #define SMT_IS_CONDITION(x) ((x)>=SMT_COND_BASE) | ||
261 | |||
262 | #define SMT_COND_BASE (SMT_EVENT_PORT_CONNECTION+1) | ||
263 | #define SMT_COND_SMT_PEER_WRAP (SMT_COND_BASE+0) | ||
264 | #define SMT_COND_SMT_HOLD (SMT_COND_BASE+1) | ||
265 | #define SMT_COND_MAC_FRAME_ERROR (SMT_COND_BASE+2) | ||
266 | #define SMT_COND_MAC_DUP_ADDR (SMT_COND_BASE+3) | ||
267 | #define SMT_COND_MAC_NOT_COPIED (SMT_COND_BASE+4) | ||
268 | #define SMT_COND_PORT_EB_ERROR (SMT_COND_BASE+5) | ||
269 | #define SMT_COND_PORT_LER (SMT_COND_BASE+6) | ||
270 | |||
271 | #define SR0_WAIT 0 | ||
272 | #define SR1_HOLDOFF 1 | ||
273 | #define SR2_DISABLED 2 | ||
274 | |||
275 | struct s_srf { | ||
276 | u_long SRThreshold ; /* threshold value */ | ||
277 | u_char RT_Flag ; /* report transmitted flag */ | ||
278 | u_char sr_state ; /* state-machine */ | ||
279 | u_char any_report ; /* any report required */ | ||
280 | u_long TSR ; /* timer */ | ||
281 | u_short ring_status ; /* IBM ring status */ | ||
282 | } ; | ||
283 | |||
284 | /* | ||
285 | * IBM token ring status | ||
286 | */ | ||
287 | #define RS_RES15 (1<<15) /* reserved */ | ||
288 | #define RS_HARDERROR (1<<14) /* ring down */ | ||
289 | #define RS_SOFTERROR (1<<13) /* sent SRF */ | ||
290 | #define RS_BEACON (1<<12) /* transmitted beacon */ | ||
291 | #define RS_PATHTEST (1<<11) /* path test failed */ | ||
292 | #define RS_SELFTEST (1<<10) /* selftest required */ | ||
293 | #define RS_RES9 (1<< 9) /* reserved */ | ||
294 | #define RS_DISCONNECT (1<< 8) /* remote disconnect */ | ||
295 | #define RS_RES7 (1<< 7) /* reserved */ | ||
296 | #define RS_DUPADDR (1<< 6) /* duplicate address */ | ||
297 | #define RS_NORINGOP (1<< 5) /* no ring op */ | ||
298 | #define RS_VERSION (1<< 4) /* SMT version mismatch */ | ||
299 | #define RS_STUCKBYPASSS (1<< 3) /* stuck bypass */ | ||
300 | #define RS_EVENT (1<< 2) /* FDDI event occurred */ | ||
301 | #define RS_RINGOPCHANGE (1<< 1) /* ring op changed */ | ||
302 | #define RS_RES0 (1<< 0) /* reserved */ | ||
303 | |||
304 | #define RS_SET(smc,bit) \ | ||
305 | ring_status_indication(smc,smc->srf.ring_status |= bit) | ||
306 | #define RS_CLEAR(smc,bit) \ | ||
307 | ring_status_indication(smc,smc->srf.ring_status &= ~bit) | ||
308 | |||
309 | #define RS_CLEAR_EVENT (0xffff & ~(RS_NORINGOP)) | ||
310 | |||
311 | /* Define the AIX-event-Notification as null function if it isn't defined */ | ||
312 | /* in the targetos.h file */ | ||
313 | #ifndef AIX_EVENT | ||
314 | #define AIX_EVENT(smc,opt0,opt1,opt2,opt3) /* nothing */ | ||
315 | #endif | ||
316 | |||
317 | struct s_srf_evc { | ||
318 | u_char evc_code ; /* event code type */ | ||
319 | u_char evc_index ; /* index for mult. instances */ | ||
320 | u_char evc_rep_required ; /* report required */ | ||
321 | u_short evc_para ; /* SMT Para Number */ | ||
322 | u_char *evc_cond_state ; /* condition state */ | ||
323 | u_char *evc_multiple ; /* multiple occurrence */ | ||
324 | } ; | ||
325 | |||
326 | /* | ||
327 | * Values used by frame based services | ||
328 | * smt.c | ||
329 | */ | ||
330 | #define SMT_MAX_TEST 5 | ||
331 | #define SMT_TID_NIF 0 /* pending NIF request */ | ||
332 | #define SMT_TID_NIF_TEST 1 /* pending NIF test */ | ||
333 | #define SMT_TID_ECF_UNA 2 /* pending ECF UNA test */ | ||
334 | #define SMT_TID_ECF_DNA 3 /* pending ECF DNA test */ | ||
335 | #define SMT_TID_ECF 4 /* pending ECF test */ | ||
336 | |||
337 | struct smt_values { | ||
338 | u_long smt_tvu ; /* timer valid una */ | ||
339 | u_long smt_tvd ; /* timer valid dna */ | ||
340 | u_long smt_tid ; /* transaction id */ | ||
341 | u_long pend[SMT_MAX_TEST] ; /* TID of requests */ | ||
342 | u_long uniq_time ; /* unique time stamp */ | ||
343 | u_short uniq_ticks ; /* unique time stamp */ | ||
344 | u_short please_reconnect ; /* flag : reconnect */ | ||
345 | u_long smt_last_lem ; | ||
346 | u_long smt_last_notify ; | ||
347 | struct smt_timer smt_timer ; /* SMT NIF timer */ | ||
348 | u_long last_tok_time[NUMMACS]; /* token cnt emulation */ | ||
349 | } ; | ||
350 | |||
351 | /* | ||
352 | * SMT/CMT configurable parameters | ||
353 | */ | ||
354 | #define SMT_DAS 0 /* dual attach */ | ||
355 | #define SMT_SAS 1 /* single attach */ | ||
356 | #define SMT_NAC 2 /* null attach concentrator */ | ||
357 | |||
358 | struct smt_config { | ||
359 | u_char attach_s ; /* CFM attach to secondary path */ | ||
360 | u_char sas ; /* SMT_DAS/SAS/NAC */ | ||
361 | u_char build_ring_map ; /* build ringmap if TRUE */ | ||
362 | u_char numphys ; /* number of active phys */ | ||
363 | u_char sc_pad[1] ; | ||
364 | |||
365 | u_long pcm_tb_min ; /* PCM : TB_Min timer value */ | ||
366 | u_long pcm_tb_max ; /* PCM : TB_Max timer value */ | ||
367 | u_long pcm_c_min ; /* PCM : C_Min timer value */ | ||
368 | u_long pcm_t_out ; /* PCM : T_Out timer value */ | ||
369 | u_long pcm_tl_min ; /* PCM : TL_min timer value */ | ||
370 | u_long pcm_lc_short ; /* PCM : LC_Short timer value */ | ||
371 | u_long pcm_lc_medium ; /* PCM : LC_Medium timer value */ | ||
372 | u_long pcm_lc_long ; /* PCM : LC_Long timer value */ | ||
373 | u_long pcm_lc_extended ; /* PCM : LC_Extended timer value */ | ||
374 | u_long pcm_t_next_9 ; /* PCM : T_Next[9] timer value */ | ||
375 | u_long pcm_ns_max ; /* PCM : NS_Max timer value */ | ||
376 | |||
377 | u_long ecm_i_max ; /* ECM : I_Max timer value */ | ||
378 | u_long ecm_in_max ; /* ECM : IN_Max timer value */ | ||
379 | u_long ecm_td_min ; /* ECM : TD_Min timer */ | ||
380 | u_long ecm_test_done ; /* ECM : path test done timer */ | ||
381 | u_long ecm_check_poll ; /* ECM : check bypass poller */ | ||
382 | |||
383 | u_long rmt_t_non_op ; /* RMT : T_Non_OP timer value */ | ||
384 | u_long rmt_t_stuck ; /* RMT : T_Stuck timer value */ | ||
385 | u_long rmt_t_direct ; /* RMT : T_Direct timer value */ | ||
386 | u_long rmt_t_jam ; /* RMT : T_Jam timer value */ | ||
387 | u_long rmt_t_announce ; /* RMT : T_Announce timer value */ | ||
388 | u_long rmt_t_poll ; /* RMT : claim/beacon poller */ | ||
389 | u_long rmt_dup_mac_behavior ; /* Flag for the beavior of SMT if | ||
390 | * a Duplicate MAC Address was detected. | ||
391 | * FALSE: SMT will leave finaly the ring | ||
392 | * TRUE: SMT will reinstert into the ring | ||
393 | */ | ||
394 | u_long mac_d_max ; /* MAC : D_Max timer value */ | ||
395 | |||
396 | u_long lct_short ; /* LCT : error threshhold */ | ||
397 | u_long lct_medium ; /* LCT : error threshhold */ | ||
398 | u_long lct_long ; /* LCT : error threshhold */ | ||
399 | u_long lct_extended ; /* LCT : error threshhold */ | ||
400 | } ; | ||
401 | |||
402 | #ifdef DEBUG | ||
403 | /* | ||
404 | * Debugging struct sometimes used in smc | ||
405 | */ | ||
406 | struct smt_debug { | ||
407 | int d_smtf ; | ||
408 | int d_smt ; | ||
409 | int d_ecm ; | ||
410 | int d_rmt ; | ||
411 | int d_cfm ; | ||
412 | int d_pcm ; | ||
413 | int d_plc ; | ||
414 | #ifdef ESS | ||
415 | int d_ess ; | ||
416 | #endif | ||
417 | #ifdef SBA | ||
418 | int d_sba ; | ||
419 | #endif | ||
420 | struct os_debug d_os; /* Include specific OS DEBUG struct */ | ||
421 | } ; | ||
422 | |||
423 | #ifndef DEBUG_BRD | ||
424 | /* all boards shall be debugged with one debug struct */ | ||
425 | extern struct smt_debug debug; /* Declaration of debug struct */ | ||
426 | #endif /* DEBUG_BRD */ | ||
427 | |||
428 | #endif /* DEBUG */ | ||
429 | |||
430 | /* | ||
431 | * the SMT Context Struct SMC | ||
432 | * this struct contains ALL global variables of SMT | ||
433 | */ | ||
434 | struct s_smc { | ||
435 | struct s_smt_os os ; /* os specific */ | ||
436 | struct s_smt_hw hw ; /* hardware */ | ||
437 | |||
438 | /* | ||
439 | * NOTE: os and hw MUST BE the first two structs | ||
440 | * anything beyond hw WILL BE SET TO ZERO in smt_set_defaults() | ||
441 | */ | ||
442 | struct smt_config s ; /* smt constants */ | ||
443 | struct smt_values sm ; /* smt variables */ | ||
444 | struct s_ecm e ; /* ecm */ | ||
445 | struct s_rmt r ; /* rmt */ | ||
446 | struct s_cfm cf ; /* cfm/cem */ | ||
447 | #ifdef CONCENTRATOR | ||
448 | struct s_cem ce[NUMPHYS] ; /* cem */ | ||
449 | struct s_c_ring cr[NUMPHYS+NUMMACS] ; | ||
450 | #endif | ||
451 | struct s_pcm p ; /* pcm */ | ||
452 | struct s_phy y[NUMPHYS] ; /* phy */ | ||
453 | struct s_queue q ; /* queue */ | ||
454 | struct s_timer t ; /* timer */ | ||
455 | struct s_srf srf ; /* SRF */ | ||
456 | struct s_srf_evc evcs[6+NUMPHYS*4] ; | ||
457 | struct fddi_mib mib ; /* __THE_MIB__ */ | ||
458 | #ifdef SBA | ||
459 | struct s_sba sba ; /* SBA variables */ | ||
460 | #endif | ||
461 | #ifdef ESS | ||
462 | struct s_ess ess ; /* Ess variables */ | ||
463 | #endif | ||
464 | #if defined(DEBUG) && defined(DEBUG_BRD) | ||
465 | /* If you want all single board to be debugged separately */ | ||
466 | struct smt_debug debug; /* Declaration of debug struct */ | ||
467 | #endif /* DEBUG_BRD && DEBUG */ | ||
468 | } ; | ||
469 | |||
470 | #endif /* _SCMECM_ */ | ||
471 | |||
diff --git a/drivers/net/skfp/h/smt.h b/drivers/net/skfp/h/smt.h new file mode 100644 index 000000000000..1ff589988d10 --- /dev/null +++ b/drivers/net/skfp/h/smt.h | |||
@@ -0,0 +1,882 @@ | |||
1 | /****************************************************************************** | ||
2 | * | ||
3 | * (C)Copyright 1998,1999 SysKonnect, | ||
4 | * a business unit of Schneider & Koch & Co. Datensysteme GmbH. | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License as published by | ||
8 | * the Free Software Foundation; either version 2 of the License, or | ||
9 | * (at your option) any later version. | ||
10 | * | ||
11 | * The information in this file is provided "AS IS" without warranty. | ||
12 | * | ||
13 | ******************************************************************************/ | ||
14 | |||
15 | /* | ||
16 | * SMT 7.2 frame definitions | ||
17 | */ | ||
18 | |||
19 | #ifndef _SMT_ | ||
20 | #define _SMT_ | ||
21 | |||
22 | /* #define SMT5_10 */ | ||
23 | #define SMT6_10 | ||
24 | #define SMT7_20 | ||
25 | |||
26 | #define OPT_PMF /* if parameter management is supported */ | ||
27 | #define OPT_SRF /* if status report is supported */ | ||
28 | |||
29 | /* | ||
30 | * SMT frame version 5.1 | ||
31 | */ | ||
32 | |||
33 | #define SMT_VID 0x0001 /* V 5.1 .. 6.1 */ | ||
34 | #define SMT_VID_2 0x0002 /* V 7.2 */ | ||
35 | |||
36 | struct smt_sid { | ||
37 | u_char sid_oem[2] ; /* implementation spec. */ | ||
38 | struct fddi_addr sid_node ; /* node address */ | ||
39 | } ; | ||
40 | |||
41 | typedef u_char t_station_id[8] ; | ||
42 | |||
43 | /* | ||
44 | * note on alignment : | ||
45 | * sizeof(struct smt_header) = 32 | ||
46 | * all parameters are long aligned | ||
47 | * if struct smt_header starts at offset 0, all longs are aligned correctly | ||
48 | * (FC starts at offset 3) | ||
49 | */ | ||
50 | _packed struct smt_header { | ||
51 | struct fddi_addr smt_dest ; /* destination address */ | ||
52 | struct fddi_addr smt_source ; /* source address */ | ||
53 | u_char smt_class ; /* NIF, SIF ... */ | ||
54 | u_char smt_type ; /* req., response .. */ | ||
55 | u_short smt_version ; /* version id */ | ||
56 | u_int smt_tid ; /* transaction ID */ | ||
57 | struct smt_sid smt_sid ; /* station ID */ | ||
58 | u_short smt_pad ; /* pad with 0 */ | ||
59 | u_short smt_len ; /* length of info field */ | ||
60 | } ; | ||
61 | #define SWAP_SMTHEADER "662sl8ss" | ||
62 | |||
63 | #if 0 | ||
64 | /* | ||
65 | * MAC FC values | ||
66 | */ | ||
67 | #define FC_SMT_INFO 0x41 /* SMT info */ | ||
68 | #define FC_SMT_NSA 0x4f /* SMT Next Station Addressing */ | ||
69 | #endif | ||
70 | |||
71 | |||
72 | /* | ||
73 | * type codes | ||
74 | */ | ||
75 | #define SMT_ANNOUNCE 0x01 /* announcement */ | ||
76 | #define SMT_REQUEST 0x02 /* request */ | ||
77 | #define SMT_REPLY 0x03 /* reply */ | ||
78 | |||
79 | /* | ||
80 | * class codes | ||
81 | */ | ||
82 | #define SMT_NIF 0x01 /* neighbor information frames */ | ||
83 | #define SMT_SIF_CONFIG 0x02 /* station information configuration */ | ||
84 | #define SMT_SIF_OPER 0x03 /* station information operation */ | ||
85 | #define SMT_ECF 0x04 /* echo frames */ | ||
86 | #define SMT_RAF 0x05 /* resource allocation */ | ||
87 | #define SMT_RDF 0x06 /* request denied */ | ||
88 | #define SMT_SRF 0x07 /* status report */ | ||
89 | #define SMT_PMF_GET 0x08 /* parameter management get */ | ||
90 | #define SMT_PMF_SET 0x09 /* parameter management set */ | ||
91 | #define SMT_ESF 0xff /* extended service */ | ||
92 | |||
93 | #define SMT_MAX_ECHO_LEN 4458 /* max length of SMT Echo */ | ||
94 | #if defined(CONC) || defined(CONC_II) | ||
95 | #define SMT_TEST_ECHO_LEN 50 /* test length of SMT Echo */ | ||
96 | #else | ||
97 | #define SMT_TEST_ECHO_LEN SMT_MAX_ECHO_LEN /* test length */ | ||
98 | #endif | ||
99 | |||
100 | #define SMT_MAX_INFO_LEN (4352-20) /* max length for SMT info */ | ||
101 | |||
102 | |||
103 | /* | ||
104 | * parameter types | ||
105 | */ | ||
106 | |||
107 | struct smt_para { | ||
108 | u_short p_type ; /* type */ | ||
109 | u_short p_len ; /* length of parameter */ | ||
110 | } ; | ||
111 | |||
112 | #define PARA_LEN (sizeof(struct smt_para)) | ||
113 | |||
114 | #define SMTSETPARA(p,t) (p)->para.p_type = (t),\ | ||
115 | (p)->para.p_len = sizeof(*(p)) - PARA_LEN | ||
116 | |||
117 | /* | ||
118 | * P01 : Upstream Neighbor Address, UNA | ||
119 | */ | ||
120 | #define SMT_P_UNA 0x0001 /* upstream neighbor address */ | ||
121 | #define SWAP_SMT_P_UNA "s6" | ||
122 | |||
123 | struct smt_p_una { | ||
124 | struct smt_para para ; /* generic parameter header */ | ||
125 | u_short una_pad ; | ||
126 | struct fddi_addr una_node ; /* node address, zero if unknown */ | ||
127 | } ; | ||
128 | |||
129 | /* | ||
130 | * P02 : Station Descriptor | ||
131 | */ | ||
132 | #define SMT_P_SDE 0x0002 /* station descriptor */ | ||
133 | #define SWAP_SMT_P_SDE "1111" | ||
134 | |||
135 | #define SMT_SDE_STATION 0 /* end node */ | ||
136 | #define SMT_SDE_CONCENTRATOR 1 /* concentrator */ | ||
137 | |||
138 | struct smt_p_sde { | ||
139 | struct smt_para para ; /* generic parameter header */ | ||
140 | u_char sde_type ; /* station type */ | ||
141 | u_char sde_mac_count ; /* number of MACs */ | ||
142 | u_char sde_non_master ; /* number of A,B or S ports */ | ||
143 | u_char sde_master ; /* number of S ports on conc. */ | ||
144 | } ; | ||
145 | |||
146 | /* | ||
147 | * P03 : Station State | ||
148 | */ | ||
149 | #define SMT_P_STATE 0x0003 /* station state */ | ||
150 | #define SWAP_SMT_P_STATE "scc" | ||
151 | |||
152 | struct smt_p_state { | ||
153 | struct smt_para para ; /* generic parameter header */ | ||
154 | u_short st_pad ; | ||
155 | u_char st_topology ; /* topology */ | ||
156 | u_char st_dupl_addr ; /* duplicate address detected */ | ||
157 | } ; | ||
158 | #define SMT_ST_WRAPPED (1<<0) /* station wrapped */ | ||
159 | #define SMT_ST_UNATTACHED (1<<1) /* unattached concentrator */ | ||
160 | #define SMT_ST_TWISTED_A (1<<2) /* A-A connection, twisted ring */ | ||
161 | #define SMT_ST_TWISTED_B (1<<3) /* B-B connection, twisted ring */ | ||
162 | #define SMT_ST_ROOTED_S (1<<4) /* rooted station */ | ||
163 | #define SMT_ST_SRF (1<<5) /* SRF protocol supported */ | ||
164 | #define SMT_ST_SYNC_SERVICE (1<<6) /* use synchronous bandwidth */ | ||
165 | |||
166 | #define SMT_ST_MY_DUPA (1<<0) /* my station detected dupl. */ | ||
167 | #define SMT_ST_UNA_DUPA (1<<1) /* my UNA detected duplicate */ | ||
168 | |||
169 | /* | ||
170 | * P04 : timestamp | ||
171 | */ | ||
172 | #define SMT_P_TIMESTAMP 0x0004 /* time stamp */ | ||
173 | #define SWAP_SMT_P_TIMESTAMP "8" | ||
174 | struct smt_p_timestamp { | ||
175 | struct smt_para para ; /* generic parameter header */ | ||
176 | u_char ts_time[8] ; /* time, resolution 80nS, unique */ | ||
177 | } ; | ||
178 | |||
179 | /* | ||
180 | * P05 : station policies | ||
181 | */ | ||
182 | #define SMT_P_POLICY 0x0005 /* station policies */ | ||
183 | #define SWAP_SMT_P_POLICY "ss" | ||
184 | |||
185 | struct smt_p_policy { | ||
186 | struct smt_para para ; /* generic parameter header */ | ||
187 | u_short pl_config ; | ||
188 | u_short pl_connect ; /* bit string POLICY_AA ... */ | ||
189 | } ; | ||
190 | #define SMT_PL_HOLD 1 /* hold policy supported (Dual MAC) */ | ||
191 | |||
192 | /* | ||
193 | * P06 : latency equivalent | ||
194 | */ | ||
195 | #define SMT_P_LATENCY 0x0006 /* latency */ | ||
196 | #define SWAP_SMT_P_LATENCY "ssss" | ||
197 | |||
198 | /* | ||
199 | * note: latency has two phy entries by definition | ||
200 | * for a SAS, the 2nd one is null | ||
201 | */ | ||
202 | struct smt_p_latency { | ||
203 | struct smt_para para ; /* generic parameter header */ | ||
204 | u_short lt_phyout_idx1 ; /* index */ | ||
205 | u_short lt_latency1 ; /* latency , unit : byte clock */ | ||
206 | u_short lt_phyout_idx2 ; /* 0 if SAS */ | ||
207 | u_short lt_latency2 ; /* 0 if SAS */ | ||
208 | } ; | ||
209 | |||
210 | /* | ||
211 | * P07 : MAC neighbors | ||
212 | */ | ||
213 | #define SMT_P_NEIGHBORS 0x0007 /* MAC neighbor description */ | ||
214 | #define SWAP_SMT_P_NEIGHBORS "ss66" | ||
215 | |||
216 | struct smt_p_neighbor { | ||
217 | struct smt_para para ; /* generic parameter header */ | ||
218 | u_short nb_mib_index ; /* MIB index */ | ||
219 | u_short nb_mac_index ; /* n+1 .. n+m, m = #MACs, n = #PHYs */ | ||
220 | struct fddi_addr nb_una ; /* UNA , 0 for unknown */ | ||
221 | struct fddi_addr nb_dna ; /* DNA , 0 for unknown */ | ||
222 | } ; | ||
223 | |||
224 | /* | ||
225 | * PHY record | ||
226 | */ | ||
227 | #define SMT_PHY_A 0 /* A port */ | ||
228 | #define SMT_PHY_B 1 /* B port */ | ||
229 | #define SMT_PHY_S 2 /* slave port */ | ||
230 | #define SMT_PHY_M 3 /* master port */ | ||
231 | |||
232 | #define SMT_CS_DISABLED 0 /* connect state : disabled */ | ||
233 | #define SMT_CS_CONNECTING 1 /* connect state : connecting */ | ||
234 | #define SMT_CS_STANDBY 2 /* connect state : stand by */ | ||
235 | #define SMT_CS_ACTIVE 3 /* connect state : active */ | ||
236 | |||
237 | #define SMT_RM_NONE 0 | ||
238 | #define SMT_RM_MAC 1 | ||
239 | |||
240 | struct smt_phy_rec { | ||
241 | u_short phy_mib_index ; /* MIB index */ | ||
242 | u_char phy_type ; /* A/B/S/M */ | ||
243 | u_char phy_connect_state ; /* disabled/connecting/active */ | ||
244 | u_char phy_remote_type ; /* A/B/S/M */ | ||
245 | u_char phy_remote_mac ; /* none/remote */ | ||
246 | u_short phy_resource_idx ; /* 1 .. n */ | ||
247 | } ; | ||
248 | |||
249 | /* | ||
250 | * MAC record | ||
251 | */ | ||
252 | struct smt_mac_rec { | ||
253 | struct fddi_addr mac_addr ; /* MAC address */ | ||
254 | u_short mac_resource_idx ; /* n+1 .. n+m */ | ||
255 | } ; | ||
256 | |||
257 | /* | ||
258 | * P08 : path descriptors | ||
259 | * should be really an array ; however our environment has a fixed number of | ||
260 | * PHYs and MACs | ||
261 | */ | ||
262 | #define SMT_P_PATH 0x0008 /* path descriptor */ | ||
263 | #define SWAP_SMT_P_PATH "[6s]" | ||
264 | |||
265 | struct smt_p_path { | ||
266 | struct smt_para para ; /* generic parameter header */ | ||
267 | struct smt_phy_rec pd_phy[2] ; /* PHY A */ | ||
268 | struct smt_mac_rec pd_mac ; /* MAC record */ | ||
269 | } ; | ||
270 | |||
271 | /* | ||
272 | * P09 : MAC status | ||
273 | */ | ||
274 | #define SMT_P_MAC_STATUS 0x0009 /* MAC status */ | ||
275 | #define SWAP_SMT_P_MAC_STATUS "sslllllllll" | ||
276 | |||
277 | struct smt_p_mac_status { | ||
278 | struct smt_para para ; /* generic parameter header */ | ||
279 | u_short st_mib_index ; /* MIB index */ | ||
280 | u_short st_mac_index ; /* n+1 .. n+m */ | ||
281 | u_int st_t_req ; /* T_Req */ | ||
282 | u_int st_t_neg ; /* T_Neg */ | ||
283 | u_int st_t_max ; /* T_Max */ | ||
284 | u_int st_tvx_value ; /* TVX_Value */ | ||
285 | u_int st_t_min ; /* T_Min */ | ||
286 | u_int st_sba ; /* synchr. bandwidth alloc */ | ||
287 | u_int st_frame_ct ; /* frame counter */ | ||
288 | u_int st_error_ct ; /* error counter */ | ||
289 | u_int st_lost_ct ; /* lost frames counter */ | ||
290 | } ; | ||
291 | |||
292 | /* | ||
293 | * P0A : PHY link error rate monitoring | ||
294 | */ | ||
295 | #define SMT_P_LEM 0x000a /* link error monitor */ | ||
296 | #define SWAP_SMT_P_LEM "ssccccll" | ||
297 | /* | ||
298 | * units of lem_cutoff,lem_alarm,lem_estimate : 10**-x | ||
299 | */ | ||
300 | struct smt_p_lem { | ||
301 | struct smt_para para ; /* generic parameter header */ | ||
302 | u_short lem_mib_index ; /* MIB index */ | ||
303 | u_short lem_phy_index ; /* 1 .. n */ | ||
304 | u_char lem_pad2 ; /* be nice and make it even . */ | ||
305 | u_char lem_cutoff ; /* 0x4 .. 0xf, default 0x7 */ | ||
306 | u_char lem_alarm ; /* 0x4 .. 0xf, default 0x8 */ | ||
307 | u_char lem_estimate ; /* 0x0 .. 0xff */ | ||
308 | u_int lem_reject_ct ; /* 0x00000000 .. 0xffffffff */ | ||
309 | u_int lem_ct ; /* 0x00000000 .. 0xffffffff */ | ||
310 | } ; | ||
311 | |||
312 | /* | ||
313 | * P0B : MAC frame counters | ||
314 | */ | ||
315 | #define SMT_P_MAC_COUNTER 0x000b /* MAC frame counters */ | ||
316 | #define SWAP_SMT_P_MAC_COUNTER "ssll" | ||
317 | |||
318 | struct smt_p_mac_counter { | ||
319 | struct smt_para para ; /* generic parameter header */ | ||
320 | u_short mc_mib_index ; /* MIB index */ | ||
321 | u_short mc_index ; /* mac index */ | ||
322 | u_int mc_receive_ct ; /* receive counter */ | ||
323 | u_int mc_transmit_ct ; /* transmit counter */ | ||
324 | } ; | ||
325 | |||
326 | /* | ||
327 | * P0C : MAC frame not copied counter | ||
328 | */ | ||
329 | #define SMT_P_MAC_FNC 0x000c /* MAC frame not copied counter */ | ||
330 | #define SWAP_SMT_P_MAC_FNC "ssl" | ||
331 | |||
332 | struct smt_p_mac_fnc { | ||
333 | struct smt_para para ; /* generic parameter header */ | ||
334 | u_short nc_mib_index ; /* MIB index */ | ||
335 | u_short nc_index ; /* mac index */ | ||
336 | u_int nc_counter ; /* not copied counter */ | ||
337 | } ; | ||
338 | |||
339 | |||
340 | /* | ||
341 | * P0D : MAC priority values | ||
342 | */ | ||
343 | #define SMT_P_PRIORITY 0x000d /* MAC priority values */ | ||
344 | #define SWAP_SMT_P_PRIORITY "ssl" | ||
345 | |||
346 | struct smt_p_priority { | ||
347 | struct smt_para para ; /* generic parameter header */ | ||
348 | u_short pr_mib_index ; /* MIB index */ | ||
349 | u_short pr_index ; /* mac index */ | ||
350 | u_int pr_priority[7] ; /* priority values */ | ||
351 | } ; | ||
352 | |||
353 | /* | ||
354 | * P0E : PHY elasticity buffer status | ||
355 | */ | ||
356 | #define SMT_P_EB 0x000e /* PHY EB status */ | ||
357 | #define SWAP_SMT_P_EB "ssl" | ||
358 | |||
359 | struct smt_p_eb { | ||
360 | struct smt_para para ; /* generic parameter header */ | ||
361 | u_short eb_mib_index ; /* MIB index */ | ||
362 | u_short eb_index ; /* phy index */ | ||
363 | u_int eb_error_ct ; /* # of eb overflows */ | ||
364 | } ; | ||
365 | |||
366 | /* | ||
367 | * P0F : manufacturer field | ||
368 | */ | ||
369 | #define SMT_P_MANUFACTURER 0x000f /* manufacturer field */ | ||
370 | #define SWAP_SMT_P_MANUFACTURER "" | ||
371 | |||
372 | struct smp_p_manufacturer { | ||
373 | struct smt_para para ; /* generic parameter header */ | ||
374 | u_char mf_data[32] ; /* OUI + arbitrary data */ | ||
375 | } ; | ||
376 | |||
377 | /* | ||
378 | * P10 : user field | ||
379 | */ | ||
380 | #define SMT_P_USER 0x0010 /* manufacturer field */ | ||
381 | #define SWAP_SMT_P_USER "" | ||
382 | |||
383 | struct smp_p_user { | ||
384 | struct smt_para para ; /* generic parameter header */ | ||
385 | u_char us_data[32] ; /* arbitrary data */ | ||
386 | } ; | ||
387 | |||
388 | |||
389 | |||
390 | /* | ||
391 | * P11 : echo data | ||
392 | */ | ||
393 | #define SMT_P_ECHODATA 0x0011 /* echo data */ | ||
394 | #define SWAP_SMT_P_ECHODATA "" | ||
395 | |||
396 | struct smt_p_echo { | ||
397 | struct smt_para para ; /* generic parameter header */ | ||
398 | u_char ec_data[SMT_MAX_ECHO_LEN-4] ; /* echo data */ | ||
399 | } ; | ||
400 | |||
401 | /* | ||
402 | * P12 : reason code | ||
403 | */ | ||
404 | #define SMT_P_REASON 0x0012 /* reason code */ | ||
405 | #define SWAP_SMT_P_REASON "l" | ||
406 | |||
407 | struct smt_p_reason { | ||
408 | struct smt_para para ; /* generic parameter header */ | ||
409 | u_int rdf_reason ; /* CLASS/VERSION */ | ||
410 | } ; | ||
411 | #define SMT_RDF_CLASS 0x00000001 /* class not supported */ | ||
412 | #define SMT_RDF_VERSION 0x00000002 /* version not supported */ | ||
413 | #define SMT_RDF_SUCCESS 0x00000003 /* success (PMF) */ | ||
414 | #define SMT_RDF_BADSET 0x00000004 /* bad set count (PMF) */ | ||
415 | #define SMT_RDF_ILLEGAL 0x00000005 /* read only (PMF) */ | ||
416 | #define SMT_RDF_NOPARAM 0x6 /* paramter not supported (PMF) */ | ||
417 | #define SMT_RDF_RANGE 0x8 /* out of range */ | ||
418 | #define SMT_RDF_AUTHOR 0x9 /* not autohorized */ | ||
419 | #define SMT_RDF_LENGTH 0x0a /* length error */ | ||
420 | #define SMT_RDF_TOOLONG 0x0b /* length error */ | ||
421 | #define SMT_RDF_SBA 0x0d /* SBA denied */ | ||
422 | |||
423 | /* | ||
424 | * P13 : refused frame beginning | ||
425 | */ | ||
426 | #define SMT_P_REFUSED 0x0013 /* refused frame beginning */ | ||
427 | #define SWAP_SMT_P_REFUSED "l" | ||
428 | |||
429 | struct smt_p_refused { | ||
430 | struct smt_para para ; /* generic parameter header */ | ||
431 | u_int ref_fc ; /* 3 bytes 0 + FC */ | ||
432 | struct smt_header ref_header ; /* refused header */ | ||
433 | } ; | ||
434 | |||
435 | /* | ||
436 | * P14 : supported SMT versions | ||
437 | */ | ||
438 | #define SMT_P_VERSION 0x0014 /* SMT supported versions */ | ||
439 | #define SWAP_SMT_P_VERSION "sccss" | ||
440 | |||
441 | struct smt_p_version { | ||
442 | struct smt_para para ; /* generic parameter header */ | ||
443 | u_short v_pad ; | ||
444 | u_char v_n ; /* 1 .. 0xff, #versions */ | ||
445 | u_char v_index ; /* 1 .. 0xff, index of op. v. */ | ||
446 | u_short v_version[1] ; /* list of min. 1 version */ | ||
447 | u_short v_pad2 ; /* pad if necessary */ | ||
448 | } ; | ||
449 | |||
450 | /* | ||
451 | * P15 : Resource Type | ||
452 | */ | ||
453 | #define SWAP_SMT_P0015 "l" | ||
454 | |||
455 | struct smt_p_0015 { | ||
456 | struct smt_para para ; /* generic parameter header */ | ||
457 | u_int res_type ; /* recsource type */ | ||
458 | } ; | ||
459 | |||
460 | #define SYNC_BW 0x00000001L /* Synchronous Bandwidth */ | ||
461 | |||
462 | /* | ||
463 | * P16 : SBA Command | ||
464 | */ | ||
465 | #define SWAP_SMT_P0016 "l" | ||
466 | |||
467 | struct smt_p_0016 { | ||
468 | struct smt_para para ; /* generic parameter header */ | ||
469 | u_int sba_cmd ; /* command for the SBA */ | ||
470 | } ; | ||
471 | |||
472 | #define REQUEST_ALLOCATION 0x1 /* req allocation of sync bandwidth */ | ||
473 | #define REPORT_ALLOCATION 0x2 /* rep of sync bandwidth allocation */ | ||
474 | #define CHANGE_ALLOCATION 0x3 /* forces a station using sync band-*/ | ||
475 | /* width to change its current allo-*/ | ||
476 | /* cation */ | ||
477 | |||
478 | /* | ||
479 | * P17 : SBA Payload Request | ||
480 | */ | ||
481 | #define SWAP_SMT_P0017 "l" | ||
482 | |||
483 | struct smt_p_0017 { | ||
484 | struct smt_para para ; /* generic parameter header */ | ||
485 | int sba_pl_req ; /* total sync bandwidth measured in */ | ||
486 | } ; /* bytes per 125 us */ | ||
487 | |||
488 | /* | ||
489 | * P18 : SBA Overhead Request | ||
490 | */ | ||
491 | #define SWAP_SMT_P0018 "l" | ||
492 | |||
493 | struct smt_p_0018 { | ||
494 | struct smt_para para ; /* generic parameter header */ | ||
495 | int sba_ov_req ; /* total sync bandwidth req for overhead*/ | ||
496 | } ; /* measuered in bytes per T_Neg */ | ||
497 | |||
498 | /* | ||
499 | * P19 : SBA Allocation Address | ||
500 | */ | ||
501 | #define SWAP_SMT_P0019 "s6" | ||
502 | |||
503 | struct smt_p_0019 { | ||
504 | struct smt_para para ; /* generic parameter header */ | ||
505 | u_short sba_pad ; | ||
506 | struct fddi_addr alloc_addr ; /* Allocation Address */ | ||
507 | } ; | ||
508 | |||
509 | /* | ||
510 | * P1A : SBA Category | ||
511 | */ | ||
512 | #define SWAP_SMT_P001A "l" | ||
513 | |||
514 | struct smt_p_001a { | ||
515 | struct smt_para para ; /* generic parameter header */ | ||
516 | u_int category ; /* Allocator defined classification */ | ||
517 | } ; | ||
518 | |||
519 | /* | ||
520 | * P1B : Maximum T_Neg | ||
521 | */ | ||
522 | #define SWAP_SMT_P001B "l" | ||
523 | |||
524 | struct smt_p_001b { | ||
525 | struct smt_para para ; /* generic parameter header */ | ||
526 | u_int max_t_neg ; /* longest T_NEG for the sync service*/ | ||
527 | } ; | ||
528 | |||
529 | /* | ||
530 | * P1C : Minimum SBA Segment Size | ||
531 | */ | ||
532 | #define SWAP_SMT_P001C "l" | ||
533 | |||
534 | struct smt_p_001c { | ||
535 | struct smt_para para ; /* generic parameter header */ | ||
536 | u_int min_seg_siz ; /* smallest number of bytes per frame*/ | ||
537 | } ; | ||
538 | |||
539 | /* | ||
540 | * P1D : SBA Allocatable | ||
541 | */ | ||
542 | #define SWAP_SMT_P001D "l" | ||
543 | |||
544 | struct smt_p_001d { | ||
545 | struct smt_para para ; /* generic parameter header */ | ||
546 | u_int allocatable ; /* total sync bw available for alloc */ | ||
547 | } ; | ||
548 | |||
549 | /* | ||
550 | * P20 0B : frame status capabilities | ||
551 | * NOTE: not in swap table, is used by smt.c AND PMF table | ||
552 | */ | ||
553 | #define SMT_P_FSC 0x200b | ||
554 | /* #define SWAP_SMT_P_FSC "ssss" */ | ||
555 | |||
556 | struct smt_p_fsc { | ||
557 | struct smt_para para ; /* generic parameter header */ | ||
558 | u_short fsc_pad0 ; | ||
559 | u_short fsc_mac_index ; /* mac index 1 .. ff */ | ||
560 | u_short fsc_pad1 ; | ||
561 | u_short fsc_value ; /* FSC_TYPE[0-2] */ | ||
562 | } ; | ||
563 | |||
564 | #define FSC_TYPE0 0 /* "normal" node (A/C handling) */ | ||
565 | #define FSC_TYPE1 1 /* Special A/C indicator forwarding */ | ||
566 | #define FSC_TYPE2 2 /* Special A/C indicator forwarding */ | ||
567 | |||
568 | /* | ||
569 | * P00 21 : user defined authoriziation (see pmf.c) | ||
570 | */ | ||
571 | #define SMT_P_AUTHOR 0x0021 | ||
572 | |||
573 | /* | ||
574 | * notification parameters | ||
575 | */ | ||
576 | #define SWAP_SMT_P1048 "ll" | ||
577 | struct smt_p_1048 { | ||
578 | u_int p1048_flag ; | ||
579 | u_int p1048_cf_state ; | ||
580 | } ; | ||
581 | |||
582 | /* | ||
583 | * NOTE: all 2xxx 3xxx and 4xxx must include the INDEX in the swap string, | ||
584 | * even so the INDEX is NOT part of the struct. | ||
585 | * INDEX is already swapped in pmf.c, format in string is '4' | ||
586 | */ | ||
587 | #define SWAP_SMT_P208C "4lss66" | ||
588 | struct smt_p_208c { | ||
589 | u_int p208c_flag ; | ||
590 | u_short p208c_pad ; | ||
591 | u_short p208c_dupcondition ; | ||
592 | struct fddi_addr p208c_fddilong ; | ||
593 | struct fddi_addr p208c_fddiunalong ; | ||
594 | } ; | ||
595 | |||
596 | #define SWAP_SMT_P208D "4lllll" | ||
597 | struct smt_p_208d { | ||
598 | u_int p208d_flag ; | ||
599 | u_int p208d_frame_ct ; | ||
600 | u_int p208d_error_ct ; | ||
601 | u_int p208d_lost_ct ; | ||
602 | u_int p208d_ratio ; | ||
603 | } ; | ||
604 | |||
605 | #define SWAP_SMT_P208E "4llll" | ||
606 | struct smt_p_208e { | ||
607 | u_int p208e_flag ; | ||
608 | u_int p208e_not_copied ; | ||
609 | u_int p208e_copied ; | ||
610 | u_int p208e_not_copied_ratio ; | ||
611 | } ; | ||
612 | |||
613 | #define SWAP_SMT_P208F "4ll6666s6" | ||
614 | |||
615 | struct smt_p_208f { | ||
616 | u_int p208f_multiple ; | ||
617 | u_int p208f_nacondition ; | ||
618 | struct fddi_addr p208f_old_una ; | ||
619 | struct fddi_addr p208f_new_una ; | ||
620 | struct fddi_addr p208f_old_dna ; | ||
621 | struct fddi_addr p208f_new_dna ; | ||
622 | u_short p208f_curren_path ; | ||
623 | struct fddi_addr p208f_smt_address ; | ||
624 | } ; | ||
625 | |||
626 | #define SWAP_SMT_P2090 "4lssl" | ||
627 | |||
628 | struct smt_p_2090 { | ||
629 | u_int p2090_multiple ; | ||
630 | u_short p2090_availablepaths ; | ||
631 | u_short p2090_currentpath ; | ||
632 | u_int p2090_requestedpaths ; | ||
633 | } ; | ||
634 | |||
635 | /* | ||
636 | * NOTE: | ||
637 | * special kludge for parameters 320b,320f,3210 | ||
638 | * these parameters are part of RAF frames | ||
639 | * RAF frames are parsed in SBA.C and must be swapped | ||
640 | * PMF.C has special code to avoid double swapping | ||
641 | */ | ||
642 | #ifdef LITTLE_ENDIAN | ||
643 | #define SBAPATHINDEX (0x01000000L) | ||
644 | #else | ||
645 | #define SBAPATHINDEX (0x01L) | ||
646 | #endif | ||
647 | |||
648 | #define SWAP_SMT_P320B "42s" | ||
649 | |||
650 | struct smt_p_320b { | ||
651 | struct smt_para para ; /* generic parameter header */ | ||
652 | u_int mib_index ; | ||
653 | u_short path_pad ; | ||
654 | u_short path_index ; | ||
655 | } ; | ||
656 | |||
657 | #define SWAP_SMT_P320F "4l" | ||
658 | |||
659 | struct smt_p_320f { | ||
660 | struct smt_para para ; /* generic parameter header */ | ||
661 | u_int mib_index ; | ||
662 | u_int mib_payload ; | ||
663 | } ; | ||
664 | |||
665 | #define SWAP_SMT_P3210 "4l" | ||
666 | |||
667 | struct smt_p_3210 { | ||
668 | struct smt_para para ; /* generic parameter header */ | ||
669 | u_int mib_index ; | ||
670 | u_int mib_overhead ; | ||
671 | } ; | ||
672 | |||
673 | #define SWAP_SMT_P4050 "4l1111ll" | ||
674 | |||
675 | struct smt_p_4050 { | ||
676 | u_int p4050_flag ; | ||
677 | u_char p4050_pad ; | ||
678 | u_char p4050_cutoff ; | ||
679 | u_char p4050_alarm ; | ||
680 | u_char p4050_estimate ; | ||
681 | u_int p4050_reject_ct ; | ||
682 | u_int p4050_ct ; | ||
683 | } ; | ||
684 | |||
685 | #define SWAP_SMT_P4051 "4lssss" | ||
686 | struct smt_p_4051 { | ||
687 | u_int p4051_multiple ; | ||
688 | u_short p4051_porttype ; | ||
689 | u_short p4051_connectstate ; | ||
690 | u_short p4051_pc_neighbor ; | ||
691 | u_short p4051_pc_withhold ; | ||
692 | } ; | ||
693 | |||
694 | #define SWAP_SMT_P4052 "4ll" | ||
695 | struct smt_p_4052 { | ||
696 | u_int p4052_flag ; | ||
697 | u_int p4052_eberrorcount ; | ||
698 | } ; | ||
699 | |||
700 | #define SWAP_SMT_P4053 "4lsslss" | ||
701 | |||
702 | struct smt_p_4053 { | ||
703 | u_int p4053_multiple ; | ||
704 | u_short p4053_availablepaths ; | ||
705 | u_short p4053_currentpath ; | ||
706 | u_int p4053_requestedpaths ; | ||
707 | u_short p4053_mytype ; | ||
708 | u_short p4053_neighbortype ; | ||
709 | } ; | ||
710 | |||
711 | |||
712 | #define SMT_P_SETCOUNT 0x1035 | ||
713 | #define SWAP_SMT_P_SETCOUNT "l8" | ||
714 | |||
715 | struct smt_p_setcount { | ||
716 | struct smt_para para ; /* generic parameter header */ | ||
717 | u_int count ; | ||
718 | u_char timestamp[8] ; | ||
719 | } ; | ||
720 | |||
721 | /* | ||
722 | * SMT FRAMES | ||
723 | */ | ||
724 | |||
725 | /* | ||
726 | * NIF : neighbor information frames | ||
727 | */ | ||
728 | struct smt_nif { | ||
729 | struct smt_header smt ; /* generic header */ | ||
730 | struct smt_p_una una ; /* UNA */ | ||
731 | struct smt_p_sde sde ; /* station descriptor */ | ||
732 | struct smt_p_state state ; /* station state */ | ||
733 | #ifdef SMT6_10 | ||
734 | struct smt_p_fsc fsc ; /* frame status cap. */ | ||
735 | #endif | ||
736 | } ; | ||
737 | |||
738 | /* | ||
739 | * SIF : station information frames | ||
740 | */ | ||
741 | struct smt_sif_config { | ||
742 | struct smt_header smt ; /* generic header */ | ||
743 | struct smt_p_timestamp ts ; /* time stamp */ | ||
744 | struct smt_p_sde sde ; /* station descriptor */ | ||
745 | struct smt_p_version version ; /* supported versions */ | ||
746 | struct smt_p_state state ; /* station state */ | ||
747 | struct smt_p_policy policy ; /* station policy */ | ||
748 | struct smt_p_latency latency ; /* path latency */ | ||
749 | struct smt_p_neighbor neighbor ; /* neighbors, we have only one*/ | ||
750 | #ifdef OPT_PMF | ||
751 | struct smt_p_setcount setcount ; /* Set Count mandatory */ | ||
752 | #endif | ||
753 | /* WARNING : path MUST BE LAST FIELD !!! (see smt.c:smt_fill_path) */ | ||
754 | struct smt_p_path path ; /* path descriptor */ | ||
755 | } ; | ||
756 | #define SIZEOF_SMT_SIF_CONFIG (sizeof(struct smt_sif_config)- \ | ||
757 | sizeof(struct smt_p_path)) | ||
758 | |||
759 | struct smt_sif_operation { | ||
760 | struct smt_header smt ; /* generic header */ | ||
761 | struct smt_p_timestamp ts ; /* time stamp */ | ||
762 | struct smt_p_mac_status status ; /* mac status */ | ||
763 | struct smt_p_mac_counter mc ; /* MAC counter */ | ||
764 | struct smt_p_mac_fnc fnc ; /* MAC frame not copied */ | ||
765 | struct smp_p_manufacturer man ; /* manufacturer field */ | ||
766 | struct smp_p_user user ; /* user field */ | ||
767 | #ifdef OPT_PMF | ||
768 | struct smt_p_setcount setcount ; /* Set Count mandatory */ | ||
769 | #endif | ||
770 | /* must be last */ | ||
771 | struct smt_p_lem lem[1] ; /* phy lem status */ | ||
772 | } ; | ||
773 | #define SIZEOF_SMT_SIF_OPERATION (sizeof(struct smt_sif_operation)- \ | ||
774 | sizeof(struct smt_p_lem)) | ||
775 | |||
776 | /* | ||
777 | * ECF : echo frame | ||
778 | */ | ||
779 | struct smt_ecf { | ||
780 | struct smt_header smt ; /* generic header */ | ||
781 | struct smt_p_echo ec_echo ; /* echo parameter */ | ||
782 | } ; | ||
783 | #define SMT_ECF_LEN (sizeof(struct smt_header)+sizeof(struct smt_para)) | ||
784 | |||
785 | /* | ||
786 | * RDF : request denied frame | ||
787 | */ | ||
788 | struct smt_rdf { | ||
789 | struct smt_header smt ; /* generic header */ | ||
790 | struct smt_p_reason reason ; /* reason code */ | ||
791 | struct smt_p_version version ; /* supported versions */ | ||
792 | struct smt_p_refused refused ; /* refused frame fragment */ | ||
793 | } ; | ||
794 | |||
795 | /* | ||
796 | * SBA Request Allocation Responce Frame | ||
797 | */ | ||
798 | struct smt_sba_alc_res { | ||
799 | struct smt_header smt ; /* generic header */ | ||
800 | struct smt_p_0015 s_type ; /* resource type */ | ||
801 | struct smt_p_0016 cmd ; /* SBA command */ | ||
802 | struct smt_p_reason reason ; /* reason code */ | ||
803 | struct smt_p_320b path ; /* path type */ | ||
804 | struct smt_p_320f payload ; /* current SBA payload */ | ||
805 | struct smt_p_3210 overhead ; /* current SBA overhead */ | ||
806 | struct smt_p_0019 a_addr ; /* Allocation Address */ | ||
807 | struct smt_p_001a cat ; /* Category - from the request */ | ||
808 | struct smt_p_001d alloc ; /* SBA Allocatable */ | ||
809 | } ; | ||
810 | |||
811 | /* | ||
812 | * SBA Request Allocation Request Frame | ||
813 | */ | ||
814 | struct smt_sba_alc_req { | ||
815 | struct smt_header smt ; /* generic header */ | ||
816 | struct smt_p_0015 s_type ; /* resource type */ | ||
817 | struct smt_p_0016 cmd ; /* SBA command */ | ||
818 | struct smt_p_320b path ; /* path type */ | ||
819 | struct smt_p_0017 pl_req ; /* requested payload */ | ||
820 | struct smt_p_0018 ov_req ; /* requested SBA overhead */ | ||
821 | struct smt_p_320f payload ; /* current SBA payload */ | ||
822 | struct smt_p_3210 overhead ; /* current SBA overhead */ | ||
823 | struct smt_p_0019 a_addr ; /* Allocation Address */ | ||
824 | struct smt_p_001a cat ; /* Category - from the request */ | ||
825 | struct smt_p_001b tneg ; /* max T-NEG */ | ||
826 | struct smt_p_001c segm ; /* minimum segment size */ | ||
827 | } ; | ||
828 | |||
829 | /* | ||
830 | * SBA Change Allocation Request Frame | ||
831 | */ | ||
832 | struct smt_sba_chg { | ||
833 | struct smt_header smt ; /* generic header */ | ||
834 | struct smt_p_0015 s_type ; /* resource type */ | ||
835 | struct smt_p_0016 cmd ; /* SBA command */ | ||
836 | struct smt_p_320b path ; /* path type */ | ||
837 | struct smt_p_320f payload ; /* current SBA payload */ | ||
838 | struct smt_p_3210 overhead ; /* current SBA overhead */ | ||
839 | struct smt_p_001a cat ; /* Category - from the request */ | ||
840 | } ; | ||
841 | |||
842 | /* | ||
843 | * SBA Report Allocation Request Frame | ||
844 | */ | ||
845 | struct smt_sba_rep_req { | ||
846 | struct smt_header smt ; /* generic header */ | ||
847 | struct smt_p_0015 s_type ; /* resource type */ | ||
848 | struct smt_p_0016 cmd ; /* SBA command */ | ||
849 | } ; | ||
850 | |||
851 | /* | ||
852 | * SBA Report Allocation Response Frame | ||
853 | */ | ||
854 | struct smt_sba_rep_res { | ||
855 | struct smt_header smt ; /* generic header */ | ||
856 | struct smt_p_0015 s_type ; /* resource type */ | ||
857 | struct smt_p_0016 cmd ; /* SBA command */ | ||
858 | struct smt_p_320b path ; /* path type */ | ||
859 | struct smt_p_320f payload ; /* current SBA payload */ | ||
860 | struct smt_p_3210 overhead ; /* current SBA overhead */ | ||
861 | } ; | ||
862 | |||
863 | /* | ||
864 | * actions | ||
865 | */ | ||
866 | #define SMT_STATION_ACTION 1 | ||
867 | #define SMT_STATION_ACTION_CONNECT 0 | ||
868 | #define SMT_STATION_ACTION_DISCONNECT 1 | ||
869 | #define SMT_STATION_ACTION_PATHTEST 2 | ||
870 | #define SMT_STATION_ACTION_SELFTEST 3 | ||
871 | #define SMT_STATION_ACTION_DISABLE_A 4 | ||
872 | #define SMT_STATION_ACTION_DISABLE_B 5 | ||
873 | #define SMT_STATION_ACTION_DISABLE_M 6 | ||
874 | |||
875 | #define SMT_PORT_ACTION 2 | ||
876 | #define SMT_PORT_ACTION_MAINT 0 | ||
877 | #define SMT_PORT_ACTION_ENABLE 1 | ||
878 | #define SMT_PORT_ACTION_DISABLE 2 | ||
879 | #define SMT_PORT_ACTION_START 3 | ||
880 | #define SMT_PORT_ACTION_STOP 4 | ||
881 | |||
882 | #endif /* _SMT_ */ | ||
diff --git a/drivers/net/skfp/h/smt_p.h b/drivers/net/skfp/h/smt_p.h new file mode 100644 index 000000000000..99f9be9552bb --- /dev/null +++ b/drivers/net/skfp/h/smt_p.h | |||
@@ -0,0 +1,326 @@ | |||
1 | /****************************************************************************** | ||
2 | * | ||
3 | * (C)Copyright 1998,1999 SysKonnect, | ||
4 | * a business unit of Schneider & Koch & Co. Datensysteme GmbH. | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License as published by | ||
8 | * the Free Software Foundation; either version 2 of the License, or | ||
9 | * (at your option) any later version. | ||
10 | * | ||
11 | * The information in this file is provided "AS IS" without warranty. | ||
12 | * | ||
13 | ******************************************************************************/ | ||
14 | |||
15 | /* | ||
16 | * defines for all SMT attributes | ||
17 | */ | ||
18 | |||
19 | /* | ||
20 | * this boring file was produced by perl | ||
21 | * thanks Larry ! | ||
22 | */ | ||
23 | #define SMT_P0012 0x0012 | ||
24 | |||
25 | #define SMT_P0015 0x0015 | ||
26 | #define SMT_P0016 0x0016 | ||
27 | #define SMT_P0017 0x0017 | ||
28 | #define SMT_P0018 0x0018 | ||
29 | #define SMT_P0019 0x0019 | ||
30 | |||
31 | #define SMT_P001A 0x001a | ||
32 | #define SMT_P001B 0x001b | ||
33 | #define SMT_P001C 0x001c | ||
34 | #define SMT_P001D 0x001d | ||
35 | |||
36 | #define SMT_P100A 0x100a | ||
37 | #define SMT_P100B 0x100b | ||
38 | #define SMT_P100C 0x100c | ||
39 | #define SMT_P100D 0x100d | ||
40 | #define SMT_P100E 0x100e | ||
41 | #define SMT_P100F 0x100f | ||
42 | #define SMT_P1010 0x1010 | ||
43 | #define SMT_P1011 0x1011 | ||
44 | #define SMT_P1012 0x1012 | ||
45 | #define SMT_P1013 0x1013 | ||
46 | #define SMT_P1014 0x1014 | ||
47 | #define SMT_P1015 0x1015 | ||
48 | #define SMT_P1016 0x1016 | ||
49 | #define SMT_P1017 0x1017 | ||
50 | #define SMT_P1018 0x1018 | ||
51 | #define SMT_P1019 0x1019 | ||
52 | #define SMT_P101A 0x101a | ||
53 | #define SMT_P101B 0x101b | ||
54 | #define SMT_P101C 0x101c | ||
55 | #define SMT_P101D 0x101d | ||
56 | #define SMT_P101E 0x101e | ||
57 | #define SMT_P101F 0x101f | ||
58 | #define SMT_P1020 0x1020 | ||
59 | #define SMT_P1021 0x1021 | ||
60 | #define SMT_P1022 0x1022 | ||
61 | #define SMT_P1023 0x1023 | ||
62 | #define SMT_P1024 0x1024 | ||
63 | #define SMT_P1025 0x1025 | ||
64 | #define SMT_P1026 0x1026 | ||
65 | #define SMT_P1027 0x1027 | ||
66 | #define SMT_P1028 0x1028 | ||
67 | #define SMT_P1029 0x1029 | ||
68 | #define SMT_P102A 0x102a | ||
69 | #define SMT_P102B 0x102b | ||
70 | #define SMT_P102C 0x102c | ||
71 | #define SMT_P102D 0x102d | ||
72 | #define SMT_P102E 0x102e | ||
73 | #define SMT_P102F 0x102f | ||
74 | #define SMT_P1030 0x1030 | ||
75 | #define SMT_P1031 0x1031 | ||
76 | #define SMT_P1032 0x1032 | ||
77 | #define SMT_P1033 0x1033 | ||
78 | #define SMT_P1034 0x1034 | ||
79 | #define SMT_P1035 0x1035 | ||
80 | #define SMT_P1036 0x1036 | ||
81 | #define SMT_P1037 0x1037 | ||
82 | #define SMT_P1038 0x1038 | ||
83 | #define SMT_P1039 0x1039 | ||
84 | #define SMT_P103A 0x103a | ||
85 | #define SMT_P103B 0x103b | ||
86 | #define SMT_P103C 0x103c | ||
87 | #define SMT_P103D 0x103d | ||
88 | #define SMT_P103E 0x103e | ||
89 | #define SMT_P103F 0x103f | ||
90 | #define SMT_P1040 0x1040 | ||
91 | #define SMT_P1041 0x1041 | ||
92 | #define SMT_P1042 0x1042 | ||
93 | #define SMT_P1043 0x1043 | ||
94 | #define SMT_P1044 0x1044 | ||
95 | #define SMT_P1045 0x1045 | ||
96 | #define SMT_P1046 0x1046 | ||
97 | #define SMT_P1047 0x1047 | ||
98 | #define SMT_P1048 0x1048 | ||
99 | #define SMT_P1049 0x1049 | ||
100 | #define SMT_P104A 0x104a | ||
101 | #define SMT_P104B 0x104b | ||
102 | #define SMT_P104C 0x104c | ||
103 | #define SMT_P104D 0x104d | ||
104 | #define SMT_P104E 0x104e | ||
105 | #define SMT_P104F 0x104f | ||
106 | #define SMT_P1050 0x1050 | ||
107 | #define SMT_P1051 0x1051 | ||
108 | #define SMT_P1052 0x1052 | ||
109 | #define SMT_P1053 0x1053 | ||
110 | #define SMT_P1054 0x1054 | ||
111 | |||
112 | #define SMT_P10F0 0x10f0 | ||
113 | #define SMT_P10F1 0x10f1 | ||
114 | #ifdef ESS | ||
115 | #define SMT_P10F2 0x10f2 | ||
116 | #define SMT_P10F3 0x10f3 | ||
117 | #define SMT_P10F4 0x10f4 | ||
118 | #define SMT_P10F5 0x10f5 | ||
119 | #define SMT_P10F6 0x10f6 | ||
120 | #define SMT_P10F7 0x10f7 | ||
121 | #endif | ||
122 | #ifdef SBA | ||
123 | #define SMT_P10F8 0x10f8 | ||
124 | #define SMT_P10F9 0x10f9 | ||
125 | #endif | ||
126 | |||
127 | #define SMT_P200A 0x200a | ||
128 | #define SMT_P200B 0x200b | ||
129 | #define SMT_P200C 0x200c | ||
130 | #define SMT_P200D 0x200d | ||
131 | #define SMT_P200E 0x200e | ||
132 | #define SMT_P200F 0x200f | ||
133 | #define SMT_P2010 0x2010 | ||
134 | #define SMT_P2011 0x2011 | ||
135 | #define SMT_P2012 0x2012 | ||
136 | #define SMT_P2013 0x2013 | ||
137 | #define SMT_P2014 0x2014 | ||
138 | #define SMT_P2015 0x2015 | ||
139 | #define SMT_P2016 0x2016 | ||
140 | #define SMT_P2017 0x2017 | ||
141 | #define SMT_P2018 0x2018 | ||
142 | #define SMT_P2019 0x2019 | ||
143 | #define SMT_P201A 0x201a | ||
144 | #define SMT_P201B 0x201b | ||
145 | #define SMT_P201C 0x201c | ||
146 | #define SMT_P201D 0x201d | ||
147 | #define SMT_P201E 0x201e | ||
148 | #define SMT_P201F 0x201f | ||
149 | #define SMT_P2020 0x2020 | ||
150 | #define SMT_P2021 0x2021 | ||
151 | #define SMT_P2022 0x2022 | ||
152 | #define SMT_P2023 0x2023 | ||
153 | #define SMT_P2024 0x2024 | ||
154 | #define SMT_P2025 0x2025 | ||
155 | #define SMT_P2026 0x2026 | ||
156 | #define SMT_P2027 0x2027 | ||
157 | #define SMT_P2028 0x2028 | ||
158 | #define SMT_P2029 0x2029 | ||
159 | #define SMT_P202A 0x202a | ||
160 | #define SMT_P202B 0x202b | ||
161 | #define SMT_P202C 0x202c | ||
162 | #define SMT_P202D 0x202d | ||
163 | #define SMT_P202E 0x202e | ||
164 | #define SMT_P202F 0x202f | ||
165 | #define SMT_P2030 0x2030 | ||
166 | #define SMT_P2031 0x2031 | ||
167 | #define SMT_P2032 0x2032 | ||
168 | #define SMT_P2033 0x2033 | ||
169 | #define SMT_P2034 0x2034 | ||
170 | #define SMT_P2035 0x2035 | ||
171 | #define SMT_P2036 0x2036 | ||
172 | #define SMT_P2037 0x2037 | ||
173 | #define SMT_P2038 0x2038 | ||
174 | #define SMT_P2039 0x2039 | ||
175 | #define SMT_P203A 0x203a | ||
176 | #define SMT_P203B 0x203b | ||
177 | #define SMT_P203C 0x203c | ||
178 | #define SMT_P203D 0x203d | ||
179 | #define SMT_P203E 0x203e | ||
180 | #define SMT_P203F 0x203f | ||
181 | #define SMT_P2040 0x2040 | ||
182 | #define SMT_P2041 0x2041 | ||
183 | #define SMT_P2042 0x2042 | ||
184 | #define SMT_P2043 0x2043 | ||
185 | #define SMT_P2044 0x2044 | ||
186 | #define SMT_P2045 0x2045 | ||
187 | #define SMT_P2046 0x2046 | ||
188 | #define SMT_P2047 0x2047 | ||
189 | #define SMT_P2048 0x2048 | ||
190 | #define SMT_P2049 0x2049 | ||
191 | #define SMT_P204A 0x204a | ||
192 | #define SMT_P204B 0x204b | ||
193 | #define SMT_P204C 0x204c | ||
194 | #define SMT_P204D 0x204d | ||
195 | #define SMT_P204E 0x204e | ||
196 | #define SMT_P204F 0x204f | ||
197 | #define SMT_P2050 0x2050 | ||
198 | #define SMT_P2051 0x2051 | ||
199 | #define SMT_P2052 0x2052 | ||
200 | #define SMT_P2053 0x2053 | ||
201 | #define SMT_P2054 0x2054 | ||
202 | #define SMT_P2055 0x2055 | ||
203 | #define SMT_P2056 0x2056 | ||
204 | #define SMT_P2057 0x2057 | ||
205 | #define SMT_P2058 0x2058 | ||
206 | #define SMT_P2059 0x2059 | ||
207 | #define SMT_P205A 0x205a | ||
208 | #define SMT_P205B 0x205b | ||
209 | #define SMT_P205C 0x205c | ||
210 | #define SMT_P205D 0x205d | ||
211 | #define SMT_P205E 0x205e | ||
212 | #define SMT_P205F 0x205f | ||
213 | #define SMT_P2060 0x2060 | ||
214 | #define SMT_P2061 0x2061 | ||
215 | #define SMT_P2062 0x2062 | ||
216 | #define SMT_P2063 0x2063 | ||
217 | #define SMT_P2064 0x2064 | ||
218 | #define SMT_P2065 0x2065 | ||
219 | #define SMT_P2066 0x2066 | ||
220 | #define SMT_P2067 0x2067 | ||
221 | #define SMT_P2068 0x2068 | ||
222 | #define SMT_P2069 0x2069 | ||
223 | #define SMT_P206A 0x206a | ||
224 | #define SMT_P206B 0x206b | ||
225 | #define SMT_P206C 0x206c | ||
226 | #define SMT_P206D 0x206d | ||
227 | #define SMT_P206E 0x206e | ||
228 | #define SMT_P206F 0x206f | ||
229 | #define SMT_P2070 0x2070 | ||
230 | #define SMT_P2071 0x2071 | ||
231 | #define SMT_P2072 0x2072 | ||
232 | #define SMT_P2073 0x2073 | ||
233 | #define SMT_P2074 0x2074 | ||
234 | #define SMT_P2075 0x2075 | ||
235 | #define SMT_P2076 0x2076 | ||
236 | |||
237 | #define SMT_P208C 0x208c | ||
238 | #define SMT_P208D 0x208d | ||
239 | #define SMT_P208E 0x208e | ||
240 | #define SMT_P208F 0x208f | ||
241 | #define SMT_P2090 0x2090 | ||
242 | |||
243 | #define SMT_P20F0 0x20F0 | ||
244 | #define SMT_P20F1 0x20F1 | ||
245 | |||
246 | #define SMT_P320A 0x320a | ||
247 | #define SMT_P320B 0x320b | ||
248 | #define SMT_P320C 0x320c | ||
249 | #define SMT_P320D 0x320d | ||
250 | #define SMT_P320E 0x320e | ||
251 | #define SMT_P320F 0x320f | ||
252 | #define SMT_P3210 0x3210 | ||
253 | #define SMT_P3211 0x3211 | ||
254 | #define SMT_P3212 0x3212 | ||
255 | #define SMT_P3213 0x3213 | ||
256 | #define SMT_P3214 0x3214 | ||
257 | #define SMT_P3215 0x3215 | ||
258 | #define SMT_P3216 0x3216 | ||
259 | #define SMT_P3217 0x3217 | ||
260 | |||
261 | #define SMT_P400A 0x400a | ||
262 | #define SMT_P400B 0x400b | ||
263 | #define SMT_P400C 0x400c | ||
264 | #define SMT_P400D 0x400d | ||
265 | #define SMT_P400E 0x400e | ||
266 | #define SMT_P400F 0x400f | ||
267 | #define SMT_P4010 0x4010 | ||
268 | #define SMT_P4011 0x4011 | ||
269 | #define SMT_P4012 0x4012 | ||
270 | #define SMT_P4013 0x4013 | ||
271 | #define SMT_P4014 0x4014 | ||
272 | #define SMT_P4015 0x4015 | ||
273 | #define SMT_P4016 0x4016 | ||
274 | #define SMT_P4017 0x4017 | ||
275 | #define SMT_P4018 0x4018 | ||
276 | #define SMT_P4019 0x4019 | ||
277 | #define SMT_P401A 0x401a | ||
278 | #define SMT_P401B 0x401b | ||
279 | #define SMT_P401C 0x401c | ||
280 | #define SMT_P401D 0x401d | ||
281 | #define SMT_P401E 0x401e | ||
282 | #define SMT_P401F 0x401f | ||
283 | #define SMT_P4020 0x4020 | ||
284 | #define SMT_P4021 0x4021 | ||
285 | #define SMT_P4022 0x4022 | ||
286 | #define SMT_P4023 0x4023 | ||
287 | #define SMT_P4024 0x4024 | ||
288 | #define SMT_P4025 0x4025 | ||
289 | #define SMT_P4026 0x4026 | ||
290 | #define SMT_P4027 0x4027 | ||
291 | #define SMT_P4028 0x4028 | ||
292 | #define SMT_P4029 0x4029 | ||
293 | #define SMT_P402A 0x402a | ||
294 | #define SMT_P402B 0x402b | ||
295 | #define SMT_P402C 0x402c | ||
296 | #define SMT_P402D 0x402d | ||
297 | #define SMT_P402E 0x402e | ||
298 | #define SMT_P402F 0x402f | ||
299 | #define SMT_P4030 0x4030 | ||
300 | #define SMT_P4031 0x4031 | ||
301 | #define SMT_P4032 0x4032 | ||
302 | #define SMT_P4033 0x4033 | ||
303 | #define SMT_P4034 0x4034 | ||
304 | #define SMT_P4035 0x4035 | ||
305 | #define SMT_P4036 0x4036 | ||
306 | #define SMT_P4037 0x4037 | ||
307 | #define SMT_P4038 0x4038 | ||
308 | #define SMT_P4039 0x4039 | ||
309 | #define SMT_P403A 0x403a | ||
310 | #define SMT_P403B 0x403b | ||
311 | #define SMT_P403C 0x403c | ||
312 | #define SMT_P403D 0x403d | ||
313 | #define SMT_P403E 0x403e | ||
314 | #define SMT_P403F 0x403f | ||
315 | #define SMT_P4040 0x4040 | ||
316 | #define SMT_P4041 0x4041 | ||
317 | #define SMT_P4042 0x4042 | ||
318 | #define SMT_P4043 0x4043 | ||
319 | #define SMT_P4044 0x4044 | ||
320 | #define SMT_P4045 0x4045 | ||
321 | #define SMT_P4046 0x4046 | ||
322 | |||
323 | #define SMT_P4050 0x4050 | ||
324 | #define SMT_P4051 0x4051 | ||
325 | #define SMT_P4052 0x4052 | ||
326 | #define SMT_P4053 0x4053 | ||
diff --git a/drivers/net/skfp/h/smtstate.h b/drivers/net/skfp/h/smtstate.h new file mode 100644 index 000000000000..62fe695077a9 --- /dev/null +++ b/drivers/net/skfp/h/smtstate.h | |||
@@ -0,0 +1,106 @@ | |||
1 | /****************************************************************************** | ||
2 | * | ||
3 | * (C)Copyright 1998,1999 SysKonnect, | ||
4 | * a business unit of Schneider & Koch & Co. Datensysteme GmbH. | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License as published by | ||
8 | * the Free Software Foundation; either version 2 of the License, or | ||
9 | * (at your option) any later version. | ||
10 | * | ||
11 | * The information in this file is provided "AS IS" without warranty. | ||
12 | * | ||
13 | ******************************************************************************/ | ||
14 | |||
15 | #ifndef _SKFP_H_SMTSTATE_H_ | ||
16 | #define _SKFP_H_SMTSTATE_H_ | ||
17 | |||
18 | /* | ||
19 | * SMT state definitions | ||
20 | */ | ||
21 | |||
22 | #ifndef KERNEL | ||
23 | /* | ||
24 | * PCM states | ||
25 | */ | ||
26 | #define PC0_OFF 0 | ||
27 | #define PC1_BREAK 1 | ||
28 | #define PC2_TRACE 2 | ||
29 | #define PC3_CONNECT 3 | ||
30 | #define PC4_NEXT 4 | ||
31 | #define PC5_SIGNAL 5 | ||
32 | #define PC6_JOIN 6 | ||
33 | #define PC7_VERIFY 7 | ||
34 | #define PC8_ACTIVE 8 | ||
35 | #define PC9_MAINT 9 | ||
36 | |||
37 | /* | ||
38 | * PCM modes | ||
39 | */ | ||
40 | #define PM_NONE 0 | ||
41 | #define PM_PEER 1 | ||
42 | #define PM_TREE 2 | ||
43 | |||
44 | /* | ||
45 | * PCM type | ||
46 | */ | ||
47 | #define TA 0 | ||
48 | #define TB 1 | ||
49 | #define TS 2 | ||
50 | #define TM 3 | ||
51 | #define TNONE 4 | ||
52 | |||
53 | /* | ||
54 | * CFM states | ||
55 | */ | ||
56 | #define SC0_ISOLATED 0 /* isolated */ | ||
57 | #define SC1_WRAP_A 5 /* wrap A */ | ||
58 | #define SC2_WRAP_B 6 /* wrap B */ | ||
59 | #define SC4_THRU_A 12 /* through A */ | ||
60 | #define SC5_THRU_B 7 /* through B (SMt 6.2) */ | ||
61 | #define SC7_WRAP_S 8 /* SAS */ | ||
62 | |||
63 | /* | ||
64 | * ECM states | ||
65 | */ | ||
66 | #define EC0_OUT 0 | ||
67 | #define EC1_IN 1 | ||
68 | #define EC2_TRACE 2 | ||
69 | #define EC3_LEAVE 3 | ||
70 | #define EC4_PATH_TEST 4 | ||
71 | #define EC5_INSERT 5 | ||
72 | #define EC6_CHECK 6 | ||
73 | #define EC7_DEINSERT 7 | ||
74 | |||
75 | /* | ||
76 | * RMT states | ||
77 | */ | ||
78 | #define RM0_ISOLATED 0 | ||
79 | #define RM1_NON_OP 1 /* not operational */ | ||
80 | #define RM2_RING_OP 2 /* ring operational */ | ||
81 | #define RM3_DETECT 3 /* detect dupl addresses */ | ||
82 | #define RM4_NON_OP_DUP 4 /* dupl. addr detected */ | ||
83 | #define RM5_RING_OP_DUP 5 /* ring oper. with dupl. addr */ | ||
84 | #define RM6_DIRECTED 6 /* sending directed beacons */ | ||
85 | #define RM7_TRACE 7 /* trace initiated */ | ||
86 | #endif | ||
87 | |||
88 | struct pcm_state { | ||
89 | unsigned char pcm_type ; /* TA TB TS TM */ | ||
90 | unsigned char pcm_state ; /* state PC[0-9]_* */ | ||
91 | unsigned char pcm_mode ; /* PM_{NONE,PEER,TREE} */ | ||
92 | unsigned char pcm_neighbor ; /* TA TB TS TM */ | ||
93 | unsigned char pcm_bsf ; /* flag bs : TRUE/FALSE */ | ||
94 | unsigned char pcm_lsf ; /* flag ls : TRUE/FALSE */ | ||
95 | unsigned char pcm_lct_fail ; /* counter lct_fail */ | ||
96 | unsigned char pcm_ls_rx ; /* rx line state */ | ||
97 | short pcm_r_val ; /* signaling bits */ | ||
98 | short pcm_t_val ; /* signaling bits */ | ||
99 | } ; | ||
100 | |||
101 | struct smt_state { | ||
102 | struct pcm_state pcm_state[NUMPHYS] ; /* port A & port B */ | ||
103 | } ; | ||
104 | |||
105 | #endif | ||
106 | |||
diff --git a/drivers/net/skfp/h/supern_2.h b/drivers/net/skfp/h/supern_2.h new file mode 100644 index 000000000000..5ba0b8306753 --- /dev/null +++ b/drivers/net/skfp/h/supern_2.h | |||
@@ -0,0 +1,1059 @@ | |||
1 | /****************************************************************************** | ||
2 | * | ||
3 | * (C)Copyright 1998,1999 SysKonnect, | ||
4 | * a business unit of Schneider & Koch & Co. Datensysteme GmbH. | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License as published by | ||
8 | * the Free Software Foundation; either version 2 of the License, or | ||
9 | * (at your option) any later version. | ||
10 | * | ||
11 | * The information in this file is provided "AS IS" without warranty. | ||
12 | * | ||
13 | ******************************************************************************/ | ||
14 | |||
15 | /* | ||
16 | defines for AMD Supernet II chip set | ||
17 | the chips are refered to as | ||
18 | FPLUS Formac Plus | ||
19 | PLC Physical Layer | ||
20 | |||
21 | added defines for AMD Supernet III chip set | ||
22 | added comments on differences between Supernet II and Supernet III | ||
23 | added defines for the Motorola ELM (MOT_ELM) | ||
24 | */ | ||
25 | |||
26 | #ifndef _SUPERNET_ | ||
27 | #define _SUPERNET_ | ||
28 | |||
29 | /* | ||
30 | * Define Supernet 3 when used | ||
31 | */ | ||
32 | #ifdef PCI | ||
33 | #ifndef SUPERNET_3 | ||
34 | #define SUPERNET_3 | ||
35 | #endif | ||
36 | #define TAG | ||
37 | #endif | ||
38 | |||
39 | #define MB 0xff | ||
40 | #define MW 0xffff | ||
41 | #define MD 0xffffffff | ||
42 | |||
43 | /* | ||
44 | * FORMAC frame status (rx_msext) | ||
45 | */ | ||
46 | #define FS_EI (1<<2) | ||
47 | #define FS_AI (1<<1) | ||
48 | #define FS_CI (1<<0) | ||
49 | |||
50 | #define FS_MSVALID (1<<15) /* end of queue */ | ||
51 | #define FS_MSRABT (1<<14) /* frame was aborted during reception*/ | ||
52 | #define FS_SSRCRTG (1<<12) /* if SA has set MSB (source-routing)*/ | ||
53 | #define FS_SEAC2 (FS_EI<<9) /* error indicator */ | ||
54 | #define FS_SEAC1 (FS_AI<<9) /* address indicator */ | ||
55 | #define FS_SEAC0 (FS_CI<<9) /* copy indicator */ | ||
56 | #define FS_SFRMERR (1<<8) /* error detected (CRC or length) */ | ||
57 | #define FS_SADRRG (1<<7) /* address recognized */ | ||
58 | #define FS_SFRMTY2 (1<<6) /* frame-class bit */ | ||
59 | #define FS_SFRMTY1 (1<<5) /* frame-type bit (impementor) */ | ||
60 | #define FS_SFRMTY0 (1<<4) /* frame-type bit (LLC) */ | ||
61 | #define FS_ERFBB1 (1<<1) /* byte offset (depends on LSB bit) */ | ||
62 | #define FS_ERFBB0 (1<<0) /* - " - */ | ||
63 | |||
64 | /* | ||
65 | * status frame type | ||
66 | */ | ||
67 | #define FRM_SMT (0) /* asynchr. frames */ | ||
68 | #define FRM_LLCA (1) | ||
69 | #define FRM_IMPA (2) | ||
70 | #define FRM_MAC (4) /* synchr. frames */ | ||
71 | #define FRM_LLCS (5) | ||
72 | #define FRM_IMPS (6) | ||
73 | |||
74 | /* | ||
75 | * bits in rx_descr.i (receive frame status word) | ||
76 | */ | ||
77 | #define RX_MSVALID ((long)1<<31) /* memory status valid */ | ||
78 | #define RX_MSRABT ((long)1<<30) /* memory status receive abort */ | ||
79 | #define RX_FS_E ((long)FS_SEAC2<<16) /* error indicator */ | ||
80 | #define RX_FS_A ((long)FS_SEAC1<<16) /* address indicator */ | ||
81 | #define RX_FS_C ((long)FS_SEAC0<<16) /* copy indicator */ | ||
82 | #define RX_FS_CRC ((long)FS_SFRMERR<<16)/* error detected */ | ||
83 | #define RX_FS_ADDRESS ((long)FS_SADRRG<<16) /* address recognized */ | ||
84 | #define RX_FS_MAC ((long)FS_SFRMTY2<<16)/* MAC frame */ | ||
85 | #define RX_FS_SMT ((long)0<<16) /* SMT frame */ | ||
86 | #define RX_FS_IMPL ((long)FS_SFRMTY1<<16)/* implementer frame */ | ||
87 | #define RX_FS_LLC ((long)FS_SFRMTY0<<16)/* LLC frame */ | ||
88 | |||
89 | /* | ||
90 | * receive frame descriptor | ||
91 | */ | ||
92 | union rx_descr { | ||
93 | struct { | ||
94 | #ifdef LITTLE_ENDIAN | ||
95 | unsigned rx_length :16 ; /* frame length lower/upper byte */ | ||
96 | unsigned rx_erfbb :2 ; /* received frame byte boundary */ | ||
97 | unsigned rx_reserv2:2 ; /* reserved */ | ||
98 | unsigned rx_sfrmty :3 ; /* frame type bits */ | ||
99 | unsigned rx_sadrrg :1 ; /* DA == MA or broad-/multicast */ | ||
100 | unsigned rx_sfrmerr:1 ; /* received frame not valid */ | ||
101 | unsigned rx_seac0 :1 ; /* frame-copied C-indicator */ | ||
102 | unsigned rx_seac1 :1 ; /* address-match A-indicator */ | ||
103 | unsigned rx_seac2 :1 ; /* frame-error E-indicator */ | ||
104 | unsigned rx_ssrcrtg:1 ; /* == 1 SA has MSB set */ | ||
105 | unsigned rx_reserv1:1 ; /* reserved */ | ||
106 | unsigned rx_msrabt :1 ; /* memory status receive abort */ | ||
107 | unsigned rx_msvalid:1 ; /* memory status valid */ | ||
108 | #else | ||
109 | unsigned rx_msvalid:1 ; /* memory status valid */ | ||
110 | unsigned rx_msrabt :1 ; /* memory status receive abort */ | ||
111 | unsigned rx_reserv1:1 ; /* reserved */ | ||
112 | unsigned rx_ssrcrtg:1 ; /* == 1 SA has MSB set */ | ||
113 | unsigned rx_seac2 :1 ; /* frame-error E-indicator */ | ||
114 | unsigned rx_seac1 :1 ; /* address-match A-indicator */ | ||
115 | unsigned rx_seac0 :1 ; /* frame-copied C-indicator */ | ||
116 | unsigned rx_sfrmerr:1 ; /* received frame not valid */ | ||
117 | unsigned rx_sadrrg :1 ; /* DA == MA or broad-/multicast */ | ||
118 | unsigned rx_sfrmty :3 ; /* frame type bits */ | ||
119 | unsigned rx_erfbb :2 ; /* received frame byte boundary */ | ||
120 | unsigned rx_reserv2:2 ; /* reserved */ | ||
121 | unsigned rx_length :16 ; /* frame length lower/upper byte */ | ||
122 | #endif | ||
123 | } r ; | ||
124 | long i ; | ||
125 | } ; | ||
126 | |||
127 | /* defines for Receive Frame Descriptor access */ | ||
128 | #define RD_S_ERFBB 0x00030000L /* received frame byte boundary */ | ||
129 | #define RD_S_RES2 0x000c0000L /* reserved */ | ||
130 | #define RD_S_SFRMTY 0x00700000L /* frame type bits */ | ||
131 | #define RD_S_SADRRG 0x00800000L /* DA == MA or broad-/multicast */ | ||
132 | #define RD_S_SFRMERR 0x01000000L /* received frame not valid */ | ||
133 | #define RD_S_SEAC 0x0e000000L /* frame status indicators */ | ||
134 | #define RD_S_SEAC0 0x02000000L /* frame-copied case-indicator */ | ||
135 | #define RD_S_SEAC1 0x04000000L /* address-match A-indicator */ | ||
136 | #define RD_S_SEAC2 0x08000000L /* frame-error E-indicator */ | ||
137 | #define RD_S_SSRCRTG 0x10000000L /* == 1 SA has MSB set */ | ||
138 | #define RD_S_RES1 0x20000000L /* reserved */ | ||
139 | #define RD_S_MSRABT 0x40000000L /* memory status receive abort */ | ||
140 | #define RD_S_MSVALID 0x80000000L /* memory status valid */ | ||
141 | |||
142 | #define RD_STATUS 0xffff0000L | ||
143 | #define RD_LENGTH 0x0000ffffL | ||
144 | |||
145 | /* defines for Receive Frames Status Word values */ | ||
146 | /*RD_S_SFRMTY*/ | ||
147 | #define RD_FRM_SMT (unsigned long)(0<<20) /* asynchr. frames */ | ||
148 | #define RD_FRM_LLCA (unsigned long)(1<<20) | ||
149 | #define RD_FRM_IMPA (unsigned long)(2<<20) | ||
150 | #define RD_FRM_MAC (unsigned long)(4<<20) /* synchr. frames */ | ||
151 | #define RD_FRM_LLCS (unsigned long)(5<<20) | ||
152 | #define RD_FRM_IMPS (unsigned long)(6<<20) | ||
153 | |||
154 | #define TX_DESCRIPTOR 0x40000000L | ||
155 | #define TX_OFFSET_3 0x18000000L | ||
156 | |||
157 | #define TXP1 2 | ||
158 | |||
159 | /* | ||
160 | * transmit frame descriptor | ||
161 | */ | ||
162 | union tx_descr { | ||
163 | struct { | ||
164 | #ifdef LITTLE_ENDIAN | ||
165 | unsigned tx_length:16 ; /* frame length lower/upper byte */ | ||
166 | unsigned tx_res :8 ; /* reserved (bit 16..23) */ | ||
167 | unsigned tx_xmtabt:1 ; /* transmit abort */ | ||
168 | unsigned tx_nfcs :1 ; /* no frame check sequence */ | ||
169 | unsigned tx_xdone :1 ; /* give up token */ | ||
170 | unsigned tx_rpxm :2 ; /* byte offset */ | ||
171 | unsigned tx_pat1 :2 ; /* must be TXP1 */ | ||
172 | unsigned tx_more :1 ; /* more frame in chain */ | ||
173 | #else | ||
174 | unsigned tx_more :1 ; /* more frame in chain */ | ||
175 | unsigned tx_pat1 :2 ; /* must be TXP1 */ | ||
176 | unsigned tx_rpxm :2 ; /* byte offset */ | ||
177 | unsigned tx_xdone :1 ; /* give up token */ | ||
178 | unsigned tx_nfcs :1 ; /* no frame check sequence */ | ||
179 | unsigned tx_xmtabt:1 ; /* transmit abort */ | ||
180 | unsigned tx_res :8 ; /* reserved (bit 16..23) */ | ||
181 | unsigned tx_length:16 ; /* frame length lower/upper byte */ | ||
182 | #endif | ||
183 | } t ; | ||
184 | long i ; | ||
185 | } ; | ||
186 | |||
187 | /* defines for Transmit Descriptor access */ | ||
188 | #define TD_C_MORE 0x80000000L /* more frame in chain */ | ||
189 | #define TD_C_DESCR 0x60000000L /* must be TXP1 */ | ||
190 | #define TD_C_TXFBB 0x18000000L /* byte offset */ | ||
191 | #define TD_C_XDONE 0x04000000L /* give up token */ | ||
192 | #define TD_C_NFCS 0x02000000L /* no frame check sequence */ | ||
193 | #define TD_C_XMTABT 0x01000000L /* transmit abort */ | ||
194 | |||
195 | #define TD_C_LNCNU 0x0000ff00L | ||
196 | #define TD_C_LNCNL 0x000000ffL | ||
197 | #define TD_C_LNCN 0x0000ffffL /* frame length lower/upper byte */ | ||
198 | |||
199 | /* | ||
200 | * transmit pointer | ||
201 | */ | ||
202 | union tx_pointer { | ||
203 | struct t { | ||
204 | #ifdef LITTLE_ENDIAN | ||
205 | unsigned tp_pointer:16 ; /* pointer to tx_descr (low/high) */ | ||
206 | unsigned tp_res :8 ; /* reserved (bit 16..23) */ | ||
207 | unsigned tp_pattern:8 ; /* fixed pattern (bit 24..31) */ | ||
208 | #else | ||
209 | unsigned tp_pattern:8 ; /* fixed pattern (bit 24..31) */ | ||
210 | unsigned tp_res :8 ; /* reserved (bit 16..23) */ | ||
211 | unsigned tp_pointer:16 ; /* pointer to tx_descr (low/high) */ | ||
212 | #endif | ||
213 | } t ; | ||
214 | long i ; | ||
215 | } ; | ||
216 | |||
217 | /* defines for Nontag Mode Pointer access */ | ||
218 | #define TD_P_CNTRL 0xff000000L | ||
219 | #define TD_P_RPXU 0x0000ff00L | ||
220 | #define TD_P_RPXL 0x000000ffL | ||
221 | #define TD_P_RPX 0x0000ffffL | ||
222 | |||
223 | |||
224 | #define TX_PATTERN 0xa0 | ||
225 | #define TX_POINTER_END 0xa0000000L | ||
226 | #define TX_INT_PATTERN 0xa0000000L | ||
227 | |||
228 | struct tx_queue { | ||
229 | struct tx_queue *tq_next ; | ||
230 | u_short tq_pack_offset ; /* offset buffer memory */ | ||
231 | u_char tq_pad[2] ; | ||
232 | } ; | ||
233 | |||
234 | /* | ||
235 | defines for FORMAC Plus (Am79C830) | ||
236 | */ | ||
237 | |||
238 | /* | ||
239 | * FORMAC+ read/write (r/w) registers | ||
240 | */ | ||
241 | #define FM_CMDREG1 0x00 /* write command reg 1 instruction */ | ||
242 | #define FM_CMDREG2 0x01 /* write command reg 2 instruction */ | ||
243 | #define FM_ST1U 0x00 /* read upper 16-bit of status reg 1 */ | ||
244 | #define FM_ST1L 0x01 /* read lower 16-bit of status reg 1 */ | ||
245 | #define FM_ST2U 0x02 /* read upper 16-bit of status reg 2 */ | ||
246 | #define FM_ST2L 0x03 /* read lower 16-bit of status reg 2 */ | ||
247 | #define FM_IMSK1U 0x04 /* r/w upper 16-bit of IMSK 1 */ | ||
248 | #define FM_IMSK1L 0x05 /* r/w lower 16-bit of IMSK 1 */ | ||
249 | #define FM_IMSK2U 0x06 /* r/w upper 16-bit of IMSK 2 */ | ||
250 | #define FM_IMSK2L 0x07 /* r/w lower 16-bit of IMSK 2 */ | ||
251 | #define FM_SAID 0x08 /* r/w short addr.-individual */ | ||
252 | #define FM_LAIM 0x09 /* r/w long addr.-ind. (MSW of LAID) */ | ||
253 | #define FM_LAIC 0x0a /* r/w long addr.-ind. (middle)*/ | ||
254 | #define FM_LAIL 0x0b /* r/w long addr.-ind. (LSW) */ | ||
255 | #define FM_SAGP 0x0c /* r/w short address-group */ | ||
256 | #define FM_LAGM 0x0d /* r/w long addr.-gr. (MSW of LAGP) */ | ||
257 | #define FM_LAGC 0x0e /* r/w long addr.-gr. (middle) */ | ||
258 | #define FM_LAGL 0x0f /* r/w long addr.-gr. (LSW) */ | ||
259 | #define FM_MDREG1 0x10 /* r/w 16-bit mode reg 1 */ | ||
260 | #define FM_STMCHN 0x11 /* read state-machine reg */ | ||
261 | #define FM_MIR1 0x12 /* read upper 16-bit of MAC Info Reg */ | ||
262 | #define FM_MIR0 0x13 /* read lower 16-bit of MAC Info Reg */ | ||
263 | #define FM_TMAX 0x14 /* r/w 16-bit TMAX reg */ | ||
264 | #define FM_TVX 0x15 /* write 8-bit TVX reg with NP7-0 | ||
265 | read TVX on NP7-0, timer on NP15-8*/ | ||
266 | #define FM_TRT 0x16 /* r/w upper 16-bit of TRT timer */ | ||
267 | #define FM_THT 0x17 /* r/w upper 16-bit of THT timer */ | ||
268 | #define FM_TNEG 0x18 /* read upper 16-bit of TNEG (TTRT) */ | ||
269 | #define FM_TMRS 0x19 /* read lower 5-bit of TNEG,TRT,THT */ | ||
270 | /* F E D C B A 9 8 7 6 5 4 3 2 1 0 | ||
271 | x |-TNEG4-0| |-TRT4-0-| |-THT4-0-| (x-late count) */ | ||
272 | #define FM_TREQ0 0x1a /* r/w 16-bit TREQ0 reg (LSW of TRT) */ | ||
273 | #define FM_TREQ1 0x1b /* r/w 16-bit TREQ1 reg (MSW of TRT) */ | ||
274 | #define FM_PRI0 0x1c /* r/w priority r. for asyn.-queue 0 */ | ||
275 | #define FM_PRI1 0x1d /* r/w priority r. for asyn.-queue 1 */ | ||
276 | #define FM_PRI2 0x1e /* r/w priority r. for asyn.-queue 2 */ | ||
277 | #define FM_TSYNC 0x1f /* r/w 16-bit of the TSYNC register */ | ||
278 | #define FM_MDREG2 0x20 /* r/w 16-bit mode reg 2 */ | ||
279 | #define FM_FRMTHR 0x21 /* r/w the frame threshold register */ | ||
280 | #define FM_EACB 0x22 /* r/w end addr of claim/beacon area */ | ||
281 | #define FM_EARV 0x23 /* r/w end addr of receive queue */ | ||
282 | /* Supernet 3 */ | ||
283 | #define FM_EARV1 FM_EARV | ||
284 | |||
285 | #define FM_EAS 0x24 /* r/w end addr of synchr. queue */ | ||
286 | #define FM_EAA0 0x25 /* r/w end addr of asyn. queue 0 */ | ||
287 | #define FM_EAA1 0x26 /* r/w end addr of asyn. queue 1 */ | ||
288 | #define FM_EAA2 0x27 /* r/w end addr of asyn. queue 2 */ | ||
289 | #define FM_SACL 0x28 /* r/w start addr of claim frame */ | ||
290 | #define FM_SABC 0x29 /* r/w start addr of beacon frame */ | ||
291 | #define FM_WPXSF 0x2a /* r/w the write ptr. for special fr.*/ | ||
292 | #define FM_RPXSF 0x2b /* r/w the read ptr. for special fr. */ | ||
293 | #define FM_RPR 0x2d /* r/w the read ptr. for receive qu. */ | ||
294 | #define FM_WPR 0x2e /* r/w the write ptr. for receive qu.*/ | ||
295 | #define FM_SWPR 0x2f /* r/w the shadow wr.-ptr. for rec.q.*/ | ||
296 | /* Supernet 3 */ | ||
297 | #define FM_RPR1 FM_RPR | ||
298 | #define FM_WPR1 FM_WPR | ||
299 | #define FM_SWPR1 FM_SWPR | ||
300 | |||
301 | #define FM_WPXS 0x30 /* r/w the write ptr. for synchr. qu.*/ | ||
302 | #define FM_WPXA0 0x31 /* r/w the write ptr. for asyn. qu.0 */ | ||
303 | #define FM_WPXA1 0x32 /* r/w the write ptr. for asyn. qu.1 */ | ||
304 | #define FM_WPXA2 0x33 /* r/w the write ptr. for asyn. qu.2 */ | ||
305 | #define FM_SWPXS 0x34 /* r/w the shadow wr.-ptr. for syn.q.*/ | ||
306 | #define FM_SWPXA0 0x35 /* r/w the shad. wr.-ptr. for asyn.q0*/ | ||
307 | #define FM_SWPXA1 0x36 /* r/w the shad. wr.-ptr. for asyn.q1*/ | ||
308 | #define FM_SWPXA2 0x37 /* r/w the shad. wr.-ptr. for asyn.q2*/ | ||
309 | #define FM_RPXS 0x38 /* r/w the read ptr. for synchr. qu. */ | ||
310 | #define FM_RPXA0 0x39 /* r/w the read ptr. for asyn. qu. 0 */ | ||
311 | #define FM_RPXA1 0x3a /* r/w the read ptr. for asyn. qu. 1 */ | ||
312 | #define FM_RPXA2 0x3b /* r/w the read ptr. for asyn. qu. 2 */ | ||
313 | #define FM_MARR 0x3c /* r/w the memory read addr register */ | ||
314 | #define FM_MARW 0x3d /* r/w the memory write addr register*/ | ||
315 | #define FM_MDRU 0x3e /* r/w upper 16-bit of mem. data reg */ | ||
316 | #define FM_MDRL 0x3f /* r/w lower 16-bit of mem. data reg */ | ||
317 | |||
318 | /* following instructions relate to MAC counters and timer */ | ||
319 | #define FM_TMSYNC 0x40 /* r/w upper 16 bits of TMSYNC timer */ | ||
320 | #define FM_FCNTR 0x41 /* r/w the 16-bit frame counter */ | ||
321 | #define FM_LCNTR 0x42 /* r/w the 16-bit lost counter */ | ||
322 | #define FM_ECNTR 0x43 /* r/w the 16-bit error counter */ | ||
323 | |||
324 | /* Supernet 3: extensions to old register block */ | ||
325 | #define FM_FSCNTR 0x44 /* r/? Frame Strip Counter */ | ||
326 | #define FM_FRSELREG 0x45 /* r/w Frame Selection Register */ | ||
327 | |||
328 | /* Supernet 3: extensions for 2. receive queue etc. */ | ||
329 | #define FM_MDREG3 0x60 /* r/w Mode Register 3 */ | ||
330 | #define FM_ST3U 0x61 /* read upper 16-bit of status reg 3 */ | ||
331 | #define FM_ST3L 0x62 /* read lower 16-bit of status reg 3 */ | ||
332 | #define FM_IMSK3U 0x63 /* r/w upper 16-bit of IMSK reg 3 */ | ||
333 | #define FM_IMSK3L 0x64 /* r/w lower 16-bit of IMSK reg 3 */ | ||
334 | #define FM_IVR 0x65 /* read Interrupt Vector register */ | ||
335 | #define FM_IMR 0x66 /* r/w Interrupt mask register */ | ||
336 | /* 0x67 Hidden */ | ||
337 | #define FM_RPR2 0x68 /* r/w the read ptr. for rec. qu. 2 */ | ||
338 | #define FM_WPR2 0x69 /* r/w the write ptr. for rec. qu. 2 */ | ||
339 | #define FM_SWPR2 0x6a /* r/w the shadow wptr. for rec. q. 2 */ | ||
340 | #define FM_EARV2 0x6b /* r/w end addr of rec. qu. 2 */ | ||
341 | #define FM_UNLCKDLY 0x6c /* r/w Auto Unlock Delay register */ | ||
342 | /* Bit 15-8: RECV2 unlock threshold */ | ||
343 | /* Bit 7-0: RECV1 unlock threshold */ | ||
344 | /* 0x6f-0x73 Hidden */ | ||
345 | #define FM_LTDPA1 0x79 /* r/w Last Trans desc ptr for A1 qu. */ | ||
346 | /* 0x80-0x9a PLCS registers of built-in PLCS (Supernet 3 only) */ | ||
347 | |||
348 | /* Supernet 3: Adderss Filter Registers */ | ||
349 | #define FM_AFCMD 0xb0 /* r/w Address Filter Command Reg */ | ||
350 | #define FM_AFSTAT 0xb2 /* r/w Address Filter Status Reg */ | ||
351 | #define FM_AFBIST 0xb4 /* r/w Address Filter BIST signature */ | ||
352 | #define FM_AFCOMP2 0xb6 /* r/w Address Filter Comparand 2 */ | ||
353 | #define FM_AFCOMP1 0xb8 /* r/w Address Filter Comparand 1 */ | ||
354 | #define FM_AFCOMP0 0xba /* r/w Address Filter Comparand 0 */ | ||
355 | #define FM_AFMASK2 0xbc /* r/w Address Filter Mask 2 */ | ||
356 | #define FM_AFMASK1 0xbe /* r/w Address Filter Mask 1 */ | ||
357 | #define FM_AFMASK0 0xc0 /* r/w Address Filter Mask 0 */ | ||
358 | #define FM_AFPERS 0xc2 /* r/w Address Filter Personality Reg */ | ||
359 | |||
360 | /* Supernet 3: Orion (PDX?) Registers */ | ||
361 | #define FM_ORBIST 0xd0 /* r/w Orion BIST signature */ | ||
362 | #define FM_ORSTAT 0xd2 /* r/w Orion Status Register */ | ||
363 | |||
364 | |||
365 | /* | ||
366 | * Mode Register 1 (MDREG1) | ||
367 | */ | ||
368 | #define FM_RES0 0x0001 /* reserved */ | ||
369 | /* SN3: other definition */ | ||
370 | #define FM_XMTINH_HOLD 0x0002 /* transmit-inhibit/hold bit */ | ||
371 | /* SN3: other definition */ | ||
372 | #define FM_HOFLXI 0x0003 /* SN3: Hold / Flush / Inhibit */ | ||
373 | #define FM_FULL_HALF 0x0004 /* full-duplex/half-duplex bit */ | ||
374 | #define FM_LOCKTX 0x0008 /* lock-transmit-asynchr.-queues bit */ | ||
375 | #define FM_EXGPA0 0x0010 /* extended-group-addressing bit 0 */ | ||
376 | #define FM_EXGPA1 0x0020 /* extended-group-addressing bit 1 */ | ||
377 | #define FM_DISCRY 0x0040 /* disable-carry bit */ | ||
378 | /* SN3: reserved */ | ||
379 | #define FM_SELRA 0x0080 /* select input from PHY (1=RA,0=RB) */ | ||
380 | |||
381 | #define FM_ADDET 0x0700 /* address detection */ | ||
382 | #define FM_MDAMA (0<<8) /* address detection : DA = MA */ | ||
383 | #define FM_MDASAMA (1<<8) /* address detection : DA=MA||SA=MA */ | ||
384 | #define FM_MRNNSAFNMA (2<<8) /* rec. non-NSA frames DA=MA&&SA!=MA */ | ||
385 | #define FM_MRNNSAF (3<<8) /* rec. non-NSA frames DA = MA */ | ||
386 | #define FM_MDISRCV (4<<8) /* disable receive function */ | ||
387 | #define FM_MRES0 (5<<8) /* reserve */ | ||
388 | #define FM_MLIMPROM (6<<8) /* limited-promiscuous mode */ | ||
389 | #define FM_MPROMISCOUS (7<<8) /* address detection : promiscous */ | ||
390 | |||
391 | #define FM_SELSA 0x0800 /* select-short-address bit */ | ||
392 | |||
393 | #define FM_MMODE 0x7000 /* mode select */ | ||
394 | #define FM_MINIT (0<<12) /* initialize */ | ||
395 | #define FM_MMEMACT (1<<12) /* memory activate */ | ||
396 | #define FM_MONLINESP (2<<12) /* on-line special */ | ||
397 | #define FM_MONLINE (3<<12) /* on-line (FDDI operational mode) */ | ||
398 | #define FM_MILOOP (4<<12) /* internal loopback */ | ||
399 | #define FM_MRES1 (5<<12) /* reserved */ | ||
400 | #define FM_MRES2 (6<<12) /* reserved */ | ||
401 | #define FM_MELOOP (7<<12) /* external loopback */ | ||
402 | |||
403 | #define FM_SNGLFRM 0x8000 /* single-frame-receive mode */ | ||
404 | /* SN3: reserved */ | ||
405 | |||
406 | #define MDR1INIT (FM_MINIT | FM_MDAMA) | ||
407 | |||
408 | /* | ||
409 | * Mode Register 2 (MDREG2) | ||
410 | */ | ||
411 | #define FM_AFULL 0x000f /* 4-bit value (empty loc.in txqueue)*/ | ||
412 | #define FM_RCVERR 0x0010 /* rec.-errored-frames bit */ | ||
413 | #define FM_SYMCTL 0x0020 /* sysmbol-control bit */ | ||
414 | /* SN3: reserved */ | ||
415 | #define FM_SYNPRQ 0x0040 /* synchron.-NP-DMA-request bit */ | ||
416 | #define FM_ENNPRQ 0x0080 /* enable-NP-DMA-request bit */ | ||
417 | #define FM_ENHSRQ 0x0100 /* enable-host-request bit */ | ||
418 | #define FM_RXFBB01 0x0600 /* rec. frame byte boundary bit0 & 1 */ | ||
419 | #define FM_LSB 0x0800 /* determ. ordering of bytes in buffer*/ | ||
420 | #define FM_PARITY 0x1000 /* 1 = even, 0 = odd */ | ||
421 | #define FM_CHKPAR 0x2000 /* 1 = parity of 32-bit buffer BD-bus*/ | ||
422 | #define FM_STRPFCS 0x4000 /* 1 = strips FCS field of rec.frame */ | ||
423 | #define FM_BMMODE 0x8000 /* Buffer-Memory-Mode (1 = tag mode) */ | ||
424 | /* SN3: 1 = tag, 0 = modified tag */ | ||
425 | |||
426 | /* | ||
427 | * Status Register 1, Upper 16 Bits (ST1U) | ||
428 | */ | ||
429 | #define FM_STEFRMS 0x0001 /* transmit end of frame: synchr. qu.*/ | ||
430 | #define FM_STEFRMA0 0x0002 /* transmit end of frame: asyn. qu.0 */ | ||
431 | #define FM_STEFRMA1 0x0004 /* transmit end of frame: asyn. qu.1 */ | ||
432 | #define FM_STEFRMA2 0x0008 /* transmit end of frame: asyn. qu.2 */ | ||
433 | /* SN3: reserved */ | ||
434 | #define FM_STECFRMS 0x0010 /* transmit end of chain of syn. qu. */ | ||
435 | /* SN3: reserved */ | ||
436 | #define FM_STECFRMA0 0x0020 /* transmit end of chain of asyn. q0 */ | ||
437 | /* SN3: reserved */ | ||
438 | #define FM_STECFRMA1 0x0040 /* transmit end of chain of asyn. q1 */ | ||
439 | /* SN3: STECMDA1 */ | ||
440 | #define FM_STECMDA1 0x0040 /* SN3: 'no description' */ | ||
441 | #define FM_STECFRMA2 0x0080 /* transmit end of chain of asyn. q2 */ | ||
442 | /* SN3: reserved */ | ||
443 | #define FM_STEXDONS 0x0100 /* transmit until XDONE in syn. qu. */ | ||
444 | #define FM_STBFLA 0x0200 /* asynchr.-queue trans. buffer full */ | ||
445 | #define FM_STBFLS 0x0400 /* synchr.-queue transm. buffer full */ | ||
446 | #define FM_STXABRS 0x0800 /* synchr. queue transmit-abort */ | ||
447 | #define FM_STXABRA0 0x1000 /* asynchr. queue 0 transmit-abort */ | ||
448 | #define FM_STXABRA1 0x2000 /* asynchr. queue 1 transmit-abort */ | ||
449 | #define FM_STXABRA2 0x4000 /* asynchr. queue 2 transmit-abort */ | ||
450 | /* SN3: reserved */ | ||
451 | #define FM_SXMTABT 0x8000 /* transmit abort */ | ||
452 | |||
453 | /* | ||
454 | * Status Register 1, Lower 16 Bits (ST1L) | ||
455 | */ | ||
456 | #define FM_SQLCKS 0x0001 /* queue lock for synchr. queue */ | ||
457 | #define FM_SQLCKA0 0x0002 /* queue lock for asynchr. queue 0 */ | ||
458 | #define FM_SQLCKA1 0x0004 /* queue lock for asynchr. queue 1 */ | ||
459 | #define FM_SQLCKA2 0x0008 /* queue lock for asynchr. queue 2 */ | ||
460 | /* SN3: reserved */ | ||
461 | #define FM_STXINFLS 0x0010 /* transmit instruction full: syn. */ | ||
462 | /* SN3: reserved */ | ||
463 | #define FM_STXINFLA0 0x0020 /* transmit instruction full: asyn.0 */ | ||
464 | /* SN3: reserved */ | ||
465 | #define FM_STXINFLA1 0x0040 /* transmit instruction full: asyn.1 */ | ||
466 | /* SN3: reserved */ | ||
467 | #define FM_STXINFLA2 0x0080 /* transmit instruction full: asyn.2 */ | ||
468 | /* SN3: reserved */ | ||
469 | #define FM_SPCEPDS 0x0100 /* parity/coding error: syn. queue */ | ||
470 | #define FM_SPCEPDA0 0x0200 /* parity/coding error: asyn. queue0 */ | ||
471 | #define FM_SPCEPDA1 0x0400 /* parity/coding error: asyn. queue1 */ | ||
472 | #define FM_SPCEPDA2 0x0800 /* parity/coding error: asyn. queue2 */ | ||
473 | /* SN3: reserved */ | ||
474 | #define FM_STBURS 0x1000 /* transmit buffer underrun: syn. q. */ | ||
475 | #define FM_STBURA0 0x2000 /* transmit buffer underrun: asyn.0 */ | ||
476 | #define FM_STBURA1 0x4000 /* transmit buffer underrun: asyn.1 */ | ||
477 | #define FM_STBURA2 0x8000 /* transmit buffer underrun: asyn.2 */ | ||
478 | /* SN3: reserved */ | ||
479 | |||
480 | /* | ||
481 | * Status Register 2, Upper 16 Bits (ST2U) | ||
482 | */ | ||
483 | #define FM_SOTRBEC 0x0001 /* other beacon received */ | ||
484 | #define FM_SMYBEC 0x0002 /* my beacon received */ | ||
485 | #define FM_SBEC 0x0004 /* beacon state entered */ | ||
486 | #define FM_SLOCLM 0x0008 /* low claim received */ | ||
487 | #define FM_SHICLM 0x0010 /* high claim received */ | ||
488 | #define FM_SMYCLM 0x0020 /* my claim received */ | ||
489 | #define FM_SCLM 0x0040 /* claim state entered */ | ||
490 | #define FM_SERRSF 0x0080 /* error in special frame */ | ||
491 | #define FM_SNFSLD 0x0100 /* NP and FORMAC+ simultaneous load */ | ||
492 | #define FM_SRFRCTOV 0x0200 /* receive frame counter overflow */ | ||
493 | /* SN3: reserved */ | ||
494 | #define FM_SRCVFRM 0x0400 /* receive frame */ | ||
495 | /* SN3: reserved */ | ||
496 | #define FM_SRCVOVR 0x0800 /* receive FIFO overflow */ | ||
497 | #define FM_SRBFL 0x1000 /* receive buffer full */ | ||
498 | #define FM_SRABT 0x2000 /* receive abort */ | ||
499 | #define FM_SRBMT 0x4000 /* receive buffer empty */ | ||
500 | #define FM_SRCOMP 0x8000 /* receive complete. Nontag mode */ | ||
501 | |||
502 | /* | ||
503 | * Status Register 2, Lower 16 Bits (ST2L) | ||
504 | * Attention: SN3 docu shows these bits the other way around | ||
505 | */ | ||
506 | #define FM_SRES0 0x0001 /* reserved */ | ||
507 | #define FM_SESTRIPTK 0x0001 /* SN3: 'no description' */ | ||
508 | #define FM_STRTEXR 0x0002 /* TRT expired in claim | beacon st. */ | ||
509 | #define FM_SDUPCLM 0x0004 /* duplicate claim received */ | ||
510 | #define FM_SSIFG 0x0008 /* short interframe gap */ | ||
511 | #define FM_SFRMCTR 0x0010 /* frame counter overflow */ | ||
512 | #define FM_SERRCTR 0x0020 /* error counter overflow */ | ||
513 | #define FM_SLSTCTR 0x0040 /* lost counter overflow */ | ||
514 | #define FM_SPHINV 0x0080 /* PHY invalid */ | ||
515 | #define FM_SADET 0x0100 /* address detect */ | ||
516 | #define FM_SMISFRM 0x0200 /* missed frame */ | ||
517 | #define FM_STRTEXP 0x0400 /* TRT expired and late count > 0 */ | ||
518 | #define FM_STVXEXP 0x0800 /* TVX expired */ | ||
519 | #define FM_STKISS 0x1000 /* token issued */ | ||
520 | #define FM_STKERR 0x2000 /* token error */ | ||
521 | #define FM_SMULTDA 0x4000 /* multiple destination address */ | ||
522 | #define FM_SRNGOP 0x8000 /* ring operational */ | ||
523 | |||
524 | /* | ||
525 | * Supernet 3: | ||
526 | * Status Register 3, Upper 16 Bits (ST3U) | ||
527 | */ | ||
528 | #define FM_SRQUNLCK1 0x0001 /* receive queue unlocked queue 1 */ | ||
529 | #define FM_SRQUNLCK2 0x0002 /* receive queue unlocked queue 2 */ | ||
530 | #define FM_SRPERRQ1 0x0004 /* receive parity error rx queue 1 */ | ||
531 | #define FM_SRPERRQ2 0x0008 /* receive parity error rx queue 2 */ | ||
532 | /* Bit 4-10: reserved */ | ||
533 | #define FM_SRCVOVR2 0x0800 /* receive FIFO overfull rx queue 2 */ | ||
534 | #define FM_SRBFL2 0x1000 /* receive buffer full rx queue 2 */ | ||
535 | #define FM_SRABT2 0x2000 /* receive abort rx queue 2 */ | ||
536 | #define FM_SRBMT2 0x4000 /* receive buf empty rx queue 2 */ | ||
537 | #define FM_SRCOMP2 0x8000 /* receive comp rx queue 2 */ | ||
538 | |||
539 | /* | ||
540 | * Supernet 3: | ||
541 | * Status Register 3, Lower 16 Bits (ST3L) | ||
542 | */ | ||
543 | #define FM_AF_BIST_DONE 0x0001 /* Address Filter BIST is done */ | ||
544 | #define FM_PLC_BIST_DONE 0x0002 /* internal PLC Bist is done */ | ||
545 | #define FM_PDX_BIST_DONE 0x0004 /* PDX BIST is done */ | ||
546 | /* Bit 3: reserved */ | ||
547 | #define FM_SICAMDAMAT 0x0010 /* Status internal CAM DA match */ | ||
548 | #define FM_SICAMDAXACT 0x0020 /* Status internal CAM DA exact match */ | ||
549 | #define FM_SICAMSAMAT 0x0040 /* Status internal CAM SA match */ | ||
550 | #define FM_SICAMSAXACT 0x0080 /* Status internal CAM SA exact match */ | ||
551 | |||
552 | /* | ||
553 | * MAC State-Machine Register FM_STMCHN | ||
554 | */ | ||
555 | #define FM_MDRTAG 0x0004 /* tag bit of long word read */ | ||
556 | #define FM_SNPPND 0x0008 /* r/w from buffer mem. is pending */ | ||
557 | #define FM_TXSTAT 0x0070 /* transmitter state machine state */ | ||
558 | #define FM_RCSTAT 0x0380 /* receiver state machine state */ | ||
559 | #define FM_TM01 0x0c00 /* indicate token mode */ | ||
560 | #define FM_SIM 0x1000 /* indicate send immediate-mode */ | ||
561 | #define FM_REV 0xe000 /* FORMAC Plus revision number */ | ||
562 | |||
563 | /* | ||
564 | * Supernet 3 | ||
565 | * Mode Register 3 | ||
566 | */ | ||
567 | #define FM_MENRS 0x0001 /* Ena enhanced rec status encoding */ | ||
568 | #define FM_MENXS 0x0002 /* Ena enhanced xmit status encoding */ | ||
569 | #define FM_MENXCT 0x0004 /* Ena EXACT/INEXACT matching */ | ||
570 | #define FM_MENAFULL 0x0008 /* Ena enh QCTRL encoding for AFULL */ | ||
571 | #define FM_MEIND 0x0030 /* Ena enh A,C indicator settings */ | ||
572 | #define FM_MENQCTRL 0x0040 /* Ena enh QCTRL encoding */ | ||
573 | #define FM_MENRQAUNLCK 0x0080 /* Ena rec q auto unlock */ | ||
574 | #define FM_MENDAS 0x0100 /* Ena DAS connections by cntr MUX */ | ||
575 | #define FM_MENPLCCST 0x0200 /* Ena Counter Segm test in PLC blck */ | ||
576 | #define FM_MENSGLINT 0x0400 /* Ena Vectored Interrupt reading */ | ||
577 | #define FM_MENDRCV 0x0800 /* Ena dual receive queue operation */ | ||
578 | #define FM_MENFCLOC 0x3000 /* Ena FC location within frm data */ | ||
579 | #define FM_MENTRCMD 0x4000 /* Ena ASYNC1 xmit only after command */ | ||
580 | #define FM_MENTDLPBK 0x8000 /* Ena TDAT to RDAT lkoopback */ | ||
581 | |||
582 | /* | ||
583 | * Supernet 3 | ||
584 | * Frame Selection Register | ||
585 | */ | ||
586 | #define FM_RECV1 0x000f /* options for receive queue 1 */ | ||
587 | #define FM_RCV1_ALL (0<<0) /* receive all frames */ | ||
588 | #define FM_RCV1_LLC (1<<0) /* rec all LLC frames */ | ||
589 | #define FM_RCV1_SMT (2<<0) /* rec all SMT frames */ | ||
590 | #define FM_RCV1_NSMT (3<<0) /* rec non-SMT frames */ | ||
591 | #define FM_RCV1_IMP (4<<0) /* rec Implementor frames */ | ||
592 | #define FM_RCV1_MAC (5<<0) /* rec all MAC frames */ | ||
593 | #define FM_RCV1_SLLC (6<<0) /* rec all sync LLC frames */ | ||
594 | #define FM_RCV1_ALLC (7<<0) /* rec all async LLC frames */ | ||
595 | #define FM_RCV1_VOID (8<<0) /* rec all void frames */ | ||
596 | #define FM_RCV1_ALSMT (9<<0) /* rec all async LLC & SMT frames */ | ||
597 | #define FM_RECV2 0x00f0 /* options for receive queue 2 */ | ||
598 | #define FM_RCV2_ALL (0<<4) /* receive all other frames */ | ||
599 | #define FM_RCV2_LLC (1<<4) /* rec all LLC frames */ | ||
600 | #define FM_RCV2_SMT (2<<4) /* rec all SMT frames */ | ||
601 | #define FM_RCV2_NSMT (3<<4) /* rec non-SMT frames */ | ||
602 | #define FM_RCV2_IMP (4<<4) /* rec Implementor frames */ | ||
603 | #define FM_RCV2_MAC (5<<4) /* rec all MAC frames */ | ||
604 | #define FM_RCV2_SLLC (6<<4) /* rec all sync LLC frames */ | ||
605 | #define FM_RCV2_ALLC (7<<4) /* rec all async LLC frames */ | ||
606 | #define FM_RCV2_VOID (8<<4) /* rec all void frames */ | ||
607 | #define FM_RCV2_ALSMT (9<<4) /* rec all async LLC & SMT frames */ | ||
608 | #define FM_ENXMTADSWAP 0x4000 /* enh rec addr swap (phys -> can) */ | ||
609 | #define FM_ENRCVADSWAP 0x8000 /* enh tx addr swap (can -> phys) */ | ||
610 | |||
611 | /* | ||
612 | * Supernet 3: | ||
613 | * Address Filter Command Register (AFCMD) | ||
614 | */ | ||
615 | #define FM_INST 0x0007 /* Address Filter Operation */ | ||
616 | #define FM_IINV_CAM (0<<0) /* Invalidate CAM */ | ||
617 | #define FM_IWRITE_CAM (1<<0) /* Write CAM */ | ||
618 | #define FM_IREAD_CAM (2<<0) /* Read CAM */ | ||
619 | #define FM_IRUN_BIST (3<<0) /* Run BIST */ | ||
620 | #define FM_IFIND (4<<0) /* Find */ | ||
621 | #define FM_IINV (5<<0) /* Invalidate */ | ||
622 | #define FM_ISKIP (6<<0) /* Skip */ | ||
623 | #define FM_ICL_SKIP (7<<0) /* Clear all SKIP bits */ | ||
624 | |||
625 | /* | ||
626 | * Supernet 3: | ||
627 | * Address Filter Status Register (AFSTAT) | ||
628 | */ | ||
629 | /* Bit 0-4: reserved */ | ||
630 | #define FM_REV_NO 0x00e0 /* Revision Number of Address Filter */ | ||
631 | #define FM_BIST_DONE 0x0100 /* BIST complete */ | ||
632 | #define FM_EMPTY 0x0200 /* CAM empty */ | ||
633 | #define FM_ERROR 0x0400 /* Error (improper operation) */ | ||
634 | #define FM_MULT 0x0800 /* Multiple Match */ | ||
635 | #define FM_EXACT 0x1000 /* Exact Match */ | ||
636 | #define FM_FOUND 0x2000 /* Comparand found in CAM */ | ||
637 | #define FM_FULL 0x4000 /* CAM full */ | ||
638 | #define FM_DONE 0x8000 /* DONE indicator */ | ||
639 | |||
640 | /* | ||
641 | * Supernet 3: | ||
642 | * BIST Signature Register (AFBIST) | ||
643 | */ | ||
644 | #define AF_BIST_SIGNAT 0x0553 /* Address Filter BIST Signature */ | ||
645 | |||
646 | /* | ||
647 | * Supernet 3: | ||
648 | * Personality Register (AFPERS) | ||
649 | */ | ||
650 | #define FM_VALID 0x0001 /* CAM Entry Valid */ | ||
651 | #define FM_DA 0x0002 /* Destination Address */ | ||
652 | #define FM_DAX 0x0004 /* Destination Address Exact */ | ||
653 | #define FM_SA 0x0008 /* Source Address */ | ||
654 | #define FM_SAX 0x0010 /* Source Address Exact */ | ||
655 | #define FM_SKIP 0x0020 /* Skip this entry */ | ||
656 | |||
657 | /* | ||
658 | * instruction set for command register 1 (NPADDR6-0 = 0x00) | ||
659 | */ | ||
660 | #define FM_IRESET 0x01 /* software reset */ | ||
661 | #define FM_IRMEMWI 0x02 /* load Memory Data Reg., inc MARR */ | ||
662 | #define FM_IRMEMWO 0x03 /* load MDR from buffer memory, n.i. */ | ||
663 | #define FM_IIL 0x04 /* idle/listen */ | ||
664 | #define FM_ICL 0x05 /* claim/listen */ | ||
665 | #define FM_IBL 0x06 /* beacon/listen */ | ||
666 | #define FM_ILTVX 0x07 /* load TVX timer from TVX reg */ | ||
667 | #define FM_INRTM 0x08 /* nonrestricted token mode */ | ||
668 | #define FM_IENTM 0x09 /* enter nonrestricted token mode */ | ||
669 | #define FM_IERTM 0x0a /* enter restricted token mode */ | ||
670 | #define FM_IRTM 0x0b /* restricted token mode */ | ||
671 | #define FM_ISURT 0x0c /* send unrestricted token */ | ||
672 | #define FM_ISRT 0x0d /* send restricted token */ | ||
673 | #define FM_ISIM 0x0e /* enter send-immediate mode */ | ||
674 | #define FM_IESIM 0x0f /* exit send-immediate mode */ | ||
675 | #define FM_ICLLS 0x11 /* clear synchronous queue lock */ | ||
676 | #define FM_ICLLA0 0x12 /* clear asynchronous queue 0 lock */ | ||
677 | #define FM_ICLLA1 0x14 /* clear asynchronous queue 1 lock */ | ||
678 | #define FM_ICLLA2 0x18 /* clear asynchronous queue 2 lock */ | ||
679 | /* SN3: reserved */ | ||
680 | #define FM_ICLLR 0x20 /* clear receive queue (SN3:1) lock */ | ||
681 | #define FM_ICLLR2 0x21 /* SN3: clear receive queue 2 lock */ | ||
682 | #define FM_ITRXBUS 0x22 /* SN3: Tristate X-Bus (SAS only) */ | ||
683 | #define FM_IDRXBUS 0x23 /* SN3: drive X-Bus */ | ||
684 | #define FM_ICLLAL 0x3f /* clear all queue locks */ | ||
685 | |||
686 | /* | ||
687 | * instruction set for command register 2 (NPADDR6-0 = 0x01) | ||
688 | */ | ||
689 | #define FM_ITRS 0x01 /* transmit synchronous queue */ | ||
690 | /* SN3: reserved */ | ||
691 | #define FM_ITRA0 0x02 /* transmit asynchronous queue 0 */ | ||
692 | /* SN3: reserved */ | ||
693 | #define FM_ITRA1 0x04 /* transmit asynchronous queue 1 */ | ||
694 | /* SN3: reserved */ | ||
695 | #define FM_ITRA2 0x08 /* transmit asynchronous queue 2 */ | ||
696 | /* SN3: reserved */ | ||
697 | #define FM_IACTR 0x10 /* abort current transmit activity */ | ||
698 | #define FM_IRSTQ 0x20 /* reset transmit queues */ | ||
699 | #define FM_ISTTB 0x30 /* set tag bit */ | ||
700 | #define FM_IERSF 0x40 /* enable receive single frame */ | ||
701 | /* SN3: reserved */ | ||
702 | #define FM_ITR 0x50 /* SN3: Transmit Command */ | ||
703 | |||
704 | |||
705 | /* | ||
706 | * defines for PLC (Am79C864) | ||
707 | */ | ||
708 | |||
709 | /* | ||
710 | * PLC read/write (r/w) registers | ||
711 | */ | ||
712 | #define PL_CNTRL_A 0x00 /* control register A (r/w) */ | ||
713 | #define PL_CNTRL_B 0x01 /* control register B (r/w) */ | ||
714 | #define PL_INTR_MASK 0x02 /* interrupt mask (r/w) */ | ||
715 | #define PL_XMIT_VECTOR 0x03 /* transmit vector register (r/w) */ | ||
716 | #define PL_VECTOR_LEN 0x04 /* transmit vector length (r/w) */ | ||
717 | #define PL_LE_THRESHOLD 0x05 /* link error event threshold (r/w) */ | ||
718 | #define PL_C_MIN 0x06 /* minimum connect state time (r/w) */ | ||
719 | #define PL_TL_MIN 0x07 /* min. line state transmit t. (r/w) */ | ||
720 | #define PL_TB_MIN 0x08 /* minimum break time (r/w) */ | ||
721 | #define PL_T_OUT 0x09 /* signal timeout (r/w) */ | ||
722 | #define PL_CNTRL_C 0x0a /* control register C (r/w) */ | ||
723 | #define PL_LC_LENGTH 0x0b /* link confidence test time (r/w) */ | ||
724 | #define PL_T_SCRUB 0x0c /* scrub time = MAC TVX (r/w) */ | ||
725 | #define PL_NS_MAX 0x0d /* max. noise time before break (r/w)*/ | ||
726 | #define PL_TPC_LOAD_V 0x0e /* TPC timer load value (write only) */ | ||
727 | #define PL_TNE_LOAD_V 0x0f /* TNE timer load value (write only) */ | ||
728 | #define PL_STATUS_A 0x10 /* status register A (read only) */ | ||
729 | #define PL_STATUS_B 0x11 /* status register B (read only) */ | ||
730 | #define PL_TPC 0x12 /* timer for PCM (ro) [20.48 us] */ | ||
731 | #define PL_TNE 0x13 /* time of noise event [0.32 us] */ | ||
732 | #define PL_CLK_DIV 0x14 /* TNE clock divider (read only) */ | ||
733 | #define PL_BIST_SIGNAT 0x15 /* built in self test signature (ro)*/ | ||
734 | #define PL_RCV_VECTOR 0x16 /* receive vector reg. (read only) */ | ||
735 | #define PL_INTR_EVENT 0x17 /* interrupt event reg. (read only) */ | ||
736 | #define PL_VIOL_SYM_CTR 0x18 /* violation symbol count. (read o) */ | ||
737 | #define PL_MIN_IDLE_CTR 0x19 /* minimum idle counter (read only) */ | ||
738 | #define PL_LINK_ERR_CTR 0x1a /* link error event ctr.(read only) */ | ||
739 | #ifdef MOT_ELM | ||
740 | #define PL_T_FOT_ASS 0x1e /* FOTOFF Assert Timer */ | ||
741 | #define PL_T_FOT_DEASS 0x1f /* FOTOFF Deassert Timer */ | ||
742 | #endif /* MOT_ELM */ | ||
743 | |||
744 | #ifdef MOT_ELM | ||
745 | /* | ||
746 | * Special Quad-Elm Registers. | ||
747 | * A Quad-ELM consists of for ELMs and these additional registers. | ||
748 | */ | ||
749 | #define QELM_XBAR_W 0x80 /* Crossbar Control ELM W */ | ||
750 | #define QELM_XBAR_X 0x81 /* Crossbar Control ELM X */ | ||
751 | #define QELM_XBAR_Y 0x82 /* Crossbar Control ELM Y */ | ||
752 | #define QELM_XBAR_Z 0x83 /* Crossbar Control ELM Z */ | ||
753 | #define QELM_XBAR_P 0x84 /* Crossbar Control Bus P */ | ||
754 | #define QELM_XBAR_S 0x85 /* Crossbar Control Bus S */ | ||
755 | #define QELM_XBAR_R 0x86 /* Crossbar Control Bus R */ | ||
756 | #define QELM_WR_XBAR 0x87 /* Write the Crossbar now (write) */ | ||
757 | #define QELM_CTR_W 0x88 /* Counter W */ | ||
758 | #define QELM_CTR_X 0x89 /* Counter X */ | ||
759 | #define QELM_CTR_Y 0x8a /* Counter Y */ | ||
760 | #define QELM_CTR_Z 0x8b /* Counter Z */ | ||
761 | #define QELM_INT_MASK 0x8c /* Interrupt mask register */ | ||
762 | #define QELM_INT_DATA 0x8d /* Interrupt data (event) register */ | ||
763 | #define QELM_ELMB 0x00 /* Elm base */ | ||
764 | #define QELM_ELM_SIZE 0x20 /* ELM size */ | ||
765 | #endif /* MOT_ELM */ | ||
766 | /* | ||
767 | * PLC control register A (PL_CNTRL_A: log. addr. 0x00) | ||
768 | * It is used for timer configuration, specification of PCM MAINT state option, | ||
769 | * counter interrupt frequency, PLC data path config. and Built In Self Test. | ||
770 | */ | ||
771 | #define PL_RUN_BIST 0x0001 /* begin running its Built In Self T.*/ | ||
772 | #define PL_RF_DISABLE 0x0002 /* disable the Repeat Filter state m.*/ | ||
773 | #define PL_SC_REM_LOOP 0x0004 /* remote loopback path */ | ||
774 | #define PL_SC_BYPASS 0x0008 /* by providing a physical bypass */ | ||
775 | #define PL_LM_LOC_LOOP 0x0010 /* loop path just after elastic buff.*/ | ||
776 | #define PL_EB_LOC_LOOP 0x0020 /* loop path just prior to PDT/PDR IF*/ | ||
777 | #define PL_FOT_OFF 0x0040 /* assertion of /FOTOFF pin of PLC */ | ||
778 | #define PL_LOOPBACK 0x0080 /* it cause the /LPBCK pin ass. low */ | ||
779 | #define PL_MINI_CTR_INT 0x0100 /* partially contr. when bit is ass. */ | ||
780 | #define PL_VSYM_CTR_INT 0x0200 /* controls when int bit is asserted */ | ||
781 | #define PL_ENA_PAR_CHK 0x0400 /* enable parity check */ | ||
782 | #define PL_REQ_SCRUB 0x0800 /* limited access to scrub capability*/ | ||
783 | #define PL_TPC_16BIT 0x1000 /* causes the TPC as a 16 bit timer */ | ||
784 | #define PL_TNE_16BIT 0x2000 /* causes the TNE as a 16 bit timer */ | ||
785 | #define PL_NOISE_TIMER 0x4000 /* allows the noise timing function */ | ||
786 | |||
787 | /* | ||
788 | * PLC control register B (PL_CNTRL_B: log. addr. 0x01) | ||
789 | * It contains signals and requeste to direct the process of PCM and it is also | ||
790 | * used to control the Line State Match interrupt. | ||
791 | */ | ||
792 | #define PL_PCM_CNTRL 0x0003 /* control PCM state machine */ | ||
793 | #define PL_PCM_NAF (0) /* state is not affected */ | ||
794 | #define PL_PCM_START (1) /* goes to the BREAK state */ | ||
795 | #define PL_PCM_TRACE (2) /* goes to the TRACE state */ | ||
796 | #define PL_PCM_STOP (3) /* goes to the OFF state */ | ||
797 | |||
798 | #define PL_MAINT 0x0004 /* if OFF state --> MAINT state */ | ||
799 | #define PL_LONG 0x0008 /* perf. a long Link Confid.Test(LCT)*/ | ||
800 | #define PL_PC_JOIN 0x0010 /* if NEXT state --> JOIN state */ | ||
801 | |||
802 | #define PL_PC_LOOP 0x0060 /* loopback used in the LCT */ | ||
803 | #define PL_NOLCT (0<<5) /* no LCT is performed */ | ||
804 | #define PL_TPDR (1<<5) /* PCM asserts transmit PDR */ | ||
805 | #define PL_TIDLE (2<<5) /* PCM asserts transmit idle */ | ||
806 | #define PL_RLBP (3<<5) /* trans. PDR & remote loopb. path */ | ||
807 | |||
808 | #define PL_CLASS_S 0x0080 /* signif. that single att. station */ | ||
809 | |||
810 | #define PL_MAINT_LS 0x0700 /* line state while in the MAINT st. */ | ||
811 | #define PL_M_QUI0 (0<<8) /* transmit QUIET line state */ | ||
812 | #define PL_M_IDLE (1<<8) /* transmit IDLE line state */ | ||
813 | #define PL_M_HALT (2<<8) /* transmit HALT line state */ | ||
814 | #define PL_M_MASTR (3<<8) /* transmit MASTER line state */ | ||
815 | #define PL_M_QUI1 (4<<8) /* transmit QUIET line state */ | ||
816 | #define PL_M_QUI2 (5<<8) /* transmit QUIET line state */ | ||
817 | #define PL_M_TPDR (6<<8) /* tr. PHY_DATA requ.-symbol is tr.ed*/ | ||
818 | #define PL_M_QUI3 (7<<8) /* transmit QUIET line state */ | ||
819 | |||
820 | #define PL_MATCH_LS 0x7800 /* line state to be comp. with curr.*/ | ||
821 | #define PL_I_ANY (0<<11) /* Int. on any change in *_LINE_ST */ | ||
822 | #define PL_I_IDLE (1<<11) /* Interrupt on IDLE line state */ | ||
823 | #define PL_I_HALT (2<<11) /* Interrupt on HALT line state */ | ||
824 | #define PL_I_MASTR (4<<11) /* Interrupt on MASTER line state */ | ||
825 | #define PL_I_QUIET (8<<11) /* Interrupt on QUIET line state */ | ||
826 | |||
827 | #define PL_CONFIG_CNTRL 0x8000 /* control over scrub, byp. & loopb.*/ | ||
828 | |||
829 | /* | ||
830 | * PLC control register C (PL_CNTRL_C: log. addr. 0x0a) | ||
831 | * It contains the scrambling control registers (PLC-S only) | ||
832 | */ | ||
833 | #define PL_C_CIPHER_ENABLE (1<<0) /* enable scrambler */ | ||
834 | #define PL_C_CIPHER_LPBCK (1<<1) /* loopback scrambler */ | ||
835 | #define PL_C_SDOFF_ENABLE (1<<6) /* enable SDOFF timer */ | ||
836 | #define PL_C_SDON_ENABLE (1<<7) /* enable SDON timer */ | ||
837 | #ifdef MOT_ELM | ||
838 | #define PL_C_FOTOFF_CTRL (3<<2) /* FOTOFF timer control */ | ||
839 | #define PL_C_FOTOFF_TIM (0<<2) /* FOTOFF use timer for (de)-assert */ | ||
840 | #define PL_C_FOTOFF_INA (2<<2) /* FOTOFF forced inactive */ | ||
841 | #define PL_C_FOTOFF_ACT (3<<2) /* FOTOFF forced active */ | ||
842 | #define PL_C_FOTOFF_SRCE (1<<4) /* FOTOFF source is PCM state != OFF */ | ||
843 | #define PL_C_RXDATA_EN (1<<5) /* Rec scr data forced to 0 */ | ||
844 | #define PL_C_SDNRZEN (1<<8) /* Monitor rec descr. data for act */ | ||
845 | #else /* nMOT_ELM */ | ||
846 | #define PL_C_FOTOFF_CTRL (3<<8) /* FOTOFF timer control */ | ||
847 | #define PL_C_FOTOFF_0 (0<<8) /* timer off */ | ||
848 | #define PL_C_FOTOFF_30 (1<<8) /* 30uS */ | ||
849 | #define PL_C_FOTOFF_50 (2<<8) /* 50uS */ | ||
850 | #define PL_C_FOTOFF_NEVER (3<<8) /* never */ | ||
851 | #define PL_C_SDON_TIMER (3<<10) /* SDON timer control */ | ||
852 | #define PL_C_SDON_084 (0<<10) /* 0.84 uS */ | ||
853 | #define PL_C_SDON_132 (1<<10) /* 1.32 uS */ | ||
854 | #define PL_C_SDON_252 (2<<10) /* 2.52 uS */ | ||
855 | #define PL_C_SDON_512 (3<<10) /* 5.12 uS */ | ||
856 | #define PL_C_SOFF_TIMER (3<<12) /* SDOFF timer control */ | ||
857 | #define PL_C_SOFF_076 (0<<12) /* 0.76 uS */ | ||
858 | #define PL_C_SOFF_132 (1<<12) /* 1.32 uS */ | ||
859 | #define PL_C_SOFF_252 (2<<12) /* 2.52 uS */ | ||
860 | #define PL_C_SOFF_512 (3<<12) /* 5.12 uS */ | ||
861 | #define PL_C_TSEL (3<<14) /* scrambler path select */ | ||
862 | #endif /* nMOT_ELM */ | ||
863 | |||
864 | /* | ||
865 | * PLC status register A (PL_STATUS_A: log. addr. 0x10) | ||
866 | * It is used to report status information to the Node Processor about the | ||
867 | * Line State Machine (LSM). | ||
868 | */ | ||
869 | #ifdef MOT_ELM | ||
870 | #define PLC_INT_MASK 0xc000 /* ELM integration bits in status A */ | ||
871 | #define PLC_INT_C 0x0000 /* ELM Revision Band C */ | ||
872 | #define PLC_INT_CAMEL 0x4000 /* ELM integrated into CAMEL */ | ||
873 | #define PLC_INT_QE 0x8000 /* ELM integrated into Quad ELM */ | ||
874 | #define PLC_REV_MASK 0x3800 /* revision bits in status A */ | ||
875 | #define PLC_REVISION_B 0x0000 /* rev bits for ELM Rev B */ | ||
876 | #define PLC_REVISION_QA 0x0800 /* rev bits for ELM core in QELM-A */ | ||
877 | #else /* nMOT_ELM */ | ||
878 | #define PLC_REV_MASK 0xf800 /* revision bits in status A */ | ||
879 | #define PLC_REVISION_A 0x0000 /* revision bits for PLC */ | ||
880 | #define PLC_REVISION_S 0xf800 /* revision bits for PLC-S */ | ||
881 | #define PLC_REV_SN3 0x7800 /* revision bits for PLC-S in IFCP */ | ||
882 | #endif /* nMOT_ELM */ | ||
883 | #define PL_SYM_PR_CTR 0x0007 /* contains the LSM symbol pair Ctr. */ | ||
884 | #define PL_UNKN_LINE_ST 0x0008 /* unknown line state bit from LSM */ | ||
885 | #define PL_LSM_STATE 0x0010 /* state bit of LSM */ | ||
886 | |||
887 | #define PL_LINE_ST 0x00e0 /* contains recogn. line state of LSM*/ | ||
888 | #define PL_L_NLS (0<<5) /* noise line state */ | ||
889 | #define PL_L_ALS (1<<5) /* activ line state */ | ||
890 | #define PL_L_UND (2<<5) /* undefined */ | ||
891 | #define PL_L_ILS4 (3<<5) /* idle l. s. (after 4 idle symbols) */ | ||
892 | #define PL_L_QLS (4<<5) /* quiet line state */ | ||
893 | #define PL_L_MLS (5<<5) /* master line state */ | ||
894 | #define PL_L_HLS (6<<5) /* halt line state */ | ||
895 | #define PL_L_ILS16 (7<<5) /* idle line state (after 16 idle s.)*/ | ||
896 | |||
897 | #define PL_PREV_LINE_ST 0x0300 /* value of previous line state */ | ||
898 | #define PL_P_QLS (0<<8) /* quiet line state */ | ||
899 | #define PL_P_MLS (1<<8) /* master line state */ | ||
900 | #define PL_P_HLS (2<<8) /* halt line state */ | ||
901 | #define PL_P_ILS16 (3<<8) /* idle line state (after 16 idle s.)*/ | ||
902 | |||
903 | #define PL_SIGNAL_DET 0x0400 /* 1=that signal detect is deasserted*/ | ||
904 | |||
905 | |||
906 | /* | ||
907 | * PLC status register B (PL_STATUS_B: log. addr. 0x11) | ||
908 | * It contains signals and status from the repeat filter and PCM state machine. | ||
909 | */ | ||
910 | #define PL_BREAK_REASON 0x0007 /* reason for PCM state mach.s to br.*/ | ||
911 | #define PL_B_NOT (0) /* PCM SM has not gone to BREAK state*/ | ||
912 | #define PL_B_PCS (1) /* PC_Start issued */ | ||
913 | #define PL_B_TPC (2) /* TPC timer expired after T_OUT */ | ||
914 | #define PL_B_TNE (3) /* TNE timer expired after NS_MAX */ | ||
915 | #define PL_B_QLS (4) /* quit line state detected */ | ||
916 | #define PL_B_ILS (5) /* idle line state detected */ | ||
917 | #define PL_B_HLS (6) /* halt line state detected */ | ||
918 | |||
919 | #define PL_TCF 0x0008 /* transmit code flag (start exec.) */ | ||
920 | #define PL_RCF 0x0010 /* receive code flag (start exec.) */ | ||
921 | #define PL_LSF 0x0020 /* line state flag (l.s. has been r.)*/ | ||
922 | #define PL_PCM_SIGNAL 0x0040 /* indic. that XMIT_VECTOR hb.written*/ | ||
923 | |||
924 | #define PL_PCM_STATE 0x0780 /* state bits of PCM state machine */ | ||
925 | #define PL_PC0 (0<<7) /* OFF - when /RST or PCM_CNTRL */ | ||
926 | #define PL_PC1 (1<<7) /* BREAK - entry point in start PCM*/ | ||
927 | #define PL_PC2 (2<<7) /* TRACE - to localize stuck Beacon*/ | ||
928 | #define PL_PC3 (3<<7) /* CONNECT - synchronize ends of conn*/ | ||
929 | #define PL_PC4 (4<<7) /* NEXT - to separate the signalng*/ | ||
930 | #define PL_PC5 (5<<7) /* SIGNAL - PCM trans/rec. bit infos*/ | ||
931 | #define PL_PC6 (6<<7) /* JOIN - 1. state to activ conn. */ | ||
932 | #define PL_PC7 (7<<7) /* VERIFY - 2. - " - (3. ACTIVE) */ | ||
933 | #define PL_PC8 (8<<7) /* ACTIVE - PHY has been incorporated*/ | ||
934 | #define PL_PC9 (9<<7) /* MAINT - for test purposes or so | ||
935 | that PCM op. completely in softw. */ | ||
936 | |||
937 | #define PL_PCI_SCRUB 0x0800 /* scrubbing function is being exec. */ | ||
938 | |||
939 | #define PL_PCI_STATE 0x3000 /* Physical Connect. Insertion SM */ | ||
940 | #define PL_CI_REMV (0<<12) /* REMOVED */ | ||
941 | #define PL_CI_ISCR (1<<12) /* INSERT_SCRUB */ | ||
942 | #define PL_CI_RSCR (2<<12) /* REMOVE_SCRUB */ | ||
943 | #define PL_CI_INS (3<<12) /* INSERTED */ | ||
944 | |||
945 | #define PL_RF_STATE 0xc000 /* state bit of repeate filter SM */ | ||
946 | #define PL_RF_REPT (0<<14) /* REPEAT */ | ||
947 | #define PL_RF_IDLE (1<<14) /* IDLE */ | ||
948 | #define PL_RF_HALT1 (2<<14) /* HALT1 */ | ||
949 | #define PL_RF_HALT2 (3<<14) /* HALT2 */ | ||
950 | |||
951 | |||
952 | /* | ||
953 | * PLC interrupt event register (PL_INTR_EVENT: log. addr. 0x17) | ||
954 | * It is read only and is clearde whenever it is read! | ||
955 | * It is used by the PLC to report events to the node processor. | ||
956 | */ | ||
957 | #define PL_PARITY_ERR 0x0001 /* p. error h.b.detected on TX9-0 inp*/ | ||
958 | #define PL_LS_MATCH 0x0002 /* l.s.== l.s. PLC_CNTRL_B's MATCH_LS*/ | ||
959 | #define PL_PCM_CODE 0x0004 /* transmit&receive | LCT complete */ | ||
960 | #define PL_TRACE_PROP 0x0008 /* master l.s. while PCM ACTIV|TRACE */ | ||
961 | #define PL_SELF_TEST 0x0010 /* QUIET|HALT while PCM in TRACE st. */ | ||
962 | #define PL_PCM_BREAK 0x0020 /* PCM has entered the BREAK state */ | ||
963 | #define PL_PCM_ENABLED 0x0040 /* asserted SC_JOIN, scrub. & ACTIV */ | ||
964 | #define PL_TPC_EXPIRED 0x0080 /* TPC timer reached zero */ | ||
965 | #define PL_TNE_EXPIRED 0x0100 /* TNE timer reached zero */ | ||
966 | #define PL_EBUF_ERR 0x0200 /* elastic buff. det. over-|underflow*/ | ||
967 | #define PL_PHYINV 0x0400 /* physical layer invalid signal */ | ||
968 | #define PL_VSYM_CTR 0x0800 /* violation symbol counter has incr.*/ | ||
969 | #define PL_MINI_CTR 0x1000 /* dep. on PLC_CNTRL_A's MINI_CTR_INT*/ | ||
970 | #define PL_LE_CTR 0x2000 /* link error event counter */ | ||
971 | #define PL_LSDO 0x4000 /* SDO input pin changed to a 1 */ | ||
972 | #define PL_NP_ERR 0x8000 /* NP has requested to r/w an inv. r.*/ | ||
973 | |||
974 | /* | ||
975 | * The PLC interrupt mask register (PL_INTR_MASK: log. addr. 0x02) constr. is | ||
976 | * equal PL_INTR_EVENT register. | ||
977 | * For each set bit, the setting of corresponding bit generate an int to NP. | ||
978 | */ | ||
979 | |||
980 | #ifdef MOT_ELM | ||
981 | /* | ||
982 | * Quad ELM Crosbar Control register values (QELM_XBAR_?) | ||
983 | */ | ||
984 | #define QELM_XOUT_IDLE 0x0000 /* Idles/Passthrough */ | ||
985 | #define QELM_XOUT_P 0x0001 /* Output to: Bus P */ | ||
986 | #define QELM_XOUT_S 0x0002 /* Output to: Bus S */ | ||
987 | #define QELM_XOUT_R 0x0003 /* Output to: Bus R */ | ||
988 | #define QELM_XOUT_W 0x0004 /* Output to: ELM W */ | ||
989 | #define QELM_XOUT_X 0x0005 /* Output to: ELM X */ | ||
990 | #define QELM_XOUT_Y 0x0006 /* Output to: ELM Y */ | ||
991 | #define QELM_XOUT_Z 0x0007 /* Output to: ELM Z */ | ||
992 | |||
993 | /* | ||
994 | * Quad ELM Interrupt data and event registers. | ||
995 | */ | ||
996 | #define QELM_NP_ERR (1<<15) /* Node Processor Error */ | ||
997 | #define QELM_COUNT_Z (1<<7) /* Counter Z Interrupt */ | ||
998 | #define QELM_COUNT_Y (1<<6) /* Counter Y Interrupt */ | ||
999 | #define QELM_COUNT_X (1<<5) /* Counter X Interrupt */ | ||
1000 | #define QELM_COUNT_W (1<<4) /* Counter W Interrupt */ | ||
1001 | #define QELM_ELM_Z (1<<3) /* ELM Z Interrupt */ | ||
1002 | #define QELM_ELM_Y (1<<2) /* ELM Y Interrupt */ | ||
1003 | #define QELM_ELM_X (1<<1) /* ELM X Interrupt */ | ||
1004 | #define QELM_ELM_W (1<<0) /* ELM W Interrupt */ | ||
1005 | #endif /* MOT_ELM */ | ||
1006 | /* | ||
1007 | * PLC Timing Parameters | ||
1008 | */ | ||
1009 | #define TP_C_MIN 0xff9c /* 2 ms */ | ||
1010 | #define TP_TL_MIN 0xfff0 /* 0.3 ms */ | ||
1011 | #define TP_TB_MIN 0xff10 /* 5 ms */ | ||
1012 | #define TP_T_OUT 0xd9db /* 200 ms */ | ||
1013 | #define TP_LC_LENGTH 0xf676 /* 50 ms */ | ||
1014 | #define TP_LC_LONGLN 0xa0a2 /* 500 ms */ | ||
1015 | #define TP_T_SCRUB 0xff6d /* 3.5 ms */ | ||
1016 | #define TP_NS_MAX 0xf021 /* 1.3 ms */ | ||
1017 | |||
1018 | /* | ||
1019 | * BIST values | ||
1020 | */ | ||
1021 | #define PLC_BIST 0x6ecd /* BIST signature for PLC */ | ||
1022 | #define PLCS_BIST 0x5b6b /* BIST signature for PLC-S */ | ||
1023 | #define PLC_ELM_B_BIST 0x6ecd /* BIST signature of ELM Rev. B */ | ||
1024 | #define PLC_ELM_D_BIST 0x5b6b /* BIST signature of ELM Rev. D */ | ||
1025 | #define PLC_CAM_A_BIST 0x9e75 /* BIST signature of CAMEL Rev. A */ | ||
1026 | #define PLC_CAM_B_BIST 0x5b6b /* BIST signature of CAMEL Rev. B */ | ||
1027 | #define PLC_IFD_A_BIST 0x9e75 /* BIST signature of IFDDI Rev. A */ | ||
1028 | #define PLC_IFD_B_BIST 0x5b6b /* BIST signature of IFDDI Rev. B */ | ||
1029 | #define PLC_QELM_A_BIST 0x5b6b /* BIST signature of QELM Rev. A */ | ||
1030 | |||
1031 | /* | ||
1032 | FDDI board recources | ||
1033 | */ | ||
1034 | |||
1035 | /* | ||
1036 | * request register array (log. addr: RQA_A + a<<1 {a=0..7}) write only. | ||
1037 | * It specifies to FORMAC+ the type of buffer memory access the host requires. | ||
1038 | */ | ||
1039 | #define RQ_NOT 0 /* not request */ | ||
1040 | #define RQ_RES 1 /* reserved */ | ||
1041 | #define RQ_SFW 2 /* special frame write */ | ||
1042 | #define RQ_RRQ 3 /* read request: receive queue */ | ||
1043 | #define RQ_WSQ 4 /* write request: synchronous queue */ | ||
1044 | #define RQ_WA0 5 /* write requ.: asynchronous queue 0 */ | ||
1045 | #define RQ_WA1 6 /* write requ.: asynchronous queue 1 */ | ||
1046 | #define RQ_WA2 7 /* write requ.: asynchronous queue 2 */ | ||
1047 | |||
1048 | #define SZ_LONG (sizeof(long)) | ||
1049 | |||
1050 | /* | ||
1051 | * FDDI defaults | ||
1052 | * NOTE : In the ANSI docs, times are specified in units of "symbol time". | ||
1053 | * AMD chips use BCLK as unit. 1 BCKL == 2 symbols | ||
1054 | */ | ||
1055 | #define COMPLREF ((u_long)32*256*256) /* two's complement 21 bit */ | ||
1056 | #define MSTOBCLK(x) ((u_long)(x)*12500L) | ||
1057 | #define MSTOTVX(x) (((u_long)(x)*1000L)/80/255) | ||
1058 | |||
1059 | #endif /* _SUPERNET_ */ | ||
diff --git a/drivers/net/skfp/h/targethw.h b/drivers/net/skfp/h/targethw.h new file mode 100644 index 000000000000..22c4923241d3 --- /dev/null +++ b/drivers/net/skfp/h/targethw.h | |||
@@ -0,0 +1,169 @@ | |||
1 | /****************************************************************************** | ||
2 | * | ||
3 | * (C)Copyright 1998,1999 SysKonnect, | ||
4 | * a business unit of Schneider & Koch & Co. Datensysteme GmbH. | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License as published by | ||
8 | * the Free Software Foundation; either version 2 of the License, or | ||
9 | * (at your option) any later version. | ||
10 | * | ||
11 | * The information in this file is provided "AS IS" without warranty. | ||
12 | * | ||
13 | ******************************************************************************/ | ||
14 | |||
15 | #ifndef _TARGETHW_ | ||
16 | #define _TARGETHW_ | ||
17 | |||
18 | /* | ||
19 | * PCI Watermark definition | ||
20 | */ | ||
21 | #ifdef PCI | ||
22 | #define RX_WATERMARK 24 | ||
23 | #define TX_WATERMARK 24 | ||
24 | #define SK_ML_ID_1 0x20 | ||
25 | #define SK_ML_ID_2 0x30 | ||
26 | #endif | ||
27 | |||
28 | #include "h/skfbi.h" | ||
29 | #ifndef TAG_MODE | ||
30 | #include "h/fplus.h" | ||
31 | #else | ||
32 | #include "h/fplustm.h" | ||
33 | #endif | ||
34 | |||
35 | #ifndef HW_PTR | ||
36 | #define HW_PTR void __iomem * | ||
37 | #endif | ||
38 | |||
39 | #ifdef MULT_OEM | ||
40 | #define OI_STAT_LAST 0 /* end of OEM data base */ | ||
41 | #define OI_STAT_PRESENT 1 /* entry present but not empty */ | ||
42 | #define OI_STAT_VALID 2 /* holds valid ID, but is not active */ | ||
43 | #define OI_STAT_ACTIVE 3 /* holds valid ID, entry is active */ | ||
44 | /* active = adapter is supported */ | ||
45 | |||
46 | /* Memory representation of IDs must match representation in adapter. */ | ||
47 | struct s_oem_ids { | ||
48 | u_char oi_status ; /* Stat: last, present, valid, active */ | ||
49 | u_char oi_mark[5] ; /* "PID00" .. "PID07" .. */ | ||
50 | u_char oi_id[4] ; /* id bytes, representation as */ | ||
51 | /* defined by hardware, */ | ||
52 | #ifdef PCI | ||
53 | u_char oi_sub_id[4] ; /* sub id bytes, representation as */ | ||
54 | /* defined by hardware, */ | ||
55 | #endif | ||
56 | #ifdef ISA | ||
57 | u_char oi_logo_len ; /* the length of the adapter logo */ | ||
58 | u_char oi_logo[6] ; /* the adapter logo */ | ||
59 | u_char oi_reserved1 ; | ||
60 | #endif /* ISA */ | ||
61 | } ; | ||
62 | #endif /* MULT_OEM */ | ||
63 | |||
64 | |||
65 | struct s_smt_hw { | ||
66 | /* | ||
67 | * global | ||
68 | */ | ||
69 | HW_PTR iop ; /* IO base address */ | ||
70 | short dma ; /* DMA channel */ | ||
71 | short irq ; /* IRQ level */ | ||
72 | short eprom ; /* FLASH prom */ | ||
73 | #ifndef PCI | ||
74 | short DmaWriteExtraBytes ; /* add bytes for DMA write */ | ||
75 | #endif | ||
76 | |||
77 | #ifndef SYNC | ||
78 | u_short n_a_send ; /* pending send requests */ | ||
79 | #endif | ||
80 | |||
81 | #if (defined(EISA) || defined(MCA) || defined(PCI)) | ||
82 | short slot ; /* slot number */ | ||
83 | short max_slots ; /* maximum number of slots */ | ||
84 | #endif | ||
85 | |||
86 | #if (defined(PCI) || defined(MCA)) | ||
87 | short wdog_used ; /* TRUE if the watch dog is used */ | ||
88 | #endif | ||
89 | |||
90 | #ifdef MCA | ||
91 | short slot_32 ; /* 32bit slot (1) or 16bit slot (0) */ | ||
92 | short rev ; /* Board revision (FMx_REV). */ | ||
93 | short VFullRead ; /* V_full value for DMA read */ | ||
94 | short VFullWrite ; /* V_full value for DMA write */ | ||
95 | #endif | ||
96 | |||
97 | #ifdef EISA | ||
98 | short led ; /* LED for FE card */ | ||
99 | |||
100 | short dma_rmode ; /* read mode */ | ||
101 | short dma_wmode ; /* write mode */ | ||
102 | short dma_emode ; /* extend mode */ | ||
103 | |||
104 | /* DMA controller channel dependent io addresses */ | ||
105 | u_short dma_base_word_count ; | ||
106 | u_short dma_base_address ; | ||
107 | u_short dma_base_address_page ; | ||
108 | #endif | ||
109 | |||
110 | #ifdef PCI | ||
111 | u_short pci_handle ; /* handle to access the BIOS func */ | ||
112 | u_long is_imask ; /* int maske for the int source reg */ | ||
113 | u_long phys_mem_addr ; /* physical memory address */ | ||
114 | u_short mc_dummy ; /* work around for MC compiler bug */ | ||
115 | /* | ||
116 | * state of the hardware | ||
117 | */ | ||
118 | u_short hw_state ; /* started or stopped */ | ||
119 | |||
120 | #define STARTED 1 | ||
121 | #define STOPPED 0 | ||
122 | |||
123 | int hw_is_64bit ; /* does we have a 64 bit adapter */ | ||
124 | #endif | ||
125 | |||
126 | #ifdef TAG_MODE | ||
127 | u_long pci_fix_value ; /* value parsed by PCIFIX */ | ||
128 | #endif | ||
129 | |||
130 | /* | ||
131 | * hwt.c | ||
132 | */ | ||
133 | u_long t_start ; /* HWT start */ | ||
134 | u_long t_stop ; /* HWT stop */ | ||
135 | u_short timer_activ ; /* HWT timer active */ | ||
136 | |||
137 | /* | ||
138 | * PIC | ||
139 | */ | ||
140 | u_char pic_a1 ; | ||
141 | u_char pic_21 ; | ||
142 | |||
143 | /* | ||
144 | * GENERIC ; do not modify beyond this line | ||
145 | */ | ||
146 | |||
147 | /* | ||
148 | * physical and canonical address | ||
149 | */ | ||
150 | struct fddi_addr fddi_home_addr ; | ||
151 | struct fddi_addr fddi_canon_addr ; | ||
152 | struct fddi_addr fddi_phys_addr ; | ||
153 | |||
154 | /* | ||
155 | * mac variables | ||
156 | */ | ||
157 | struct mac_parameter mac_pa ; /* tmin, tmax, tvx, treq .. */ | ||
158 | struct mac_counter mac_ct ; /* recv., lost, error */ | ||
159 | u_short mac_ring_is_up ; /* ring is up flag */ | ||
160 | |||
161 | struct s_smt_fp fp ; /* formac+ */ | ||
162 | |||
163 | #ifdef MULT_OEM | ||
164 | struct s_oem_ids *oem_id ; /* pointer to selected id */ | ||
165 | int oem_min_status ; /* IDs to take care of */ | ||
166 | #endif /* MULT_OEM */ | ||
167 | |||
168 | } ; | ||
169 | #endif | ||
diff --git a/drivers/net/skfp/h/targetos.h b/drivers/net/skfp/h/targetos.h new file mode 100644 index 000000000000..5d940e7b8ea0 --- /dev/null +++ b/drivers/net/skfp/h/targetos.h | |||
@@ -0,0 +1,165 @@ | |||
1 | /****************************************************************************** | ||
2 | * | ||
3 | * (C)Copyright 1998,1999 SysKonnect, | ||
4 | * a business unit of Schneider & Koch & Co. Datensysteme GmbH. | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License as published by | ||
8 | * the Free Software Foundation; either version 2 of the License, or | ||
9 | * (at your option) any later version. | ||
10 | * | ||
11 | * The information in this file is provided "AS IS" without warranty. | ||
12 | * | ||
13 | ******************************************************************************/ | ||
14 | |||
15 | /* | ||
16 | * Operating system specific definitions for driver and | ||
17 | * hardware module. | ||
18 | */ | ||
19 | |||
20 | #ifndef TARGETOS_H | ||
21 | #define TARGETOS_H | ||
22 | |||
23 | |||
24 | //-------- those should go into include/linux/pci.h | ||
25 | #define PCI_VENDOR_ID_SK 0x1148 | ||
26 | #define PCI_DEVICE_ID_SK_FP 0x4000 | ||
27 | //-------- | ||
28 | |||
29 | |||
30 | |||
31 | //-------- those should go into include/linux/if_fddi.h | ||
32 | #define FDDI_MAC_HDR_LEN 13 | ||
33 | |||
34 | #define FDDI_RII 0x01 /* routing information bit */ | ||
35 | #define FDDI_RCF_DIR_BIT 0x80 | ||
36 | #define FDDI_RCF_LEN_MASK 0x1f | ||
37 | #define FDDI_RCF_BROADCAST 0x8000 | ||
38 | #define FDDI_RCF_LIMITED_BROADCAST 0xA000 | ||
39 | #define FDDI_RCF_FRAME2K 0x20 | ||
40 | #define FDDI_RCF_FRAME4K 0x30 | ||
41 | //-------- | ||
42 | |||
43 | |||
44 | #undef ADDR | ||
45 | |||
46 | #include <asm/io.h> | ||
47 | #include <linux/netdevice.h> | ||
48 | #include <linux/fddidevice.h> | ||
49 | #include <linux/skbuff.h> | ||
50 | #include <linux/pci.h> | ||
51 | #include <linux/init.h> | ||
52 | |||
53 | // is redefined by linux, but we need our definition | ||
54 | #undef ADDR | ||
55 | #ifdef MEM_MAPPED_IO | ||
56 | #define ADDR(a) (smc->hw.iop+(a)) | ||
57 | #else | ||
58 | #define ADDR(a) (((a)>>7) ? (outp(smc->hw.iop+B0_RAP,(a)>>7), (smc->hw.iop+( ((a)&0x7F) | ((a)>>7 ? 0x80:0)) )) : (smc->hw.iop+(((a)&0x7F)|((a)>>7 ? 0x80:0)))) | ||
59 | #endif | ||
60 | |||
61 | #include "h/hwmtm.h" | ||
62 | |||
63 | #define TRUE 1 | ||
64 | #define FALSE 0 | ||
65 | |||
66 | // HWM Definitions | ||
67 | // ----------------------- | ||
68 | #define FDDI_TRACE(string, arg1, arg2, arg3) // Performance analysis. | ||
69 | #ifdef PCI | ||
70 | #define NDD_TRACE(string, arg1, arg2, arg3) // Performance analysis. | ||
71 | #endif // PCI | ||
72 | #define SMT_PAGESIZE PAGE_SIZE // Size of a memory page (power of 2). | ||
73 | // ----------------------- | ||
74 | |||
75 | |||
76 | // SMT Definitions | ||
77 | // ----------------------- | ||
78 | #define TICKS_PER_SECOND HZ | ||
79 | #define SMC_VERSION 1 | ||
80 | // ----------------------- | ||
81 | |||
82 | |||
83 | // OS-Driver Definitions | ||
84 | // ----------------------- | ||
85 | #define NO_ADDRESS 0xffe0 /* No Device (I/O) Address */ | ||
86 | #define SKFP_MAX_NUM_BOARDS 8 /* maximum number of PCI boards */ | ||
87 | |||
88 | #define SK_BUS_TYPE_PCI 0 | ||
89 | #define SK_BUS_TYPE_EISA 1 | ||
90 | |||
91 | #define FP_IO_LEN 256 /* length of IO area used */ | ||
92 | |||
93 | #define u8 unsigned char | ||
94 | #define u16 unsigned short | ||
95 | #define u32 unsigned int | ||
96 | |||
97 | #define MAX_TX_QUEUE_LEN 20 // number of packets queued by driver | ||
98 | #define MAX_FRAME_SIZE 4550 | ||
99 | |||
100 | #define RX_LOW_WATERMARK NUM_RECEIVE_BUFFERS / 2 | ||
101 | #define TX_LOW_WATERMARK NUM_TRANSMIT_BUFFERS - 2 | ||
102 | |||
103 | /* | ||
104 | ** Include the IOCTL stuff | ||
105 | */ | ||
106 | #include <linux/sockios.h> | ||
107 | |||
108 | #define SKFPIOCTL SIOCDEVPRIVATE | ||
109 | |||
110 | struct s_skfp_ioctl { | ||
111 | unsigned short cmd; /* Command to run */ | ||
112 | unsigned short len; /* Length of the data buffer */ | ||
113 | unsigned char __user *data; /* Pointer to the data buffer */ | ||
114 | }; | ||
115 | |||
116 | /* | ||
117 | ** Recognised ioctl commands for the driver | ||
118 | */ | ||
119 | #define SKFP_GET_STATS 0x05 /* Get the driver statistics */ | ||
120 | #define SKFP_CLR_STATS 0x06 /* Zero out the driver statistics */ | ||
121 | |||
122 | // The per-adapter driver structure | ||
123 | struct s_smt_os { | ||
124 | struct net_device *dev; | ||
125 | struct net_device *next_module; | ||
126 | u32 bus_type; /* bus type (0 == PCI, 1 == EISA) */ | ||
127 | struct pci_dev pdev; /* PCI device structure */ | ||
128 | |||
129 | unsigned long base_addr; | ||
130 | unsigned char factory_mac_addr[8]; | ||
131 | ulong SharedMemSize; | ||
132 | ulong SharedMemHeap; | ||
133 | void* SharedMemAddr; | ||
134 | dma_addr_t SharedMemDMA; | ||
135 | |||
136 | ulong QueueSkb; | ||
137 | struct sk_buff_head SendSkbQueue; | ||
138 | |||
139 | ulong MaxFrameSize; | ||
140 | u8 ResetRequested; | ||
141 | |||
142 | // MAC statistics structure | ||
143 | struct fddi_statistics MacStat; | ||
144 | |||
145 | // receive into this local buffer if no skb available | ||
146 | // data will be not valid, because multiple RxDs can | ||
147 | // point here at the same time, it must be at least | ||
148 | // MAX_FRAME_SIZE bytes in size | ||
149 | unsigned char *LocalRxBuffer; | ||
150 | dma_addr_t LocalRxBufferDMA; | ||
151 | |||
152 | // Version (required by SMT module). | ||
153 | u_long smc_version ; | ||
154 | |||
155 | // Required by Hardware Module (HWM). | ||
156 | struct hw_modul hwm ; | ||
157 | |||
158 | // For SMP-savety | ||
159 | spinlock_t DriverLock; | ||
160 | |||
161 | }; | ||
162 | |||
163 | typedef struct s_smt_os skfddi_priv; | ||
164 | |||
165 | #endif // _TARGETOS_ | ||
diff --git a/drivers/net/skfp/h/types.h b/drivers/net/skfp/h/types.h new file mode 100644 index 000000000000..5a3bf8378f9e --- /dev/null +++ b/drivers/net/skfp/h/types.h | |||
@@ -0,0 +1,39 @@ | |||
1 | /****************************************************************************** | ||
2 | * | ||
3 | * (C)Copyright 1998,1999 SysKonnect, | ||
4 | * a business unit of Schneider & Koch & Co. Datensysteme GmbH. | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License as published by | ||
8 | * the Free Software Foundation; either version 2 of the License, or | ||
9 | * (at your option) any later version. | ||
10 | * | ||
11 | * The information in this file is provided "AS IS" without warranty. | ||
12 | * | ||
13 | ******************************************************************************/ | ||
14 | |||
15 | #include <linux/types.h> | ||
16 | /* | ||
17 | ---------------------- | ||
18 | Basic SMT system types | ||
19 | ---------------------- | ||
20 | */ | ||
21 | #ifndef _TYPES_ | ||
22 | #define _TYPES_ | ||
23 | |||
24 | #define _packed | ||
25 | #ifndef far | ||
26 | #define far | ||
27 | #endif | ||
28 | #ifndef _far | ||
29 | #define _far | ||
30 | #endif | ||
31 | |||
32 | #define inp(p) ioread8(p) | ||
33 | #define inpw(p) ioread16(p) | ||
34 | #define inpd(p) ioread32(p) | ||
35 | #define outp(p,c) iowrite8(c,p) | ||
36 | #define outpw(p,s) iowrite16(s,p) | ||
37 | #define outpd(p,l) iowrite32(l,p) | ||
38 | |||
39 | #endif /* _TYPES_ */ | ||