Commit fab672bd authored by Andrew Jeffery's avatar Andrew Jeffery

mboxd: Mark the protocol as reset on shutdown

This is necessary for the host firmware to properly recover from a
daemon restart event, as it needs to re-perform the GET_INFO handshake
and re-establish any window it had active prior to the daemon
restarting.

While we're here, rename the symbol to align with the documentation.

Change-Id: I628d2ee5972177b7ad78392a86122d16104e7011
Signed-off-by: Andrew Jeffery's avatarAndrew Jeffery <andrew@aj.id.au>
parent fe0c9e86
......@@ -439,6 +439,7 @@ int main(int argc, char **argv)
finish:
MSG_INFO("Daemon Exiting...\n");
context->bmc_events &= ~BMC_EVENT_DAEMON_READY;
context->bmc_events |= BMC_EVENT_PROTOCOL_RESET;
/* Alert on all supported transports */
protocol_events_put(context, mbox_ops);
......
......@@ -30,14 +30,14 @@ enum api_version {
#define FLAGS_SHORT_LIFETIME 0x01
/* BMC Event Notification */
#define BMC_EVENT_REBOOT 0x01
#define BMC_EVENT_PROTOCOL_RESET 0x01
#define BMC_EVENT_WINDOW_RESET 0x02
#define BMC_EVENT_ACK_MASK (BMC_EVENT_REBOOT | \
#define BMC_EVENT_ACK_MASK (BMC_EVENT_PROTOCOL_RESET | \
BMC_EVENT_WINDOW_RESET)
#define BMC_EVENT_FLASH_CTRL_LOST 0x40
#define BMC_EVENT_DAEMON_READY 0x80
#define BMC_EVENT_V1_MASK BMC_EVENT_REBOOT
#define BMC_EVENT_V2_MASK (BMC_EVENT_REBOOT | \
#define BMC_EVENT_V1_MASK BMC_EVENT_PROTOCOL_RESET
#define BMC_EVENT_V2_MASK (BMC_EVENT_PROTOCOL_RESET | \
BMC_EVENT_WINDOW_RESET | \
BMC_EVENT_FLASH_CTRL_LOST | \
BMC_EVENT_DAEMON_READY)
......
......@@ -65,7 +65,7 @@ static int transport_dbus_signal_update(struct mbox_context *context,
}
}
if (events & BMC_EVENT_REBOOT) {
if (events & BMC_EVENT_PROTOCOL_RESET) {
sd_bus_message *m = NULL;
rc = sd_bus_message_new_signal(context->bus, &m,
......
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