static void tei_id_assign(struct FsmInst *fi, int event, void *arg) { struct PStack *ost, *st = fi->userdata; struct sk_buff *skb = arg; struct IsdnCardState *cs; int ri, tei; ri = ((unsigned int) skb->data[1] << 8) + skb->data[2]; tei = skb->data[4] >> 1; if (st->ma.debug) st->ma.tei_m.printdebug(&st->ma.tei_m, "identity assign ri %d tei %d", ri, tei); if ((ost = findtei(st, tei))) { /* same tei is in use */ if (ri != ost->ma.ri) { st->ma.tei_m.printdebug(&st->ma.tei_m, "possible duplicate assignment tei %d", tei); ost->l2.l2tei(ost, MDL_ERROR | RESPONSE, NULL); } } else if (ri == st->ma.ri) { FsmDelTimer(&st->ma.t202, 1); FsmChangeState(&st->ma.tei_m, ST_TEI_NOP); L3L2(st, MDL_ASSIGN | REQUEST, (void *) (long) tei); cs = (struct IsdnCardState *) st->l1.hardware; mdl_assign(cs); } }
static void tei_id_test_dup(struct FsmInst *fi, int event, void *arg) { struct PStack *ost, *st = fi->userdata; struct sk_buff *skb = arg; int tei, ri; ri = ((unsigned int) skb->data[1] << 8) + skb->data[2]; tei = skb->data[4] >> 1; if (st->ma.debug) st->ma.tei_m.printdebug(&st->ma.tei_m, "foreign identity assign ri %d tei %d", ri, tei); if ((ost = findtei(st, tei))) { /* same tei is in use */ st->ma.tei_m.printdebug(&st->ma.tei_m, "possible duplicate assignment tei %d", tei); FsmEvent(&ost->ma.tei_m, EV_VERIFY, NULL); } }
static void tei_id_test_dup(struct FsmInst *fi, int event, void *arg) { teimgr_t *otm, *tm = fi->userdata; u_char *dp = arg; int tei, ri; ri = ((unsigned int) *dp++ << 8); ri += *dp++; dp++; tei = *dp >> 1; if (tm->debug) tm->tei_m.printdebug(fi, "foreign identity assign ri %d tei %d", ri, tei); if ((otm = findtei(tm, tei))) { /* same tei is in use */ if (ri != otm->ri) { /* and it wasn't our request */ tm->tei_m.printdebug(fi, "possible duplicate assignment tei %d", tei); mISDN_FsmEvent(&otm->tei_m, EV_VERIFY, NULL); } } }
static void tei_id_assign(struct FsmInst *fi, int event, void *arg) { teimgr_t *otm, *tm = fi->userdata; struct sk_buff *skb; u_char *dp = arg; int ri, tei; ri = ((unsigned int) *dp++ << 8); ri += *dp++; dp++; tei = *dp >> 1; if (tm->debug) tm->tei_m.printdebug(fi, "identity assign ri %d tei %d", ri, tei); if ((otm = findtei(tm, tei))) { /* same tei is in use */ if (ri != otm->ri) { tm->tei_m.printdebug(fi, "possible duplicate assignment tei %d", tei); skb = create_link_skb(MDL_ERROR | RESPONSE, 0, 0, NULL, 0); if (!skb) return; if (tei_l2(otm->l2, skb)) dev_kfree_skb(skb); } } else if (ri == tm->ri) { mISDN_FsmDelTimer(&tm->t202, 1); mISDN_FsmChangeState(fi, ST_TEI_NOP); skb = create_link_skb(MDL_ASSIGN | REQUEST, tei, 0, NULL, 0); if (!skb) return; if (tei_l2(tm->l2, skb)) dev_kfree_skb(skb); // cs->cardmsg(cs, MDL_ASSIGN | REQUEST, NULL); } }