Lines Matching +full:1 +full:mib

67 #define GO_STATE(x)	(mib->fddiPORTPCMState = (x)|AFLAG)
68 #define ACTIONS_DONE() (mib->fddiPORTPCMState &= ~AFLAG)
75 #define PC1_BREAK 1
138 #define PS_BIT3 1
231 struct fddi_mib_p *mib ; in pcm_init() local
235 mib = phy->mib ; in pcm_init()
236 mib->fddiPORTPCMState = ACTIONS(PC0_OFF) ; in pcm_init()
241 mib->fddiPORTMy_Type = (np == PS) ? TS : TM ; in pcm_init()
244 mib->fddiPORTMy_Type = (np == PA) ? TA : in pcm_init()
248 mib->fddiPORTMy_Type = TM ; in pcm_init()
252 mib->fddiPORTMy_Type = (np == PS) ? TS : TNONE ; in pcm_init()
253 mib->fddiPORTHardwarePresent = (np == PS) ? TRUE : in pcm_init()
256 smc->y[PA].mib->fddiPORTPCMState = PC0_OFF ; in pcm_init()
258 smc->y[PB].mib->fddiPORTPCMState = PC0_OFF ; in pcm_init()
262 mib->fddiPORTMy_Type = (np == PB) ? TB : TA ; in pcm_init()
272 mib->fddiPORTPMDClass = MIB_PMDCLASS_MULTI ; in pcm_init()
275 mib->fddiPORTPMDClass = MIB_PMDCLASS_LCF ; in pcm_init()
278 mib->fddiPORTPMDClass = MIB_PMDCLASS_TP ; in pcm_init()
281 mib->fddiPORTPMDClass = MIB_PMDCLASS_TP ; in pcm_init()
285 mib->fddiPORTPMDClass = MIB_PMDCLASS_TP ; in pcm_init()
288 case '1' : in pcm_init()
289 mib->fddiPORTPMDClass = MIB_PMDCLASS_SINGLE1 ; in pcm_init()
292 mib->fddiPORTPMDClass = MIB_PMDCLASS_SINGLE2 ; in pcm_init()
295 mib->fddiPORTPMDClass = MIB_PMDCLASS_SINGLE2 ; in pcm_init()
298 mib->fddiPORTPMDClass = MIB_PMDCLASS_SINGLE1 ; in pcm_init()
301 mib->fddiPORTPMDClass = MIB_PMDCLASS_UNKNOWN ; in pcm_init()
304 mib->fddiPORTPMDClass = MIB_PMDCLASS_TP ; in pcm_init()
307 mib->fddiPORTPMDClass = MIB_PMDCLASS_TP ; in pcm_init()
310 mib->fddiPORTPMDClass = MIB_PMDCLASS_UNKNOWN ; in pcm_init()
316 switch (mib->fddiPORTMy_Type) { in pcm_init()
318 mib->fddiPORTAvailablePaths |= MIB_PATH_S ; in pcm_init()
319 mib->fddiPORTRequestedPaths[1] = MIB_P_PATH_LOCAL ; in pcm_init()
320 mib->fddiPORTRequestedPaths[2] = in pcm_init()
324 mib->fddiPORTRequestedPaths[3] = in pcm_init()
331 mib->fddiPORTAvailablePaths |= MIB_PATH_S ; in pcm_init()
332 mib->fddiPORTRequestedPaths[1] = MIB_P_PATH_LOCAL ; in pcm_init()
333 mib->fddiPORTRequestedPaths[2] = in pcm_init()
336 mib->fddiPORTRequestedPaths[3] = in pcm_init()
343 mib->fddiPORTAvailablePaths |= MIB_PATH_S ; in pcm_init()
344 mib->fddiPORTRequestedPaths[1] = MIB_P_PATH_LOCAL ; in pcm_init()
345 mib->fddiPORTRequestedPaths[2] = in pcm_init()
349 mib->fddiPORTRequestedPaths[3] = in pcm_init()
355 mib->fddiPORTRequestedPaths[1] = MIB_P_PATH_LOCAL ; in pcm_init()
356 mib->fddiPORTRequestedPaths[2] = in pcm_init()
360 mib->fddiPORTRequestedPaths[3] = 0 ; in pcm_init()
365 mib->fddiPORTPCMStateX = mib->fddiPORTPCMState ; in pcm_init()
366 mib->fddiPORTLCTFail_Ct = 0 ; in pcm_init()
367 mib->fddiPORTBS_Flag = 0 ; in pcm_init()
368 mib->fddiPORTCurrentPath = MIB_PATH_ISOLATED ; in pcm_init()
369 mib->fddiPORTNeighborType = TNONE ; in pcm_init()
532 for (i = len-1,n = 0 ; i >= 0 ; i--) { in plc_send_bits()
533 n = (n<<1) | phy->t_val[phy->bitn+i] ; in plc_send_bits()
539 return 1; in plc_send_bits()
541 /* write bit[n] & length = 1 to regs */ in plc_send_bits()
542 outpw(PLC(np,PL_VECTOR_LEN),len-1) ; /* len=nr-1 */ in plc_send_bits()
545 #if 1 in plc_send_bits()
551 printf("SIGNALING bit %d .. %d\n",phy->bitn,phy->bitn+len-1) ; in plc_send_bits()
589 struct fddi_mib_p *mib ; in pcm() local
599 mib = phy->mib ; in pcm()
600 oldstate = mib->fddiPORTPCMState ; in pcm()
604 mib->fddiPORTPCMState & AFLAG ? "ACTIONS " : "", in pcm()
605 pcm_states[mib->fddiPORTPCMState & ~AFLAG], in pcm()
607 state = mib->fddiPORTPCMState ; in pcm()
610 } while (state != mib->fddiPORTPCMState) ; in pcm()
614 * the MIB want's to see CONNECT in pcm()
615 * we therefore fake an entry in the MIB in pcm()
618 mib->fddiPORTPCMStateX = PC3_CONNECT ; in pcm()
620 mib->fddiPORTPCMStateX = state ; in pcm()
626 if ( mib->fddiPORTPCMState != oldstate && in pcm()
627 ((oldstate == PC8_ACTIVE) || (mib->fddiPORTPCMState == PC8_ACTIVE))) { in pcm()
636 if ( mib->fddiPORTPCMState != oldstate ) { in pcm()
638 DB_SNMP ("PCM from %d to %d\n", oldstate, mib->fddiPORTPCMState); in pcm()
639 if ( mib->fddiPORTPCMState == PC0_OFF ) { in pcm()
641 snmp_fddi_trap (smc, 1, (int) mib->fddiPORTIndex ); in pcm()
644 snmp_fddi_trap (smc, 2, (int) mib->fddiPORTIndex ); in pcm()
645 } else if ( mib->fddiPORTPCMState != PC2_TRACE && in pcm()
648 snmp_fddi_trap (smc, 3, (int) mib->fddiPORTIndex ); in pcm()
649 } else if ( mib->fddiPORTPCMState == PC8_ACTIVE ) { in pcm()
651 snmp_fddi_trap (smc, 4, (int) mib->fddiPORTIndex ); in pcm()
667 struct fddi_mib_p *mib ; in pcm_fsm() local
673 mib = phy->mib ; in pcm_fsm()
681 if (mib->fddiPORTPCMState != PC9_MAINT) { in pcm_fsm()
690 if (mib->fddiPORTPCMState != PC9_MAINT) in pcm_fsm()
708 switch(mib->fddiPORTPCMState) { in pcm_fsm()
719 mib->fddiPORTConnectState = PCM_DISABLED ; in pcm_fsm()
751 if (mib->fddiPORTPC_Withhold == PC_WH_NONE) in pcm_fsm()
752 mib->fddiPORTConnectState = PCM_CONNECTING ; in pcm_fsm()
856 plc->p_bits = 1 ; in pcm_fsm()
859 if (plc_send_bits(smc,phy,1)) { in pcm_fsm()
895 plc->p_bits = 1 ; in pcm_fsm()
898 if (plc_send_bits(smc,phy,1)) { in pcm_fsm()
975 mib->fddiPORTConnectState = PCM_ACTIVE ; in pcm_fsm()
1002 mib->fddiPORTConnectState = PCM_DISABLED ; in pcm_fsm()
1004 sm_ph_linestate(smc,np,(int) MIB2LS(mib->fddiPORTMaint_LS)) ; in pcm_fsm()
1009 DB_PCMN(1, "PCM %c : MAINT", phy->phy_name); in pcm_fsm()
1059 phy->mib->fddiPORTLer_Estimate = 15 ; in reset_lem_struct()
1071 struct fddi_mib_p *mib ; in lem_evaluate() local
1074 mib = phy->mib ; in lem_evaluate()
1081 mib->fddiPORTLem_Ct += errors ; in lem_evaluate()
1103 else if (errors <= 999999999) ber = 1 ; in lem_evaluate()
1112 mib->fddiPORTLer_Estimate = lem->lem_float_ber / 100 ; in lem_evaluate()
1113 if (mib->fddiPORTLer_Estimate < 4) { in lem_evaluate()
1114 mib->fddiPORTLer_Estimate = 4 ; in lem_evaluate()
1118 DB_PCMN(1, "LEM %c :", phy->np == PB ? 'B' : 'A'); in lem_evaluate()
1119 DB_PCMN(1, "errors : %ld", lem->lem_errors); in lem_evaluate()
1120 DB_PCMN(1, "sum_errors : %ld", mib->fddiPORTLem_Ct); in lem_evaluate()
1121 DB_PCMN(1, "current BER : 10E-%d", ber / 100); in lem_evaluate()
1122 DB_PCMN(1, "float BER : 10E-(%d/100)", lem->lem_float_ber); in lem_evaluate()
1123 DB_PCMN(1, "avg. BER : 10E-%d", mib->fddiPORTLer_Estimate); in lem_evaluate()
1129 cond = (mib->fddiPORTLer_Estimate <= mib->fddiPORTLer_Alarm) ? in lem_evaluate()
1134 if (cond != mib->fddiPORTLerFlag) { in lem_evaluate()
1140 if ( mib->fddiPORTLer_Estimate <= mib->fddiPORTLer_Cutoff) { in lem_evaluate()
1142 mib->fddiPORTLem_Reject_Ct++ ; in lem_evaluate()
1151 DB_PCMN(1, "PCM: LER cutoff on port %d cutoff %d", in lem_evaluate()
1152 phy->np, mib->fddiPORTLer_Cutoff); in lem_evaluate()
1176 struct fddi_mib_p *mib ; in lem_check_lct() local
1179 mib = phy->mib ; in lem_check_lct()
1184 mib->fddiPORTLem_Ct += errors ; in lem_check_lct()
1204 DB_PCMN(1, " >>errors : %lu", lem->lem_errors); in lem_check_lct()
1207 mib->fddiPORTLCTFail_Ct++ ; in lem_check_lct()
1208 mib->fddiPORTLem_Reject_Ct++ ; in lem_check_lct()
1211 mib->fddiPORTLCTFail_Ct = 0 ; in lem_check_lct()
1221 lem->lem_on = 1 ; in sm_ph_lem_start()
1224 /* Do NOT reset mib->fddiPORTLer_Estimate here. It is called too in sm_ph_lem_start()
1254 struct fddi_mib_p *mib ; in pc_rcode_actions() local
1256 mib = phy->mib ; in pc_rcode_actions()
1258 DB_PCMN(1, "SIG rec %x %x:", bit, phy->r_val[bit]); in pc_rcode_actions()
1263 case 1: in pc_rcode_actions()
1267 if (phy->r_val[1] == 0 && phy->r_val[2] == 0) in pc_rcode_actions()
1268 mib->fddiPORTNeighborType = TA ; in pc_rcode_actions()
1269 else if (phy->r_val[1] == 0 && phy->r_val[2] == 1) in pc_rcode_actions()
1270 mib->fddiPORTNeighborType = TB ; in pc_rcode_actions()
1271 else if (phy->r_val[1] == 1 && phy->r_val[2] == 0) in pc_rcode_actions()
1272 mib->fddiPORTNeighborType = TS ; in pc_rcode_actions()
1273 else if (phy->r_val[1] == 1 && phy->r_val[2] == 1) in pc_rcode_actions()
1274 mib->fddiPORTNeighborType = TM ; in pc_rcode_actions()
1277 if (mib->fddiPORTMy_Type == TM && in pc_rcode_actions()
1278 mib->fddiPORTNeighborType == TM) { in pc_rcode_actions()
1279 DB_PCMN(1, "PCM %c : E100 withhold M-M", in pc_rcode_actions()
1281 mib->fddiPORTPC_Withhold = PC_WH_M_M ; in pc_rcode_actions()
1285 mib->fddiPORTPC_Withhold = PC_WH_NONE ; in pc_rcode_actions()
1286 if (mib->fddiPORTMy_Type == TM || in pc_rcode_actions()
1287 mib->fddiPORTNeighborType == TM) in pc_rcode_actions()
1296 mib->fddiPORTPC_Withhold = PC_WH_PATH ; in pc_rcode_actions()
1300 mib->fddiPORTPC_Withhold = PC_WH_OTHER ; in pc_rcode_actions()
1302 DB_PCMN(1, "PCM %c : E101 withhold other", in pc_rcode_actions()
1305 phy->twisted = ((mib->fddiPORTMy_Type != TS) && in pc_rcode_actions()
1306 (mib->fddiPORTMy_Type != TM) && in pc_rcode_actions()
1307 (mib->fddiPORTNeighborType == in pc_rcode_actions()
1308 mib->fddiPORTMy_Type)) ; in pc_rcode_actions()
1310 DB_PCMN(1, "PCM %c : E102 !!! TWISTED !!!", in pc_rcode_actions()
1349 DB_PCMN(1, "LCT timer = %ld us", phy->t_next[7]); in pc_rcode_actions()
1360 DB_PCMN(1, "PCM %c : E103 LCT fail %s", in pc_rcode_actions()
1376 mib->fddiPORTMacIndicated.R_val = TRUE ; in pc_rcode_actions()
1380 mib->fddiPORTMacIndicated.R_val = FALSE ; in pc_rcode_actions()
1392 struct fddi_mib_p *mib ; in pc_tcode_actions() local
1394 mib = phy->mib ; in pc_tcode_actions()
1400 case 1: in pc_tcode_actions()
1401 if (mib->fddiPORTMy_Type == TS || mib->fddiPORTMy_Type == TM) in pc_tcode_actions()
1402 phy->t_val[1] = 1 ; in pc_tcode_actions()
1404 phy->t_val[1] = 0 ; in pc_tcode_actions()
1407 if (mib->fddiPORTMy_Type == TB || mib->fddiPORTMy_Type == TM) in pc_tcode_actions()
1408 phy->t_val[2] = 1 ; in pc_tcode_actions()
1417 type = mib->fddiPORTMy_Type ; in pc_tcode_actions()
1418 ne = mib->fddiPORTNeighborType ; in pc_tcode_actions()
1419 policy = smc->mib.fddiSMTConnectionPolicy ; in pc_tcode_actions()
1421 phy->t_val[3] = 1 ; /* Accept connection */ in pc_tcode_actions()
1473 if (mib->fddiPORTPC_Withhold == PC_WH_NONE) { in pc_tcode_actions()
1475 phy->t_val[4] = 1 ; /* long */ in pc_tcode_actions()
1480 if (mib->fddiPORTLCTFail_Ct > 0) in pc_tcode_actions()
1481 phy->t_val[5] = 1 ; /* medium */ in pc_tcode_actions()
1491 phy->t_val[5] = 1 ; /* medium */ in pc_tcode_actions()
1493 mib->fddiPORTConnectState = PCM_CONNECTING ; in pc_tcode_actions()
1496 mib->fddiPORTConnectState = PCM_STANDBY ; in pc_tcode_actions()
1497 phy->t_val[4] = 1 ; /* extended */ in pc_tcode_actions()
1498 phy->t_val[5] = 1 ; in pc_tcode_actions()
1511 DB_PCMN(1, "PCM %c : E104 LCT failed", phy->phy_name); in pc_tcode_actions()
1512 phy->t_val[7] = 1 ; in pc_tcode_actions()
1522 if ((mib->fddiPORTPC_Withhold != PC_WH_NONE) || in pc_tcode_actions()
1535 (smc->y[PB].mib->fddiPORTConnectState != in pc_tcode_actions()
1558 mib->fddiPORTMacIndicated.T_val = phy->t_val[9] ; in pc_tcode_actions()
1561 DB_PCMN(1, "SIG snd %x %x:", bit, phy->t_val[bit]); in pc_tcode_actions()
1572 if (smc->y[PA].twisted && (smc->y[PA].mib->fddiPORTPCMState == PC8_ACTIVE)) in pcm_status_twisted()
1573 twist |= 1 ; in pcm_status_twisted()
1574 if (smc->y[PB].twisted && (smc->y[PB].mib->fddiPORTPCMState == PC8_ACTIVE)) in pcm_status_twisted()
1590 struct fddi_mib_p *mib ; in pcm_status_state() local
1592 mib = phy->mib ; in pcm_status_state()
1596 *type = mib->fddiPORTMy_Type ; /* our PHY type */ in pcm_status_state()
1597 *state = mib->fddiPORTConnectState ; in pcm_status_state()
1598 *remote = mib->fddiPORTNeighborType ; in pcm_status_state()
1600 switch(mib->fddiPORTPCMState) { in pcm_status_state()
1602 *mac = mib->fddiPORTMacIndicated.R_val ; in pcm_status_state()
1615 if (smc->y[n].mib->fddiPORTPCMState == PC8_ACTIVE && in pcm_rooted_station()
1616 smc->y[n].mib->fddiPORTNeighborType == TM) in pcm_rooted_station()
1619 return 1; in pcm_rooted_station()
1644 if (!plc->ebuf_cont && phy->mib->fddiPORTPCMState == PC8_ACTIVE){ in plc_irq()
1651 phy->mib->fddiPORTEBError_Ct ++ ; in plc_irq()
1729 phy->mib->fddiPORTLem_Ct += i ; in plc_irq()
1764 DB_PCMN(1, "PLC %d: MDcF = %x", np, smc->e.DisconnectFlag); in plc_irq()
1766 DB_PCMN(1, "PLC %d: restart (reason %x)", np, reason); in plc_irq()
1770 DB_PCMN(1, "PLC %d: NO!! restart (reason %x)", in plc_irq()
1782 phy->r_val[plc->p_start+i] = n & 1 ; in plc_irq()
1783 n >>= 1 ; in plc_irq()
1792 DB_PCMN(1, "PCM : irq TRACE_PROP %d %d", in plc_irq()
1793 np, smc->mib.fddiSMTECMState); in plc_irq()
1803 if ((cmd & PL_SELF_TEST) && (phy->mib->fddiPORTPCMState == PC2_TRACE)) { in plc_irq()
1806 DB_PCMN(1, "PCM : state = %s %d", in plc_irq()
1808 phy->mib->fddiPORTPCMState); in plc_irq()
1816 if (phy->mib->fddiPORTPCMState == PC8_ACTIVE) { in plc_irq()
1818 DB_PCMN(1, "PCM %c : PC81 %s", in plc_irq()
1854 struct fddi_mib_p *mib ; in pcm_get_state() local
1858 mib = phy->mib ; in pcm_get_state()
1859 pcs->pcm_type = (u_char) mib->fddiPORTMy_Type ; in pcm_get_state()
1860 pcs->pcm_state = (u_char) mib->fddiPORTPCMState ; in pcm_get_state()
1862 pcs->pcm_neighbor = (u_char) mib->fddiPORTNeighborType ; in pcm_get_state()
1863 pcs->pcm_bsf = mib->fddiPORTBS_Flag ; in pcm_get_state()
1865 pcs->pcm_lct_fail = (u_char) mib->fddiPORTLCTFail_Ct ; in pcm_get_state()
1868 rbits <<= 1 ; in pcm_get_state()
1869 tbits <<= 1 ; in pcm_get_state()
1870 if (phy->r_val[NUMBITS-1-ii]) in pcm_get_state()
1871 rbits |= 1 ; in pcm_get_state()
1872 if (phy->t_val[NUMBITS-1-ii]) in pcm_get_state()
1873 tbits |= 1 ; in pcm_get_state()
1978 struct fddi_mib_p *mib ; in pcm_lem_dump() local
1987 mib = phy->mib ; in pcm_lem_dump()
1990 mib->fddiPORTLem_Ct, in pcm_lem_dump()
1991 mib->fddiPORTLer_Estimate) ; in pcm_lem_dump()