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 then 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 /*
423  * link error monitor
424  */
425 #define LEM_AVG	5
426 struct lem_counter {
427 #ifdef	AM29K
428 	int	lem_on	;
429 	u_long	lem_errors ;
430 	u_long	lem_symbols ;
431 	u_long	lem_tsymbols ;
432 	int	lem_s_count ;
433 	int	lem_n_s ;
434 	int	lem_values ;
435 	int	lem_index ;
436 	int	lem_avg_ber[LEM_AVG] ;
437 	int	lem_sum ;
438 #else
439 	u_short	lem_float_ber ;		/* 10E-nn bit error rate */
440 	u_long	lem_errors ;		/* accumulated error count */
441 	u_short	lem_on	;
442 #endif
443 } ;
444 
445 #define NUMBITS	10
446 
447 
448 #ifdef	AMDPLC
449 
450 /*
451  * PLC state table
452  */
453 struct s_plc {
454 	u_short	p_state ;		/* current state */
455 	u_short	p_bits ;		/* number of bits to send */
456 	u_short	p_start ;		/* first bit pos */
457 	u_short	p_pad ;			/* padding for alignment */
458 	u_long soft_err ;		/* error counter */
459 	u_long parity_err ;		/* error counter */
460 	u_long ebuf_err ;		/* error counter */
461 	u_long ebuf_cont ;		/* continous error counter */
462 	u_long phyinv ;			/* error counter */
463 	u_long vsym_ctr ;		/* error counter */
464 	u_long mini_ctr ;		/* error counter */
465 	u_long tpc_exp ;		/* error counter */
466 	u_long np_err ;			/* error counter */
467 	u_long b_pcs ;			/* error counter */
468 	u_long b_tpc ;			/* error counter */
469 	u_long b_tne ;			/* error counter */
470 	u_long b_qls ;			/* error counter */
471 	u_long b_ils ;			/* error counter */
472 	u_long b_hls ;			/* error counter */
473 } ;
474 #endif
475 
476 #ifdef	PROTOTYP_INC
477 #include "fddi/driver.pro"
478 #else	/* PROTOTYP_INC */
479 /*
480  * function prototypes
481  */
482 #include "h/mbuf.h"	/* Type definitions for MBUFs */
483 void hwt_restart(                       /* hwt.c */
484 #ifdef ANSIC
485         struct s_smc *smc
486 #endif
487 	) ;
488 
489 SMbuf *smt_build_frame(                 /* smt.c */
490 #ifdef ANSIC
491         struct s_smc *smc,
492         int class,
493         int type,
494         int length
495 #endif
496 	) ;
497 
498 SMbuf *smt_get_mbuf(                     /* drvsr.c */
499 #ifdef ANSIC
500         struct s_smc *smc
501 #endif
502 	) ;
503 
504 void *sm_to_para(                       /* smt.c */
505 #ifdef ANSIC
506 	struct s_smc *smc,
507         struct smt_header *sm,
508         int para
509 #endif
510 	) ;
511 
512 #ifndef SK_UNUSED
513 #define SK_UNUSED(var)		(void)(var)
514 #endif
515 
516 void queue_event() ;
517 void ecm() ;
518 void ecm_init() ;
519 void rmt() ;
520 void rmt_init() ;
521 void pcm() ;
522 void pcm_init() ;
523 void cfm() ;
524 void cfm_init() ;
525 void smt_timer_start() ;
526 void smt_timer_stop() ;
527 void pcm_status_state() ;
528 void plc_config_mux() ;
529 void sm_lem_evaluate() ;
530 void smt_clear_una_dna() ;
531 void mac_status_para() ;
532 void mac_update_counter() ;
533 void sm_pm_ls_latch() ;
534 void sm_ma_control() ;
535 void sm_mac_check_beacon_claim() ;
536 void config_mux() ;
537 void smt_agent_init() ;
538 void smt_timer_init() ;
539 void smt_received_pack() ;
540 void smt_add_para() ;
541 void smt_swap_para() ;
542 void ev_init() ;
543 void hwt_init() ;
544 u_long hwt_read() ;
545 void hwt_stop() ;
546 void hwt_start() ;
547 void smt_send_mbuf() ;
548 void smt_free_mbuf() ;
549 void sm_pm_bypass_req() ;
550 void rmt_indication() ;
551 void cfm_state_change() ;
552 void rx_indication() ;
553 void tx_indication() ;
554 #ifndef NO_SMT_PANIC
555 void smt_panic() ;
556 #else
557 #ifdef	DEBUG
558 void smt_panic() ;
559 #else
560 #define	smt_panic(smc,text)
561 #endif	/* DEBUG */
562 #endif	/* NO_SMT_PANIC */
563 void smt_stat_counter() ;
564 void smt_timer_poll() ;
565 u_long smt_get_time() ;
566 u_long smt_get_tid() ;
567 void smt_timer_done() ;
568 void smt_set_defaults() ;
569 void smt_fixup_mib() ;
570 void smt_reset_defaults() ;
571 void smt_agent_task() ;
572 void smt_please_reconnect() ;
573 int smt_check_para() ;
574 void driver_get_bia() ;
575 #ifdef	SUPERNET_3
576 void drv_reset_indication() ;
577 #endif	/* SUPERNET_3 */
578 void smt_start_watchdog() ;
579 
580 void smt_event() ;
581 void pcm_event() ;
582 void rmt_event() ;
583 void cfm_event() ;
584 void timer_event() ;
585 void ev_dispatcher() ;
586 
587 void smt_get_state() ;
588 void ecm_get_state() ;
589 void pcm_get_state() ;
590 void rmt_get_state() ;
591 
592 void ecm_state_change() ;
593 int sm_pm_bypass_present() ;
594 void pcm_state_change() ;
595 void rmt_state_change() ;
596 int sm_pm_get_ls() ;
597 int pcm_get_s_port() ;
598 int pcm_rooted_station() ;
599 int cfm_get_mac_input() ;
600 int cfm_get_mac_output() ;
601 int port_to_mib() ;
602 int cem_build_path() ;
603 int sm_mac_get_tx_state() ;
604 int is_individual() ;
605 int is_my_addr() ;
606 int is_broadcast() ;
607 int is_equal() ;
608 char *get_pcmstate() ;
609 
610 int smt_action() ;
611 u_short smt_online() ;
612 void smt_force_irq() ;
613 void smt_pmf_received_pack() ;
614 void smt_send_frame() ;
615 void smt_set_timestamp() ;
616 void mac_set_rx_mode() ;
617 int mac_add_multicast() ;
618 int mac_set_func_addr() ;
619 void mac_del_multicast() ;
620 void mac_update_multicast() ;
621 void mac_clear_multicast() ;
622 void mac_rx_directed_beacon() ;
623 void set_formac_tsync() ;
624 void formac_reinit_tx() ;
625 void formac_tx_restart() ;
626 void process_receive() ;
627 void init_driver_fplus() ;
628 
629 void rtm_irq() ;
630 void rtm_set_timer() ;
631 void ring_status_indication() ;
632 void llc_recover_tx() ;
633 void llc_restart_tx() ;
634 void plc_clear_irq() ;
635 void plc_irq() ;
636 int smt_set_mac_opvalues() ;
637 #ifdef	TAG_MODE
638 void mac_drv_pci_fix() ;
639 void mac_do_pci_fix() ;
640 void mac_drv_clear_tx_queue() ;
641 void mac_drv_repair_descr() ;
642 u_long hwt_quick_read() ;
643 void hwt_wait_time() ;
644 #endif
645 
646 #ifdef SMT_PNMI
647 #ifdef ANSIC
648 int pnmi_init (struct s_smc* smc);
649 int pnmi_process_ndis_id (struct s_smc* smc, u_long ndis_oid, void* buf,
650 		int len, int* BytesAccessed, int* BytesNeeded, u_char action);
651 #else
652 int pnmi_init ();
653 int pnmi_process_ndis_id ();
654 #endif
655 #endif
656 
657 #ifdef	SBA
658 #ifndef _H2INC
659 void sba() ;
660 #endif
661 void sba_raf_received_pack() ;
662 void sba_timer_poll() ;
663 void smt_init_sba() ;
664 #endif
665 #ifdef	ESS
666 int ess_raf_received_pack() ;
667 void ess_timer_poll() ;
668 void ess_para_change() ;
669 #endif
670 
671 #ifdef	BOOT
672 #define smt_srf_event(a,b,c,d)
673 #define smt_init_evc(a)
674 #else
675 void smt_init_evc() ;
676 void smt_srf_event() ;
677 #endif
678 
679 #ifndef SMT_REAL_TOKEN_CT
680 void smt_emulate_token_ct();
681 #endif
682 
683 #if defined(DEBUG) && !defined(BOOT)
684 void dump_smt() ;
685 #else
686 #define	dump_smt(smc,sm,text)
687 #endif
688 
689 #ifdef	DEBUG
690 char	*addr_to_string() ;
691 void	dump_hex() ;
692 #endif
693 #endif	/* PROTOTYP_INC */
694 
695 /* PNMI default defines */
696 #ifndef PNMI_INIT
697 #define	PNMI_INIT(smc)	/* Nothing */
698 #endif
699 #ifndef PNMI_GET_ID
700 #define PNMI_GET_ID( smc, ndis_oid, buf, len, BytesWritten, BytesNeeded ) \
701 		( 1 ? (-1) : (-1) )
702 #endif
703 #ifndef PNMI_SET_ID
704 #define PNMI_SET_ID( smc, ndis_oid, buf, len, BytesRead, BytesNeeded, \
705 		set_type) ( 1 ? (-1) : (-1) )
706 #endif
707 
708 /*
709  * SMT_PANIC defines
710  */
711 #ifndef	SMT_PANIC
712 #define	SMT_PANIC(smc,nr,msg)	smt_panic (smc, msg)
713 #endif
714 
715 #ifndef	SMT_ERR_LOG
716 #define	SMT_ERR_LOG(smc,nr,msg)	SMT_PANIC (smc, nr, msg)
717 #endif
718 
719 #ifndef	SMT_EBASE
720 #define	SMT_EBASE	100
721 #endif
722 
723 #define	SMT_E0100	SMT_EBASE + 0
724 #define	SMT_E0100_MSG	"cfm FSM: illegal ce_type"
725 #define	SMT_E0101	SMT_EBASE + 1
726 #define	SMT_E0101_MSG	"CEM: case ???"
727 #define	SMT_E0102	SMT_EBASE + 2
728 #define	SMT_E0102_MSG	"CEM A: illegal state"
729 #define	SMT_E0103	SMT_EBASE + 3
730 #define	SMT_E0103_MSG	"CEM B: illegal state"
731 #define	SMT_E0104	SMT_EBASE + 4
732 #define	SMT_E0104_MSG	"CEM M: illegal state"
733 #define	SMT_E0105	SMT_EBASE + 5
734 #define	SMT_E0105_MSG	"CEM S: illegal state"
735 #define	SMT_E0106	SMT_EBASE + 6
736 #define	SMT_E0106_MSG	"CFM : illegal state"
737 #define	SMT_E0107	SMT_EBASE + 7
738 #define	SMT_E0107_MSG	"ECM : illegal state"
739 #define	SMT_E0108	SMT_EBASE + 8
740 #define	SMT_E0108_MSG	"prop_actions : NAC in DAS CFM"
741 #define	SMT_E0109	SMT_EBASE + 9
742 #define	SMT_E0109_MSG	"ST2U.FM_SERRSF error in special frame"
743 #define	SMT_E0110	SMT_EBASE + 10
744 #define	SMT_E0110_MSG	"ST2U.FM_SRFRCTOV recv. count. overflow"
745 #define	SMT_E0111	SMT_EBASE + 11
746 #define	SMT_E0111_MSG	"ST2U.FM_SNFSLD NP & FORMAC simult. load"
747 #define	SMT_E0112	SMT_EBASE + 12
748 #define	SMT_E0112_MSG	"ST2U.FM_SRCVFRM single-frame recv.-mode"
749 #define	SMT_E0113	SMT_EBASE + 13
750 #define	SMT_E0113_MSG	"FPLUS: Buffer Memory Error"
751 #define	SMT_E0114	SMT_EBASE + 14
752 #define	SMT_E0114_MSG	"ST2U.FM_SERRSF error in special frame"
753 #define	SMT_E0115	SMT_EBASE + 15
754 #define	SMT_E0115_MSG	"ST3L: parity error in receive queue 2"
755 #define	SMT_E0116	SMT_EBASE + 16
756 #define	SMT_E0116_MSG	"ST3L: parity error in receive queue 1"
757 #define	SMT_E0117	SMT_EBASE + 17
758 #define	SMT_E0117_MSG	"E_SMT_001: RxD count for receive queue 1 = 0"
759 #define	SMT_E0118	SMT_EBASE + 18
760 #define	SMT_E0118_MSG	"PCM : illegal state"
761 #define	SMT_E0119	SMT_EBASE + 19
762 #define	SMT_E0119_MSG	"smt_add_para"
763 #define	SMT_E0120	SMT_EBASE + 20
764 #define	SMT_E0120_MSG	"smt_set_para"
765 #define	SMT_E0121	SMT_EBASE + 21
766 #define	SMT_E0121_MSG	"illegal event in dispatcher"
767 #define	SMT_E0122	SMT_EBASE + 22
768 #define	SMT_E0122_MSG	"RMT : illegal state"
769 #define	SMT_E0123	SMT_EBASE + 23
770 #define	SMT_E0123_MSG	"SBA: state machine has illegal state"
771 #define	SMT_E0124	SMT_EBASE + 24
772 #define	SMT_E0124_MSG	"sba_free_session() called with NULL pointer"
773 #define	SMT_E0125	SMT_EBASE + 25
774 #define	SMT_E0125_MSG	"SBA : illegal session pointer"
775 #define	SMT_E0126	SMT_EBASE + 26
776 #define	SMT_E0126_MSG	"smt_free_mbuf() called with NULL pointer\n"
777 #define	SMT_E0127	SMT_EBASE + 27
778 #define	SMT_E0127_MSG	"sizeof evcs"
779 #define	SMT_E0128	SMT_EBASE + 28
780 #define	SMT_E0128_MSG	"evc->evc_cond_state = 0"
781 #define	SMT_E0129	SMT_EBASE + 29
782 #define	SMT_E0129_MSG	"evc->evc_multiple = 0"
783 #define	SMT_E0130	SMT_EBASE + 30
784 #define	SMT_E0130_MSG	write_mdr_warning
785 #define	SMT_E0131	SMT_EBASE + 31
786 #define	SMT_E0131_MSG	cam_warning
787 #define SMT_E0132	SMT_EBASE + 32
788 #define SMT_E0132_MSG	"ST1L.FM_SPCEPDx parity/coding error"
789 #define SMT_E0133	SMT_EBASE + 33
790 #define SMT_E0133_MSG	"ST1L.FM_STBURx tx buffer underrun"
791 #define SMT_E0134	SMT_EBASE + 34
792 #define SMT_E0134_MSG	"ST1L.FM_SPCEPDx parity error"
793 #define SMT_E0135	SMT_EBASE + 35
794 #define SMT_E0135_MSG	"RMT: duplicate MAC address detected. Ring left!"
795 #define SMT_E0136	SMT_EBASE + 36
796 #define SMT_E0136_MSG	"Elasticity Buffer hang-up"
797 #define SMT_E0137	SMT_EBASE + 37
798 #define SMT_E0137_MSG	"SMT: queue overrun"
799 #define SMT_E0138	SMT_EBASE + 38
800 #define SMT_E0138_MSG	"RMT: duplicate MAC address detected. Ring NOT left!"
801 #endif	/* _CMTDEF_ */
802