#include "fsm.h"
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/timer.h>
Go to the source code of this file.
|
| MODULE_AUTHOR ("(C) 2000 IBM Corp. by Fritz Elfert ([email protected])") |
|
| MODULE_DESCRIPTION ("Finite state machine helper functions") |
|
| MODULE_LICENSE ("GPL") |
|
fsm_instance * | init_fsm (char *name, const char **state_names, const char **event_names, int nr_states, int nr_events, const fsm_node *tmpl, int tmpl_len, gfp_t order) |
|
void | kfree_fsm (fsm_instance *this) |
|
const char * | fsm_getstate_str (fsm_instance *fi) |
|
void | fsm_settimer (fsm_instance *fi, fsm_timer *this) |
|
void | fsm_deltimer (fsm_timer *this) |
|
int | fsm_addtimer (fsm_timer *this, int millisec, int event, void *arg) |
|
void | fsm_modtimer (fsm_timer *this, int millisec, int event, void *arg) |
|
| EXPORT_SYMBOL (init_fsm) |
|
| EXPORT_SYMBOL (kfree_fsm) |
|
| EXPORT_SYMBOL (fsm_settimer) |
|
| EXPORT_SYMBOL (fsm_deltimer) |
|
| EXPORT_SYMBOL (fsm_addtimer) |
|
| EXPORT_SYMBOL (fsm_modtimer) |
|
| EXPORT_SYMBOL (fsm_getstate_str) |
|
Adds and starts a timer to an FSM instance.
- Parameters
-
timer | The timer to be added. The field fi of that timer must have been set to point to the instance. |
millisec | Duration, after which the timer should expire. |
event | Event, to trigger if timer expires. |
arg | Generic argument, provided to expiry function. |
- Returns
- 0 on success, -1 if timer is already active.
Definition at line 165 of file fsm.c.
Clears a pending timer of an FSM instance.
- Parameters
-
Definition at line 155 of file fsm.c.
Retrieves the name of the state of an FSM
- Parameters
-
- Returns
- The current state of the FSM in a human readable form.
Definition at line 123 of file fsm.c.
Modifies a timer of an FSM.
- Parameters
-
timer | The timer to modify. |
millisec | Duration, after which the timer should expire. |
event | Event, to trigger if timer expires. |
arg | Generic argument, provided to expiry function. |
Definition at line 185 of file fsm.c.
Initializes a timer for an FSM. This prepares an fsm_timer for usage with fsm_addtimer.
- Parameters
-
fi | Pointer to FSM |
timer | The timer to be initialized. |
Definition at line 142 of file fsm.c.
Creates an FSM
- Parameters
-
name | Name of this instance for logging purposes. |
state_names | An array of names for all states for logging purposes. |
event_names | An array of names for all events for logging purposes. |
nr_states | Number of states for this instance. |
nr_events | Number of events for this instance. |
tmpl | An array of fsm_nodes, describing this FSM. |
tmpl_len | Length of the describing array. |
order | Parameter for allocation of the FSM data structs. |
Definition at line 16 of file fsm.c.
Releases an FSM
- Parameters
-
fi | Pointer to an FSM, previously created with init_fsm. |
Definition at line 72 of file fsm.c.
A generic FSM based on fsm used in isdn4linux
MODULE_DESCRIPTION |
( |
"Finite state machine helper functions" |
| ) |
|