Jelajahi Sumber

qcacld-3.0: Add fils code for connection manager

Add fils code for connection manager.

Change-Id: Icabc91605077c483487d6070ccc3fc714ba2d315
CRs-Fixed: 2857915
gaurank kathpalia 4 tahun lalu
induk
melakukan
0030dee8db

+ 14 - 1
components/umac/mlme/connection_mgr/dispatcher/inc/wlan_cm_roam_api.h

@@ -491,6 +491,7 @@ struct wlan_fils_connection_info *wlan_cm_get_fils_connection_info(
 		struct wlan_objmgr_psoc *psoc,
 		uint8_t vdev_id);
 
+#ifndef FEATURE_CM_ENABLE
 /**
  * wlan_cm_update_mlme_fils_connection_info  - Update FILS connection info
  * to mlme vdev private object
@@ -504,7 +505,19 @@ QDF_STATUS wlan_cm_update_mlme_fils_connection_info(
 		struct wlan_objmgr_psoc *psoc,
 		struct wlan_fils_connection_info *src_fils_info,
 		uint8_t vdev_id);
-
+#else
+/**
+ * wlan_cm_update_mlme_fils_info  - Update FILS connection info
+ * to mlme vdev private object
+ * @vdev: Pointer to pdev object
+ * @src_fils_info: Current profile FILS connection information
+ *
+ * Return: QDF_STATUS
+ */
+QDF_STATUS
+wlan_cm_update_mlme_fils_info(struct wlan_objmgr_vdev *vdev,
+			      struct wlan_fils_con_info *src_fils_info);
+#endif
 /**
  * wlan_cm_update_fils_ft - Update the FILS FT derived to mlme
  * @psoc: Psoc pointer

+ 8 - 0
components/umac/mlme/connection_mgr/dispatcher/inc/wlan_cm_roam_public_struct.h

@@ -27,6 +27,7 @@
 #include "wlan_blm_public_struct.h"
 #include "wmi_unified_param.h"
 #include "wmi_unified_sta_param.h"
+#include "wlan_cm_public_struct.h"
 
 #define ROAM_SCAN_OFFLOAD_START                     1
 #define ROAM_SCAN_OFFLOAD_STOP                      2
@@ -87,9 +88,16 @@
 #define REASON_ROAM_HANDOFF_DONE                    52
 #define REASON_ROAM_ABORT                           53
 
+#ifdef FEATURE_CM_ENABLE
+#define FILS_MAX_KEYNAME_NAI_LENGTH WLAN_CM_FILS_MAX_KEYNAME_NAI_LENGTH
+#define WLAN_FILS_MAX_REALM_LEN WLAN_CM_FILS_MAX_REALM_LEN
+#define WLAN_FILS_MAX_RRK_LENGTH WLAN_CM_FILS_MAX_RRK_LENGTH
+#else
 #define FILS_MAX_KEYNAME_NAI_LENGTH 253
 #define WLAN_FILS_MAX_REALM_LEN 255
 #define WLAN_FILS_MAX_RRK_LENGTH 64
+#endif
+
 #define WLAN_FILS_MAX_RIK_LENGTH WLAN_FILS_MAX_RRK_LENGTH
 #define WLAN_FILS_FT_MAX_LEN          48
 

+ 52 - 0
components/umac/mlme/connection_mgr/dispatcher/src/wlan_cm_roam_api.c

@@ -1414,6 +1414,7 @@ rel_vdev_ref:
 }
 
 #ifdef WLAN_FEATURE_FILS_SK
+#ifndef FEATURE_CM_ENABLE
 QDF_STATUS wlan_cm_update_mlme_fils_connection_info(
 		struct wlan_objmgr_psoc *psoc,
 		struct wlan_fils_connection_info *src_fils_info,
@@ -1462,7 +1463,58 @@ QDF_STATUS wlan_cm_update_mlme_fils_connection_info(
 
 	return QDF_STATUS_SUCCESS;
 }
+#else
+QDF_STATUS
+wlan_cm_update_mlme_fils_info(struct wlan_objmgr_vdev *vdev,
+			      struct wlan_fils_con_info *src_fils_info)
+{
+	struct mlme_legacy_priv *mlme_priv;
+	uint8_t vdev_id = wlan_vdev_get_id(vdev);
+	struct wlan_fils_connection_info *tgt_info;
+
+	mlme_priv = wlan_vdev_mlme_get_ext_hdl(vdev);
+	if (!mlme_priv) {
+		mlme_err("vdev legacy private object is NULL fro vdev %d",
+			 vdev_id);
+		return QDF_STATUS_E_FAILURE;
+	}
+
+	if (!src_fils_info) {
+		mlme_debug("FILS: vdev:%d Clear fils info", vdev_id);
+		qdf_mem_free(mlme_priv->fils_con_info);
+		mlme_priv->fils_con_info = NULL;
+		return QDF_STATUS_SUCCESS;
+	}
 
+	if (mlme_priv->fils_con_info)
+		qdf_mem_free(mlme_priv->fils_con_info);
+
+	mlme_priv->fils_con_info =
+		qdf_mem_malloc(sizeof(struct wlan_fils_connection_info));
+	if (!mlme_priv->fils_con_info)
+		return QDF_STATUS_E_NOMEM;
+
+	tgt_info = mlme_priv->fils_con_info;
+	mlme_debug("FILS: vdev:%d update fils info", vdev_id);
+	tgt_info->is_fils_connection = src_fils_info->is_fils_connection;
+	tgt_info->key_nai_length = src_fils_info->username_len;
+	qdf_mem_copy(tgt_info->keyname_nai, src_fils_info->username,
+		     tgt_info->key_nai_length);
+
+	tgt_info->realm_len = src_fils_info->realm_len;
+	qdf_mem_copy(tgt_info->realm, src_fils_info->realm,
+		     tgt_info->realm_len);
+
+	tgt_info->r_rk_length = src_fils_info->rrk_len;
+	qdf_mem_copy(tgt_info->r_rk, src_fils_info->rrk,
+		     tgt_info->r_rk_length);
+	tgt_info->erp_sequence_number = src_fils_info->next_seq_num;
+	tgt_info->auth_type = src_fils_info->auth_type;
+
+	return QDF_STATUS_SUCCESS;
+}
+
+#endif
 struct wlan_fils_connection_info *wlan_cm_get_fils_connection_info(
 				struct wlan_objmgr_psoc *psoc,
 				uint8_t vdev_id)

+ 3 - 1
core/hdd/inc/wlan_hdd_assoc.h

@@ -200,11 +200,13 @@ struct hdd_context;
 
 /*
  * hdd_is_fils_connection: API to determine if connection is FILS
+ * @hdd_ctx: hdd context
  * @adapter: hdd adapter
  *
  * Return: true if fils connection else false
  */
