transport: Retain knowledge of setting and clearing of events

The protocol layer now just filters the events based on the version of
the protocol in use, and leaves it to the transport layer to manage how
the resulting state is represented. For the moment this simply moves
manipulation of bmc_events in struct mbox_context down in to the
transport layer.

Change-Id: Iff1df934505dc9c769be3d376396d425fb4e8264
Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
diff --git a/transport_dbus.c b/transport_dbus.c
index 1d3f0cd..152dc95 100644
--- a/transport_dbus.c
+++ b/transport_dbus.c
@@ -11,7 +11,16 @@
 #include "protocol.h"
 #include "transport.h"
 
-int transport_dbus_flush_events(struct mbox_context *context)
+static int transport_dbus_set_events(struct mbox_context *context,
+				     uint8_t events)
+{
+	/* FIXME ! */
+	MSG_ERR("%s is unimplemented!\n", __func__);
+	return 0;
+}
+
+static int transport_dbus_clear_events(struct mbox_context *context,
+				       uint8_t events)
 {
 	/* FIXME ! */
 	MSG_ERR("%s is unimplemented!\n", __func__);
@@ -19,7 +28,8 @@
 }
 
 static const struct transport_ops transport_dbus_ops = {
-	.flush_events = transport_dbus_flush_events,
+	.set_events = transport_dbus_set_events,
+	.clear_events = transport_dbus_clear_events,
 };
 
 static int transport_dbus_get_info(sd_bus_message *m, void *userdata,
@@ -48,7 +58,7 @@
 
 	/* Switch transport to DBus. This is fine as DBus signals are async */
 	context->transport = &transport_dbus_ops;
-	context->transport->flush_events(context);
+	context->transport->set_events(context, context->bmc_events);
 
 	rc = sd_bus_message_new_method_return(m, &n);
 	if (rc < 0) {