Browse Source

qcacld-3.0: Fill RSN IE in LIM for connection manager

Fill RSN IE in LIM if profile is RSN.

Change-Id: I86b2bfcf554bea8c0ac860be2eb49c613c5ee041
CRs-Fixed: 2858412
gaurank kathpalia 4 years ago
parent
commit
d077fd57db

+ 2 - 0
components/mlme/core/src/wlan_mlme_main.c

@@ -2856,6 +2856,8 @@ QDF_STATUS wlan_strip_ie(uint8_t *addn_ie, uint16_t *addn_ielen,
 		mlme_debug("NULL addn_ie pointer");
 		return QDF_STATUS_E_INVAL;
 	}
+	if (!left)
+		return QDF_STATUS_E_INVAL;
 
 	tmp_buf = qdf_mem_malloc(left);
 	if (!tmp_buf)

+ 5 - 3
components/umac/mlme/connection_mgr/core/src/wlan_cm_vdev_connect.c

@@ -27,6 +27,7 @@
 #include "wlan_p2p_api.h"
 #include "wlan_tdls_api.h"
 #include "wlan_mlme_vdev_mgr_interface.h"
+#include "wni_api.h"
 
 QDF_STATUS cm_connect_start_ind(struct wlan_objmgr_vdev *vdev,
 				struct wlan_cm_connect_req *req)
