Lines Matching +full:ps +full:- +full:hold

1 // SPDX-License-Identifier: GPL-2.0-or-later
43 #define GO_STATE(x) (smc->mib.fddiSMTCF_State = (x)|AFLAG)
44 #define ACTIONS_DONE() (smc->mib.fddiSMTCF_State &= ~AFLAG)
97 smc->mib.fddiSMTCF_State = ACTIONS(SC0_ISOLATED) ; in cfm_init()
98 smc->r.rm_join = 0 ; in cfm_init()
99 smc->r.rm_loop = 0 ; in cfm_init()
100 smc->y[PA].scrub = 0 ; in cfm_init()
101 smc->y[PB].scrub = 0 ; in cfm_init()
102 smc->y[PA].cem_pst = CEM_PST_DOWN ; in cfm_init()
103 smc->y[PB].cem_pst = CEM_PST_DOWN ; in cfm_init()
107 #define THRU_ENABLED(smc) (smc->y[PA].pc_mode != PM_TREE && \
108 smc->y[PB].pc_mode != PM_TREE)
113 switch (phy->mib->fddiPORTMy_Type) { in selection_criteria()
115 if ( !THRU_ENABLED(smc) && smc->y[PB].cf_join ) { in selection_criteria()
116 phy->wc_flag = TRUE ; in selection_criteria()
118 phy->wc_flag = FALSE ; in selection_criteria()
124 phy->wc_flag = FALSE ; in selection_criteria()
127 phy->wc_flag = FALSE ; in selection_criteria()
130 phy->wc_flag = FALSE ; in selection_criteria()
141 for ( p = 0,phy = smc->y ; p < NUMPHYS; p++, phy++ ) { in all_selection_criteria()
154 if (smc->s.sas != SMT_DAS ) in cem_priv_state()
157 np = event - CF_JOIN; in cem_priv_state()
163 if (smc->y[np].cf_join) { in cem_priv_state()
164 smc->y[np].cem_pst = CEM_PST_UP ; in cem_priv_state()
165 } else if (!smc->y[np].wc_flag) { in cem_priv_state()
167 smc->y[np].cem_pst = CEM_PST_DOWN ; in cem_priv_state()
170 /* Don't set an hold port to down */ in cem_priv_state()
174 /* Check all port for PORT is on hold and no withhold is done */ in cem_priv_state()
175 if ( smc->y[i].cem_pst == CEM_PST_HOLD && !smc->y[i].wc_flag ) { in cem_priv_state()
176 smc->y[i].cem_pst = CEM_PST_DOWN; in cem_priv_state()
179 if ( smc->y[i].cem_pst == CEM_PST_UP && smc->y[i].wc_flag ) { in cem_priv_state()
180 smc->y[i].cem_pst = CEM_PST_HOLD; in cem_priv_state()
183 if ( smc->y[i].cem_pst == CEM_PST_DOWN && smc->y[i].wc_flag ) { in cem_priv_state()
186 * will be reset. So set the port on hold. in cem_priv_state()
188 smc->y[i].cem_pst = CEM_PST_HOLD; in cem_priv_state()
209 /* - compute the variable WC_Flag for every port (This is where */ in cfm()
211 /* - do the old (SMT 6.2 like) state machine */ in cfm()
212 /* - do the resulting station states */ in cfm()
217 /* - change the portstates */ in cfm()
222 smc->mib.fddiSMTCF_State & AFLAG ? "ACTIONS " : "", in cfm()
223 cfm_states[smc->mib.fddiSMTCF_State & ~AFLAG], in cfm()
225 state = smc->mib.fddiSMTCF_State ; in cfm()
228 } while (state != smc->mib.fddiSMTCF_State) ; in cfm()
235 if ( (smc->mib.fddiSMTCF_State == SC9_C_WRAP_A && in cfm()
236 smc->y[PA].pc_mode == PM_PEER) || in cfm()
237 (smc->mib.fddiSMTCF_State == SC10_C_WRAP_B && in cfm()
238 smc->y[PB].pc_mode == PM_PEER) || in cfm()
239 (smc->mib.fddiSMTCF_State == SC11_C_WRAP_S && in cfm()
240 smc->y[PS].pc_mode == PM_PEER && in cfm()
241 smc->y[PS].mib->fddiPORTNeighborType != TS ) ) { in cfm()
244 if (cond != smc->mib.fddiSMTPeerWrapFlag) in cfm()
248 * Don't ever send MAC_PATH_CHANGE events. Our MAC is hard-wired in cfm()
257 smc->mib.m[MAC0].fddiMACDownstreamPORTType = in cfm()
258 cf_to_ptype[smc->mib.fddiSMTCF_State] ; in cfm()
259 cfm_state_change(smc,(int)smc->mib.fddiSMTCF_State) ; in cfm()
268 switch(smc->mib.fddiSMTCF_State) { in cfm_fsm()
270 smc->mib.p[PA].fddiPORTCurrentPath = MIB_PATH_ISOLATED ; in cfm_fsm()
271 smc->mib.p[PB].fddiPORTCurrentPath = MIB_PATH_ISOLATED ; in cfm_fsm()
272 smc->mib.p[PA].fddiPORTMACPlacement = 0 ; in cfm_fsm()
273 smc->mib.p[PB].fddiPORTMACPlacement = 0 ; in cfm_fsm()
274 smc->mib.fddiSMTStationStatus = MIB_SMT_STASTA_SEPA ; in cfm_fsm()
276 smc->r.rm_loop = FALSE ; in cfm_fsm()
277 smc->r.rm_join = FALSE ; in cfm_fsm()
279 /* Don't do the WC-Flag changing here */ in cfm_fsm()
281 DB_CFMN(1, "CFM : %s", cfm_states[smc->mib.fddiSMTCF_State]); in cfm_fsm()
286 if (smc->s.sas && (smc->y[PA].cf_join || smc->y[PA].cf_loop || in cfm_fsm()
287 smc->y[PB].cf_join || smc->y[PB].cf_loop)) { in cfm_fsm()
292 if ((smc->y[PA].cem_pst == CEM_PST_UP && smc->y[PA].cf_join && in cfm_fsm()
293 !smc->y[PA].wc_flag) || smc->y[PA].cf_loop) { in cfm_fsm()
298 if ((smc->y[PB].cem_pst == CEM_PST_UP && smc->y[PB].cf_join && in cfm_fsm()
299 !smc->y[PB].wc_flag) || smc->y[PB].cf_loop) { in cfm_fsm()
305 smc->mib.p[PA].fddiPORTCurrentPath = MIB_PATH_CONCATENATED ; in cfm_fsm()
306 smc->mib.p[PB].fddiPORTCurrentPath = MIB_PATH_ISOLATED ; in cfm_fsm()
307 smc->mib.p[PA].fddiPORTMACPlacement = INDEX_MAC ; in cfm_fsm()
308 smc->mib.p[PB].fddiPORTMACPlacement = 0 ; in cfm_fsm()
309 smc->mib.fddiSMTStationStatus = MIB_SMT_STASTA_CON ; in cfm_fsm()
311 if (smc->y[PA].cf_loop) { in cfm_fsm()
312 smc->r.rm_join = FALSE ; in cfm_fsm()
313 smc->r.rm_loop = TRUE ; in cfm_fsm()
316 if (smc->y[PA].cf_join) { in cfm_fsm()
317 smc->r.rm_loop = FALSE ; in cfm_fsm()
318 smc->r.rm_join = TRUE ; in cfm_fsm()
322 DB_CFMN(1, "CFM : %s", cfm_states[smc->mib.fddiSMTCF_State]); in cfm_fsm()
326 if ( (smc->y[PA].wc_flag || !smc->y[PA].cf_join) && in cfm_fsm()
327 !smc->y[PA].cf_loop ) { in cfm_fsm()
332 else if ( (smc->y[PB].cf_loop && smc->y[PA].cf_join && in cfm_fsm()
333 smc->y[PA].cem_pst == CEM_PST_UP) || in cfm_fsm()
334 ((smc->y[PB].cf_loop || in cfm_fsm()
335 (smc->y[PB].cf_join && in cfm_fsm()
336 smc->y[PB].cem_pst == CEM_PST_UP)) && in cfm_fsm()
337 (smc->y[PA].pc_mode == PM_TREE || in cfm_fsm()
338 smc->y[PB].pc_mode == PM_TREE))) { in cfm_fsm()
339 smc->y[PA].scrub = TRUE ; in cfm_fsm()
344 else if (!smc->s.attach_s && in cfm_fsm()
345 smc->y[PA].cf_join && in cfm_fsm()
346 smc->y[PA].cem_pst == CEM_PST_UP && in cfm_fsm()
347 smc->y[PA].pc_mode == PM_PEER && smc->y[PB].cf_join && in cfm_fsm()
348 smc->y[PB].cem_pst == CEM_PST_UP && in cfm_fsm()
349 smc->y[PB].pc_mode == PM_PEER) { in cfm_fsm()
350 smc->y[PA].scrub = TRUE ; in cfm_fsm()
351 smc->y[PB].scrub = TRUE ; in cfm_fsm()
356 else if ( smc->s.attach_s && in cfm_fsm()
357 smc->y[PA].cf_join && in cfm_fsm()
358 smc->y[PA].cem_pst == CEM_PST_UP && in cfm_fsm()
359 smc->y[PA].pc_mode == PM_PEER && in cfm_fsm()
360 smc->y[PB].cf_join && in cfm_fsm()
361 smc->y[PB].cem_pst == CEM_PST_UP && in cfm_fsm()
362 smc->y[PB].pc_mode == PM_PEER) { in cfm_fsm()
363 smc->y[PA].scrub = TRUE ; in cfm_fsm()
364 smc->y[PB].scrub = TRUE ; in cfm_fsm()
370 smc->mib.p[PA].fddiPORTCurrentPath = MIB_PATH_ISOLATED ; in cfm_fsm()
371 smc->mib.p[PB].fddiPORTCurrentPath = MIB_PATH_CONCATENATED ; in cfm_fsm()
372 smc->mib.p[PA].fddiPORTMACPlacement = 0 ; in cfm_fsm()
373 smc->mib.p[PB].fddiPORTMACPlacement = INDEX_MAC ; in cfm_fsm()
374 smc->mib.fddiSMTStationStatus = MIB_SMT_STASTA_CON ; in cfm_fsm()
376 if (smc->y[PB].cf_loop) { in cfm_fsm()
377 smc->r.rm_join = FALSE ; in cfm_fsm()
378 smc->r.rm_loop = TRUE ; in cfm_fsm()
381 if (smc->y[PB].cf_join) { in cfm_fsm()
382 smc->r.rm_loop = FALSE ; in cfm_fsm()
383 smc->r.rm_join = TRUE ; in cfm_fsm()
387 DB_CFMN(1, "CFM : %s", cfm_states[smc->mib.fddiSMTCF_State]); in cfm_fsm()
391 if ( !smc->y[PB].cf_join && !smc->y[PB].cf_loop ) { in cfm_fsm()
396 else if ( smc->y[PA].cf_loop && smc->y[PA].pc_mode == PM_PEER && in cfm_fsm()
397 smc->y[PB].cf_join && smc->y[PB].pc_mode == PM_PEER) { in cfm_fsm()
398 smc->y[PB].scrub = TRUE ; in cfm_fsm()
403 else if (!smc->s.attach_s && in cfm_fsm()
404 smc->y[PA].cf_join && smc->y[PA].pc_mode == PM_PEER && in cfm_fsm()
405 smc->y[PB].cf_join && smc->y[PB].pc_mode == PM_PEER) { in cfm_fsm()
406 smc->y[PA].scrub = TRUE ; in cfm_fsm()
407 smc->y[PB].scrub = TRUE ; in cfm_fsm()
412 else if ( smc->s.attach_s && in cfm_fsm()
413 smc->y[PA].cf_join && smc->y[PA].pc_mode == PM_PEER && in cfm_fsm()
414 smc->y[PB].cf_join && smc->y[PB].pc_mode == PM_PEER) { in cfm_fsm()
415 smc->y[PA].scrub = TRUE ; in cfm_fsm()
416 smc->y[PB].scrub = TRUE ; in cfm_fsm()
422 smc->mib.p[PA].fddiPORTCurrentPath = MIB_PATH_THRU ; in cfm_fsm()
423 smc->mib.p[PB].fddiPORTCurrentPath = MIB_PATH_THRU ; in cfm_fsm()
424 smc->mib.p[PA].fddiPORTMACPlacement = 0 ; in cfm_fsm()
425 smc->mib.p[PB].fddiPORTMACPlacement = INDEX_MAC ; in cfm_fsm()
426 smc->mib.fddiSMTStationStatus = MIB_SMT_STASTA_THRU ; in cfm_fsm()
428 smc->r.rm_loop = FALSE ; in cfm_fsm()
429 smc->r.rm_join = TRUE ; in cfm_fsm()
432 DB_CFMN(1, "CFM : %s", cfm_states[smc->mib.fddiSMTCF_State]); in cfm_fsm()
436 if (smc->y[PB].wc_flag || !smc->y[PB].cf_join) { in cfm_fsm()
437 smc->y[PA].scrub = TRUE ; in cfm_fsm()
442 else if (!smc->y[PA].cf_join || smc->y[PA].wc_flag) { in cfm_fsm()
443 smc->y[PB].scrub = TRUE ; in cfm_fsm()
448 else if (smc->s.attach_s) { in cfm_fsm()
449 smc->y[PB].scrub = TRUE ; in cfm_fsm()
455 smc->mib.p[PA].fddiPORTCurrentPath = MIB_PATH_THRU ; in cfm_fsm()
456 smc->mib.p[PB].fddiPORTCurrentPath = MIB_PATH_THRU ; in cfm_fsm()
457 smc->mib.p[PA].fddiPORTMACPlacement = INDEX_MAC ; in cfm_fsm()
458 smc->mib.p[PB].fddiPORTMACPlacement = 0 ; in cfm_fsm()
459 smc->mib.fddiSMTStationStatus = MIB_SMT_STASTA_THRU ; in cfm_fsm()
461 smc->r.rm_loop = FALSE ; in cfm_fsm()
462 smc->r.rm_join = TRUE ; in cfm_fsm()
465 DB_CFMN(1, "CFM : %s", cfm_states[smc->mib.fddiSMTCF_State]); in cfm_fsm()
469 if (!smc->y[PB].cf_join || smc->y[PB].wc_flag) { in cfm_fsm()
470 smc->y[PA].scrub = TRUE ; in cfm_fsm()
475 else if (!smc->y[PA].cf_join || smc->y[PA].wc_flag) { in cfm_fsm()
476 smc->y[PB].scrub = TRUE ; in cfm_fsm()
481 else if (!smc->s.attach_s) { in cfm_fsm()
482 smc->y[PA].scrub = TRUE ; in cfm_fsm()
488 smc->mib.p[PS].fddiPORTCurrentPath = MIB_PATH_CONCATENATED ; in cfm_fsm()
489 smc->mib.p[PS].fddiPORTMACPlacement = INDEX_MAC ; in cfm_fsm()
490 smc->mib.fddiSMTStationStatus = MIB_SMT_STASTA_CON ; in cfm_fsm()
492 if (smc->y[PA].cf_loop || smc->y[PB].cf_loop) { in cfm_fsm()
493 smc->r.rm_join = FALSE ; in cfm_fsm()
494 smc->r.rm_loop = TRUE ; in cfm_fsm()
497 if (smc->y[PA].cf_join || smc->y[PB].cf_join) { in cfm_fsm()
498 smc->r.rm_loop = FALSE ; in cfm_fsm()
499 smc->r.rm_join = TRUE ; in cfm_fsm()
503 DB_CFMN(1, "CFM : %s", cfm_states[smc->mib.fddiSMTCF_State]); in cfm_fsm()
507 if ( !smc->y[PA].cf_join && !smc->y[PA].cf_loop && in cfm_fsm()
508 !smc->y[PB].cf_join && !smc->y[PB].cf_loop) { in cfm_fsm()
526 return (smc->mib.fddiSMTCF_State == SC10_C_WRAP_B || in cfm_get_mac_input()
527 smc->mib.fddiSMTCF_State == SC5_THRU_B) ? PB : PA; in cfm_get_mac_input()
537 return (smc->mib.fddiSMTCF_State == SC10_C_WRAP_B || in cfm_get_mac_output()
538 smc->mib.fddiSMTCF_State == SC4_THRU_A) ? PB : PA; in cfm_get_mac_output()
566 0,0, 0,RES_PORT, 0,PS + INDEX_PORT, 0,PATH_PRIM,
571 0,0, 0,RES_PORT, 0,PS + INDEX_PORT, 0,PATH_ISO,
580 switch (smc->mib.fddiSMTCF_State) { in cem_build_path()
583 path = smc->s.sas ? path_iso_s : path_iso ; in cem_build_path()
584 len = smc->s.sas ? sizeof(path_iso_s) : sizeof(path_iso) ; in cem_build_path()