Lines Matching defs:state
56 int state;
66 atomic_t state;
79 * Description of a state-event combination
127 fsm_record_history(fsm_instance *fi, int state, int event);
132 * If an action function is defined for the current state/event combination,
140 * 1 if current state or event is out of range
141 * !0 if state and event in range, but no action defined.
147 int state = atomic_read(&fi->state);
149 if ((state >= fi->f->nr_states) ||
151 printk(KERN_ERR "fsm(%s): Invalid state st(%ld/%ld) ev(%d/%ld)\n",
152 fi->name, (long)state,(long)fi->f->nr_states, event,
159 r = fi->f->jumpmatrix[fi->f->nr_states * event + state];
162 printk(KERN_DEBUG "fsm(%s): state %s event %s\n",
163 fi->name, fi->f->state_names[state],
167 fsm_record_history(fi, state, event);
173 printk(KERN_DEBUG "fsm(%s): no function for event %s in state %s\n",
175 fi->f->state_names[state]);
185 * Modifies the state of an FSM.
189 * @param state The new state for this FSM.
194 atomic_set(&fi->state,newstate);
199 printk(KERN_DEBUG "fsm(%s): New state %s\n", fi->name,
206 * Retrieves the state of an FSM
210 * @return The current state of the FSM.
215 return atomic_read(&fi->state);
219 * Retrieves the name of the state of an FSM
223 * @return The current state of the FSM in a human readable form.