Lines Matching refs:tm

221 	struct teimgr	*tm = fi->userdata;
234 tm->l2->sapi, tm->l2->tei, &vaf);
458 struct teimgr *tm = fi->userdata;
460 if (tm->l2->tei != GROUP_TEI) {
461 tm->tei_m.printdebug(&tm->tei_m,
463 tm->l2->tei);
466 tm->ri = random_ri();
468 tm->tei_m.printdebug(&tm->tei_m,
469 "assign request ri %d", tm->ri);
470 put_tei_msg(tm->mgr, ID_REQUEST, tm->ri, GROUP_TEI);
472 mISDN_FsmAddTimer(&tm->timer, tm->tval, EV_TIMER, NULL, 1);
473 tm->nval = 3;
479 struct teimgr *tm = fi->userdata;
489 tm->tei_m.printdebug(fi, "identity assign ri %d tei %d",
491 l2 = findtei(tm->mgr, tei);
493 if (ri != l2->tm->ri) {
494 tm->tei_m.printdebug(fi,
498 } else if (ri == tm->ri) {
499 mISDN_FsmDelTimer(&tm->timer, 1);
501 tei_l2(tm->l2, MDL_ASSIGN_REQ, tei);
508 struct teimgr *tm = fi->userdata;
518 tm->tei_m.printdebug(fi, "foreign identity assign ri %d tei %d",
520 l2 = findtei(tm->mgr, tei);
522 if (ri != l2->tm->ri) { /* and it wasn't our request */
523 tm->tei_m.printdebug(fi,
525 mISDN_FsmEvent(&l2->tm->tei_m, EV_VERIFY, NULL);
533 struct teimgr *tm = fi->userdata;
542 tm->tei_m.printdebug(fi, "identity denied ri %d tei %d",
549 struct teimgr *tm = fi->userdata;
555 tm->tei_m.printdebug(fi, "identity check req tei %d", tei);
556 if ((tm->l2->tei != GROUP_TEI) && ((tei == GROUP_TEI) ||
557 (tei == tm->l2->tei))) {
558 mISDN_FsmDelTimer(&tm->timer, 4);
559 mISDN_FsmChangeState(&tm->tei_m, ST_TEI_NOP);
560 put_tei_msg(tm->mgr, ID_CHK_RES, random_ri(), tm->l2->tei);
567 struct teimgr *tm = fi->userdata;
573 tm->tei_m.printdebug(fi, "identity remove tei %d", tei);
574 if ((tm->l2->tei != GROUP_TEI) &&
575 ((tei == GROUP_TEI) || (tei == tm->l2->tei))) {
576 mISDN_FsmDelTimer(&tm->timer, 5);
577 mISDN_FsmChangeState(&tm->tei_m, ST_TEI_NOP);
578 tei_l2(tm->l2, MDL_REMOVE_REQ, 0);
585 struct teimgr *tm = fi->userdata;
588 tm->tei_m.printdebug(fi, "id verify request for tei %d",
589 tm->l2->tei);
590 put_tei_msg(tm->mgr, ID_VERIFY, 0, tm->l2->tei);
591 mISDN_FsmChangeState(&tm->tei_m, ST_TEI_IDVERIFY);
592 mISDN_FsmAddTimer(&tm->timer, tm->tval, EV_TIMER, NULL, 2);
593 tm->nval = 2;
599 struct teimgr *tm = fi->userdata;
601 if (--tm->nval) {
602 tm->ri = random_ri();
604 tm->tei_m.printdebug(fi, "assign req(%d) ri %d",
605 4 - tm->nval, tm->ri);
606 put_tei_msg(tm->mgr, ID_REQUEST, tm->ri, GROUP_TEI);
607 mISDN_FsmAddTimer(&tm->timer, tm->tval, EV_TIMER, NULL, 3);
609 tm->tei_m.printdebug(fi, "assign req failed");
610 tei_l2(tm->l2, MDL_ERROR_RSP, 0);
618 struct teimgr *tm = fi->userdata;
620 if (--tm->nval) {
622 tm->tei_m.printdebug(fi,
624 3 - tm->nval, tm->l2->tei);
625 put_tei_msg(tm->mgr, ID_VERIFY, 0, tm->l2->tei);
626 mISDN_FsmAddTimer(&tm->timer, tm->tval, EV_TIMER, NULL, 4);
628 tm->tei_m.printdebug(fi, "verify req for tei %d failed",
629 tm->l2->tei);
630 tei_l2(tm->l2, MDL_REMOVE_REQ, 0);
653 put_tei_msg(l2->tm->mgr, ID_REMOVE, 0, l2->tei);
662 struct teimgr *tm = fi->userdata;
665 if (tm->l2->tei == GROUP_TEI) {
666 tm->tei_m.printdebug(&tm->tei_m,
670 tm->ri = ((unsigned int) *dp++ << 8);
671 tm->ri += *dp++;
673 tm->tei_m.printdebug(&tm->tei_m,
674 "net assign request ri %d teim %d", tm->ri, *dp);
675 put_tei_msg(tm->mgr, ID_ASSIGNED, tm->ri, tm->l2->tei);
682 struct teimgr *tm = fi->userdata;
685 tm->tei_m.printdebug(fi, "id check request for tei %d",
686 tm->l2->tei);
687 tm->rcnt = 0;
688 put_tei_msg(tm->mgr, ID_CHK_REQ, 0, tm->l2->tei);
689 mISDN_FsmChangeState(&tm->tei_m, ST_TEI_IDVERIFY);
690 mISDN_FsmAddTimer(&tm->timer, tm->tval, EV_TIMER, NULL, 2);
691 tm->nval = 2;
697 struct teimgr *tm = fi->userdata;
703 tm->tei_m.printdebug(fi, "identity check resp tei %d", tei);
704 if (tei == tm->l2->tei)
705 tm->rcnt++;
711 struct teimgr *tm = fi->userdata;
717 tm->tei_m.printdebug(fi, "identity verify req tei %d/%d",
718 tei, tm->l2->tei);
719 if (tei == tm->l2->tei)
726 struct teimgr *tm = fi->userdata;
728 if (tm->rcnt == 1) {
730 tm->tei_m.printdebug(fi,
731 "check req for tei %d successful\n", tm->l2->tei);
733 } else if (tm->rcnt > 1) {
735 tei_l2remove(tm->l2);
736 } else if (--tm->nval) {
738 tm->tei_m.printdebug(fi,
740 3 - tm->nval, tm->l2->tei);
741 put_tei_msg(tm->mgr, ID_CHK_REQ, 0, tm->l2->tei);
742 mISDN_FsmAddTimer(&tm->timer, tm->tval, EV_TIMER, NULL, 4);
744 tm->tei_m.printdebug(fi, "check req for tei %d failed",
745 tm->l2->tei);
747 tei_l2remove(tm->l2);
761 tei_ph_data_ind(struct teimgr *tm, u_int mt, u_char *dp, int len)
763 if (test_bit(FLG_FIXED_TEI, &tm->l2->flag))
766 tm->tei_m.printdebug(&tm->tei_m, "tei handler mt %x", mt);
768 mISDN_FsmEvent(&tm->tei_m, EV_ASSIGN, dp);
770 mISDN_FsmEvent(&tm->tei_m, EV_DENIED, dp);
772 mISDN_FsmEvent(&tm->tei_m, EV_CHKREQ, dp);
774 mISDN_FsmEvent(&tm->tei_m, EV_REMOVE, dp);
776 mISDN_FsmEvent(&tm->tei_m, EV_VERIFY, dp);
778 mISDN_FsmEvent(&tm->tei_m, EV_CHKRESP, dp);
806 l2->tm = kzalloc(sizeof(struct teimgr), GFP_KERNEL);
807 if (!l2->tm) {
812 l2->tm->mgr = mgr;
813 l2->tm->l2 = l2;
814 l2->tm->tei_m.debug = *debug & DEBUG_L2_TEIFSM;
815 l2->tm->tei_m.userdata = l2->tm;
816 l2->tm->tei_m.printdebug = tei_debug;
817 l2->tm->tei_m.fsm = &teifsmn;
818 l2->tm->tei_m.state = ST_TEI_NOP;
819 l2->tm->tval = 2000; /* T202 2 sec */
820 mISDN_FsmInitTimer(&l2->tm->tei_m, &l2->tm->timer);
871 mISDN_FsmEvent(&l2->tm->tei_m, EV_ASSIGN_REQ, dp);
927 tei_ph_data_ind(l2->tm, mt, &skb->data[4], skb->len - 4);
936 struct teimgr *tm = l2->tm;
944 mISDN_FsmEvent(&tm->tei_m, EV_IDREQ, NULL);
947 if (test_bit(MGR_OPT_NETWORK, &tm->mgr->options))
948 mISDN_FsmEvent(&tm->tei_m, EV_CHKREQ, &l2->tei);
949 if (test_bit(MGR_OPT_USER, &tm->mgr->options))
950 mISDN_FsmEvent(&tm->tei_m, EV_VERIFY, NULL);
953 if (test_bit(MGR_OPT_NETWORK, &tm->mgr->options))
954 mISDN_FsmEvent(&tm->mgr->deact, EV_ACTIVATE, NULL);
957 if (test_bit(MGR_OPT_NETWORK, &tm->mgr->options))
958 mISDN_FsmEvent(&tm->mgr->deact, EV_DEACTIVATE, NULL);
961 if (test_bit(MGR_OPT_NETWORK, &tm->mgr->options))
962 mISDN_FsmEvent(&tm->mgr->deact, EV_UI, NULL);
971 struct teimgr *tm = l2->tm;
974 mISDN_FsmDelTimer(&tm->timer, 1);
975 write_lock_irqsave(&tm->mgr->lock, flags);
977 write_unlock_irqrestore(&tm->mgr->lock, flags);
978 l2->tm = NULL;
979 kfree(tm);
1049 l2->tm = kzalloc(sizeof(struct teimgr), GFP_KERNEL);
1050 if (!l2->tm) {
1055 l2->tm->mgr = mgr;
1056 l2->tm->l2 = l2;
1057 l2->tm->tei_m.debug = *debug & DEBUG_L2_TEIFSM;
1058 l2->tm->tei_m.userdata = l2->tm;
1059 l2->tm->tei_m.printdebug = tei_debug;
1061 l2->tm->tei_m.fsm = &teifsmu;
1062 l2->tm->tei_m.state = ST_TEI_NOP;
1063 l2->tm->tval = 1000; /* T201 1 sec */
1069 l2->tm->tei_m.fsm = &teifsmn;
1070 l2->tm->tei_m.state = ST_TEI_NOP;
1071 l2->tm->tval = 2000; /* T202 2 sec */
1077 mISDN_FsmInitTimer(&l2->tm->tei_m, &l2->tm->timer);