treewide: remove redundant IS_ERR() before error code check
[linux/fpc-iii.git] / drivers / net / fddi / skfp / smtinit.c
blob01f6c75cbea81d014302b99398b0531e166ca052
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 #ifndef lint
23 static const char ID_sccs[] = "@(#)smtinit.c 1.15 97/05/06 (C) SK " ;
24 #endif
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;
31 #endif
33 #ifndef MULT_OEM
34 #define OEMID(smc,i) oem_id[i]
35 extern u_char oem_id[] ;
36 #else /* MULT_OEM */
37 #define OEMID(smc,i) smc->hw.oem_id->oi_mark[i]
38 extern struct s_oem_ids oem_ids[] ;
39 #endif /* MULT_OEM */
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 ;
51 mib = &smc->mib ;
54 * set IBM specific values
56 if (OEMID(smc,0) == 'I') {
57 mib->fddiSMTConnectionPolicy = POLICY_MM ;
62 * Init SMT
64 int init_smt(struct s_smc *smc, u_char *mac_addr)
65 /* u_char *mac_addr; canonical address or NULL */
67 int p ;
69 #if defined(DEBUG) && !defined(DEBUG_BRD)
70 debug.d_smt = 0 ;
71 debug.d_smtf = 0 ;
72 debug.d_rmt = 0 ;
73 debug.d_ecm = 0 ;
74 debug.d_pcm = 0 ;
75 debug.d_cfm = 0 ;
77 debug.d_plc = 0 ;
78 #ifdef ESS
79 debug.d_ess = 0 ;
80 #endif
81 #ifdef SBA
82 debug.d_sba = 0 ;
83 #endif
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 */
97 #ifndef SLIM_SMT
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 */
119 return 0;