From 7be8933aba6c8bbe910aaf9564df59e344cd2f77 Mon Sep 17 00:00:00 2001 From: Pragaspathi Thilagaraj Date: Mon, 18 Nov 2019 20:10:04 +0530 Subject: [PATCH] qcacld-3.0: Allow roaming to whitelist SSID Currently, when roaming to different SSID, the host driver validates the SSID of the current connected AP and the roamed SSID. If the validation fails, the driver disassociates with the current AP, which results in data path carrier queues being disabled. And as part of the roam indication to the user space, the driver doesn't enable carrier queues. Check if the SSID from the roam synch indication is present in the allowed SSID list, if the SSID is present don't disassociate with current AP. Change-Id: Iafe3497d5d00753edbd5d5176ff3acd1a6d949bd CRs-Fixed: 2567233 --- core/sme/src/csr/csr_api_roam.c | 40 +++++++++++++++++++++++++++++++-- 1 file changed, 38 insertions(+), 2 deletions(-) diff --git a/core/sme/src/csr/csr_api_roam.c b/core/sme/src/csr/csr_api_roam.c index 7501868596f8..e2f619f3c6d3 100644 --- a/core/sme/src/csr/csr_api_roam.c +++ b/core/sme/src/csr/csr_api_roam.c @@ -5193,6 +5193,41 @@ error: return is_null_ssid_match; } +/** + * csr_check_for_allowed_ssid() - Function to check if the roamed + * SSID is present in the configured Allowed SSID list + * @mac: Pointer to global mac_ctx + * @bss_desc: bss descriptor pointer + * @roamed_bss_ies: Pointer to roamed BSS IEs + * + * Return: True if SSID match found else False + */ +static bool +csr_check_for_allowed_ssid(struct mac_context *mac, + struct bss_description *bss_desc, + tDot11fBeaconIEs *roamed_bss_ies) +{ + uint8_t i; + tSirMacSSid *ssid_list = + mac->roam.configParam.roam_params.ssid_allowed_list; + uint8_t num_ssid_allowed_list = + mac->roam.configParam.roam_params.num_ssid_allowed_list; + + if (!roamed_bss_ies) { + sme_info(" Roamed BSS IEs NULL"); + return false; + } + + for (i = 0; i < num_ssid_allowed_list; i++) { + if (ssid_list[i].length == roamed_bss_ies->SSID.num_ssid && + !qdf_mem_cmp(ssid_list[i].ssId, roamed_bss_ies->SSID.ssid, + ssid_list[i].length)) + return true; + } + + return false; +} + static QDF_STATUS csr_roam_stop_network(struct mac_context *mac, uint32_t sessionId, struct csr_roam_profile *roam_profile, @@ -5245,8 +5280,9 @@ QDF_STATUS csr_roam_stop_network(struct mac_context *mac, uint32_t sessionId, * Not worry about WDS connection for now */ ssid_match = - csr_check_for_hidden_ssid_match(mac, pSession, - bss_desc, pIes); + (csr_check_for_allowed_ssid(mac, bss_desc, pIes) || + csr_check_for_hidden_ssid_match(mac, pSession, + bss_desc, pIes)); if (!ssid_match) ssid_match = csr_is_ssid_equal( mac, pSession->pConnectBssDesc,