Преглед изворни кода

qcacld-3.0: Refactor the roaming code

Refactor the roaming code by moving to component.

Change-Id: I566967482ec3eb0d15d3ff357855b58b9579d3cf
CRs-Fixed: 2887126
gaurank kathpalia пре 4 година
родитељ
комит
758f6c8bc3
29 измењених фајлова са 551 додато и 765 уклоњено
  1. 20 0
      components/mlme/core/inc/wlan_mlme_main.h
  2. 2 2
      components/target_if/pmo/src/target_if_pmo_suspend_resume.c
  3. 170 1
      components/umac/mlme/connection_mgr/core/src/wlan_cm_roam_offload.c
  4. 59 0
      components/umac/mlme/connection_mgr/core/src/wlan_cm_roam_offload.h
  5. 9 26
      components/umac/mlme/connection_mgr/core/src/wlan_cm_vdev_api.h
  6. 67 1
      components/umac/mlme/connection_mgr/core/src/wlan_cm_vdev_connect.c
  7. 11 1
      components/umac/mlme/connection_mgr/core/src/wlan_cm_vdev_disconnect.c
  8. 1 14
      components/umac/mlme/connection_mgr/dispatcher/inc/wlan_cm_roam_api.h
  9. 5 0
      components/umac/mlme/connection_mgr/dispatcher/inc/wlan_cm_roam_public_struct.h
  10. 2 0
      components/umac/mlme/connection_mgr/dispatcher/inc/wlan_cm_roam_ucfg_api.h
  11. 27 0
      components/umac/mlme/connection_mgr/dispatcher/src/wlan_cm_roam_ucfg_api.c
  12. 2 2
      core/hdd/src/wlan_hdd_ioctl.c
  13. 0 11
      core/mac/inc/ani_system_defs.h
  14. 0 8
      core/mac/inc/sir_api.h
  15. 1 1
      core/mac/src/include/parser_api.h
  16. 0 9
      core/mac/src/include/sir_params.h
  17. 7 2
      core/mac/src/pe/lim/lim_send_frames_host_roam.c
  18. 16 11
      core/mac/src/sys/legacy/src/utils/src/parser_api.c
  19. 0 5
      core/sme/inc/csr_api.h
  20. 2 2
      core/sme/inc/csr_internal.h
  21. 1 5
      core/sme/inc/csr_neighbor_roam.h
  22. 0 4
      core/sme/inc/csr_support.h
  23. 0 3
      core/sme/inc/sme_api.h
  24. 0 26
      core/sme/src/common/sme_api.c
  25. 136 470
      core/sme/src/csr/csr_api_roam.c
  26. 5 2
      core/sme/src/csr/csr_api_scan.c
  27. 2 34
      core/sme/src/csr/csr_inside_api.h
  28. 1 52
      core/sme/src/csr/csr_neighbor_roam.c
  29. 5 73
      core/sme/src/csr/csr_util.c

+ 20 - 0
components/mlme/core/inc/wlan_mlme_main.h

@@ -33,6 +33,20 @@
 
 #define MAC_MAX_ADD_IE_LENGTH       2048
 
+/*
+ * Following time is used to program WOW_TIMER_PATTERN to FW so that FW will
+ * wake host up to do graceful disconnect in case PEER remains un-authorized
+ * for this long.
+ */
+#define INSTALL_KEY_TIMEOUT_SEC      70
+#define INSTALL_KEY_TIMEOUT_MS       \
+			(INSTALL_KEY_TIMEOUT_SEC * SYSTEM_TIME_SEC_TO_MSEC)
+/* 70 seconds, for WPA, WPA2, CCKM */
+#define WAIT_FOR_KEY_TIMEOUT_PERIOD     \
+	(INSTALL_KEY_TIMEOUT_SEC * QDF_MC_TIMER_TO_SEC_UNIT)
+/* 120 seconds, for WPS */
+#define WAIT_FOR_WPS_KEY_TIMEOUT_PERIOD (120 * QDF_MC_TIMER_TO_SEC_UNIT)
+
 /* QCN IE definitions */
 #define QCN_IE_HDR_LEN     6
 