-bool hdd_is_fils_connection(struct hdd_adapter *adapter);
+bool hdd_is_fils_connection(struct hdd_context *hdd_ctx,
+			    struct hdd_adapter *adapter);
 
 /**
  * hdd_conn_set_connection_state() - set connection state

+ 9 - 6
core/hdd/src/wlan_hdd_assoc.c

@@ -4732,18 +4732,21 @@ hdd_translate_wpa_to_csr_encryption_type(uint8_t cipher_suite[4])
 }
 
 #ifdef WLAN_FEATURE_FILS_SK
-bool hdd_is_fils_connection(struct hdd_adapter *adapter)
+bool hdd_is_fils_connection(struct hdd_context *hdd_ctx,
+			    struct hdd_adapter *adapter)
 {
-	struct csr_roam_profile *roam_profile;
+	struct wlan_fils_connection_info *fils_info;
 
-	roam_profile = hdd_roam_profile(adapter);
-	if (roam_profile->fils_con_info)
-		return roam_profile->fils_con_info->is_fils_connection;
+	fils_info = wlan_cm_get_fils_connection_info(hdd_ctx->psoc,
+						     adapter->vdev_id);
+	if (fils_info)
+		return fils_info->is_fils_connection;
 
 	return false;
 }
 #else
-bool hdd_is_fils_connection(struct hdd_adapter *adapter)
+bool hdd_is_fils_connection(struct hdd_context *hdd_ctx,
+			    struct hdd_adapter *adapter)
 {
 	return false;
 }

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

@@ -6526,6 +6526,7 @@ void wlan_hdd_save_gtk_offload_params(struct hdd_adapter *adapter,
 	struct pmo_gtk_req *gtk_req = NULL;
 	struct wlan_objmgr_vdev *vdev;
 	QDF_STATUS status = QDF_STATUS_E_FAILURE;
+	struct hdd_context *hdd_ctx =  WLAN_HDD_GET_CTX(adapter);
 
 	gtk_req = qdf_mem_malloc(sizeof(*gtk_req));
 	if (!gtk_req)
@@ -6553,7 +6554,7 @@ void wlan_hdd_save_gtk_offload_params(struct hdd_adapter *adapter,
 	qdf_copy_macaddr(&gtk_req->bssid, &hdd_sta_ctx->conn_info.bssid);
 
 	gtk_req->kek_len = kek_len;
-	gtk_req->is_fils_connection = hdd_is_fils_connection(adapter);
+	gtk_req->is_fils_connection = hdd_is_fils_connection(hdd_ctx, adapter);
 
 	/* convert big to little endian since driver work on little endian */
 	buf = (uint8_t *)&gtk_req->replay_counter;
