Lines Matching refs:tm

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