Merge tag 'block-5.11-2021-01-10' of git://git.kernel.dk/linux-block
[linux/fpc-iii.git] / drivers / isdn / mISDN / fsm.h
blob211554b997f811bdc7b1a1550b4e06035b496844
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /*
4 * Author Karsten Keil <kkeil@novell.com>
6 * Thanks to Jan den Ouden
7 * Fritz Elfert
8 * Copyright 2008 by Karsten Keil <kkeil@novell.com>
9 */
11 #ifndef _MISDN_FSM_H
12 #define _MISDN_FSM_H
14 #include <linux/timer.h>
16 /* Statemachine */
18 struct FsmInst;
20 typedef void (*FSMFNPTR)(struct FsmInst *, int, void *);
22 struct Fsm {
23 FSMFNPTR *jumpmatrix;
24 int state_count, event_count;
25 char **strEvent, **strState;
28 struct FsmInst {
29 struct Fsm *fsm;
30 int state;
31 int debug;
32 void *userdata;
33 int userint;
34 void (*printdebug) (struct FsmInst *, char *, ...);
37 struct FsmNode {
38 int state, event;
39 void (*routine) (struct FsmInst *, int, void *);
42 struct FsmTimer {
43 struct FsmInst *fi;
44 struct timer_list tl;
45 int event;
46 void *arg;
49 extern int mISDN_FsmNew(struct Fsm *, struct FsmNode *, int);
50 extern void mISDN_FsmFree(struct Fsm *);
51 extern int mISDN_FsmEvent(struct FsmInst *, int , void *);
52 extern void mISDN_FsmChangeState(struct FsmInst *, int);
53 extern void mISDN_FsmInitTimer(struct FsmInst *, struct FsmTimer *);
54 extern int mISDN_FsmAddTimer(struct FsmTimer *, int, int, void *, int);
55 extern void mISDN_FsmRestartTimer(struct FsmTimer *, int, int, void *, int);
56 extern void mISDN_FsmDelTimer(struct FsmTimer *, int);
58 #endif