Lines Matching refs:smc

60 struct s_smc	* smc, int  type, int  index
67 struct s_smc *smc ,
202 static void pcm_fsm(struct s_smc *smc, struct s_phy *phy, int cmd);
203 static void pc_rcode_actions(struct s_smc *smc, int bit, struct s_phy *phy);
204 static void pc_tcode_actions(struct s_smc *smc, const int bit, struct s_phy *phy);
206 static void plc_init(struct s_smc *smc, int p);
207 static void sm_ph_lem_start(struct s_smc *smc, int np, int threshold);
208 static void sm_ph_lem_stop(struct s_smc *smc, int np);
209 static void sm_ph_linestate(struct s_smc *smc, int phy, int ls);
210 static void real_init_plc(struct s_smc *smc);
216 static void start_pcm_timer0(struct s_smc *smc, u_long value, int event, in start_pcm_timer0() argument
220 smt_timer_start(smc,&phy->pcm_timer0,value, in start_pcm_timer0()
227 static void stop_pcm_timer0(struct s_smc *smc, struct s_phy *phy) in stop_pcm_timer0() argument
230 smt_timer_stop(smc,&phy->pcm_timer0) ; in stop_pcm_timer0()
237 void pcm_init(struct s_smc *smc) in pcm_init() argument
244 for (np = 0,phy = smc->y ; np < NUMPHYS ; np++,phy++) { in pcm_init()
249 switch (smc->s.sas) { in pcm_init()
267 smc->y[PA].mib->fddiPORTPCMState = PC0_OFF ; in pcm_init()
269 smc->y[PB].mib->fddiPORTPCMState = PC0_OFF ; in pcm_init()
398 real_init_plc(smc) ; in pcm_init()
401 void init_plc(struct s_smc *smc) in init_plc() argument
403 SK_UNUSED(smc) ; in init_plc()
414 static void real_init_plc(struct s_smc *smc) in real_init_plc() argument
419 plc_init(smc,p) ; in real_init_plc()
422 static void plc_init(struct s_smc *smc, int p) in plc_init() argument
442 if (smc->y[p].pmd_scramble) { in plc_init()
465 plc_clear_irq(smc,p) ; in plc_init()
476 if ((smc->s.sas == SMT_SAS) && (p == PS)) { in plc_init()
485 static void plc_go_state(struct s_smc *smc, int p, int state) in plc_go_state() argument
490 SK_UNUSED(smc) ; in plc_go_state()
501 int sm_pm_get_ls(struct s_smc *smc, int phy) in sm_pm_get_ls() argument
506 if (!plc_is_installed(smc,phy)) in sm_pm_get_ls()
534 static int plc_send_bits(struct s_smc *smc, struct s_phy *phy, int len) in plc_send_bits() argument
540 SK_UNUSED(smc) ; in plc_send_bits()
558 if (smc->debug.d_plc & 0x80) in plc_send_bits()
571 void plc_config_mux(struct s_smc *smc, int mux) in plc_config_mux() argument
573 if (smc->s.sas != SMT_DAS) in plc_config_mux()
595 void pcm(struct s_smc *smc, const int np, int event) in pcm() argument
606 if ((np != PS) && (smc->s.sas == SMT_SAS)) in pcm()
609 phy = &smc->y[np] ; in pcm()
620 pcm_fsm(smc,phy,event) ; in pcm()
640 smt_srf_event(smc,SMT_EVENT_PORT_PATH_CHANGE, in pcm()
653 snmp_fddi_trap (smc, 1, (int) mib->fddiPORTIndex ); in pcm()
656 snmp_fddi_trap (smc, 2, (int) mib->fddiPORTIndex ); in pcm()
660 snmp_fddi_trap (smc, 3, (int) mib->fddiPORTIndex ); in pcm()
663 snmp_fddi_trap (smc, 4, (int) mib->fddiPORTIndex ); in pcm()
668 pcm_state_change(smc,np,state) ; in pcm()
674 static void pcm_fsm(struct s_smc *smc, struct s_phy *phy, int cmd) in pcm_fsm() argument
695 AIX_EVENT(smc, (u_long) FDDI_RING_STATUS, (u_long) in pcm_fsm()
697 smt_get_port_event_word(smc)); in pcm_fsm()
708 AIX_EVENT(smc, (u_long) FDDI_RING_STATUS, (u_long) in pcm_fsm()
710 smt_get_port_event_word(smc)); in pcm_fsm()
714 stop_pcm_timer0(smc,phy) ; in pcm_fsm()
722 stop_pcm_timer0(smc,phy) ; in pcm_fsm()
726 sm_ph_lem_stop(smc,np) ; /* disable LEM */ in pcm_fsm()
729 queue_event(smc,EVENT_CFM,CF_JOIN+np) ; in pcm_fsm()
730 plc_go_state(smc,np,PL_PCM_STOP) ; in pcm_fsm()
743 stop_pcm_timer0(smc,phy) ; in pcm_fsm()
745 plc_go_state(smc,np,0) ; in pcm_fsm()
748 sm_ph_lem_stop(smc,np) ; /* disable LEM */ in pcm_fsm()
754 plc_go_state(smc,np,PL_PCM_STOP) ; in pcm_fsm()
761 plc_go_state(smc,np,PL_PCM_STOP) ; in pcm_fsm()
767 queue_event(smc,EVENT_CFM,CF_JOIN+np) ; in pcm_fsm()
772 pc_tcode_actions(smc,i,phy) ; in pcm_fsm()
794 if (plc_send_bits(smc,phy,3)) { in pcm_fsm()
814 plc_go_state(smc,np,PL_PCM_START) ; in pcm_fsm()
831 (void) plc_send_bits(smc,phy,3) ; in pcm_fsm()
846 plc_go_state(smc,np,PL_PCM_TRACE) ; in pcm_fsm()
864 pc_rcode_actions(smc,i,phy) ; in pcm_fsm()
865 pc_tcode_actions(smc,3,phy) ; in pcm_fsm()
870 if (plc_send_bits(smc,phy,1)) { in pcm_fsm()
875 pc_rcode_actions(smc,3,phy) ; in pcm_fsm()
877 pc_tcode_actions(smc,i,phy) ; in pcm_fsm()
882 if (plc_send_bits(smc,phy,3)) { in pcm_fsm()
888 pc_rcode_actions(smc,i,phy) ; in pcm_fsm()
893 sm_ph_lem_start(smc,np,(int)smc->s.lct_short) ; /* enable LEM */ in pcm_fsm()
901 pc_tcode_actions(smc,7,phy) ; in pcm_fsm()
909 if (plc_send_bits(smc,phy,1)) { in pcm_fsm()
915 pc_rcode_actions(smc,7,phy) ; in pcm_fsm()
917 plc_go_state(smc,np,PL_PCM_STOP) ; in pcm_fsm()
922 pc_tcode_actions(smc,i,phy) ; in pcm_fsm()
927 if (plc_send_bits(smc,phy,2)) { in pcm_fsm()
933 pc_rcode_actions(smc,i,phy) ; in pcm_fsm()
944 if (smc->s.sas == SMT_DAS && np == PB && in pcm_fsm()
945 (smc->y[PA].pc_mode == PM_TREE || in pcm_fsm()
946 smc->y[PB].pc_mode == PM_TREE)) { in pcm_fsm()
963 queue_event(smc,EVENT_CFM,CF_JOIN+np) ; in pcm_fsm()
983 sm_ph_lem_start(smc,(int)phy->np,LCT_LEM_MAX) ; in pcm_fsm()
1004 stop_pcm_timer0(smc,phy) ; in pcm_fsm()
1008 sm_ph_lem_stop(smc,np) ; /* disable LEM */ in pcm_fsm()
1011 queue_event(smc,EVENT_CFM,CF_JOIN+np) ; in pcm_fsm()
1012 plc_go_state(smc,np,PL_PCM_STOP) ; in pcm_fsm()
1015 sm_ph_linestate(smc,np,(int) MIB2LS(mib->fddiPORTMaint_LS)) ; in pcm_fsm()
1029 SMT_PANIC(smc,SMT_E0118, SMT_E0118_MSG) ; in pcm_fsm()
1037 static void sm_ph_linestate(struct s_smc *smc, int phy, int ls) in sm_ph_linestate() argument
1041 SK_UNUSED(smc) ; in sm_ph_linestate()
1077 static void lem_evaluate(struct s_smc *smc, struct s_phy *phy) in lem_evaluate() argument
1144 smt_ler_alarm_check(smc,phy,cond) ; in lem_evaluate()
1147 smt_srf_event(smc,SMT_COND_PORT_LER, in lem_evaluate()
1167 smt_port_off_event(smc,phy->np); in lem_evaluate()
1169 queue_event(smc,(int)(EVENT_PCM+phy->np),PC_START) ; in lem_evaluate()
1177 void sm_lem_evaluate(struct s_smc *smc) in sm_lem_evaluate() argument
1182 lem_evaluate(smc,&smc->y[np]) ; in sm_lem_evaluate()
1185 static void lem_check_lct(struct s_smc *smc, struct s_phy *phy) in lem_check_lct() argument
1200 if (lem->lem_errors >= smc->s.lct_short) in lem_check_lct()
1204 if (lem->lem_errors >= smc->s.lct_medium) in lem_check_lct()
1208 if (lem->lem_errors >= smc->s.lct_long) in lem_check_lct()
1212 if (lem->lem_errors >= smc->s.lct_extended) in lem_check_lct()
1229 static void sm_ph_lem_start(struct s_smc *smc, int np, int threshold) in sm_ph_lem_start() argument
1231 struct lem_counter *lem = &smc->y[np].lem ; in sm_ph_lem_start()
1247 static void sm_ph_lem_stop(struct s_smc *smc, int np) in sm_ph_lem_stop() argument
1249 struct lem_counter *lem = &smc->y[np].lem ; in sm_ph_lem_stop()
1256 void sm_pm_ls_latch(struct s_smc *smc, int phy, int on_off) in sm_pm_ls_latch() argument
1259 SK_UNUSED(smc) ; in sm_pm_ls_latch()
1274 static void pc_rcode_actions(struct s_smc *smc, int bit, struct s_phy *phy) in pc_rcode_actions() argument
1304 RS_SET(smc,RS_EVENT) ; in pc_rcode_actions()
1315 all_selection_criteria (smc); in pc_rcode_actions()
1323 RS_SET(smc,RS_EVENT) ; in pc_rcode_actions()
1353 phy->t_next[7] = smc->s.pcm_lc_short ; in pc_rcode_actions()
1357 phy->t_next[7] = smc->s.pcm_lc_medium ; in pc_rcode_actions()
1361 phy->t_next[7] = smc->s.pcm_lc_long ; in pc_rcode_actions()
1365 phy->t_next[7] = smc->s.pcm_lc_extended ; in pc_rcode_actions()
1368 if (phy->t_next[7] > smc->s.pcm_lc_medium) { in pc_rcode_actions()
1369 start_pcm_timer0(smc,phy->t_next[7],PC_TIMEOUT_LCT,phy); in pc_rcode_actions()
1372 phy->t_next[9] = smc->s.pcm_t_next_9 ; in pc_rcode_actions()
1384 queue_event(smc,(int)(EVENT_PCM+phy->np),PC_START) ; in pc_rcode_actions()
1410 static void pc_tcode_actions(struct s_smc *smc, const int bit, struct s_phy *phy) in pc_tcode_actions() argument
1440 policy = smc->mib.fddiSMTConnectionPolicy ; in pc_tcode_actions()
1487 smt_srf_event(smc,SMT_EVENT_PORT_CONNECTION, in pc_tcode_actions()
1530 lem_check_lct(smc,phy) ; in pc_tcode_actions()
1545 ((smc->s.sas == SMT_DAS) && (phy->wc_flag))) { in pc_tcode_actions()
1546 queue_event(smc,EVENT_PCM+np,PC_START) ; in pc_tcode_actions()
1550 switch (smc->s.sas) { in pc_tcode_actions()
1557 (smc->y[PB].mib->fddiPORTConnectState != in pc_tcode_actions()
1589 int pcm_status_twisted(struct s_smc *smc) in pcm_status_twisted() argument
1592 if (smc->s.sas != SMT_DAS) in pcm_status_twisted()
1594 if (smc->y[PA].twisted && (smc->y[PA].mib->fddiPORTPCMState == PC8_ACTIVE)) in pcm_status_twisted()
1596 if (smc->y[PB].twisted && (smc->y[PB].mib->fddiPORTPCMState == PC8_ACTIVE)) in pcm_status_twisted()
1608 void pcm_status_state(struct s_smc *smc, int np, int *type, int *state, in pcm_status_state() argument
1611 struct s_phy *phy = &smc->y[np] ; in pcm_status_state()
1632 int pcm_rooted_station(struct s_smc *smc) in pcm_rooted_station() argument
1637 if (smc->y[n].mib->fddiPORTPCMState == PC8_ACTIVE && in pcm_rooted_station()
1638 smc->y[n].mib->fddiPORTNeighborType == TM) in pcm_rooted_station()
1647 void plc_irq(struct s_smc *smc, int np, unsigned int cmd) in plc_irq() argument
1650 struct s_phy *phy = &smc->y[np] ; in plc_irq()
1658 if (np >= smc->s.numphys) { in plc_irq()
1706 queue_event(smc,EVENT_ECM,EC_DISCONNECT) ; in plc_irq()
1711 SMT_ERR_LOG(smc,SMT_E0136, SMT_E0136_MSG) ; in plc_irq()
1716 drv_reset_indication(smc) ; in plc_irq()
1786 DB_PCMN(1,"PLC %d: MDcF = %x\n", np, smc->e.DisconnectFlag); in plc_irq()
1787 if (smc->e.DisconnectFlag == FALSE) { in plc_irq()
1789 queue_event(smc,EVENT_PCM+np,PC_START) ; in plc_irq()
1800 queue_event(smc,EVENT_PCM+np,PC_SIGNAL) ; in plc_irq()
1808 queue_event(smc,EVENT_PCM+np,PC_JOIN) ; in plc_irq()
1814 np,smc->mib.fddiSMTECMState) ; in plc_irq()
1816 smc->e.trace_prop |= ENTITY_BIT(ENTITY_PHY(np)) ; in plc_irq()
1817 queue_event(smc,EVENT_ECM,EC_TRACE_PROP) ; in plc_irq()
1826 if (smc->e.path_test == PT_PASSED) { in plc_irq()
1827 DB_PCMN(1,"PCM : state = %s %d\n", get_pcmstate(smc,np), in plc_irq()
1830 smc->e.path_test = PT_PENDING ; in plc_irq()
1831 queue_event(smc,EVENT_ECM,EC_PATH_TEST) ; in plc_irq()
1839 queue_event(smc,EVENT_PCM+np,PC_START) ; in plc_irq()
1865 void pcm_get_state(struct s_smc *smc, struct smt_state *state) in pcm_get_state() argument
1875 for (i = 0, phy = smc->y, pcs = state->pcm_state ; i < NUMPHYS ; in pcm_get_state()
1885 pcs->pcm_ls_rx = LS2MIB(sm_pm_get_ls(smc,i)) ; in pcm_get_state()
1899 int get_pcm_state(struct s_smc *smc, int np) in get_pcm_state() argument
1903 SK_UNUSED(smc) ; in get_pcm_state()
1921 char *get_linestate(struct s_smc *smc, int np) in get_linestate() argument
1925 SK_UNUSED(smc) ; in get_linestate()
1943 char *get_pcmstate(struct s_smc *smc, int np) in get_pcmstate() argument
1947 SK_UNUSED(smc) ; in get_pcmstate()
1965 void list_phy(struct s_smc *smc) in list_phy() argument
1971 plc = &smc->y[np].plc ; in list_phy()
1976 plc->parity_err,plc->b_tpc,get_linestate(smc,np)) ; in list_phy()
1980 plc->phyinv,plc->b_qls,get_pcmstate(smc,np)) ; in list_phy()
1987 printf("\tLEM_err : %ld\n",smc->y[np].lem.lem_errors) ; in list_phy()
1993 void pcm_lem_dump(struct s_smc *smc) in pcm_lem_dump() argument
2003 for (i = 0,phy = smc->y ; i < NUMPHYS ; i++,phy++) { in pcm_lem_dump()
2004 if (!plc_is_installed(smc,i)) in pcm_lem_dump()
2008 entostring(smc,ENTITY_PHY(i)), in pcm_lem_dump()