Lines Matching refs:l2

109 	struct layer2	*l2;  in da_deactivate()  local
113 list_for_each_entry(l2, &mgr->layer2, list) { in da_deactivate()
114 if (l2->l2m.state > ST_L2_4) { in da_deactivate()
146 struct layer2 *l2; in da_timer() local
151 list_for_each_entry(l2, &mgr->layer2, list) { in da_timer()
152 if (l2->l2m.state > ST_L2_4) { in da_timer()
234 tm->l2->sapi, tm->l2->tei, &vaf); in tei_debug()
246 struct layer2 *l2; in get_free_id() local
248 list_for_each_entry(l2, &mgr->layer2, list) { in get_free_id()
249 if (l2->ch.nr > 63) { in get_free_id()
255 __set_bit(l2->ch.nr, ids); in get_free_id()
270 struct layer2 *l2; in get_free_tei() local
272 list_for_each_entry(l2, &mgr->layer2, list) { in get_free_tei()
273 if (l2->ch.nr == 0) in get_free_tei()
275 if ((l2->ch.addr & 0xff) != 0) in get_free_tei()
277 i = l2->ch.addr >> 8; in get_free_tei()
416 struct layer2 *l2; in findtei() local
420 list_for_each_entry(l2, &mgr->layer2, list) { in findtei()
421 if ((l2->sapi == 0) && (l2->tei > 0) && in findtei()
422 (l2->tei != GROUP_TEI) && (l2->tei == tei)) in findtei()
425 l2 = NULL; in findtei()
428 return l2; in findtei()
460 if (tm->l2->tei != GROUP_TEI) { in tei_id_request()
463 tm->l2->tei); in tei_id_request()
480 struct layer2 *l2; in tei_id_assign() local
491 l2 = findtei(tm->mgr, tei); in tei_id_assign()
492 if (l2) { /* same tei is in use */ in tei_id_assign()
493 if (ri != l2->tm->ri) { in tei_id_assign()
496 tei_l2(l2, MDL_ERROR_RSP, 0); in tei_id_assign()
501 tei_l2(tm->l2, MDL_ASSIGN_REQ, tei); in tei_id_assign()
509 struct layer2 *l2; in tei_id_test_dup() local
520 l2 = findtei(tm->mgr, tei); in tei_id_test_dup()
521 if (l2) { /* same tei is in use */ in tei_id_test_dup()
522 if (ri != l2->tm->ri) { /* and it wasn't our request */ in tei_id_test_dup()
525 mISDN_FsmEvent(&l2->tm->tei_m, EV_VERIFY, NULL); in tei_id_test_dup()
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()
560 put_tei_msg(tm->mgr, ID_CHK_RES, random_ri(), tm->l2->tei); in tei_id_chk_req()
574 if ((tm->l2->tei != GROUP_TEI) && in tei_id_remove()
575 ((tei == GROUP_TEI) || (tei == tm->l2->tei))) { in tei_id_remove()
578 tei_l2(tm->l2, MDL_REMOVE_REQ, 0); in tei_id_remove()
589 tm->l2->tei); in tei_id_verify()
590 put_tei_msg(tm->mgr, ID_VERIFY, 0, tm->l2->tei); in tei_id_verify()
610 tei_l2(tm->l2, MDL_ERROR_RSP, 0); in tei_id_req_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()
629 tm->l2->tei); in tei_id_ver_tout()
630 tei_l2(tm->l2, MDL_REMOVE_REQ, 0); in tei_id_ver_tout()
651 tei_l2remove(struct layer2 *l2) in tei_l2remove() argument
653 put_tei_msg(l2->tm->mgr, ID_REMOVE, 0, l2->tei); in tei_l2remove()
654 tei_l2(l2, MDL_REMOVE_REQ, 0); in tei_l2remove()
655 list_del(&l2->ch.list); in tei_l2remove()
656 l2->ch.ctrl(&l2->ch, CLOSE_CHANNEL, NULL); in tei_l2remove()
665 if (tm->l2->tei == GROUP_TEI) { in tei_assign_req()
675 put_tei_msg(tm->mgr, ID_ASSIGNED, tm->ri, tm->l2->tei); in tei_assign_req()
686 tm->l2->tei); 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()
704 if (tei == tm->l2->tei) in tei_id_chk_resp()
718 tei, tm->l2->tei); in tei_id_verify_net()
719 if (tei == tm->l2->tei) in tei_id_verify_net()
731 "check req for tei %d successful\n", tm->l2->tei); in tei_id_ver_tout_net()
735 tei_l2remove(tm->l2); 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()
745 tm->l2->tei); in tei_id_ver_tout_net()
747 tei_l2remove(tm->l2); in tei_id_ver_tout_net()
763 if (test_bit(FLG_FIXED_TEI, &tm->l2->flag)) in tei_ph_data_ind()
787 struct layer2 *l2; in create_new_tei() local
801 l2 = create_l2(mgr->up, ISDN_P_LAPD_NT, opt, tei, sapi); in create_new_tei()
802 if (!l2) { in create_new_tei()
806 l2->tm = kzalloc(sizeof(struct teimgr), GFP_KERNEL); in create_new_tei()
807 if (!l2->tm) { in create_new_tei()
808 kfree(l2); 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()
823 list_add_tail(&l2->list, &mgr->layer2); in create_new_tei()
826 l2->ch.ctrl(&l2->ch, CLOSE_CHANNEL, NULL); in create_new_tei()
830 l2->ch.nr = id; in create_new_tei()
831 __add_layer2(&l2->ch, mgr->ch.st); in create_new_tei()
832 l2->ch.recv = mgr->ch.recv; in create_new_tei()
833 l2->ch.peer = mgr->ch.peer; in create_new_tei()
834 l2->ch.ctrl(&l2->ch, OPEN_CHANNEL, NULL); in create_new_tei()
840 l2->ch.ctrl(&l2->ch, CLOSE_CHANNEL, NULL); in create_new_tei()
841 l2 = NULL; in create_new_tei()
844 return l2; in create_new_tei()
851 struct layer2 *l2; in new_tei_req() local
867 l2 = create_new_tei(mgr, tei, CTRL_SAPI); in new_tei_req()
868 if (!l2) in new_tei_req()
871 mISDN_FsmEvent(&l2->tm->tei_m, EV_ASSIGN_REQ, dp); in new_tei_req()
881 struct layer2 *l2, *nl2; in ph_data_ind() local
926 list_for_each_entry_safe(l2, nl2, &mgr->layer2, list) { in ph_data_ind()
927 tei_ph_data_ind(l2->tm, mt, &skb->data[4], skb->len - 4); in ph_data_ind()
934 l2_tei(struct layer2 *l2, u_int cmd, u_long arg) in l2_tei() argument
936 struct teimgr *tm = l2->tm; in l2_tei()
938 if (test_bit(FLG_FIXED_TEI, &l2->flag)) in l2_tei()
948 mISDN_FsmEvent(&tm->tei_m, EV_CHKREQ, &l2->tei); in l2_tei()
969 TEIrelease(struct layer2 *l2) in TEIrelease() argument
971 struct teimgr *tm = l2->tm; in TEIrelease()
976 list_del(&l2->list); in TEIrelease()
978 l2->tm = NULL; in TEIrelease()
985 struct layer2 *l2; in create_teimgr() local
1037 list_for_each_entry(l2, &mgr->layer2, list) { in create_teimgr()
1038 l2->up = mgr->up; in create_teimgr()
1039 l2->ch.ctrl(&l2->ch, OPEN_CHANNEL, NULL); in create_teimgr()
1045 l2 = create_l2(crq->ch, crq->protocol, opt, in create_teimgr()
1047 if (!l2) in create_teimgr()
1049 l2->tm = kzalloc(sizeof(struct teimgr), GFP_KERNEL); in create_teimgr()
1050 if (!l2->tm) { in create_teimgr()
1051 kfree(l2); 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()
1080 list_add_tail(&l2->list, &mgr->layer2); in create_teimgr()
1083 l2->ch.nr = id; in create_teimgr()
1084 l2->up->nr = id; in create_teimgr()
1085 crq->ch = &l2->ch; in create_teimgr()
1091 l2->ch.ctrl(&l2->ch, CLOSE_CHANNEL, NULL); in create_teimgr()
1141 struct layer2 *l2, *nl2; in free_teimanager() local
1148 list_for_each_entry_safe(l2, nl2, &mgr->layer2, list) { in free_teimanager()
1149 put_tei_msg(mgr, ID_REMOVE, 0, l2->tei); in free_teimanager()
1151 list_del(&l2->ch.list); in free_teimanager()
1153 l2->ch.ctrl(&l2->ch, CLOSE_CHANNEL, NULL); in free_teimanager()
1157 list_for_each_entry_safe(l2, nl2, &mgr->layer2, list) { in free_teimanager()
1158 l2->up = NULL; in free_teimanager()
1201 struct layer2 *l2; in check_data() local
1226 l2 = create_new_tei(mgr, tei, sapi); in check_data()
1227 if (!l2) { in check_data()
1233 ret = l2->ch.send(&l2->ch, skb); in check_data()
1241 struct layer2 *l2, *nl2; in delete_teimanager() local
1245 list_for_each_entry_safe(l2, nl2, &mgr->layer2, list) { in delete_teimanager()
1247 list_del(&l2->ch.list); in delete_teimanager()
1249 l2->ch.ctrl(&l2->ch, CLOSE_CHANNEL, NULL); in delete_teimanager()
1289 struct layer2 *l2; in mgr_bcast() local
1294 list_for_each_entry(l2, &mgr->layer2, list) { in mgr_bcast()
1296 (l2->ch.addr & MISDN_ID_SAPI_MASK)) { in mgr_bcast()
1297 if (list_is_last(&l2->list, &mgr->layer2)) { in mgr_bcast()
1311 hhc->id = l2->ch.nr; in mgr_bcast()
1318 __func__, l2->ch.nr, in mgr_bcast()
1319 hh->prim, l2->ch.addr, ret); in mgr_bcast()