cachepc-linux

Fork of AMDESE/linux with modifications for CachePC side-channel attack
git clone https://git.sinitax.com/sinitax/cachepc-linux
Log | Files | Refs | README | LICENSE | sfeed.txt

cmtdef.h (22233B)


      1/* SPDX-License-Identifier: GPL-2.0-or-later */
      2/******************************************************************************
      3 *
      4 *	(C)Copyright 1998,1999 SysKonnect,
      5 *	a business unit of Schneider & Koch & Co. Datensysteme GmbH.
      6 *
      7 *	The information in this file is provided "AS IS" without warranty.
      8 *
      9 ******************************************************************************/
     10
     11#ifndef	_CMTDEF_
     12#define _CMTDEF_
     13
     14/* **************************************************************** */
     15
     16/*
     17 * implementation specific constants
     18 * MODIIFY THE FOLLOWING THREE DEFINES
     19 */
     20#define AMDPLC			/* if Amd PLC chip used */
     21#ifdef	CONC
     22#define NUMPHYS		12	/* 2 for SAS or DAS, more for Concentrator */
     23#else
     24#ifdef	CONC_II
     25#define NUMPHYS		24	/* 2 for SAS or DAS, more for Concentrator */
     26#else
     27#define NUMPHYS		2	/* 2 for SAS or DAS, more for Concentrator */
     28#endif
     29#endif
     30#define NUMMACS		1	/* only 1 supported at the moment */
     31#define NUMPATHS	2	/* primary and secondary path supported */
     32
     33/*
     34 * DO NOT MODIFY BEYOND THIS POINT
     35 */
     36
     37/* **************************************************************** */
     38
     39#if	NUMPHYS > 2
     40#define CONCENTRATOR
     41#endif
     42
     43/*
     44 * Definitions for comfortable LINT usage
     45 */
     46#ifdef	lint
     47#define LINT_USE(x)	(x)=(x)
     48#else
     49#define LINT_USE(x)
     50#endif
     51
     52#ifdef	DEBUG
     53#define	DB_PR(flag, fmt, ...)						\
     54	do { if (flag) printf(fmt "\n", ##__VA_ARGS__); } while (0)
     55#else
     56#define	DB_PR(flag, fmt, ...)	no_printk(fmt "\n", ##__VA_ARGS__)
     57
     58#endif
     59
     60#ifdef DEBUG_BRD
     61#define DB_TEST (smc->debug)
     62#else
     63#define DB_TEST (debug)
     64#endif
     65
     66#define DB_ECM(fmt, ...)						\
     67	DB_PR((DB_TEST).d_smt & 1, fmt, ##__VA_ARGS__)
     68#define DB_ECMN(n, fmt, ...)						\
     69	DB_PR((DB_TEST).d_ecm >= (n), fmt, ##__VA_ARGS__)
     70#define DB_RMT(fmt, ...)						\
     71	DB_PR((DB_TEST).d_smt & 2, fmt, ##__VA_ARGS__)
     72#define DB_RMTN(n, fmt, ...)						\
     73	DB_PR((DB_TEST).d_rmt >= (n), fmt, ##__VA_ARGS__)
     74#define DB_CFM(fmt, ...)						\
     75	DB_PR((DB_TEST).d_smt & 4, fmt, ##__VA_ARGS__)
     76#define DB_CFMN(n, fmt, ...)						\
     77	DB_PR((DB_TEST).d_cfm >= (n), fmt, ##__VA_ARGS__)
     78#define DB_PCM(fmt, ...)						\
     79	DB_PR((DB_TEST).d_smt & 8, fmt, ##__VA_ARGS__)
     80#define DB_PCMN(n, fmt, ...)						\
     81	DB_PR((DB_TEST).d_pcm >= (n), fmt, ##__VA_ARGS__)
     82#define DB_SMT(fmt, ...)						\
     83	DB_PR((DB_TEST).d_smtf, fmt, ##__VA_ARGS__)
     84#define DB_SMTN(n, fmt, ...)						\
     85	DB_PR((DB_TEST).d_smtf >= (n), fmt, ##__VA_ARGS__)
     86#define DB_SBA(fmt, ...)						\
     87	DB_PR((DB_TEST).d_sba, fmt, ##__VA_ARGS__)
     88#define DB_SBAN(n, fmt, ...)						\
     89	DB_PR((DB_TEST).d_sba >= (n), fmt, ##__VA_ARGS__)
     90#define DB_ESS(fmt, ...)						\
     91	DB_PR((DB_TEST).d_ess, fmt, ##__VA_ARGS__)
     92#define DB_ESSN(n, fmt, ...)						\
     93	DB_PR((DB_TEST).d_ess >= (n), fmt, ##__VA_ARGS__)
     94
     95#ifndef	SS_NOT_DS
     96#define	SK_LOC_DECL(type,var)	type var
     97#else
     98#define	SK_LOC_DECL(type,var)	static type var
     99#endif
    100/*
    101 * PHYs and PORTS
    102 * Note: Don't touch the definition of PA and PB. Those might be used
    103 *	by some "for" loops.
    104 */
    105#define PA		0
    106#define PB		1
    107#if	defined(SUPERNET_3) || defined(CONC_II)
    108/*
    109 * The port indices have to be different,
    110 * because the MAC output goes through the 2. PLC
    111 * Conc II: It has to be the first port in the row.
    112 */
    113#define PS		0	/* Internal PLC which is the same as PA */
    114#else
    115#define PS		1
    116#endif
    117#define PM		2		/* PM .. PA+NUM_PHYS-1 */
    118
    119/*
    120 * PHY types - as in path descriptor 'fddiPHYType'
    121 */
    122#define TA			0	/* A port */
    123#define TB			1	/* B port */
    124#define TS			2	/* S port */
    125#define TM			3	/* M port */
    126#define TNONE			4
    127
    128
    129/*
    130 * indexes in MIB
    131 */
    132#define INDEX_MAC	1
    133#define INDEX_PATH	1
    134#define INDEX_PORT	1
    135
    136
    137/*
    138 * policies
    139 */
    140#define POLICY_AA	(1<<0)		/* reject AA */
    141#define POLICY_AB	(1<<1)		/* reject AB */
    142#define POLICY_AS	(1<<2)		/* reject AS */
    143#define POLICY_AM	(1<<3)		/* reject AM */
    144#define POLICY_BA	(1<<4)		/* reject BA */
    145#define POLICY_BB	(1<<5)		/* reject BB */
    146#define POLICY_BS	(1<<6)		/* reject BS */
    147#define POLICY_BM	(1<<7)		/* reject BM */
    148#define POLICY_SA	(1<<8)		/* reject SA */
    149#define POLICY_SB	(1<<9)		/* reject SB */
    150#define POLICY_SS	(1<<10)		/* reject SS */
    151#define POLICY_SM	(1<<11)		/* reject SM */
    152#define POLICY_MA	(1<<12)		/* reject MA */
    153#define POLICY_MB	(1<<13)		/* reject MB */
    154#define POLICY_MS	(1<<14)		/* reject MS */
    155#define POLICY_MM	(1<<15)		/* reject MM */
    156
    157/*
    158 * commands
    159 */
    160
    161/*
    162 * EVENTS
    163 * event classes
    164 */
    165#define EVENT_ECM	1		/* event class ECM */
    166#define EVENT_CFM	2		/* event class CFM */
    167#define EVENT_RMT	3		/* event class RMT */
    168#define EVENT_SMT	4		/* event class SMT */
    169#define EVENT_PCM	5		/* event class PCM */
    170#define EVENT_PCMA	5		/* event class PCMA */
    171#define EVENT_PCMB	6		/* event class PCMB */
    172
    173/* WARNING :
    174 * EVENT_PCM* must be last in the above list
    175 * if more than two ports are used, EVENT_PCM .. EVENT_PCMA+NUM_PHYS-1
    176 * are used !
    177 */
    178
    179#define EV_TOKEN(class,event)	(((u_long)(class)<<16L)|((u_long)(event)))
    180#define EV_T_CLASS(token)	((int)((token)>>16)&0xffff)
    181#define EV_T_EVENT(token)	((int)(token)&0xffff)
    182
    183/*
    184 * ECM events
    185 */
    186#define EC_CONNECT	1		/* connect request */
    187#define EC_DISCONNECT	2		/* disconnect request */
    188#define EC_TRACE_PROP	3		/* trace propagation */
    189#define EC_PATH_TEST	4		/* path test */
    190#define EC_TIMEOUT_TD	5		/* timer TD_min */
    191#define EC_TIMEOUT_TMAX	6		/* timer trace_max */
    192#define EC_TIMEOUT_IMAX	7		/* timer I_max */
    193#define EC_TIMEOUT_INMAX 8		/* timer IN_max */
    194#define EC_TEST_DONE	9		/* path test done */
    195
    196/*
    197 * CFM events
    198 */
    199#define CF_LOOP		1		/* cf_loop flag from PCM */
    200#define CF_LOOP_A	1		/* cf_loop flag from PCM */
    201#define CF_LOOP_B	2		/* cf_loop flag from PCM */
    202#define CF_JOIN		3		/* cf_join flag from PCM */
    203#define CF_JOIN_A	3		/* cf_join flag from PCM */
    204#define CF_JOIN_B	4		/* cf_join flag from PCM */
    205
    206/*
    207 * PCM events
    208 */
    209#define PC_START		1
    210#define PC_STOP			2
    211#define PC_LOOP			3
    212#define PC_JOIN			4
    213#define PC_SIGNAL		5
    214#define PC_REJECT		6
    215#define PC_MAINT    		7
    216#define PC_TRACE		8
    217#define PC_PDR			9
    218#define PC_ENABLE		10
    219#define PC_DISABLE		11
    220
    221/*
    222 * must be ordered as in LineStateType
    223 */
    224#define PC_QLS			12
    225#define PC_ILS			13
    226#define PC_MLS			14
    227#define PC_HLS			15
    228#define PC_LS_PDR		16
    229#define PC_LS_NONE		17
    230#define LS2MIB(x)	((x)-PC_QLS)
    231#define MIB2LS(x)	((x)+PC_QLS)
    232
    233#define PC_TIMEOUT_TB_MAX	18	/* timer TB_max */
    234#define PC_TIMEOUT_TB_MIN	19	/* timer TB_min */
    235#define PC_TIMEOUT_C_MIN	20	/* timer C_Min */
    236#define PC_TIMEOUT_T_OUT	21	/* timer T_Out */
    237#define PC_TIMEOUT_TL_MIN	22	/* timer TL_Min */
    238#define PC_TIMEOUT_T_NEXT	23	/* timer t_next[] */
    239#define PC_TIMEOUT_LCT		24
    240#define PC_NSE			25	/* NOISE hardware timer */
    241#define PC_LEM			26	/* LEM done */
    242
    243/*
    244 * RMT events				  meaning		from
    245 */
    246#define RM_RING_OP	1		/* ring operational	MAC	*/
    247#define RM_RING_NON_OP	2		/* ring not operational	MAC	*/
    248#define RM_MY_BEACON	3		/* recvd my beacon	MAC	*/
    249#define RM_OTHER_BEACON	4		/* recvd other beacon	MAC	*/
    250#define RM_MY_CLAIM	5		/* recvd my claim	MAC	*/
    251#define RM_TRT_EXP	6		/* TRT exp		MAC	*/
    252#define RM_VALID_CLAIM	7		/* claim from dup addr	MAC	*/
    253#define RM_JOIN		8		/* signal rm_join	CFM	*/
    254#define RM_LOOP		9		/* signal rm_loop	CFM	*/
    255#define RM_DUP_ADDR	10		/* dup_addr_test hange	SMT-NIF	*/
    256#define RM_ENABLE_FLAG	11		/* enable flag */
    257
    258#define RM_TIMEOUT_NON_OP	12	/* timeout T_Non_OP	*/
    259#define RM_TIMEOUT_T_STUCK	13	/* timeout T_Stuck	*/
    260#define RM_TIMEOUT_ANNOUNCE	14	/* timeout T_Announce	*/
    261#define RM_TIMEOUT_T_DIRECT	15	/* timeout T_Direct	*/
    262#define RM_TIMEOUT_D_MAX	16	/* timeout D_Max	*/
    263#define RM_TIMEOUT_POLL		17	/* claim/beacon poller	*/
    264#define RM_TX_STATE_CHANGE	18	/* To restart timer for D_Max */
    265
    266/*
    267 * SMT events
    268 */
    269#define SM_TIMER	1		/* timer */
    270#define SM_FAST		2		/* smt_force_irq */
    271
    272/* PC modes */
    273#define PM_NONE		0
    274#define PM_PEER		1
    275#define PM_TREE		2
    276
    277/*
    278 * PCM withhold codes
    279 * MIB PC-WithholdType ENUM
    280 */
    281#define PC_WH_NONE	0		/* ok */
    282#define PC_WH_M_M	1		/* M to M */
    283#define PC_WH_OTHER	2		/* other incompatible phys */
    284#define PC_WH_PATH	3		/* path not available */
    285/*
    286 * LCT duration
    287 */
    288#define LC_SHORT	1		/* short LCT */
    289#define LC_MEDIUM	2		/* medium LCT */
    290#define LC_LONG		3		/* long LCT */
    291#define LC_EXTENDED	4		/* extended LCT */
    292
    293/*
    294 * path_test values
    295 */
    296#define PT_NONE		0
    297#define PT_TESTING	1		/* test is running */
    298#define PT_PASSED	2		/* test passed */
    299#define PT_FAILED	3		/* test failed */
    300#define PT_PENDING	4		/* path test follows */
    301#define PT_EXITING	5		/* disconnected while in trace/leave */
    302
    303/*
    304 * duplicate address test
    305 * MIB DupAddressTest ENUM
    306 */
    307#define DA_NONE		0		/* 		*/
    308#define DA_PASSED	1		/* test passed */
    309#define DA_FAILED	2		/* test failed */
    310
    311
    312/*
    313 * optical bypass
    314 */
    315#define BP_DEINSERT	0		/* disable bypass */
    316#define BP_INSERT	1		/* enable bypass */
    317
    318/*
    319 * ODL enable/disable
    320 */
    321#define PM_TRANSMIT_DISABLE	0	/* disable xmit */
    322#define PM_TRANSMIT_ENABLE	1	/* enable xmit */
    323
    324/*
    325 * parameter for config_mux
    326 * note : number is index in config_endec table !
    327 */
    328#define MUX_THRUA	0		/* through A */
    329#define MUX_THRUB	1		/* through B */
    330#define MUX_WRAPA	2		/* wrap A */
    331#define MUX_WRAPB	3		/* wrap B */
    332#define MUX_ISOLATE	4		/* isolated */
    333#define MUX_WRAPS	5		/* SAS */
    334
    335/*
    336 * MAC control
    337 */
    338#define MA_RESET	0
    339#define MA_BEACON	1
    340#define MA_CLAIM	2
    341#define MA_DIRECTED	3		/* directed beacon */
    342#define MA_TREQ		4		/* change T_Req */
    343#define MA_OFFLINE	5		/* switch MAC to offline */
    344
    345
    346/*
    347 * trace prop
    348 * bit map for trace propagation
    349 */
    350#define ENTITY_MAC	(NUMPHYS)
    351#define ENTITY_PHY(p)	(p)
    352#define ENTITY_BIT(m)	(1<<(m))
    353
    354/*
    355 * Resource Tag Types
    356 */
    357#define PATH_ISO	0	/* isolated */
    358#define PATH_PRIM	3	/* primary path */
    359#define PATH_THRU	5	/* through path */
    360
    361#define RES_MAC		2	/* resource type MAC */
    362#define RES_PORT	4	/* resource type PORT */
    363
    364
    365/*
    366 * CFM state
    367 * oops: MUST MATCH CF-StateType in SMT7.2 !
    368 */
    369#define SC0_ISOLATED	0		/* isolated */
    370#define SC1_WRAP_A	5		/* wrap A (not used) */
    371#define SC2_WRAP_B	6		/* wrap B (not used) */
    372#define SC4_THRU_A	12		/* through A */
    373#define SC5_THRU_B	7		/* through B (used in SMT 6.2) */
    374#define SC7_WRAP_S	8		/* SAS (not used) */
    375#define SC9_C_WRAP_A	9		/* c wrap A */
    376#define SC10_C_WRAP_B	10		/* c wrap B */
    377#define SC11_C_WRAP_S	11		/* c wrap S */
    378
    379/*
    380 * convert MIB time in units of 80nS to uS
    381 */
    382#define MIB2US(t)		((t)/12)
    383#define SEC2MIB(s)	((s)*12500000L)
    384/*
    385 * SMT timer
    386 */
    387struct smt_timer {
    388	struct smt_timer	*tm_next ;	/* linked list */
    389	struct s_smc		*tm_smc ;	/* pointer to context */
    390	u_long			tm_delta ;	/* delta time */
    391	u_long			tm_token ;	/* token value */
    392	u_short			tm_active ;	/* flag : active/inactive */
    393	u_short			tm_pad ;	/* pad field */
    394} ;
    395
    396/*
    397 * communication structures
    398 */
    399struct mac_parameter {
    400	u_long	t_neg ;		/* T_Neg parameter */
    401	u_long	t_pri ;		/* T_Pri register in MAC */
    402} ;
    403
    404/*
    405 * MAC counters
    406 */
    407struct mac_counter {
    408	u_long	mac_nobuf_counter ;	/* MAC SW counter: no buffer */
    409	u_long	mac_r_restart_counter ;	/* MAC SW counter: rx restarted */
    410} ;
    411
    412/*
    413 * para struct context for SMT parameters
    414 */
    415struct s_pcon {
    416	int	pc_len ;
    417	int	pc_err ;
    418	int	pc_badset ;
    419	void	*pc_p ;
    420} ;
    421
    422/*
    423 * link error monitor
    424 */
    425#define LEM_AVG	5
    426struct 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#ifdef	AMDPLC
    448
    449/*
    450 * PLC state table
    451 */
    452struct s_plc {
    453	u_short	p_state ;		/* current state */
    454	u_short	p_bits ;		/* number of bits to send */
    455	u_short	p_start ;		/* first bit pos */
    456	u_short	p_pad ;			/* padding for alignment */
    457	u_long soft_err ;		/* error counter */
    458	u_long parity_err ;		/* error counter */
    459	u_long ebuf_err ;		/* error counter */
    460	u_long ebuf_cont ;		/* continuous error counter */
    461	u_long phyinv ;			/* error counter */
    462	u_long vsym_ctr ;		/* error counter */
    463	u_long mini_ctr ;		/* error counter */
    464	u_long tpc_exp ;		/* error counter */
    465	u_long np_err ;			/* error counter */
    466	u_long b_pcs ;			/* error counter */
    467	u_long b_tpc ;			/* error counter */
    468	u_long b_tne ;			/* error counter */
    469	u_long b_qls ;			/* error counter */
    470	u_long b_ils ;			/* error counter */
    471	u_long b_hls ;			/* error counter */
    472} ;
    473#endif
    474
    475#ifdef	PROTOTYP_INC
    476#include "fddi/driver.pro"
    477#else	/* PROTOTYP_INC */
    478/*
    479 * function prototypes
    480 */
    481#include "mbuf.h"	/* Type definitions for MBUFs */
    482#include "smtstate.h"	/* struct smt_state */
    483
    484void hwt_restart(struct s_smc *smc);	/* hwt.c */
    485SMbuf *smt_build_frame(struct s_smc *smc, int class, int type,
    486		       int length);	/* smt.c */
    487SMbuf *smt_get_mbuf(struct s_smc *smc);	/* drvsr.c */
    488void *sm_to_para(struct s_smc *smc, struct smt_header *sm,
    489		 int para);		/* smt.c */
    490
    491#ifndef SK_UNUSED
    492#define SK_UNUSED(var)		(void)(var)
    493#endif
    494
    495void queue_event(struct s_smc *smc, int class, int event);
    496void ecm(struct s_smc *smc, int event);
    497void ecm_init(struct s_smc *smc);
    498void rmt(struct s_smc *smc, int event);
    499void rmt_init(struct s_smc *smc);
    500void pcm(struct s_smc *smc, const int np, int event);
    501void pcm_init(struct s_smc *smc);
    502void cfm(struct s_smc *smc, int event);
    503void cfm_init(struct s_smc *smc);
    504void smt_timer_start(struct s_smc *smc, struct smt_timer *timer, u_long time,
    505		     u_long token);
    506void smt_timer_stop(struct s_smc *smc, struct smt_timer *timer);
    507void pcm_status_state(struct s_smc *smc, int np, int *type, int *state,
    508		      int *remote, int *mac);
    509void plc_config_mux(struct s_smc *smc, int mux);
    510void sm_lem_evaluate(struct s_smc *smc);
    511void mac_update_counter(struct s_smc *smc);
    512void sm_ma_control(struct s_smc *smc, int mode);
    513void sm_mac_check_beacon_claim(struct s_smc *smc);
    514void config_mux(struct s_smc *smc, int mux);
    515void smt_agent_init(struct s_smc *smc);
    516void smt_timer_init(struct s_smc *smc);
    517void smt_received_pack(struct s_smc *smc, SMbuf *mb, int fs);
    518void smt_add_para(struct s_smc *smc, struct s_pcon *pcon, u_short para,
    519		  int index, int local);
    520void smt_swap_para(struct smt_header *sm, int len, int direction);
    521void ev_init(struct s_smc *smc);
    522void hwt_init(struct s_smc *smc);
    523u_long hwt_read(struct s_smc *smc);
    524void hwt_stop(struct s_smc *smc);
    525void hwt_start(struct s_smc *smc, u_long time);
    526void smt_send_mbuf(struct s_smc *smc, SMbuf *mb, int fc);
    527void smt_free_mbuf(struct s_smc *smc, SMbuf *mb);
    528void sm_pm_bypass_req(struct s_smc *smc, int mode);
    529void rmt_indication(struct s_smc *smc, int i);
    530void cfm_state_change(struct s_smc *smc, int c_state);
    531
    532#if defined(DEBUG) || !defined(NO_SMT_PANIC)
    533void smt_panic(struct s_smc *smc, char *text);
    534#else
    535#define	smt_panic(smc,text)
    536#endif /* DEBUG || !NO_SMT_PANIC */
    537
    538void smt_stat_counter(struct s_smc *smc, int stat);
    539void smt_timer_poll(struct s_smc *smc);
    540u_long smt_get_time(void);
    541u_long smt_get_tid(struct s_smc *smc);
    542void smt_timer_done(struct s_smc *smc);
    543void smt_fixup_mib(struct s_smc *smc);
    544void smt_reset_defaults(struct s_smc *smc, int level);
    545void smt_agent_task(struct s_smc *smc);
    546int smt_check_para(struct s_smc *smc, struct smt_header *sm,
    547		   const u_short list[]);
    548void driver_get_bia(struct s_smc *smc, struct fddi_addr *bia_addr);
    549
    550#ifdef SUPERNET_3
    551void drv_reset_indication(struct s_smc *smc);
    552#endif	/* SUPERNET_3 */
    553
    554void smt_start_watchdog(struct s_smc *smc);
    555void smt_event(struct s_smc *smc, int event);
    556void timer_event(struct s_smc *smc, u_long token);
    557void ev_dispatcher(struct s_smc *smc);
    558void pcm_get_state(struct s_smc *smc, struct smt_state *state);
    559void ecm_state_change(struct s_smc *smc, int e_state);
    560int sm_pm_bypass_present(struct s_smc *smc);
    561void pcm_state_change(struct s_smc *smc, int plc, int p_state);
    562void rmt_state_change(struct s_smc *smc, int r_state);
    563int sm_pm_get_ls(struct s_smc *smc, int phy);
    564int pcm_get_s_port(struct s_smc *smc);
    565int pcm_rooted_station(struct s_smc *smc);
    566int cfm_get_mac_input(struct s_smc *smc);
    567int cfm_get_mac_output(struct s_smc *smc);
    568int cem_build_path(struct s_smc *smc, char *to, int path_index);
    569int sm_mac_get_tx_state(struct s_smc *smc);
    570char *get_pcmstate(struct s_smc *smc, int np);
    571int smt_action(struct s_smc *smc, int class, int code, int index);
    572u_short smt_online(struct s_smc *smc, int on);
    573void smt_force_irq(struct s_smc *smc);
    574void smt_pmf_received_pack(struct s_smc *smc, SMbuf *mb, int local);
    575void smt_send_frame(struct s_smc *smc, SMbuf *mb, int fc, int local);
    576void smt_set_timestamp(struct s_smc *smc, u_char *p);
    577void mac_set_rx_mode(struct s_smc *smc,	int mode);
    578int mac_add_multicast(struct s_smc *smc, struct fddi_addr *addr, int can);
    579void mac_update_multicast(struct s_smc *smc);
    580void mac_clear_multicast(struct s_smc *smc);
    581void set_formac_tsync(struct s_smc *smc, long sync_bw);
    582void formac_reinit_tx(struct s_smc *smc);
    583void formac_tx_restart(struct s_smc *smc);
    584void process_receive(struct s_smc *smc);
    585void init_driver_fplus(struct s_smc *smc);
    586void rtm_irq(struct s_smc *smc);
    587void rtm_set_timer(struct s_smc *smc);
    588void ring_status_indication(struct s_smc *smc, u_long status);
    589void llc_recover_tx(struct s_smc *smc);
    590void llc_restart_tx(struct s_smc *smc);
    591void plc_clear_irq(struct s_smc *smc, int p);
    592void plc_irq(struct s_smc *smc,	int np,	unsigned int cmd);
    593int smt_set_mac_opvalues(struct s_smc *smc);
    594
    595#ifdef TAG_MODE
    596void mac_do_pci_fix(struct s_smc *smc);
    597void mac_drv_clear_tx_queue(struct s_smc *smc);
    598void mac_drv_repair_descr(struct s_smc *smc);
    599u_long hwt_quick_read(struct s_smc *smc);
    600void hwt_wait_time(struct s_smc *smc, u_long start, long duration);
    601#endif
    602
    603#ifdef SMT_PNMI
    604int pnmi_init(struct s_smc* smc);
    605int pnmi_process_ndis_id(struct s_smc *smc, u_long ndis_oid, void *buf, int len,
    606			 int *BytesAccessed, int *BytesNeeded, u_char action);
    607#endif
    608
    609#ifdef	SBA
    610#ifndef _H2INC
    611void sba();
    612#endif
    613void sba_raf_received_pack();
    614void sba_timer_poll();
    615void smt_init_sba();
    616#endif
    617
    618#ifdef	ESS
    619int ess_raf_received_pack(struct s_smc *smc, SMbuf *mb, struct smt_header *sm,
    620			  int fs);
    621void ess_timer_poll(struct s_smc *smc);
    622void ess_para_change(struct s_smc *smc);
    623#endif
    624
    625#ifndef	BOOT
    626void smt_init_evc(struct s_smc *smc);
    627void smt_srf_event(struct s_smc *smc, int code, int index, int cond);
    628#else
    629#define smt_init_evc(smc)
    630#define smt_srf_event(smc,code,index,cond)
    631#endif
    632
    633#ifndef SMT_REAL_TOKEN_CT
    634void smt_emulate_token_ct(struct s_smc *smc, int mac_index);
    635#endif
    636
    637#if defined(DEBUG) && !defined(BOOT)
    638void dump_smt(struct s_smc *smc, struct smt_header *sm, char *text);
    639#else
    640#define	dump_smt(smc,sm,text)
    641#endif
    642
    643#ifdef	DEBUG
    644void dump_hex(char *p, int len);
    645#endif
    646
    647#endif	/* PROTOTYP_INC */
    648
    649/* PNMI default defines */
    650#ifndef PNMI_INIT
    651#define	PNMI_INIT(smc)	/* Nothing */
    652#endif
    653
    654/*
    655 * SMT_PANIC defines
    656 */
    657#ifndef	SMT_PANIC
    658#define	SMT_PANIC(smc,nr,msg)	smt_panic (smc, msg)
    659#endif
    660
    661#ifndef	SMT_ERR_LOG
    662#define	SMT_ERR_LOG(smc,nr,msg)	SMT_PANIC (smc, nr, msg)
    663#endif
    664
    665#ifndef	SMT_EBASE
    666#define	SMT_EBASE	100
    667#endif
    668
    669#define	SMT_E0100	SMT_EBASE + 0
    670#define	SMT_E0100_MSG	"cfm FSM: invalid ce_type"
    671#define	SMT_E0101	SMT_EBASE + 1
    672#define	SMT_E0101_MSG	"CEM: case ???"
    673#define	SMT_E0102	SMT_EBASE + 2
    674#define	SMT_E0102_MSG	"CEM A: invalid state"
    675#define	SMT_E0103	SMT_EBASE + 3
    676#define	SMT_E0103_MSG	"CEM B: invalid state"
    677#define	SMT_E0104	SMT_EBASE + 4
    678#define	SMT_E0104_MSG	"CEM M: invalid state"
    679#define	SMT_E0105	SMT_EBASE + 5
    680#define	SMT_E0105_MSG	"CEM S: invalid state"
    681#define	SMT_E0106	SMT_EBASE + 6
    682#define	SMT_E0106_MSG	"CFM : invalid state"
    683#define	SMT_E0107	SMT_EBASE + 7
    684#define	SMT_E0107_MSG	"ECM : invalid state"
    685#define	SMT_E0108	SMT_EBASE + 8
    686#define	SMT_E0108_MSG	"prop_actions : NAC in DAS CFM"
    687#define	SMT_E0109	SMT_EBASE + 9
    688#define	SMT_E0109_MSG	"ST2U.FM_SERRSF error in special frame"
    689#define	SMT_E0110	SMT_EBASE + 10
    690#define	SMT_E0110_MSG	"ST2U.FM_SRFRCTOV recv. count. overflow"
    691#define	SMT_E0111	SMT_EBASE + 11
    692#define	SMT_E0111_MSG	"ST2U.FM_SNFSLD NP & FORMAC simult. load"
    693#define	SMT_E0112	SMT_EBASE + 12
    694#define	SMT_E0112_MSG	"ST2U.FM_SRCVFRM single-frame recv.-mode"
    695#define	SMT_E0113	SMT_EBASE + 13
    696#define	SMT_E0113_MSG	"FPLUS: Buffer Memory Error"
    697#define	SMT_E0114	SMT_EBASE + 14
    698#define	SMT_E0114_MSG	"ST2U.FM_SERRSF error in special frame"
    699#define	SMT_E0115	SMT_EBASE + 15
    700#define	SMT_E0115_MSG	"ST3L: parity error in receive queue 2"
    701#define	SMT_E0116	SMT_EBASE + 16
    702#define	SMT_E0116_MSG	"ST3L: parity error in receive queue 1"
    703#define	SMT_E0117	SMT_EBASE + 17
    704#define	SMT_E0117_MSG	"E_SMT_001: RxD count for receive queue 1 = 0"
    705#define	SMT_E0118	SMT_EBASE + 18
    706#define	SMT_E0118_MSG	"PCM : invalid state"
    707#define	SMT_E0119	SMT_EBASE + 19
    708#define	SMT_E0119_MSG	"smt_add_para"
    709#define	SMT_E0120	SMT_EBASE + 20
    710#define	SMT_E0120_MSG	"smt_set_para"
    711#define	SMT_E0121	SMT_EBASE + 21
    712#define	SMT_E0121_MSG	"invalid event in dispatcher"
    713#define	SMT_E0122	SMT_EBASE + 22
    714#define	SMT_E0122_MSG	"RMT : invalid state"
    715#define	SMT_E0123	SMT_EBASE + 23
    716#define	SMT_E0123_MSG	"SBA: state machine has invalid state"
    717#define	SMT_E0124	SMT_EBASE + 24
    718#define	SMT_E0124_MSG	"sba_free_session() called with NULL pointer"
    719#define	SMT_E0125	SMT_EBASE + 25
    720#define	SMT_E0125_MSG	"SBA : invalid session pointer"
    721#define	SMT_E0126	SMT_EBASE + 26
    722#define	SMT_E0126_MSG	"smt_free_mbuf() called with NULL pointer\n"
    723#define	SMT_E0127	SMT_EBASE + 27
    724#define	SMT_E0127_MSG	"sizeof evcs"
    725#define	SMT_E0128	SMT_EBASE + 28
    726#define	SMT_E0128_MSG	"evc->evc_cond_state = 0"
    727#define	SMT_E0129	SMT_EBASE + 29
    728#define	SMT_E0129_MSG	"evc->evc_multiple = 0"
    729#define	SMT_E0130	SMT_EBASE + 30
    730#define	SMT_E0130_MSG	write_mdr_warning
    731#define	SMT_E0131	SMT_EBASE + 31
    732#define	SMT_E0131_MSG	cam_warning
    733#define SMT_E0132	SMT_EBASE + 32
    734#define SMT_E0132_MSG	"ST1L.FM_SPCEPDx parity/coding error"
    735#define SMT_E0133	SMT_EBASE + 33
    736#define SMT_E0133_MSG	"ST1L.FM_STBURx tx buffer underrun"
    737#define SMT_E0134	SMT_EBASE + 34
    738#define SMT_E0134_MSG	"ST1L.FM_SPCEPDx parity error"
    739#define SMT_E0135	SMT_EBASE + 35
    740#define SMT_E0135_MSG	"RMT: duplicate MAC address detected. Ring left!"
    741#define SMT_E0136	SMT_EBASE + 36
    742#define SMT_E0136_MSG	"Elasticity Buffer hang-up"
    743#define SMT_E0137	SMT_EBASE + 37
    744#define SMT_E0137_MSG	"SMT: queue overrun"
    745#define SMT_E0138	SMT_EBASE + 38
    746#define SMT_E0138_MSG	"RMT: duplicate MAC address detected. Ring NOT left!"
    747#endif	/* _CMTDEF_ */