From edb7360d92331c7faba6ff01e84f2fe0f9b33f02 Mon Sep 17 00:00:00 2001 From: Abhishek Singh Date: Tue, 20 Feb 2018 15:20:26 +0530 Subject: [PATCH] qcacld-3.0: Match all encryption type in case of testbed STA If force rsne is set i.e testbed STA mode, the auth type and encryption type set in RSNE provided, may not match with the AP. In this case driver will not find the AP in filtered scan result using the encryption and auth type provided in RSNE. Thus no Assoc req is sent to AP and the test case fails. As part of the fix set all authtype and RSN encryptions in filter so that driver is able to find the AP and send Assoc request. Change-Id: If99df221b10c5276f902df2f0a52b87e4df1be2c CRs-Fixed: 2192174 --- core/sme/inc/csr_api.h | 1 + core/sme/src/csr/csr_api_roam.c | 1 + core/sme/src/csr/csr_api_scan.c | 69 ++++++++++++++++++++++----------- 3 files changed, 48 insertions(+), 23 deletions(-) diff --git a/core/sme/inc/csr_api.h b/core/sme/inc/csr_api.h index 00636ec1d19c..7423ff8a4836 100644 --- a/core/sme/inc/csr_api.h +++ b/core/sme/inc/csr_api.h @@ -414,6 +414,7 @@ typedef struct tagCsrScanResultFilter { enum QDF_OPMODE csrPersona; bool realm_check; uint8_t fils_realm[2]; + bool force_rsne_override; } tCsrScanResultFilter; typedef struct sCsrChnPower_ { diff --git a/core/sme/src/csr/csr_api_roam.c b/core/sme/src/csr/csr_api_roam.c index 66bee67c9f65..a52c58b9168c 100644 --- a/core/sme/src/csr/csr_api_roam.c +++ b/core/sme/src/csr/csr_api_roam.c @@ -11141,6 +11141,7 @@ csr_roam_prepare_filter_from_profile(tpAniSirGlobal mac_ctx, #endif scan_fltr->csrPersona = profile->csrPersona; csr_update_fils_scan_filter(scan_fltr, profile); + scan_fltr->force_rsne_override = profile->force_rsne_override; free_filter: if (!QDF_IS_STATUS_SUCCESS(status)) diff --git a/core/sme/src/csr/csr_api_scan.c b/core/sme/src/csr/csr_api_scan.c index 821142341b96..192644111494 100644 --- a/core/sme/src/csr/csr_api_scan.c +++ b/core/sme/src/csr/csr_api_scan.c @@ -3538,30 +3538,53 @@ static QDF_STATUS csr_prepare_scan_filter(tpAniSirGlobal mac_ctx, pFilter->fils_realm, REAM_HASH_LEN); } - filter->num_of_auth = - pFilter->authType.numEntries; - if (filter->num_of_auth > WLAN_NUM_OF_SUPPORT_AUTH_TYPE) - filter->num_of_auth = WLAN_NUM_OF_SUPPORT_AUTH_TYPE; - for (i = 0; i < filter->num_of_auth; i++) - filter->auth_type[i] = - csr_covert_auth_type_new(pFilter->authType.authType[i]); - filter->num_of_enc_type = - pFilter->EncryptionType.numEntries; - if (filter->num_of_enc_type > WLAN_NUM_OF_ENCRYPT_TYPE) - filter->num_of_enc_type = WLAN_NUM_OF_ENCRYPT_TYPE; - for (i = 0; i < filter->num_of_enc_type; i++) - filter->enc_type[i] = - csr_covert_enc_type_new( - pFilter->EncryptionType.encryptionType[i]); - filter->num_of_mc_enc_type = - pFilter->mcEncryptionType.numEntries; - if (filter->num_of_mc_enc_type > WLAN_NUM_OF_ENCRYPT_TYPE) - filter->num_of_mc_enc_type = WLAN_NUM_OF_ENCRYPT_TYPE; - for (i = 0; i < filter->num_of_mc_enc_type; i++) - filter->mc_enc_type[i] = - csr_covert_enc_type_new( - pFilter->mcEncryptionType.encryptionType[i]); + if (pFilter->force_rsne_override) { + int idx; + sme_debug("force_rsne_override enabled fill all auth type and enctype"); + filter->num_of_auth = WLAN_NUM_OF_SUPPORT_AUTH_TYPE; + for (i = 0; i < filter->num_of_auth; i++) + filter->auth_type[i] = i; + + idx = 0; + for (i = 0; i < WLAN_NUM_OF_ENCRYPT_TYPE; i++) { + if (i == WLAN_ENCRYPT_TYPE_TKIP || + i == WLAN_ENCRYPT_TYPE_AES || + i == WLAN_ENCRYPT_TYPE_AES_GCMP || + i == WLAN_ENCRYPT_TYPE_AES_GCMP_256) { + filter->enc_type[idx] = i; + filter->mc_enc_type[idx] = i; + idx++; + } + } + filter->num_of_enc_type = idx; + filter->num_of_mc_enc_type = idx; + } else { + filter->num_of_auth = + pFilter->authType.numEntries; + if (filter->num_of_auth > WLAN_NUM_OF_SUPPORT_AUTH_TYPE) + filter->num_of_auth = WLAN_NUM_OF_SUPPORT_AUTH_TYPE; + for (i = 0; i < filter->num_of_auth; i++) + filter->auth_type[i] = + csr_covert_auth_type_new( + pFilter->authType.authType[i]); + filter->num_of_enc_type = + pFilter->EncryptionType.numEntries; + if (filter->num_of_enc_type > WLAN_NUM_OF_ENCRYPT_TYPE) + filter->num_of_enc_type = WLAN_NUM_OF_ENCRYPT_TYPE; + for (i = 0; i < filter->num_of_enc_type; i++) + filter->enc_type[i] = + csr_covert_enc_type_new( + pFilter->EncryptionType.encryptionType[i]); + filter->num_of_mc_enc_type = + pFilter->mcEncryptionType.numEntries; + if (filter->num_of_mc_enc_type > WLAN_NUM_OF_ENCRYPT_TYPE) + filter->num_of_mc_enc_type = WLAN_NUM_OF_ENCRYPT_TYPE; + for (i = 0; i < filter->num_of_mc_enc_type; i++) + filter->mc_enc_type[i] = + csr_covert_enc_type_new( + pFilter->mcEncryptionType.encryptionType[i]); + } qdf_mem_copy(filter->country, pFilter->countryCode, WNI_CFG_COUNTRY_CODE_LEN);