This commits creates a connect_or_ctrl nl_sock* for every bss uncoditionally. It is used in follow up patches for nl80211 control port rx. Signed-off-by: Markus Theil <markus.theil@xxxxxxxxxxxxx> --- src/drivers/driver_nl80211.c | 49 ++++++++++++++++++------------------ 1 file changed, 25 insertions(+), 24 deletions(-) diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c index b952b56be..e6ab38639 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c @@ -1918,6 +1918,25 @@ static void wpa_driver_nl80211_handle_eapol_tx_status(int sock, } +static int nl80211_init_connect_or_ctrl_handle(struct i802_bss *bss) +{ + if (bss->nl_connect_or_ctrl) { + wpa_printf(MSG_DEBUG, + "nl80211: Connect handle already created (nl_connect_or_ctrl=%p)", + bss->nl_connect_or_ctrl); + return -1; + } + + bss->nl_connect_or_ctrl = nl_create_handle(bss->nl_cb, "connect_or_ctrl"); + if (!bss->nl_connect_or_ctrl) + return -1; + nl80211_register_eloop_read(&bss->nl_connect_or_ctrl, + wpa_driver_nl80211_event_receive, + bss->nl_cb, 1); + return 0; +} + + static int nl80211_init_bss(struct i802_bss *bss) { bss->nl_cb = nl_cb_alloc(NL_CB_DEFAULT); @@ -1929,6 +1948,8 @@ static int nl80211_init_bss(struct i802_bss *bss) nl_cb_set(bss->nl_cb, NL_CB_VALID, NL_CB_CUSTOM, process_bss_event, bss); + nl80211_init_connect_or_ctrl_handle(bss); + return 0; } @@ -1937,6 +1958,10 @@ static void nl80211_destroy_bss(struct i802_bss *bss) { nl_cb_put(bss->nl_cb); bss->nl_cb = NULL; + + if (bss->nl_connect_or_ctrl) { + nl80211_destroy_eloop_handle(&bss->nl_connect_or_ctrl, 1); + } } @@ -2160,25 +2185,6 @@ static int nl80211_register_action_frame(struct i802_bss *bss, } -static int nl80211_init_connect_handle(struct i802_bss *bss) -{ - if (bss->nl_connect_or_ctrl) { - wpa_printf(MSG_DEBUG, - "nl80211: Connect handle already created (nl_connect_or_ctrl=%p)", - bss->nl_connect_or_ctrl); - return -1; - } - - bss->nl_connect_or_ctrl = nl_create_handle(bss->nl_cb, "connect"); - if (!bss->nl_connect_or_ctrl) - return -1; - nl80211_register_eloop_read(&bss->nl_connect_or_ctrl, - wpa_driver_nl80211_event_receive, - bss->nl_cb, 1); - return 0; -} - - static int nl80211_mgmt_subscribe_non_ap(struct i802_bss *bss) { struct wpa_driver_nl80211_data *drv = bss->drv; @@ -2714,8 +2720,6 @@ wpa_driver_nl80211_finish_drv_init(struct wpa_driver_nl80211_data *drv, if (drv->vendor_cmd_test_avail) qca_vendor_test(drv); - nl80211_init_connect_handle(bss); - return 0; } @@ -2828,9 +2832,6 @@ static void wpa_driver_nl80211_deinit(struct i802_bss *bss) nl80211_del_p2pdev(bss); } - if (bss->nl_connect_or_ctrl) - nl80211_destroy_eloop_handle(&bss->nl_connect_or_ctrl, 1); - nl80211_destroy_bss(drv->first_bss); os_free(drv->filter_ssids); -- 2.24.1 _______________________________________________ Hostap mailing list Hostap@xxxxxxxxxxxxxxxxxxx http://lists.infradead.org/mailman/listinfo/hostap