@@ -94,12 +95,13 @@ cm_copy_join_params(struct cm_vdev_join_req *join_req,
 
 	qdf_mem_copy(join_req->assoc_ie.ptr, req->assoc_ie.ptr,
 		     req->assoc_ie.len);
+	join_req->assoc_ie.len = req->assoc_ie.len;
 
 	join_req->scan_ie.ptr = qdf_mem_malloc(req->scan_ie.len);
 
 	if (!join_req->scan_ie.ptr)
 		return QDF_STATUS_E_NOMEM;
-
+	join_req->scan_ie.len = req->scan_ie.len;
 	qdf_mem_copy(join_req->scan_ie.ptr, req->scan_ie.ptr,
 		     req->scan_ie.len);
 
@@ -188,7 +190,7 @@ cm_handle_connect_req(struct wlan_objmgr_vdev *vdev,
 	}
 
 	msg.bodyptr = join_req;
-	msg.callback = cm_process_join_req;
+	msg.type = CM_CONNECT_REQ;
 	msg.flush_callback = cm_flush_join_req;
 
 	status = scheduler_post_message(QDF_MODULE_ID_MLME,
@@ -221,7 +223,7 @@ cm_send_bss_peer_create_req(struct wlan_objmgr_vdev *vdev,
 	qdf_copy_macaddr(&req->peer_mac, peer_mac);
 
 	msg.bodyptr = req;
-	msg.callback = cm_process_peer_create;
+	msg.type = CM_BSS_PEER_CREATE_REQ;
 
 	status = scheduler_post_message(QDF_MODULE_ID_MLME,
 					QDF_MODULE_ID_PE,

+ 2 - 1
components/umac/mlme/connection_mgr/core/src/wlan_cm_vdev_disconnect.c

@@ -29,6 +29,7 @@
 #include <wlan_objmgr_pdev_obj.h>
 #include <wlan_objmgr_vdev_obj.h>
 #include <wlan_cm_roam_api.h>
+#include "wni_api.h"
 
 QDF_STATUS cm_disconnect_start_ind(struct wlan_objmgr_vdev *vdev,
 				   struct wlan_cm_disconnect_req *req)
@@ -103,7 +104,7 @@ cm_handle_disconnect_req(struct wlan_objmgr_vdev *vdev,
 
 	qdf_mem_copy(discon_req, req, sizeof(*req));
 	msg.bodyptr = discon_req;
-	msg.callback = cm_process_disconnect_req;
+	msg.type = CM_DISCONNECT_REQ;
 
 	status = scheduler_post_message(QDF_MODULE_ID_MLME,
 					QDF_MODULE_ID_PE,

+ 2 - 3
components/umac/mlme/connection_mgr/dispatcher/src/wlan_cm_roam_api.c

@@ -514,10 +514,9 @@ void wlan_cm_set_psk_pmk(struct wlan_objmgr_pdev *pdev,
 
 	vdev = wlan_objmgr_get_vdev_by_id_from_pdev(pdev, vdev_id,
 						    WLAN_MLME_CM_ID);
-	if (!vdev) {
-		mlme_err("vdev object is NULL");
+	if (!vdev)
 		return;
-	}
+
 	rso_cfg = wlan_cm_get_rso_config(vdev);
 	if (!rso_cfg) {
 		wlan_objmgr_vdev_release_ref(vdev, WLAN_MLME_CM_ID);

+ 5 - 4
core/hdd/src/wlan_hdd_assoc.c

@@ -303,7 +303,7 @@ hdd_conn_set_authenticated(struct hdd_adapter *adapter, uint8_t auth_state)
 
 	/* save the new connection state */
 	hdd_debug("Authenticated state Changed from oldState:%d to State:%d",
-		   sta_ctx->conn_info.is_authenticated, auth_state);
+		  sta_ctx->conn_info.is_authenticated, auth_state);
 	sta_ctx->conn_info.is_authenticated = auth_state;
 
 	auth_time = sta_ctx->conn_info.auth_time;
@@ -422,12 +422,13 @@ enum band_info hdd_conn_get_connected_band(struct hdd_adapter *adapter)
  * Return: false if any errors encountered, true otherwise
  */
 static inline bool
-hdd_conn_get_connected_cipher_algo(struct hdd_station_ctx *sta_ctx,
+hdd_conn_get_connected_cipher_algo(struct hdd_adapter *adapter,
+				   struct hdd_station_ctx *sta_ctx,
 				   eCsrEncryptionType *pConnectedCipherAlgo)
 {
 	bool connected = false;
 
-	connected = hdd_conn_get_connection_state(sta_ctx, NULL);
+	connected = hdd_cm_is_vdev_associated(adapter);
 
 	if (pConnectedCipherAlgo)
 		*pConnectedCipherAlgo = sta_ctx->conn_info.uc_encrypt_type;
@@ -2606,7 +2607,7 @@ hdd_roam_set_key_complete_handler(struct hdd_adapter *adapter,
 		  QDF_MAC_ADDR_FMT, roam_status, roam_result,
 		  QDF_MAC_ADDR_REF(roam_info->peerMac.bytes));
 
-	connected = hdd_conn_get_connected_cipher_algo(sta_ctx,
+	connected = hdd_conn_get_connected_cipher_algo(adapter, sta_ctx,
 						       &algorithm);
 	if (connected) {
 		hdd_change_peer_state_after_set_key(adapter, roam_info,

+ 23 - 24
core/hdd/src/wlan_hdd_cm_connect.c

@@ -50,16 +50,19 @@ bool hdd_cm_is_vdev_associated(struct hdd_adapter *adapter)
 {
 	struct wlan_objmgr_vdev *vdev;
 	bool is_vdev_active;
+	enum QDF_OPMODE opmode;
+	struct hdd_station_ctx *sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(adapter);
 
-	vdev = hdd_objmgr_get_vdev_by_user(adapter, WLAN_OSIF_CM_ID);
+	if (adapter->device_mode == QDF_NDI_MODE)
+		return (sta_ctx->conn_info.conn_state ==
+			eConnectionState_NdiConnected);
 
-	if (!vdev) {
-		mlme_err("vdev_id: %d: vdev not found", adapter->vdev_id);
+	vdev = hdd_objmgr_get_vdev_by_user(adapter, WLAN_OSIF_CM_ID);
+	if (!vdev)
 		return false;
-	}
 
-	if (wlan_vdev_mlme_get_opmode(vdev) != QDF_STA_MODE &&
-	    wlan_vdev_mlme_get_opmode(vdev) != QDF_P2P_CLIENT_MODE) {
+	opmode = wlan_vdev_mlme_get_opmode(vdev);
+	if (opmode != QDF_STA_MODE && opmode != QDF_P2P_CLIENT_MODE) {
 		hdd_objmgr_put_vdev_by_user(vdev, WLAN_OSIF_CM_ID);
 		return false;
 	}
@@ -74,16 +77,14 @@ bool hdd_cm_is_connecting(struct hdd_adapter *adapter)
 {
 	struct wlan_objmgr_vdev *vdev;
 	bool is_vdev_connecting;
+	enum QDF_OPMODE opmode;
 
 	vdev = hdd_objmgr_get_vdev_by_user(adapter, WLAN_OSIF_CM_ID);
-
-	if (!vdev) {
-		mlme_err("vdev_id: %d: vdev not found", adapter->vdev_id);
+	if (!vdev)
 		return false;
-	}
 
-	if (wlan_vdev_mlme_get_opmode(vdev) != QDF_STA_MODE &&
-	    wlan_vdev_mlme_get_opmode(vdev) != QDF_P2P_CLIENT_MODE) {
+	opmode = wlan_vdev_mlme_get_opmode(vdev);
+	if (opmode != QDF_STA_MODE && opmode != QDF_P2P_CLIENT_MODE) {
 		hdd_objmgr_put_vdev_by_user(vdev, WLAN_OSIF_CM_ID);
 		return false;
 	}
@@ -98,16 +99,14 @@ bool hdd_cm_is_disconnected(struct hdd_adapter *adapter)
 {
 	struct wlan_objmgr_vdev *vdev;
 	bool is_vdev_disconnected;
+	enum QDF_OPMODE opmode;
 
 	vdev = hdd_objmgr_get_vdev_by_user(adapter, WLAN_OSIF_CM_ID);
-
-	if (!vdev) {
-		mlme_err("vdev_id: %d: vdev not found", adapter->vdev_id);
+	if (!vdev)
 		return false;
-	}
 
-	if (wlan_vdev_mlme_get_opmode(vdev) != QDF_STA_MODE &&
-	    wlan_vdev_mlme_get_opmode(vdev) != QDF_P2P_CLIENT_MODE) {
+	opmode = wlan_vdev_mlme_get_opmode(vdev);
+	if (opmode != QDF_STA_MODE && opmode != QDF_P2P_CLIENT_MODE) {
 		hdd_objmgr_put_vdev_by_user(vdev, WLAN_OSIF_CM_ID);
 		return false;
 	}
@@ -122,16 +121,15 @@ bool hdd_cm_is_disconnecting(struct hdd_adapter *adapter)
 {
 	struct wlan_objmgr_vdev *vdev;
 	bool is_vdev_disconnecting;
+	enum QDF_OPMODE opmode;
 
 	vdev = hdd_objmgr_get_vdev_by_user(adapter, WLAN_OSIF_CM_ID);
 
-	if (!vdev) {
-		mlme_err("vdev_id: %d: vdev not found", adapter->vdev_id);
+	if (!vdev)
 		return false;
-	}
 
-	if (wlan_vdev_mlme_get_opmode(vdev) != QDF_STA_MODE &&
-	    wlan_vdev_mlme_get_opmode(vdev) != QDF_P2P_CLIENT_MODE) {
+	opmode = wlan_vdev_mlme_get_opmode(vdev);
+	if (opmode != QDF_STA_MODE && opmode != QDF_P2P_CLIENT_MODE) {
 		hdd_objmgr_put_vdev_by_user(vdev, WLAN_OSIF_CM_ID);
 		return false;
 	}
@@ -147,7 +145,8 @@ bool hdd_cm_is_vdev_associated(struct hdd_adapter *adapter)
 {
 	struct hdd_station_ctx *sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(adapter);
 
-	return (sta_ctx->conn_info.conn_state == eConnectionState_Associated);
+	return (sta_ctx->conn_info.conn_state == eConnectionState_Associated ||
+		sta_ctx->conn_info.conn_state == eConnectionState_NdiConnected);
 }
 
 bool hdd_cm_is_connecting(struct hdd_adapter *adapter)

+ 4 - 1
core/mac/inc/wni_api.h

@@ -251,7 +251,10 @@ enum eWniMsgTypes {
 	eWNI_SME_TWT_RESUME_DIALOG_EVENT = SIR_SME_MSG_TYPES_BEGIN + 168,
 	eWNI_SME_TWT_NUDGE_DIALOG_EVENT = SIR_SME_MSG_TYPES_BEGIN + 169,
 	eWNI_SME_TWT_NOTIFY_EVENT = SIR_SME_MSG_TYPES_BEGIN + 170,
-	eWNI_SME_MSG_TYPES_END = SIR_SME_MSG_TYPES_BEGIN + 171
+	CM_BSS_PEER_CREATE_REQ = SIR_SME_MSG_TYPES_BEGIN + 171,
+	CM_CONNECT_REQ = SIR_SME_MSG_TYPES_BEGIN + 172,
+	CM_DISCONNECT_REQ = SIR_SME_MSG_TYPES_BEGIN + 173,
+	eWNI_SME_MSG_TYPES_END = SIR_SME_MSG_TYPES_BEGIN + 174
 };
 
 typedef struct sAniCfgTxRateCtrs {

+ 7 - 11
core/mac/src/pe/lim/lim_process_fils.c

@@ -1445,17 +1445,16 @@ void lim_update_fils_config(struct mac_context *mac_ctx,
 {
 	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;
-
+	if (!fils_info)
+		return;
 	pe_fils_info = session->fils_info;
 	if (!pe_fils_info)
 		return;
@@ -1504,13 +1503,11 @@ void lim_update_fils_config(struct mac_context *mac_ctx,
 
 	qdf_mem_copy(pe_fils_info->fils_pmkid, fils_info->pmkid,
 		     PMKID_LEN);
-
-/*
-	pe_fils_info->rsn_ie_len = sme_join_req->rsnIE.length;
+	pe_fils_info->rsn_ie_len = session->lim_join_req->rsnIE.length;
 	qdf_mem_copy(pe_fils_info->rsn_ie,
-		     sme_join_req->rsnIE.rsnIEdata,
-		     sme_join_req->rsnIE.length);
-*/
+		     session->lim_join_req->rsnIE.rsnIEdata,
+		     session->lim_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
@@ -1522,7 +1519,6 @@ void lim_update_fils_config(struct mac_context *mac_ctx,
 	 * 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);
@@ -1531,7 +1527,7 @@ void lim_update_fils_config(struct mac_context *mac_ctx,
 			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 =

+ 12 - 1
core/mac/src/pe/lim/lim_process_message_queue.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011-2020 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2011-2021 The Linux Foundation. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -2100,6 +2100,17 @@ static void lim_process_messages(struct mac_context *mac_ctx,
 		break;
 	case SIR_LIM_PROCESS_DEFERRED_QUEUE:
 		break;
+#ifdef FEATURE_CM_ENABLE
+	case CM_BSS_PEER_CREATE_REQ:
+		cm_process_peer_create(msg);
+		break;
+	case CM_CONNECT_REQ:
+		cm_process_join_req(msg);
+		break;
+	case CM_DISCONNECT_REQ:
+		cm_process_disconnect_req(msg);
+		break;
+#endif
 	default:
 		qdf_mem_free((void *)msg->bodyptr);
 		msg->bodyptr = NULL;

+ 359 - 99
core/mac/src/pe/lim/lim_process_sme_req_messages.c

@@ -2132,104 +2132,6 @@ lim_get_intersected_dot11_mode_sta_ap(struct mac_context *mac_ctx,
 	}
 }
 
-#if 0
-/* This is temp will be removed in next gerrit */
-static bool
-lim_is_wap_profile(struct pe_session *session)
-{
-	int32_t ucast_cipher;
-	int32_t auth_mode;
-
-	ucast_cipher = wlan_crypto_get_param(session->vdev,
-					     WLAN_CRYPTO_PARAM_UCAST_CIPHER);
-
-	auth_mode = wlan_crypto_get_param(session->vdev,
-					  WLAN_CRYPTO_PARAM_AUTH_MODE);
-
-	if (auth_mode == -1 || ucast_cipher == -1)
-		return false;
-
-	if (!QDF_HAS_PARAM(auth_mode, WLAN_CRYPTO_AUTH_WPA))
-		return false;
-
-	if (((ucast_cipher & (1 << WLAN_CRYPTO_CIPHER_TKIP)) ||
-	     (ucast_cipher & (1 << WLAN_CRYPTO_CIPHER_WEP)) ||
-	     (ucast_cipher & (1 << WLAN_CRYPTO_CIPHER_WEP_104)) ||
-	     (ucast_cipher & (1 << WLAN_CRYPTO_CIPHER_WEP_40)) ||
-	     (ucast_cipher & (1 << WLAN_CRYPTO_CIPHER_AES_CCM)) ||
-	     (ucast_cipher & (1 << WLAN_CRYPTO_CIPHER_AES_OCB)) ||
-	     (ucast_cipher & (1 << WLAN_CRYPTO_CIPHER_AES_CCM_256))))
-		return true;
-
-	return false;
-}
-
-static bool
-lim_is_wapi_profile(struct pe_session *session)
-{
-	int32_t ucast_cipher;
-	int32_t auth_mode;
-
-	ucast_cipher = wlan_crypto_get_param(session->vdev,
-					     WLAN_CRYPTO_PARAM_UCAST_CIPHER);
-
-	auth_mode = wlan_crypto_get_param(session->vdev,
-					  WLAN_CRYPTO_PARAM_AUTH_MODE);
-
-	if (auth_mode == -1 || ucast_cipher == -1)
-		return false;
-
-	if (!QDF_HAS_PARAM(auth_mode, WLAN_CRYPTO_AUTH_WAPI))
-		return false;
-
-	if (((ucast_cipher & (1 << WLAN_CRYPTO_CIPHER_WAPI_GCM4)) ||
-	     (ucast_cipher & (1 << WLAN_CRYPTO_CIPHER_WAPI_SMS4))))
-		return true;
-
-	return false;
-}
-
-static bool
-lim_is_rsn_profile(struct pe_session *session)
-{
-	int32_t ucast_cipher;
-	int32_t auth_mode;
-	bool is_rsn = false;
-
-	ucast_cipher = wlan_crypto_get_param(session->vdev,
-					     WLAN_CRYPTO_PARAM_UCAST_CIPHER);
-
-	auth_mode = wlan_crypto_get_param(session->vdev,
-					  WLAN_CRYPTO_PARAM_AUTH_MODE);
-
-	if (auth_mode == -1 || ucast_cipher == -1)
-		return false;
-
-	if (QDF_HAS_PARAM(auth_mode, WLAN_CRYPTO_AUTH_8021X) ||
-	    QDF_HAS_PARAM(auth_mode, WLAN_CRYPTO_AUTH_RSNA) ||
-	    QDF_HAS_PARAM(auth_mode, WLAN_CRYPTO_AUTH_CCKM) ||
-	    QDF_HAS_PARAM(auth_mode, WLAN_CRYPTO_AUTH_SAE) ||
-	    QDF_HAS_PARAM(auth_mode, WLAN_CRYPTO_AUTH_FILS_SK))
-		is_rsn = true;
-
-	if (!is_rsn)
-		return false;
-
-	if (((ucast_cipher & (1 << WLAN_CRYPTO_CIPHER_TKIP)) ||
-	     (ucast_cipher & (1 << WLAN_CRYPTO_CIPHER_WEP)) ||
-	     (ucast_cipher & (1 << WLAN_CRYPTO_CIPHER_WEP_104)) ||
-	     (ucast_cipher & (1 << WLAN_CRYPTO_CIPHER_WEP_40)) ||
-	     (ucast_cipher & (1 << WLAN_CRYPTO_CIPHER_AES_CCM)) ||
-	     (ucast_cipher & (1 << WLAN_CRYPTO_CIPHER_AES_OCB)) ||
-	     (ucast_cipher & (1 << WLAN_CRYPTO_CIPHER_AES_CCM_256)) ||
-	     (ucast_cipher & (1 << WLAN_CRYPTO_CIPHER_AES_GCM_256)) ||
-	     (ucast_cipher & (1 << WLAN_CRYPTO_CIPHER_AES_GCM))))
-		return true;
-
-	return false;
-}
-#endif
-
 static void
 lim_verify_dot11_mode_with_crypto(struct pe_session *session)
 {
@@ -2796,6 +2698,348 @@ lim_send_connect_req_to_mlm(struct pe_session *session)
 	return QDF_STATUS_SUCCESS;
 }
 
+static bool
+lim_is_wpa_profile(struct pe_session *session)
+{
+	int32_t ucast_cipher;
+	int32_t auth_mode;
+
+	ucast_cipher = wlan_crypto_get_param(session->vdev,
+					     WLAN_CRYPTO_PARAM_UCAST_CIPHER);
+
+	auth_mode = wlan_crypto_get_param(session->vdev,
+					  WLAN_CRYPTO_PARAM_AUTH_MODE);
+
+	if (auth_mode == -1 || ucast_cipher == -1)
+		return false;
+
+	if (!QDF_HAS_PARAM(auth_mode, WLAN_CRYPTO_AUTH_WPA))
+		return false;
+
+	if (((ucast_cipher & (1 << WLAN_CRYPTO_CIPHER_TKIP)) ||
+	     (ucast_cipher & (1 << WLAN_CRYPTO_CIPHER_WEP)) ||
+	     (ucast_cipher & (1 << WLAN_CRYPTO_CIPHER_WEP_104)) ||
+	     (ucast_cipher & (1 << WLAN_CRYPTO_CIPHER_WEP_40)) ||
+	     (ucast_cipher & (1 << WLAN_CRYPTO_CIPHER_AES_CCM)) ||
+	     (ucast_cipher & (1 << WLAN_CRYPTO_CIPHER_AES_OCB)) ||
+	     (ucast_cipher & (1 << WLAN_CRYPTO_CIPHER_AES_CCM_256))))
+		return true;
+
+	return false;
+}
+
+static bool
+lim_is_wapi_profile(struct pe_session *session)
+{
+	int32_t ucast_cipher;
+	int32_t auth_mode;
+
+	ucast_cipher = wlan_crypto_get_param(session->vdev,
+					     WLAN_CRYPTO_PARAM_UCAST_CIPHER);
+
+	auth_mode = wlan_crypto_get_param(session->vdev,
+					  WLAN_CRYPTO_PARAM_AUTH_MODE);
+
+	if (auth_mode == -1 || ucast_cipher == -1)
+		return false;
+
+	if (!QDF_HAS_PARAM(auth_mode, WLAN_CRYPTO_AUTH_WAPI))
+		return false;
+
+	if (((ucast_cipher & (1 << WLAN_CRYPTO_CIPHER_WAPI_GCM4)) ||
+	     (ucast_cipher & (1 << WLAN_CRYPTO_CIPHER_WAPI_SMS4))))
+		return true;
+
+	return false;
+}
+
+static bool
+lim_is_rsn_profile(struct pe_session *session)
+{
+	int32_t ucast_cipher;
+	int32_t auth_mode;
+	bool is_rsn = false;
+
+	ucast_cipher = wlan_crypto_get_param(session->vdev,
+					     WLAN_CRYPTO_PARAM_UCAST_CIPHER);
+
+	auth_mode = wlan_crypto_get_param(session->vdev,
+					  WLAN_CRYPTO_PARAM_AUTH_MODE);
+
+	if (auth_mode == -1 || ucast_cipher == -1)
+		return false;
+
+	if (QDF_HAS_PARAM(auth_mode, WLAN_CRYPTO_AUTH_8021X) ||
+	    QDF_HAS_PARAM(auth_mode, WLAN_CRYPTO_AUTH_RSNA) ||
+	    QDF_HAS_PARAM(auth_mode, WLAN_CRYPTO_AUTH_CCKM) ||
+	    QDF_HAS_PARAM(auth_mode, WLAN_CRYPTO_AUTH_SAE) ||
+	    QDF_HAS_PARAM(auth_mode, WLAN_CRYPTO_AUTH_FILS_SK))
+		is_rsn = true;
+
+	if (!is_rsn)
+		return false;
+
+	if (((ucast_cipher & (1 << WLAN_CRYPTO_CIPHER_TKIP)) ||
+	     (ucast_cipher & (1 << WLAN_CRYPTO_CIPHER_WEP)) ||
+	     (ucast_cipher & (1 << WLAN_CRYPTO_CIPHER_WEP_104)) ||
+	     (ucast_cipher & (1 << WLAN_CRYPTO_CIPHER_WEP_40)) ||
+	     (ucast_cipher & (1 << WLAN_CRYPTO_CIPHER_AES_CCM)) ||
+	     (ucast_cipher & (1 << WLAN_CRYPTO_CIPHER_AES_OCB)) ||
+	     (ucast_cipher & (1 << WLAN_CRYPTO_CIPHER_AES_CCM_256)) ||
+	     (ucast_cipher & (1 << WLAN_CRYPTO_CIPHER_AES_GCM_256)) ||
+	     (ucast_cipher & (1 << WLAN_CRYPTO_CIPHER_AES_GCM))))
+		return true;
+
+	return false;
+}
+
+static tAniEdType
+lim_get_encrypt_ed_type(struct pe_session *session)
+{
+	int32_t ucast_cipher;
+
+	ucast_cipher = wlan_crypto_get_param(session->vdev,
+					     WLAN_CRYPTO_PARAM_UCAST_CIPHER);
+
+	if (ucast_cipher == -1)
+		return eSIR_ED_NONE;
+
+	if (QDF_HAS_PARAM(ucast_cipher, WLAN_CRYPTO_CIPHER_AES_GCM_256))
+		return eSIR_ED_GCMP_256;
+	else if (QDF_HAS_PARAM(ucast_cipher, WLAN_CRYPTO_CIPHER_AES_GCM))
+		return eSIR_ED_GCMP;
+	else if (QDF_HAS_PARAM(ucast_cipher, WLAN_CRYPTO_CIPHER_AES_CCM) ||
+		 QDF_HAS_PARAM(ucast_cipher, WLAN_CRYPTO_CIPHER_AES_OCB) ||
+		 QDF_HAS_PARAM(ucast_cipher, WLAN_CRYPTO_CIPHER_AES_CCM_256))
+		return eSIR_ED_CCMP;
+	else if (QDF_HAS_PARAM(ucast_cipher, WLAN_CRYPTO_CIPHER_TKIP))
+		return eSIR_ED_TKIP;
+	else if (QDF_HAS_PARAM(ucast_cipher, WLAN_CRYPTO_CIPHER_AES_CMAC) ||
+		 QDF_HAS_PARAM(ucast_cipher, WLAN_CRYPTO_CIPHER_AES_CMAC_256))
+		return eSIR_ED_AES_128_CMAC;
+	else if (QDF_HAS_PARAM(ucast_cipher, WLAN_CRYPTO_CIPHER_WAPI_GCM4) ||
+		 QDF_HAS_PARAM(ucast_cipher, WLAN_CRYPTO_CIPHER_WAPI_SMS4))
+		return eSIR_ED_WPI;
+	else if (QDF_HAS_PARAM(ucast_cipher, WLAN_CRYPTO_CIPHER_AES_GMAC))
+		return eSIR_ED_AES_GMAC_128;
+	else if (QDF_HAS_PARAM(ucast_cipher, WLAN_CRYPTO_CIPHER_AES_GMAC_256))
+		return eSIR_ED_AES_GMAC_256;
+	else if (QDF_HAS_PARAM(ucast_cipher, WLAN_CRYPTO_CIPHER_WEP))
+		return eSIR_ED_WEP40;
+	else if (QDF_HAS_PARAM(ucast_cipher, WLAN_CRYPTO_CIPHER_WEP_40))
+		return eSIR_ED_WEP40;
+	else if (QDF_HAS_PARAM(ucast_cipher, WLAN_CRYPTO_CIPHER_WEP_104))
+		return eSIR_ED_WEP104;
+
+	return eSIR_ED_NONE;
+}
+
+static enum ani_akm_type
+lim_get_wpa_akm(uint32_t akm)
+{
+	if (QDF_HAS_PARAM(akm, WLAN_CRYPTO_KEY_MGMT_IEEE8021X))
+		return ANI_AKM_TYPE_WPA;
+	else if (QDF_HAS_PARAM(akm, WLAN_CRYPTO_KEY_MGMT_PSK))
+		return ANI_AKM_TYPE_WPA_PSK;
+	else if (QDF_HAS_PARAM(akm, WLAN_CRYPTO_KEY_MGMT_CCKM))
+		return ANI_AKM_TYPE_CCKM;
+	else
+		return ANI_AKM_TYPE_UNKNOWN;
+}
+
+static enum ani_akm_type
+lim_get_rsn_akm(uint32_t akm)
+{
+	if (QDF_HAS_PARAM(akm, WLAN_CRYPTO_KEY_MGMT_FT_FILS_SHA384))
+		return ANI_AKM_TYPE_FT_FILS_SHA384;
+	else if (QDF_HAS_PARAM(akm, WLAN_CRYPTO_KEY_MGMT_FT_FILS_SHA256))
+		return ANI_AKM_TYPE_FT_FILS_SHA256;
+	else if (QDF_HAS_PARAM(akm, WLAN_CRYPTO_KEY_MGMT_FILS_SHA384))
+		return ANI_AKM_TYPE_FILS_SHA384;
+	else if (QDF_HAS_PARAM(akm, WLAN_CRYPTO_KEY_MGMT_FILS_SHA256))
+		return ANI_AKM_TYPE_FILS_SHA256;
+	else if (QDF_HAS_PARAM(akm, WLAN_CRYPTO_KEY_MGMT_FT_SAE))
+		return ANI_AKM_TYPE_FT_SAE;
+	else if (QDF_HAS_PARAM(akm, WLAN_CRYPTO_KEY_MGMT_SAE))
+		return ANI_AKM_TYPE_SAE;
+	else if (QDF_HAS_PARAM(akm, WLAN_CRYPTO_KEY_MGMT_DPP))
+		return ANI_AKM_TYPE_DPP_RSN;
+	else if (QDF_HAS_PARAM(akm, WLAN_CRYPTO_KEY_MGMT_OSEN))
+		return ANI_AKM_TYPE_OSEN;
+	else if (QDF_HAS_PARAM(akm, WLAN_CRYPTO_KEY_MGMT_OWE))
+		return ANI_AKM_TYPE_OWE;
+	else if (QDF_HAS_PARAM(akm, WLAN_CRYPTO_KEY_MGMT_FT_IEEE8021X))
+		return ANI_AKM_TYPE_FT_RSN;
+	else if (QDF_HAS_PARAM(akm, WLAN_CRYPTO_KEY_MGMT_FT_PSK))
+		return ANI_AKM_TYPE_FT_RSN_PSK;
+	else if (QDF_HAS_PARAM(akm, WLAN_CRYPTO_KEY_MGMT_IEEE8021X))
+		return ANI_AKM_TYPE_RSN;
+	else if (QDF_HAS_PARAM(akm, WLAN_CRYPTO_KEY_MGMT_PSK))
+		return ANI_AKM_TYPE_RSN_PSK;
+	else if (QDF_HAS_PARAM(akm, WLAN_CRYPTO_KEY_MGMT_CCKM))
+		return ANI_AKM_TYPE_CCKM;
+	else if (QDF_HAS_PARAM(akm, WLAN_CRYPTO_KEY_MGMT_PSK_SHA256))
+		return ANI_AKM_TYPE_RSN_PSK_SHA256;
+	else if (QDF_HAS_PARAM(akm, WLAN_CRYPTO_KEY_MGMT_IEEE8021X_SHA256))
+		return ANI_AKM_TYPE_RSN_8021X_SHA256;
+	else if (QDF_HAS_PARAM(akm, WLAN_CRYPTO_KEY_MGMT_IEEE8021X_SUITE_B))
+		return ANI_AKM_TYPE_SUITEB_EAP_SHA256;
+	else if (QDF_HAS_PARAM(akm, WLAN_CRYPTO_KEY_MGMT_IEEE8021X_SUITE_B_192))
+		return ANI_AKM_TYPE_SUITEB_EAP_SHA384;
+	else if (QDF_HAS_PARAM(akm, WLAN_CRYPTO_KEY_MGMT_FT_IEEE8021X_SHA384))
+		return ANI_AKM_TYPE_FT_SUITEB_EAP_SHA384;
+	else
+		return ANI_AKM_TYPE_NONE;
+}
+
+static enum ani_akm_type
+lim_get_connected_akm(struct pe_session *session,
+		      struct scan_cache_entry *entry)
+{
+	int32_t ucast_cipher;
+	int32_t auth_mode;
+
+	ucast_cipher = wlan_crypto_get_param(session->vdev,
+					     WLAN_CRYPTO_PARAM_UCAST_CIPHER);
+
+	auth_mode = wlan_crypto_get_param(session->vdev,
+					  WLAN_CRYPTO_PARAM_AUTH_MODE);
+
+	if (auth_mode == -1 || ucast_cipher == -1)
+		return ANI_AKM_TYPE_NONE;
+
+	if (QDF_HAS_PARAM(auth_mode, WLAN_CRYPTO_AUTH_NONE) ||
+	    QDF_HAS_PARAM(auth_mode, WLAN_CRYPTO_AUTH_OPEN))
+		return ANI_AKM_TYPE_NONE;
+
+	if (lim_is_rsn_profile(session))
+		return lim_get_rsn_akm(entry->neg_sec_info.key_mgmt);
+
+	if (lim_is_wpa_profile(session))
+		return lim_get_wpa_akm(entry->neg_sec_info.key_mgmt);
+
+	if (lim_is_wapi_profile(session))
+		return ANI_AKM_TYPE_UNKNOWN;
+
+	return ANI_AKM_TYPE_NONE;
+}
+
+#ifdef WLAN_FEATURE_FILS_SK
+/**
+ * lim_update_pmksa_to_profile() - update pmk and pmkid to profile which will be
+ * used in case of fils session
+ * @vdev: vdev
+ * @pmkid_cache: pmksa cache
+ *
+ * Return: None
+ */
+static inline void lim_update_pmksa_to_profile(struct wlan_objmgr_vdev *vdev,
+					       struct wlan_crypto_pmksa *pmksa)
+{
+	struct mlme_legacy_priv *mlme_priv;
+
+	mlme_priv = wlan_vdev_mlme_get_ext_hdl(vdev);
+	if (!mlme_priv) {
+		pe_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(mlme_priv->fils_con_info->pmkid,
+		     pmksa->pmkid, PMKID_LEN);
+}
+#else
+static inline void lim_update_pmksa_to_profile(struct wlan_objmgr_vdev *vdev,
+					       struct wlan_crypto_pmksa *pmksa)
+{
+}
+#endif
+
+static QDF_STATUS
+lim_fill_rsn_ie(struct mac_context *mac_ctx, struct pe_session *session,
+		struct cm_vdev_join_req *req)
+{
+	QDF_STATUS status;
+	uint8_t *rsn_ie;
+	uint8_t rsn_ie_len = 0;
+	uint8_t *rsn_ie_end = NULL;
+	struct wlan_crypto_pmksa pmksa, *pmksa_peer;
+	struct bss_description *bss_desc;
+
+	if (!lim_is_rsn_profile(session))
+		return QDF_STATUS_SUCCESS;
+
+	rsn_ie = qdf_mem_malloc(DOT11F_IE_RSN_MAX_LEN + 2);
+	if (!rsn_ie)
+		return QDF_STATUS_E_NOMEM;
+
+	status = lim_strip_ie(mac_ctx, req->assoc_ie.ptr,
+			      (uint16_t *)&req->assoc_ie.len,
+			      WLAN_ELEMID_RSN, ONE_BYTE,
+			      NULL, 0, rsn_ie, DOT11F_IE_RSN_MAX_LEN);
+
+	if (session->lim_join_req->force_rsne_override &&
+	    QDF_IS_STATUS_SUCCESS(status)) {
+		rsn_ie_len = rsn_ie[1];
+		if (rsn_ie_len < DOT11F_IE_RSN_MIN_LEN ||
+		    rsn_ie_len > DOT11F_IE_RSN_MAX_LEN) {
+			pe_err("RSN length %d not within limits", rsn_ie_len);
+			qdf_mem_free(rsn_ie);
+			return QDF_STATUS_E_FAILURE;
+		}
+
+		session->lim_join_req->rsnIE.length = rsn_ie_len;
+		qdf_mem_copy(session->lim_join_req->rsnIE.rsnIEdata,
+			     rsn_ie, rsn_ie_len + 2);
+
+		qdf_mem_free(rsn_ie);
+		return QDF_STATUS_SUCCESS;
+	}
+
+	bss_desc = &session->lim_join_req->bssDescription;
+
+	qdf_mem_zero(&pmksa, sizeof(pmksa));
+	if (bss_desc->fils_info_element.is_cache_id_present) {
+		pmksa.ssid_len = session->ssId.length;
+		qdf_mem_copy(pmksa.ssid, session->ssId.ssId,
+			     session->ssId.length);
+		qdf_mem_copy(pmksa.cache_id,
+			     bss_desc->fils_info_element.cache_id,
+			     CACHE_ID_LEN);
+		qdf_mem_copy(&pmksa.bssid, session->bssId, QDF_MAC_ADDR_SIZE);
+	} else {
+		qdf_mem_copy(&pmksa.bssid, session->bssId, QDF_MAC_ADDR_SIZE);
+	}
+	pmksa_peer = wlan_crypto_get_peer_pmksa(session->vdev, &pmksa);
+
+	/* TODO: Add support for Adaptive 11r connection */
+	rsn_ie_end = wlan_crypto_build_rsnie_with_pmksa(session->vdev, rsn_ie,
+							pmksa_peer);
+	if (rsn_ie_end)
+		rsn_ie_len = rsn_ie_end - rsn_ie;
+
+	session->lim_join_req->rsnIE.length = rsn_ie_len;
+	qdf_mem_copy(session->lim_join_req->rsnIE.rsnIEdata,
+		     rsn_ie, rsn_ie_len);
+
+	qdf_mem_free(rsn_ie);
+	/*
+	 * If a PMK cache is found for the BSSID, then
+	 * update the PMK in CSR session also as this
+	 * will be sent to the FW during RSO.
+	 */
+	if (pmksa_peer) {
+		wlan_cm_set_psk_pmk(mac_ctx->pdev, session->vdev_id,
+				    pmksa_peer->pmk, pmksa_peer->pmk_len);
+		lim_update_pmksa_to_profile(session->vdev, pmksa_peer);
+	}
+
+	return QDF_STATUS_SUCCESS;
+}
+
 static QDF_STATUS
 lim_fill_session_params(struct mac_context *mac_ctx,
 			struct pe_session *session,
@@ -2820,6 +3064,10 @@ lim_fill_session_params(struct mac_context *mac_ctx,
 
 	pe_join_req = session->lim_join_req;
 	bss_desc = &session->lim_join_req->bssDescription;
+	pe_debug("Beacon/probe frame received:");
+	QDF_TRACE_HEX_DUMP(QDF_MODULE_ID_PE, QDF_TRACE_LEVEL_DEBUG,
+			   util_scan_entry_frame_ptr(req->entry),
+			   util_scan_entry_frame_len(req->entry));
 
 	status = wlan_fill_bss_desc_from_scan_entry(mac_ctx, bss_desc,
 						    req->entry);
@@ -2864,10 +3112,22 @@ 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);
 
+	session->encryptType = lim_get_encrypt_ed_type(session);
+	session->connected_akm = lim_get_connected_akm(session, req->entry);
+	pe_debug("Assoc IE len: %d", req->assoc_ie.len);
+	if (req->assoc_ie.len)
+		QDF_TRACE_HEX_DUMP(QDF_MODULE_ID_PE, QDF_TRACE_LEVEL_DEBUG,
+				   req->assoc_ie.ptr, req->assoc_ie.len);
+
+	lim_fill_rsn_ie(mac_ctx, session, req);
+	lim_update_fils_config(mac_ctx, session, req);
 	qdf_mem_copy(pe_join_req->addIEAssoc.addIEdata,
 		     req->assoc_ie.ptr, req->assoc_ie.len);
+	pe_debug("After stripping Assoc IE len: %d", req->assoc_ie.len);
+	if (req->assoc_ie.len)
+		QDF_TRACE_HEX_DUMP(QDF_MODULE_ID_PE, QDF_TRACE_LEVEL_DEBUG,
+				   req->assoc_ie.ptr, req->assoc_ie.len);
 
 	qdf_mem_copy(pe_join_req->addIEScan.addIEdata,
 		     req->scan_ie.ptr, req->scan_ie.len);

+ 3 - 1
core/mac/src/pe/lim/lim_prop_exts_utils.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011-2020 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2011-2021 The Linux Foundation. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -396,9 +396,11 @@ void lim_extract_ap_capability(struct mac_context *mac_ctx, uint8_t *p_ie,
 
 	*qos_cap = 0;
 	*uapsd = 0;
+#ifndef FEATURE_CM_ENABLE
 	pe_debug("The IE's being received:");
 	QDF_TRACE_HEX_DUMP(QDF_MODULE_ID_PE, QDF_TRACE_LEVEL_DEBUG,
 			   p_ie, ie_len);
+#endif
 	if (sir_parse_beacon_ie(mac_ctx, beacon_struct, p_ie,
 		(uint32_t) ie_len) != QDF_STATUS_SUCCESS) {
 		pe_err("sir_parse_beacon_ie failed to parse beacon");

+ 6 - 1
core/mac/src/pe/lim/lim_send_management_frames.c

@@ -2137,7 +2137,12 @@ lim_send_assoc_req_mgmt_frame(struct mac_context *mac_ctx,
 	swap_bit_field16(caps, (uint16_t *) &frm->Capabilities);
 
 	frm->ListenInterval.interval = mlm_assoc_req->listenInterval;
-	populate_dot11f_ssid2(mac_ctx, &frm->SSID);
+
+	qdf_mem_copy(frm->SSID.ssid, pe_session->ssId.ssId,
+		     pe_session->ssId.length);
+	frm->SSID.present = 1;
+	frm->SSID.num_ssid = pe_session->ssId.length;
+
 	populate_dot11f_supp_rates(mac_ctx, POPULATE_DOT11F_RATES_OPERATIONAL,
 		&frm->SuppRates, pe_session);
 

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

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011-2020 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2011-2021 The Linux Foundation. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -248,6 +248,7 @@ uint8_t csr_construct_wpa_ie(struct mac_context *mac, uint8_t session_id,
 #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
@@ -257,7 +258,6 @@ uint8_t csr_retrieve_wpa_ie(struct mac_context *mac, uint8_t session_id,
 			    struct csr_roam_profile *pProfile,
 			    struct bss_description *pSirBssDesc,
 			    tDot11fBeaconIEs *pIes, tCsrWpaIe *pWpaIe);
-
 bool csr_is_ssid_equal(struct mac_context *mac,
 		       struct bss_description *pSirBssDesc1,
 		       struct bss_description *pSirBssDesc2,
@@ -287,6 +287,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
 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(

+ 4 - 1
core/sme/src/csr/csr_api_roam.c

@@ -7925,8 +7925,9 @@ csr_roam_reassoc(struct mac_context *mac_ctx, uint32_t session_id,
 	QDF_STATUS status = QDF_STATUS_SUCCESS;
 	bool fCallCallback = true;
 	uint32_t roamId = 0;
+#ifndef FEATURE_CM_ENABLE
 	struct csr_roam_session *session = CSR_GET_SESSION(mac_ctx, session_id);
-
+#endif
 	if (!profile) {
 		sme_err("No profile specified");
 		return QDF_STATUS_E_FAILURE;
@@ -7940,6 +7941,7 @@ csr_roam_reassoc(struct mac_context *mac_ctx, uint32_t session_id,
 	csr_scan_abort_mac_scan(mac_ctx, session_id, INVAL_SCAN_ID);
 	csr_roam_remove_duplicate_command(mac_ctx, session_id, NULL,
 					  eCsrHddIssuedReassocToSameAP);
+#ifndef FEATURE_CM_ENABLE
 	if (csr_is_conn_state_connected(mac_ctx, session_id)) {
 		if (profile) {
 			if (profile->SSIDs.numOfSSIDs &&
@@ -7969,6 +7971,7 @@ csr_roam_reassoc(struct mac_context *mac_ctx, uint32_t session_id,
 	} else {
 		sme_debug("Not connected! No need to reassoc");
 	}
+#endif
 	if (!fCallCallback) {
 		roamId = GET_NEXT_ROAM_ID(&mac_ctx->roam);
 		if (roam_id)

+ 8 - 4
core/sme/src/csr/csr_util.c

@@ -1206,6 +1206,7 @@ bool csr_is_wmm_supported(struct mac_context *mac)
 		return true;
 }
 
+#ifndef FEATURE_CM_ENABLE
 /* pIes is the IEs for pSirBssDesc2 */
 bool csr_is_ssid_equal(struct mac_context *mac,
 		       struct bss_description *pSirBssDesc1,
@@ -1253,7 +1254,7 @@ bool csr_is_ssid_equal(struct mac_context *mac,
 
 	return fEqual;
 }
-
+#endif
 /* pIes can be passed in as NULL if the caller doesn't have one prepared */
 static bool csr_is_bss_description_wme(struct mac_context *mac,
 				       struct bss_description *pSirBssDesc,
@@ -2017,6 +2018,7 @@ uint32_t csr_get11h_power_constraint(struct mac_context *mac_ctx,
 	return localPowerConstraint;
 }
 
+#ifndef FEATURE_CM_ENABLE
 bool csr_is_profile_wpa(struct csr_roam_profile *pProfile)
 {
 	bool fWpaProfile = false;
@@ -2116,7 +2118,7 @@ bool csr_is_profile_rsn(struct csr_roam_profile *pProfile)
 	}
 	return fRSNProfile;
 }
-
+#endif
 /**
  * csr_update_mcc_p2p_beacon_interval() - update p2p beacon interval
  * @mac_ctx: pointer to mac context
@@ -2681,7 +2683,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
@@ -2979,6 +2981,7 @@ uint8_t csr_retrieve_wapi_ie(struct mac_context *mac, uint32_t sessionId,
 	return cbWapiIe;
 }
 #endif /* FEATURE_WLAN_WAPI */
+#endif
 
 bool csr_rates_is_dot11_rate11b_supported_rate(uint8_t dot11Rate)
 {
@@ -3124,6 +3127,7 @@ bool csr_is_ssid_match(struct mac_context *mac, uint8_t *ssid1, uint8_t ssid1Len
 	return fMatch;
 }
 
+#ifndef FEATURE_CM_ENABLE
 /* Null ssid means match */
 bool csr_is_ssid_in_list(tSirMacSSid *pSsid, tCsrSSIDs *pSsidList)
 {
@@ -3149,7 +3153,7 @@ bool csr_is_ssid_in_list(tSirMacSSid *pSsid, tCsrSSIDs *pSsidList)
 
 	return fMatch;
 }
-
+#endif
 bool csr_is_bssid_match(struct qdf_mac_addr *pProfBssid,
 			struct qdf_mac_addr *BssBssid)
 {