Browse Source

qcacld-3.0: Move STA params of profile under connecton mgr macro

Move legacy unused STA params of csr_roam_profile under connecton mgr
macro.

Change-Id: I247b07af89203d4e0e16d7449d178b28e2138fdf
CRs-Fixed: 2938277
Utkarsh Bhatnagar 3 years ago
parent
commit
0a488c8261

+ 2 - 3
core/hdd/src/wlan_hdd_assoc.c

@@ -1635,6 +1635,7 @@ void hdd_clear_roam_profile_ie(struct hdd_adapter *adapter)
 	/* clear WPA/RSN/WSC IE information in the profile */
 	roam_profile = hdd_roam_profile(adapter);
 
+#ifndef FEATURE_CM_ENABLE
 	roam_profile->nWPAReqIELength = 0;
 	roam_profile->pWPAReqIE = NULL;
 	roam_profile->nRSNReqIELength = 0;
@@ -1669,10 +1670,8 @@ void hdd_clear_roam_profile_ie(struct hdd_adapter *adapter)
 	roam_profile->MFPEnabled = false;
 	roam_profile->MFPRequired = 0;
 	roam_profile->MFPCapable = 0;
+#endif /* FEATURE_CM_ENABLE */
 
-	qdf_mem_zero(roam_profile->Keys.KeyLength, CSR_MAX_NUM_KEY);
-	qdf_mem_zero(roam_profile->Keys.KeyMaterial,
-		     sizeof(roam_profile->Keys.KeyMaterial));
 #ifdef FEATURE_WLAN_WAPI
 	adapter->wapi_info.wapi_auth_mode = WAPI_AUTH_MODE_OPEN;
 	adapter->wapi_info.wapi_mode = false;

+ 6 - 2
core/hdd/src/wlan_hdd_cfg80211.c

