Home | History | Annotate | Download | only in utils

Lines Matching refs:state

2  * wpa_supplicant/hostapd - State machine definitions
9 * implement a state machine. In addition to including this header file, each
10 * file implementing a state machine must define STATE_MACHINE_DATA to be the
11 * data structure including state variables (enum machine_state,
14 * a group of state machines with shared data structure, STATE_MACHINE_ADDR
16 * SM_ENTRY_M macro can be used to define similar group of state machines
24 * SM_STATE - Declaration of a state machine function
25 * @machine: State machine name
26 * @state: State machine state
28 * This macro is used to declare a state machine function. It is used in place
29 * of a C function definition to declare functions to be run when the state is
32 #define SM_STATE(machine, state) \
33 static void sm_ ## machine ## _ ## state ## _Enter(STATE_MACHINE_DATA *sm, \
37 * SM_ENTRY - State machine function entry point
38 * @machine: State machine name
39 * @state: State machine state
41 * This macro is used inside each state machine function declared with
44 * information about state transition and update the state machine state.
46 #define SM_ENTRY(machine, state) \
47 if (!global || sm->machine ## _state != machine ## _ ## state) { \
50 " entering state " #state); \
52 sm->machine ## _state = machine ## _ ## state;
55 * SM_ENTRY_M - State machine function entry point for state machine group
56 * @machine: State machine name
57 * @_state: State machine state
58 * @data: State variable prefix (full variable: prefix_state)
60 * This macro is like SM_ENTRY, but for state machine groups that use a shared
61 * data structure for more than one state machine. Both machine and prefix
62 * parameters are set to "sub-state machine" name. prefix is used to allow more
63 * than one state variable to be stored in the same data structure.
66 if (!global || sm->data ## _ ## state != machine ## _ ## _state) { \
69 #machine " entering state " #_state); \
71 sm->data ## _ ## state = machine ## _ ## _state;
74 * SM_ENTRY_MA - State machine function entry point for state machine group
75 * @machine: State machine name
76 * @_state: State machine state
77 * @data: State variable prefix (full variable: prefix_state)
84 if (!global || sm->data ## _ ## state != machine ## _ ## _state) { \
87 #machine " entering state " #_state, \
90 sm->data ## _ ## state = machine ## _ ## _state;
93 * SM_ENTER - Enter a new state machine state
94 * @machine: State machine name
95 * @state: State machine state
97 * This macro expands to a function call to a state machine function defined
98 * with SM_STATE macro. SM_ENTER is used in a state machine step function to
99 * move the state machine to a new state.
101 #define SM_ENTER(machine, state) \
102 sm_ ## machine ## _ ## state ## _Enter(sm, 0)
105 * SM_ENTER_GLOBAL - Enter a new state machine state based on global rule
106 * @machine: State machine name
107 * @state: State machine state
109 * This macro is like SM_ENTER, but this is used when entering a new state
110 * based on a global (not specific to any particular state) rule. A separate
112 * rule is forcing a state machine to remain in on state.
114 #define SM_ENTER_GLOBAL(machine, state) \
115 sm_ ## machine ## _ ## state ## _Enter(sm, 1)
118 * SM_STEP - Declaration of a state machine step function
119 * @machine: State machine name
121 * This macro is used to declare a state machine step function. It is used in
123 * state machine to a new state based on state variables. This function uses
124 * SM_ENTER and SM_ENTER_GLOBAL macros to enter new state.
130 * SM_STEP_RUN - Call the state machine step function
131 * @machine: State machine name
133 * This macro expands to a function call to a state machine step function