@@ -22576,7 +22577,7 @@ int __wlan_hdd_cfg80211_set_rekey_data(struct wiphy *wiphy,
 		qdf_mem_copy(gtk_req->kck, data->kck, NL80211_KCK_LEN);
 		gtk_req->kck_len = NL80211_KCK_LEN;
 	}
-	gtk_req->is_fils_connection = hdd_is_fils_connection(adapter);
+	gtk_req->is_fils_connection = hdd_is_fils_connection(hdd_ctx, adapter);
 	vdev = hdd_objmgr_get_vdev_by_user(adapter, WLAN_OSIF_POWER_ID);
 	if (!vdev) {
 		result = -EINVAL;

+ 22 - 1
core/mac/src/pe/include/lim_process_fils.h

@@ -80,6 +80,20 @@ bool lim_is_valid_fils_auth_frame(struct mac_context *mac_ctx,
 QDF_STATUS lim_create_fils_rik(uint8_t *rrk, uint8_t rrk_len,
 			       uint8_t *rik, uint32_t *rik_len);
 
+#ifdef FEATURE_CM_ENABLE
+/**
+ * lim_update_fils_config()- This API updates fils session info to csr config
+ * from join request.
+ * @mac_ctx: pointer to mac context
+ * @session: PE session
+ * @join_req: pointer to join request
+ *
+ * Return: None
+ */
+void lim_update_fils_config(struct mac_context *mac_ctx,
+			    struct pe_session *session,
+			    struct cm_vdev_join_req *join_req);
+#else
 /**
  * lim_update_fils_config()- This API updates fils session info to csr config
  * from join request.
@@ -92,7 +106,7 @@ QDF_STATUS lim_create_fils_rik(uint8_t *rrk, uint8_t rrk_len,
 void lim_update_fils_config(struct mac_context *mac_ctx,
 			    struct pe_session *session,
 			    struct join_req *sme_join_req);
-
+#endif
 /**
  * lim_create_fils_auth_data()- This API creates the fils auth data
  * which needs to be sent in auth req.
@@ -255,11 +269,18 @@ static inline bool lim_is_valid_fils_auth_frame(struct mac_context *mac_ctx,
 	return true;
 }
 
+#ifdef FEATURE_CM_ENABLE
+static inline void lim_update_fils_config(struct mac_context *mac_ctx,
+			    struct pe_session *session,
+			    struct cm_vdev_join_req *join_req)
+{}
+#else
 static inline
 void lim_update_fils_config(struct mac_context *mac_ctx,
 			    struct pe_session *session,
 			    struct join_req *sme_join_req)
 { }
+#endif
 
 static inline
 QDF_STATUS lim_create_fils_auth_data(struct mac_context *mac_ctx,

+ 148 - 0
core/mac/src/pe/lim/lim_process_fils.c

@@ -1408,6 +1408,153 @@ bool lim_process_fils_auth_frame2(struct mac_context *mac_ctx,
 	return true;
 }
 
+#ifdef FEATURE_CM_ENABLE
+static enum eAniAuthType lim_get_auth_type(uint8_t auth_type)
+{
+	switch (auth_type) {
+	case FILS_SK_WITHOUT_PFS:
+		return SIR_FILS_SK_WITHOUT_PFS;
+	case FILS_SK_WITH_PFS:
+		return SIR_FILS_SK_WITH_PFS;
+	case FILS_PK_AUTH:
+		return SIR_FILS_PK_AUTH;
+	default:
+		return eSIR_DONOT_USE_AUTH_TYPE;
+	}
+}
+
+static uint8_t lim_get_akm_type(struct wlan_objmgr_vdev *vdev)
+{
+	int32_t akm;
+
+	akm = wlan_crypto_get_param(vdev, WLAN_CRYPTO_PARAM_KEY_MGMT);
+
+	if (QDF_HAS_PARAM(akm, WLAN_CRYPTO_KEY_MGMT_FT_FILS_SHA384))
+		return eCSR_AUTH_TYPE_FT_FILS_SHA384;
+	else if (QDF_HAS_PARAM(akm, WLAN_CRYPTO_KEY_MGMT_FT_FILS_SHA256))
+		return eCSR_AUTH_TYPE_FT_FILS_SHA256;
+	else if (QDF_HAS_PARAM(akm, WLAN_CRYPTO_KEY_MGMT_FILS_SHA384))
+		return eCSR_AUTH_TYPE_FILS_SHA384;
+	else
+		return eCSR_AUTH_TYPE_FILS_SHA256;
+}
+
+void lim_update_fils_config(struct mac_context *mac_ctx,
+			    struct pe_session *session,
+			    struct cm_vdev_join_req *join_req)
+{
+	struct pe_fils_session *pe_fils_info;
+	struct wlan_fils_connection_info *fils_info = NULL;
+/*
+	tDot11fIERSN dot11f_ie_rsn = {0};
+	uint32_t ret;
+*/
+	struct mlme_legacy_priv *mlme_priv;
+
+	mlme_priv = wlan_vdev_mlme_get_ext_hdl(session->vdev);
+	if (!mlme_priv)
+		return;
+	fils_info = mlme_priv->fils_con_info;
+
+	pe_fils_info = session->fils_info;
+	if (!pe_fils_info)
+		return;
+
+	if (!fils_info->is_fils_connection)
+		return;
+
+	pe_fils_info->is_fils_connection = fils_info->is_fils_connection;
+	pe_fils_info->keyname_nai_length = fils_info->key_nai_length;
+	pe_fils_info->fils_rrk_len = fils_info->r_rk_length;
+	pe_fils_info->akm = lim_get_akm_type(session->vdev);
+	pe_fils_info->auth = lim_get_auth_type(fils_info->auth_type);
+	pe_fils_info->sequence_number = fils_info->erp_sequence_number;
+
+	if (fils_info->key_nai_length > FILS_MAX_KEYNAME_NAI_LENGTH) {
+		pe_err("Restricting the key_nai_length of %d to max %d",
+		       fils_info->key_nai_length,
+		       FILS_MAX_KEYNAME_NAI_LENGTH);
+		fils_info->key_nai_length = FILS_MAX_KEYNAME_NAI_LENGTH;
+	}
+
+	if (fils_info->key_nai_length) {
+		pe_fils_info->keyname_nai_data =
+			qdf_mem_malloc(fils_info->key_nai_length);
+		if (!pe_fils_info->keyname_nai_data)
+			return;
+
+		qdf_mem_copy(pe_fils_info->keyname_nai_data,
+			     fils_info->keyname_nai,
+			     fils_info->key_nai_length);
+	}
+
+	if (fils_info->r_rk_length) {
+		pe_fils_info->fils_rrk =
+			qdf_mem_malloc(fils_info->r_rk_length);
+		if (!pe_fils_info->fils_rrk) {
+			qdf_mem_free(pe_fils_info->keyname_nai_data);
+			return;
+		}
+
+		if (fils_info->r_rk_length <= WLAN_FILS_MAX_RRK_LENGTH)
+			qdf_mem_copy(pe_fils_info->fils_rrk,
+				     fils_info->r_rk,
+				     fils_info->r_rk_length);
+	}
+
+	qdf_mem_copy(pe_fils_info->fils_pmkid, fils_info->pmkid,
+		     PMKID_LEN);
+
+/*
+	pe_fils_info->rsn_ie_len = sme_join_req->rsnIE.length;
+	qdf_mem_copy(pe_fils_info->rsn_ie,
+		     sme_join_req->rsnIE.rsnIEdata,
+		     sme_join_req->rsnIE.length);
+*/
+	/*
+	 * When AP is MFP capable and STA is also MFP capable,
+	 * the supplicant fills the RSN IE with PMKID count as 0
+	 * and PMKID as 0, then appends the group management cipher
+	 * suite. This opaque RSN IE is copied into fils_info in pe
+	 * session. For FT-FILS association, STA has to fill the
+	 * PMKR0 derived after authentication response is received from
+	 * the AP. So unpack the RSN IE to find if group management cipher
+	 * suite is present and based on this RSN IE will be constructed in
+	 * lim_generate_fils_pmkr1_name() for FT-FILS connection.
+	 */
+/*
+	ret = dot11f_unpack_ie_rsn(mac_ctx, pe_fils_info->rsn_ie + 2,
+				   pe_fils_info->rsn_ie_len - 2,
+				   &dot11f_ie_rsn, 0);
+	if (DOT11F_SUCCEEDED(ret))
+		pe_fils_info->group_mgmt_cipher_present =
+			dot11f_ie_rsn.gp_mgmt_cipher_suite_present;
+	else
+		pe_err("FT-FILS: Invalid RSN IE");
+*/
+	pe_fils_info->fils_pmk_len = fils_info->pmk_len;
+	if (fils_info->pmk_len) {
+		pe_fils_info->fils_pmk =
+			qdf_mem_malloc(fils_info->pmk_len);
+		if (!pe_fils_info->fils_pmk) {
+			qdf_mem_free(pe_fils_info->keyname_nai_data);
+			qdf_mem_free(pe_fils_info->fils_rrk);
+			return;
+		}
+		qdf_mem_copy(pe_fils_info->fils_pmk, fils_info->pmk,
+			     fils_info->pmk_len);
+	}
+
+	pe_debug("FILS: fils=%d nai-len=%d rrk_len=%d akm=%d auth=%d pmk_len=%d",
+		 fils_info->is_fils_connection,
+		 fils_info->key_nai_length,
+		 fils_info->r_rk_length,
+		 fils_info->akm_type,
+		 fils_info->auth_type,
+		 fils_info->pmk_len);
+}
+
+#else
 void lim_update_fils_config(struct mac_context *mac_ctx,
 			    struct pe_session *session,
 			    struct join_req *sme_join_req)
@@ -1518,6 +1665,7 @@ void lim_update_fils_config(struct mac_context *mac_ctx,
 		 fils_info->auth_type,
 		 fils_info->pmk_len);
 }
