17 #include <linux/module.h>
18 #include <linux/slab.h>
22 #define FSM_TIMER_DEBUG 0
34 for (i = 0; i < fncount; i++)
56 if ((fi->
state >= fi->
fsm->state_count) || (event >= fi->
fsm->event_count)) {
58 (
long)fi->
state, (
long)fi->
fsm->state_count, event, (
long)fi->
fsm->event_count);
61 r = fi->
fsm->jumpmatrix[fi->
fsm->state_count *
event + fi->
state];
66 fi->
fsm->strEvent[event]);
71 fi->
printdebug(fi,
"State %s Event %s no routine",
73 fi->
fsm->strEvent[event]);
84 fi->
fsm->strState[newstate]);
92 ft->
fi->printdebug(ft->
fi,
"FsmExpireTimer %lx", (
long) ft);
94 FsmEvent(ft->fi, ft->event, ft->arg);
101 ft->
tl.function = (
void *) FsmExpireTimer;
105 ft->
fi->printdebug(ft->
fi,
"FsmInitTimer %lx", (
long) ft);
115 ft->
fi->printdebug(ft->
fi,
"FsmDelTimer %lx %d", (
long) ft, where);
122 int millisec,
int event,
void *
arg,
int where)
127 ft->
fi->printdebug(ft->
fi,
"FsmAddTimer %lx %d %d",
128 (
long) ft, millisec, where);
131 if (timer_pending(&ft->tl)) {
133 ft->fi->printdebug(ft->fi,
"FsmAddTimer already active!");
139 ft->tl.expires =
jiffies + (millisec *
HZ) / 1000;
146 int millisec,
int event,
void *
arg,
int where)
151 ft->
fi->printdebug(ft->
fi,
"FsmRestartTimer %lx %d %d",
152 (
long) ft, millisec, where);
155 if (timer_pending(&ft->tl))
160 ft->tl.expires =
jiffies + (millisec *
HZ) / 1000;