diff --git a/src/manager.c b/src/manager.c index 2c0e481c..132ac188 100644 --- a/src/manager.c +++ b/src/manager.c @@ -449,6 +449,8 @@ static void manager_new_wiphy_event(struct l_genl_msg *msg) if (!state) return; + wiphy_create_complete(state->wiphy); + /* Setup a timer just in case a default interface is not created */ state->setup_timeout = l_timeout_create(1, manager_wiphy_setup_timeout, state, NULL); @@ -605,7 +607,12 @@ static void manager_interface_dump_done(void *user_data) struct wiphy_setup_state *state = entry->data; /* phy might have been detected after the initial dump */ - if (state->setup_timeout || state->pending_cmd_count) + if (state->setup_timeout) + continue; + + wiphy_create_complete(state->wiphy); + + if (state->pending_cmd_count) continue; /* If we are here, then there are no interfaces for this phy */ diff --git a/src/wiphy.c b/src/wiphy.c index 299ba0bf..54b6de63 100644 --- a/src/wiphy.c +++ b/src/wiphy.c @@ -751,11 +751,12 @@ void wiphy_update_from_genl(struct wiphy *wiphy, struct l_genl_msg *msg) IWD_WIPHY_INTERFACE, "Name"); } - if (!wiphy->supported_iftypes) { - /* Most likely a new wiphy, set all the parameters */ - wiphy_parse_attributes(wiphy, &attr); - wiphy_print_basic_info(wiphy); - } + wiphy_parse_attributes(wiphy, &attr); +} + +void wiphy_create_complete(struct wiphy *wiphy) +{ + wiphy_print_basic_info(wiphy); } bool wiphy_destroy(struct wiphy *wiphy) diff --git a/src/wiphy.h b/src/wiphy.h index 0da447d0..792602c8 100644 --- a/src/wiphy.h +++ b/src/wiphy.h @@ -49,6 +49,7 @@ bool wiphy_parse_id_and_name(struct l_genl_attr *attr, uint32_t *out_id, struct wiphy *wiphy_find(int wiphy_id); struct wiphy *wiphy_create(uint32_t wiphy_id, const char *name); +void wiphy_create_complete(struct wiphy *wiphy); bool wiphy_destroy(struct wiphy *wiphy); void wiphy_update_from_genl(struct wiphy *wiphy, struct l_genl_msg *msg);