+#endif
 
 #define EXTENDED_IE_HEADER_LEN 3
 /**

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

@@ -1023,6 +1023,7 @@ void lim_get_random_bssid(struct mac_context *mac, uint8_t *data)
 	qdf_mem_copy(data, random, sizeof(tSirMacAddr));
 }
 
+#ifndef FEATURE_CM_ENABLE
 #ifdef WLAN_FEATURE_SAE
 
 /**
@@ -1047,6 +1048,7 @@ static inline void lim_update_sae_config(struct pe_session *session,
 					 struct join_req *sme_join_req)
 {}
 #endif
+#endif
 
 /**
  * lim_send_join_req() - send vdev start request for assoc
@@ -2862,6 +2864,7 @@ lim_fill_session_params(struct mac_context *mac_ctx,
 
 	session->rateSet.numRates = op_rate_len;
 	session->extRateSet.numRates = ext_rate_len;
+	lim_update_fils_config(mac_ctx, session, req);
 
 	qdf_mem_copy(pe_join_req->addIEAssoc.addIEdata,
 		     req->assoc_ie.ptr, req->assoc_ie.len);
@@ -2897,6 +2900,20 @@ lim_cm_handle_join_req(struct cm_vdev_join_req *req)
 	if (QDF_IS_STATUS_ERROR(status))
 		goto fail;
 
+	pe_debug("Freq %d width %d freq0 %d freq1 %d, Smps %d: mode %d action %d, nss 1x1 %d vdev_nss %d nss %d cbMode %d dot11mode %d subfer %d subfee %d csn %d is_cisco %d",
+		 pe_session->curr_op_freq, pe_session->ch_width,
+		 pe_session->ch_center_freq_seg0,
+		 pe_session->ch_center_freq_seg1,
+		 pe_session->enableHtSmps, pe_session->htSmpsvalue,
+		 pe_session->send_smps_action, pe_session->supported_nss_1x1,
+		 pe_session->vdev_nss, pe_session->nss,
+		 pe_session->htSupportedChannelWidthSet,
+		 pe_session->dot11mode,
+		 pe_session->vht_config.su_beam_former,
+		 pe_session->vht_config.su_beam_formee,
+		 pe_session->vht_config.csnof_beamformer_antSup,
+		 pe_session->isCiscoVendorAP);
+
 	status = lim_send_connect_req_to_mlm(pe_session);
 	if (QDF_IS_STATUS_ERROR(status)) {
 		pe_err("Failed to send mlm req vdev id %d",
@@ -3112,7 +3129,7 @@ QDF_STATUS cm_process_peer_create(struct scheduler_msg *msg)
 
 	return status;
 }
-#endif
+#else
 
 /**
  * __lim_process_sme_join_req() - process SME_JOIN_REQ message
@@ -3360,6 +3377,7 @@ end:
 	lim_send_sme_join_reassoc_rsp(mac_ctx, eWNI_SME_JOIN_RSP, ret_code,
 		STATUS_UNSPECIFIED_FAILURE, session, vdev_id);
 }
+#endif
 
 uint8_t lim_get_max_tx_power(struct mac_context *mac,
 			     struct lim_max_tx_pwr_attr *attr)
@@ -6292,11 +6310,11 @@ bool lim_process_sme_req_messages(struct mac_context *mac,
 	case eWNI_SME_START_BSS_REQ:
 		bufConsumed = __lim_process_sme_start_bss_req(mac, pMsg);
 		break;
-
+#ifndef FEATURE_CM_ENABLE
 	case eWNI_SME_JOIN_REQ:
 		__lim_process_sme_join_req(mac, msg_buf);
 		break;
-
+#endif
 	case eWNI_SME_REASSOC_REQ:
 		__lim_process_sme_reassoc_req(mac, msg_buf);
 		break;

+ 54 - 3
core/sme/src/csr/csr_api_roam.c

@@ -13705,6 +13705,50 @@ void csr_update_prev_ap_info(struct csr_roam_session *session,
 #endif
 
 #ifdef FEATURE_CM_ENABLE
+#ifdef WLAN_FEATURE_FILS_SK
+static QDF_STATUS csr_cm_update_fils_info(struct wlan_objmgr_vdev *vdev,
+					  struct bss_description *bss_desc,
+					  struct wlan_cm_vdev_connect_req *req)
+{
+	uint8_t cache_id[CACHE_ID_LEN] = {0};
+	struct scan_cache_entry *entry;
+	struct wlan_crypto_pmksa *fils_ssid_pmksa, *bssid_lookup_pmksa;
+
+	if (!req->fils_info || !req->fils_info->is_fils_connection) {
+		wlan_cm_update_mlme_fils_info(vdev, NULL);
+		return QDF_STATUS_SUCCESS;
+	}
+
+	if (bss_desc->fils_info_element.is_cache_id_present) {
+		qdf_mem_copy(cache_id, bss_desc->fils_info_element.cache_id,
+			     CACHE_ID_LEN);
+		sme_debug("FILS_PMKSA: cache_id[0]:%d, cache_id[1]:%d",
+			  cache_id[0], cache_id[1]);
+	}
+	entry = req->bss->entry;
+	bssid_lookup_pmksa = wlan_crypto_get_pmksa(vdev, &entry->bssid);
+	fils_ssid_pmksa =
+			wlan_crypto_get_fils_pmksa(vdev, cache_id,
+						   entry->ssid.ssid,
+						   entry->ssid.length);
+
+	if ((!req->fils_info->rrk_len ||
+	     !req->fils_info->username_len) &&
+	     !bss_desc->fils_info_element.is_cache_id_present &&
+	     !bssid_lookup_pmksa && !fils_ssid_pmksa)
+		return QDF_STATUS_E_FAILURE;
+
+	return wlan_cm_update_mlme_fils_info(vdev, req->fils_info);
+}
+#else
+static inline
+QDF_STATUS csr_cm_update_fils_info(struct wlan_objmgr_vdev *vdev,
+				   struct bss_description *bss_desc,
+				   struct wlan_cm_vdev_connect_req *req)
+{
+}
+#endif
+
 QDF_STATUS cm_csr_handle_connect_req(struct wlan_objmgr_vdev *vdev,
 				     struct wlan_cm_vdev_connect_req *req,
 				     struct cm_vdev_join_req *join_req)
@@ -13746,7 +13790,13 @@ QDF_STATUS cm_csr_handle_connect_req(struct wlan_objmgr_vdev *vdev,
 	status = wlan_get_parsed_bss_description_ies(mac_ctx, bss_desc,
 						     &ie_struct);
 	if (QDF_IS_STATUS_ERROR(status)) {
-		sme_err("IE parsing failed vdev id %d", wlan_vdev_get_id(vdev));
+		sme_err("IE parsing failed vdev id %d", vdev_id);
+		qdf_mem_free(bss_desc);
+		return QDF_STATUS_E_FAILURE;
+	}
+	status = csr_cm_update_fils_info(vdev, bss_desc, req);
+	if (QDF_IS_STATUS_ERROR(status)) {
+		sme_err("failed to update fils info vdev id %d", vdev_id);
 		qdf_mem_free(bss_desc);
 		return QDF_STATUS_E_FAILURE;
 	}
@@ -13755,8 +13805,7 @@ QDF_STATUS cm_csr_handle_connect_req(struct wlan_objmgr_vdev *vdev,
 				  &ext_rate_set);
 
 	if (QDF_IS_STATUS_ERROR(status)) {
-		sme_err("Rates parsing failed vdev id %d",
-			wlan_vdev_get_id(vdev));
+		sme_err("Rates parsing failed vdev id %d", vdev_id);
 		qdf_mem_free(ie_struct);
 		qdf_mem_free(bss_desc);
 		return QDF_STATUS_E_FAILURE;
@@ -19123,6 +19172,7 @@ csr_process_roam_sync_callback(struct mac_context *mac_ctx,
 	roam_info->update_erp_next_seq_num =
 			roam_synch_data->update_erp_next_seq_num;
 	roam_info->next_erp_seq_num = roam_synch_data->next_erp_seq_num;
+	/* for cm enable copy to reassoc/connect resp */
 #ifndef FEATURE_CM_ENABLE
 	csr_update_fils_erp_seq_num(session->pCurRoamProfile,
 				    roam_info->next_erp_seq_num);
