aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/isdn/hisax/fsm.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
commit1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch)
tree0bba044c4ce775e45a88a51686b5d9f90697ea9d /drivers/isdn/hisax/fsm.h
Linux-2.6.12-rc2v2.6.12-rc2
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!
Diffstat (limited to 'drivers/isdn/hisax/fsm.h')
-rw-r--r--drivers/isdn/hisax/fsm.h61
1 files changed, 61 insertions, 0 deletions
diff --git a/drivers/isdn/hisax/fsm.h b/drivers/isdn/hisax/fsm.h
new file mode 100644
index 000000000000..f02f7da1688d
--- /dev/null
+++ b/drivers/isdn/hisax/fsm.h
@@ -0,0 +1,61 @@
1/* $Id: fsm.h,v 1.3.2.2 2001/09/23 22:24:47 kai Exp $
2 *
3 * Finite state machine
4 *
5 * Author Karsten Keil
6 * Copyright by Karsten Keil <keil@isdn4linux.de>
7 * by Kai Germaschewski <kai.germaschewski@gmx.de>
8 *
9 * This software may be used and distributed according to the terms
10 * of the GNU General Public License, incorporated herein by reference.
11 *
12 */
13
14#ifndef __FSM_H__
15#define __FSM_H__
16
17#include <linux/timer.h>
18
19struct FsmInst;
20
21typedef void (* FSMFNPTR)(struct FsmInst *, int, void *);
22
23struct Fsm {
24 FSMFNPTR *jumpmatrix;
25 int state_count, event_count;
26 char **strEvent, **strState;
27};
28
29struct FsmInst {
30 struct Fsm *fsm;
31 int state;
32 int debug;
33 void *userdata;
34 int userint;
35 void (*printdebug) (struct FsmInst *, char *, ...);
36};
37
38struct FsmNode {
39 int state, event;
40 void (*routine) (struct FsmInst *, int, void *);
41};
42
43struct FsmTimer {
44 struct FsmInst *fi;
45 struct timer_list tl;
46 int event;
47 void *arg;
48};
49
50int FsmNew(struct Fsm *fsm, struct FsmNode *fnlist, int fncount);
51void FsmFree(struct Fsm *fsm);
52int FsmEvent(struct FsmInst *fi, int event, void *arg);
53void FsmChangeState(struct FsmInst *fi, int newstate);
54void FsmInitTimer(struct FsmInst *fi, struct FsmTimer *ft);
55int FsmAddTimer(struct FsmTimer *ft, int millisec, int event,
56 void *arg, int where);
57void FsmRestartTimer(struct FsmTimer *ft, int millisec, int event,
58 void *arg, int where);
59void FsmDelTimer(struct FsmTimer *ft, int where);
60
61#endif