Bläddra i källkod

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
Abhishek Singh 7 år sedan
förälder
incheckning
edb7360d92
3 ändrade filer med 48 tillägg och 23 borttagningar
  1. 1 0
      core/sme/inc/csr_api.h
  2. 1 0
      core/sme/src/csr/csr_api_roam.c
  3. 46 23
      core/sme/src/csr/csr_api_scan.c

+ 1 - 0
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_ {

+ 1 - 0
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))

+ 46 - 23
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);