diff options
Diffstat (limited to 'mesh/mesh-io.c')
-rw-r--r-- | mesh/mesh-io.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/mesh/mesh-io.c b/mesh/mesh-io.c index 48e3f4226..b953bf4cf 100644 --- a/mesh/mesh-io.c +++ b/mesh/mesh-io.c @@ -72,12 +72,20 @@ static void ctl_alert(int index, bool up, bool pwr, bool mesh, void *user_data) enum mesh_io_type type = L_PTR_TO_UINT(user_data); const struct mesh_io_api *api = NULL; - l_warn("up:%d pwr: %d mesh: %d", up, pwr, mesh); + l_warn("index %u up:%d pwr: %d mesh: %d", index, up, pwr, mesh); /* If specific IO controller requested, honor it */ - if (default_io->favored_index != MGMT_INDEX_NONE && - default_io->favored_index != index) - return; + if (default_io->favored_index != MGMT_INDEX_NONE) { + if (default_io->favored_index != index) + return; + + if (!up | pwr) { + l_warn("HCI%u failed to start generic IO %s", + index, pwr ? ": already powered on" : ""); + if (default_io->ready) + default_io->ready(default_io->user_data, false); + } + } if (!up && default_io->index == index) { /* Our controller has disappeared */ @@ -104,7 +112,6 @@ static void ctl_alert(int index, bool up, bool pwr, bool mesh, void *user_data) default_io->index = index; default_io->api = api; api->init(default_io, &index, default_io->user_data); - l_queue_foreach(default_io->rx_regs, refresh_rx, default_io); } } |