/*---------------------------------------------------------------------------* * FSM state ST_AW_EST event T200 expiry *---------------------------------------------------------------------------*/ static void F_AE11(l2_softc_t *l2sc) { NDBGL2(L2_F_MSG, "FSM function F_AE11 executing"); if(l2sc->RC >= N200) { i4b_Dcleanifq(&l2sc->i_queue); i4b_mdl_error_ind(l2sc, "F_AE11", MDL_ERR_G); l2sc->postfsmarg = l2sc->unit; l2sc->postfsmfunc = DL_Rel_Ind_A; l2sc->Q921_state = ST_TEI_ASGD; } else { l2sc->RC++; i4b_tx_sabme(l2sc, P1); i4b_T200_start(l2sc); l2sc->Q921_state = ST_AW_EST; } }
/*---------------------------------------------------------------------------* * FSM state ST_MULTIFR event rx'd SABME *---------------------------------------------------------------------------*/ static void F_MF07(l2_softc_t *l2sc) { NDBGL2(L2_F_MSG, "FSM function F_MF07 executing"); i4b_clear_exception_conditions(l2sc); MDL_Status_Ind(l2sc->unit, STI_L2STAT, LAYER_ACTIVE); i4b_tx_ua(l2sc, l2sc->rxd_PF); i4b_mdl_error_ind(l2sc, "F_MF07", MDL_ERR_F); if(l2sc->vs != l2sc->va) { i4b_Dcleanifq(&l2sc->i_queue); l2sc->postfsmarg = l2sc->unit; l2sc->postfsmfunc = DL_Est_Ind_A; } i4b_T200_stop(l2sc); i4b_T203_start(l2sc); l2sc->vs = 0; l2sc->va = 0; l2sc->vr = 0; }
/*---------------------------------------------------------------------------* * routine CLEAR EXCEPTION CONDITIONS (Q.921 03/93 page 83) *---------------------------------------------------------------------------*/ void i4b_clear_exception_conditions(l2_softc_t *l2sc) { CRIT_VAR; CRIT_BEG; /*XXX -------------------------------------------------------------- */ /*XXX is this really appropriate here or should it moved elsewhere ? */ i4b_Dcleanifq(&l2sc->i_queue); if(l2sc->ua_num != UA_EMPTY) { i4b_Dfreembuf(l2sc->ua_frame); l2sc->ua_num = UA_EMPTY; } /*XXX -------------------------------------------------------------- */ l2sc->peer_busy = 0; l2sc->rej_excpt = 0; l2sc->own_busy = 0; l2sc->ack_pend = 0; CRIT_END; }
/*---------------------------------------------------------------------------* * FSM state ST_AW_EST event dl establish request *---------------------------------------------------------------------------*/ static void F_AE01(l2_softc_t *l2sc) { NDBGL2(L2_F_MSG, "FSM function F_AE01 executing"); i4b_Dcleanifq(&l2sc->i_queue); l2sc->l3initiated = 1; }
/*---------------------------------------------------------------------------* * i4bclose - device driver close routine *---------------------------------------------------------------------------*/ PDEVSTATIC int i4bclose(dev_t dev, int flag, int fmt, struct proc *p) { int x = splimp(); openflag = 0; i4b_l4_daemon_detached(); i4b_Dcleanifq(&i4b_rdqueue); splx(x); return(0); }
/*---------------------------------------------------------------------------* * i4bclose - device driver close routine *---------------------------------------------------------------------------*/ PDEVSTATIC int i4bclose(struct dev_close_args *ap) { crit_enter(); openflag = 0; i4b_l4_daemon_detached(); i4b_Dcleanifq(&i4b_rdqueue); crit_exit(); return(0); }
/*---------------------------------------------------------------------------* * FSM state ST_TIMREC event dl establish request *---------------------------------------------------------------------------*/ static void F_TR01(l2_softc_t *l2sc) { NDBGL2(L2_F_MSG, "FSM function F_TR01 executing"); i4b_Dcleanifq(&l2sc->i_queue); i4b_establish_data_link(l2sc); l2sc->l3initiated = 1; }
/*---------------------------------------------------------------------------* * i4bclose - device driver close routine *---------------------------------------------------------------------------*/ PDEVSTATIC int isdnclose(dev_t dev, int flag, int fmt, struct lwp *l) { int x = splnet(); openflag = 0; i4b_l4_daemon_detached(); i4b_Dcleanifq(&i4b_rdqueue); splx(x); return(0); }
/*---------------------------------------------------------------------------* * FSM state ST_AW_EST event persistent deactivation *---------------------------------------------------------------------------*/ static void F_AE05(l2_softc_t *l2sc) { NDBGL2(L2_F_MSG, "FSM function F_AE05 executing"); i4b_Dcleanifq(&l2sc->i_queue); l2sc->postfsmarg = l2sc->unit; l2sc->postfsmfunc = DL_Rel_Ind_A; i4b_T200_stop(l2sc); }
/*---------------------------------------------------------------------------* * FSM state ST_TIMREC event dl release request *---------------------------------------------------------------------------*/ static void F_TR13(l2_softc_t *l2sc) { NDBGL2(L2_F_MSG, "FSM function F_TR13 executing"); i4b_Dcleanifq(&l2sc->i_queue); l2sc->RC = 0; i4b_tx_disc(l2sc, P1); i4b_T200_restart(l2sc); }
/*---------------------------------------------------------------------------* * FSM state ST_TIMREC event rx'd DISC *---------------------------------------------------------------------------*/ static void F_TR08(l2_softc_t *l2sc) { NDBGL2(L2_F_MSG, "FSM function F_TR08 executing"); i4b_Dcleanifq(&l2sc->i_queue); MDL_Status_Ind(l2sc->unit, STI_L2STAT, LAYER_IDLE); i4b_tx_ua(l2sc, l2sc->rxd_PF); l2sc->postfsmarg = l2sc->unit; l2sc->postfsmfunc = DL_Rel_Ind_A; i4b_T200_stop(l2sc); }
/*---------------------------------------------------------------------------* * FSM state ST_TIMREC event mdl remove request *---------------------------------------------------------------------------*/ static void F_TR06(l2_softc_t *l2sc) { NDBGL2(L2_F_MSG, "FSM function F_TR06 executing"); i4b_Dcleanifq(&l2sc->i_queue); l2sc->postfsmarg = l2sc->unit; l2sc->postfsmfunc = DL_Rel_Ind_A; i4b_T200_stop(l2sc); /*XXX*/ i4b_mdl_assign_ind(l2sc); }
/*---------------------------------------------------------------------------* * FSM state ST_AW_EST event rx'd DM *---------------------------------------------------------------------------*/ static void F_AE10(l2_softc_t *l2sc) { NDBGL2(L2_F_MSG, "FSM function F_AE10 executing"); if(l2sc->rxd_PF == 0) { l2sc->Q921_state = ST_AW_EST; } else { i4b_Dcleanifq(&l2sc->i_queue); l2sc->postfsmarg = l2sc->unit; l2sc->postfsmfunc = DL_Rel_Ind_A; i4b_T200_stop(l2sc); l2sc->Q921_state = ST_TEI_ASGD; } }
/*---------------------------------------------------------------------------* * FSM state ST_AW_EST event rx'd UA *---------------------------------------------------------------------------*/ static void F_AE09(l2_softc_t *l2sc) { NDBGL2(L2_F_MSG, "FSM function F_AE09 executing"); if(l2sc->rxd_PF == 0) { i4b_mdl_error_ind(l2sc, "F_AE09", MDL_ERR_D); l2sc->Q921_state = ST_AW_EST; } else { if(l2sc->l3initiated) { l2sc->l3initiated = 0; l2sc->vr = 0; l2sc->postfsmarg = l2sc->unit; l2sc->postfsmfunc = DL_Est_Cnf_A; } else { if(l2sc->vs != l2sc->va) { i4b_Dcleanifq(&l2sc->i_queue); l2sc->postfsmarg = l2sc->unit; l2sc->postfsmfunc = DL_Est_Ind_A; } } MDL_Status_Ind(l2sc->unit, STI_L2STAT, LAYER_ACTIVE); i4b_T200_stop(l2sc); i4b_T203_start(l2sc); l2sc->vs = 0; l2sc->va = 0; l2sc->Q921_state = ST_MULTIFR; } }
/*---------------------------------------------------------------------------* * T3 timeout - persistant deactivation *---------------------------------------------------------------------------*/ static void ihfc_T3_expired(ihfc_sc_t *sc) { u_char chan = 0; HFC_VAR; HFC_BEG; S_STM_T3 = 0; if (S_PHSTATE != 3) /* line was not activated */ { i4b_Dcleanifq(&S_IFQUEUE); i4b_l1_ph_deactivate_ind(S_I4BUNIT); i4b_l1_mph_status_ind(S_I4BUNIT, STI_PDEACT, 0, 0); HFC_FSM(sc, 2); /* L1 deactivate */ } HFC_END; }