From 77767915dd12a2c0df5c5815e3cfc26e91cd6782 Mon Sep 17 00:00:00 2001 From: Pragaspathi Thilagaraj Date: Fri, 21 Feb 2020 17:38:38 +0530 Subject: [PATCH] qcacld-3.0: Fix MBO IE not added in probe requests Currently the driver doesn't add MBO IE to probe if in the scan request, req->ie_len is non-zero and req->ie doesn't have the MBO IE. Also when connection is triggered from AP2 from AP1 both advertising different SSID, then there will be a vdev delete followed by vdev create, and scan request is not received from userspace, then the unicast probe sent from the driver doesn't have the MBO IE. Add MBO IE if its not present in the scan request ie. In roam profile if pAddIEScan is NULL, get IEs from default scan IE. Change-Id: I574f5cae2158a2d4f0adad6d15b8aba2df1de0a2 CRs-Fixed: 2622871 --- core/hdd/src/wlan_hdd_cfg80211.c | 24 ++++++++++++++++++++++++ core/hdd/src/wlan_hdd_scan.c | 14 ++++++++++---- 2 files changed, 34 insertions(+), 4 deletions(-) diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index f1671e602839..0c549a55fee5 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -17981,6 +17981,30 @@ static int wlan_hdd_cfg80211_connect_start(struct hdd_adapter *adapter, adapter->scan_info.scan_add_ie.length; } + /* + * When connecting between two profiles there could be scenario + * when the vdev create and vdev destroy clears the additional + * scan IEs in roam profile and when the supplicant doesn't + * issue scan request. So the unicast frames that are sent from + * the STA doesn't have the additional MBO IE. + */ + if (adapter->device_mode == QDF_STA_MODE && + (adapter->scan_info.default_scan_ies || + adapter->scan_info.scan_add_ie.length) && + !roam_profile->nAddIEScanLength) { + if (adapter->scan_info.default_scan_ies) { + roam_profile->pAddIEScan = + adapter->scan_info.default_scan_ies; + roam_profile->nAddIEScanLength = + adapter->scan_info.default_scan_ies_len; + } else if (adapter->scan_info.scan_add_ie.length) { + roam_profile->pAddIEScan = + adapter->scan_info.scan_add_ie.addIEdata; + roam_profile->nAddIEScanLength = + adapter->scan_info.scan_add_ie.length; + } + } + if ((policy_mgr_is_hw_dbs_capable(hdd_ctx->psoc) == true) && (false == wlan_hdd_handle_sap_sta_dfs_conc(adapter, roam_profile))) { diff --git a/core/hdd/src/wlan_hdd_scan.c b/core/hdd/src/wlan_hdd_scan.c index 80f905de124b..8b6422ee6c6e 100644 --- a/core/hdd/src/wlan_hdd_scan.c +++ b/core/hdd/src/wlan_hdd_scan.c @@ -340,6 +340,7 @@ static int wlan_hdd_update_scan_ies(struct hdd_adapter *adapter, uint16_t rem_len = scan_info->default_scan_ies_len; uint8_t *temp_ie = scan_info->default_scan_ies; uint8_t *current_ie; + const uint8_t *mbo_ie; uint8_t elem_id; uint16_t elem_len; bool add_ie = false; @@ -347,6 +348,9 @@ static int wlan_hdd_update_scan_ies(struct hdd_adapter *adapter, if (!scan_info->default_scan_ies_len || !scan_info->default_scan_ies) return 0; + mbo_ie = wlan_get_vendor_ie_ptr_from_oui(MBO_OUI_TYPE, + MBO_OUI_TYPE_SIZE, scan_ie, + *scan_ie_len); while (rem_len >= 2) { current_ie = temp_ie; elem_id = *temp_ie++; @@ -366,10 +370,12 @@ static int wlan_hdd_update_scan_ies(struct hdd_adapter *adapter, add_ie = true; break; case WLAN_ELEMID_VENDOR: - if ((0 != qdf_mem_cmp(&temp_ie[0], MBO_OUI_TYPE, - MBO_OUI_TYPE_SIZE)) || - (0 == qdf_mem_cmp(&temp_ie[0], QCN_OUI_TYPE, - QCN_OUI_TYPE_SIZE))) + /* Donot add MBO IE if its already present */ + if ((!mbo_ie && + 0 == qdf_mem_cmp(&temp_ie[0], MBO_OUI_TYPE, + MBO_OUI_TYPE_SIZE)) || + (0 == qdf_mem_cmp(&temp_ie[0], QCN_OUI_TYPE, + QCN_OUI_TYPE_SIZE))) add_ie = true; break; }