• Home
  • Raw
  • Download

Lines Matching refs:tm

230 	struct teimgr	*tm = fi->userdata;  in tei_debug()  local
243 tm->l2->sapi, tm->l2->tei, &vaf); in tei_debug()
467 struct teimgr *tm = fi->userdata; in tei_id_request() local
469 if (tm->l2->tei != GROUP_TEI) { in tei_id_request()
470 tm->tei_m.printdebug(&tm->tei_m, in tei_id_request()
472 tm->l2->tei); in tei_id_request()
475 tm->ri = random_ri(); in tei_id_request()
477 tm->tei_m.printdebug(&tm->tei_m, in tei_id_request()
478 "assign request ri %d", tm->ri); in tei_id_request()
479 put_tei_msg(tm->mgr, ID_REQUEST, tm->ri, GROUP_TEI); in tei_id_request()
481 mISDN_FsmAddTimer(&tm->timer, tm->tval, EV_TIMER, NULL, 1); in tei_id_request()
482 tm->nval = 3; in tei_id_request()
488 struct teimgr *tm = fi->userdata; in tei_id_assign() local
498 tm->tei_m.printdebug(fi, "identity assign ri %d tei %d", in tei_id_assign()
500 l2 = findtei(tm->mgr, tei); in tei_id_assign()
502 if (ri != l2->tm->ri) { in tei_id_assign()
503 tm->tei_m.printdebug(fi, in tei_id_assign()
507 } else if (ri == tm->ri) { in tei_id_assign()
508 mISDN_FsmDelTimer(&tm->timer, 1); in tei_id_assign()
510 tei_l2(tm->l2, MDL_ASSIGN_REQ, tei); in tei_id_assign()
517 struct teimgr *tm = fi->userdata; in tei_id_test_dup() local
527 tm->tei_m.printdebug(fi, "foreign identity assign ri %d tei %d", in tei_id_test_dup()
529 l2 = findtei(tm->mgr, tei); in tei_id_test_dup()
531 if (ri != l2->tm->ri) { /* and it wasn't our request */ in tei_id_test_dup()
532 tm->tei_m.printdebug(fi, in tei_id_test_dup()
534 mISDN_FsmEvent(&l2->tm->tei_m, EV_VERIFY, NULL); in tei_id_test_dup()
542 struct teimgr *tm = fi->userdata; in tei_id_denied() local
551 tm->tei_m.printdebug(fi, "identity denied ri %d tei %d", in tei_id_denied()
558 struct teimgr *tm = fi->userdata; in tei_id_chk_req() local
564 tm->tei_m.printdebug(fi, "identity check req tei %d", tei); in tei_id_chk_req()
565 if ((tm->l2->tei != GROUP_TEI) && ((tei == GROUP_TEI) || in tei_id_chk_req()
566 (tei == tm->l2->tei))) { in tei_id_chk_req()
567 mISDN_FsmDelTimer(&tm->timer, 4); in tei_id_chk_req()
568 mISDN_FsmChangeState(&tm->tei_m, ST_TEI_NOP); in tei_id_chk_req()
569 put_tei_msg(tm->mgr, ID_CHK_RES, random_ri(), tm->l2->tei); in tei_id_chk_req()
576 struct teimgr *tm = fi->userdata; in tei_id_remove() local
582 tm->tei_m.printdebug(fi, "identity remove tei %d", tei); in tei_id_remove()
583 if ((tm->l2->tei != GROUP_TEI) && in tei_id_remove()
584 ((tei == GROUP_TEI) || (tei == tm->l2->tei))) { in tei_id_remove()
585 mISDN_FsmDelTimer(&tm->timer, 5); in tei_id_remove()
586 mISDN_FsmChangeState(&tm->tei_m, ST_TEI_NOP); in tei_id_remove()
587 tei_l2(tm->l2, MDL_REMOVE_REQ, 0); in tei_id_remove()
594 struct teimgr *tm = fi->userdata; in tei_id_verify() local
597 tm->tei_m.printdebug(fi, "id verify request for tei %d", in tei_id_verify()
598 tm->l2->tei); in tei_id_verify()
599 put_tei_msg(tm->mgr, ID_VERIFY, 0, tm->l2->tei); in tei_id_verify()
600 mISDN_FsmChangeState(&tm->tei_m, ST_TEI_IDVERIFY); in tei_id_verify()
601 mISDN_FsmAddTimer(&tm->timer, tm->tval, EV_TIMER, NULL, 2); in tei_id_verify()
602 tm->nval = 2; in tei_id_verify()
608 struct teimgr *tm = fi->userdata; in tei_id_req_tout() local
610 if (--tm->nval) { in tei_id_req_tout()
611 tm->ri = random_ri(); in tei_id_req_tout()
613 tm->tei_m.printdebug(fi, "assign req(%d) ri %d", in tei_id_req_tout()
614 4 - tm->nval, tm->ri); in tei_id_req_tout()
615 put_tei_msg(tm->mgr, ID_REQUEST, tm->ri, GROUP_TEI); in tei_id_req_tout()
616 mISDN_FsmAddTimer(&tm->timer, tm->tval, EV_TIMER, NULL, 3); in tei_id_req_tout()
618 tm->tei_m.printdebug(fi, "assign req failed"); in tei_id_req_tout()
619 tei_l2(tm->l2, MDL_ERROR_RSP, 0); in tei_id_req_tout()
627 struct teimgr *tm = fi->userdata; in tei_id_ver_tout() local
629 if (--tm->nval) { in tei_id_ver_tout()
631 tm->tei_m.printdebug(fi, in tei_id_ver_tout()
633 3 - tm->nval, tm->l2->tei); in tei_id_ver_tout()
634 put_tei_msg(tm->mgr, ID_VERIFY, 0, tm->l2->tei); in tei_id_ver_tout()
635 mISDN_FsmAddTimer(&tm->timer, tm->tval, EV_TIMER, NULL, 4); in tei_id_ver_tout()
637 tm->tei_m.printdebug(fi, "verify req for tei %d failed", in tei_id_ver_tout()
638 tm->l2->tei); in tei_id_ver_tout()
639 tei_l2(tm->l2, MDL_REMOVE_REQ, 0); in tei_id_ver_tout()
662 put_tei_msg(l2->tm->mgr, ID_REMOVE, 0, l2->tei); in tei_l2remove()
671 struct teimgr *tm = fi->userdata; in tei_assign_req() local
674 if (tm->l2->tei == GROUP_TEI) { in tei_assign_req()
675 tm->tei_m.printdebug(&tm->tei_m, in tei_assign_req()
679 tm->ri = ((unsigned int) *dp++ << 8); in tei_assign_req()
680 tm->ri += *dp++; in tei_assign_req()
682 tm->tei_m.printdebug(&tm->tei_m, in tei_assign_req()
683 "net assign request ri %d teim %d", tm->ri, *dp); in tei_assign_req()
684 put_tei_msg(tm->mgr, ID_ASSIGNED, tm->ri, tm->l2->tei); in tei_assign_req()
691 struct teimgr *tm = fi->userdata; in tei_id_chk_req_net() local
694 tm->tei_m.printdebug(fi, "id check request for tei %d", in tei_id_chk_req_net()
695 tm->l2->tei); in tei_id_chk_req_net()
696 tm->rcnt = 0; in tei_id_chk_req_net()
697 put_tei_msg(tm->mgr, ID_CHK_REQ, 0, tm->l2->tei); in tei_id_chk_req_net()
698 mISDN_FsmChangeState(&tm->tei_m, ST_TEI_IDVERIFY); in tei_id_chk_req_net()
699 mISDN_FsmAddTimer(&tm->timer, tm->tval, EV_TIMER, NULL, 2); in tei_id_chk_req_net()
700 tm->nval = 2; in tei_id_chk_req_net()
706 struct teimgr *tm = fi->userdata; in tei_id_chk_resp() local
712 tm->tei_m.printdebug(fi, "identity check resp tei %d", tei); in tei_id_chk_resp()
713 if (tei == tm->l2->tei) in tei_id_chk_resp()
714 tm->rcnt++; in tei_id_chk_resp()
720 struct teimgr *tm = fi->userdata; in tei_id_verify_net() local
726 tm->tei_m.printdebug(fi, "identity verify req tei %d/%d", in tei_id_verify_net()
727 tei, tm->l2->tei); in tei_id_verify_net()
728 if (tei == tm->l2->tei) in tei_id_verify_net()
735 struct teimgr *tm = fi->userdata; in tei_id_ver_tout_net() local
737 if (tm->rcnt == 1) { in tei_id_ver_tout_net()
739 tm->tei_m.printdebug(fi, in tei_id_ver_tout_net()
740 "check req for tei %d successful\n", tm->l2->tei); in tei_id_ver_tout_net()
742 } else if (tm->rcnt > 1) { in tei_id_ver_tout_net()
744 tei_l2remove(tm->l2); in tei_id_ver_tout_net()
745 } else if (--tm->nval) { in tei_id_ver_tout_net()
747 tm->tei_m.printdebug(fi, in tei_id_ver_tout_net()
749 3 - tm->nval, tm->l2->tei); in tei_id_ver_tout_net()
750 put_tei_msg(tm->mgr, ID_CHK_REQ, 0, tm->l2->tei); in tei_id_ver_tout_net()
751 mISDN_FsmAddTimer(&tm->timer, tm->tval, EV_TIMER, NULL, 4); in tei_id_ver_tout_net()
753 tm->tei_m.printdebug(fi, "check req for tei %d failed", in tei_id_ver_tout_net()
754 tm->l2->tei); in tei_id_ver_tout_net()
756 tei_l2remove(tm->l2); in tei_id_ver_tout_net()
770 tei_ph_data_ind(struct teimgr *tm, u_int mt, u_char *dp, int len) in tei_ph_data_ind() argument
772 if (test_bit(FLG_FIXED_TEI, &tm->l2->flag)) in tei_ph_data_ind()
775 tm->tei_m.printdebug(&tm->tei_m, "tei handler mt %x", mt); in tei_ph_data_ind()
777 mISDN_FsmEvent(&tm->tei_m, EV_ASSIGN, dp); in tei_ph_data_ind()
779 mISDN_FsmEvent(&tm->tei_m, EV_DENIED, dp); in tei_ph_data_ind()
781 mISDN_FsmEvent(&tm->tei_m, EV_CHKREQ, dp); in tei_ph_data_ind()
783 mISDN_FsmEvent(&tm->tei_m, EV_REMOVE, dp); in tei_ph_data_ind()
785 mISDN_FsmEvent(&tm->tei_m, EV_VERIFY, dp); in tei_ph_data_ind()
787 mISDN_FsmEvent(&tm->tei_m, EV_CHKRESP, dp); in tei_ph_data_ind()
815 l2->tm = kzalloc(sizeof(struct teimgr), GFP_KERNEL); in create_new_tei()
816 if (!l2->tm) { in create_new_tei()
821 l2->tm->mgr = mgr; in create_new_tei()
822 l2->tm->l2 = l2; in create_new_tei()
823 l2->tm->tei_m.debug = *debug & DEBUG_L2_TEIFSM; in create_new_tei()
824 l2->tm->tei_m.userdata = l2->tm; in create_new_tei()
825 l2->tm->tei_m.printdebug = tei_debug; in create_new_tei()
826 l2->tm->tei_m.fsm = &teifsmn; in create_new_tei()
827 l2->tm->tei_m.state = ST_TEI_NOP; in create_new_tei()
828 l2->tm->tval = 2000; /* T202 2 sec */ in create_new_tei()
829 mISDN_FsmInitTimer(&l2->tm->tei_m, &l2->tm->timer); in create_new_tei()
880 mISDN_FsmEvent(&l2->tm->tei_m, EV_ASSIGN_REQ, dp); in new_tei_req()
936 tei_ph_data_ind(l2->tm, mt, &skb->data[4], skb->len - 4); in ph_data_ind()
945 struct teimgr *tm = l2->tm; in l2_tei() local
953 mISDN_FsmEvent(&tm->tei_m, EV_IDREQ, NULL); in l2_tei()
956 if (test_bit(MGR_OPT_NETWORK, &tm->mgr->options)) in l2_tei()
957 mISDN_FsmEvent(&tm->tei_m, EV_CHKREQ, &l2->tei); in l2_tei()
958 if (test_bit(MGR_OPT_USER, &tm->mgr->options)) in l2_tei()
959 mISDN_FsmEvent(&tm->tei_m, EV_VERIFY, NULL); in l2_tei()
962 if (test_bit(MGR_OPT_NETWORK, &tm->mgr->options)) in l2_tei()
963 mISDN_FsmEvent(&tm->mgr->deact, EV_ACTIVATE, NULL); in l2_tei()
966 if (test_bit(MGR_OPT_NETWORK, &tm->mgr->options)) in l2_tei()
967 mISDN_FsmEvent(&tm->mgr->deact, EV_DEACTIVATE, NULL); in l2_tei()
970 if (test_bit(MGR_OPT_NETWORK, &tm->mgr->options)) in l2_tei()
971 mISDN_FsmEvent(&tm->mgr->deact, EV_UI, NULL); in l2_tei()
980 struct teimgr *tm = l2->tm; in TEIrelease() local
983 mISDN_FsmDelTimer(&tm->timer, 1); in TEIrelease()
984 write_lock_irqsave(&tm->mgr->lock, flags); in TEIrelease()
986 write_unlock_irqrestore(&tm->mgr->lock, flags); in TEIrelease()
987 l2->tm = NULL; in TEIrelease()
988 kfree(tm); in TEIrelease()
1058 l2->tm = kzalloc(sizeof(struct teimgr), GFP_KERNEL); in create_teimgr()
1059 if (!l2->tm) { in create_teimgr()
1064 l2->tm->mgr = mgr; in create_teimgr()
1065 l2->tm->l2 = l2; in create_teimgr()
1066 l2->tm->tei_m.debug = *debug & DEBUG_L2_TEIFSM; in create_teimgr()
1067 l2->tm->tei_m.userdata = l2->tm; in create_teimgr()
1068 l2->tm->tei_m.printdebug = tei_debug; in create_teimgr()
1070 l2->tm->tei_m.fsm = &teifsmu; in create_teimgr()
1071 l2->tm->tei_m.state = ST_TEI_NOP; in create_teimgr()
1072 l2->tm->tval = 1000; /* T201 1 sec */ in create_teimgr()
1078 l2->tm->tei_m.fsm = &teifsmn; in create_teimgr()
1079 l2->tm->tei_m.state = ST_TEI_NOP; in create_teimgr()
1080 l2->tm->tval = 2000; /* T202 2 sec */ in create_teimgr()
1086 mISDN_FsmInitTimer(&l2->tm->tei_m, &l2->tm->timer); in create_teimgr()