@@ -19143,6 +19193,7 @@ csr_process_roam_sync_callback(struct mac_context *mac_ctx,
 	roam_info->roam_reason = roam_synch_data->roamReason &
 				 ROAM_REASON_MASK;
 	sme_debug("Update roam reason : %d", roam_info->roam_reason);
+	/* for cm enable copy to reassoc/connect resp */
 #ifndef FEATURE_CM_ENABLE
 	csr_copy_fils_join_rsp_roam_info(roam_info, roam_synch_data);
 #endif

+ 4 - 0
core/sme/src/csr/csr_inside_api.h

@@ -1027,6 +1027,8 @@ bool csr_lookup_pmkid_using_bssid(struct mac_context *mac,
 					struct csr_roam_session *session,
 					tPmkidCacheInfo *pmk_cache);
 
+#ifndef FEATURE_CM_ENABLE
+
 /**
  * csr_lookup_fils_pmkid  - Lookup FILS PMKID using ssid and cache id
  * @mac:       Pointer to mac context
@@ -1041,6 +1043,8 @@ bool csr_lookup_pmkid_using_bssid(struct mac_context *mac,
 bool csr_lookup_fils_pmkid(struct mac_context *mac, uint8_t vdev_id,
 			   uint8_t *cache_id, uint8_t *ssid,
 			   uint8_t ssid_len, struct qdf_mac_addr *bssid);
+#endif
+
 /**
  * csr_is_pmkid_found_for_peer() - check if pmkid sent by peer is present
 				   in PMK cache. Used in SAP mode.

+ 16 - 9
core/sme/src/csr/csr_util.c

@@ -2653,6 +2653,7 @@ bool csr_lookup_pmkid_using_bssid(struct mac_context *mac,
 	return true;
 }
 
+#ifndef FEATURE_CM_ENABLE
 bool csr_lookup_fils_pmkid(struct mac_context *mac,
 			   uint8_t vdev_id, uint8_t *cache_id,
 			   uint8_t *ssid, uint8_t ssid_len,
@@ -2680,7 +2681,7 @@ bool csr_lookup_fils_pmkid(struct mac_context *mac,
 
 	return true;
 }
-
+#endif
 #ifdef WLAN_FEATURE_FILS_SK
 /**
  * csr_update_pmksa_to_profile() - update pmk and pmkid to profile which will be
@@ -2690,20 +2691,26 @@ bool csr_lookup_fils_pmkid(struct mac_context *mac,
  *
  * Return: None
  */
-static inline void csr_update_pmksa_to_profile(struct csr_roam_profile *profile,
+static inline void csr_update_pmksa_to_profile(struct wlan_objmgr_vdev *vdev,
 					       struct wlan_crypto_pmksa *pmksa)
 {
-	if (!profile->fils_con_info)
-		return;
+	struct mlme_legacy_priv *mlme_priv;
 
-	profile->fils_con_info->pmk_len = pmksa->pmk_len;
-	qdf_mem_copy(profile->fils_con_info->pmk,
+	mlme_priv = wlan_vdev_mlme_get_ext_hdl(vdev);
+	if (!mlme_priv) {
+		mlme_err("vdev legacy private object is NULL");
+		return;
+	}
+	if (!mlme_priv->fils_con_info)
+		return;
+	mlme_priv->fils_con_info->pmk_len = pmksa->pmk_len;
+	qdf_mem_copy(mlme_priv->fils_con_info->pmk,
 		     pmksa->pmk, pmksa->pmk_len);
-	qdf_mem_copy(profile->fils_con_info->pmkid,
+	qdf_mem_copy(mlme_priv->fils_con_info->pmkid,
 		     pmksa->pmkid, PMKID_LEN);
 }
 #else
-static inline void csr_update_pmksa_to_profile(struct csr_roam_profile *profile,
+static inline void csr_update_pmksa_to_profile(struct wlan_objmgr_vdev *vdev,
 					       struct wlan_crypto_pmksa *pmksa)
 {
 }
@@ -2800,7 +2807,7 @@ uint8_t csr_construct_rsn_ie(struct mac_context *mac, uint32_t sessionId,
 	if (pmksa_peer) {
 		wlan_cm_set_psk_pmk(mac->pdev, sessionId,
 				    pmksa_peer->pmk, pmksa_peer->pmk_len);
-		csr_update_pmksa_to_profile(pProfile, pmksa_peer);
+		csr_update_pmksa_to_profile(vdev, pmksa_peer);
 	}
 	rso_cfg = wlan_cm_get_rso_config(vdev);
 	if (rso_cfg) {