Lines Matching defs:state
55 int state;
65 atomic_t state;
78 * Description of a state-event combination
126 fsm_record_history(fsm_instance *fi, int state, int event);
131 * If an action function is defined for the current state/event combination,
139 * 1 if current state or event is out of range
140 * !0 if state and event in range, but no action defined.
146 int state = atomic_read(&fi->state);
148 if ((state >= fi->f->nr_states) ||
150 printk(KERN_ERR "fsm(%s): Invalid state st(%ld/%ld) ev(%d/%ld)\n",
151 fi->name, (long)state,(long)fi->f->nr_states, event,
158 r = fi->f->jumpmatrix[fi->f->nr_states * event + state];
161 printk(KERN_DEBUG "fsm(%s): state %s event %s\n",
162 fi->name, fi->f->state_names[state],
166 fsm_record_history(fi, state, event);
172 printk(KERN_DEBUG "fsm(%s): no function for event %s in state %s\n",
174 fi->f->state_names[state]);
184 * Modifies the state of an FSM.
188 * @param state The new state for this FSM.
193 atomic_set(&fi->state,newstate);
198 printk(KERN_DEBUG "fsm(%s): New state %s\n", fi->name,
205 * Retrieves the state of an FSM
209 * @return The current state of the FSM.
214 return atomic_read(&fi->state);
218 * Retrieves the name of the state of an FSM
222 * @return The current state of the FSM in a human readable form.