static void l2_restart_multi(struct FsmInst *fi, int event, void *arg) { struct PStack *st = fi->userdata; struct sk_buff *skb = arg; int est = 0, state; state = fi->state; send_uframe(st, UA | get_PollFlagFree(st, skb), RSP); st->ma.layer(st, MDL_ERROR | INDICATION, (void *) 'F'); if (st->l2.vs != st->l2.va) { skb_queue_purge(&st->l2.i_queue); est = 1; } clear_exception(&st->l2); st->l2.vs = 0; st->l2.va = 0; st->l2.vr = 0; st->l2.sow = 0; FsmChangeState(fi, ST_L2_7); stop_t200(st, 3); FsmRestartTimer(&st->l2.t203, st->l2.T203, EV_L2_T203, NULL, 3); if (est) st->l2.l2l3(st, DL_ESTABLISH | INDICATION, NULL); if ((ST_L2_7==state) || (ST_L2_8 == state)) if (!skb_queue_empty(&st->l2.i_queue) && cansend(st)) st->l2.l2l1(st, PH_PULL | REQUEST, NULL); }
static void l2_restart_multi(struct FsmInst *fi, int event, void *arg) { struct layer2 *l2 = fi->userdata; struct sk_buff *skb = arg; int est = 0; send_uframe(l2, skb, UA | get_PollFlag(l2, skb), RSP); l2mgr(l2, MDL_ERROR_IND, (void *) 'F'); if (l2->vs != l2->va) { skb_queue_purge(&l2->i_queue); est = 1; } clear_exception(l2); l2->vs = 0; l2->va = 0; l2->vr = 0; l2->sow = 0; mISDN_FsmChangeState(fi, ST_L2_7); stop_t200(l2, 3); mISDN_FsmRestartTimer(&l2->t203, l2->T203, EV_L2_T203, NULL, 3); if (est) l2up_create(l2, DL_ESTABLISH_IND, 0, NULL); /* mISDN_queue_data(&l2->inst, l2->inst.id | MSG_BROADCAST, * MGR_SHORTSTATUS | INDICATION, SSTATUS_L2_ESTABLISHED, * 0, NULL, 0); */ if (skb_queue_len(&l2->i_queue) && cansend(l2)) mISDN_FsmEvent(fi, EV_L2_ACK_PULL, NULL); }
static void l2_restart_multi(struct FsmInst *fi, int event, void *arg) { layer2_t *l2 = fi->userdata; msg_t *msg = arg; int est = 0; send_uframe(l2, msg, UA | get_PollFlag(l2, msg), RSP); l2mgr(l2, MDL_ERROR | INDICATION, (void *) 'F'); if (l2->vs != l2->va) { msg_queue_purge(&l2->i_queue); est = 1; } clear_exception(l2); l2->vs = 0; l2->va = 0; l2->vr = 0; l2->sow = 0; FsmChangeState(fi, ST_L2_7); stop_t200(l2, 3); FsmRestartTimer(&l2->t203, l2->T203, EV_L2_T203, NULL, 3); if (est) l2up_create(l2, DL_ESTABLISH | INDICATION, CES(l2), 0, NULL); if (msg_queue_len(&l2->i_queue) && cansend(l2)) FsmEvent(fi, EV_L2_ACK_PULL, NULL); }
static void l2_send_DM(struct FsmInst *fi, int event, void *arg) { struct layer2 *l2 = fi->userdata; struct sk_buff *skb = arg; send_uframe(l2, skb, DM | get_PollFlag(l2, skb), RSP); }
static void l2_send_DM(struct FsmInst *fi, int event, void *arg) { layer2_t *l2 = fi->userdata; msg_t *msg = arg; send_uframe(l2, msg, DM | get_PollFlag(l2, msg), RSP); }
static void l2_send_DM(struct FsmInst *fi, int event, void *arg) { struct PStack *st = fi->userdata; struct sk_buff *skb = arg; send_uframe(st, DM | get_PollFlagFree(st, skb), RSP); }
static void l2_disconnect(struct FsmInst *fi, int event, void *arg) { struct PStack *st = fi->userdata; skb_queue_purge(&st->l2.i_queue); freewin(st); FsmChangeState(fi, ST_L2_6); st->l2.rc = 0; send_uframe(st, DISC | 0x10, CMD); FsmDelTimer(&st->l2.t203, 1); restart_t200(st, 2); }
static void l2_stop_multi(struct FsmInst *fi, int event, void *arg) { layer2_t *l2 = fi->userdata; msg_t *msg = arg; FsmChangeState(fi, ST_L2_4); FsmDelTimer(&l2->t203, 3); stop_t200(l2, 4); send_uframe(l2, msg, UA | get_PollFlag(l2, msg), RSP); msg_queue_purge(&l2->i_queue); freewin(l2); lapb_dl_release_l2l3(l2, INDICATION); }
static void establishlink(struct FsmInst *fi) { struct layer2 *l2 = fi->userdata; u_char cmd; clear_exception(l2); l2->rc = 0; cmd = (test_bit(FLG_MOD128, &l2->flag) ? SABME : SABM) | 0x10; send_uframe(l2, NULL, cmd, CMD); mISDN_FsmDelTimer(&l2->t203, 1); restart_t200(l2, 1); test_and_clear_bit(FLG_PEND_REL, &l2->flag); freewin(l2); mISDN_FsmChangeState(fi, ST_L2_5); }
static void l2_stop_multi(struct FsmInst *fi, int event, void *arg) { struct PStack *st = fi->userdata; struct sk_buff *skb = arg; FsmChangeState(fi, ST_L2_4); FsmDelTimer(&st->l2.t203, 3); stop_t200(st, 4); send_uframe(st, UA | get_PollFlagFree(st, skb), RSP); skb_queue_purge(&st->l2.i_queue); freewin(st); lapb_dl_release_l2l3(st, INDICATION); }
static void establishlink(struct FsmInst *fi) { struct PStack *st = fi->userdata; u_char cmd; clear_exception(&st->l2); st->l2.rc = 0; cmd = (test_bit(FLG_MOD128, &st->l2.flag) ? SABME : SABM) | 0x10; send_uframe(st, cmd, CMD); FsmDelTimer(&st->l2.t203, 1); restart_t200(st, 1); test_and_clear_bit(FLG_PEND_REL, &st->l2.flag); freewin(st); FsmChangeState(fi, ST_L2_5); }
static void l2_disconnect(struct FsmInst *fi, int event, void *arg) { struct layer2 *l2 = fi->userdata; struct sk_buff *skb = arg; skb_queue_purge(&l2->i_queue); freewin(l2); mISDN_FsmChangeState(fi, ST_L2_6); l2->rc = 0; send_uframe(l2, NULL, DISC | 0x10, CMD); mISDN_FsmDelTimer(&l2->t203, 1); restart_t200(l2, 2); if (skb) dev_kfree_skb(skb); }
static void l2_disconnect(struct FsmInst *fi, int event, void *arg) { layer2_t *l2 = fi->userdata; msg_t *msg = arg; msg_queue_purge(&l2->i_queue); freewin(l2); FsmChangeState(fi, ST_L2_6); l2->rc = 0; send_uframe(l2, NULL, DISC | 0x10, CMD); FsmDelTimer(&l2->t203, 1); restart_t200(l2, 2); if (msg) free_msg(msg); }
static void l2_stop_multi(struct FsmInst *fi, int event, void *arg) { struct layer2 *l2 = fi->userdata; struct sk_buff *skb = arg; mISDN_FsmChangeState(fi, ST_L2_4); mISDN_FsmDelTimer(&l2->t203, 3); stop_t200(l2, 4); send_uframe(l2, skb, UA | get_PollFlag(l2, skb), RSP); skb_queue_purge(&l2->i_queue); freewin(l2); lapb_dl_release_l2l3(l2, DL_RELEASE_IND); if (l2->tm) l2_tei(l2, MDL_STATUS_DOWN_IND, 0); }
static void l2_start_multi(struct FsmInst *fi, int event, void *arg) { struct PStack *st = fi->userdata; struct sk_buff *skb = arg; send_uframe(st, UA | get_PollFlagFree(st, skb), RSP); clear_exception(&st->l2); st->l2.vs = 0; st->l2.va = 0; st->l2.vr = 0; st->l2.sow = 0; FsmChangeState(fi, ST_L2_7); FsmAddTimer(&st->l2.t203, st->l2.T203, EV_L2_T203, NULL, 3); st->l2.l2l3(st, DL_ESTABLISH | INDICATION, NULL); }
static void l2_start_multi(struct FsmInst *fi, int event, void *arg) { struct layer2 *l2 = fi->userdata; struct sk_buff *skb = arg; l2->vs = 0; l2->va = 0; l2->vr = 0; l2->sow = 0; clear_exception(l2); send_uframe(l2, NULL, UA | get_PollFlag(l2, skb), RSP); mISDN_FsmChangeState(fi, ST_L2_7); mISDN_FsmAddTimer(&l2->t203, l2->T203, EV_L2_T203, NULL, 3); skb_trim(skb, 0); l2up(l2, DL_ESTABLISH_IND, skb); if (l2->tm) l2_tei(l2, MDL_STATUS_UP_IND, 0); }
static void l2_start_multi(struct FsmInst *fi, int event, void *arg) { layer2_t *l2 = fi->userdata; msg_t *msg = arg; send_uframe(l2, NULL, UA | get_PollFlag(l2, msg), RSP); clear_exception(l2); l2->vs = 0; l2->va = 0; l2->vr = 0; l2->sow = 0; FsmChangeState(fi, ST_L2_7); FsmAddTimer(&l2->t203, l2->T203, EV_L2_T203, NULL, 3); msg_trim(msg, 0); msg_push(msg, mISDNUSER_HEAD_SIZE); if (l2up(l2, DL_ESTABLISH | INDICATION, CES(l2), msg)) free_msg(msg); }