// SPDX-License-Identifier: GPL-2.0-or-later /****************************************************************************** * * (C)Copyright 1998,1999 SysKonnect, * a business unit of Schneider & Koch & Co. Datensysteme GmbH. * * See the file "skfddi.c" for further information. * * The information in this file is provided "AS IS" without warranty. *
******************************************************************************/
/* SMT CFM Configuration Management DAS with single MAC
*/
/* * Hardware independent state machine implemantation * The following external SMT functions are referenced : * * queue_event() * * The following external HW dependent functions are referenced : * config_mux() * * The following HW dependent events are required : * NONE
*/
/* * map from state to downstream port type
*/ staticconstunsignedchar cf_to_ptype[] = {
TNONE,TNONE,TNONE,TNONE,TNONE,
TNONE,TB,TB,TS,
TA,TB,TS,TB
} ;
/* * CEM port states
*/ #define CEM_PST_DOWN 0 #define CEM_PST_UP 1 #define CEM_PST_HOLD 2 /* define portstate array only for A and B port */ /* Do this within the smc structure (use in multiple cards) */
/* * all Globals are defined in smc.h * struct s_cfm
*/
/* * function declarations
*/ staticvoid cfm_fsm(struct s_smc *smc, int cmd);
break; case TB: /* take precedence over PA */
phy->wc_flag = FALSE ; break; case TS:
phy->wc_flag = FALSE ; break; case TM:
phy->wc_flag = FALSE ; break;
}
}
void all_selection_criteria(struct s_smc *smc)
{ struct s_phy *phy ; int p ;
for ( p = 0,phy = smc->y ; p < NUMPHYS; p++, phy++ ) { /* Do the selection criteria */
selection_criteria (smc,phy);
}
}
staticvoid cem_priv_state(struct s_smc *smc, int event) /* State machine for private PORT states: used to optimize dual homing */
{ int np; /* Number of the port */ int i;
/* Do this only in a DAS */ if (smc->s.sas != SMT_DAS ) return ;
np = event - CF_JOIN;
if (np != PA && np != PB) { return ;
} /* Change the port state according to the event (portnumber) */ if (smc->y[np].cf_join) {
smc->y[np].cem_pst = CEM_PST_UP ;
} elseif (!smc->y[np].wc_flag) { /* set the port to done only if it is not withheld */
smc->y[np].cem_pst = CEM_PST_DOWN ;
}
/* Don't set an hold port to down */
/* Check all ports of restart conditions */ for (i = 0 ; i < 2 ; i ++ ) { /* Check all port for PORT is on hold and no withhold is done */ if ( smc->y[i].cem_pst == CEM_PST_HOLD && !smc->y[i].wc_flag ) {
smc->y[i].cem_pst = CEM_PST_DOWN;
queue_event(smc,(int)(EVENT_PCM+i),PC_START) ;
} if ( smc->y[i].cem_pst == CEM_PST_UP && smc->y[i].wc_flag ) {
smc->y[i].cem_pst = CEM_PST_HOLD;
queue_event(smc,(int)(EVENT_PCM+i),PC_START) ;
} if ( smc->y[i].cem_pst == CEM_PST_DOWN && smc->y[i].wc_flag ) { /* * The port must be restarted when the wc_flag * will be reset. So set the port on hold.
*/
smc->y[i].cem_pst = CEM_PST_HOLD;
}
} return ;
}
/* CFM state machine called by dispatcher
do display state change process event until SM is stable
*/ void cfm(struct s_smc *smc, int event)
{ int state ; /* remember last state */ int cond ;
/* We will do the following: */ /* - compute the variable WC_Flag for every port (This is where */ /* we can extend the requested path checking !!) */ /* - do the old (SMT 6.2 like) state machine */ /* - do the resulting station states */
all_selection_criteria (smc);
/* We will check now whether a state transition is allowed or not */ /* - change the portstates */
cem_priv_state (smc, event);
do {
DB_CFM("CFM : state %s%s event %s",
smc->mib.fddiSMTCF_State & AFLAG ? "ACTIONS " : "",
cfm_states[smc->mib.fddiSMTCF_State & ~AFLAG],
cfm_events[event]);
state = smc->mib.fddiSMTCF_State ;
cfm_fsm(smc,event) ;
event = 0 ;
} while (state != smc->mib.fddiSMTCF_State) ;
/* * Don't ever send MAC_PATH_CHANGE events. Our MAC is hard-wired * to the primary path.
*/
#endif/* no SLIM_SMT */
/* * set MAC port type
*/
smc->mib.m[MAC0].fddiMACDownstreamPORTType =
cf_to_ptype[smc->mib.fddiSMTCF_State] ;
cfm_state_change(smc,(int)smc->mib.fddiSMTCF_State) ;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.