WIP FPC-III support
[linux/fpc-iii.git] / drivers / net / fddi / skfp / smtinit.c
blobc9898c83fe30452e4e0748c48a636c377f74607f
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 ******************************************************************************/
14 Init SMT
15 call all module level initialization routines
18 #include "h/types.h"
19 #include "h/fddi.h"
20 #include "h/smc.h"
22 void init_fddi_driver(struct s_smc *smc, u_char *mac_addr);
24 /* define global debug variable */
25 #if defined(DEBUG) && !defined(DEBUG_BRD)
26 struct smt_debug debug;
27 #endif
29 #ifndef MULT_OEM
30 #define OEMID(smc,i) oem_id[i]
31 extern u_char oem_id[] ;
32 #else /* MULT_OEM */
33 #define OEMID(smc,i) smc->hw.oem_id->oi_mark[i]
34 extern struct s_oem_ids oem_ids[] ;
35 #endif /* MULT_OEM */
38 * Set OEM specific values
40 * Can not be called in smt_reset_defaults, because it is not sure that
41 * the OEM ID is already defined.
43 static void set_oem_spec_val(struct s_smc *smc)
45 struct fddi_mib *mib ;
47 mib = &smc->mib ;
50 * set IBM specific values
52 if (OEMID(smc,0) == 'I') {
53 mib->fddiSMTConnectionPolicy = POLICY_MM ;
58 * Init SMT
60 int init_smt(struct s_smc *smc, u_char *mac_addr)
61 /* u_char *mac_addr; canonical address or NULL */
63 int p ;
65 #if defined(DEBUG) && !defined(DEBUG_BRD)
66 debug.d_smt = 0 ;
67 debug.d_smtf = 0 ;
68 debug.d_rmt = 0 ;
69 debug.d_ecm = 0 ;
70 debug.d_pcm = 0 ;
71 debug.d_cfm = 0 ;
73 debug.d_plc = 0 ;
74 #ifdef ESS
75 debug.d_ess = 0 ;
76 #endif
77 #ifdef SBA
78 debug.d_sba = 0 ;
79 #endif
80 #endif /* DEBUG && !DEBUG_BRD */
82 /* First initialize the ports mib->pointers */
83 for ( p = 0; p < NUMPHYS; p ++ ) {
84 smc->y[p].mib = & smc->mib.p[p] ;
87 set_oem_spec_val(smc) ;
88 (void) smt_set_mac_opvalues(smc) ;
89 init_fddi_driver(smc,mac_addr) ; /* HW driver */
90 smt_fixup_mib(smc) ; /* update values that depend on s.sas */
92 ev_init(smc) ; /* event queue */
93 #ifndef SLIM_SMT
94 smt_init_evc(smc) ; /* evcs in MIB */
95 #endif /* no SLIM_SMT */
96 smt_timer_init(smc) ; /* timer package */
97 smt_agent_init(smc) ; /* SMT frame manager */
99 pcm_init(smc) ; /* PCM state machine */
100 ecm_init(smc) ; /* ECM state machine */
101 cfm_init(smc) ; /* CFM state machine */
102 rmt_init(smc) ; /* RMT state machine */
104 for (p = 0 ; p < NUMPHYS ; p++) {
105 pcm(smc,p,0) ; /* PCM A state machine */
107 ecm(smc,0) ; /* ECM state machine */
108 cfm(smc,0) ; /* CFM state machine */
109 rmt(smc,0) ; /* RMT state machine */
111 smt_agent_task(smc) ; /* NIF FSM etc */
113 PNMI_INIT(smc) ; /* PNMI initialization */
115 return 0;