Lines Matching refs:smc
47 #define GO_STATE(x) (smc->mib.fddiSMTECMState = (x)|AFLAG)
48 #define ACTIONS_DONE() (smc->mib.fddiSMTECMState &= ~AFLAG)
86 static void ecm_fsm(struct s_smc *smc, int cmd);
87 static void start_ecm_timer(struct s_smc *smc, u_long value, int event);
88 static void stop_ecm_timer(struct s_smc *smc);
89 static void prop_actions(struct s_smc *smc);
95 void ecm_init(struct s_smc *smc) in ecm_init() argument
97 smc->e.path_test = PT_PASSED ; in ecm_init()
98 smc->e.trace_prop = 0 ; in ecm_init()
99 smc->e.sb_flag = 0 ; in ecm_init()
100 smc->mib.fddiSMTECMState = ACTIONS(EC0_OUT) ; in ecm_init()
101 smc->e.ecm_line_state = FALSE ; in ecm_init()
113 void ecm(struct s_smc *smc, int event) in ecm() argument
119 smc->mib.fddiSMTECMState & AFLAG ? "ACTIONS " : "", in ecm()
120 ecm_states[smc->mib.fddiSMTECMState & ~AFLAG], in ecm()
122 state = smc->mib.fddiSMTECMState ; in ecm()
123 ecm_fsm(smc,event) ; in ecm()
125 } while (state != smc->mib.fddiSMTECMState) ; in ecm()
126 ecm_state_change(smc,(int)smc->mib.fddiSMTECMState) ; in ecm()
132 static void ecm_fsm(struct s_smc *smc, int cmd) in ecm_fsm() argument
139 smc->mib.fddiSMTBypassPresent = sm_pm_bypass_present(smc) ; in ecm_fsm()
141 smc->mib.fddiSMTRemoteDisconnectFlag = FALSE ; in ecm_fsm()
146 smc->mib.fddiSMTRemoteDisconnectFlag == TRUE) { in ecm_fsm()
147 AIX_EVENT (smc, (u_long) CIO_HARD_FAIL, (u_long) in ecm_fsm()
148 FDDI_REMOTE_DISCONNECT, smt_get_event_word(smc), in ecm_fsm()
149 smt_get_error_word(smc) ); in ecm_fsm()
154 smc->e.DisconnectFlag = FALSE ; in ecm_fsm()
157 smc->e.DisconnectFlag = TRUE ; in ecm_fsm()
160 switch(smc->mib.fddiSMTECMState) { in ecm_fsm()
165 smc->e.path_test = PT_PASSED ; in ecm_fsm()
166 smc->e.ecm_line_state = FALSE ; in ecm_fsm()
167 stop_ecm_timer(smc) ; in ecm_fsm()
172 if (cmd == EC_CONNECT && !smc->mib.fddiSMTBypassPresent in ecm_fsm()
173 && smc->e.path_test==PT_PASSED) { in ecm_fsm()
178 else if (cmd == EC_CONNECT && (smc->e.path_test==PT_PASSED) && in ecm_fsm()
179 smc->mib.fddiSMTBypassPresent && in ecm_fsm()
180 (smc->s.sas == SMT_DAS)) { in ecm_fsm()
186 stop_ecm_timer(smc) ; in ecm_fsm()
187 smc->e.trace_prop = 0 ; in ecm_fsm()
188 sm_ma_control(smc,MA_TREQ) ; in ecm_fsm()
190 if (smc->mib.p[p].fddiPORTHardwarePresent) in ecm_fsm()
191 queue_event(smc,EVENT_PCMA+p,PC_START) ; in ecm_fsm()
197 prop_actions(smc) ; in ecm_fsm()
208 start_ecm_timer(smc,MIB2US(smc->mib.fddiSMTTrace_MaxExpiration), in ecm_fsm()
215 prop_actions(smc) ; in ecm_fsm()
221 smc->e.path_test = PT_EXITING ; in ecm_fsm()
226 else if (smc->e.path_test == PT_PENDING) { in ecm_fsm()
234 AIX_EVENT(smc, (u_long) FDDI_RING_STATUS, in ecm_fsm()
236 FDDI_TRACE_MAX, smt_get_error_word(smc)); in ecm_fsm()
237 smc->e.path_test = PT_PENDING ; in ecm_fsm()
243 start_ecm_timer(smc,smc->s.ecm_td_min,EC_TIMEOUT_TD) ; in ecm_fsm()
245 queue_event(smc,EVENT_PCMA+p,PC_STOP) ; in ecm_fsm()
250 if (cmd == EC_TIMEOUT_TD && !smc->mib.fddiSMTBypassPresent && in ecm_fsm()
251 (smc->e.path_test != PT_PENDING)) { in ecm_fsm()
257 (smc->e.path_test == PT_PENDING)) { in ecm_fsm()
262 else if (cmd == EC_CONNECT && smc->e.path_test == PT_PASSED) { in ecm_fsm()
268 smc->e.path_test == PT_PENDING) { in ecm_fsm()
269 smc->e.path_test = PT_EXITING ; in ecm_fsm()
276 smc->mib.fddiSMTBypassPresent && in ecm_fsm()
277 smc->e.path_test != PT_PENDING) { in ecm_fsm()
283 stop_ecm_timer(smc) ; in ecm_fsm()
284 smc->e.path_test = PT_TESTING ; in ecm_fsm()
285 start_ecm_timer(smc,smc->s.ecm_test_done,EC_TEST_DONE) ; in ecm_fsm()
292 smc->e.path_test = PT_PASSED ; in ecm_fsm()
294 if (smc->e.path_test == PT_FAILED) in ecm_fsm()
295 RS_SET(smc,RS_PATHTEST) ; in ecm_fsm()
298 if (smc->e.path_test == PT_FAILED && in ecm_fsm()
299 !smc->mib.fddiSMTBypassPresent) { in ecm_fsm()
305 !smc->mib.fddiSMTBypassPresent) { in ecm_fsm()
310 else if (smc->e.path_test == PT_PASSED) { in ecm_fsm()
315 else if (smc->e.path_test == PT_FAILED && in ecm_fsm()
316 smc->mib.fddiSMTBypassPresent) { in ecm_fsm()
322 smc->mib.fddiSMTBypassPresent) { in ecm_fsm()
328 sm_pm_bypass_req(smc,BP_INSERT); in ecm_fsm()
329 start_ecm_timer(smc,smc->s.ecm_in_max,EC_TIMEOUT_INMAX) ; in ecm_fsm()
349 start_ecm_timer(smc,smc->s.ecm_check_poll,0) ; in ecm_fsm()
350 smc->e.ecm_line_state = TRUE ; /* flag to pcm: report Q/HLS */ in ecm_fsm()
354 ls_a = sm_pm_get_ls(smc,PA) ; in ecm_fsm()
355 ls_b = sm_pm_get_ls(smc,PB) ; in ecm_fsm()
360 smc->e.sb_flag = FALSE ; in ecm_fsm()
361 smc->e.ecm_line_state = FALSE ; in ecm_fsm()
366 else if (!smc->e.sb_flag && in ecm_fsm()
369 smc->e.sb_flag = TRUE ; in ecm_fsm()
371 AIX_EVENT(smc, (u_long) FDDI_RING_STATUS, (u_long) in ecm_fsm()
373 smt_get_error_word(smc)); in ecm_fsm()
377 smc->e.ecm_line_state = FALSE ; in ecm_fsm()
385 start_ecm_timer(smc,smc->s.ecm_check_poll,0) ; in ecm_fsm()
389 sm_pm_bypass_req(smc,BP_DEINSERT); in ecm_fsm()
390 start_ecm_timer(smc,smc->s.ecm_i_max,EC_TIMEOUT_IMAX) ; in ecm_fsm()
400 else if (cmd == EC_CONNECT && smc->e.path_test == PT_PASSED) { in ecm_fsm()
406 SMT_PANIC(smc,SMT_E0107, SMT_E0107_MSG) ; in ecm_fsm()
415 static void prop_actions(struct s_smc *smc) in prop_actions() argument
420 RS_SET(smc,RS_EVENT) ; in prop_actions()
421 switch (smc->s.sas) { in prop_actions()
423 port_in = port_out = pcm_get_s_port(smc) ; in prop_actions()
426 port_in = cfm_get_mac_input(smc) ; /* PA or PB */ in prop_actions()
427 port_out = cfm_get_mac_output(smc) ; /* PA or PB */ in prop_actions()
430 SMT_PANIC(smc,SMT_E0108, SMT_E0108_MSG) ; in prop_actions()
434 DB_ECM("ECM : prop_actions - trace_prop %lu", smc->e.trace_prop); in prop_actions()
437 if (smc->e.trace_prop & ENTITY_BIT(ENTITY_MAC)) { in prop_actions()
440 queue_event(smc,EVENT_PCM+port_in,PC_TRACE) ; in prop_actions()
442 else if ((smc->e.trace_prop & ENTITY_BIT(ENTITY_PHY(PA))) && in prop_actions()
446 queue_event(smc,EVENT_PCMB,PC_TRACE) ; in prop_actions()
448 else if ((smc->e.trace_prop & ENTITY_BIT(ENTITY_PHY(PB))) && in prop_actions()
452 queue_event(smc,EVENT_PCMA,PC_TRACE) ; in prop_actions()
457 smc->e.path_test = PT_PENDING ; in prop_actions()
459 smc->e.trace_prop = 0 ; in prop_actions()
465 static void prop_actions(struct s_smc *smc) in prop_actions() argument
471 RS_SET(smc,RS_EVENT) ; in prop_actions()
472 while (smc->e.trace_prop) { in prop_actions()
474 smc->e.trace_prop); in prop_actions()
476 if (smc->e.trace_prop & ENTITY_BIT(ENTITY_MAC)) { in prop_actions()
478 smc->e.trace_prop &= ~ENTITY_BIT(ENTITY_MAC) ; in prop_actions()
483 if (smc->e.trace_prop & in prop_actions()
488 smc->e.trace_prop &= ~ENTITY_BIT(ENTITY_PHY(p)) ; in prop_actions()
490 upstream = cem_get_upstream(smc,initiator) ; in prop_actions()
495 smc->e.path_test = PT_PENDING ; in prop_actions()
500 queue_event(smc,EVENT_PCM+upstream,PC_TRACE) ; in prop_actions()
511 static void start_ecm_timer(struct s_smc *smc, u_long value, int event) in start_ecm_timer() argument
513 smt_timer_start(smc,&smc->e.ecm_timer,value,EV_TOKEN(EVENT_ECM,event)); in start_ecm_timer()
520 static void stop_ecm_timer(struct s_smc *smc) in stop_ecm_timer() argument
522 if (smc->e.ecm_timer.tm_active) in stop_ecm_timer()
523 smt_timer_stop(smc,&smc->e.ecm_timer) ; in stop_ecm_timer()