daemon: Remove the concept of triggering or suppressing events

Rather, trigger them (or not) as necessary in the relevant code-paths.
This ensures that any call to one of protocol_events_{set,clear}()
actually has a consequence that we can set about dealing with in the
transport layer.

Change-Id: If64733fa53ed9def0da8330c99cbe48327bab934
Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
diff --git a/mboxd.c b/mboxd.c
index dece231..86a67f3 100644
--- a/mboxd.c
+++ b/mboxd.c
@@ -147,7 +147,14 @@
 				break;
 			case SIGHUP:
 				/* Host didn't request reset -> Notify it */
-				windows_reset_all(context, EVENT_TRIGGER);
+				if (windows_reset_all(context)) {
+				       rc = protocol_events_set(context,
+						     BMC_EVENT_WINDOW_RESET);
+				       if (rc < 0) {
+					      MSG_ERR("Failed to notify host of reset, expect host-side corruption\n");
+					      break;
+				       }
+				}
 				rc = lpc_reset(context);
 				if (rc < 0) {
 					MSG_ERR("WARNING: Failed to point the "
@@ -185,7 +192,13 @@
 
 	/* Best to reset windows and the lpc mapping for safety */
 	/* Host didn't request reset -> Notify it */
-	windows_reset_all(context, EVENT_TRIGGER);
+	if (windows_reset_all(context)) {
+	       rc = protocol_events_set(context, BMC_EVENT_WINDOW_RESET);
+	       if (rc < 0) {
+		      MSG_ERR("Failed to notify host of reset, expect host-side corruption\n");
+		      return rc;
+	       }
+	}
 	rc = lpc_reset(context);
 	/* Not much we can do if this fails */
 	if (rc < 0) {
@@ -402,7 +415,7 @@
 		MSG_ERR("LPC configuration failed, RESET required: %d\n", rc);
 	}
 
-	rc = protocol_events_set(context, BMC_EVENT_DAEMON_READY, EVENT_TRIGGER);
+	rc = protocol_events_set(context, BMC_EVENT_DAEMON_READY);
 	if (rc) {
 		goto finish;
 	}
@@ -414,7 +427,7 @@
 
 finish:
 	MSG_INFO("Daemon Exiting...\n");
-	protocol_events_clear(context, BMC_EVENT_DAEMON_READY, EVENT_TRIGGER);
+	protocol_events_clear(context, BMC_EVENT_DAEMON_READY);
 
 #ifdef VIRTUAL_PNOR_ENABLED
 	destroy_vpnor(context);