Lines Matching +full:reg +full:- +full:names

76 #define GO_STATE(x)	(mib->fddiPORTPCMState = (x)|AFLAG)
77 #define ACTIONS_DONE() (mib->fddiPORTPCMState &= ~AFLAG)
96 * symbolic state names
104 * symbolic event names
120 * PCL-S control register
121 * this register in the PLC-S controls the scrambling parameters
132 * PCL-S control register
133 * this register in the PLC-S controls the scrambling parameters
163 #define PLC_MS(m) ((int)((0x10000L-(m*100000L/2048))))
219 phy->timer0_exp = FALSE ; /* clear timer event flag */ in start_pcm_timer0()
220 smt_timer_start(smc,&phy->pcm_timer0,value, in start_pcm_timer0()
221 EV_TOKEN(EVENT_PCM+phy->np,event)) ; in start_pcm_timer0()
229 if (phy->pcm_timer0.tm_active) in stop_pcm_timer0()
230 smt_timer_stop(smc,&phy->pcm_timer0) ; in stop_pcm_timer0()
244 for (np = 0,phy = smc->y ; np < NUMPHYS ; np++,phy++) { in pcm_init()
246 mib = phy->mib ; in pcm_init()
247 mib->fddiPORTPCMState = ACTIONS(PC0_OFF) ; in pcm_init()
248 phy->np = np ; in pcm_init()
249 switch (smc->s.sas) { in pcm_init()
252 mib->fddiPORTMy_Type = (np == PS) ? TS : TM ; in pcm_init()
255 mib->fddiPORTMy_Type = (np == PA) ? TA : in pcm_init()
259 mib->fddiPORTMy_Type = TM ; in pcm_init()
263 mib->fddiPORTMy_Type = (np == PS) ? TS : TNONE ; in pcm_init()
264 mib->fddiPORTHardwarePresent = (np == PS) ? TRUE : 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()
273 mib->fddiPORTMy_Type = (np == PB) ? TB : TA ; in pcm_init()
278 * set PMD-type in pcm_init()
280 phy->pmd_scramble = 0 ; in pcm_init()
281 switch (phy->pmd_type[PMD_SK_PMD]) { in pcm_init()
283 mib->fddiPORTPMDClass = MIB_PMDCLASS_MULTI ; in pcm_init()
286 mib->fddiPORTPMDClass = MIB_PMDCLASS_LCF ; in pcm_init()
289 mib->fddiPORTPMDClass = MIB_PMDCLASS_TP ; in pcm_init()
292 mib->fddiPORTPMDClass = MIB_PMDCLASS_TP ; in pcm_init()
293 phy->pmd_scramble = TRUE ; in pcm_init()
296 mib->fddiPORTPMDClass = MIB_PMDCLASS_TP ; in pcm_init()
297 phy->pmd_scramble = TRUE ; in pcm_init()
300 mib->fddiPORTPMDClass = MIB_PMDCLASS_SINGLE1 ; in pcm_init()
303 mib->fddiPORTPMDClass = MIB_PMDCLASS_SINGLE2 ; in pcm_init()
306 mib->fddiPORTPMDClass = MIB_PMDCLASS_SINGLE2 ; in pcm_init()
309 mib->fddiPORTPMDClass = MIB_PMDCLASS_SINGLE1 ; in pcm_init()
312 mib->fddiPORTPMDClass = MIB_PMDCLASS_UNKNOWN ; in pcm_init()
315 mib->fddiPORTPMDClass = MIB_PMDCLASS_TP ; in pcm_init()
318 mib->fddiPORTPMDClass = MIB_PMDCLASS_TP ; in pcm_init()
321 mib->fddiPORTPMDClass = MIB_PMDCLASS_UNKNOWN ; in pcm_init()
327 switch (mib->fddiPORTMy_Type) { in pcm_init()
329 mib->fddiPORTAvailablePaths |= MIB_PATH_S ; in pcm_init()
330 mib->fddiPORTRequestedPaths[1] = MIB_P_PATH_LOCAL ; in pcm_init()
331 mib->fddiPORTRequestedPaths[2] = in pcm_init()
335 mib->fddiPORTRequestedPaths[3] = in pcm_init()
342 mib->fddiPORTAvailablePaths |= MIB_PATH_S ; in pcm_init()
343 mib->fddiPORTRequestedPaths[1] = MIB_P_PATH_LOCAL ; in pcm_init()
344 mib->fddiPORTRequestedPaths[2] = in pcm_init()
347 mib->fddiPORTRequestedPaths[3] = in pcm_init()
354 mib->fddiPORTAvailablePaths |= MIB_PATH_S ; 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] = in pcm_init()
366 mib->fddiPORTRequestedPaths[1] = MIB_P_PATH_LOCAL ; in pcm_init()
367 mib->fddiPORTRequestedPaths[2] = in pcm_init()
371 mib->fddiPORTRequestedPaths[3] = 0 ; in pcm_init()
375 phy->pc_lem_fail = FALSE ; in pcm_init()
376 mib->fddiPORTPCMStateX = mib->fddiPORTPCMState ; in pcm_init()
377 mib->fddiPORTLCTFail_Ct = 0 ; in pcm_init()
378 mib->fddiPORTBS_Flag = 0 ; in pcm_init()
379 mib->fddiPORTCurrentPath = MIB_PATH_ISOLATED ; in pcm_init()
380 mib->fddiPORTNeighborType = TNONE ; in pcm_init()
381 phy->ls_flag = 0 ; in pcm_init()
382 phy->rc_flag = 0 ; in pcm_init()
383 phy->tc_flag = 0 ; in pcm_init()
384 phy->td_flag = 0 ; in pcm_init()
386 phy->phy_name = '0' + np - PM ; in pcm_init()
388 phy->phy_name = 'A' + np ; in pcm_init()
389 phy->wc_flag = FALSE ; /* set by SMT */ in pcm_init()
390 memset((char *)&phy->lem,0,sizeof(struct lem_counter)) ; in pcm_init()
392 memset((char *)&phy->plc,0,sizeof(struct s_plc)) ; in pcm_init()
393 phy->plc.p_state = PS_OFF ; in pcm_init()
395 phy->t_next[i] = 0 ; in pcm_init()
426 int rev ; /* Revision of PLC-x */ in plc_init()
435 * if PLC-S then set control register C in plc_init()
442 if (smc->y[p].pmd_scramble) { in plc_init()
461 for ( i = 0 ; pltm[i].timer; i++) /* set timer parameter reg */ in plc_init()
464 (void)inpw(PLC(p,PL_INTR_EVENT)) ; /* clear interrupt event reg */ in plc_init()
470 * REMOVE state if offline (page 3-36;) in plc_init()
476 if ((smc->s.sas == SMT_SAS) && (p == PS)) { in plc_init()
536 int np = phy->np ; /* PHY index */ in plc_send_bits()
543 for (i = len-1,n = 0 ; i >= 0 ; i--) { in plc_send_bits()
544 n = (n<<1) | phy->t_val[phy->bitn+i] ; in plc_send_bits()
553 outpw(PLC(np,PL_VECTOR_LEN),len-1) ; /* len=nr-1 */ in plc_send_bits()
558 if (smc->debug.d_plc & 0x80) in plc_send_bits()
562 printf("SIGNALING bit %d .. %d\n",phy->bitn,phy->bitn+len-1) ; in plc_send_bits()
573 if (smc->s.sas != SMT_DAS) in plc_config_mux()
606 if ((np != PS) && (smc->s.sas == SMT_SAS)) in pcm()
609 phy = &smc->y[np] ; in pcm()
610 mib = phy->mib ; in pcm()
611 oldstate = mib->fddiPORTPCMState ; in pcm()
614 phy->phy_name, in pcm()
615 (mib->fddiPORTPCMState & AFLAG) ? "ACTIONS " : "") ; in pcm()
617 pcm_states[mib->fddiPORTPCMState & ~AFLAG], in pcm()
619 state = mib->fddiPORTPCMState ; in pcm()
622 } while (state != mib->fddiPORTPCMState) ; in pcm()
630 mib->fddiPORTPCMStateX = PC3_CONNECT ; in pcm()
632 mib->fddiPORTPCMStateX = state ; in pcm()
638 if ( mib->fddiPORTPCMState != oldstate && in pcm()
639 ((oldstate == PC8_ACTIVE) || (mib->fddiPORTPCMState == PC8_ACTIVE))) { in pcm()
641 (int) (INDEX_PORT+ phy->np),0) ; in pcm()
646 /* check whether a snmp-trap has to be sent */ in pcm()
648 if ( mib->fddiPORTPCMState != oldstate ) { in pcm()
650 DB_SNMP ("PCM from %d to %d\n", oldstate, mib->fddiPORTPCMState); in pcm()
651 if ( mib->fddiPORTPCMState == PC0_OFF ) { in pcm()
653 snmp_fddi_trap (smc, 1, (int) mib->fddiPORTIndex ); in pcm()
656 snmp_fddi_trap (smc, 2, (int) mib->fddiPORTIndex ); in pcm()
657 } else if ( mib->fddiPORTPCMState != PC2_TRACE && in pcm()
660 snmp_fddi_trap (smc, 3, (int) mib->fddiPORTIndex ); in pcm()
661 } else if ( mib->fddiPORTPCMState == PC8_ACTIVE ) { in pcm()
663 snmp_fddi_trap (smc, 4, (int) mib->fddiPORTIndex ); in pcm()
677 int np = phy->np ; /* PHY index */ in pcm_fsm()
684 plc = &phy->plc ; in pcm_fsm()
685 mib = phy->mib ; in pcm_fsm()
692 /*PC00-PC80*/ in pcm_fsm()
693 if (mib->fddiPORTPCMState != PC9_MAINT) { in pcm_fsm()
701 /*PC01-PC81*/ in pcm_fsm()
702 if (mib->fddiPORTPCMState != PC9_MAINT) in pcm_fsm()
706 /* PC09-PC99 */ in pcm_fsm()
720 switch(mib->fddiPORTPCMState) { in pcm_fsm()
727 phy->cf_loop = FALSE ; in pcm_fsm()
728 phy->cf_join = FALSE ; in pcm_fsm()
731 mib->fddiPORTConnectState = PCM_DISABLED ; in pcm_fsm()
763 if (mib->fddiPORTPC_Withhold == PC_WH_NONE) in pcm_fsm()
764 mib->fddiPORTConnectState = PCM_CONNECTING ; in pcm_fsm()
765 phy->cf_loop = FALSE ; in pcm_fsm()
766 phy->cf_join = FALSE ; in pcm_fsm()
768 phy->ls_flag = FALSE ; in pcm_fsm()
769 phy->pc_mode = PM_NONE ; /* needed by CFM */ in pcm_fsm()
770 phy->bitn = 0 ; /* bit signaling start bit */ in pcm_fsm()
774 /* Set the non-active interrupt mask register */ in pcm_fsm()
801 * - The start command shall be done before setting the bits in pcm_fsm()
802 * to be signaled. (In PLC-S description and PLCS in SN3. in pcm_fsm()
803 * - The start command shall be issued AFTER setting the in pcm_fsm()
817 * workaround for PLC-S eng. sample errata in pcm_fsm()
838 plc->p_state = PS_BIT3 ; in pcm_fsm()
839 plc->p_bits = 3 ; in pcm_fsm()
840 plc->p_start = 0 ; in pcm_fsm()
861 switch (plc->p_state) { in pcm_fsm()
866 plc->p_state = PS_BIT4 ; in pcm_fsm()
867 plc->p_bits = 1 ; in pcm_fsm()
868 plc->p_start = 3 ; in pcm_fsm()
869 phy->bitn = 3 ; in pcm_fsm()
878 plc->p_state = PS_BIT7 ; in pcm_fsm()
879 plc->p_bits = 3 ; in pcm_fsm()
880 plc->p_start = 4 ; in pcm_fsm()
881 phy->bitn = 4 ; in pcm_fsm()
889 plc->p_state = PS_LCT ; in pcm_fsm()
890 plc->p_bits = 0 ; in pcm_fsm()
891 plc->p_start = 7 ; in pcm_fsm()
892 phy->bitn = 7 ; in pcm_fsm()
893 sm_ph_lem_start(smc,np,(int)smc->s.lct_short) ; /* enable LEM */ in pcm_fsm()
905 plc->p_state = PS_BIT8 ; in pcm_fsm()
906 plc->p_bits = 1 ; in pcm_fsm()
907 plc->p_start = 7 ; in pcm_fsm()
908 phy->bitn = 7 ; in pcm_fsm()
916 if (phy->t_val[7] || phy->r_val[7]) { in pcm_fsm()
923 plc->p_state = PS_JOIN ; in pcm_fsm()
924 plc->p_bits = 2 ; in pcm_fsm()
925 plc->p_start = 8 ; in pcm_fsm()
926 phy->bitn = 8 ; in pcm_fsm()
934 plc->p_state = PS_ACTIVE ; 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()
958 switch (plc->p_state) { in pcm_fsm()
961 if (!phy->cf_join) { in pcm_fsm()
962 phy->cf_join = TRUE ; in pcm_fsm()
983 sm_ph_lem_start(smc,(int)phy->np,LCT_LEM_MAX) ; in pcm_fsm()
985 phy->tr_flag = FALSE ; in pcm_fsm()
986 mib->fddiPORTConnectState = PCM_ACTIVE ; in pcm_fsm()
1009 phy->cf_loop = FALSE ; in pcm_fsm()
1010 phy->cf_join = FALSE ; in pcm_fsm()
1013 mib->fddiPORTConnectState = PCM_DISABLED ; in pcm_fsm()
1015 sm_ph_linestate(smc,np,(int) MIB2LS(mib->fddiPORTMaint_LS)) ; in pcm_fsm()
1020 DB_PCMN(1,"PCM %c : MAINT\n",phy->phy_name,0) ; in pcm_fsm()
1068 struct lem_counter *lem = &phy->lem ; in reset_lem_struct()
1070 phy->mib->fddiPORTLer_Estimate = 15 ; in reset_lem_struct()
1071 lem->lem_float_ber = 15 * 100 ; in reset_lem_struct()
1081 struct lem_counter *lem = &phy->lem ; in lem_evaluate()
1085 mib = phy->mib ; in lem_evaluate()
1087 if (!lem->lem_on) in lem_evaluate()
1090 errors = inpw(PLC(((int) phy->np),PL_LINK_ERR_CTR)) ; in lem_evaluate()
1091 lem->lem_errors += errors ; in lem_evaluate()
1092 mib->fddiPORTLem_Ct += errors ; in lem_evaluate()
1094 errors = lem->lem_errors ; in lem_evaluate()
1097 * -> this means, that one error in 8 sec. is one of 8*125*10E6 in lem_evaluate()
1098 * the same as BER = 10E-9 in lem_evaluate()
1100 * -> 9 errors in 8 seconds mean: in lem_evaluate()
1101 * BER = 9 * 10E-9 and this is in lem_evaluate()
1102 * < 10E-8, so the limit of 10E-8 is not reached! in lem_evaluate()
1121 lem->lem_float_ber = lem->lem_float_ber * 7 + ber * 3 ; in lem_evaluate()
1122 lem->lem_float_ber /= 10 ; in lem_evaluate()
1123 mib->fddiPORTLer_Estimate = lem->lem_float_ber / 100 ; in lem_evaluate()
1124 if (mib->fddiPORTLer_Estimate < 4) { in lem_evaluate()
1125 mib->fddiPORTLer_Estimate = 4 ; in lem_evaluate()
1128 if (lem->lem_errors) { in lem_evaluate()
1129 DB_PCMN(1,"LEM %c :\n",phy->np == PB? 'B' : 'A',0) ; in lem_evaluate()
1130 DB_PCMN(1,"errors : %ld\n",lem->lem_errors,0) ; in lem_evaluate()
1131 DB_PCMN(1,"sum_errors : %ld\n",mib->fddiPORTLem_Ct,0) ; in lem_evaluate()
1132 DB_PCMN(1,"current BER : 10E-%d\n",ber/100,0) ; in lem_evaluate()
1133 DB_PCMN(1,"float BER : 10E-(%d/100)\n",lem->lem_float_ber,0) ; in lem_evaluate()
1134 DB_PCMN(1,"avg. BER : 10E-%d\n", in lem_evaluate()
1135 mib->fddiPORTLer_Estimate,0) ; in lem_evaluate()
1138 lem->lem_errors = 0L ; in lem_evaluate()
1141 cond = (mib->fddiPORTLer_Estimate <= mib->fddiPORTLer_Alarm) ? in lem_evaluate()
1146 if (cond != mib->fddiPORTLerFlag) { in lem_evaluate()
1148 (int) (INDEX_PORT+ phy->np) ,cond) ; in lem_evaluate()
1152 if ( mib->fddiPORTLer_Estimate <= mib->fddiPORTLer_Cutoff) { in lem_evaluate()
1153 phy->pc_lem_fail = TRUE ; /* flag */ in lem_evaluate()
1154 mib->fddiPORTLem_Reject_Ct++ ; in lem_evaluate()
1156 * "forgive 10e-2" if we cutoff so we can come in lem_evaluate()
1159 lem->lem_float_ber += 2*100 ; in lem_evaluate()
1164 phy->np, mib->fddiPORTLer_Cutoff) ; 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()
1182 lem_evaluate(smc,&smc->y[np]) ; in sm_lem_evaluate()
1187 struct lem_counter *lem = &phy->lem ; in lem_check_lct()
1191 mib = phy->mib ; in lem_check_lct()
1193 phy->pc_lem_fail = FALSE ; /* flag */ in lem_check_lct()
1194 errors = inpw(PLC(((int)phy->np),PL_LINK_ERR_CTR)) ; in lem_check_lct()
1195 lem->lem_errors += errors ; in lem_check_lct()
1196 mib->fddiPORTLem_Ct += errors ; in lem_check_lct()
1197 if (lem->lem_errors) { in lem_check_lct()
1198 switch(phy->lc_test) { in lem_check_lct()
1200 if (lem->lem_errors >= smc->s.lct_short) in lem_check_lct()
1201 phy->pc_lem_fail = TRUE ; in lem_check_lct()
1204 if (lem->lem_errors >= smc->s.lct_medium) in lem_check_lct()
1205 phy->pc_lem_fail = TRUE ; in lem_check_lct()
1208 if (lem->lem_errors >= smc->s.lct_long) in lem_check_lct()
1209 phy->pc_lem_fail = TRUE ; in lem_check_lct()
1212 if (lem->lem_errors >= smc->s.lct_extended) in lem_check_lct()
1213 phy->pc_lem_fail = TRUE ; in lem_check_lct()
1216 DB_PCMN(1," >>errors : %d\n",lem->lem_errors,0) ; in lem_check_lct()
1218 if (phy->pc_lem_fail) { in lem_check_lct()
1219 mib->fddiPORTLCTFail_Ct++ ; in lem_check_lct()
1220 mib->fddiPORTLem_Reject_Ct++ ; in lem_check_lct()
1223 mib->fddiPORTLCTFail_Ct = 0 ; in lem_check_lct()
1231 struct lem_counter *lem = &smc->y[np].lem ; in sm_ph_lem_start()
1233 lem->lem_on = 1 ; in sm_ph_lem_start()
1234 lem->lem_errors = 0L ; in sm_ph_lem_start()
1236 /* Do NOT reset mib->fddiPORTLer_Estimate here. It is called too in sm_ph_lem_start()
1249 struct lem_counter *lem = &smc->y[np].lem ; in sm_ph_lem_stop()
1251 lem->lem_on = 0 ; in sm_ph_lem_stop()
1257 /* int on_off; en- or disable ident. ls */ in sm_pm_ls_latch()
1278 mib = phy->mib ; in pc_rcode_actions()
1280 DB_PCMN(1,"SIG rec %x %x:\n", bit,phy->r_val[bit] ) ; in pc_rcode_actions()
1289 if (phy->r_val[1] == 0 && phy->r_val[2] == 0) in pc_rcode_actions()
1290 mib->fddiPORTNeighborType = TA ; in pc_rcode_actions()
1291 else if (phy->r_val[1] == 0 && phy->r_val[2] == 1) in pc_rcode_actions()
1292 mib->fddiPORTNeighborType = TB ; in pc_rcode_actions()
1293 else if (phy->r_val[1] == 1 && phy->r_val[2] == 0) in pc_rcode_actions()
1294 mib->fddiPORTNeighborType = TS ; in pc_rcode_actions()
1295 else if (phy->r_val[1] == 1 && phy->r_val[2] == 1) in pc_rcode_actions()
1296 mib->fddiPORTNeighborType = TM ; in pc_rcode_actions()
1299 if (mib->fddiPORTMy_Type == TM && in pc_rcode_actions()
1300 mib->fddiPORTNeighborType == TM) { in pc_rcode_actions()
1301 DB_PCMN(1,"PCM %c : E100 withhold M-M\n", in pc_rcode_actions()
1302 phy->phy_name,0) ; in pc_rcode_actions()
1303 mib->fddiPORTPC_Withhold = PC_WH_M_M ; in pc_rcode_actions()
1306 else if (phy->t_val[3] || phy->r_val[3]) { in pc_rcode_actions()
1307 mib->fddiPORTPC_Withhold = PC_WH_NONE ; in pc_rcode_actions()
1308 if (mib->fddiPORTMy_Type == TM || in pc_rcode_actions()
1309 mib->fddiPORTNeighborType == TM) in pc_rcode_actions()
1310 phy->pc_mode = PM_TREE ; in pc_rcode_actions()
1312 phy->pc_mode = PM_PEER ; in pc_rcode_actions()
1317 if (phy->wc_flag) { in pc_rcode_actions()
1318 mib->fddiPORTPC_Withhold = PC_WH_PATH ; in pc_rcode_actions()
1322 mib->fddiPORTPC_Withhold = PC_WH_OTHER ; in pc_rcode_actions()
1325 phy->phy_name,0) ; in pc_rcode_actions()
1327 phy->twisted = ((mib->fddiPORTMy_Type != TS) && in pc_rcode_actions()
1328 (mib->fddiPORTMy_Type != TM) && in pc_rcode_actions()
1329 (mib->fddiPORTNeighborType == in pc_rcode_actions()
1330 mib->fddiPORTMy_Type)) ; in pc_rcode_actions()
1331 if (phy->twisted) { in pc_rcode_actions()
1333 phy->phy_name,0) ; in pc_rcode_actions()
1339 if (phy->t_val[4] || phy->r_val[4]) { in pc_rcode_actions()
1340 if ((phy->t_val[4] && phy->t_val[5]) || in pc_rcode_actions()
1341 (phy->r_val[4] && phy->r_val[5]) ) in pc_rcode_actions()
1342 phy->lc_test = LC_EXTENDED ; in pc_rcode_actions()
1344 phy->lc_test = LC_LONG ; in pc_rcode_actions()
1346 else if (phy->t_val[5] || phy->r_val[5]) in pc_rcode_actions()
1347 phy->lc_test = LC_MEDIUM ; in pc_rcode_actions()
1349 phy->lc_test = LC_SHORT ; in pc_rcode_actions()
1350 switch (phy->lc_test) { in pc_rcode_actions()
1352 outpw(PLC((int)phy->np,PL_LC_LENGTH), TP_LC_LENGTH ) ; in pc_rcode_actions()
1353 phy->t_next[7] = smc->s.pcm_lc_short ; in pc_rcode_actions()
1356 outpw(PLC((int)phy->np,PL_LC_LENGTH), TP_LC_LONGLN ) ; in pc_rcode_actions()
1357 phy->t_next[7] = smc->s.pcm_lc_medium ; in pc_rcode_actions()
1360 SETMASK(PLC((int)phy->np,PL_CNTRL_B),PL_LONG,PL_LONG) ; in pc_rcode_actions()
1361 phy->t_next[7] = smc->s.pcm_lc_long ; in pc_rcode_actions()
1364 SETMASK(PLC((int)phy->np,PL_CNTRL_B),PL_LONG,PL_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()
1371 DB_PCMN(1,"LCT timer = %ld us\n", phy->t_next[7], 0) ; in pc_rcode_actions()
1372 phy->t_next[9] = smc->s.pcm_t_next_9 ; in pc_rcode_actions()
1375 if (phy->t_val[6]) { in pc_rcode_actions()
1376 phy->cf_loop = TRUE ; in pc_rcode_actions()
1378 phy->td_flag = TRUE ; in pc_rcode_actions()
1381 if (phy->t_val[7] || phy->r_val[7]) { in pc_rcode_actions()
1383 phy->phy_name,phy->t_val[7]? "local":"remote") ; in pc_rcode_actions()
1384 queue_event(smc,(int)(EVENT_PCM+phy->np),PC_START) ; in pc_rcode_actions()
1388 if (phy->t_val[8] || phy->r_val[8]) { in pc_rcode_actions()
1389 if (phy->t_val[8]) in pc_rcode_actions()
1390 phy->cf_loop = TRUE ; in pc_rcode_actions()
1391 phy->td_flag = TRUE ; in pc_rcode_actions()
1395 if (phy->r_val[9]) { in pc_rcode_actions()
1397 mib->fddiPORTMacIndicated.R_val = TRUE ; in pc_rcode_actions()
1401 mib->fddiPORTMacIndicated.R_val = FALSE ; in pc_rcode_actions()
1412 int np = phy->np ; in pc_tcode_actions()
1415 mib = phy->mib ; in pc_tcode_actions()
1419 phy->t_val[0] = 0 ; /* no escape used */ in pc_tcode_actions()
1422 if (mib->fddiPORTMy_Type == TS || mib->fddiPORTMy_Type == TM) in pc_tcode_actions()
1423 phy->t_val[1] = 1 ; in pc_tcode_actions()
1425 phy->t_val[1] = 0 ; in pc_tcode_actions()
1428 if (mib->fddiPORTMy_Type == TB || mib->fddiPORTMy_Type == TM) in pc_tcode_actions()
1429 phy->t_val[2] = 1 ; in pc_tcode_actions()
1431 phy->t_val[2] = 0 ; in pc_tcode_actions()
1438 type = mib->fddiPORTMy_Type ; in pc_tcode_actions()
1439 ne = mib->fddiPORTNeighborType ; in pc_tcode_actions()
1440 policy = smc->mib.fddiSMTConnectionPolicy ; in pc_tcode_actions()
1442 phy->t_val[3] = 1 ; /* Accept connection */ in pc_tcode_actions()
1450 phy->t_val[3] = 0 ; /* Reject */ in pc_tcode_actions()
1458 phy->t_val[3] = 0 ; /* Reject */ in pc_tcode_actions()
1466 phy->t_val[3] = 0 ; /* Reject */ in pc_tcode_actions()
1474 phy->t_val[3] = 0 ; /* Reject */ in pc_tcode_actions()
1488 (int) (INDEX_PORT+ phy->np) ,0) ; in pc_tcode_actions()
1494 if (mib->fddiPORTPC_Withhold == PC_WH_NONE) { in pc_tcode_actions()
1495 if (phy->pc_lem_fail) { in pc_tcode_actions()
1496 phy->t_val[4] = 1 ; /* long */ in pc_tcode_actions()
1497 phy->t_val[5] = 0 ; in pc_tcode_actions()
1500 phy->t_val[4] = 0 ; in pc_tcode_actions()
1501 if (mib->fddiPORTLCTFail_Ct > 0) in pc_tcode_actions()
1502 phy->t_val[5] = 1 ; /* medium */ in pc_tcode_actions()
1504 phy->t_val[5] = 0 ; /* short */ in pc_tcode_actions()
1511 if (phy->wc_flag) in pc_tcode_actions()
1512 phy->t_val[5] = 1 ; /* medium */ in pc_tcode_actions()
1514 mib->fddiPORTConnectState = PCM_CONNECTING ; in pc_tcode_actions()
1517 mib->fddiPORTConnectState = PCM_STANDBY ; in pc_tcode_actions()
1518 phy->t_val[4] = 1 ; /* extended */ in pc_tcode_actions()
1519 phy->t_val[5] = 1 ; in pc_tcode_actions()
1526 phy->t_val[6] = 0 ; in pc_tcode_actions()
1529 phy->cf_loop = FALSE ; in pc_tcode_actions()
1531 if (phy->pc_lem_fail) { in pc_tcode_actions()
1533 phy->phy_name,0) ; in pc_tcode_actions()
1534 phy->t_val[7] = 1 ; in pc_tcode_actions()
1537 phy->t_val[7] = 0 ; in pc_tcode_actions()
1540 phy->t_val[8] = 0 ; /* Don't request MAC loopback */ in pc_tcode_actions()
1543 phy->cf_loop = 0 ; in pc_tcode_actions()
1544 if ((mib->fddiPORTPC_Withhold != PC_WH_NONE) || in pc_tcode_actions()
1545 ((smc->s.sas == SMT_DAS) && (phy->wc_flag))) { in pc_tcode_actions()
1549 phy->t_val[9] = FALSE ; in pc_tcode_actions()
1550 switch (smc->s.sas) { in pc_tcode_actions()
1555 if (phy->pc_mode == PM_TREE) { in pc_tcode_actions()
1557 (smc->y[PB].mib->fddiPORTConnectState != in pc_tcode_actions()
1559 phy->t_val[9] = TRUE ; in pc_tcode_actions()
1563 phy->t_val[9] = TRUE ; in pc_tcode_actions()
1568 phy->t_val[9] = TRUE ; in pc_tcode_actions()
1576 phy->t_val[9] = TRUE ; in pc_tcode_actions()
1580 mib->fddiPORTMacIndicated.T_val = phy->t_val[9] ; in pc_tcode_actions()
1583 DB_PCMN(1,"SIG snd %x %x:\n", bit,phy->t_val[bit] ) ; in pc_tcode_actions()
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()
1611 struct s_phy *phy = &smc->y[np] ; in pcm_status_state()
1614 mib = phy->mib ; in pcm_status_state()
1616 /* remote PHY type and MAC - set only if active */ in pcm_status_state()
1618 *type = mib->fddiPORTMy_Type ; /* our PHY type */ in pcm_status_state()
1619 *state = mib->fddiPORTConnectState ; in pcm_status_state()
1620 *remote = mib->fddiPORTNeighborType ; in pcm_status_state()
1622 switch(mib->fddiPORTPCMState) { in pcm_status_state()
1624 *mac = mib->fddiPORTMacIndicated.R_val ; in pcm_status_state()
1637 if (smc->y[n].mib->fddiPORTPCMState == PC8_ACTIVE && in pcm_rooted_station()
1638 smc->y[n].mib->fddiPORTNeighborType == TM) in pcm_rooted_station()
1650 struct s_phy *phy = &smc->y[np] ; in plc_irq()
1651 struct s_plc *plc = &phy->plc ; in plc_irq()
1658 if (np >= smc->s.numphys) { in plc_irq()
1659 plc->soft_err++ ; in plc_irq()
1662 if (cmd & PL_EBUF_ERR) { /* elastic buff. det. over-|underflow*/ in plc_irq()
1666 if (!plc->ebuf_cont && phy->mib->fddiPORTPCMState == PC8_ACTIVE){ in plc_irq()
1673 phy->mib->fddiPORTEBError_Ct ++ ; in plc_irq()
1677 plc->ebuf_err++ ; in plc_irq()
1678 if (plc->ebuf_cont <= 1000) { in plc_irq()
1683 plc->ebuf_cont++ ; /* Ebuf continuous error */ in plc_irq()
1687 if (plc->ebuf_cont == 1000 && in plc_irq()
1721 plc->ebuf_cont = 0 ; /* reset Ebuf continuous error */ in plc_irq()
1724 plc->phyinv++ ; in plc_irq()
1727 plc->vsym_ctr++ ; in plc_irq()
1730 plc->mini_ctr++ ; in plc_irq()
1746 if (phy->lem.lem_on) { in plc_irq()
1750 phy->lem.lem_errors += i ; in plc_irq()
1751 phy->mib->fddiPORTLem_Ct += i ; in plc_irq()
1755 if (plc->p_state == PS_LCT) { in plc_irq()
1761 plc->tpc_exp++ ; in plc_irq()
1765 case PL_I_IDLE : phy->curr_ls = PC_ILS ; break ; in plc_irq()
1766 case PL_I_HALT : phy->curr_ls = PC_HLS ; break ; in plc_irq()
1767 case PL_I_MASTR : phy->curr_ls = PC_MLS ; break ; in plc_irq()
1768 case PL_I_QUIET : phy->curr_ls = PC_QLS ; break ; in plc_irq()
1777 case PL_B_PCS : plc->b_pcs++ ; break ; in plc_irq()
1778 case PL_B_TPC : plc->b_tpc++ ; break ; in plc_irq()
1779 case PL_B_TNE : plc->b_tne++ ; break ; in plc_irq()
1780 case PL_B_QLS : plc->b_qls++ ; break ; in plc_irq()
1781 case PL_B_ILS : plc->b_ils++ ; break ; in plc_irq()
1782 case PL_B_HLS : plc->b_hls++ ; break ; in plc_irq()
1785 /*jd 05-Aug-1999 changed: Bug #10419 */ 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()
1799 if (cmd & PL_PCM_CODE) { /* receive last sign.-bit | LCT complete */ in plc_irq()
1802 for (i = 0 ; i < plc->p_bits ; i++) { in plc_irq()
1803 phy->r_val[plc->p_start+i] = n & 1 ; in plc_irq()
1812 if (!phy->tr_flag) { in plc_irq()
1814 np,smc->mib.fddiSMTECMState) ; in plc_irq()
1815 phy->tr_flag = TRUE ; in plc_irq()
1816 smc->e.trace_prop |= ENTITY_BIT(ENTITY_PHY(np)) ; in plc_irq()
1824 if ((cmd & PL_SELF_TEST) && (phy->mib->fddiPORTPCMState == PC2_TRACE)) { in plc_irq()
1826 if (smc->e.path_test == PT_PASSED) { in plc_irq()
1828 phy->mib->fddiPORTPCMState) ; in plc_irq()
1830 smc->e.path_test = PT_PENDING ; in plc_irq()
1836 if (phy->mib->fddiPORTPCMState == PC8_ACTIVE) { in plc_irq()
1837 if (!phy->tr_flag) { in plc_irq()
1838 DB_PCMN(1,"PCM %c : PC81 %s\n",phy->phy_name,"NSE"); in plc_irq()
1845 if (cmd & PL_NP_ERR) { /* NP has requested to r/w an inv reg*/ in plc_irq()
1849 plc->np_err++ ; in plc_irq()
1852 if (cmd & PL_PARITY_ERR) { /* p. error dedected on TX9-0 inp */ in plc_irq()
1853 plc->parity_err++ ; in plc_irq()
1875 for (i = 0, phy = smc->y, pcs = state->pcm_state ; i < NUMPHYS ; in pcm_get_state()
1877 mib = phy->mib ; in pcm_get_state()
1878 pcs->pcm_type = (u_char) mib->fddiPORTMy_Type ; in pcm_get_state()
1879 pcs->pcm_state = (u_char) mib->fddiPORTPCMState ; in pcm_get_state()
1880 pcs->pcm_mode = phy->pc_mode ; in pcm_get_state()
1881 pcs->pcm_neighbor = (u_char) mib->fddiPORTNeighborType ; in pcm_get_state()
1882 pcs->pcm_bsf = mib->fddiPORTBS_Flag ; in pcm_get_state()
1883 pcs->pcm_lsf = phy->ls_flag ; in pcm_get_state()
1884 pcs->pcm_lct_fail = (u_char) mib->fddiPORTLCTFail_Ct ; in pcm_get_state()
1885 pcs->pcm_ls_rx = LS2MIB(sm_pm_get_ls(smc,i)) ; in pcm_get_state()
1889 if (phy->r_val[NUMBITS-1-ii]) in pcm_get_state()
1891 if (phy->t_val[NUMBITS-1-ii]) in pcm_get_state()
1894 pcs->pcm_r_val = rbits ; in pcm_get_state()
1895 pcs->pcm_t_val = tbits ; in pcm_get_state()
1971 plc = &smc->y[np].plc ; in list_phy()
1974 plc->soft_err,plc->b_pcs); in list_phy()
1976 plc->parity_err,plc->b_tpc,get_linestate(smc,np)) ; in list_phy()
1978 plc->ebuf_err,plc->b_tne) ; in list_phy()
1980 plc->phyinv,plc->b_qls,get_pcmstate(smc,np)) ; in list_phy()
1982 plc->vsym_ctr,plc->b_ils) ; in list_phy()
1984 plc->mini_ctr,plc->b_hls) ; in list_phy()
1985 printf("\tnodepr_err: %ld\n",plc->np_err) ; in list_phy()
1986 printf("\tTPC_exp : %ld\n",plc->tpc_exp) ; in list_phy()
1987 printf("\tLEM_err : %ld\n",smc->y[np].lem.lem_errors) ; in list_phy()
2002 printf("----------------------\n") ; in pcm_lem_dump()
2003 for (i = 0,phy = smc->y ; i < NUMPHYS ; i++,phy++) { in pcm_lem_dump()
2006 mib = phy->mib ; in pcm_lem_dump()
2007 printf("%s\t%ld\t10E-%d\n", in pcm_lem_dump()
2009 mib->fddiPORTLem_Ct, in pcm_lem_dump()
2010 mib->fddiPORTLer_Estimate) ; in pcm_lem_dump()