protocol: Add reset

Change-Id: Ie5c11e71312c30de1aa9ec14d963bde91545dc50
Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
diff --git a/protocol.c b/protocol.c
index 24a830b..b0e9e23 100644
--- a/protocol.c
+++ b/protocol.c
@@ -10,6 +10,13 @@
 #include "transport_mbox.h" /* TODO: Remove dependency on transport_mbox.h */
 #include "windows.h"
 
+int protocol_v1_reset(struct mbox_context *context)
+{
+	/* Host requested it -> No BMC Event */
+	windows_reset_all(context, NO_BMC_EVENT);
+	return lpc_reset(context);
+}
+
 int protocol_v1_get_info(struct mbox_context *context,
 			 struct protocol_get_info *io)
 {
@@ -100,10 +107,12 @@
 }
 
 static const struct protocol_ops protocol_ops_v1 = {
+	.reset = protocol_v1_reset,
 	.get_info = protocol_v1_get_info,
 };
 
 static const struct protocol_ops protocol_ops_v2 = {
+	.reset = protocol_v1_reset,
 	.get_info = protocol_v2_get_info,
 };
 
diff --git a/protocol.h b/protocol.h
index c147139..d7827c0 100644
--- a/protocol.h
+++ b/protocol.h
@@ -30,6 +30,7 @@
 };
 
 struct protocol_ops {
+	int (*reset)(struct mbox_context *context);
 	int (*get_info)(struct mbox_context *context,
 			struct protocol_get_info *io);
 };
@@ -40,6 +41,7 @@
 int protocol_negotiate_version(struct mbox_context *context, uint8_t requested);
 
 /* Protocol v1 */
+int protocol_v1_reset(struct mbox_context *context);
 int protocol_v1_get_info(struct mbox_context *context,
 			 struct protocol_get_info *io);
 
diff --git a/transport_mbox.c b/transport_mbox.c
index ec6d601..be2eba9 100644
--- a/transport_mbox.c
+++ b/transport_mbox.c
@@ -168,9 +168,12 @@
 int mbox_handle_reset(struct mbox_context *context,
 			     union mbox_regs *req, struct mbox_msg *resp)
 {
-	/* Host requested it -> No BMC Event */
-	windows_reset_all(context, NO_BMC_EVENT);
-	return lpc_reset(context);
+	int rc = context->protocol->reset(context);
+	if (rc < 0) {
+		return mbox_xlate_errno(context, rc);
+	}
+
+	return 0;
 }
 
 /*