Lines Matching full:state

23  * onoff_manager::flags that indicate the state of the machine.  The
28 * * ERROR indicates that the machine is in an error state. When
30 * * ONOFF indicates whether the target/current state is off (clear)
37 * state changes while invoking notifications associated with a
38 * state transition. This bounds the depth by limiting
39 * active process_event() call stacks to two instances. State changes
47 * * RECHECK indicates that a state transition has completed but
48 * process_events() must re-check the overall state to confirm no
57 /* Identify the events that can trigger state changes, as well as an
58 * internal state used when processing deferred actions.
71 * state (TO-ON, TO-OFF, or RESETTING).
75 /* Reassess whether a transition from a stable state is needed.
85 * potential for these state changes, and process_event() ...
93 * process_event() when state OFF is confirmed with a
101 * process_event() when state ON is confirmed with a
109 * process_event() when state ERROR is confirmed with a
116 uint32_t state) in set_state() argument
118 mgr->flags = (state & ONOFF_STATE_MASK) in set_state()
156 uint32_t state, in notify_monitors() argument
164 mon->callback(mgr, mon, state, res); in notify_monitors()
170 uint32_t state, in notify_one() argument
177 cb(mgr, cli, state, res); in notify_one()
183 uint32_t state, in notify_all() argument
193 notify_one(mgr, cli, state, res); in notify_all()
210 /* Detect whether static state requires a transition. */
214 uint32_t state = mgr->flags & ONOFF_STATE_MASK; in process_recheck() local
216 if ((state == ONOFF_STATE_OFF) in process_recheck()
219 } else if ((state == ONOFF_STATE_ON) in process_recheck()
222 } else if ((state == ONOFF_STATE_ERROR) in process_recheck()
241 uint32_t state = mgr->flags & ONOFF_STATE_MASK; in process_complete() local
244 /* Enter ERROR state and notify all clients. */ in process_complete()
248 } else if ((state == ONOFF_STATE_TO_ON) in process_complete()
249 || (state == ONOFF_STATE_RESETTING)) { in process_complete()
253 if (state == ONOFF_STATE_TO_ON) { in process_complete()
257 * clients and enter ON state. in process_complete()
265 __ASSERT_NO_MSG(state == ONOFF_STATE_RESETTING); in process_complete()
272 } else if (state == ONOFF_STATE_TO_OFF) { in process_complete()
287 /* There are two points in the state machine where the machine is
290 * * Invocation of the user-specified callback when a stable state is
294 * state, but processing is deferred to the top-level invocation which
303 uint32_t state = mgr->flags & ONOFF_STATE_MASK; in process_event() local
342 __ASSERT_NO_MSG(state == ONOFF_STATE_OFF); in process_event()
349 __ASSERT_NO_MSG(state == ONOFF_STATE_ON); in process_event()
356 __ASSERT_NO_MSG(state == ONOFF_STATE_ERROR); in process_event()
367 * * We changed state and there are monitors; in process_event()
371 bool do_monitors = (state != (mgr->flags & ONOFF_STATE_MASK)) in process_event()
381 state = flags & ONOFF_STATE_MASK; in process_event()
386 notify_monitors(mgr, state, res); in process_event()
390 notify_all(mgr, &clients, state, res); in process_event()
414 state = mgr->flags & ONOFF_STATE_MASK; in process_event()
434 uint32_t state = mgr->flags & ONOFF_STATE_MASK; in onoff_request() local
442 rv = state; in onoff_request()
443 if (state == ONOFF_STATE_ON) { in onoff_request()
447 } else if ((state == ONOFF_STATE_OFF) in onoff_request()
448 || (state == ONOFF_STATE_TO_OFF) in onoff_request()
449 || (state == ONOFF_STATE_TO_ON)) { in onoff_request()
451 start = (state == ONOFF_STATE_OFF); in onoff_request()
453 } else if (state == ONOFF_STATE_RESETTING) { in onoff_request()
456 __ASSERT_NO_MSG(state == ONOFF_STATE_ERROR); in onoff_request()
471 notify_one(mgr, cli, state, 0); in onoff_request()
483 uint32_t state = mgr->flags & ONOFF_STATE_MASK; in onoff_release() local
484 int rv = state; in onoff_release()
486 if (state != ONOFF_STATE_ON) { in onoff_release()
487 if (state == ONOFF_STATE_ERROR) { in onoff_release()
525 uint32_t state = mgr->flags & ONOFF_STATE_MASK; in onoff_reset() local
527 rv = state; in onoff_reset()
529 if ((state & ONOFF_FLAG_ERROR) == 0) { in onoff_reset()
532 reset = (state != ONOFF_STATE_RESETTING); in onoff_reset()
554 uint32_t state = mgr->flags & ONOFF_STATE_MASK; in onoff_cancel() local
557 __ASSERT_NO_MSG((state == ONOFF_STATE_TO_ON) in onoff_cancel()
558 || (state == ONOFF_STATE_TO_OFF) in onoff_cancel()
559 || (state == ONOFF_STATE_RESETTING)); in onoff_cancel()
560 rv = state; in onoff_cancel()
620 uint32_t state = ONOFF_STATE_ON; in onoff_sync_finalize() local
631 state = ONOFF_STATE_ERROR; in onoff_sync_finalize()
636 /* state would be either off or on, but since in onoff_sync_finalize()
651 notify_one(NULL, cli, state, res); in onoff_sync_finalize()