transport: mbox: Drop handler functions from header

Change-Id: If9dbb4e3ac849abc8651285f95025a9b53a35753
Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
diff --git a/protocol.c b/protocol.c
index 2bd91ab..c66f2df 100644
--- a/protocol.c
+++ b/protocol.c
@@ -90,9 +90,14 @@
 
 	/* Close the current window if there is one */
 	if (context->current) {
-		/* There is an implicit flush if it was a write window */
+		/* There is an implicit flush if it was a write window
+		 *
+		 * protocol_v2_create_window() calls
+		 * protocol_v1_create_window(), so use indirect call to
+		 * write_flush() to make sure we pick the right one.
+		 */
 		if (context->current_is_write) {
-			rc = mbox_handle_flush_window(context, NULL, NULL);
+			rc = context->protocol->flush(context, NULL);
 			if (rc < 0) {
 				MSG_ERR("Couldn't Flush Write Window\n");
 				return rc;
diff --git a/transport_mbox.c b/transport_mbox.c
index b0e0c04..fcc4430 100644
--- a/transport_mbox.c
+++ b/transport_mbox.c
@@ -172,7 +172,7 @@
  * Reset the LPC mapping to point back at the flash, or memory in case we're
  * using a virtual pnor.
  */
-int mbox_handle_reset(struct mbox_context *context,
+static int mbox_handle_reset(struct mbox_context *context,
 			     union mbox_regs *req, struct mbox_msg *resp)
 {
 	return context->protocol->reset(context);
@@ -200,7 +200,7 @@
  * RESP[3:4]: Default write window size (number of blocks)
  * RESP[5]: Block size (as shift)
  */
-int mbox_handle_mbox_info(struct mbox_context *context,
+static int mbox_handle_mbox_info(struct mbox_context *context,
 				 union mbox_regs *req, struct mbox_msg *resp)
 {
 	uint8_t mbox_api_version = req->msg.args[0];
@@ -237,7 +237,7 @@
  * RESP[0:1]: Flash Size (number of blocks)
  * RESP[2:3]: Erase Size (number of blocks)
  */
-int mbox_handle_flash_info(struct mbox_context *context,
+static int mbox_handle_flash_info(struct mbox_context *context,
 				  union mbox_regs *req, struct mbox_msg *resp)
 {
 	struct protocol_get_flash_info io;
@@ -287,7 +287,7 @@
 	return lpc_addr >> context->block_size_shift;
 }
 
-int mbox_handle_create_window(struct mbox_context *context, bool ro,
+static int mbox_handle_create_window(struct mbox_context *context, bool ro,
 			      union mbox_regs *req, struct mbox_msg *resp)
 {
 	struct protocol_create_window io;
@@ -329,7 +329,7 @@
  * RESP[0:1]: LPC bus address for host to access this window (number of blocks)
  * RESP[2:3]: Actual window size that the host can access (number of blocks)
  */
-int mbox_handle_read_window(struct mbox_context *context,
+static int mbox_handle_read_window(struct mbox_context *context,
 				   union mbox_regs *req, struct mbox_msg *resp)
 {
 	return mbox_handle_create_window(context, true, req, resp);
@@ -354,7 +354,7 @@
  * RESP[0:1]: LPC bus address for host to access this window (number of blocks)
  * RESP[2:3]: Actual window size that was mapped/host can access (n.o. blocks)
  */
-int mbox_handle_write_window(struct mbox_context *context,
+static int mbox_handle_write_window(struct mbox_context *context,
 				    union mbox_regs *req, struct mbox_msg *resp)
 {
 	return mbox_handle_create_window(context, false, req, resp);
@@ -376,7 +376,7 @@
  * ARGS[0:1]: Where within window to start (number of blocks)
  * ARGS[2:3]: Number to mark dirty (number of blocks)
  */
-int mbox_handle_dirty_window(struct mbox_context *context,
+static int mbox_handle_dirty_window(struct mbox_context *context,
 				    union mbox_regs *req, struct mbox_msg *resp)
 {
 	struct protocol_mark_dirty io;
@@ -405,7 +405,7 @@
  * ARGS[0:1]: Where within window to start (number of blocks)
  * ARGS[2:3]: Number to erase (number of blocks)
  */
-int mbox_handle_erase_window(struct mbox_context *context,
+static int mbox_handle_erase_window(struct mbox_context *context,
 				    union mbox_regs *req, struct mbox_msg *resp)
 {
 	struct protocol_erase io;
@@ -438,7 +438,7 @@
  * V2:
  * NONE
  */
-int mbox_handle_flush_window(struct mbox_context *context,
+static int mbox_handle_flush_window(struct mbox_context *context,
 				    union mbox_regs *req, struct mbox_msg *resp)
 {
 	struct protocol_flush io = { 0 };
@@ -462,7 +462,7 @@
  * V2:
  * ARGS[0]: FLAGS
  */
-int mbox_handle_close_window(struct mbox_context *context,
+static int mbox_handle_close_window(struct mbox_context *context,
 				    union mbox_regs *req, struct mbox_msg *resp)
 {
 	struct protocol_close io = { 0 };
@@ -480,7 +480,7 @@
  *
  * ARGS[0]: Bitmap of bits to ack (by clearing)
  */
-int mbox_handle_ack(struct mbox_context *context, union mbox_regs *req,
+static int mbox_handle_ack(struct mbox_context *context, union mbox_regs *req,
 			   struct mbox_msg *resp)
 {
 	struct protocol_ack io;
diff --git a/transport_mbox.h b/transport_mbox.h
index d911b7b..aebf3bd 100644
--- a/transport_mbox.h
+++ b/transport_mbox.h
@@ -21,26 +21,4 @@
 int init_mbox_dev(struct mbox_context *context);
 void free_mbox_dev(struct mbox_context *context);
 
-/* Command handlers */
-int mbox_handle_reset(struct mbox_context *context,
-			     union mbox_regs *req, struct mbox_msg *resp);
-int mbox_handle_mbox_info(struct mbox_context *context,
-				 union mbox_regs *req, struct mbox_msg *resp);
-int mbox_handle_flash_info(struct mbox_context *context,
-				  union mbox_regs *req, struct mbox_msg *resp);
-int mbox_handle_read_window(struct mbox_context *context,
-				   union mbox_regs *req, struct mbox_msg *resp);
-int mbox_handle_close_window(struct mbox_context *context,
-				    union mbox_regs *req, struct mbox_msg *resp);
-int mbox_handle_write_window(struct mbox_context *context,
-				    union mbox_regs *req, struct mbox_msg *resp);
-int mbox_handle_dirty_window(struct mbox_context *context,
-				    union mbox_regs *req, struct mbox_msg *resp);
-int mbox_handle_flush_window(struct mbox_context *context,
-				    union mbox_regs *req, struct mbox_msg *resp);
-int mbox_handle_ack(struct mbox_context *context, union mbox_regs *req,
-			   struct mbox_msg *resp);
-int mbox_handle_erase_window(struct mbox_context *context,
-				    union mbox_regs *req, struct mbox_msg *resp);
-
 #endif /* MBOXD_MSG_H */