From b9cd5a82f4150d9264f159096a2f37f940055970 Mon Sep 17 00:00:00 2001 From: Veerendranath Jakkam Date: Mon, 25 Jul 2022 16:50:12 +0530 Subject: [PATCH] Always process pending QCA_NL80211_VENDOR_SUBCMD_KEY_MGMT_ROAM_AUTH data Commit 74818ca63f7e ("Process QCA_NL80211_VENDOR_SUBCMD_KEY_MGMT_ROAM_AUTH after NL80211_CMD_ROAM") added workaround to hold the pending QCA_NL80211_VENDOR_SUBCMD_KEY_MGMT_ROAM_AUTH event data for up to 100 ms in case NL80211_CMD_ROAM is not received first. The 100 ms wait period was sufficient for most of the cases but it's observed that some times kernel is taking more than 100 ms to process and send NL80211_CMD_ROAM to userspace. If NL80211_CMD_ROAM takes more than 100 ms QCA_NL80211_VENDOR_SUBCMD_KEY_MGMT_ROAM_AUTH event data getting ignored though wpa_supplicant has it. To avoid this remove timeout for QCA_NL80211_VENDOR_SUBCMD_KEY_MGMT_ROAM_AUTH event data since driver always indicates NL80211_CMD_ROAM along with QCA_NL80211_VENDOR_SUBCMD_KEY_MGMT_ROAM_AUTH. In addition, clear the pending event data when marking the interface disconnected since the roaming information is supposed to be used only when reassociating without a disconnection. Signed-off-by: Veerendranath Jakkam --- src/drivers/driver_nl80211.c | 4 ++++ src/drivers/driver_nl80211.h | 1 - src/drivers/driver_nl80211_event.c | 16 ++++------------ 3 files changed, 8 insertions(+), 13 deletions(-) diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c index 460072023..b52a4800e 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c @@ -270,6 +270,10 @@ void nl80211_mark_disconnected(struct wpa_driver_nl80211_data *drv) drv->associated = 0; os_memset(drv->bssid, 0, ETH_ALEN); drv->first_bss->freq = 0; +#ifdef CONFIG_DRIVER_NL80211_QCA + os_free(drv->pending_roam_data); + drv->pending_roam_data = NULL; +#endif /* CONFIG_DRIVER_NL80211_QCA */ } diff --git a/src/drivers/driver_nl80211.h b/src/drivers/driver_nl80211.h index 80d456472..18da94a76 100644 --- a/src/drivers/driver_nl80211.h +++ b/src/drivers/driver_nl80211.h @@ -232,7 +232,6 @@ struct wpa_driver_nl80211_data { bool roam_indication_done; u8 *pending_roam_data; size_t pending_roam_data_len; - struct os_reltime pending_roam_ind_time; #endif /* CONFIG_DRIVER_NL80211_QCA */ }; diff --git a/src/drivers/driver_nl80211_event.c b/src/drivers/driver_nl80211_event.c index 70a10655d..896d188f3 100644 --- a/src/drivers/driver_nl80211_event.c +++ b/src/drivers/driver_nl80211_event.c @@ -2120,7 +2120,6 @@ qca_nl80211_key_mgmt_auth_handler(struct wpa_driver_nl80211_data *drv, if (!drv->roam_indication_done) { wpa_printf(MSG_DEBUG, "nl80211: Pending roam indication, delay processing roam+auth vendor event"); - os_get_reltime(&drv->pending_roam_ind_time); os_free(drv->pending_roam_data); drv->pending_roam_data = os_memdup(data, len); @@ -2987,17 +2986,10 @@ static void do_process_drv_event(struct i802_bss *bss, int cmd, if (cmd == NL80211_CMD_ROAM && (drv->capa.flags & WPA_DRIVER_FLAGS_KEY_MGMT_OFFLOAD)) { if (drv->pending_roam_data) { - struct os_reltime now, age; - - os_get_reltime(&now); - os_reltime_sub(&now, &drv->pending_roam_ind_time, &age); - if (age.sec == 0 && age.usec < 100000) { - wpa_printf(MSG_DEBUG, - "nl80211: Process pending roam+auth vendor event"); - qca_nl80211_key_mgmt_auth( - drv, drv->pending_roam_data, - drv->pending_roam_data_len); - } + wpa_printf(MSG_DEBUG, + "nl80211: Process pending roam+auth vendor event"); + qca_nl80211_key_mgmt_auth(drv, drv->pending_roam_data, + drv->pending_roam_data_len); os_free(drv->pending_roam_data); drv->pending_roam_data = NULL; return;