Disable aspeed mbox backend
This disables the mbox backend in the daemon. The associated code
remains, as it is tangled in to the tests which provide coverage for
parts of the code base beyond the mbox backend.
A future cleanup would refactor the tests to not rely on the mbox
transport, andfinally remove the mbox transport itself.
Change-Id: Id4fe74617a2dd920c1f8bc8ac4cd69cfbc0239b6
Signed-off-by: Joel Stanley <joel@jms.id.au>
diff --git a/mboxd.c b/mboxd.c
index c7f7d33..059261b 100644
--- a/mboxd.c
+++ b/mboxd.c
@@ -33,7 +33,6 @@
#include "control_dbus.h"
#include "backend.h"
#include "lpc.h"
-#include "transport_mbox.h"
#include "transport_dbus.h"
#include "windows.h"
#include "vpnor/backend.h"
@@ -176,13 +175,6 @@
if (context->terminate) {
break; /* This should mean we clean up nicely */
}
- if (context->fds[MBOX_FD].revents & POLLIN) { /* MBOX */
- MSG_DBG("MBOX Event\n");
- rc = transport_mbox_dispatch(context);
- if (rc < 0) {
- MSG_ERR("Error handling MBOX event\n");
- }
- }
}
rc = protocol_reset(context);
@@ -389,9 +381,8 @@
int main(int argc, char **argv)
{
- const struct transport_ops *mbox_ops, *dbus_ops;
+ const struct transport_ops *dbus_ops;
struct mbox_context *context;
- bool have_transport_mbox;
char *name = argv[0];
sigset_t set;
int rc, i;
@@ -429,19 +420,9 @@
goto cleanup_backend;
}
- rc = transport_mbox_init(context, &mbox_ops);
- /* TODO: Think about whether we could use a less branch-y strategy */
- have_transport_mbox = rc == 0;
- if (!have_transport_mbox) {
- /* Disable MBOX for poll()ing purposes */
- context->fds[MBOX_FD].fd = -1;
- MSG_DBG("Failed to initialise MBOX transport: %d\n", rc);
- MSG_INFO("MBOX transport unavailable\n");
- }
-
rc = lpc_dev_init(context);
if (rc) {
- goto cleanup_mbox;
+ goto cleanup_protocol;
}
/* We've found the reserved memory region -> we can assign to windows */
@@ -463,13 +444,6 @@
context->bmc_events |= BMC_EVENT_PROTOCOL_RESET;
/* Alert on all supported transports, as required */
- if (have_transport_mbox) {
- rc = protocol_events_put(context, mbox_ops);
- if (rc) {
- goto cleanup;
- }
- }
-
rc = protocol_events_put(context, dbus_ops);
if (rc) {
goto cleanup;
@@ -485,10 +459,6 @@
context->bmc_events |= BMC_EVENT_PROTOCOL_RESET;
/* Alert on all supported transports, as required */
- if (have_transport_mbox) {
- protocol_events_put(context, mbox_ops);
- }
-
protocol_events_put(context, dbus_ops);
cleanup:
@@ -497,10 +467,7 @@
windows_free(context);
cleanup_lpc:
lpc_dev_free(context);
-cleanup_mbox:
- if (have_transport_mbox) {
- transport_mbox_free(context);
- }
+cleanup_protocol:
protocol_free(context);
cleanup_backend:
backend_free(&context->backend);