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/mbox.h b/mbox.h
index 3676825..c2db30c 100644
--- a/mbox.h
+++ b/mbox.h
@@ -10,6 +10,7 @@
 #include <stdbool.h>
 
 #include "protocol.h"
+#include "transport.h"
 #include "vpnor/mboxd_pnor_partition_table.h"
 
 enum api_version {
@@ -134,12 +135,10 @@
 
 struct mbox_context;
 
-typedef int (*mboxd_mbox_handler)(struct mbox_context *, union mbox_regs *,
-				  struct mbox_msg *);
-
 struct mbox_context {
 	enum api_version version;
 	const struct protocol_ops *protocol;
+	const struct transport_ops *transport;
 
 /* System State */
 	enum mbox_state state;
@@ -149,9 +148,6 @@
 	uint8_t bmc_events;
 	uint8_t prev_seq;
 
-/* Command Dispatch */
-	const mboxd_mbox_handler *handlers;
-
 /* Window State */
 	/* The window list struct containing all current "windows" */
 	struct window_list windows;