diff options
author | Andrew Jeffery <andrew@aj.id.au> | 2018-08-07 14:28:09 +0930 |
---|---|---|
committer | Andrew Jeffery <andrew@aj.id.au> | 2018-09-12 15:05:51 +0930 |
commit | ab666a572c4969f8540a5a815266ec5675932464 (patch) | |
tree | f841d198a8627a1e771f516d7e2d9c83baf4d2ea | |
parent | 1e531afd1698c5613004e2bf4e73bda4364fa6d6 (diff) | |
download | phosphor-mboxbridge-ab666a572c4969f8540a5a815266ec5675932464.tar.gz phosphor-mboxbridge-ab666a572c4969f8540a5a815266ec5675932464.zip |
protocol: Add reset
Change-Id: Ie5c11e71312c30de1aa9ec14d963bde91545dc50
Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
-rw-r--r-- | protocol.c | 9 | ||||
-rw-r--r-- | protocol.h | 2 | ||||
-rw-r--r-- | transport_mbox.c | 9 |
3 files changed, 17 insertions, 3 deletions
@@ -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 @@ int protocol_v2_get_info(struct mbox_context *context, } 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, }; @@ -30,6 +30,7 @@ struct protocol_get_info { }; 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 @@ void protocol_free(struct mbox_context *context); 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 clr_bmc_events(struct mbox_context *context, uint8_t bmc_event, 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; } /* |