Commit ab666a57 authored by Andrew Jeffery's avatar Andrew Jeffery
Browse files

protocol: Add reset


Change-Id: Ie5c11e71312c30de1aa9ec14d963bde91545dc50
Signed-off-by: Andrew Jeffery's avatarAndrew Jeffery <andrew@aj.id.au>
parent 1e531afd
......@@ -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);
......
......@@ -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;
}
/*
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment