#include "h/types.h"
#include "h/fddi.h"
#include "h/smc.h"
#define KERNEL
#include "h/smtstate.h"
#define AFLAG …
#define GO_STATE(x) …
#define ACTIONS_DONE() …
#define ACTIONS(x) …
#define EC0_OUT …
#define EC1_IN …
#define EC2_TRACE …
#define EC3_LEAVE …
#define EC4_PATH_TEST …
#define EC5_INSERT …
#define EC6_CHECK …
#define EC7_DEINSERT …
static const char * const ecm_states[] = … ;
static const char * const ecm_events[] = … ;
static void ecm_fsm(struct s_smc *smc, int cmd);
static void start_ecm_timer(struct s_smc *smc, u_long value, int event);
static void stop_ecm_timer(struct s_smc *smc);
static void prop_actions(struct s_smc *smc);
void ecm_init(struct s_smc *smc)
{ … }
void ecm(struct s_smc *smc, int event)
{ … }
static void ecm_fsm(struct s_smc *smc, int cmd)
{ … }
#ifndef CONCENTRATOR
static void prop_actions(struct s_smc *smc)
{ … }
#else
static void prop_actions(struct s_smc *smc)
{
int initiator ;
int upstream ;
int p ;
RS_SET(smc,RS_EVENT) ;
while (smc->e.trace_prop) {
DB_ECM("ECM : prop_actions - trace_prop %d",
smc->e.trace_prop);
if (smc->e.trace_prop & ENTITY_BIT(ENTITY_MAC)) {
initiator = ENTITY_MAC ;
smc->e.trace_prop &= ~ENTITY_BIT(ENTITY_MAC) ;
DB_ECM("ECM: MAC initiates trace");
}
else {
for (p = NUMPHYS-1 ; p >= 0 ; p--) {
if (smc->e.trace_prop &
ENTITY_BIT(ENTITY_PHY(p)))
break ;
}
initiator = ENTITY_PHY(p) ;
smc->e.trace_prop &= ~ENTITY_BIT(ENTITY_PHY(p)) ;
}
upstream = cem_get_upstream(smc,initiator) ;
if (upstream == ENTITY_MAC) {
DB_ECM("ECM : TRACE terminated");
smc->e.path_test = PT_PENDING ;
}
else {
DB_ECM("ECM : propagate TRACE on PHY %d", upstream);
queue_event(smc,EVENT_PCM+upstream,PC_TRACE) ;
}
}
}
#endif
static void start_ecm_timer(struct s_smc *smc, u_long value, int event)
{ … }
static void stop_ecm_timer(struct s_smc *smc)
{ … }