ソースを参照

qcacld-3.0: Changes for 11d to not get disabled

Currently, the regulatory callback does not know whether the
country setting is due to 11d or user-space. Therefore, even
for 11d country setting, 11d gets disabled. Fix this by
maintaining variable for country code setting.

Change-Id: Icc5f636de7245a9c65df56374cf99fb9c5c15f5f
CRs-Fixed: 1077498
Amar Singhal 8 年 前
コミット
9d5b1feedb
3 ファイル変更14 行追加34 行削除
  1. 1 0
      core/mac/inc/ani_global.h
  2. 8 34
      core/sme/src/common/sme_api.c
  3. 5 0
      core/sme/src/csr/csr_api_scan.c

+ 1 - 0
core/mac/inc/ani_global.h

@@ -979,6 +979,7 @@ typedef struct sAniSirGlobal {
 	enum auth_tx_ack_status auth_ack_status;
 	uint8_t user_configured_nss;
 	bool sta_prefer_80MHz_over_160MHz;
+	bool is_11d_hint;
 } tAniSirGlobal;
 
 typedef enum {

+ 8 - 34
core/sme/src/common/sme_api.c

@@ -7838,24 +7838,19 @@ sme_handle_generic_change_country_code(tpAniSirGlobal mac_ctx,
 {
 	QDF_STATUS status = QDF_STATUS_SUCCESS;
 	v_REGDOMAIN_t reg_domain_id = 0;
-	bool is_11d_country = false;
 	bool supplicant_priority =
 		mac_ctx->roam.configParam.fSupplicantCountryCodeHasPriority;
 	tAniGenericChangeCountryCodeReq *msg = pMsgBuf;
 
 	sms_log(mac_ctx, LOG1, FL(" called"));
 
-	if (memcmp(msg->countryCode, mac_ctx->scan.countryCode11d,
-		   CDS_COUNTRY_CODE_LEN) == 0) {
-		is_11d_country = true;
-	}
 	/* Set the country code given by userspace when 11dOriginal is false
 	 * when 11doriginal is True,is_11d_country =0 and
 	 * fSupplicantCountryCodeHasPriority = 0, then revert the country code,
 	 * and return failure
 	 */
 	if (mac_ctx->roam.configParam.Is11dSupportEnabledOriginal == true
-	    && !is_11d_country && !supplicant_priority) {
+	    && !mac_ctx->is_11d_hint && !supplicant_priority) {
 		sms_log(mac_ctx, LOGW,
 			FL("Incorrect country req, nullify this"));
 
@@ -7879,37 +7874,14 @@ sme_handle_generic_change_country_code(tpAniSirGlobal mac_ctx,
 	}
 
 	/* if Supplicant country code has priority, disable 11d */
-	if (!is_11d_country && supplicant_priority)
+	if (supplicant_priority && !mac_ctx->is_11d_hint)
 		mac_ctx->roam.configParam.Is11dSupportEnabled = false;
+
+	qdf_mem_copy(mac_ctx->scan.countryCode11d, msg->countryCode,
+		     WNI_CFG_COUNTRY_CODE_LEN);
 	qdf_mem_copy(mac_ctx->scan.countryCodeCurrent, msg->countryCode,
 		     WNI_CFG_COUNTRY_CODE_LEN);
-	status = wma_set_reg_domain(mac_ctx, reg_domain_id);
-	if (false == is_11d_country) {
-		/* overwrite the defualt country code */
-		qdf_mem_copy(mac_ctx->scan.countryCodeDefault,
-			     mac_ctx->scan.countryCodeCurrent,
-			     WNI_CFG_COUNTRY_CODE_LEN);
-		/* set to default domain ID */
-		mac_ctx->scan.domainIdDefault = mac_ctx->scan.domainIdCurrent;
-	}
-	if (status != QDF_STATUS_SUCCESS) {
-		sms_log(mac_ctx, LOGE, FL("fail to set regId %d"),
-			reg_domain_id);
-		return status;
-	} else {
-		/* if 11d has priority, clear currentCountryBssid &
-		 * countryCode11d to get set again if we find AP with 11d info
-		 * during scan
-		 */
-		if (!supplicant_priority && (false == is_11d_country)) {
-			sms_log(mac_ctx, LOGW,
-				FL("Clearing currentCountryBssid, countryCode11d"));
-			qdf_mem_zero(&mac_ctx->scan.currentCountryBssid,
-				     sizeof(struct qdf_mac_addr));
-			qdf_mem_zero(mac_ctx->scan.countryCode11d,
-				     sizeof(mac_ctx->scan.countryCode11d));
-		}
-	}
+
 	/* get the channels based on new cc */
 	status = csr_get_channel_and_power_list(mac_ctx);
 
@@ -7929,6 +7901,8 @@ sme_handle_generic_change_country_code(tpAniSirGlobal mac_ctx,
 	 * Country IE
 	 */
 	mac_ctx->scan.curScanType = eSIR_ACTIVE_SCAN;
+	mac_ctx->is_11d_hint = false;
+
 	sme_disconnect_connected_sessions(mac_ctx);
 	sms_log(mac_ctx, LOG1, FL(" returned"));
 	return QDF_STATUS_SUCCESS;

+ 5 - 0
core/sme/src/csr/csr_api_scan.c

@@ -3716,6 +3716,11 @@ bool csr_learn_11dcountry_information(tpAniSirGlobal pMac,
 	else
 		pCountryCodeSelected = pMac->scan.countryCodeElected;
 
+	if (qdf_mem_cmp(pCountryCodeSelected, pMac->scan.countryCode11d,
+		   CDS_COUNTRY_CODE_LEN) == 0)
+		goto free_ie;
+
+	pMac->is_11d_hint = true;
 	status = csr_get_regulatory_domain_for_country(pMac,
 				pCountryCodeSelected, &domainId, SOURCE_11D);
 	if (status != QDF_STATUS_SUCCESS) {