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);