21 #include <linux/kernel.h>
22 #include <linux/slab.h>
23 #include <linux/module.h>
24 #include <linux/string.h>
27 #define FSM_TIMER_DEBUG 0
31 struct FsmNode *fnlist,
int fncount)
38 for (i = 0; i < fncount; i++)
42 "mISDN_FsmNew Error: %d st(%ld/%ld) ev(%ld/%ld)\n",
63 if ((fi->
state >= fi->
fsm->state_count) ||
64 (event >= fi->
fsm->event_count)) {
66 "mISDN_FsmEvent Error st(%ld/%ld) ev(%d/%ld)\n",
67 (
long)fi->
state, (
long)fi->
fsm->state_count, event,
68 (
long)fi->
fsm->event_count);
71 r = fi->
fsm->jumpmatrix[fi->
fsm->state_count *
event + fi->
state];
76 fi->
fsm->strEvent[event]);
81 fi->
printdebug(fi,
"State %s Event %s no action",
83 fi->
fsm->strEvent[event]);
95 fi->
fsm->strState[newstate]);
104 ft->
fi->printdebug(ft->
fi,
"FsmExpireTimer %lx", (
long) ft);
113 ft->
tl.function = (
void *) FsmExpireTimer;
117 ft->
fi->printdebug(ft->
fi,
"mISDN_FsmInitTimer %lx", (
long) ft);
128 ft->
fi->printdebug(ft->
fi,
"mISDN_FsmDelTimer %lx %d",
137 int millisec,
int event,
void *
arg,
int where)
142 ft->
fi->printdebug(ft->
fi,
"mISDN_FsmAddTimer %lx %d %d",
143 (
long) ft, millisec, where);
146 if (timer_pending(&ft->tl)) {
149 "mISDN_FsmAddTimer: timer already active!\n");
150 ft->fi->printdebug(ft->fi,
151 "mISDN_FsmAddTimer already active!");
158 ft->tl.expires =
jiffies + (millisec *
HZ) / 1000;
166 int millisec,
int event,
void *
arg,
int where)
171 ft->
fi->printdebug(ft->
fi,
"mISDN_FsmRestartTimer %lx %d %d",
172 (
long) ft, millisec, where);
175 if (timer_pending(&ft->tl))
180 ft->tl.expires =
jiffies + (millisec *
HZ) / 1000;