protocol: Provide abstraction over event notification
How this works will be transport-dependent. Move the event notification
helpers into the protocol abstraction and call-back through the
registered flush handler as necessary.
Change-Id: I29e3a9a9785b92de46a2b2750257fb7f8480a184
Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
diff --git a/mboxd.c b/mboxd.c
index 2382724..a5c7ef6 100644
--- a/mboxd.c
+++ b/mboxd.c
@@ -139,7 +139,7 @@
break;
case SIGHUP:
/* Host didn't request reset -> Notify it */
- windows_reset_all(context, SET_BMC_EVENT);
+ windows_reset_all(context, EVENT_TRIGGER);
rc = lpc_reset(context);
if (rc < 0) {
MSG_ERR("WARNING: Failed to point the "
@@ -177,7 +177,7 @@
/* Best to reset windows and the lpc mapping for safety */
/* Host didn't request reset -> Notify it */
- windows_reset_all(context, SET_BMC_EVENT);
+ windows_reset_all(context, EVENT_TRIGGER);
rc = lpc_reset(context);
/* Not much we can do if this fails */
if (rc < 0) {
@@ -394,7 +394,7 @@
MSG_ERR("LPC configuration failed, RESET required: %d\n", rc);
}
- rc = set_bmc_events(context, BMC_EVENT_DAEMON_READY, SET_BMC_EVENT);
+ rc = protocol_events_set(context, BMC_EVENT_DAEMON_READY, EVENT_TRIGGER);
if (rc) {
goto finish;
}
@@ -406,7 +406,7 @@
finish:
MSG_INFO("Daemon Exiting...\n");
- clr_bmc_events(context, BMC_EVENT_DAEMON_READY, SET_BMC_EVENT);
+ protocol_events_clear(context, BMC_EVENT_DAEMON_READY, EVENT_TRIGGER);
#ifdef VIRTUAL_PNOR_ENABLED
destroy_vpnor(context);