@@ -17459,7 +17459,9 @@ static int hdd_change_adapter_mode(struct hdd_adapter *adapter,
 {
 	struct hdd_context *hdd_ctx = WLAN_HDD_GET_CTX(adapter);
 	struct net_device *netdev = adapter->dev;
+#ifndef FEATURE_CM_ENABLE
 	struct csr_roam_profile *roam_profile;
+#endif
 	QDF_STATUS status = QDF_STATUS_SUCCESS;
 
 	hdd_enter();
@@ -17470,9 +17472,11 @@ static int hdd_change_adapter_mode(struct hdd_adapter *adapter,
 	memset(&adapter->session, 0, sizeof(adapter->session));
 	hdd_set_station_ops(netdev);
 
+#ifndef FEATURE_CM_ENABLE
 	roam_profile = hdd_roam_profile(adapter);
 	roam_profile->pAddIEScan = adapter->scan_info.scan_add_ie.addIEdata;
 	roam_profile->nAddIEScanLength = adapter->scan_info.scan_add_ie.length;
+#endif
 
 	hdd_exit();
 
@@ -18246,10 +18250,10 @@ static int __wlan_hdd_cfg80211_get_key(struct wiphy *wiphy,
 		   TRACE_CODE_HDD_CFG80211_GET_KEY,
 		   adapter->vdev_id, params.cipher);
 
-	params.key_len = roam_profile->Keys.KeyLength[key_index];
+	params.key_len = 0;
 	params.seq_len = 0;
 	params.seq = NULL;
-	params.key = &roam_profile->Keys.KeyMaterial[key_index][0];
+	params.key = NULL;
 	callback(cookie, &params);
 
 	hdd_exit();

+ 2 - 0
core/hdd/src/wlan_hdd_cm_connect.c

@@ -477,6 +477,8 @@ hdd_cm_connect_failure_post_user_update(struct wlan_objmgr_vdev *vdev,
 		qdf_runtime_pm_allow_suspend(&hdd_ctx->runtime_context.connect);
 		hdd_allow_suspend(WIFI_POWER_EVENT_WAKELOCK_CONNECT);
 	}
+
+	hdd_clear_roam_profile_ie(adapter);
 	sme_reset_key(hdd_ctx->mac_handle, adapter->vdev_id);
 	hdd_wmm_dscp_initial_state(adapter);
 	hdd_debug("Disabling queues");

+ 2 - 0
core/hdd/src/wlan_hdd_scan.c

@@ -655,6 +655,7 @@ static int __wlan_hdd_cfg80211_scan(struct wiphy *wiphy,
 		}
 	}
 
+#ifndef FEATURE_CM_ENABLE
 	if ((QDF_STA_MODE == adapter->device_mode) ||
 	    (QDF_P2P_CLIENT_MODE == adapter->device_mode) ||
 	    (QDF_P2P_DEVICE_MODE == adapter->device_mode)) {
@@ -666,6 +667,7 @@ static int __wlan_hdd_cfg80211_scan(struct wiphy *wiphy,
 		roam_profile->nAddIEScanLength =
 			scan_info->scan_add_ie.length;
 	}
+#endif
 
 	if (QDF_P2P_CLIENT_MODE == adapter->device_mode ||
 	    QDF_P2P_DEVICE_MODE == adapter->device_mode) {

+ 1 - 5
core/hdd/src/wlan_hdd_wext.c

@@ -6355,11 +6355,8 @@ static int __iw_get_char_setnone(struct net_device *dev,
 		struct csr_roam_profile *roam_profile =
 			hdd_roam_profile(adapter);
 
-		hdd_debug("WE_GET_11W_ENABLED = %d",
-		       roam_profile->MFPEnabled);
-
 		snprintf(extra, WE_MAX_STR_LEN,
-			 "\n BSSID %02X:%02X:%02X:%02X:%02X:%02X, Is PMF Assoc? %d"
+			 "\n BSSID %02X:%02X:%02X:%02X:%02X:%02X"
 			 "\n Number of Unprotected Disassocs %d"
 			 "\n Number of Unprotected Deauths %d",
 			 roam_profile->BSSIDs.bssid->bytes[0],
@@ -6368,7 +6365,6 @@ static int __iw_get_char_setnone(struct net_device *dev,
 			 roam_profile->BSSIDs.bssid->bytes[3],
 			 roam_profile->BSSIDs.bssid->bytes[4],
 			 roam_profile->BSSIDs.bssid->bytes[5],
-			 roam_profile->MFPEnabled,
 			 adapter->hdd_stats.hdd_pmf_stats.
 			 num_unprot_disassoc_rx,
 			 adapter->hdd_stats.hdd_pmf_stats.

+ 5 - 3
core/mac/src/pe/lim/lim_process_sme_req_messages.c

@@ -1792,9 +1792,10 @@ lim_get_bss_dot11_mode(struct bss_description *bss_desc,
 	if (ie_struct->eht_cap.present)
 		bss_dot11_mode = MLME_DOT11_MODE_11BE;
 
-	pe_debug("bss HT %d VHT %d HE %d nw_type %d bss dot11_mode %d",
+	pe_debug("bss HT %d VHT %d HE %d EHT %d nw_type %d bss dot11_mode %d",
 		 ie_struct->HTCaps.present, ie_struct->VHTCaps.present,
-		 ie_struct->he_cap.present, bss_desc->nwType, bss_dot11_mode);
+		 ie_struct->he_cap.present, ie_struct->eht_cap.present,
+		 bss_desc->nwType, bss_dot11_mode);
 
 	return bss_dot11_mode;
 }
@@ -2327,7 +2328,8 @@ lim_verify_dot11_mode_with_crypto(struct pe_session *session)
 
 	if (!(session->dot11mode == MLME_DOT11_MODE_11N ||
 	    session->dot11mode == MLME_DOT11_MODE_11AC ||
-	    session->dot11mode == MLME_DOT11_MODE_11AX))
+	    session->dot11mode == MLME_DOT11_MODE_11AX ||
+	    session->dot11mode == MLME_DOT11_MODE_11BE))
 		return;
 
 	ucast_cipher = wlan_crypto_get_param(session->vdev,

+ 0 - 11
core/sap/src/sap_fsm.c

@@ -2911,8 +2911,6 @@ sapconvert_to_csr_profile(struct sap_config *config, eCsrRoamBssType bssType,
 	profile->AuthType.numEntries = 1;
 	profile->AuthType.authType[0] = eCSR_AUTH_TYPE_OPEN_SYSTEM;
 
-	profile->akm_list = config->akm_list;
-
 	/* Always set the Encryption Type */
 	profile->EncryptionType.numEntries = 1;
 	profile->EncryptionType.encryptionType[0] =
@@ -2937,10 +2935,6 @@ sapconvert_to_csr_profile(struct sap_config *config, eCsrRoamBssType bssType,
 		profile->csr80211AuthType = eSIR_AUTO_SWITCH;
 	}
 
-	/* Initialize we are not going to use it */
-	profile->pWPAReqIE = NULL;
-	profile->nWPAReqIELength = 0;
-
 	if (profile->pRSNReqIE) {
 		sap_debug("pRSNReqIE already allocated.");
 		qdf_mem_free(profile->pRSNReqIE);
@@ -2991,11 +2985,6 @@ sapconvert_to_csr_profile(struct sap_config *config, eCsrRoamBssType bssType,
 	if (QDF_IS_STATUS_ERROR(qdf_status))
 		sap_err("Get ap protection mode failed using default value");
 	profile->cfg_protection = ap_prot;
-
-	/* country code */
-	if (config->countryCode[0])
-		qdf_mem_copy(profile->countryCode, config->countryCode,
-			     REG_ALPHA2_LEN + 1);
 	profile->ieee80211d = config->ieee80211d;
 	/* wps config info */
 	profile->wps_state = config->wps_state;

+ 28 - 33
core/sme/inc/csr_api.h

@@ -601,7 +601,6 @@ struct csr_roam_profile {
 	eCsrRoamBssType BSSType;
 	tCsrAuthList AuthType;
 	enum csr_akm_type negotiatedAuthType;
-	tCsrAuthList akm_list;
 	tCsrEncryptionList EncryptionType;
 	/* This field is for output only, not for input */
 	eCsrEncryptionType negotiatedUCEncryptionType;
@@ -610,13 +609,9 @@ struct csr_roam_profile {
 	 * If caller doesn't case, put all supported encryption types in here
 	 */
 	tCsrEncryptionList mcEncryptionType;
-	/* This field is for output only, not for input */
-	eCsrEncryptionType negotiatedMCEncryptionType;
 	/* Management Frame Protection */
-	bool MFPEnabled;
 	uint8_t MFPRequired;
 	uint8_t MFPCapable;
-	tCsrKeys Keys;
 	tCsrChannelInfo ChannelInfo;
 	uint32_t op_freq;
 	struct ch_params ch_params;
@@ -628,32 +623,8 @@ struct csr_roam_profile {
 	 * During assoc resp this'd carry cnf of what ACs U-APSD got setup for
 	 */
 	uint8_t uapsd_mask;
-	uint32_t nWPAReqIELength; /* The byte count in the pWPAReqIE */
-	uint8_t *pWPAReqIE;       /* If not null,it's IE byte stream for WPA */
 	uint32_t nRSNReqIELength; /* The byte count in the pRSNReqIE */
 	uint8_t *pRSNReqIE;       /* If not null,it's IE byte stream for RSN */
-#ifdef FEATURE_WLAN_WAPI
-	uint32_t nWAPIReqIELength;/* The byte count in the pWAPIReqIE */
-	uint8_t *pWAPIReqIE;      /* If not null,it's IE byte stream for WAPI */
-#endif /* FEATURE_WLAN_WAPI */
-
-	uint32_t nAddIEScanLength;/* pAddIE for scan (at the time of join) */
-	/*
-	 * If not null,it's the IE byte stream for additional IE,
-	 * which can be WSC IE and/or P2P IE
-	 */
-	uint8_t *pAddIEScan;
-	uint32_t nAddIEAssocLength; /* The byte count in the pAddIE for assoc */
-	/*
-	 * If not null, it has the IE byte stream for additional IE,
-	 * which can be WSC IE and/or P2P IE
-	 */
-	uint8_t *pAddIEAssoc;
-	/* it is ignored if [0] is 0. */
-	uint8_t countryCode[REG_ALPHA2_LEN + 1];
-	/* WPS Association if true => auth and ecryption should be ignored */
-	bool bWPSAssociation;
-	bool bOSENAssociation;
 	uint8_t ieee80211d;
 	uint8_t privacy;
 	bool fwdWPSPBCProbeReq;
@@ -665,23 +636,47 @@ struct csr_roam_profile {
 	bool chan_switch_hostapd_rate_enabled;
 	uint16_t cfg_protection;
 	uint8_t wps_state;
-	struct mobility_domain_info mdid;
 	enum QDF_OPMODE csrPersona;
 	/* addIe params */
 	struct add_ie_params add_ie_params;
 	uint16_t beacon_tx_rate;
 	tSirMacRateSet  supported_rates;
 	tSirMacRateSet  extended_rates;
-	struct qdf_mac_addr bssid_hint;
-	bool force_24ghz_in_ht20;
 	uint32_t cac_duration_ms;
 	uint32_t dfs_regdomain;
 #ifndef FEATURE_CM_ENABLE
+	eCsrEncryptionType negotiatedMCEncryptionType;
+	bool MFPEnabled;
+	uint32_t nWPAReqIELength; /* The byte count in the pWPAReqIE */
+	uint8_t *pWPAReqIE;       /* If not null,it's IE byte stream for WPA */
+#ifdef FEATURE_WLAN_WAPI
+	uint32_t nWAPIReqIELength;/* The byte count in the pWAPIReqIE */
+	uint8_t *pWAPIReqIE;      /* If not null,it's IE byte stream for WAPI */
+#endif /* FEATURE_WLAN_WAPI */
+
+	uint32_t nAddIEScanLength;/* pAddIE for scan (at the time of join) */
+	/*
+	 * If not null,it's the IE byte stream for additional IE,
+	 * which can be WSC IE and/or P2P IE
+	 */
+	uint8_t *pAddIEScan;
+	uint32_t nAddIEAssocLength; /* The byte count in the pAddIE for assoc */
+	/*
+	 * If not null, it has the IE byte stream for additional IE,
+	 * which can be WSC IE and/or P2P IE
+	 */
+	uint8_t *pAddIEAssoc;
 #ifdef WLAN_FEATURE_FILS_SK
 	struct wlan_fils_connection_info *fils_con_info;
 #endif
-#endif
+	/* WPS Association if true => auth and ecryption should be ignored */
+	bool bWPSAssociation;
+	bool bOSENAssociation;
+	struct mobility_domain_info mdid;
+	struct qdf_mac_addr bssid_hint;
+	bool force_24ghz_in_ht20;
 	bool force_rsne_override;
+#endif /* FEATURE_CM_ENABLE */
 };
 
 typedef struct tagCsrRoamConnectedProfile {

+ 3 - 5
core/sme/inc/csr_support.h

@@ -193,6 +193,7 @@ tSirResultCodes csr_get_de_auth_rsp_status_code(struct deauth_rsp *pSmeRsp);
 uint32_t csr_get_frag_thresh(struct mac_context *mac_ctx);
 uint32_t csr_get_rts_thresh(struct mac_context *mac_ctx);
 
+#ifndef FEATURE_CM_ENABLE
 uint8_t csr_construct_rsn_ie(struct mac_context *mac, uint32_t sessionId,
 			     struct csr_roam_profile *pProfile,
 			     struct bss_description *pSirBssDesc,
@@ -202,11 +203,9 @@ uint8_t csr_construct_wpa_ie(struct mac_context *mac, uint8_t session_id,
 			     struct csr_roam_profile *pProfile,
 			     struct bss_description *pSirBssDesc,
 			     tDot11fBeaconIEs *pIes, tCsrWpaIe *pWpaIe);
-
 #ifdef FEATURE_WLAN_WAPI
 bool csr_is_profile_wapi(struct csr_roam_profile *pProfile);
 #endif /* FEATURE_WLAN_WAPI */
-#ifndef FEATURE_CM_ENABLE
 /*
  * If a WPAIE exists in the profile, just use it.
  * Or else construct one from the BSS Caller allocated memory for pWpaIe and
@@ -245,7 +244,7 @@ uint8_t csr_retrieve_wapi_ie(struct mac_context *mac, uint32_t sessionId,
 			     struct bss_description *pSirBssDesc,
 			     tDot11fBeaconIEs *pIes, tCsrWapiIe *pWapiIe);
 #endif /* FEATURE_WLAN_WAPI */
-#endif
+#endif /* FEATURE_CM_ENABLE */
 bool csr_rates_is_dot11_rate11b_supported_rate(uint8_t dot11Rate);
 bool csr_rates_is_dot11_rate11a_supported_rate(uint8_t dot11Rate);
 tAniEdType csr_translate_encrypt_type_to_ed_type(
@@ -283,11 +282,10 @@ QDF_STATUS csr_get_phy_mode_from_bss(struct mac_context *mac,
 QDF_STATUS csr_reassoc(struct mac_context *mac, uint32_t sessionId,
 		tCsrRoamModifyProfileFields *pModProfileFields,
 		uint32_t *pRoamId, bool fForce);
-#endif
 #ifdef FEATURE_WLAN_ESE
 bool csr_is_profile_ese(struct csr_roam_profile *pProfile);
 #endif
-
+#endif
 /**
  * csr_is_auth_type_ese() - Checks whether Auth type is ESE or not
  * @AuthType: Authentication type

+ 69 - 71
core/sme/src/csr/csr_api_roam.c

@@ -3914,12 +3914,14 @@ static void csr_roam_assign_default_param(struct mac_context *mac,
 	pCommand->u.roamCmd.roamProfile.negotiatedUCEncryptionType =
 		pCommand->u.roamCmd.roamProfile.EncryptionType.
 		encryptionType[0];
+#ifndef FEATURE_CM_ENABLE
 	/* In this case, the multicast encryption needs to follow the
 	 * uncast ones.
 	 */
 	pCommand->u.roamCmd.roamProfile.negotiatedMCEncryptionType =
 		pCommand->u.roamCmd.roamProfile.EncryptionType.
 		encryptionType[0];
+#endif
 }
 
 #ifndef FEATURE_CM_ENABLE
@@ -5249,6 +5251,7 @@ static void csr_roam_process_start_bss_success(struct mac_context *mac_ctx,
 						0, 0, NULL);
 		}
 	}
+
 	/*
 	 * Only tell upper layer is we start the BSS because Vista doesn't like
 	 * multiple connection indications. If we don't start the BSS ourself,
@@ -6090,18 +6093,6 @@ QDF_STATUS csr_roam_copy_profile(struct mac_context *mac,
 		qdf_mem_copy(pDstProfile->SSIDs.SSIDList,
 			pSrcProfile->SSIDs.SSIDList, size);
 	}
-	if (pSrcProfile->nWPAReqIELength) {
-		pDstProfile->pWPAReqIE =
-			qdf_mem_malloc(pSrcProfile->nWPAReqIELength);
-		if (!pDstProfile->pWPAReqIE) {
-			status = QDF_STATUS_E_NOMEM;
-			goto end;
-		}
-		pDstProfile->nWPAReqIELength =
-			pSrcProfile->nWPAReqIELength;
-		qdf_mem_copy(pDstProfile->pWPAReqIE, pSrcProfile->pWPAReqIE,
-			pSrcProfile->nWPAReqIELength);
-	}
 	if (pSrcProfile->nRSNReqIELength) {
 		pDstProfile->pRSNReqIE =
 			qdf_mem_malloc(pSrcProfile->nRSNReqIELength);
@@ -6114,44 +6105,7 @@ QDF_STATUS csr_roam_copy_profile(struct mac_context *mac,
 		qdf_mem_copy(pDstProfile->pRSNReqIE, pSrcProfile->pRSNReqIE,
 			pSrcProfile->nRSNReqIELength);
 	}
-#ifdef FEATURE_WLAN_WAPI
-	if (pSrcProfile->nWAPIReqIELength) {
-		pDstProfile->pWAPIReqIE =
-			qdf_mem_malloc(pSrcProfile->nWAPIReqIELength);
-		if (!pDstProfile->pWAPIReqIE) {
-			status = QDF_STATUS_E_NOMEM;
-			goto end;
-		}
-		pDstProfile->nWAPIReqIELength =
-			pSrcProfile->nWAPIReqIELength;
-		qdf_mem_copy(pDstProfile->pWAPIReqIE, pSrcProfile->pWAPIReqIE,
-			pSrcProfile->nWAPIReqIELength);
-	}
-#endif /* FEATURE_WLAN_WAPI */
-	if (pSrcProfile->nAddIEScanLength && pSrcProfile->pAddIEScan) {
-		pDstProfile->pAddIEScan =
-			qdf_mem_malloc(pSrcProfile->nAddIEScanLength);
-		if (!pDstProfile->pAddIEScan) {
-			status = QDF_STATUS_E_NOMEM;
-			goto end;
-		}
-		pDstProfile->nAddIEScanLength =
-			pSrcProfile->nAddIEScanLength;
-		qdf_mem_copy(pDstProfile->pAddIEScan, pSrcProfile->pAddIEScan,
-			pSrcProfile->nAddIEScanLength);
-	}
-	if (pSrcProfile->nAddIEAssocLength) {
-		pDstProfile->pAddIEAssoc =
-			qdf_mem_malloc(pSrcProfile->nAddIEAssocLength);
-		if (!pDstProfile->pAddIEAssoc) {
-			status = QDF_STATUS_E_NOMEM;
-			goto end;
-		}
-		pDstProfile->nAddIEAssocLength =
-			pSrcProfile->nAddIEAssocLength;
-		qdf_mem_copy(pDstProfile->pAddIEAssoc, pSrcProfile->pAddIEAssoc,
-			pSrcProfile->nAddIEAssocLength);
-	}
+
 	if (pSrcProfile->ChannelInfo.freq_list) {
 		pDstProfile->ChannelInfo.freq_list =
 			qdf_mem_malloc(sizeof(uint32_t) *
@@ -6169,26 +6123,17 @@ QDF_STATUS csr_roam_copy_profile(struct mac_context *mac,
 			     pSrcProfile->ChannelInfo.numOfChannels);
 	}
 	pDstProfile->AuthType = pSrcProfile->AuthType;
-	pDstProfile->akm_list = pSrcProfile->akm_list;
 	pDstProfile->EncryptionType = pSrcProfile->EncryptionType;
-	pDstProfile->mcEncryptionType = pSrcProfile->mcEncryptionType;
 	pDstProfile->negotiatedUCEncryptionType =
 		pSrcProfile->negotiatedUCEncryptionType;
-	pDstProfile->negotiatedMCEncryptionType =
-		pSrcProfile->negotiatedMCEncryptionType;
+	pDstProfile->mcEncryptionType = pSrcProfile->mcEncryptionType;
 	pDstProfile->negotiatedAuthType = pSrcProfile->negotiatedAuthType;
-	pDstProfile->MFPEnabled = pSrcProfile->MFPEnabled;
 	pDstProfile->MFPRequired = pSrcProfile->MFPRequired;
 	pDstProfile->MFPCapable = pSrcProfile->MFPCapable;
 	pDstProfile->BSSType = pSrcProfile->BSSType;
 	pDstProfile->phyMode = pSrcProfile->phyMode;
 	pDstProfile->csrPersona = pSrcProfile->csrPersona;
 
-#ifdef FEATURE_WLAN_WAPI
-	if (csr_is_profile_wapi(pSrcProfile))
-		if (pDstProfile->phyMode & eCSR_DOT11_MODE_11n)
-			pDstProfile->phyMode &= ~eCSR_DOT11_MODE_11n;
-#endif /* FEATURE_WLAN_WAPI */
 	pDstProfile->ch_params.ch_width = pSrcProfile->ch_params.ch_width;
 	pDstProfile->ch_params.center_freq_seg0 =
 		pSrcProfile->ch_params.center_freq_seg0;
@@ -6196,10 +6141,6 @@ QDF_STATUS csr_roam_copy_profile(struct mac_context *mac,
 		pSrcProfile->ch_params.center_freq_seg1;
 	pDstProfile->ch_params.sec_ch_offset =
 		pSrcProfile->ch_params.sec_ch_offset;
-	/*Save the WPS info */
-	pDstProfile->bWPSAssociation = pSrcProfile->bWPSAssociation;
-	pDstProfile->bOSENAssociation = pSrcProfile->bOSENAssociation;
-	pDstProfile->force_24ghz_in_ht20 = pSrcProfile->force_24ghz_in_ht20;
 	pDstProfile->uapsd_mask = pSrcProfile->uapsd_mask;
 	pDstProfile->beaconInterval = pSrcProfile->beaconInterval;
 	pDstProfile->privacy = pSrcProfile->privacy;
@@ -6214,17 +6155,10 @@ QDF_STATUS csr_roam_copy_profile(struct mac_context *mac,
 	pDstProfile->cfg_protection = pSrcProfile->cfg_protection;
 	pDstProfile->wps_state = pSrcProfile->wps_state;
 	pDstProfile->ieee80211d = pSrcProfile->ieee80211d;
-	qdf_mem_copy(&pDstProfile->Keys, &pSrcProfile->Keys,
-		sizeof(pDstProfile->Keys));
-	pDstProfile->MFPEnabled = pSrcProfile->MFPEnabled;
 	pDstProfile->MFPRequired = pSrcProfile->MFPRequired;
 	pDstProfile->MFPCapable = pSrcProfile->MFPCapable;
-	pDstProfile->mdid = pSrcProfile->mdid;
 	pDstProfile->add_ie_params = pSrcProfile->add_ie_params;
 
-#ifndef FEATURE_CM_ENABLE
-	update_profile_fils_info(mac, pDstProfile, pSrcProfile, vdev_id);
-#endif
 	pDstProfile->beacon_tx_rate = pSrcProfile->beacon_tx_rate;
 
 	if (pSrcProfile->supported_rates.numRates) {
@@ -6245,7 +6179,71 @@ QDF_STATUS csr_roam_copy_profile(struct mac_context *mac,
 	pDstProfile->dfs_regdomain   = pSrcProfile->dfs_regdomain;
 	pDstProfile->chan_switch_hostapd_rate_enabled  =
 		pSrcProfile->chan_switch_hostapd_rate_enabled;
+#ifndef FEATURE_CM_ENABLE
+	pDstProfile->negotiatedMCEncryptionType =
+		pSrcProfile->negotiatedMCEncryptionType;
+	pDstProfile->MFPEnabled = pSrcProfile->MFPEnabled;
+	if (pSrcProfile->nWPAReqIELength) {
+		pDstProfile->pWPAReqIE =
+			qdf_mem_malloc(pSrcProfile->nWPAReqIELength);
+		if (!pDstProfile->pWPAReqIE) {
+			status = QDF_STATUS_E_NOMEM;
+			goto end;
+		}
+		pDstProfile->nWPAReqIELength =
+			pSrcProfile->nWPAReqIELength;
+		qdf_mem_copy(pDstProfile->pWPAReqIE, pSrcProfile->pWPAReqIE,
+			pSrcProfile->nWPAReqIELength);
+	}
+#ifdef FEATURE_WLAN_WAPI
+	if (pSrcProfile->nWAPIReqIELength) {
+		pDstProfile->pWAPIReqIE =
+			qdf_mem_malloc(pSrcProfile->nWAPIReqIELength);
+		if (!pDstProfile->pWAPIReqIE) {
+			status = QDF_STATUS_E_NOMEM;
+			goto end;
+		}
+		pDstProfile->nWAPIReqIELength =
+			pSrcProfile->nWAPIReqIELength;
+		qdf_mem_copy(pDstProfile->pWAPIReqIE, pSrcProfile->pWAPIReqIE,
+			pSrcProfile->nWAPIReqIELength);
+	}
+	if (csr_is_profile_wapi(pSrcProfile))
+		if (pDstProfile->phyMode & eCSR_DOT11_MODE_11n)
+			pDstProfile->phyMode &= ~eCSR_DOT11_MODE_11n;
+#endif /* FEATURE_WLAN_WAPI */
+	if (pSrcProfile->nAddIEScanLength && pSrcProfile->pAddIEScan) {
+		pDstProfile->pAddIEScan =
+			qdf_mem_malloc(pSrcProfile->nAddIEScanLength);
+		if (!pDstProfile->pAddIEScan) {
+			status = QDF_STATUS_E_NOMEM;
+			goto end;
+		}
+		pDstProfile->nAddIEScanLength =
+			pSrcProfile->nAddIEScanLength;
+		qdf_mem_copy(pDstProfile->pAddIEScan, pSrcProfile->pAddIEScan,
+			pSrcProfile->nAddIEScanLength);
+	}
+	if (pSrcProfile->nAddIEAssocLength) {
+		pDstProfile->pAddIEAssoc =
+			qdf_mem_malloc(pSrcProfile->nAddIEAssocLength);
+		if (!pDstProfile->pAddIEAssoc) {
+			status = QDF_STATUS_E_NOMEM;
+			goto end;
+		}
+		pDstProfile->nAddIEAssocLength =
+			pSrcProfile->nAddIEAssocLength;
+		qdf_mem_copy(pDstProfile->pAddIEAssoc, pSrcProfile->pAddIEAssoc,
+			pSrcProfile->nAddIEAssocLength);
+	}
+	/*Save the WPS info */
+	pDstProfile->bWPSAssociation = pSrcProfile->bWPSAssociation;
+	pDstProfile->bOSENAssociation = pSrcProfile->bOSENAssociation;
+	pDstProfile->mdid = pSrcProfile->mdid;
+	update_profile_fils_info(mac, pDstProfile, pSrcProfile, vdev_id);
+	pDstProfile->force_24ghz_in_ht20 = pSrcProfile->force_24ghz_in_ht20;
 	pDstProfile->force_rsne_override = pSrcProfile->force_rsne_override;
+#endif
 end:
 	if (!QDF_IS_STATUS_SUCCESS(status)) {
 		csr_release_profile(mac, pDstProfile);

+ 2 - 1
core/sme/src/csr/csr_inside_api.h

@@ -527,10 +527,11 @@ tSmeCmd *csr_get_command_buffer(struct mac_context *mac);
 void csr_release_command(struct mac_context *mac, tSmeCmd *pCommand);
 void csr_release_command_buffer(struct mac_context *mac, tSmeCmd *pCommand);
 
+#ifndef FEATURE_CM_ENABLE
 #ifdef FEATURE_WLAN_WAPI
 bool csr_is_profile_wapi(struct csr_roam_profile *pProfile);
 #endif /* FEATURE_WLAN_WAPI */
-
+#endif
 /**
  * csr_get_vdev_type_nss() - gets the nss value based on vdev type
  * @dev_mode: current device operating mode.

+ 50 - 51
core/sme/src/csr/csr_util.c

@@ -2123,60 +2123,28 @@ bool csr_is_profile_rsn(struct csr_roam_profile *pProfile)
 	}
 	return fRSNProfile;
 }
-#endif
-
-bool csr_is_auth_type_ese(enum csr_akm_type AuthType)
-{
-	switch (AuthType) {
-	case eCSR_AUTH_TYPE_CCKM_WPA:
-	case eCSR_AUTH_TYPE_CCKM_RSN:
-		return true;
-	default:
-		break;
-	}
-	return false;
-}
 
 #ifdef FEATURE_WLAN_ESE
-
 /* Function to return true if the profile is ESE */
 bool csr_is_profile_ese(struct csr_roam_profile *pProfile)
 {
 	return csr_is_auth_type_ese(pProfile->negotiatedAuthType);
 }
+#endif
 
 #endif
 
-#ifdef FEATURE_WLAN_WAPI
-bool csr_is_profile_wapi(struct csr_roam_profile *pProfile)
+bool csr_is_auth_type_ese(enum csr_akm_type AuthType)
 {
-	bool fWapiProfile = false;
-
-	switch (pProfile->negotiatedAuthType) {
-	case eCSR_AUTH_TYPE_WAPI_WAI_CERTIFICATE:
-	case eCSR_AUTH_TYPE_WAPI_WAI_PSK:
-		fWapiProfile = true;
-		break;
-
+	switch (AuthType) {
+	case eCSR_AUTH_TYPE_CCKM_WPA:
+	case eCSR_AUTH_TYPE_CCKM_RSN:
+		return true;
 	default:
-		fWapiProfile = false;
 		break;
 	}
-
-	if (fWapiProfile) {
-		switch (pProfile->negotiatedUCEncryptionType) {
-		case eCSR_ENCRYPT_TYPE_WPI:
-			fWapiProfile = true;
-			break;
-
-		default:
-			fWapiProfile = false;
-			break;
-		}
-	}
-	return fWapiProfile;
+	return false;
 }
-#endif /* FEATURE_WLAN_WAPI */
 
 bool csr_is_pmkid_found_for_peer(struct mac_context *mac,
 				 struct csr_roam_session *session,
@@ -2217,6 +2185,36 @@ bool csr_is_pmkid_found_for_peer(struct mac_context *mac,
 }
 
 #ifndef FEATURE_CM_ENABLE
+#ifdef FEATURE_WLAN_WAPI
+bool csr_is_profile_wapi(struct csr_roam_profile *pProfile)
+{
+	bool fWapiProfile = false;
+
+	switch (pProfile->negotiatedAuthType) {
+	case eCSR_AUTH_TYPE_WAPI_WAI_CERTIFICATE:
+	case eCSR_AUTH_TYPE_WAPI_WAI_PSK:
+		fWapiProfile = true;
+		break;
+
+	default:
+		fWapiProfile = false;
+		break;
+	}
+
+	if (fWapiProfile) {
+		switch (pProfile->negotiatedUCEncryptionType) {
+		case eCSR_ENCRYPT_TYPE_WPI:
+			fWapiProfile = true;
+			break;
+
+		default:
+			fWapiProfile = false;
+			break;
+		}
+	}
+	return fWapiProfile;
+}
+#endif /* FEATURE_WLAN_WAPI */
 bool csr_lookup_fils_pmkid(struct mac_context *mac,
 			   uint8_t vdev_id, uint8_t *cache_id,
 			   uint8_t *ssid, uint8_t ssid_len,
@@ -2771,14 +2769,20 @@ void csr_release_profile(struct mac_context *mac,
 			qdf_mem_free(pProfile->SSIDs.SSIDList);
 			pProfile->SSIDs.SSIDList = NULL;
 		}
-		if (pProfile->pWPAReqIE) {
-			qdf_mem_free(pProfile->pWPAReqIE);
-			pProfile->pWPAReqIE = NULL;
+
+		if (pProfile->ChannelInfo.freq_list) {
+			qdf_mem_free(pProfile->ChannelInfo.freq_list);
+			pProfile->ChannelInfo.freq_list = NULL;
 		}
 		if (pProfile->pRSNReqIE) {
 			qdf_mem_free(pProfile->pRSNReqIE);
 			pProfile->pRSNReqIE = NULL;
 		}
+#ifndef FEATURE_CM_ENABLE
+		if (pProfile->pWPAReqIE) {
+			qdf_mem_free(pProfile->pWPAReqIE);
+			pProfile->pWPAReqIE = NULL;
+		}
 #ifdef FEATURE_WLAN_WAPI
 		if (pProfile->pWAPIReqIE) {
 			qdf_mem_free(pProfile->pWAPIReqIE);
@@ -2786,20 +2790,15 @@ void csr_release_profile(struct mac_context *mac,
 		}
 #endif /* FEATURE_WLAN_WAPI */
 
-		if (pProfile->pAddIEScan) {
-			qdf_mem_free(pProfile->pAddIEScan);
-			pProfile->pAddIEScan = NULL;
-		}
-
 		if (pProfile->pAddIEAssoc) {
 			qdf_mem_free(pProfile->pAddIEAssoc);
 			pProfile->pAddIEAssoc = NULL;
 		}
-		if (pProfile->ChannelInfo.freq_list) {
-			qdf_mem_free(pProfile->ChannelInfo.freq_list);
-			pProfile->ChannelInfo.freq_list = NULL;
+
+		if (pProfile->pAddIEScan) {
+			qdf_mem_free(pProfile->pAddIEScan);
+			pProfile->pAddIEScan = NULL;
 		}
-#ifndef FEATURE_CM_ENABLE
 		csr_free_fils_profile_info(mac, pProfile);
 #endif
 		qdf_mem_zero(pProfile, sizeof(struct csr_roam_profile));