Lines Matching refs:context
14 int control_ping(struct mbox_context *context __attribute__((unused))) in control_ping() argument
19 int control_daemon_state(struct mbox_context *context) in control_daemon_state() argument
21 return (context->state & STATE_SUSPENDED) ? in control_daemon_state()
25 int control_lpc_state(struct mbox_context *context) in control_lpc_state() argument
27 if ((context->state & MAPS_MEM) && !(context->state & MAPS_FLASH)) { in control_lpc_state()
29 } else if (!(context->state & MAPS_MEM) && in control_lpc_state()
30 (context->state & MAPS_FLASH)) { in control_lpc_state()
37 int control_reset(struct mbox_context *context) in control_reset() argument
40 if (context->state & STATE_SUSPENDED) { in control_reset()
50 return protocol_reset(context); in control_reset()
53 int control_kill(struct mbox_context *context) in control_kill() argument
55 context->terminate = 1; in control_kill()
62 int control_modified(struct mbox_context *context) in control_modified() argument
65 backend_set_bytemap(&context->backend, 0, context->backend.flash_size, in control_modified()
69 if (windows_reset_all(context)) { in control_modified()
70 protocol_events_set(context, BMC_EVENT_WINDOW_RESET); in control_modified()
76 int control_suspend(struct mbox_context *context) in control_suspend() argument
80 if (context->state & STATE_SUSPENDED) { in control_suspend()
86 rc = protocol_events_set(context, BMC_EVENT_FLASH_CTRL_LOST); in control_suspend()
91 context->state |= STATE_SUSPENDED; in control_suspend()
96 int control_resume(struct mbox_context *context, bool modified) in control_resume() argument
100 if (!(context->state & STATE_SUSPENDED)) { in control_resume()
107 control_modified(context); in control_resume()
111 rc = protocol_events_clear(context, BMC_EVENT_FLASH_CTRL_LOST); in control_resume()
115 context->state &= ~STATE_SUSPENDED; in control_resume()
120 int control_set_backend(struct mbox_context *context, struct backend *backend, in control_set_backend() argument
126 if (context->state & STATE_SUSPENDED) in control_set_backend()
129 rc = protocol_events_clear(context, BMC_EVENT_DAEMON_READY); in control_set_backend()
137 backend_free(&context->backend); in control_set_backend()
139 context->backend = successor; in control_set_backend()
141 rc = __protocol_reset(context); in control_set_backend()
145 return protocol_events_set(context, in control_set_backend()