Lines Matching refs:st
85 *ni1_new_l3_process(struct PStack *st, int cr) in ni1_new_l3_process() argument
88 if (!(proc = new_l3_process(st, cr))) in ni1_new_l3_process()
104 free_invoke_id(p->st, p->prot.ni1.invoke_id); in ni1_release_l3_process()
112 l3ni1_search_dummy_proc(struct PStack *st, int id) in l3ni1_search_dummy_proc() argument
113 { struct l3_process *pc = st->l3.proc; /* start of processes */ in l3ni1_search_dummy_proc()
130 l3ni1_dummy_return_result(struct PStack *st, int id, u_char *p, u_char nlen) in l3ni1_dummy_return_result() argument
135 if ((pc = l3ni1_search_dummy_proc(st, id))) in l3ni1_dummy_return_result()
138 cs = pc->st->l1.hardware; in l3ni1_dummy_return_result()
148 free_invoke_id(pc->st, pc->prot.ni1.invoke_id); in l3ni1_dummy_return_result()
155 l3_debug(st, "dummy return result id=0x%x result len=%d", id, nlen); in l3ni1_dummy_return_result()
163 l3ni1_dummy_error_return(struct PStack *st, int id, ulong error) in l3ni1_dummy_error_return() argument
168 if ((pc = l3ni1_search_dummy_proc(st, id))) in l3ni1_dummy_error_return()
171 cs = pc->st->l1.hardware; in l3ni1_dummy_error_return()
181 free_invoke_id(pc->st, pc->prot.ni1.invoke_id); in l3ni1_dummy_error_return()
188 l3_debug(st, "dummy return error id=0x%x error=0x%lx", id, error); in l3ni1_dummy_error_return()
196 l3ni1_dummy_invoke(struct PStack *st, int cr, int id, in l3ni1_dummy_invoke() argument
201 l3_debug(st, "dummy invoke %s id=0x%x ident=0x%x datalen=%d", in l3ni1_dummy_invoke()
205 cs = st->l1.hardware; in l3ni1_dummy_invoke()
220 l3ni1_parse_facility(struct PStack *st, struct l3_process *pc, in l3ni1_parse_facility() argument
229 st = pc->st; /* valid Stack */ in l3ni1_parse_facility()
231 if ((!st) || (cr >= 0)) return; /* neither pc nor st specified */ in l3ni1_parse_facility()
236 l3_debug(st, "qd_len == 0"); in l3ni1_parse_facility()
240 l3_debug(st, "supplementary service != 0x11"); in l3ni1_parse_facility()
248 l3_debug(st, "qd_len < 2"); in l3ni1_parse_facility()
254 l3_debug(st, "class and form != 0xA0"); in l3ni1_parse_facility()
263 { l3_debug(st, "qd_len < 1"); in l3ni1_parse_facility()
271 { l3_debug(st, "length format error or not implemented"); in l3ni1_parse_facility()
281 { l3_debug(st, "length format indefinite error"); in l3ni1_parse_facility()
292 { l3_debug(st, "qd_len < nlen"); in l3ni1_parse_facility()
298 { l3_debug(st, "nlen < 2"); in l3ni1_parse_facility()
303 l3_debug(st, "invoke identifier tag !=0x02"); in l3ni1_parse_facility()
310 l3_debug(st, "invoke id length format 2"); in l3ni1_parse_facility()
316 { l3_debug(st, "ilen > nlen || ilen == 0"); in l3ni1_parse_facility()
329 l3_debug(st, "nlen < 2 22"); in l3ni1_parse_facility()
333 l3_debug(st, "operation value !=0x02"); in l3ni1_parse_facility()
341 l3_debug(st, "ilen > nlen || ilen == 0 22"); in l3ni1_parse_facility()
353 l3ni1_dummy_invoke(st, cr, id, ident, p, nlen); in l3ni1_parse_facility()
356 l3_debug(st, "invoke break"); in l3ni1_parse_facility()
362 l3ni1_dummy_return_result(st, id, p, nlen); in l3ni1_parse_facility()
367 free_invoke_id(st, pc->prot.ni1.invoke_id); in l3ni1_parse_facility()
371 st->l3.l3l4(st, CC_REDIR | INDICATION, pc); } /* Diversion successful */ in l3ni1_parse_facility()
373 l3_debug(st, "return error unknown identifier"); in l3ni1_parse_facility()
378 { l3_debug(st, "return error nlen < 2"); in l3ni1_parse_facility()
383 l3_debug(st, "invoke error tag !=0x02"); in l3ni1_parse_facility()
390 l3_debug(st, "invoke return errlen > 4 "); in l3ni1_parse_facility()
396 { l3_debug(st, "error return ilen > nlen || ilen == 0"); in l3ni1_parse_facility()
407 l3ni1_dummy_error_return(st, id, err_ret); in l3ni1_parse_facility()
412 free_invoke_id(st, pc->prot.ni1.invoke_id); in l3ni1_parse_facility()
416 st->l3.l3l4(st, CC_REDIR | INDICATION, pc); in l3ni1_parse_facility()
419 l3_debug(st, "return result unknown identifier"); in l3ni1_parse_facility()
422 l3_debug(st, "facility default break tag=0x%02x", cp_tag); in l3ni1_parse_facility()
437 l3_msg(pc->st, DL_DATA | REQUEST, skb); in l3ni1_message()
458 l3_msg(pc->st, DL_DATA | REQUEST, skb); in l3ni1_message_plus_chid()
479 l3_msg(pc->st, DL_DATA | REQUEST, skb); in l3ni1_message_cause()
505 l3_msg(pc->st, DL_DATA | REQUEST, skb); in l3ni1_status_send()
541 l3_msg(pc->st, DL_DATA | REQUEST, skb); in l3ni1_msg_without_setup()
690 l3_debug(pc->st, "check IE shift%scodeset %d->%d", in check_infoelements()
722 l3_debug(pc->st, "check IE shift back codeset %d->%d", in check_infoelements()
730 l3_debug(pc->st, "check IE MT(%x) %d/%d/%d/%d", in check_infoelements()
773 l3_debug(pc->st, "l3ni1_check_messagetype_validity mt(%x) OK", mt); in l3ni1_check_messagetype_validity()
779 l3_debug(pc->st, "l3ni1_check_messagetype_validity mt(%x) fail", mt); in l3ni1_check_messagetype_validity()
791 l3_debug(pc->st, "check_infoelements ret %d", ret); in l3ni1_std_ie_err()
822 l3_debug(pc->st, "wrong chid len %d", *p); in l3ni1_get_channel_id()
828 l3_debug(pc->st, "wrong chid %x", *p); in l3ni1_get_channel_id()
898 l3_msg(pc->st, DL_DATA | REQUEST, skb); in l3ni1_msg_with_uus()
921 l3_debug(pc->st, "RELCMPL get_cause ret(%d)", ret); in l3ni1_release_cmpl()
926 pc->st->l3.l3l4(pc->st, CC_RELEASE | CONFIRM, pc); in l3ni1_release_cmpl()
1281 l3_msg(pc->st, DL_DATA | REQUEST, skb); in l3ni1_setup_req()
1293 l3_debug(pc->st, "setup answer with wrong chid %x", id); in l3ni1_call_proc()
1301 l3_debug(pc->st, "setup answer wrong chid (ret %d)", id); in l3ni1_call_proc()
1320 pc->st->l3.l3l4(pc->st, CC_PROCEEDING | INDICATION, pc); in l3ni1_call_proc()
1332 l3_debug(pc->st, "setup answer with wrong chid %x", id); in l3ni1_setup_ack()
1340 l3_debug(pc->st, "setup answer wrong chid (ret %d)", id); in l3ni1_setup_ack()
1359 pc->st->l3.l3l4(pc->st, CC_MORE_INFO | INDICATION, pc); in l3ni1_setup_ack()
1373 l3_debug(pc->st, "DISC get_cause ret(%d)", ret); in l3ni1_disconnect()
1380 l3ni1_parse_facility(pc->st, pc, pc->callref, p); in l3ni1_disconnect()
1391 pc->st->l3.l3l4(pc->st, CC_DISCONNECT | INDICATION, pc); in l3ni1_disconnect()
1417 pc->st->l3.l3l4(pc->st, CC_SETUP | CONFIRM, pc); in l3ni1_connect()
1435 pc->st->l3.l3l4(pc->st, CC_ALERTING | INDICATION, pc); in l3ni1_alerting()
1503 l3_debug(pc->st, "SI=%d, AI=%d", in l3ni1_setup()
1507 l3_debug(pc->st, "setup with wrong bearer(l=%d:%x,%x)", in l3ni1_setup()
1515 l3_debug(pc->st, "setup without bearer capabilities"); in l3ni1_setup()
1528 l3_debug(pc->st, "setup with wrong chid %x", in l3ni1_setup()
1537 l3_debug(pc->st, "setup without bchannel, call waiting"); in l3ni1_setup()
1542 l3_debug(pc->st, "setup with wrong chid ret %d", id); in l3ni1_setup()
1571 l3_debug(pc->st, "wrong called subaddress"); in l3ni1_setup()
1596 l3_debug(pc->st, "wrong calling subaddress"); in l3ni1_setup()
1601 pc->st->l3.l3l4(pc->st, CC_SETUP | INDICATION, pc); in l3ni1_setup()
1645 l3_msg(pc->st, DL_DATA | REQUEST, skb); in l3ni1_disconnect_req()
1655 l3_debug(pc->st, "D-chan connect for waiting call"); in l3ni1_setup_rsp()
1661 l3_debug(pc->st, "D-chan connect for waiting call"); in l3ni1_setup_rsp()
1682 pc->st->l3.l3l4(pc->st, CC_SETUP_COMPL | INDICATION, pc); in l3ni1_connect_ack()
1708 l3_msg(pc->st, DL_DATA | REQUEST, skb); in l3ni1_reject_req()
1709 pc->st->l3.l3l4(pc->st, CC_RELEASE | INDICATION, pc); in l3ni1_reject_req()
1724 l3_debug(pc->st, "REL get_cause ret(%d)", ret); in l3ni1_release()
1728 l3ni1_parse_facility(pc->st, pc, pc->callref, p); in l3ni1_release()
1743 pc->st->l3.l3l4(pc->st, CC_RELEASE | INDICATION, pc); in l3ni1_release()
1765 pc->st->l3.l3l4(pc->st, CC_PROCEED_SEND | INDICATION, pc); in l3ni1_proceed_req()
1797 cs = pc->st->l1.hardware; in l3ni1_deliver_display()
1849 l3_debug(pc->st, "progress error %d", err); in l3ni1_progress()
1858 pc->st->l3.l3l4(pc->st, CC_PROGRESS | INDICATION, pc); in l3ni1_progress()
1890 l3_debug(pc->st, "notify error %d", err); in l3ni1_notify()
1899 pc->st->l3.l3l4(pc->st, CC_NOTIFY | INDICATION, pc); in l3ni1_notify()
1931 pc->st->l3.l3l4(pc->st, CC_MORE_INFO | INDICATION, pc); in l3ni1_information()
1959 free_invoke_id(pc->st, pc->prot.ni1.invoke_id); in l3ni1_redir_req()
1961 if (!(pc->prot.ni1.invoke_id = new_invoke_id(pc->st))) in l3ni1_redir_req()
2006 l3_msg(pc->st, DL_DATA | REQUEST, skb); in l3ni1_redir_req()
2023 static int l3ni1_cmd_global(struct PStack *st, isdn_ctrl *ic) in l3ni1_cmd_global() argument
2041 if (!(id = new_invoke_id(st))) in l3ni1_cmd_global()
2063 pc = ni1_new_l3_process(st, -1); in l3ni1_cmd_global()
2065 free_invoke_id(st, id); in l3ni1_cmd_global()
2075 { free_invoke_id(st, id); in l3ni1_cmd_global()
2086 l3_msg(st, DL_DATA | REQUEST, skb); in l3ni1_cmd_global()
2091 if ((pc = l3ni1_search_dummy_proc(st, ic->parm.ni1_io.hl_id))) in l3ni1_cmd_global()
2097 { l3_debug(st, "l3ni1_cmd_global abort unknown id"); in l3ni1_cmd_global()
2103 l3_debug(st, "l3ni1_cmd_global unknown cmd 0x%lx", ic->arg); in l3ni1_cmd_global()
2112 struct IsdnCardState *cs = pc->st->l1.hardware; in l3ni1_io_timer()
2125 free_invoke_id(pc->st, pc->prot.ni1.invoke_id); in l3ni1_io_timer()
2150 pc->st->l3.l3l4(pc->st, CC_RELEASE | INDICATION, pc); in l3ni1_release_ind()
2154 pc->st->l3.l3l4(pc->st, CC_IGNORE | INDICATION, pc); in l3ni1_release_ind()
2170 pc->st->l3.l3l4(pc->st, CC_SETUP_ERR, pc); in l3ni1_t302()
2183 pc->st->l3.l3l4(pc->st, CC_NOSETUP_RSP, pc); in l3ni1_t303()
2195 pc->st->l3.l3l4(pc->st, CC_SETUP_ERR, pc); in l3ni1_t304()
2224 l3_msg(pc->st, DL_DATA | REQUEST, skb); in l3ni1_t305()
2235 pc->st->l3.l3l4(pc->st, CC_SETUP_ERR, pc); in l3ni1_t310()
2245 pc->st->l3.l3l4(pc->st, CC_CONNECT_ERR, pc); in l3ni1_t313()
2261 pc->st->l3.l3l4(pc->st, CC_RELEASE_ERR, pc); in l3ni1_t308_2()
2271 pc->st->l3.l3l4(pc->st, CC_RESUME_ERR, pc); in l3ni1_t318()
2283 pc->st->l3.l3l4(pc->st, CC_SUSPEND_ERR, pc); in l3ni1_t319()
2291 pc->st->l3.l3l4(pc->st, CC_RELEASE | INDICATION, pc); in l3ni1_restart()
2305 l3_debug(pc->st, "STATUS get_cause ret(%d)", ret); in l3ni1_status()
2332 l3_debug(pc->st, "STATUS error(%d/%d)", ret, cause); in l3ni1_status()
2347 pc->st->l3.l3l4(pc->st, CC_RELEASE | INDICATION, pc); in l3ni1_status()
2364 l3ni1_parse_facility(pc->st, pc, pc->callref, p); in l3ni1_facility()
2385 l3_debug(pc->st, "SUS wrong CALL_ID len %d", l); in l3ni1_suspend_req()
2392 l3_msg(pc->st, DL_DATA | REQUEST, skb); in l3ni1_suspend_req()
2406 pc->st->l3.l3l4(pc->st, CC_SUSPEND | CONFIRM, pc); in l3ni1_suspend_ack()
2410 l3_debug(pc->st, "SUSPACK check ie(%d)", ret); in l3ni1_suspend_ack()
2422 l3_debug(pc->st, "SUSP_REJ get_cause ret(%d)", ret); in l3ni1_suspend_rej()
2436 pc->st->l3.l3l4(pc->st, CC_SUSPEND_ERR, pc); in l3ni1_suspend_rej()
2460 l3_debug(pc->st, "RES wrong CALL_ID len %d", l); in l3ni1_resume_req()
2467 l3_msg(pc->st, DL_DATA | REQUEST, skb); in l3ni1_resume_req()
2481 l3_debug(pc->st, "resume ack with wrong chid %x", id); in l3ni1_resume_ack()
2489 l3_debug(pc->st, "resume ack without chid (ret %d)", id); in l3ni1_resume_ack()
2500 pc->st->l3.l3l4(pc->st, CC_RESUME | CONFIRM, pc); in l3ni1_resume_ack()
2514 l3_debug(pc->st, "RES_REJ get_cause ret(%d)", ret); in l3ni1_resume_rej()
2528 pc->st->l3.l3l4(pc->st, CC_RESUME_ERR, pc); in l3ni1_resume_rej()
2550 l3_debug(pc->st, "Restart %x", ri); in l3ni1_global_restart()
2552 l3_debug(pc->st, "Restart without restart IE"); in l3ni1_global_restart()
2559 if (pc->st->l3.debug) in l3ni1_global_restart()
2560 l3_debug(pc->st, "Restart for channel %d", chan); in l3ni1_global_restart()
2563 up = pc->st->l3.proc; in l3ni1_global_restart()
2566 up->st->lli.l4l3(up->st, CC_RESTART | REQUEST, up); in l3ni1_global_restart()
2568 up->st->lli.l4l3(up->st, CC_RESTART | REQUEST, up); in l3ni1_global_restart()
2587 l3_msg(pc->st, DL_DATA | REQUEST, skb); in l3ni1_global_restart()
2596 pc->st->l3.l3l4(pc->st, CC_SETUP_ERR, pc); in l3ni1_dl_reset()
2605 pc->st->l3.l3l4(pc->st, CC_RELEASE | INDICATION, pc); in l3ni1_dl_release()
2614 l3_msg(pc->st, DL_ESTABLISH | REQUEST, NULL); in l3ni1_dl_reestablish()
2630 struct Channel *pChan = pc->st->lli.userdata; in l3ni1_SendSpid()
2640 pc->st->l3.l3l2(pc->st, DL_RELEASE | REQUEST, NULL); in l3ni1_SendSpid()
2665 pc->st->l3.l3l2(pc->st, DL_DATA | REQUEST, skb); in l3ni1_SendSpid()
2682 l3_msg(pc->st, DL_ESTABLISH | CONFIRM, NULL); in l3ni1_spid_epid()
2698 pc->st->l3.l3l2(pc->st, DL_RELEASE | REQUEST, NULL); in l3ni1_spid_tout()
2844 global_handler(struct PStack *st, int mt, struct sk_buff *skb) in global_handler() argument
2850 struct l3_process *proc = st->l3.global; in global_handler()
2861 if (st->l3.debug & L3_DEB_STATE) { in global_handler()
2862 l3_debug(st, "ni1 global state %d mt %x unhandled", in global_handler()
2877 l3_msg(proc->st, DL_DATA | REQUEST, skb); in global_handler()
2879 if (st->l3.debug & L3_DEB_STATE) { in global_handler()
2880 l3_debug(st, "ni1 global %d mt %x", in global_handler()
2888 ni1up(struct PStack *st, int pr, void *arg) in ni1up() argument
2903 l3_msg(st, pr, arg); in ni1up()
2908 global_handler(st, MT_DL_ESTABLISHED, NULL); in ni1up()
2916 l3_debug(st, "ni1up frame too short(%d)", skb->len); in ni1up()
2922 if (st->l3.debug & L3_DEB_PROTERR) { in ni1up()
2923 l3_debug(st, "ni1up%sunexpected discriminator %x message len %d", in ni1up()
2932 l3_debug(st, "ni1up frame too short(%d)", skb->len); in ni1up()
2937 if (st->l3.debug & L3_DEB_STATE) in ni1up()
2938 l3_debug(st, "ni1up cr %d", cr); in ni1up()
2940 if (st->l3.debug & L3_DEB_WARN) in ni1up()
2941 l3_debug(st, "ni1up wrong Callref"); in ni1up()
2948 l3ni1_parse_facility(st, NULL, in ni1up()
2956 global_handler(st, mt, skb); in ni1up()
2960 if (st->l3.debug & L3_DEB_WARN) in ni1up()
2961 l3_debug(st, "ni1up dummy Callref (no facility msg or ie)"); in ni1up()
2966 if (st->l3.debug & L3_DEB_STATE) in ni1up()
2967 l3_debug(st, "ni1up Global CallRef"); in ni1up()
2968 global_handler(st, mt, skb); in ni1up()
2971 } else if (!(proc = getl3proc(st, cr))) { in ni1up()
2979 if (st->l3.debug & L3_DEB_STATE) in ni1up()
2980 l3_debug(st, "ni1up wrong CRef flag"); in ni1up()
2984 if (!(proc = ni1_new_l3_process(st, cr))) { in ni1up()
3016 if ((proc = ni1_new_l3_process(st, cr))) { in ni1up()
3032 if ((proc = ni1_new_l3_process(st, cr))) { in ni1up()
3050 if (st->l3.debug & L3_DEB_STATE) { in ni1up()
3051 l3_debug(st, "ni1up%sstate %d mt %#x unhandled", in ni1up()
3060 if (st->l3.debug & L3_DEB_STATE) { in ni1up()
3061 l3_debug(st, "ni1up%sstate %d mt %x", in ni1up()
3072 ni1down(struct PStack *st, int pr, void *arg) in ni1down() argument
3079 l3_msg(st, pr, NULL); in ni1down()
3085 if ((proc = ni1_new_l3_process(st, cr))) { in ni1down()
3109 if (st->l3.debug & L3_DEB_STATE) { in ni1down()
3110 l3_debug(st, "ni1down state %d prim %#x unhandled", in ni1down()
3114 if (st->l3.debug & L3_DEB_STATE) { in ni1down()
3115 l3_debug(st, "ni1down state %d prim %#x", in ni1down()
3123 ni1man(struct PStack *st, int pr, void *arg) in ni1man() argument
3137 if (st->l3.debug & L3_DEB_STATE) { in ni1man()
3138 l3_debug(st, "cr %d ni1man state %d prim %#x unhandled", in ni1man()
3142 if (st->l3.debug & L3_DEB_STATE) { in ni1man()
3143 l3_debug(st, "cr %d ni1man state %d prim %#x", in ni1man()
3151 setstack_ni1(struct PStack *st) in setstack_ni1() argument
3156 st->lli.l4l3 = ni1down; in setstack_ni1()
3157 st->lli.l4l3_proto = l3ni1_cmd_global; in setstack_ni1()
3158 st->l2.l2l3 = ni1up; in setstack_ni1()
3159 st->l3.l3ml3 = ni1man; in setstack_ni1()
3160 st->l3.N303 = 1; in setstack_ni1()
3161 st->prot.ni1.last_invoke_id = 0; in setstack_ni1()
3162 st->prot.ni1.invoke_used[0] = 1; /* Bit 0 must always be set to 1 */ in setstack_ni1()
3165 st->prot.ni1.invoke_used[i++] = 0; in setstack_ni1()
3167 if (!(st->l3.global = kmalloc(sizeof(struct l3_process), GFP_ATOMIC))) { in setstack_ni1()
3170 st->l3.global->state = 0; in setstack_ni1()
3171 st->l3.global->callref = 0; in setstack_ni1()
3172 st->l3.global->next = NULL; in setstack_ni1()
3173 st->l3.global->debug = L3_DEB_WARN; in setstack_ni1()
3174 st->l3.global->st = st; in setstack_ni1()
3175 st->l3.global->N303 = 1; in setstack_ni1()
3176 st->l3.global->prot.ni1.invoke_id = 0; in setstack_ni1()
3178 L3InitTimer(st->l3.global, &st->l3.global->timer); in setstack_ni1()