Lines Matching refs:l2
112 struct layer2 *l2; in da_deactivate() local
116 list_for_each_entry(l2, &mgr->layer2, list) { in da_deactivate()
117 if (l2->l2m.state > ST_L2_4) { in da_deactivate()
144 struct layer2 *l2; in da_timer() local
149 list_for_each_entry(l2, &mgr->layer2, list) { in da_timer()
150 if (l2->l2m.state > ST_L2_4) { in da_timer()
225 printk(KERN_DEBUG "tei(%d): ", tm->l2->tei); in tei_debug()
238 struct layer2 *l2; in get_free_id() local
240 list_for_each_entry(l2, &mgr->layer2, list) { in get_free_id()
241 if (l2->ch.nr > 63) { in get_free_id()
247 test_and_set_bit(l2->ch.nr, (u_long *)&ids); in get_free_id()
262 struct layer2 *l2; in get_free_tei() local
264 list_for_each_entry(l2, &mgr->layer2, list) { in get_free_tei()
265 if (l2->ch.nr == 0) in get_free_tei()
267 if ((l2->ch.addr & 0xff) != 0) in get_free_tei()
269 i = l2->ch.addr >> 8; in get_free_tei()
408 struct layer2 *l2; in findtei() local
412 list_for_each_entry(l2, &mgr->layer2, list) { in findtei()
413 if ((l2->sapi == 0) && (l2->tei > 0) && in findtei()
414 (l2->tei != GROUP_TEI) && (l2->tei == tei)) in findtei()
417 l2 = NULL; in findtei()
420 return l2; in findtei()
453 if (tm->l2->tei != GROUP_TEI) { in tei_id_request()
456 tm->l2->tei); in tei_id_request()
473 struct layer2 *l2; in tei_id_assign() local
484 l2 = findtei(tm->mgr, tei); in tei_id_assign()
485 if (l2) { /* same tei is in use */ in tei_id_assign()
486 if (ri != l2->tm->ri) { in tei_id_assign()
489 tei_l2(l2, MDL_ERROR_RSP, 0); in tei_id_assign()
494 tei_l2(tm->l2, MDL_ASSIGN_REQ, tei); in tei_id_assign()
502 struct layer2 *l2; in tei_id_test_dup() local
513 l2 = findtei(tm->mgr, tei); in tei_id_test_dup()
514 if (l2) { /* same tei is in use */ in tei_id_test_dup()
515 if (ri != l2->tm->ri) { /* and it wasn't our request */ in tei_id_test_dup()
518 mISDN_FsmEvent(&l2->tm->tei_m, EV_VERIFY, NULL); in tei_id_test_dup()
549 if ((tm->l2->tei != GROUP_TEI) && ((tei == GROUP_TEI) || in tei_id_chk_req()
550 (tei == tm->l2->tei))) { in tei_id_chk_req()
553 put_tei_msg(tm->mgr, ID_CHK_RES, random_ri(), tm->l2->tei); in tei_id_chk_req()
567 if ((tm->l2->tei != GROUP_TEI) && in tei_id_remove()
568 ((tei == GROUP_TEI) || (tei == tm->l2->tei))) { in tei_id_remove()
571 tei_l2(tm->l2, MDL_REMOVE_REQ, 0); in tei_id_remove()
582 tm->l2->tei); in tei_id_verify()
583 put_tei_msg(tm->mgr, ID_VERIFY, 0, tm->l2->tei); in tei_id_verify()
603 tei_l2(tm->l2, MDL_ERROR_RSP, 0); in tei_id_req_tout()
617 3 - tm->nval, tm->l2->tei); in tei_id_ver_tout()
618 put_tei_msg(tm->mgr, ID_VERIFY, 0, tm->l2->tei); in tei_id_ver_tout()
622 tm->l2->tei); in tei_id_ver_tout()
623 tei_l2(tm->l2, MDL_REMOVE_REQ, 0); in tei_id_ver_tout()
644 tei_l2remove(struct layer2 *l2) in tei_l2remove() argument
646 put_tei_msg(l2->tm->mgr, ID_REMOVE, 0, l2->tei); in tei_l2remove()
647 tei_l2(l2, MDL_REMOVE_REQ, 0); in tei_l2remove()
648 list_del(&l2->ch.list); in tei_l2remove()
649 l2->ch.ctrl(&l2->ch, CLOSE_CHANNEL, NULL); in tei_l2remove()
658 if (tm->l2->tei == GROUP_TEI) { in tei_assign_req()
668 put_tei_msg(tm->mgr, ID_ASSIGNED, tm->ri, tm->l2->tei); in tei_assign_req()
679 tm->l2->tei); in tei_id_chk_req_net()
681 put_tei_msg(tm->mgr, ID_CHK_REQ, 0, tm->l2->tei); in tei_id_chk_req_net()
697 if (tei == tm->l2->tei) in tei_id_chk_resp()
711 tei, tm->l2->tei); in tei_id_verify_net()
712 if (tei == tm->l2->tei) in tei_id_verify_net()
724 "check req for tei %d sucessful\n", tm->l2->tei); in tei_id_ver_tout_net()
728 tei_l2remove(tm->l2); in tei_id_ver_tout_net()
733 3 - tm->nval, tm->l2->tei); in tei_id_ver_tout_net()
734 put_tei_msg(tm->mgr, ID_CHK_REQ, 0, tm->l2->tei); in tei_id_ver_tout_net()
738 tm->l2->tei); in tei_id_ver_tout_net()
740 tei_l2remove(tm->l2); in tei_id_ver_tout_net()
756 if (test_bit(FLG_FIXED_TEI, &tm->l2->flag)) in tei_ph_data_ind()
780 struct layer2 *l2; in create_new_tei() local
789 l2 = create_l2(mgr->up, ISDN_P_LAPD_NT, (u_int)opt, (u_long)tei); in create_new_tei()
790 if (!l2) { in create_new_tei()
794 l2->tm = kzalloc(sizeof(struct teimgr), GFP_KERNEL); in create_new_tei()
795 if (!l2->tm) { in create_new_tei()
796 kfree(l2); in create_new_tei()
800 l2->tm->mgr = mgr; in create_new_tei()
801 l2->tm->l2 = l2; in create_new_tei()
802 l2->tm->tei_m.debug = *debug & DEBUG_L2_TEIFSM; in create_new_tei()
803 l2->tm->tei_m.userdata = l2->tm; in create_new_tei()
804 l2->tm->tei_m.printdebug = tei_debug; in create_new_tei()
805 l2->tm->tei_m.fsm = &teifsmn; in create_new_tei()
806 l2->tm->tei_m.state = ST_TEI_NOP; in create_new_tei()
807 l2->tm->tval = 2000; /* T202 2 sec */ in create_new_tei()
808 mISDN_FsmInitTimer(&l2->tm->tei_m, &l2->tm->timer); in create_new_tei()
811 list_add_tail(&l2->list, &mgr->layer2); in create_new_tei()
814 l2->ch.ctrl(&l2->ch, CLOSE_CHANNEL, NULL); in create_new_tei()
818 l2->ch.nr = id; in create_new_tei()
819 __add_layer2(&l2->ch, mgr->ch.st); in create_new_tei()
820 l2->ch.recv = mgr->ch.recv; in create_new_tei()
821 l2->ch.peer = mgr->ch.peer; in create_new_tei()
822 l2->ch.ctrl(&l2->ch, OPEN_CHANNEL, NULL); in create_new_tei()
824 return l2; in create_new_tei()
831 struct layer2 *l2; in new_tei_req() local
842 l2 = create_new_tei(mgr, tei); in new_tei_req()
843 if (!l2) in new_tei_req()
846 mISDN_FsmEvent(&l2->tm->tei_m, EV_ASSIGN_REQ, dp); in new_tei_req()
856 struct layer2 *l2; in ph_data_ind() local
904 list_for_each_entry(l2, &mgr->layer2, list) { in ph_data_ind()
905 tei_ph_data_ind(l2->tm, mt, &skb->data[4], skb->len - 4); in ph_data_ind()
913 l2_tei(struct layer2 *l2, u_int cmd, u_long arg) in l2_tei() argument
915 struct teimgr *tm = l2->tm; in l2_tei()
917 if (test_bit(FLG_FIXED_TEI, &l2->flag)) in l2_tei()
927 mISDN_FsmEvent(&tm->tei_m, EV_CHKREQ, &l2->tei); in l2_tei()
948 TEIrelease(struct layer2 *l2) in TEIrelease() argument
950 struct teimgr *tm = l2->tm; in TEIrelease()
955 list_del(&l2->list); in TEIrelease()
957 l2->tm = NULL; in TEIrelease()
964 struct layer2 *l2; in create_teimgr() local
1014 list_for_each_entry(l2, &mgr->layer2, list) { in create_teimgr()
1015 l2->up = mgr->up; in create_teimgr()
1016 l2->ch.ctrl(&l2->ch, OPEN_CHANNEL, NULL); in create_teimgr()
1022 l2 = create_l2(crq->ch, crq->protocol, (u_int)opt, in create_teimgr()
1024 if (!l2) in create_teimgr()
1026 l2->tm = kzalloc(sizeof(struct teimgr), GFP_KERNEL); in create_teimgr()
1027 if (!l2->tm) { in create_teimgr()
1028 kfree(l2); in create_teimgr()
1032 l2->tm->mgr = mgr; in create_teimgr()
1033 l2->tm->l2 = l2; in create_teimgr()
1034 l2->tm->tei_m.debug = *debug & DEBUG_L2_TEIFSM; in create_teimgr()
1035 l2->tm->tei_m.userdata = l2->tm; in create_teimgr()
1036 l2->tm->tei_m.printdebug = tei_debug; in create_teimgr()
1038 l2->tm->tei_m.fsm = &teifsmu; in create_teimgr()
1039 l2->tm->tei_m.state = ST_TEI_NOP; in create_teimgr()
1040 l2->tm->tval = 1000; /* T201 1 sec */ in create_teimgr()
1042 l2->tm->tei_m.fsm = &teifsmn; in create_teimgr()
1043 l2->tm->tei_m.state = ST_TEI_NOP; in create_teimgr()
1044 l2->tm->tval = 2000; /* T202 2 sec */ in create_teimgr()
1046 mISDN_FsmInitTimer(&l2->tm->tei_m, &l2->tm->timer); in create_teimgr()
1049 list_add_tail(&l2->list, &mgr->layer2); in create_teimgr()
1052 l2->ch.ctrl(&l2->ch, CLOSE_CHANNEL, NULL); in create_teimgr()
1054 l2->ch.nr = id; in create_teimgr()
1055 l2->up->nr = id; in create_teimgr()
1056 crq->ch = &l2->ch; in create_teimgr()
1104 struct layer2 *l2, *nl2; in free_teimanager() local
1110 list_for_each_entry_safe(l2, nl2, &mgr->layer2, list) { in free_teimanager()
1111 put_tei_msg(mgr, ID_REMOVE, 0, l2->tei); in free_teimanager()
1113 list_del(&l2->ch.list); in free_teimanager()
1115 l2->ch.ctrl(&l2->ch, CLOSE_CHANNEL, NULL); in free_teimanager()
1119 list_for_each_entry_safe(l2, nl2, &mgr->layer2, list) { in free_teimanager()
1120 l2->up = NULL; in free_teimanager()
1151 struct layer2 *l2; in check_data() local
1173 l2 = create_new_tei(mgr, tei); in check_data()
1174 if (!l2) in check_data()
1176 ret = l2->ch.send(&l2->ch, skb); in check_data()
1184 struct layer2 *l2, *nl2; in delete_teimanager() local
1188 list_for_each_entry_safe(l2, nl2, &mgr->layer2, list) { in delete_teimanager()
1190 list_del(&l2->ch.list); in delete_teimanager()
1192 l2->ch.ctrl(&l2->ch, CLOSE_CHANNEL, NULL); in delete_teimanager()
1232 struct layer2 *l2; in mgr_bcast() local
1237 list_for_each_entry(l2, &mgr->layer2, list) { in mgr_bcast()
1239 (l2->ch.addr & MISDN_ID_SAPI_MASK)) { in mgr_bcast()
1240 if (list_is_last(&l2->list, &mgr->layer2)) { in mgr_bcast()
1248 ret = l2->ch.send(&l2->ch, cskb); in mgr_bcast()
1254 __func__, l2->ch.nr, in mgr_bcast()
1255 hh->prim, l2->ch.addr, ret); in mgr_bcast()