@@ -264,6 +278,8 @@ struct ft_context {
  * @hlp_ie: hldp ie
  * @hlp_ie_len: hlp ie length
  * @fils_con_info: Pointer to fils connection info from connect req
+ * @cckm_ie: cck IE
+ * @cckm_ie_len: cckm_ie len
  */
 struct mlme_connect_info {
 	uint8_t timing_meas_cap;
@@ -280,6 +296,10 @@ struct mlme_connect_info {
 	uint32_t hlp_ie_len;
 	struct wlan_fils_connection_info *fils_con_info;
 #endif
+#ifdef FEATURE_WLAN_ESE
+	uint8_t cckm_ie[DOT11F_IE_RSN_MAX_LEN];
+	uint8_t cckm_ie_len;
+#endif
 };
 
 /** struct wait_for_key_timer - wait for key timer object

+ 2 - 2
components/target_if/pmo/src/target_if_pmo_suspend_resume.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017-2020 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2017-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
@@ -241,7 +241,7 @@ QDF_STATUS target_if_pmo_psoc_send_wow_enable_req(
 		return QDF_STATUS_E_INVAL;
 	}
 
-	wma_check_and_set_wake_timer(SIR_INSTALL_KEY_TIMEOUT_MS);
+	wma_check_and_set_wake_timer(INSTALL_KEY_TIMEOUT_MS);
 	return wmi_unified_wow_enable_send(wmi_handle,
 					   (struct wow_cmd_params *)param,
 					   TGT_WILDCARD_PDEV_ID);

+ 170 - 1
components/umac/mlme/connection_mgr/core/src/wlan_cm_roam_offload.c

@@ -3879,6 +3879,86 @@ out:
 	return status;
 }
 
+void cm_update_pmk_cache_ft(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id)
+{
+	QDF_STATUS status = QDF_STATUS_E_INVAL;
+	struct wlan_objmgr_vdev *vdev;
+	struct wlan_crypto_pmksa pmksa;
+	enum QDF_OPMODE vdev_mode;
+	struct cm_roam_values_copy src_cfg;
+
+	vdev = wlan_objmgr_get_vdev_by_id_from_psoc(psoc, vdev_id,
+						    WLAN_MLME_CM_ID);
+	if (!vdev) {
+		mlme_err("vdev is NULL");
+		return;
+	}
+
+	vdev_mode = wlan_vdev_mlme_get_opmode(vdev);
+	/* If vdev mode is STA then proceed further */
+	if (vdev_mode != QDF_STA_MODE) {
+		mlme_err("vdev mode is not STA");
+		wlan_objmgr_vdev_release_ref(vdev, WLAN_MLME_CM_ID);
+		return;
+	}
+
+	/*
+	 * In FT connection fetch the MDID from Session and send it to crypto
+	 * so that it will update the crypto PMKSA table with the MDID for the
+	 * matching BSSID or SSID PMKSA entry. And delete the old/stale PMK
+	 * cache entries for the same mobility domain as of the newly added
+	 * entry to avoid multiple PMK cache entries for the same MDID.
+	 */
+	wlan_vdev_get_bss_peer_mac(vdev, &pmksa.bssid);
+	wlan_vdev_mlme_get_ssid(vdev, pmksa.ssid, &pmksa.ssid_len);
+	wlan_cm_roam_cfg_get_value(psoc, vdev_id,
+				   MOBILITY_DOMAIN, &src_cfg);
+	mlme_debug("copied the BSSID/SSID from session to PMKSA mdie %d",
+		  src_cfg.bool_value);
+	if (src_cfg.bool_value) {
+		pmksa.mdid.mdie_present = 1;
+		pmksa.mdid.mobility_domain = src_cfg.uint_value;
+		mlme_debug("copied the MDID from session to PMKSA");
+
+		status = wlan_crypto_update_pmk_cache_ft(vdev, &pmksa);
+		if (status == QDF_STATUS_SUCCESS)
+			mlme_debug("Updated the crypto cache table");
+	}
+
+	wlan_objmgr_vdev_release_ref(vdev, WLAN_MLME_CM_ID);
+}
+
+bool cm_lookup_pmkid_using_bssid(struct wlan_objmgr_psoc *psoc,
+				 uint8_t vdev_id,
+				 struct wlan_crypto_pmksa *pmk_cache)
+{
+	struct wlan_crypto_pmksa *pmksa;
+	struct wlan_objmgr_vdev *vdev;
+
+	vdev = wlan_objmgr_get_vdev_by_id_from_psoc(psoc, vdev_id,
+						    WLAN_MLME_CM_ID);
+	if (!vdev) {
+		mlme_err("Invalid vdev");
+		return false;
+	}
+
+	pmksa = wlan_crypto_get_pmksa(vdev, &pmk_cache->bssid);
+	if (!pmksa) {
+		wlan_objmgr_vdev_release_ref(vdev, WLAN_MLME_CM_ID);
+		return false;
+	}
+	qdf_mem_copy(pmk_cache->pmkid, pmksa->pmkid, sizeof(pmk_cache->pmkid));
+	qdf_mem_copy(pmk_cache->pmk, pmksa->pmk, pmksa->pmk_len);
+	pmk_cache->pmk_len = pmksa->pmk_len;
+	pmk_cache->pmk_lifetime = pmksa->pmk_lifetime;
+	pmk_cache->pmk_lifetime_threshold = pmksa->pmk_lifetime_threshold;
+	pmk_cache->pmk_entry_ts = pmksa->pmk_entry_ts;
+
+	wlan_objmgr_vdev_release_ref(vdev, WLAN_MLME_CM_ID);
+
+	return true;
+}
+
 void cm_roam_restore_default_config(struct wlan_objmgr_pdev *pdev,
 				    uint8_t vdev_id)
 {
@@ -3955,6 +4035,95 @@ cm_store_sae_single_pmk_to_global_cache(struct wlan_objmgr_psoc *psoc,
 	qdf_mem_zero(pmk_info, sizeof(*pmk_info));
 	qdf_mem_free(pmk_info);
 }
+
+void cm_check_and_set_sae_single_pmk_cap(struct wlan_objmgr_psoc *psoc,
+					 uint8_t vdev_id)
+{
+	struct wlan_objmgr_vdev *vdev;
+	struct mlme_pmk_info *pmk_info;
+	struct wlan_crypto_pmksa *pmkid_cache;
+	int32_t keymgmt;
+	bool lookup_success;
+	QDF_STATUS status;
+	struct qdf_mac_addr bssid = QDF_MAC_ADDR_ZERO_INIT;
+
+	vdev = wlan_objmgr_get_vdev_by_id_from_psoc(psoc, vdev_id,
+						    WLAN_MLME_CM_ID);
+	if (!vdev) {
+		mlme_err("get vdev failed");
+		return;
+	}
+	status = wlan_vdev_get_bss_peer_mac(vdev, &bssid);
+	if (QDF_IS_STATUS_ERROR(status)) {
+		mlme_err("Failed to find connected bssid");
+		wlan_objmgr_vdev_release_ref(vdev, WLAN_MLME_CM_ID);
+		return;
+	}
+	keymgmt = wlan_crypto_get_param(vdev, WLAN_CRYPTO_PARAM_KEY_MGMT);
+	if (keymgmt < 0) {
+		mlme_err("Invalid mgmt cipher");
+		wlan_objmgr_vdev_release_ref(vdev, WLAN_MLME_CM_ID);
+		return;
+	}
+
+	if (keymgmt & (1 << WLAN_CRYPTO_KEY_MGMT_SAE)) {
+		struct cm_roam_values_copy src_cfg;
+
+		wlan_cm_roam_cfg_get_value(psoc, vdev_id, IS_SINGLE_PMK,
+					   &src_cfg);
+		wlan_mlme_set_sae_single_pmk_bss_cap(psoc, vdev_id,
+						     src_cfg.bool_value);
+		if (!src_cfg.bool_value)
+			goto end;
+
+		wlan_crypto_set_sae_single_pmk_bss_cap(vdev, &bssid, true);
+
+		pmkid_cache = qdf_mem_malloc(sizeof(*pmkid_cache));
+		if (!pmkid_cache)
+			goto end;
+
+		qdf_copy_macaddr(&pmkid_cache->bssid, &bssid);
+		/*
+		 * In SAE single pmk roaming case, there will
+		 * be no PMK entry found for the AP in pmk cache.
+		 * So if the lookup is successful, then we have done
+		 * a FULL sae here. In that case, clear all other
+		 * single pmk entries.
+		 */
+		lookup_success =
+			cm_lookup_pmkid_using_bssid(psoc, vdev_id, pmkid_cache);
+		if (lookup_success) {
+			wlan_crypto_selective_clear_sae_single_pmk_entries(vdev,
+					&bssid);
+
+			pmk_info = qdf_mem_malloc(sizeof(*pmk_info));
+			if (!pmk_info) {
+				qdf_mem_zero(pmkid_cache, sizeof(*pmkid_cache));
+				qdf_mem_free(pmkid_cache);
+				goto end;
+			}
+
+			qdf_mem_copy(pmk_info->pmk, pmkid_cache->pmk,
+				     pmkid_cache->pmk_len);
+			pmk_info->pmk_len = pmkid_cache->pmk_len;
+			pmk_info->spmk_timestamp = pmkid_cache->pmk_entry_ts;
+			pmk_info->spmk_timeout_period  =
+				(pmkid_cache->pmk_lifetime *
+				 pmkid_cache->pmk_lifetime_threshold / 100);
+
+			wlan_mlme_update_sae_single_pmk(vdev, pmk_info);
+
+			qdf_mem_zero(pmk_info, sizeof(*pmk_info));
+			qdf_mem_free(pmk_info);
+		}
+
+		qdf_mem_zero(pmkid_cache, sizeof(*pmkid_cache));
+		qdf_mem_free(pmkid_cache);
+	}
+
+end:
+	wlan_objmgr_vdev_release_ref(vdev, WLAN_MLME_CM_ID);
+}
 #endif
 
 bool cm_is_auth_type_11r(struct wlan_mlme_psoc_ext_obj *mlme_obj,
@@ -3986,7 +4155,6 @@ bool cm_is_auth_type_11r(struct wlan_mlme_psoc_ext_obj *mlme_obj,
 	return false;
 }
 
-#ifdef FEATURE_CM_ENABLE
 static void cm_roam_start_init(struct wlan_objmgr_psoc *psoc,
 			       struct wlan_objmgr_pdev *pdev,
 			       struct wlan_objmgr_vdev *vdev)
@@ -4068,6 +4236,7 @@ void cm_roam_start_init_on_connect(struct wlan_objmgr_pdev *pdev,
 	wlan_objmgr_vdev_release_ref(vdev, WLAN_MLME_CM_ID);
 }
 
+#ifdef FEATURE_CM_ENABLE
 #ifdef WLAN_FEATURE_ROAM_OFFLOAD
 static QDF_STATUS
 cm_find_roam_candidate(struct wlan_objmgr_pdev *pdev,

+ 59 - 0
components/umac/mlme/connection_mgr/core/src/wlan_cm_roam_offload.h

@@ -172,6 +172,27 @@ void cm_flush_roam_channel_list(struct rso_chan_info *channel_info);
 QDF_STATUS cm_roam_control_restore_default_config(struct wlan_objmgr_pdev *pdev,
 						  uint8_t vdev_id);
 
+/**
+ * cm_update_pmk_cache_ft - API to update MDID in PMKSA cache entry
+ * @psoc: psoc pointer
+ * @vdev_id: dvev ID
+ *
+ * Return: None
+ */
+void cm_update_pmk_cache_ft(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id);
+
+/**
+ * cm_lookup_pmkid_using_bssid() - lookup pmkid using bssid
+ * @psoc: pointer to psoc
+ * @vdev_id: vdev_id
+ * @pmk_cache: pointer to pmk cache
+ *
+ * Return: true if pmkid is found else false
+ */
+bool cm_lookup_pmkid_using_bssid(struct wlan_objmgr_psoc *psoc,
+				 uint8_t vdev_id,
+				 struct wlan_crypto_pmksa *pmk_cache);
+
 void cm_roam_restore_default_config(struct wlan_objmgr_pdev *pdev,
 				    uint8_t vdev_id);
 
@@ -187,6 +208,44 @@ QDF_STATUS
 cm_roam_send_disable_config(struct wlan_objmgr_psoc *psoc,
 			    uint8_t vdev_id, uint8_t cfg);
 
+/**
+ * cm_roam_start_init_on_connect() - init roaming
+ * @pdev: pdev pointer
+ * @vdev_id: vdev_id
+ *
+ * Return: void
+ */
+void cm_roam_start_init_on_connect(struct wlan_objmgr_pdev *pdev,
+				   uint8_t vdev_id);
+
+#if defined(WLAN_SAE_SINGLE_PMK) && defined(WLAN_FEATURE_ROAM_OFFLOAD)
+void
+cm_store_sae_single_pmk_to_global_cache(struct wlan_objmgr_psoc *psoc,
+					struct wlan_objmgr_pdev *pdev,
+					struct wlan_objmgr_vdev *vdev);
+/**
+ * cm_check_and_set_sae_single_pmk_cap() - check if the Roamed AP support
+ * roaming using single pmk
+ * with same pmk or not
+ * @psoc: psoc
+ * @vdev_id: vdev id
+ *
+ * Return: void
+ */
+void cm_check_and_set_sae_single_pmk_cap(struct wlan_objmgr_psoc *psoc,
+					 uint8_t vdev_id);
+#else
+static inline void
+cm_store_sae_single_pmk_to_global_cache(struct wlan_objmgr_psoc *psoc,
+					struct wlan_objmgr_pdev *pdev,
+					struct wlan_objmgr_vdev *vdev)
+{}
+static inline void
+cm_check_and_set_sae_single_pmk_cap(struct wlan_objmgr_psoc *psoc,
+				    uint8_t vdev_id)
+{}
+#endif
+
 bool cm_is_auth_type_11r(struct wlan_mlme_psoc_ext_obj *mlme_obj,
 			 struct wlan_objmgr_vdev *vdev,
 			 bool mdie_present);

+ 9 - 26
components/umac/mlme/connection_mgr/core/src/wlan_cm_vdev_api.h

@@ -224,16 +224,15 @@ QDF_STATUS cm_start_wait_for_key_timer(struct wlan_objmgr_vdev *vdev,
 void cm_stop_wait_for_key_timer(struct wlan_objmgr_psoc *psoc,
 				uint8_t vdev_id);
 
-/**
- * cm_csr_is_wait_for_key_n_change_state() - CM CSR API to check roam substate
- * @vdev_id: vdev_id
- *
- * This CM CSR API checks CSR roam substate state is WAIT FOR KEY OR not, if
- * yes then changes to NONE and returns true.
- *
- * Return: true if roam current substate is wait for key, else false
- */
-bool cm_csr_is_wait_for_key_n_change_state(uint8_t vdev_id);
+void cm_update_wait_for_key_timer(struct wlan_objmgr_vdev *vdev,
+				  uint8_t vdev_id, uint32_t interval);
+
+bool cm_csr_is_ss_wait_for_key(uint8_t vdev_id);
+void cm_csr_set_ss_wait_for_key(uint8_t vdev_id);
+void cm_csr_set_ss_none(uint8_t vdev_id);
+void cm_csr_set_joining(uint8_t vdev_id);
+void cm_csr_set_joined(uint8_t vdev_id);
+void cm_csr_set_idle(uint8_t vdev_id);
 
 #ifndef FEATURE_CM_ENABLE
 /**
@@ -389,22 +388,6 @@ bool cm_is_vdevid_connected(struct wlan_objmgr_pdev *pdev, uint8_t vdev_id);
 QDF_STATUS cm_disconnect_start_ind(struct wlan_objmgr_vdev *vdev,
 				   struct wlan_cm_disconnect_req *req);
 
-/**
- * cm_csr_disconnect_start_ind() - Connection manager disconnect start
- * indication to CSR
- * vdev and peer assoc state machine
- * @vdev: VDEV object
- * @req: disconnect request
- *
- * This API is to update legacy struct and should be removed once
- * CSR is cleaned up fully. No new params should be added to CSR, use
- * vdev/pdev/psoc instead.
- *
- * Return: QDF_STATUS
- */
-QDF_STATUS cm_csr_disconnect_start_ind(struct wlan_objmgr_vdev *vdev,
-				       struct wlan_cm_disconnect_req *req);
-
 /**
  * cm_handle_disconnect_req() - Connection manager ext disconnect
  * req to vdev and peer sm

+ 67 - 1
components/umac/mlme/connection_mgr/core/src/wlan_cm_vdev_connect.c

@@ -128,7 +128,8 @@ void cm_wait_for_key_time_out_handler(void *data)
 		return;
 	}
 
-	if (cm_csr_is_wait_for_key_n_change_state(vdev_id)) {
+	if (cm_csr_is_ss_wait_for_key(vdev_id)) {
+		cm_csr_set_ss_none(vdev_id);
 		if (wlan_cm_is_vdev_id_roam_reassoc_state(vdev))
 			mlme_obj->cfg.timeouts.heart_beat_threshold =
 					cfg_default(CFG_HEART_BEAT_THRESHOLD);
@@ -205,6 +206,17 @@ end:
 	wlan_objmgr_vdev_release_ref(vdev, WLAN_MLME_CM_ID);
 }
 
+void cm_update_wait_for_key_timer(struct wlan_objmgr_vdev *vdev,
+				  uint8_t vdev_id, uint32_t interval)
+{
+	cm_csr_set_ss_wait_for_key(vdev_id);
+
+	if (QDF_IS_STATUS_ERROR(cm_start_wait_for_key_timer(vdev,  interval))) {
+		mlme_err("Failed wait for key timer start");
+		cm_csr_set_ss_none(vdev_id);
+	}
+}
+
 #ifdef FEATURE_WLAN_DIAG_SUPPORT_CSR
 static const char *cm_diag_get_ch_width_str(uint8_t ch_width)
 {
@@ -1147,6 +1159,58 @@ cm_send_bss_peer_create_req(struct wlan_objmgr_vdev *vdev,
 
 }
 
+#ifdef WLAN_FEATURE_FILS_SK
+static inline bool is_fils_connection(struct wlan_cm_connect_resp *resp)
+{
+	return resp->is_fils_connection;
+}
+#else
+static inline bool is_fils_connection(struct wlan_cm_connect_resp *resp)
+{
+	return false;
+}
+#endif
+
+static void cm_process_connect_complete(struct wlan_objmgr_psoc *psoc,
+					struct wlan_objmgr_pdev *pdev,
+					struct wlan_objmgr_vdev *vdev,
+					struct wlan_cm_connect_resp *rsp)
+{
+	uint8_t vdev_id = wlan_vdev_get_id(vdev);
+	int32_t ucast_cipher, akm;
+	uint32_t key_interval;
+
+	akm = wlan_crypto_get_param(vdev, WLAN_CRYPTO_PARAM_KEY_MGMT);
+	if (QDF_HAS_PARAM(akm, WLAN_CRYPTO_KEY_MGMT_FT_SAE)) {
+		mlme_debug("Update the MDID in PMK cache for FT-SAE case");
+		cm_update_pmk_cache_ft(psoc, vdev_id);
+	}
+
+	cm_csr_set_joined(vdev_id);
+
+	ucast_cipher = wlan_crypto_get_param(vdev,
+					     WLAN_CRYPTO_PARAM_UCAST_CIPHER);
+	if (!rsp->is_wps_connection &&
+	    (is_fils_connection(rsp) || !ucast_cipher ||
+	    QDF_HAS_PARAM(ucast_cipher, WLAN_CRYPTO_CIPHER_NONE) ==
+			  ucast_cipher ||
+	    QDF_HAS_PARAM(ucast_cipher, WLAN_CRYPTO_CIPHER_WEP_40) ||
+	    QDF_HAS_PARAM(ucast_cipher, WLAN_CRYPTO_CIPHER_WEP_104) ||
+	    QDF_HAS_PARAM(ucast_cipher, WLAN_CRYPTO_CIPHER_WEP))) {
+		cm_csr_set_ss_none(vdev_id);
+		cm_roam_start_init_on_connect(pdev, vdev_id);
+	} else {
+		if (rsp->is_wps_connection)
+			key_interval =
+				WAIT_FOR_WPS_KEY_TIMEOUT_PERIOD;
+		else
+			key_interval =
+				WAIT_FOR_KEY_TIMEOUT_PERIOD;
+		cm_update_wait_for_key_timer(vdev, vdev_id, key_interval);
+	}
+
+}
+
 QDF_STATUS
 cm_connect_complete_ind(struct wlan_objmgr_vdev *vdev,
 			struct wlan_cm_connect_resp *rsp)
@@ -1180,6 +1244,8 @@ cm_connect_complete_ind(struct wlan_objmgr_vdev *vdev,
 		wlan_cm_roam_state_change(pdev, vdev_id, WLAN_ROAM_INIT,
 					  REASON_CONNECT);
 	cm_csr_connect_done_ind(vdev, rsp);
+	if (QDF_IS_STATUS_SUCCESS(rsp->connect_status))
+		cm_process_connect_complete(psoc, pdev, vdev, rsp);
 	cm_connect_info(vdev, QDF_IS_STATUS_SUCCESS(rsp->connect_status) ?
 			true : false, &rsp->bssid, &rsp->ssid,
 			rsp->freq);

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

@@ -38,6 +38,7 @@
 QDF_STATUS cm_disconnect_start_ind(struct wlan_objmgr_vdev *vdev,
 				   struct wlan_cm_disconnect_req *req)
 {
+	struct wlan_objmgr_psoc *psoc;
 	struct wlan_objmgr_pdev *pdev;
 	bool user_disconnect;
 
@@ -51,8 +52,17 @@ QDF_STATUS cm_disconnect_start_ind(struct wlan_objmgr_vdev *vdev,
 		mlme_err("vdev_id: %d pdev not found", req->vdev_id);
 		return QDF_STATUS_E_INVAL;
 	}
+	psoc = wlan_pdev_get_psoc(pdev);
+	if (!psoc) {
+		mlme_err("vdev_id: %d psoc not found", req->vdev_id);
+		return QDF_STATUS_E_INVAL;
+	}
 
-	cm_csr_disconnect_start_ind(vdev, req);
+	if (cm_csr_is_ss_wait_for_key(req->vdev_id)) {
+		mlme_debug("Stop Wait for key timer");
+		cm_stop_wait_for_key_timer(psoc, req->vdev_id);
+		cm_csr_set_ss_none(req->vdev_id);
+	}
 
 	user_disconnect = req->source == CM_OSIF_DISCONNECT ? true : false;
 	wlan_p2p_cleanup_roc_by_vdev(vdev);

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

@@ -591,19 +591,6 @@ static inline void wlan_cm_update_hlp_info(struct wlan_objmgr_psoc *psoc,
 {}
 #endif
 
-#if defined(WLAN_SAE_SINGLE_PMK) && defined(WLAN_FEATURE_ROAM_OFFLOAD)
-void
-cm_store_sae_single_pmk_to_global_cache(struct wlan_objmgr_psoc *psoc,
-					struct wlan_objmgr_pdev *pdev,
-					struct wlan_objmgr_vdev *vdev);
-#else
-static inline void
-cm_store_sae_single_pmk_to_global_cache(struct wlan_objmgr_psoc *psoc,
-					struct wlan_objmgr_pdev *pdev,
-					struct wlan_objmgr_vdev *vdev)
-{}
-#endif
-
 static inline
 bool wlan_cm_is_auth_type_11r(struct wlan_mlme_psoc_ext_obj *mlme_obj,
 			      struct wlan_objmgr_vdev *vdev,
@@ -612,7 +599,6 @@ bool wlan_cm_is_auth_type_11r(struct wlan_mlme_psoc_ext_obj *mlme_obj,
 	return cm_is_auth_type_11r(mlme_obj, vdev, mdie_present);
 }
 
-#ifdef FEATURE_CM_ENABLE
 /**
  * cm_roam_start_init_on_connect() - init roaming
  * @pdev: pdev pointer
@@ -622,6 +608,7 @@ bool wlan_cm_is_auth_type_11r(struct wlan_mlme_psoc_ext_obj *mlme_obj,
  */
 void cm_roam_start_init_on_connect(struct wlan_objmgr_pdev *pdev,
 				   uint8_t vdev_id);
+#ifdef FEATURE_CM_ENABLE
 /**
  * wlan_cm_roam_invoke() - Validate and send Roam invoke req to CM
  * @pdev: Pdev pointer

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

@@ -119,6 +119,11 @@
 #define ROAM_AUTH_STATUS_CONNECTED      0x1
 /* connected and authenticated */
 #define ROAM_AUTH_STATUS_AUTHENTICATED  0x2
+
+#define IS_ROAM_REASON_STA_KICKOUT(reason) ((reason & 0xF) == \
+	WMI_ROAM_TRIGGER_REASON_STA_KICKOUT)
+#define IS_ROAM_REASON_DISCONNECTION(reason) ((reason & 0xF) == \
+	WMI_ROAM_TRIGGER_REASON_DEAUTH)
 #endif
 
 /*

+ 2 - 0
components/umac/mlme/connection_mgr/dispatcher/inc/wlan_cm_roam_ucfg_api.h

@@ -66,6 +66,8 @@ QDF_STATUS ucfg_cm_set_ese_roam_scan_channel_list(struct wlan_objmgr_pdev *pdev,
 						  uint8_t vdev_id,
 						  qdf_freq_t *chan_freq_list,
 						  uint8_t num_chan);
+QDF_STATUS ucfg_cm_set_cckm_ie(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id,
+			       const uint8_t *cck_ie, const uint8_t cck_ie_len);
 #endif
 
 /**

+ 27 - 0
components/umac/mlme/connection_mgr/dispatcher/src/wlan_cm_roam_ucfg_api.c

@@ -187,6 +187,33 @@ release_ref:
 
 	return status;
 }
+
+QDF_STATUS ucfg_cm_set_cckm_ie(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id,
+			       const uint8_t *cck_ie, const uint8_t cck_ie_len)
+{
+	struct wlan_objmgr_vdev *vdev;
+	struct mlme_legacy_priv *mlme_priv;
+
+	vdev = wlan_objmgr_get_vdev_by_id_from_psoc(psoc, vdev_id,
+						    WLAN_MLME_CM_ID);
+
+	if (!vdev) {
+		mlme_err("vdev not found for id %d", vdev_id);
+		return QDF_STATUS_E_FAILURE;
+	}
+
+	mlme_priv = wlan_vdev_mlme_get_ext_hdl(vdev);
+	if (!mlme_priv) {
+		wlan_objmgr_vdev_release_ref(vdev, WLAN_MLME_CM_ID);
+		return QDF_STATUS_E_FAILURE;
+	}
+	qdf_mem_copy(mlme_priv->connect_info.cckm_ie, cck_ie, cck_ie_len);
+	mlme_priv->connect_info.cckm_ie_len = cck_ie_len;
+	wlan_objmgr_vdev_release_ref(vdev, WLAN_MLME_CM_ID);
+
+	return QDF_STATUS_SUCCESS;
+}
+
 #endif
 
 #ifdef FEATURE_CM_ENABLE

+ 2 - 2
core/hdd/src/wlan_hdd_ioctl.c

@@ -5153,8 +5153,8 @@ static int drv_cmd_set_cckm_ie(struct hdd_adapter *adapter,
 		goto exit;
 	}
 
-	sme_set_cckm_ie(hdd_ctx->mac_handle, adapter->vdev_id,
-			cckm_ie, cckm_ie_len);
+	ucfg_cm_set_cckm_ie(hdd_ctx->psoc, adapter->vdev_id, cckm_ie,
+			    cckm_ie_len);
 	if (cckm_ie) {
 		qdf_mem_free(cckm_ie);
 		cckm_ie = NULL;

+ 0 - 11
core/mac/inc/ani_system_defs.h

@@ -146,17 +146,6 @@ typedef struct sSirAddie {
 	uint8_t addIEdata[SIR_MAC_MAX_ADD_IE_LENGTH + 2];
 } tSirAddie, *tpSirAddie;
 
-#ifdef FEATURE_WLAN_ESE
-
-/* The CCKM IE needs to be in the */
-/* Join and Reassoc Req. */
-typedef struct sSirCCKMie {
-	uint16_t length;
-	uint8_t cckmIEdata[WLAN_MAX_IE_LEN + 2];
-} tSirCCKMie, *tpSirCCKMie;
-
-#endif
-
 /* / Definition for Encryption Keys */
 typedef struct sSirKeys {
 	uint8_t keyId;

+ 0 - 8
core/mac/inc/sir_api.h

@@ -932,14 +932,6 @@ struct join_req {
 	tSirMacRateSet operationalRateSet;      /* Has 11a or 11b rates */
 	tSirMacRateSet extendedRateSet; /* Has 11g rates */
 	tSirRSNie rsnIE;        /* RSN IE to be sent in */
-	/* (Re) Association Request */
-#ifdef FEATURE_WLAN_ESE
-	/* CCMK IE to be included as handler for join and reassoc is */
-	tSirCCKMie cckmIE;
-	/* the same. The join will never carry cckm, but will be set to */
-	/* 0. */
-#endif
-
 	tSirAddie addIEScan;    /* Additional IE to be sent in */
 	/* (unicast) Probe Request at the time of join */
 

+ 1 - 1
core/mac/src/include/parser_api.h

@@ -931,7 +931,7 @@ void populate_dot11f_ese_version(tDot11fIEESEVersion *pESEVersion);
 void populate_dot11f_ese_rad_mgmt_cap(tDot11fIEESERadMgmtCap *pESERadMgmtCap);
 /* Fill the CCKM IE */
 QDF_STATUS populate_dot11f_ese_cckm_opaque(struct mac_context *mac,
-					tpSirCCKMie pCCKMie,
+					struct mlme_connect_info *connect_info,
 					tDot11fIEESECckmOpaque *pDot11f);
 
 void populate_dot11_tsrsie(struct mac_context *mac,

+ 0 - 9
core/mac/src/include/sir_params.h

@@ -41,15 +41,6 @@
 #define SYSTEM_TIME_SEC_TO_MSEC       1000
 #define SYSTEM_TIME_NSEC_TO_USEC      1000
 
-/*
- * Following time is used to program WOW_TIMER_PATTERN to FW so that FW will
- * wake host up to do graceful disconnect in case PEER remains un-authorized
- * for this long.
- */
-#define SIR_INSTALL_KEY_TIMEOUT_SEC      70
-#define SIR_INSTALL_KEY_TIMEOUT_MS       \
-			(SIR_INSTALL_KEY_TIMEOUT_SEC * SYSTEM_TIME_SEC_TO_MSEC)
-
 /* defines for WPS config states */
 #define       SAP_WPS_DISABLED             0
 #define       SAP_WPS_ENABLED_UNCONFIGURED 1

+ 7 - 2
core/mac/src/pe/lim/lim_send_frames_host_roam.c

@@ -84,10 +84,15 @@ void lim_send_reassoc_req_with_ft_ies_mgmt_frame(struct mac_context *mac_ctx,
 	bool vht_enabled = false;
 	tpSirMacMgmtHdr mac_hdr;
 	tftSMEContext *ft_sme_context;
+	struct mlme_legacy_priv *mlme_priv;
 
 	if (!pe_session)
 		return;
 
+	mlme_priv = wlan_vdev_mlme_get_ext_hdl(pe_session->vdev);
+	if (!mlme_priv)
+		return;
+
 	vdev_id = pe_session->vdev_id;
 
 	/* check this early to avoid unncessary operation */
@@ -213,9 +218,9 @@ void lim_send_reassoc_req_with_ft_ies_mgmt_frame(struct mac_context *mac_ctx,
 				&frm->WPAOpaque);
 		}
 #ifdef FEATURE_WLAN_ESE
-		if (pe_session->pLimReAssocReq->cckmIE.length) {
+		if (mlme_priv->connect_info.cckm_ie_len) {
 			populate_dot11f_ese_cckm_opaque(mac_ctx,
-				&(pe_session->pLimReAssocReq->cckmIE),
+				&mlme_priv->connect_info,
 				&frm->ESECckmOpaque);
 		}
 #endif

+ 16 - 11
core/mac/src/sys/legacy/src/utils/src/parser_api.c

@@ -5477,21 +5477,26 @@ void populate_dot11f_ese_rad_mgmt_cap(tDot11fIEESERadMgmtCap *pESERadMgmtCap)
 	pESERadMgmtCap->reserved = 0;
 }
 
-QDF_STATUS populate_dot11f_ese_cckm_opaque(struct mac_context *mac,
-					   tpSirCCKMie pCCKMie,
-					   tDot11fIEESECckmOpaque *pDot11f)
+QDF_STATUS
+populate_dot11f_ese_cckm_opaque(struct mac_context *mac,
+				struct mlme_connect_info *connect_info,
+				tDot11fIEESECckmOpaque *pDot11f)
 {
 	int idx;
-
-	if (pCCKMie->length) {
-		idx = find_ie_location(mac, (tpSirRSNie) pCCKMie,
-						 DOT11F_EID_ESECCKMOPAQUE);
-		if (0 <= idx) {
+	tSirRSNie ie;
+
+	if (connect_info->cckm_ie_len &&
+	    connect_info->cckm_ie_len < DOT11F_IE_RSN_MAX_LEN) {
+		qdf_mem_copy(ie.rsnIEdata, connect_info->cckm_ie,
+			     connect_info->cckm_ie_len);
+		ie.length = connect_info->cckm_ie_len;
+		idx = find_ie_location(mac, &ie, DOT11F_EID_ESECCKMOPAQUE);
+		if (idx >= 0) {
 			pDot11f->present = 1;
 			/* Dont include OUI */
-			pDot11f->num_data = pCCKMie->cckmIEdata[idx + 1] - 4;
-			qdf_mem_copy(pDot11f->data, pCCKMie->cckmIEdata + idx + 2 + 4,  /* EID,len,OUI */
-				     pCCKMie->cckmIEdata[idx + 1] - 4); /* Skip OUI */
+			pDot11f->num_data = ie.rsnIEdata[idx + 1] - 4;
+			qdf_mem_copy(pDot11f->data, ie.rsnIEdata + idx + 2 + 4,  /* EID,len,OUI */
+				     ie.rsnIEdata[idx + 1] - 4); /* Skip OUI */
 		}
 	}
 	return QDF_STATUS_SUCCESS;

+ 0 - 5
core/sme/inc/csr_api.h

@@ -252,11 +252,6 @@ typedef struct tagCsrEseCckmInfo {
 	uint8_t btk[SIR_BTK_KEY_LEN];
 #endif
 } tCsrEseCckmInfo;
-
-typedef struct tagCsrEseCckmIe {
-	uint8_t cckmIe[DOT11F_IE_RSN_MAX_LEN];
-	uint8_t cckmIeLen;
-} tCsrEseCckmIe;
 #endif /* FEATURE_WLAN_ESE */
 
 typedef struct sCsrChannel_ {

+ 2 - 2
core/sme/inc/csr_internal.h

@@ -519,7 +519,6 @@ struct csr_roam_session {
 	bool isPrevApInfoValid;
 	tSirMacSSid prevApSSID;
 	uint32_t roamTS1;
-	tCsrEseCckmIe suppCckmIeInfo;
 #endif
 	uint8_t bRefAssocStartCnt;      /* Tracking assoc start indication */
 #ifdef WLAN_FEATURE_ROAM_OFFLOAD
@@ -900,6 +899,7 @@ QDF_STATUS
 csr_roam_update_add_ies(struct mac_context *mac,
 		tSirUpdateIE *pUpdateIE, eUpdateIEsType updateType);
 #ifdef WLAN_FEATURE_ROAM_OFFLOAD
+#ifndef FEATURE_CM_ENABLE
 /**
  * csr_scan_save_roam_offload_ap_to_scan_cache() - This function parses the
  * received beacon/probe response from the firmware as part of the roam synch
@@ -915,7 +915,7 @@ QDF_STATUS
 csr_rso_save_ap_to_scan_cache(struct mac_context *mac,
 			      struct roam_offload_synch_ind *roam_synch_ind,
 			      struct bss_description *bss_desc_ptr);
-
+#endif
 /**
  * csr_process_ho_fail_ind  - This function will process the Hand Off Failure
  * indication received from the firmware. It will trigger a disconnect on

+ 1 - 5
core/sme/inc/csr_neighbor_roam.h

@@ -166,16 +166,12 @@ static inline void csr_neighbor_roam_send_lfr_metric_event(
 
 QDF_STATUS csr_roam_copy_connected_profile(struct mac_context *mac,
 		uint32_t sessionId, struct csr_roam_profile *pDstProfile);
-#endif /* FEATURE_CM_ENABLE */
 
 #ifdef FEATURE_WLAN_ESE
-QDF_STATUS csr_set_cckm_ie(struct mac_context *mac, const uint8_t sessionId,
-		const uint8_t *pCckmIe, const uint8_t ccKmIeLen);
-#ifndef FEATURE_CM_ENABLE
 QDF_STATUS csr_roam_read_tsf(struct mac_context *mac, uint8_t *pTimestamp,
 		const uint8_t sessionId);
-#endif
 #endif /* FEATURE_WLAN_ESE */
+#endif /* FEATURE_CM_ENABLE */
 
 #ifdef WLAN_FEATURE_ROAM_OFFLOAD
 QDF_STATUS csr_roam_synch_callback(struct mac_context *mac,

+ 0 - 4
core/sme/inc/csr_support.h

@@ -327,10 +327,6 @@ QDF_STATUS csr_reassoc(struct mac_context *mac, uint32_t sessionId,
 		tCsrRoamModifyProfileFields *pModProfileFields,
 		uint32_t *pRoamId, bool fForce);
 #endif
-
-bool csr_is_profile11r(struct mac_context *mac, struct csr_roam_profile *pProfile);
-bool csr_is_auth_type11r(struct mac_context *mac, enum csr_akm_type AuthType,
-			 uint8_t mdiePresent);
 #ifdef FEATURE_WLAN_ESE
 bool csr_is_profile_ese(struct csr_roam_profile *pProfile);
 #endif

+ 0 - 3
core/sme/inc/sme_api.h

@@ -686,9 +686,6 @@ QDF_STATUS sme_get_tsm_stats(mac_handle_t mac_handle,
 		tCsrTsmStatsCallback callback,
 		struct qdf_mac_addr bssId,
 		void *pContext, uint8_t tid);
-QDF_STATUS sme_set_cckm_ie(mac_handle_t mac_handle,
-		uint8_t sessionId,
-		uint8_t *pCckmIe, uint8_t cckmIeLen);
 QDF_STATUS sme_set_ese_beacon_request(mac_handle_t mac_handle,
 				      const uint8_t sessionId,
 				      const tCsrEseBeaconReq *in_req);

+ 0 - 26
core/sme/src/common/sme_api.c

@@ -1626,32 +1626,6 @@ static QDF_STATUS sme_tsm_ie_ind(struct mac_context *mac,
 	return status;
 }
 
-/**
- * sme_set_cckm_ie() - set cckm ie
- * @mac_handle: Opaque handle to the global MAC context
- * @sessionId: session id
- * @pCckmIe: Pointer to CCKM Ie
- * @cckmIeLen: Length of @pCckmIe
- *
- * Function to store the CCKM IE passed from supplicant and use
- * it while packing reassociation request.
- *
- * Return: QDF_STATUS enumeration
- */
-QDF_STATUS sme_set_cckm_ie(mac_handle_t mac_handle, uint8_t sessionId,
-			   uint8_t *pCckmIe, uint8_t cckmIeLen)
-{
-	struct mac_context *mac = MAC_CONTEXT(mac_handle);
-	QDF_STATUS status = QDF_STATUS_SUCCESS;
-
-	status = sme_acquire_global_lock(&mac->sme);
-	if (QDF_IS_STATUS_SUCCESS(status)) {
-		csr_set_cckm_ie(mac, sessionId, pCckmIe, cckmIeLen);
-		sme_release_global_lock(&mac->sme);
-	}
-	return status;
-}
-
 /**
  * sme_set_ese_beacon_request() - set ese beacon request
  * @mac_handle: Opaque handle to the global MAC context

+ 136 - 470
core/sme/src/csr/csr_api_roam.c

@@ -85,12 +85,6 @@
 #define MAX_PWR_FCC_CHAN_12 8
 #define MAX_PWR_FCC_CHAN_13 2
 
-/* 70 seconds, for WPA, WPA2, CCKM */
-#define CSR_WAIT_FOR_KEY_TIMEOUT_PERIOD     \
-	(SIR_INSTALL_KEY_TIMEOUT_SEC * QDF_MC_TIMER_TO_SEC_UNIT)
-/* 120 seconds, for WPS */
-#define CSR_WAIT_FOR_WPS_KEY_TIMEOUT_PERIOD (120 * QDF_MC_TIMER_TO_SEC_UNIT)
-
 #define CSR_SINGLE_PMK_OUI               "\x00\x40\x96\x03"
 #define CSR_SINGLE_PMK_OUI_SIZE          4
 
@@ -1632,34 +1626,6 @@ QDF_STATUS csr_get_tsm_stats(struct mac_context *mac,
 	return status;
 }
 
-/**
- * csr_set_cckm_ie() - set CCKM IE
- * @mac: Global MAC context
- * @sessionId: session identifier
- * @pCckmIe: Pointer to input CCKM IE data
- * @ccKmIeLen: Length of @pCckmIe
- *
- * This function stores the CCKM IE passed by the supplicant
- * in a place holder data structure and this IE will be packed inside
- * reassociation request
- *
- * Return: QDF_STATUS enumeration
- */
-QDF_STATUS csr_set_cckm_ie(struct mac_context *mac, const uint8_t sessionId,
-			   const uint8_t *pCckmIe, const uint8_t ccKmIeLen)
-{
-	QDF_STATUS status = QDF_STATUS_SUCCESS;
-	struct csr_roam_session *pSession = CSR_GET_SESSION(mac, sessionId);
-
-	if (!pSession) {
-		sme_err("session %d not found", sessionId);
-		return QDF_STATUS_E_FAILURE;
-	}
-	qdf_mem_copy(pSession->suppCckmIeInfo.cckmIe, pCckmIe, ccKmIeLen);
-	pSession->suppCckmIeInfo.cckmIeLen = ccKmIeLen;
-	return status;
-}
-
 #ifndef FEATURE_CM_ENABLE
 /**
  * csr_roam_read_tsf() - read TSF
@@ -5962,16 +5928,14 @@ static void csr_roam_process_join_res(struct mac_context *mac_ctx,
 			 * Set the substate to WaitForKey in case
 			 * authentiation is needed
 			 */
-			csr_roam_substate_change(mac_ctx,
-					eCSR_ROAM_SUBSTATE_WAIT_FOR_KEY,
-					session_id);
+			cm_csr_set_ss_wait_for_key(session_id);
 
 			if (profile->bWPSAssociation)
 				key_timeout_interval =
-					CSR_WAIT_FOR_WPS_KEY_TIMEOUT_PERIOD;
+					WAIT_FOR_WPS_KEY_TIMEOUT_PERIOD;
 			else
 				key_timeout_interval =
-					CSR_WAIT_FOR_KEY_TIMEOUT_PERIOD;
+					WAIT_FOR_KEY_TIMEOUT_PERIOD;
 
 			vdev = wlan_objmgr_get_vdev_by_id_from_psoc(
 				mac_ctx->psoc, session_id, WLAN_LEGACY_SME_ID);
@@ -6013,8 +5977,8 @@ static void csr_roam_process_join_res(struct mac_context *mac_ctx,
 			mdie_present = cfg.bool_value;
 			if (akm_type == eCSR_AUTH_TYPE_FT_SAE && mdie_present) {
 				sme_debug("Update the MDID in PMK cache for FT-SAE case");
-				csr_update_pmk_cache_ft(mac_ctx,
-							session_id, session);
+				cm_update_pmk_cache_ft(mac_ctx->psoc,
+							session_id);
 			}
 
 			len = join_rsp->assocReqLength +
@@ -7206,28 +7170,90 @@ csr_roam_reassoc(struct mac_context *mac_ctx, uint32_t session_id,
 }
 #endif
 
-bool cm_csr_is_wait_for_key_n_change_state(uint8_t vdev_id)
+bool cm_csr_is_ss_wait_for_key(uint8_t vdev_id)
 {
 	struct mac_context *mac;
+	bool is_wait_for_key = false;
 
 	mac = sme_get_mac_context();
 	if (!mac) {
 		sme_err("mac_ctx is NULL");
-		return false;
+		return is_wait_for_key;
 	}
 
 	spin_lock(&mac->roam.roam_state_lock);
-	if (CSR_IS_WAIT_FOR_KEY(mac, vdev_id)) {
-		/* Change the substate so command queue is unblocked. */
-		if (vdev_id < WLAN_MAX_VDEVS)
-			mac->roam.curSubState[vdev_id] =
-						eCSR_ROAM_SUBSTATE_NONE;
-		spin_unlock(&mac->roam.roam_state_lock);
-		return true;
-	}
+	if (CSR_IS_WAIT_FOR_KEY(mac, vdev_id))
+		is_wait_for_key = true;
 	spin_unlock(&mac->roam.roam_state_lock);
 
-	return false;
+	return is_wait_for_key;
+}
+
+void cm_csr_set_ss_wait_for_key(uint8_t vdev_id)
+{
+	struct mac_context *mac;
+
+	mac = sme_get_mac_context();
+	if (!mac) {
+		sme_err("mac_ctx is NULL");
+		return;
+	}
+
+	csr_roam_substate_change(mac, eCSR_ROAM_SUBSTATE_WAIT_FOR_KEY,
+				 vdev_id);
+}
+
+void cm_csr_set_joining(uint8_t vdev_id)
+{
+	struct mac_context *mac;
+
+	mac = sme_get_mac_context();
+	if (!mac) {
+		sme_err("mac_ctx is NULL");
+		return;
+	}
+
+	csr_roam_state_change(mac, eCSR_ROAMING_STATE_JOINING, vdev_id);
+}
+
+void cm_csr_set_joined(uint8_t vdev_id)
+{
+	struct mac_context *mac;
+
+	mac = sme_get_mac_context();
+	if (!mac) {
+		sme_err("mac_ctx is NULL");
+		return;
+	}
+
+	csr_roam_state_change(mac, eCSR_ROAMING_STATE_JOINED, vdev_id);
+}
+
+void cm_csr_set_idle(uint8_t vdev_id)
+{
+	struct mac_context *mac;
+
+	mac = sme_get_mac_context();
+	if (!mac) {
+		sme_err("mac_ctx is NULL");
+		return;
+	}
+
+	csr_roam_state_change(mac, eCSR_ROAMING_STATE_IDLE, vdev_id);
+}
+
+void cm_csr_set_ss_none(uint8_t vdev_id)
+{
+	struct mac_context *mac;
+
+	mac = sme_get_mac_context();
+	if (!mac) {
+		sme_err("mac_ctx is NULL");
+		return;
+	}
+
+	csr_roam_substate_change(mac, eCSR_ROAM_SUBSTATE_NONE,
+				 vdev_id);
 }
 
 #ifndef FEATURE_CM_ENABLE
@@ -12392,7 +12418,7 @@ QDF_STATUS csr_roam_set_psk_pmk(struct mac_context *mac, uint8_t vdev_id,
 	    QDF_HAS_PARAM(akm, WLAN_CRYPTO_KEY_MGMT_FILS_SHA384) ||
 	    QDF_HAS_PARAM(akm, WLAN_CRYPTO_KEY_MGMT_FT_IEEE8021X_SHA384)) {
 		sme_debug("Auth type: %d update the MDID in cache", akm_type);
-		csr_update_pmk_cache_ft(mac, vdev_id, session);
+		cm_update_pmk_cache_ft(mac->psoc, vdev_id);
 	}
 
 	if (update_to_fw)
@@ -12438,80 +12464,8 @@ void csr_clear_sae_single_pmk(struct wlan_objmgr_psoc *psoc,
 	}
 	wlan_objmgr_vdev_release_ref(vdev, WLAN_LEGACY_SME_ID);
 }
-
-void
-csr_store_sae_single_pmk_to_global_cache(struct mac_context *mac,
-					 struct csr_roam_session *session,
-					 uint8_t vdev_id)
-{
-	struct wlan_objmgr_vdev *vdev;
-
-	vdev = wlan_objmgr_get_vdev_by_id_from_psoc(mac->psoc, vdev_id,
-						    WLAN_LEGACY_SME_ID);
-	if (!vdev) {
-		sme_err("vdev is NULL");
-		return;
-	}
-	cm_store_sae_single_pmk_to_global_cache(mac->psoc, mac->pdev, vdev);
-	wlan_objmgr_vdev_release_ref(vdev, WLAN_LEGACY_SME_ID);
-}
 #endif
 
-void csr_update_pmk_cache_ft(struct mac_context *mac, uint32_t vdev_id,
-			     struct csr_roam_session *session)
-{
-	QDF_STATUS status = QDF_STATUS_E_INVAL;
-	struct wlan_objmgr_vdev *vdev;
-	struct wlan_crypto_pmksa pmksa;
-	enum QDF_OPMODE vdev_mode;
-	struct cm_roam_values_copy src_cfg;
-
-	if (!session) {
-		sme_err("session not found");
-		return;
-	}
-
-	vdev = wlan_objmgr_get_vdev_by_id_from_psoc(mac->psoc, vdev_id,
-						    WLAN_LEGACY_SME_ID);
-	if (!vdev) {
-		sme_err("vdev is NULL");
-		return;
-	}
-
-	vdev_mode = wlan_vdev_mlme_get_opmode(vdev);
-	/* If vdev mode is STA then proceed further */
-	if (vdev_mode != QDF_STA_MODE) {
-		sme_err("vdev mode is not STA");
-		wlan_objmgr_vdev_release_ref(vdev, WLAN_LEGACY_SME_ID);
-		return;
-	}
-
-	/*
-	 * In FT connection fetch the MDID from Session and send it to crypto
-	 * so that it will update the crypto PMKSA table with the MDID for the
-	 * matching BSSID or SSID PMKSA entry. And delete the old/stale PMK
-	 * cache entries for the same mobility domain as of the newly added
-	 * entry to avoid multiple PMK cache entries for the same MDID.
-	 */
-	wlan_vdev_get_bss_peer_mac(vdev, &pmksa.bssid);
-	wlan_vdev_mlme_get_ssid(vdev, pmksa.ssid, &pmksa.ssid_len);
-	wlan_cm_roam_cfg_get_value(mac->psoc, vdev_id,
-				   MOBILITY_DOMAIN, &src_cfg);
-	sme_debug("copied the BSSID/SSID from session to PMKSA mdie %d",
-		  src_cfg.bool_value);
-	if (src_cfg.bool_value) {
-		pmksa.mdid.mdie_present = 1;
-		pmksa.mdid.mobility_domain = src_cfg.uint_value;
-		sme_debug("copied the MDID from session to PMKSA");
-
-		status = wlan_crypto_update_pmk_cache_ft(vdev, &pmksa);
-		if (status == QDF_STATUS_SUCCESS)
-			sme_debug("Updated the crypto cache table");
-	}
-
-	wlan_objmgr_vdev_release_ref(vdev, WLAN_LEGACY_SME_ID);
-}
-
 #ifndef FEATURE_CM_ENABLE
 QDF_STATUS csr_roam_get_wpa_rsn_req_ie(struct mac_context *mac, uint32_t sessionId,
 				       uint32_t *pLen, uint8_t *pBuf)
@@ -12754,7 +12708,7 @@ QDF_STATUS cm_csr_handle_connect_req(struct wlan_objmgr_vdev *vdev,
 	mlme_set_opr_rate(vdev, op_rate_set.rate, op_rate_set.numRates);
 	mlme_set_ext_opr_rate(vdev, ext_rate_set.rate, ext_rate_set.numRates);
 
-	csr_roam_state_change(mac_ctx, eCSR_ROAMING_STATE_JOINING, vdev_id);
+	cm_csr_set_joining(vdev_id);
 
 	return QDF_STATUS_SUCCESS;
 }
@@ -12995,18 +12949,6 @@ purge_list:
 
 }
 
-#ifdef WLAN_FEATURE_FILS_SK
-static inline bool csr_cm_is_fils_connection(struct wlan_cm_connect_resp *resp)
-{
-	return resp->is_fils_connection;
-}
-#else
-static inline bool csr_cm_is_fils_connection(struct wlan_cm_connect_resp *resp)
-{
-	return false;
-}
-#endif
-
 QDF_STATUS cm_csr_connect_rsp(struct wlan_objmgr_vdev *vdev,
 			      struct cm_vdev_join_rsp *rsp)
 {
@@ -13052,11 +12994,9 @@ cm_csr_connect_done_ind(struct wlan_objmgr_vdev *vdev,
 {
 	struct mac_context *mac_ctx;
 	uint8_t vdev_id = wlan_vdev_get_id(vdev);
-	int32_t ucast_cipher, akm;
+	int32_t ucast_cipher;
 	struct set_context_rsp install_key_rsp;
-	struct csr_roam_session *session;
 	int32_t rsn_cap;
-	uint32_t key_interval;
 
 	/*
 	 * This API is to update legacy struct and should be removed once
@@ -13067,15 +13007,8 @@ cm_csr_connect_done_ind(struct wlan_objmgr_vdev *vdev,
 	if (!mac_ctx)
 		return QDF_STATUS_E_INVAL;
 
-	session = CSR_GET_SESSION(mac_ctx, vdev_id);
-	if (!session || !CSR_IS_SESSION_VALID(mac_ctx, vdev_id)) {
-		sme_err("session not found for vdev_id %d", vdev_id);
-		return QDF_STATUS_E_INVAL;
-	}
-
 	if (QDF_IS_STATUS_ERROR(rsp->connect_status)) {
-		csr_roam_state_change(mac_ctx, eCSR_ROAMING_STATE_IDLE,
-				      vdev_id);
+		cm_csr_set_idle(vdev_id);
 		sme_qos_update_hand_off(vdev_id, false);
 		sme_qos_csr_event_ind(mac_ctx, vdev_id,
 				      SME_QOS_CSR_DISCONNECT_IND, NULL);
@@ -13100,45 +13033,6 @@ cm_csr_connect_done_ind(struct wlan_objmgr_vdev *vdev,
 					     (tSirSmeRsp *)&install_key_rsp);
 	}
 
-	akm = wlan_crypto_get_param(vdev, WLAN_CRYPTO_PARAM_KEY_MGMT);
-	if (QDF_HAS_PARAM(akm, WLAN_CRYPTO_KEY_MGMT_FT_SAE)) {
-		sme_debug("Update the MDID in PMK cache for FT-SAE case");
-		csr_update_pmk_cache_ft(mac_ctx, vdev_id, session);
-	}
-
-	csr_roam_state_change(mac_ctx, eCSR_ROAMING_STATE_JOINED, vdev_id);
-
-	if (!rsp->is_wps_connection &&
-	    (csr_cm_is_fils_connection(rsp) || !ucast_cipher ||
-	    QDF_HAS_PARAM(ucast_cipher, WLAN_CRYPTO_CIPHER_NONE) ==
-			  ucast_cipher ||
-	    QDF_HAS_PARAM(ucast_cipher, WLAN_CRYPTO_CIPHER_WEP_40) ||
-	    QDF_HAS_PARAM(ucast_cipher, WLAN_CRYPTO_CIPHER_WEP_104) ||
-	    QDF_HAS_PARAM(ucast_cipher, WLAN_CRYPTO_CIPHER_WEP))) {
-		csr_roam_substate_change(mac_ctx, eCSR_ROAM_SUBSTATE_NONE,
-					 vdev_id);
-		cm_roam_start_init_on_connect(mac_ctx->pdev, vdev_id);
-	} else {
-		csr_roam_substate_change(mac_ctx,
-					 eCSR_ROAM_SUBSTATE_WAIT_FOR_KEY,
-					 vdev_id);
-
-		if (rsp->is_wps_connection)
-			key_interval =
-				CSR_WAIT_FOR_WPS_KEY_TIMEOUT_PERIOD;
-		else
-			key_interval =
-				CSR_WAIT_FOR_KEY_TIMEOUT_PERIOD;
-		if (cm_start_wait_for_key_timer(vdev,
-						key_interval)) {
-			sme_err("Failed to start wait key timer");
-			csr_roam_substate_change(mac_ctx,
-						 eCSR_ROAM_SUBSTATE_NONE,
-						 vdev_id);
-			return QDF_STATUS_E_FAILURE;
-		}
-	}
-
 	rsn_cap = wlan_crypto_get_param(vdev, WLAN_CRYPTO_PARAM_RSN_CAP);
 	if (rsn_cap >= 0) {
 		if (wma_cli_set2_command(vdev_id, WMI_VDEV_PARAM_RSN_CAPABILITY,
@@ -13150,38 +13044,6 @@ cm_csr_connect_done_ind(struct wlan_objmgr_vdev *vdev,
 	return QDF_STATUS_SUCCESS;
 }
 
-QDF_STATUS cm_csr_disconnect_start_ind(struct wlan_objmgr_vdev *vdev,
-				       struct wlan_cm_disconnect_req *req)
-{
-	struct mac_context *mac_ctx;
-	uint8_t vdev_id = wlan_vdev_get_id(vdev);
-	struct csr_roam_session *session;
-
-	/*
-	 * This API is to update legacy struct and should be removed once
-	 * CSR is cleaned up fully. No new params should be added to CSR, use
-	 * vdev/pdev/psoc instead
-	 */
-	mac_ctx = cds_get_context(QDF_MODULE_ID_SME);
-	if (!mac_ctx)
-		return QDF_STATUS_E_INVAL;
-
-	session = CSR_GET_SESSION(mac_ctx, vdev_id);
-	if (!session || !CSR_IS_SESSION_VALID(mac_ctx, vdev_id)) {
-		sme_err("session not found for vdev_id %d", vdev_id);
-		return QDF_STATUS_E_INVAL;
-	}
-
-	if (CSR_IS_WAIT_FOR_KEY(mac_ctx, vdev_id)) {
-		sme_debug("Stop Wait for key timer and change substate to eCSR_ROAM_SUBSTATE_NONE");
-		cm_stop_wait_for_key_timer(mac_ctx->psoc, vdev_id);
-		csr_roam_substate_change(mac_ctx, eCSR_ROAM_SUBSTATE_NONE,
-					 vdev_id);
-	}
-
-	return QDF_STATUS_SUCCESS;
-}
-
 QDF_STATUS cm_csr_handle_diconnect_req(struct wlan_objmgr_vdev *vdev,
 				       struct wlan_cm_vdev_discon_req *req)
 {
@@ -13204,7 +13066,7 @@ QDF_STATUS cm_csr_handle_diconnect_req(struct wlan_objmgr_vdev *vdev,
 		return QDF_STATUS_E_INVAL;
 	}
 
-	csr_roam_state_change(mac_ctx, eCSR_ROAMING_STATE_JOINING, vdev_id);
+	cm_csr_set_joining(vdev_id);
 
 	/* Update the disconnect stats */
 	session->disconnect_stats.disconnection_cnt++;
@@ -13248,7 +13110,7 @@ cm_csr_diconnect_done_ind(struct wlan_objmgr_vdev *vdev,
 	if (!mac_ctx)
 		return QDF_STATUS_E_INVAL;
 
-	csr_roam_state_change(mac_ctx, eCSR_ROAMING_STATE_IDLE, vdev_id);
+	cm_csr_set_idle(vdev_id);
 	if (cm_is_vdev_roaming(vdev))
 		sme_qos_update_hand_off(vdev_id, false);
 	csr_set_default_dot11_mode(mac_ctx);
@@ -13695,35 +13557,6 @@ QDF_STATUS csr_send_join_req_msg(struct mac_context *mac, uint32_t sessionId,
 #endif /* FEATURE_WLAN_WAPI */
 			csr_join_req->rsnIE.length = 0;
 		}
-#ifdef FEATURE_WLAN_ESE
-		if (eWNI_SME_JOIN_REQ == messageType)
-			csr_join_req->cckmIE.length = 0;
-		else if (eWNI_SME_REASSOC_REQ == messageType) {
-			/* cckmIE */
-			if (csr_is_profile_ese(pProfile)) {
-				/* Insert the CCKM IE into the join request */
-				ieLen = pSession->suppCckmIeInfo.cckmIeLen;
-				qdf_mem_copy((void *)(wpaRsnIE),
-						pSession->suppCckmIeInfo.cckmIe,
-						ieLen);
-			} else
-				ieLen = 0;
-			/*
-			 * If present, copy the IE into the
-			 * eWNI_SME_REASSOC_REQ message buffer
-			 */
-			if (ieLen) {
-				/*
-				 * Copy the CCKM IE over from the temp
-				 * buffer (wpaRsnIE)
-				 */
-				csr_join_req->cckmIE.length = ieLen;
-				qdf_mem_copy(&csr_join_req->cckmIE.cckmIEdata,
-						wpaRsnIE, ieLen);
-			} else
-				csr_join_req->cckmIE.length = 0;
-		}
-#endif /* FEATURE_WLAN_ESE */
 		/* addIEScan */
 		if (pProfile->nAddIEScanLength && pProfile->pAddIEScan) {
 			ieLen = pProfile->nAddIEScanLength;
@@ -16963,182 +16796,6 @@ QDF_STATUS csr_fast_reassoc(mac_handle_t mac_handle,
 }
 #endif
 
-#if defined(WLAN_SAE_SINGLE_PMK) && defined(WLAN_FEATURE_ROAM_OFFLOAD)
-/**
- * csr_is_sae_single_pmk_vsie_ap() - check if the Roamed AP supports sae
- * roaming using single pmk connection
- * with same pmk or not
- * @bss_des: bss descriptor
- *
- * Return: True if same pmk IE is present
- */
-static bool csr_is_sae_single_pmk_vsie_ap(struct bss_description *bss_des)
-{
-	uint16_t ie_len;
-	const uint8_t *vendor_ie;
-
-	if (!bss_des) {
-		sme_debug("Invalid bss description");
-		return false;
-	}
-	ie_len = wlan_get_ielen_from_bss_description(bss_des);
-
-	vendor_ie =
-		wlan_get_vendor_ie_ptr_from_oui(CSR_SINGLE_PMK_OUI,
-						CSR_SINGLE_PMK_OUI_SIZE,
-						(uint8_t *)bss_des->ieFields,
-						ie_len);
-
-	if (!vendor_ie)
-		return false;
-
-	sme_debug("AP supports sae single pmk feature");
-
-	return true;
-}
-
-/**
- * csr_check_and_set_sae_single_pmk_cap() - check if the Roamed AP support
- * roaming using single pmk
- * with same pmk or not
- * @mac_ctx: mac context
- * @session: Session
- * @vdev_id: session id
- *
- * Return: True if same pmk IE is present
- */
-static void
-csr_check_and_set_sae_single_pmk_cap(struct mac_context *mac_ctx,
-				     struct csr_roam_session *session,
-				     uint8_t vdev_id)
-{
-	struct wlan_objmgr_vdev *vdev;
-	struct mlme_pmk_info *pmk_info;
-	tPmkidCacheInfo *pmkid_cache;
-	int32_t keymgmt;
-	bool val, lookup_success;
-
-	vdev = wlan_objmgr_get_vdev_by_id_from_psoc(mac_ctx->psoc, vdev_id,
-						    WLAN_LEGACY_SME_ID);
-	if (!vdev) {
-		mlme_err("get vdev failed");
-		return;
-	}
-
-	keymgmt = wlan_crypto_get_param(vdev, WLAN_CRYPTO_PARAM_KEY_MGMT);
-	if (keymgmt < 0) {
-		mlme_err("Invalid mgmt cipher");
-		wlan_objmgr_vdev_release_ref(vdev, WLAN_LEGACY_SME_ID);
-		return;
-	}
-
-	if (keymgmt & (1 << WLAN_CRYPTO_KEY_MGMT_SAE)) {
-		val = csr_is_sae_single_pmk_vsie_ap(session->pConnectBssDesc);
-		wlan_mlme_set_sae_single_pmk_bss_cap(mac_ctx->psoc, vdev_id,
-						     val);
-		if (!val)
-			goto end;
-
-		wlan_crypto_set_sae_single_pmk_bss_cap(vdev,
-		   (struct qdf_mac_addr *)session->pConnectBssDesc->bssId,
-		   true);
-
-		pmkid_cache = qdf_mem_malloc(sizeof(*pmkid_cache));
-		if (!pmkid_cache)
-			goto end;
-
-		qdf_copy_macaddr(&pmkid_cache->BSSID,
-				 &session->connectedProfile.bssid);
-		/*
-		 * In SAE single pmk roaming case, there will
-		 * be no PMK entry found for the AP in pmk cache.
-		 * So if the lookup is successful, then we have done
-		 * a FULL sae here. In that case, clear all other
-		 * single pmk entries.
-		 */
-		lookup_success = csr_lookup_pmkid_using_bssid(mac_ctx, session,
-							      pmkid_cache);
-		if (lookup_success) {
-			wlan_crypto_selective_clear_sae_single_pmk_entries(vdev,
-					&session->connectedProfile.bssid);
-
-			pmk_info = qdf_mem_malloc(sizeof(*pmk_info));
-			if (!pmk_info) {
-				qdf_mem_zero(pmkid_cache, sizeof(*pmkid_cache));
-				qdf_mem_free(pmkid_cache);
-				goto end;
-			}
-
-			qdf_mem_copy(pmk_info->pmk, pmkid_cache->pmk,
-				     pmkid_cache->pmk_len);
-			pmk_info->pmk_len = pmkid_cache->pmk_len;
-			pmk_info->spmk_timestamp = pmkid_cache->pmk_ts;
-			pmk_info->spmk_timeout_period  =
-				(pmkid_cache->pmk_lifetime *
-				 pmkid_cache->pmk_lifetime_threshold / 100);
-
-			wlan_mlme_update_sae_single_pmk(vdev, pmk_info);
-
-			qdf_mem_zero(pmk_info, sizeof(*pmk_info));
-			qdf_mem_free(pmk_info);
-		}
-
-		qdf_mem_zero(pmkid_cache, sizeof(*pmkid_cache));
-		qdf_mem_free(pmkid_cache);
-	}
-
-end:
-	wlan_objmgr_vdev_release_ref(vdev, WLAN_LEGACY_SME_ID);
-}
-#else
-static inline void
-csr_check_and_set_sae_single_pmk_cap(struct mac_context *mac_ctx,
-				     struct csr_roam_session *session,
-				     uint8_t vdev_id)
-{
-}
-#endif
-
-#define IS_ROAM_REASON_STA_KICKOUT(reason) ((reason & 0xF) == \
-	WMI_ROAM_TRIGGER_REASON_STA_KICKOUT)
-#define IS_ROAM_REASON_DISCONNECTION(reason) ((reason & 0xF) == \
-	WMI_ROAM_TRIGGER_REASON_DEAUTH)
-
-/**
- * csr_roam_update_wait_for_key_timer_info() - API to update timer info
- * @mac_ctx: MAC Context
- * @vdev_id: Session on which the timer should be operated
- *
- * API to update wait_for_key timer information
- *
- * Return: None
- */
-static QDF_STATUS
-csr_roam_update_wait_for_key_timer_info(struct mac_context *mac_ctx,
-					uint8_t vdev_id)
-{
-	struct wlan_objmgr_vdev *vdev;
-
-	csr_roam_substate_change(mac_ctx, eCSR_ROAM_SUBSTATE_WAIT_FOR_KEY,
-				 vdev_id);
-
-	vdev = wlan_objmgr_get_vdev_by_id_from_psoc(mac_ctx->psoc, vdev_id,
-						    WLAN_LEGACY_SME_ID);
-	if (!vdev) {
-		sme_err("Vdev obj is NULL for vdev id %d", vdev_id);
-		return QDF_STATUS_E_INVAL;
-	}
-	if (!QDF_IS_STATUS_SUCCESS(cm_start_wait_for_key_timer(vdev,
-				   CSR_WAIT_FOR_KEY_TIMEOUT_PERIOD))) {
-		sme_err("Failed wait for key timer start");
-		csr_roam_substate_change(mac_ctx, eCSR_ROAM_SUBSTATE_NONE,
-					 vdev_id);
-	}
-	wlan_objmgr_vdev_release_ref(vdev, WLAN_LEGACY_SME_ID);
-
-	return QDF_STATUS_SUCCESS;
-}
-
 static QDF_STATUS
 csr_process_roam_sync_callback(struct mac_context *mac_ctx,
 			       struct roam_offload_synch_ind *roam_synch_data,
@@ -17153,17 +16810,21 @@ csr_process_roam_sync_callback(struct mac_context *mac_ctx,
 	sme_QosAssocInfo assoc_info;
 	struct bss_params *add_bss_params;
 	QDF_STATUS status = QDF_STATUS_SUCCESS;
-	tPmkidCacheInfo *pmkid_cache;
 	uint16_t len;
 	struct wlan_objmgr_vdev *vdev;
 	struct mlme_roam_after_data_stall *vdev_roam_params;
 	bool abort_host_scan_cap = false;
 	wlan_scan_id scan_id;
-	struct wlan_crypto_pmksa *pmksa;
 	uint8_t ssid_offset;
-	enum csr_akm_type akm_type;
 	uint8_t mdie_present;
 	struct cm_roam_values_copy config;
+	struct wlan_mlme_psoc_ext_obj *mlme_obj;
+
+	mlme_obj = mlme_get_psoc_ext_obj(mac_ctx->psoc);
+	if (!mlme_obj) {
+		sme_err("mlme_obj is NULL, aborting roam invoke");
+		return QDF_STATUS_E_NULL_VALUE;
+	}
 
 	vdev = wlan_objmgr_get_vdev_by_id_from_psoc(mac_ctx->psoc, session_id,
 						    WLAN_LEGACY_SME_ID);
@@ -17353,8 +17014,7 @@ csr_process_roam_sync_callback(struct mac_context *mac_ctx,
 			mac_ctx->psoc);
 		mac_ctx->sme.set_connection_info_cb(false);
 
-		csr_check_and_set_sae_single_pmk_cap(mac_ctx, session,
-						     session_id);
+		cm_check_and_set_sae_single_pmk_cap(mac_ctx->psoc, session_id);
 
 		if (ucfg_pkt_capture_get_pktcap_mode(mac_ctx->psoc))
 			ucfg_pkt_capture_record_channel(vdev);
@@ -17434,32 +17094,33 @@ csr_process_roam_sync_callback(struct mac_context *mac_ctx,
 
 	/* This is temp ifdef will be removed in near future */
 #ifndef FEATURE_CM_ENABLE
-	/* Remove old BSSID mlme info from scan cache */
+	/* use API similar to cm_update_scan_mlme_on_disconnect for CM */
 	csr_update_scan_entry_associnfo(mac_ctx, session,
 					SCAN_ENTRY_CON_STATE_NONE);
+	/* use cm_inform_bcn_probe for connection manager */
+	csr_rso_save_ap_to_scan_cache(mac_ctx, roam_synch_data, bss_desc);
 #endif
+	/* For CM fill struct cm_vdev_join_rsp and struct wlan_cm_connect_resp
+	 * instead of roam info */
 	roam_info = qdf_mem_malloc(sizeof(struct csr_roam_info));
 	if (!roam_info) {
 		qdf_mem_free(ies_local);
 		status = QDF_STATUS_E_NOMEM;
 		goto end;
 	}
-	csr_rso_save_ap_to_scan_cache(mac_ctx, roam_synch_data, bss_desc);
 	roam_info->sessionId = session_id;
 
 	qdf_mem_copy(&roam_info->bssid.bytes, &bss_desc->bssId,
 			sizeof(struct qdf_mac_addr));
+	/* This is temp ifdef will be removed in near future */
+#ifndef FEATURE_CM_ENABLE
+	/* for CM hande same way as cm_csr_connect_rsp and
+	 * cm_csr_connect_done_ind */
 	csr_roam_save_connected_information(mac_ctx, session_id,
 			session->pCurRoamProfile,
 			bss_desc,
 			ies_local);
-	/*
-	 * use csr_fill_connected_profile instead of
-	 * csr_roam_save_connected_information
-	 */
-	/* This is temp ifdef will be removed in near future */
-#ifndef FEATURE_CM_ENABLE
-	/* Add new mlme info to new BSSID after upting connectedProfile */
+	/* For CM handle similar to cm_connect_complete to update */
 	csr_update_scan_entry_associnfo(mac_ctx, session,
 					SCAN_ENTRY_CON_STATE_ASSOC);
 #endif
@@ -17491,13 +17152,16 @@ csr_process_roam_sync_callback(struct mac_context *mac_ctx,
 	 * eapol. So the session->psk_pmk will be stale in PMKSA cached
 	 * SAE/OWE roaming case.
 	 */
+
+	/* for CM handle this similar to cm_connect_complete_ind */
 	if (roam_synch_data->authStatus == ROAM_AUTH_STATUS_AUTHENTICATED ||
 	    session->pCurRoamProfile->negotiatedAuthType ==
 	    eCSR_AUTH_TYPE_SAE ||
 	    session->pCurRoamProfile->negotiatedAuthType ==
 	    eCSR_AUTH_TYPE_OWE) {
-		csr_roam_substate_change(mac_ctx,
-				eCSR_ROAM_SUBSTATE_NONE, session_id);
+		struct wlan_crypto_pmksa *pmkid_cache;
+
+		cm_csr_set_ss_none(session_id);
 		/*
 		 * If authStatus is AUTHENTICATED, then we have done successful
 		 * 4 way handshake in FW using the cached PMKID.
@@ -17515,28 +17179,26 @@ csr_process_roam_sync_callback(struct mac_context *mac_ctx,
 			status = QDF_STATUS_E_NOMEM;
 			goto end;
 		}
-
-		qdf_copy_macaddr(&pmkid_cache->BSSID,
-				 &session->connectedProfile.bssid);
+		wlan_vdev_get_bss_peer_mac(vdev, &pmkid_cache->bssid);
 		sme_debug("Trying to find PMKID for " QDF_MAC_ADDR_FMT " AKM Type:%d",
-			  QDF_MAC_ADDR_REF(pmkid_cache->BSSID.bytes),
-			  session->pCurRoamProfile->negotiatedAuthType);
-		akm_type = session->connectedProfile.AuthType;
+			  QDF_MAC_ADDR_REF(pmkid_cache->bssid.bytes),
+			  session->pCurRoamProfile->negotiatedAuthType);;
 		wlan_cm_roam_cfg_get_value(mac_ctx->psoc, session_id,
 					   MOBILITY_DOMAIN, &config);
 		mdie_present = config.bool_value;
 
-		if (csr_lookup_pmkid_using_bssid(mac_ctx, session,
+		if (cm_lookup_pmkid_using_bssid(mac_ctx->psoc,
+						 session->vdev_id,
 						 pmkid_cache)) {
 			wlan_cm_set_psk_pmk(mac_ctx->pdev, session_id,
 					    pmkid_cache->pmk,
 					    pmkid_cache->pmk_len);
 			sme_debug("pmkid found for " QDF_MAC_ADDR_FMT " len %d",
-				  QDF_MAC_ADDR_REF(pmkid_cache->BSSID.bytes),
+				  QDF_MAC_ADDR_REF(pmkid_cache->bssid.bytes),
 				  pmkid_cache->pmk_len);
 		} else {
 			sme_debug("PMKID Not found in cache for " QDF_MAC_ADDR_FMT,
-				  QDF_MAC_ADDR_REF(pmkid_cache->BSSID.bytes));
+				  QDF_MAC_ADDR_REF(pmkid_cache->bssid.bytes));
 			/*
 			 * In FT roam when the CSR lookup fails then the PMK
 			 * details from the roam sync indication will be
@@ -17545,37 +17207,32 @@ csr_process_roam_sync_callback(struct mac_context *mac_ctx,
 			 * So do not add the PMKSA cache entry in all the
 			 * FT-Roam cases.
 			 */
-			if (!csr_is_auth_type11r(mac_ctx, akm_type,
+			if (!cm_is_auth_type_11r(mlme_obj, vdev,
 						 mdie_present) &&
 			    roam_synch_data->pmk_len) {
-				pmksa = qdf_mem_malloc(sizeof(*pmksa));
-				if (!pmksa) {
-					status = QDF_STATUS_E_NOMEM;
-					goto end;
-				}
+				qdf_mem_zero(pmkid_cache, sizeof(*pmkid_cache));
 				wlan_cm_set_psk_pmk(mac_ctx->pdev, session_id,
 						    roam_synch_data->pmk,
 						    roam_synch_data->pmk_len);
-				qdf_copy_macaddr(&pmksa->bssid,
-					&session->connectedProfile.bssid);
-				qdf_mem_copy(pmksa->pmkid,
+				wlan_vdev_get_bss_peer_mac(vdev,
+							   &pmkid_cache->bssid);
+				qdf_mem_copy(pmkid_cache->pmkid,
 					     roam_synch_data->pmkid, PMKID_LEN);
-				qdf_mem_copy(pmksa->pmk, roam_synch_data->pmk,
+				qdf_mem_copy(pmkid_cache->pmk,
+					     roam_synch_data->pmk,
 					     roam_synch_data->pmk_len);
-				pmksa->pmk_len = roam_synch_data->pmk_len;
+				pmkid_cache->pmk_len = roam_synch_data->pmk_len;
 
-				if (wlan_crypto_set_del_pmksa(vdev, pmksa, true)
-					!= QDF_STATUS_SUCCESS) {
-					qdf_mem_zero(pmksa, sizeof(*pmksa));
-					qdf_mem_free(pmksa);
-				}
+				wlan_crypto_set_del_pmksa(vdev, pmkid_cache,
+							  true);
 			}
 		}
-		qdf_mem_zero(pmkid_cache, sizeof(pmkid_cache));
+		qdf_mem_zero(pmkid_cache, sizeof(*pmkid_cache));
 		qdf_mem_free(pmkid_cache);
 	} else {
 		roam_info->fAuthRequired = true;
-		csr_roam_update_wait_for_key_timer_info(mac_ctx, session_id);
+		cm_update_wait_for_key_timer(vdev, session_id,
+					     WAIT_FOR_KEY_TIMEOUT_PERIOD);
 		/* This is temp ifdef will be removed in near future */
 #ifndef FEATURE_CM_ENABLE
 		csr_neighbor_roam_state_transition(mac_ctx,
@@ -17665,6 +17322,8 @@ csr_process_roam_sync_callback(struct mac_context *mac_ctx,
 	mac_ctx->roam.roamSession[session_id].connectState =
 		eCSR_ASSOC_STATE_TYPE_NOT_CONNECTED;
 #endif
+	/* for CM move all this sme qos API to cm_csr * API as in
+	 * cm_csr_connect_rsp */
 	sme_qos_csr_event_ind(mac_ctx, session_id,
 		SME_QOS_CSR_HANDOFF_ASSOC_REQ, NULL);
 	sme_qos_csr_event_ind(mac_ctx, session_id,
@@ -17676,6 +17335,8 @@ csr_process_roam_sync_callback(struct mac_context *mac_ctx,
 	mac_ctx->roam.roamSession[session_id].connectState =
 		eCSR_ASSOC_STATE_TYPE_INFRA_ASSOCIATED;
 #endif
+	/* for CM move all this sme qos API to cm_csr * API as in
+	 * cm_csr_connect_rsp */
 	sme_qos_csr_event_ind(mac_ctx, session_id,
 		SME_QOS_CSR_REASSOC_COMPLETE, &assoc_info);
 	roam_info->bss_desc = bss_desc;
@@ -17716,6 +17377,7 @@ csr_process_roam_sync_callback(struct mac_context *mac_ctx,
 	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
+	/* for CM fill fils info in struct wlan_cm_connect_resp */
 	csr_update_fils_erp_seq_num(session->pCurRoamProfile,
 				    roam_info->next_erp_seq_num);
 #endif
@@ -17737,17 +17399,21 @@ csr_process_roam_sync_callback(struct mac_context *mac_ctx,
 	sme_debug("Update roam reason : %d", roam_info->roam_reason);
 	/* for cm enable copy to reassoc/connect resp */
 #ifndef FEATURE_CM_ENABLE
+	/* for CM fill fils info in struct wlan_cm_connect_resp */
 	csr_copy_fils_join_rsp_roam_info(roam_info, roam_synch_data);
 #endif
 	csr_roam_call_callback(mac_ctx, session_id, roam_info, 0,
 		eCSR_ROAM_ASSOCIATION_COMPLETION, eCSR_ROAM_RESULT_ASSOCIATED);
 
+	/* for CM move all this sme qos API to cm_csr * API as in
+	 * cm_csr_connect_rsp */
 	if (IS_ROAM_REASON_DISCONNECTION(roam_synch_data->roamReason))
 		sme_qos_csr_event_ind(mac_ctx, session_id,
 				      SME_QOS_CSR_DISCONNECT_ROAM_COMPLETE,
 				      NULL);
 	/* for cm enable copy to reassoc/connect resp */
 #ifndef FEATURE_CM_ENABLE
+	/* for CM move hanlde all roam specific handling in new func */
 	if (!CSR_IS_WAIT_FOR_KEY(mac_ctx, session_id)) {
 		QDF_TRACE(QDF_MODULE_ID_SME,
 				QDF_TRACE_LEVEL_DEBUG,

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

@@ -321,6 +321,7 @@ QDF_STATUS csr_scan_result_purge(struct mac_context *mac,
 	return status;
 }
 
+#ifndef FEATURE_CM_ENABLE
 /* Put the BSS into the scan result list */
 /* pIes can not be NULL */
 static void csr_scan_add_result(struct mac_context *mac_ctx,
@@ -418,7 +419,7 @@ bool csr_scan_append_bss_description(struct mac_context *mac,
 {
 	return csr_scan_save_bss_description(mac, pSirBssDescription);
 }
-
+#endif
 static void csr_purge_channel_power(struct mac_context *mac,
 				    tDblLinkList *pChannelList)
 {
@@ -1416,7 +1417,6 @@ bool csr_roam_is_valid_channel(struct mac_context *mac, uint32_t ch_freq)
 	}
 	return fValid;
 }
-#endif
 
 QDF_STATUS csr_scan_create_entry_in_scan_cache(struct mac_context *mac,
 					       uint32_t sessionId,
@@ -1464,6 +1464,7 @@ free_mem:
 
 	return status;
 }
+#endif
 
 #ifdef FEATURE_WLAN_ESE
 /*  Update the TSF with the difference in system time */
@@ -1478,6 +1479,7 @@ void update_cckmtsf(uint32_t *timeStamp0, uint32_t *timeStamp1,
 }
 #endif
 
+#ifndef FEATURE_CM_ENABLE
 #ifdef WLAN_FEATURE_ROAM_OFFLOAD
 QDF_STATUS
 csr_rso_save_ap_to_scan_cache(struct mac_context *mac,
@@ -1505,6 +1507,7 @@ csr_rso_save_ap_to_scan_cache(struct mac_context *mac,
 	return QDF_STATUS_SUCCESS;
 }
 #endif
+#endif
 
 /**
  * csr_get_fst_bssdescr_ptr() - This function returns the pointer to first bss

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

@@ -158,11 +158,11 @@ void csr_roam_stop(struct mac_context *mac, uint32_t sessionId);
 QDF_STATUS csr_scan_open(struct mac_context *mac);
 QDF_STATUS csr_scan_close(struct mac_context *mac);
 
+#ifndef FEATURE_CM_ENABLE
 bool
 csr_scan_append_bss_description(struct mac_context *mac,
 				struct bss_description *pSirBssDescription);
 
-#ifndef FEATURE_CM_ENABLE
 QDF_STATUS csr_scan_for_ssid(struct mac_context *mac, uint32_t sessionId,
 			     struct csr_roam_profile *pProfile, uint32_t roamId,
 			     bool notify);
@@ -811,25 +811,15 @@ QDF_STATUS csr_roam_enqueue_preauth(struct mac_context *mac, uint32_t sessionId,
 QDF_STATUS csr_dequeue_roam_command(struct mac_context *mac,
 				enum csr_roam_reason reason,
 				uint8_t session_id);
-#endif
 
 QDF_STATUS csr_scan_create_entry_in_scan_cache(struct mac_context *mac,
 						uint32_t sessionId,
 						struct qdf_mac_addr bssid,
 						uint32_t ch_freq);
+#endif
 
 QDF_STATUS csr_update_channel_list(struct mac_context *mac);
 
-/**
- * csr_update_pmk_cache_ft - API to update MDID in PMKSA cache entry
- * @session_id: session ID
- * @session: sme session pointer
- *
- * Return: None
- */
-void csr_update_pmk_cache_ft(struct mac_context *mac, uint32_t session_id,
-			     struct csr_roam_session *session);
-
 #if defined(WLAN_SAE_SINGLE_PMK) && defined(WLAN_FEATURE_ROAM_OFFLOAD)
 /**
  * csr_clear_sae_single_pmk - API to clear single_pmk_info cache
@@ -841,22 +831,12 @@ void csr_update_pmk_cache_ft(struct mac_context *mac, uint32_t session_id,
  */
 void csr_clear_sae_single_pmk(struct wlan_objmgr_psoc *psoc,
 			      uint8_t vdev_id, tPmkidCacheInfo *pmksa);
-
-void csr_store_sae_single_pmk_to_global_cache(struct mac_context *mac,
-					      struct csr_roam_session *session,
-					      uint8_t vdev_id);
 #else
 static inline void
 csr_clear_sae_single_pmk(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id,
 			 tPmkidCacheInfo *pmksa)
 {
 }
-
-static inline
-void csr_store_sae_single_pmk_to_global_cache(struct mac_context *mac,
-					      struct csr_roam_session *session,
-					      uint8_t vdev_id)
-{}
 #endif
 
 QDF_STATUS csr_send_ext_change_freq(struct mac_context *mac_ctx,
@@ -941,18 +921,6 @@ csr_roam_set_bss_config_cfg(struct mac_context *mac_ctx, uint32_t session_id,
 void csr_prune_channel_list_for_mode(struct mac_context *mac,
 				     struct csr_channel *pChannelList);
 
-/**
- * csr_lookup_pmkid_using_bssid() - lookup pmkid using bssid
- * @mac: pointer to mac
- * @session: sme session pointer
- * @pmk_cache: pointer to pmk cache
- *
- * Return: true if pmkid is found else false
- */
-bool csr_lookup_pmkid_using_bssid(struct mac_context *mac,
-					struct csr_roam_session *session,
-					tPmkidCacheInfo *pmk_cache);
-
 #ifndef FEATURE_CM_ENABLE
 
 /**

+ 1 - 52
core/sme/src/csr/csr_neighbor_roam.c

@@ -426,30 +426,14 @@ static void csr_neighbor_roam_info_ctx_init(struct mac_context *mac,
 {
 	tpCsrNeighborRoamControlInfo ngbr_roam_info =
 		&mac->roam.neighborRoamInfo[session_id];
-	struct cm_roam_values_copy src_cfg;
 	struct csr_roam_session *session = &mac->roam.roamSession[session_id];
 	int init_ft_flag = false;
-	bool mdie_present;
 
-	wlan_cm_init_occupied_ch_freq_list(mac->pdev, mac->psoc, session_id);
 	csr_neighbor_roam_state_transition(mac,
 			eCSR_NEIGHBOR_ROAM_STATE_CONNECTED, session_id);
-
 	qdf_copy_macaddr(&ngbr_roam_info->currAPbssid,
 			&session->connectedProfile.bssid);
-	/*
-	 * Update RSSI change params to vdev
-	 */
-	src_cfg.uint_value = mac->mlme_cfg->lfr.roam_rescan_rssi_diff;
-	wlan_cm_roam_cfg_set_value(mac->psoc, session_id,
-				   RSSI_CHANGE_THRESHOLD, &src_cfg);
-
-	src_cfg.uint_value = mac->mlme_cfg->lfr.roam_scan_hi_rssi_delay;
-	wlan_cm_roam_cfg_set_value(mac->psoc, session_id,
-				   HI_RSSI_DELAY_BTW_SCANS, &src_cfg);
-
-	wlan_cm_update_roam_scan_scheme_bitmap(mac->psoc, session_id,
-					       DEFAULT_ROAM_SCAN_SCHEME_BITMAP);
+	cm_roam_start_init_on_connect(mac->pdev, session_id);
 
 	/*
 	 * Now we can clear the preauthDone that
@@ -457,19 +441,6 @@ static void csr_neighbor_roam_info_ctx_init(struct mac_context *mac,
 	 */
 	csr_neighbor_roam_free_roamable_bss_list(mac,
 		&ngbr_roam_info->FTRoamInfo.preAuthDoneList);
-	wlan_cm_roam_cfg_get_value(mac->psoc, session_id,
-				   MOBILITY_DOMAIN, &src_cfg);
-	mdie_present = src_cfg.bool_value;
-	/* Based on the auth scheme tell if we are 11r */
-	if (csr_is_auth_type11r
-		(mac, session->connectedProfile.AuthType, mdie_present)) {
-		if (mac->mlme_cfg->lfr.fast_transition_enabled)
-			init_ft_flag = true;
-		src_cfg.bool_value = true;
-	} else
-		src_cfg.bool_value = false;
-	wlan_cm_roam_cfg_set_value(mac->psoc, session_id,
-				   IS_11R_CONNECTION, &src_cfg);
 #ifdef FEATURE_WLAN_ESE
 	/* Based on the auth scheme tell if we are 11r */
 	if (wlan_cm_get_ese_assoc(mac->pdev, session_id)) {
@@ -487,29 +458,7 @@ static void csr_neighbor_roam_info_ctx_init(struct mac_context *mac,
 		csr_neighbor_roam_purge_preauth_failed_list(mac);
 	}
 
-	if (!csr_roam_is_roam_offload_scan_enabled(mac))
-		return;
-	/*
-	 * Store the current PMK info of the AP
-	 * to the single pmk global cache if the BSS allows
-	 * single pmk roaming capable.
-	 */
-	csr_store_sae_single_pmk_to_global_cache(mac, session,
-						 session_id);
-
-	/*
-	 * If this is not a INFRA type BSS, then do not send the command
-	 * down to firmware.Do not send the START command for
-	 * other session connections.
-	 */
-	if (!csr_roam_is_sta_mode(mac, session_id))
-		return;
-
 	ngbr_roam_info->uOsRequestedHandoff = 0;
-	if (!MLME_IS_ROAM_SYNCH_IN_PROGRESS(mac->psoc, session_id))
-		wlan_cm_roam_state_change(mac->pdev, session_id,
-					  WLAN_ROAM_RSO_ENABLED,
-					  REASON_CTX_INIT);
 }
 
 /**

+ 5 - 73
core/sme/src/csr/csr_util.c

@@ -2075,44 +2075,6 @@ bool csr_is_profile_rsn(struct csr_roam_profile *pProfile)
 }
 #endif
 
-/**
- * csr_is_auth_type11r() - Check if Authentication type is 11R
- * @mac: pointer to mac context
- * @auth_type: The authentication type that is used to make the connection
- * @mdie_present: Is MDIE IE present
- *
- * Return: true if is 11R auth type, false otherwise
- */
-bool csr_is_auth_type11r(struct mac_context *mac, enum csr_akm_type auth_type,
-			 uint8_t mdie_present)
-{
-	switch (auth_type) {
-	case eCSR_AUTH_TYPE_OPEN_SYSTEM:
-		if (mdie_present &&
-		    mac->mlme_cfg->lfr.enable_ftopen)
-			return true;
-		break;
-	case eCSR_AUTH_TYPE_FT_RSN_PSK:
-	case eCSR_AUTH_TYPE_FT_RSN:
-	case eCSR_AUTH_TYPE_FT_SAE:
-	case eCSR_AUTH_TYPE_FT_SUITEB_EAP_SHA384:
-	case eCSR_AUTH_TYPE_FT_FILS_SHA256:
-	case eCSR_AUTH_TYPE_FT_FILS_SHA384:
-		return true;
-	default:
-		break;
-	}
-	return false;
-}
-
-/* Function to return true if the profile is 11r */
-bool csr_is_profile11r(struct mac_context *mac,
-			struct csr_roam_profile *pProfile)
-{
-	return csr_is_auth_type11r(mac, pProfile->negotiatedAuthType,
-				   pProfile->mdid.mdie_present);
-}
-
 bool csr_is_auth_type_ese(enum csr_akm_type AuthType)
 {
 	switch (AuthType) {
@@ -2174,21 +2136,22 @@ bool csr_is_pmkid_found_for_peer(struct mac_context *mac,
 {
 	uint32_t i;
 	uint8_t *session_pmkid;
-	tPmkidCacheInfo *pmkid_cache;
+	struct wlan_crypto_pmksa *pmkid_cache;
 
 	pmkid_cache = qdf_mem_malloc(sizeof(*pmkid_cache));
 	if (!pmkid_cache)
 		return false;
 
-	qdf_mem_copy(pmkid_cache->BSSID.bytes, peer_mac_addr,
+	qdf_mem_copy(pmkid_cache->bssid.bytes, peer_mac_addr,
 		     QDF_MAC_ADDR_SIZE);
 
-	if (!csr_lookup_pmkid_using_bssid(mac, session, pmkid_cache)) {
+	if (!cm_lookup_pmkid_using_bssid(mac->psoc, session->vdev_id,
+					 pmkid_cache)) {
 		qdf_mem_free(pmkid_cache);
 		return false;
 	}
 
-	session_pmkid = pmkid_cache->PMKID;
+	session_pmkid = pmkid_cache->pmkid;
 	for (i = 0; i < pmkid_count; i++) {
 		if (!qdf_mem_cmp(pmkid + (i * PMKID_LEN),
 				 session_pmkid, PMKID_LEN)) {
@@ -2203,37 +2166,6 @@ bool csr_is_pmkid_found_for_peer(struct mac_context *mac,
 	return false;
 }
 
-bool csr_lookup_pmkid_using_bssid(struct mac_context *mac,
-				  struct csr_roam_session *session,
-				  tPmkidCacheInfo *pmk_cache)
-{
-	struct wlan_crypto_pmksa *pmksa;
-	struct wlan_objmgr_vdev *vdev;
-
-	vdev = wlan_objmgr_get_vdev_by_id_from_psoc(mac->psoc, session->vdev_id,
-						    WLAN_LEGACY_SME_ID);
-	if (!vdev) {
-		sme_err("Invalid vdev");
-		return false;
-	}
-
-	pmksa = wlan_crypto_get_pmksa(vdev, &pmk_cache->BSSID);
-	if (!pmksa) {
-		wlan_objmgr_vdev_release_ref(vdev, WLAN_LEGACY_SME_ID);
-		return false;
-	}
-	qdf_mem_copy(pmk_cache->PMKID, pmksa->pmkid, sizeof(pmk_cache->PMKID));
-	qdf_mem_copy(pmk_cache->pmk, pmksa->pmk, pmksa->pmk_len);
-	pmk_cache->pmk_len = pmksa->pmk_len;
-	pmk_cache->pmk_lifetime = pmksa->pmk_lifetime;
-	pmk_cache->pmk_lifetime_threshold = pmksa->pmk_lifetime_threshold;
-	pmk_cache->pmk_ts = pmksa->pmk_entry_ts;
-
-	wlan_objmgr_vdev_release_ref(vdev, WLAN_LEGACY_SME_ID);
-
-	return true;
-}
-
 #ifndef FEATURE_CM_ENABLE
 bool csr_lookup_fils_pmkid(struct mac_context *mac,
 			   uint8_t vdev_id, uint8_t *cache_id,