19 #include <linux/slab.h>
25 static struct Fsm l3fsm;
35 #define L3_STATE_COUNT (ST_L3_LC_ESTAB + 1)
37 static char *strL3State[] =
40 "ST_L3_LC_ESTAB_WAIT",
56 #define L3_EVENT_COUNT (EV_TIMEOUT + 1)
58 static char *strL3Event[] =
73 struct PStack *
st = fi->userdata;
83 int l, codeset, maincodeset;
95 if ((*p & 0xf0) == 0x90) {
98 maincodeset = codeset;
103 if (codeset == wanted_set) {
108 if (*(p + 1) > (pend - (p + 2)))
119 codeset = maincodeset;
140 static int OrigCallRef = 0;
145 if (OrigCallRef == 127)
149 return (OrigCallRef);
156 l3_debug(pc->st,
"newstate cr %d %d --> %d",
163 L3ExpireTimer(
struct L3Timer *
t)
165 t->pc->st->lli.l4l3(t->pc->st, t->event, t->pc);
172 t->tl.function = (
void *) L3ExpireTimer;
173 t->tl.data = (
long) t;
185 int millisec,
int event)
187 if (timer_pending(&t->tl)) {
193 t->tl.expires =
jiffies + (millisec *
HZ) / 1000;
209 if (!(skb = alloc_skb(len + MAX_HEADER_LEN,
GFP_ATOMIC))) {
213 skb_reserve(skb, MAX_HEADER_LEN);
218 no_l3_proto(
struct PStack *
st,
int pr,
void *
arg)
229 no_l3_proto_spec(
struct PStack *st,
isdn_ctrl *ic)
238 struct l3_process *
p = st->l3.proc;
241 if (p->callref == cr)
251 struct l3_process *
p, *np;
266 p->debug = st->l3.debug;
271 p->N303 = st->l3.N303;
279 struct l3_process *np, *
pp =
NULL;
289 else if (!(p->st->l3.proc = np->next) &&
292 l3_debug(p->st,
"release_l3_process: last process");
293 if (skb_queue_empty(&p->st->l3.squeue)) {
295 l3_debug(p->st,
"release_l3_process: release link");
302 l3_debug(p->st,
"release_l3_process: not release link");
311 printk(
KERN_ERR "HiSax internal L3 error CR(%d) not in list\n", p->callref);
312 l3_debug(p->st,
"HiSax internal L3 error CR(%d) not in list", p->callref);
316 l3ml3p(
struct PStack *st,
int pr)
318 struct l3_process *
p = st->l3.proc;
319 struct l3_process *np;
324 st->l3.l3ml3(st, pr, p);
335 st->l3.global =
NULL;
336 skb_queue_head_init(&st->l3.squeue);
337 st->l3.l3m.fsm = &l3fsm;
339 st->l3.l3m.debug = 1;
340 st->l3.l3m.userdata =
st;
341 st->l3.l3m.userint = 0;
342 st->l3.l3m.printdebug = l3m_debug;
344 strcpy(st->l3.debug_id,
"L3DC ");
345 st->lli.l4l3_proto = no_l3_proto_spec;
347 #ifdef CONFIG_HISAX_EURO
352 #ifdef CONFIG_HISAX_NI1
357 #ifdef CONFIG_HISAX_1TR6
363 st->lli.l4l3 = no_l3_proto;
364 st->l2.l2l3 = no_l3_proto;
365 st->l3.l3ml3 = no_l3_proto;
368 st->lli.l4l3 = no_l3_proto;
369 st->l2.l2l3 = no_l3_proto;
370 st->l3.l3ml3 = no_l3_proto;
371 sprintf(tmp,
"protocol %s not supported",
382 isdnl3_trans(
struct PStack *st,
int pr,
void *arg) {
383 st->l3.l3l2(st, pr, arg);
393 kfree(st->l3.global);
394 st->l3.global =
NULL;
405 st->l3.global =
NULL;
406 skb_queue_head_init(&st->l3.squeue);
407 st->l3.l3m.fsm = &l3fsm;
409 st->l3.l3m.debug = 1;
410 st->l3.l3m.userdata =
st;
411 st->l3.l3m.userint = 0;
412 st->l3.l3m.printdebug = l3m_debug;
413 strcpy(st->l3.debug_id,
"L3BC ");
414 st->lli.l4l3 = isdnl3_trans;
417 #define DREL_TIMER_VALUE 40000
440 if ((!st->l3.proc) && dequeued) {
442 l3_debug(st,
"lc_connect: release link");
449 lc_connected(
struct FsmInst *fi,
int event,
void *arg)
461 if ((!st->l3.proc) && dequeued) {
463 l3_debug(st,
"lc_connected: release link");
470 lc_start_delay(
struct FsmInst *fi,
int event,
void *arg)
479 lc_start_delay_check(
struct FsmInst *fi,
int event,
void *arg)
491 lc_release_req(
struct FsmInst *fi,
int event,
void *arg)
497 l3_debug(st,
"lc_release_req: l2 blocked");
507 lc_release_ind(
struct FsmInst *fi,
int event,
void *arg)
518 lc_release_cnf(
struct FsmInst *fi,
int event,
void *arg)
548 l3_msg(
struct PStack *st,
int pr,
void *arg)
553 st->l3.l3l2(st, pr, arg);
587 l3fsm.strEvent = strL3Event;
588 l3fsm.strState = strL3State;