Lines Matching +full:1 +full:mib
71 #define GO_STATE(x) (mib->fddiPORTPCMState = (x)|AFLAG)
72 #define ACTIONS_DONE() (mib->fddiPORTPCMState &= ~AFLAG)
79 #define PC1_BREAK 1
142 #define PS_BIT3 1
235 struct fddi_mib_p *mib ; in pcm_init() local
239 mib = phy->mib ; in pcm_init()
240 mib->fddiPORTPCMState = ACTIONS(PC0_OFF) ; in pcm_init()
245 mib->fddiPORTMy_Type = (np == PS) ? TS : TM ; in pcm_init()
248 mib->fddiPORTMy_Type = (np == PA) ? TA : in pcm_init()
252 mib->fddiPORTMy_Type = TM ; in pcm_init()
256 mib->fddiPORTMy_Type = (np == PS) ? TS : TNONE ; in pcm_init()
257 mib->fddiPORTHardwarePresent = (np == PS) ? TRUE : in pcm_init()
260 smc->y[PA].mib->fddiPORTPCMState = PC0_OFF ; in pcm_init()
262 smc->y[PB].mib->fddiPORTPCMState = PC0_OFF ; in pcm_init()
266 mib->fddiPORTMy_Type = (np == PB) ? TB : TA ; in pcm_init()
276 mib->fddiPORTPMDClass = MIB_PMDCLASS_MULTI ; in pcm_init()
279 mib->fddiPORTPMDClass = MIB_PMDCLASS_LCF ; in pcm_init()
282 mib->fddiPORTPMDClass = MIB_PMDCLASS_TP ; in pcm_init()
285 mib->fddiPORTPMDClass = MIB_PMDCLASS_TP ; in pcm_init()
289 mib->fddiPORTPMDClass = MIB_PMDCLASS_TP ; in pcm_init()
292 case '1' : in pcm_init()
293 mib->fddiPORTPMDClass = MIB_PMDCLASS_SINGLE1 ; in pcm_init()
296 mib->fddiPORTPMDClass = MIB_PMDCLASS_SINGLE2 ; in pcm_init()
299 mib->fddiPORTPMDClass = MIB_PMDCLASS_SINGLE2 ; in pcm_init()
302 mib->fddiPORTPMDClass = MIB_PMDCLASS_SINGLE1 ; in pcm_init()
305 mib->fddiPORTPMDClass = MIB_PMDCLASS_UNKNOWN ; in pcm_init()
308 mib->fddiPORTPMDClass = MIB_PMDCLASS_TP ; in pcm_init()
311 mib->fddiPORTPMDClass = MIB_PMDCLASS_TP ; in pcm_init()
314 mib->fddiPORTPMDClass = MIB_PMDCLASS_UNKNOWN ; in pcm_init()
320 switch (mib->fddiPORTMy_Type) { in pcm_init()
322 mib->fddiPORTAvailablePaths |= MIB_PATH_S ; in pcm_init()
323 mib->fddiPORTRequestedPaths[1] = MIB_P_PATH_LOCAL ; in pcm_init()
324 mib->fddiPORTRequestedPaths[2] = in pcm_init()
328 mib->fddiPORTRequestedPaths[3] = in pcm_init()
335 mib->fddiPORTAvailablePaths |= MIB_PATH_S ; in pcm_init()
336 mib->fddiPORTRequestedPaths[1] = MIB_P_PATH_LOCAL ; in pcm_init()
337 mib->fddiPORTRequestedPaths[2] = in pcm_init()
340 mib->fddiPORTRequestedPaths[3] = in pcm_init()
347 mib->fddiPORTAvailablePaths |= MIB_PATH_S ; in pcm_init()
348 mib->fddiPORTRequestedPaths[1] = MIB_P_PATH_LOCAL ; in pcm_init()
349 mib->fddiPORTRequestedPaths[2] = in pcm_init()
353 mib->fddiPORTRequestedPaths[3] = in pcm_init()
359 mib->fddiPORTRequestedPaths[1] = MIB_P_PATH_LOCAL ; in pcm_init()
360 mib->fddiPORTRequestedPaths[2] = in pcm_init()
364 mib->fddiPORTRequestedPaths[3] = 0 ; in pcm_init()
369 mib->fddiPORTPCMStateX = mib->fddiPORTPCMState ; in pcm_init()
370 mib->fddiPORTLCTFail_Ct = 0 ; in pcm_init()
371 mib->fddiPORTBS_Flag = 0 ; in pcm_init()
372 mib->fddiPORTCurrentPath = MIB_PATH_ISOLATED ; in pcm_init()
373 mib->fddiPORTNeighborType = TNONE ; in pcm_init()
536 for (i = len-1,n = 0 ; i >= 0 ; i--) { in plc_send_bits()
537 n = (n<<1) | phy->t_val[phy->bitn+i] ; in plc_send_bits()
543 return 1; in plc_send_bits()
545 /* write bit[n] & length = 1 to regs */ in plc_send_bits()
546 outpw(PLC(np,PL_VECTOR_LEN),len-1) ; /* len=nr-1 */ in plc_send_bits()
549 #if 1 in plc_send_bits()
555 printf("SIGNALING bit %d .. %d\n",phy->bitn,phy->bitn+len-1) ; in plc_send_bits()
593 struct fddi_mib_p *mib ; in pcm() local
603 mib = phy->mib ; in pcm()
604 oldstate = mib->fddiPORTPCMState ; in pcm()
608 mib->fddiPORTPCMState & AFLAG ? "ACTIONS " : "", in pcm()
609 pcm_states[mib->fddiPORTPCMState & ~AFLAG], in pcm()
611 state = mib->fddiPORTPCMState ; in pcm()
614 } while (state != mib->fddiPORTPCMState) ; in pcm()
618 * the MIB want's to see CONNECT in pcm()
619 * we therefore fake an entry in the MIB in pcm()
622 mib->fddiPORTPCMStateX = PC3_CONNECT ; in pcm()
624 mib->fddiPORTPCMStateX = state ; in pcm()
630 if ( mib->fddiPORTPCMState != oldstate && in pcm()
631 ((oldstate == PC8_ACTIVE) || (mib->fddiPORTPCMState == PC8_ACTIVE))) { in pcm()
640 if ( mib->fddiPORTPCMState != oldstate ) { in pcm()
642 DB_SNMP ("PCM from %d to %d\n", oldstate, mib->fddiPORTPCMState); in pcm()
643 if ( mib->fddiPORTPCMState == PC0_OFF ) { in pcm()
645 snmp_fddi_trap (smc, 1, (int) mib->fddiPORTIndex ); in pcm()
648 snmp_fddi_trap (smc, 2, (int) mib->fddiPORTIndex ); in pcm()
649 } else if ( mib->fddiPORTPCMState != PC2_TRACE && in pcm()
652 snmp_fddi_trap (smc, 3, (int) mib->fddiPORTIndex ); in pcm()
653 } else if ( mib->fddiPORTPCMState == PC8_ACTIVE ) { in pcm()
655 snmp_fddi_trap (smc, 4, (int) mib->fddiPORTIndex ); in pcm()
671 struct fddi_mib_p *mib ; in pcm_fsm() local
677 mib = phy->mib ; in pcm_fsm()
685 if (mib->fddiPORTPCMState != PC9_MAINT) { in pcm_fsm()
694 if (mib->fddiPORTPCMState != PC9_MAINT) in pcm_fsm()
712 switch(mib->fddiPORTPCMState) { in pcm_fsm()
723 mib->fddiPORTConnectState = PCM_DISABLED ; in pcm_fsm()
755 if (mib->fddiPORTPC_Withhold == PC_WH_NONE) in pcm_fsm()
756 mib->fddiPORTConnectState = PCM_CONNECTING ; in pcm_fsm()
860 plc->p_bits = 1 ; in pcm_fsm()
863 if (plc_send_bits(smc,phy,1)) { in pcm_fsm()
899 plc->p_bits = 1 ; in pcm_fsm()
902 if (plc_send_bits(smc,phy,1)) { in pcm_fsm()
979 mib->fddiPORTConnectState = PCM_ACTIVE ; in pcm_fsm()
1006 mib->fddiPORTConnectState = PCM_DISABLED ; in pcm_fsm()
1008 sm_ph_linestate(smc,np,(int) MIB2LS(mib->fddiPORTMaint_LS)) ; in pcm_fsm()
1013 DB_PCMN(1, "PCM %c : MAINT", phy->phy_name); in pcm_fsm()
1063 phy->mib->fddiPORTLer_Estimate = 15 ; in reset_lem_struct()
1075 struct fddi_mib_p *mib ; in lem_evaluate() local
1078 mib = phy->mib ; in lem_evaluate()
1085 mib->fddiPORTLem_Ct += errors ; in lem_evaluate()
1107 else if (errors <= 999999999) ber = 1 ; in lem_evaluate()
1116 mib->fddiPORTLer_Estimate = lem->lem_float_ber / 100 ; in lem_evaluate()
1117 if (mib->fddiPORTLer_Estimate < 4) { in lem_evaluate()
1118 mib->fddiPORTLer_Estimate = 4 ; in lem_evaluate()
1122 DB_PCMN(1, "LEM %c :", phy->np == PB ? 'B' : 'A'); in lem_evaluate()
1123 DB_PCMN(1, "errors : %ld", lem->lem_errors); in lem_evaluate()
1124 DB_PCMN(1, "sum_errors : %ld", mib->fddiPORTLem_Ct); in lem_evaluate()
1125 DB_PCMN(1, "current BER : 10E-%d", ber / 100); in lem_evaluate()
1126 DB_PCMN(1, "float BER : 10E-(%d/100)", lem->lem_float_ber); in lem_evaluate()
1127 DB_PCMN(1, "avg. BER : 10E-%d", mib->fddiPORTLer_Estimate); in lem_evaluate()
1133 cond = (mib->fddiPORTLer_Estimate <= mib->fddiPORTLer_Alarm) ? in lem_evaluate()
1138 if (cond != mib->fddiPORTLerFlag) { in lem_evaluate()
1144 if ( mib->fddiPORTLer_Estimate <= mib->fddiPORTLer_Cutoff) { in lem_evaluate()
1146 mib->fddiPORTLem_Reject_Ct++ ; in lem_evaluate()
1155 DB_PCMN(1, "PCM: LER cutoff on port %d cutoff %d", in lem_evaluate()
1156 phy->np, mib->fddiPORTLer_Cutoff); in lem_evaluate()
1180 struct fddi_mib_p *mib ; in lem_check_lct() local
1183 mib = phy->mib ; in lem_check_lct()
1188 mib->fddiPORTLem_Ct += errors ; in lem_check_lct()
1208 DB_PCMN(1, " >>errors : %lu", lem->lem_errors); in lem_check_lct()
1211 mib->fddiPORTLCTFail_Ct++ ; in lem_check_lct()
1212 mib->fddiPORTLem_Reject_Ct++ ; in lem_check_lct()
1215 mib->fddiPORTLCTFail_Ct = 0 ; in lem_check_lct()
1225 lem->lem_on = 1 ; in sm_ph_lem_start()
1228 /* Do NOT reset mib->fddiPORTLer_Estimate here. It is called too in sm_ph_lem_start()
1258 struct fddi_mib_p *mib ; in pc_rcode_actions() local
1260 mib = phy->mib ; in pc_rcode_actions()
1262 DB_PCMN(1, "SIG rec %x %x:", bit, phy->r_val[bit]); in pc_rcode_actions()
1267 case 1: in pc_rcode_actions()
1271 if (phy->r_val[1] == 0 && phy->r_val[2] == 0) in pc_rcode_actions()
1272 mib->fddiPORTNeighborType = TA ; in pc_rcode_actions()
1273 else if (phy->r_val[1] == 0 && phy->r_val[2] == 1) in pc_rcode_actions()
1274 mib->fddiPORTNeighborType = TB ; in pc_rcode_actions()
1275 else if (phy->r_val[1] == 1 && phy->r_val[2] == 0) in pc_rcode_actions()
1276 mib->fddiPORTNeighborType = TS ; in pc_rcode_actions()
1277 else if (phy->r_val[1] == 1 && phy->r_val[2] == 1) in pc_rcode_actions()
1278 mib->fddiPORTNeighborType = TM ; in pc_rcode_actions()
1281 if (mib->fddiPORTMy_Type == TM && in pc_rcode_actions()
1282 mib->fddiPORTNeighborType == TM) { in pc_rcode_actions()
1283 DB_PCMN(1, "PCM %c : E100 withhold M-M", in pc_rcode_actions()
1285 mib->fddiPORTPC_Withhold = PC_WH_M_M ; in pc_rcode_actions()
1289 mib->fddiPORTPC_Withhold = PC_WH_NONE ; in pc_rcode_actions()
1290 if (mib->fddiPORTMy_Type == TM || in pc_rcode_actions()
1291 mib->fddiPORTNeighborType == TM) in pc_rcode_actions()
1300 mib->fddiPORTPC_Withhold = PC_WH_PATH ; in pc_rcode_actions()
1304 mib->fddiPORTPC_Withhold = PC_WH_OTHER ; in pc_rcode_actions()
1306 DB_PCMN(1, "PCM %c : E101 withhold other", in pc_rcode_actions()
1309 phy->twisted = ((mib->fddiPORTMy_Type != TS) && in pc_rcode_actions()
1310 (mib->fddiPORTMy_Type != TM) && in pc_rcode_actions()
1311 (mib->fddiPORTNeighborType == in pc_rcode_actions()
1312 mib->fddiPORTMy_Type)) ; in pc_rcode_actions()
1314 DB_PCMN(1, "PCM %c : E102 !!! TWISTED !!!", in pc_rcode_actions()
1353 DB_PCMN(1, "LCT timer = %ld us", phy->t_next[7]); in pc_rcode_actions()
1364 DB_PCMN(1, "PCM %c : E103 LCT fail %s", in pc_rcode_actions()
1380 mib->fddiPORTMacIndicated.R_val = TRUE ; in pc_rcode_actions()
1384 mib->fddiPORTMacIndicated.R_val = FALSE ; in pc_rcode_actions()
1396 struct fddi_mib_p *mib ; in pc_tcode_actions() local
1398 mib = phy->mib ; in pc_tcode_actions()
1404 case 1: in pc_tcode_actions()
1405 if (mib->fddiPORTMy_Type == TS || mib->fddiPORTMy_Type == TM) in pc_tcode_actions()
1406 phy->t_val[1] = 1 ; in pc_tcode_actions()
1408 phy->t_val[1] = 0 ; in pc_tcode_actions()
1411 if (mib->fddiPORTMy_Type == TB || mib->fddiPORTMy_Type == TM) in pc_tcode_actions()
1412 phy->t_val[2] = 1 ; in pc_tcode_actions()
1421 type = mib->fddiPORTMy_Type ; in pc_tcode_actions()
1422 ne = mib->fddiPORTNeighborType ; in pc_tcode_actions()
1423 policy = smc->mib.fddiSMTConnectionPolicy ; in pc_tcode_actions()
1425 phy->t_val[3] = 1 ; /* Accept connection */ in pc_tcode_actions()
1477 if (mib->fddiPORTPC_Withhold == PC_WH_NONE) { in pc_tcode_actions()
1479 phy->t_val[4] = 1 ; /* long */ in pc_tcode_actions()
1484 if (mib->fddiPORTLCTFail_Ct > 0) in pc_tcode_actions()
1485 phy->t_val[5] = 1 ; /* medium */ in pc_tcode_actions()
1495 phy->t_val[5] = 1 ; /* medium */ in pc_tcode_actions()
1497 mib->fddiPORTConnectState = PCM_CONNECTING ; in pc_tcode_actions()
1500 mib->fddiPORTConnectState = PCM_STANDBY ; in pc_tcode_actions()
1501 phy->t_val[4] = 1 ; /* extended */ in pc_tcode_actions()
1502 phy->t_val[5] = 1 ; in pc_tcode_actions()
1515 DB_PCMN(1, "PCM %c : E104 LCT failed", phy->phy_name); in pc_tcode_actions()
1516 phy->t_val[7] = 1 ; in pc_tcode_actions()
1526 if ((mib->fddiPORTPC_Withhold != PC_WH_NONE) || in pc_tcode_actions()
1539 (smc->y[PB].mib->fddiPORTConnectState != in pc_tcode_actions()
1562 mib->fddiPORTMacIndicated.T_val = phy->t_val[9] ; in pc_tcode_actions()
1565 DB_PCMN(1, "SIG snd %x %x:", bit, phy->t_val[bit]); in pc_tcode_actions()
1576 if (smc->y[PA].twisted && (smc->y[PA].mib->fddiPORTPCMState == PC8_ACTIVE)) in pcm_status_twisted()
1577 twist |= 1 ; in pcm_status_twisted()
1578 if (smc->y[PB].twisted && (smc->y[PB].mib->fddiPORTPCMState == PC8_ACTIVE)) in pcm_status_twisted()
1594 struct fddi_mib_p *mib ; in pcm_status_state() local
1596 mib = phy->mib ; in pcm_status_state()
1600 *type = mib->fddiPORTMy_Type ; /* our PHY type */ in pcm_status_state()
1601 *state = mib->fddiPORTConnectState ; in pcm_status_state()
1602 *remote = mib->fddiPORTNeighborType ; in pcm_status_state()
1604 switch(mib->fddiPORTPCMState) { in pcm_status_state()
1606 *mac = mib->fddiPORTMacIndicated.R_val ; in pcm_status_state()
1619 if (smc->y[n].mib->fddiPORTPCMState == PC8_ACTIVE && in pcm_rooted_station()
1620 smc->y[n].mib->fddiPORTNeighborType == TM) in pcm_rooted_station()
1623 return 1; in pcm_rooted_station()
1648 if (!plc->ebuf_cont && phy->mib->fddiPORTPCMState == PC8_ACTIVE){ in plc_irq()
1655 phy->mib->fddiPORTEBError_Ct ++ ; in plc_irq()
1733 phy->mib->fddiPORTLem_Ct += i ; in plc_irq()
1768 DB_PCMN(1, "PLC %d: MDcF = %x", np, smc->e.DisconnectFlag); in plc_irq()
1770 DB_PCMN(1, "PLC %d: restart (reason %x)", np, reason); in plc_irq()
1774 DB_PCMN(1, "PLC %d: NO!! restart (reason %x)", in plc_irq()
1786 phy->r_val[plc->p_start+i] = n & 1 ; in plc_irq()
1787 n >>= 1 ; in plc_irq()
1796 DB_PCMN(1, "PCM : irq TRACE_PROP %d %d", in plc_irq()
1797 np, smc->mib.fddiSMTECMState); in plc_irq()
1807 if ((cmd & PL_SELF_TEST) && (phy->mib->fddiPORTPCMState == PC2_TRACE)) { in plc_irq()
1810 DB_PCMN(1, "PCM : state = %s %d", in plc_irq()
1812 phy->mib->fddiPORTPCMState); in plc_irq()
1820 if (phy->mib->fddiPORTPCMState == PC8_ACTIVE) { in plc_irq()
1822 DB_PCMN(1, "PCM %c : PC81 %s", in plc_irq()
1858 struct fddi_mib_p *mib ; in pcm_get_state() local
1862 mib = phy->mib ; in pcm_get_state()
1863 pcs->pcm_type = (u_char) mib->fddiPORTMy_Type ; in pcm_get_state()
1864 pcs->pcm_state = (u_char) mib->fddiPORTPCMState ; in pcm_get_state()
1866 pcs->pcm_neighbor = (u_char) mib->fddiPORTNeighborType ; in pcm_get_state()
1867 pcs->pcm_bsf = mib->fddiPORTBS_Flag ; in pcm_get_state()
1869 pcs->pcm_lct_fail = (u_char) mib->fddiPORTLCTFail_Ct ; in pcm_get_state()
1872 rbits <<= 1 ; in pcm_get_state()
1873 tbits <<= 1 ; in pcm_get_state()
1874 if (phy->r_val[NUMBITS-1-ii]) in pcm_get_state()
1875 rbits |= 1 ; in pcm_get_state()
1876 if (phy->t_val[NUMBITS-1-ii]) in pcm_get_state()
1877 tbits |= 1 ; in pcm_get_state()
1982 struct fddi_mib_p *mib ; in pcm_lem_dump() local
1991 mib = phy->mib ; in pcm_lem_dump()
1994 mib->fddiPORTLem_Ct, in pcm_lem_dump()
1995 mib->fddiPORTLer_Estimate) ; in pcm_lem_dump()