From 4fe30bdde05dc82f3dacdf275d39e0b683c174f6 Mon Sep 17 00:00:00 2001 From: Yeshwanth Sriram Guntuka Date: Wed, 13 Jun 2018 11:41:42 +0530 Subject: [PATCH] qcacld-3.0: Send mode change event after addkey On STA connection, mode change event is sent to userspace after association is complete. This causes delay in processing of M1 frame at supplicant due to latency associated with nl80211_get_wiphy_index function as part of processing mode change vendor event. Fix is to send mode change event for STA after key is added. Change-Id: Id403bfdd26ed3a47449ba3f2967f4b4322ad5da6 CRs-Fixed: 2257117 --- core/hdd/inc/wlan_hdd_main.h | 1 + core/hdd/src/wlan_hdd_assoc.c | 1 + core/hdd/src/wlan_hdd_cfg80211.c | 5 +++++ core/hdd/src/wlan_hdd_main.c | 1 + 4 files changed, 8 insertions(+) diff --git a/core/hdd/inc/wlan_hdd_main.h b/core/hdd/inc/wlan_hdd_main.h index 825a372467bb..844b24264e35 100644 --- a/core/hdd/inc/wlan_hdd_main.h +++ b/core/hdd/inc/wlan_hdd_main.h @@ -1412,6 +1412,7 @@ struct hdd_adapter { /* rcpi information */ struct rcpi_info rcpi; + bool send_mode_change; }; #define WLAN_HDD_GET_STATION_CTX_PTR(adapter) (&(adapter)->session.station) diff --git a/core/hdd/src/wlan_hdd_assoc.c b/core/hdd/src/wlan_hdd_assoc.c index 3c16ab08851a..315c78678855 100644 --- a/core/hdd/src/wlan_hdd_assoc.c +++ b/core/hdd/src/wlan_hdd_assoc.c @@ -1849,6 +1849,7 @@ static QDF_STATUS hdd_dis_connect_handler(struct hdd_adapter *adapter, (QDF_P2P_CLIENT_MODE == adapter->device_mode)) { sme_ps_disable_auto_ps_timer(mac_handle, adapter->session_id); + adapter->send_mode_change = true; } wlan_hdd_clear_link_layer_stats(adapter); diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index 178e7c802b53..01956d2a9b2d 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -16487,6 +16487,11 @@ static int __wlan_hdd_cfg80211_add_key(struct wiphy *wiphy, return -EINVAL; } + if (adapter->send_mode_change) { + wlan_hdd_send_mode_change_event(); + adapter->send_mode_change = false; + } + /* in case of IBSS as there was no information * available about WEP keys during IBSS join, group * key initialized with NULL key, so re-initialize diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 7ef461591004..a52bced52664 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -3673,6 +3673,7 @@ static struct hdd_adapter *hdd_alloc_station_adapter(struct hdd_context *hdd_ctx adapter->offloads_configured = false; adapter->is_link_up_service_needed = false; adapter->disconnection_in_progress = false; + adapter->send_mode_change = true; /* Init the net_device structure */ strlcpy(dev->name, name, IFNAMSIZ);