1 // SPDX-License-Identifier: GPL-2.0-or-later
2 /******************************************************************************
4 * (C)Copyright 1998,1999 SysKonnect,
5 * a business unit of Schneider & Koch & Co. Datensysteme GmbH.
7 * See the file "skfddi.c" for further information.
9 * The information in this file is provided "AS IS" without warranty.
11 ******************************************************************************/
15 call all module level initialization routines
23 static const char ID_sccs
[] = "@(#)smtinit.c 1.15 97/05/06 (C) SK " ;
26 void init_fddi_driver(struct s_smc
*smc
, u_char
*mac_addr
);
28 /* define global debug variable */
29 #if defined(DEBUG) && !defined(DEBUG_BRD)
30 struct smt_debug debug
;
34 #define OEMID(smc,i) oem_id[i]
35 extern u_char oem_id
[] ;
37 #define OEMID(smc,i) smc->hw.oem_id->oi_mark[i]
38 extern struct s_oem_ids oem_ids
[] ;
42 * Set OEM specific values
44 * Can not be called in smt_reset_defaults, because it is not sure that
45 * the OEM ID is already defined.
47 static void set_oem_spec_val(struct s_smc
*smc
)
49 struct fddi_mib
*mib
;
54 * set IBM specific values
56 if (OEMID(smc
,0) == 'I') {
57 mib
->fddiSMTConnectionPolicy
= POLICY_MM
;
64 int init_smt(struct s_smc
*smc
, u_char
*mac_addr
)
65 /* u_char *mac_addr; canonical address or NULL */
69 #if defined(DEBUG) && !defined(DEBUG_BRD)
84 #endif /* DEBUG && !DEBUG_BRD */
86 /* First initialize the ports mib->pointers */
87 for ( p
= 0; p
< NUMPHYS
; p
++ ) {
88 smc
->y
[p
].mib
= & smc
->mib
.p
[p
] ;
91 set_oem_spec_val(smc
) ;
92 (void) smt_set_mac_opvalues(smc
) ;
93 init_fddi_driver(smc
,mac_addr
) ; /* HW driver */
94 smt_fixup_mib(smc
) ; /* update values that depend on s.sas */
96 ev_init(smc
) ; /* event queue */
98 smt_init_evc(smc
) ; /* evcs in MIB */
99 #endif /* no SLIM_SMT */
100 smt_timer_init(smc
) ; /* timer package */
101 smt_agent_init(smc
) ; /* SMT frame manager */
103 pcm_init(smc
) ; /* PCM state machine */
104 ecm_init(smc
) ; /* ECM state machine */
105 cfm_init(smc
) ; /* CFM state machine */
106 rmt_init(smc
) ; /* RMT state machine */
108 for (p
= 0 ; p
< NUMPHYS
; p
++) {
109 pcm(smc
,p
,0) ; /* PCM A state machine */
111 ecm(smc
,0) ; /* ECM state machine */
112 cfm(smc
,0) ; /* CFM state machine */
113 rmt(smc
,0) ; /* RMT state machine */
115 smt_agent_task(smc
) ; /* NIF FSM etc */
117 PNMI_INIT(smc
) ; /* PNMI initialization */