From 95ec722a057b3ebb44699af16ea68ca0dffef50e Mon Sep 17 00:00:00 2001 From: Samuel Mendoza-Jonas Date: Thu, 13 Dec 2018 11:24:09 +1100 Subject: ui/ncurses: Add option to clear IPMI boot mailbox If there is an IPMI boot mailbox configuration present display a message in the System Configuration screen and provide the option to clear the mailbox. Signed-off-by: Samuel Mendoza-Jonas --- lib/pb-config/pb-config.c | 1 + lib/pb-protocol/pb-protocol.c | 6 ++++++ 2 files changed, 7 insertions(+) (limited to 'lib') diff --git a/lib/pb-config/pb-config.c b/lib/pb-config/pb-config.c index 7fa925c..a802c92 100644 --- a/lib/pb-config/pb-config.c +++ b/lib/pb-config/pb-config.c @@ -83,6 +83,7 @@ struct config *config_copy(void *ctx, const struct config *src) dest->ipmi_bootdev = src->ipmi_bootdev; dest->ipmi_bootdev_persistent = src->ipmi_bootdev_persistent; + dest->ipmi_bootdev_mailbox = src->ipmi_bootdev_mailbox; dest->allow_writes = src->allow_writes; diff --git a/lib/pb-protocol/pb-protocol.c b/lib/pb-protocol/pb-protocol.c index d8771fc..b4138bb 100644 --- a/lib/pb-protocol/pb-protocol.c +++ b/lib/pb-protocol/pb-protocol.c @@ -324,6 +324,7 @@ int pb_protocol_config_len(const struct config *config) } len += 4 + 4; /* ipmi_bootdev, ipmi_bootdev_persistent */ + len += 4; /* ipmi_bootdev_mailbox */ len += 4; /* allow_writes */ @@ -646,6 +647,8 @@ int pb_protocol_serialise_config(const struct config *config, pos += 4; *(uint32_t *)pos = config->ipmi_bootdev_persistent; pos += 4; + *(uint32_t *)pos = config->ipmi_bootdev_mailbox; + pos += 4; *(uint32_t *)pos = config->allow_writes; pos += 4; @@ -1277,6 +1280,9 @@ int pb_protocol_deserialise_config(struct config *config, if (read_u32(&pos, &len, &tmp)) goto out; config->ipmi_bootdev_persistent = !!tmp; + if (read_u32(&pos, &len, &tmp)) + goto out; + config->ipmi_bootdev_mailbox = !!tmp; if (read_u32(&pos, &len, &tmp)) goto out; -- cgit v1.2.3