浏览代码

qcacld-3.0: Remove unused params and functions

Remove unused params and functions due to connection manager.

Change-Id: Ie1fd0031abce0c97f82b221ed43f10609f6dac7a
CRs-Fixed: 2856577
gaurank kathpalia 4 年之前
父节点
当前提交
157bb417c2

+ 1 - 40
components/cmn_services/policy_mgr/inc/wlan_policy_mgr_api.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012-2020 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2012-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
@@ -472,22 +472,6 @@ uint32_t policy_mgr_get_connection_count(struct wlan_objmgr_psoc *psoc);
  */
 uint32_t policy_mgr_get_concurrency_mode(struct wlan_objmgr_psoc *psoc);
 
-/**
- * policy_mgr_search_and_check_for_session_conc() - Checks if
- * concurrecy is allowed
- * @psoc: PSOC object information
- * @session_id: Session id
- * @roam_profile: Pointer to the roam profile
- *
- * Searches and gets the channel number from the scan results and checks if
- * concurrency is allowed for the given session ID
- *
- * Return: Non zero channel frequency value if concurrency is allowed else  0
- */
-uint32_t policy_mgr_search_and_check_for_session_conc(
-		struct wlan_objmgr_psoc *psoc,
-		uint8_t session_id, void *roam_profile);
-
 /**
  * policy_mgr_is_chnl_in_diff_band() - to check that given channel
  * is in diff band from existing channel or not
@@ -1437,12 +1421,6 @@ struct policy_mgr_sme_cbacks {
 		enum policy_mgr_conn_update_reason reason,
 		uint32_t original_vdev_id);
 	QDF_STATUS (*sme_change_mcc_beacon_interval)(uint8_t session_id);
-	QDF_STATUS (*sme_get_ap_channel_from_scan)(
-		void *roam_profile,
-		void **scan_cache,
-		uint32_t *ch_freq, uint8_t vdev_id);
-	QDF_STATUS (*sme_scan_result_purge)(
-				void *scan_result);
 	QDF_STATUS (*sme_rso_start_cb)(
 		mac_handle_t mac_handle, uint8_t vdev_id,
 		uint8_t reason, enum wlan_cm_rso_control_requestor requestor);
@@ -1666,23 +1644,6 @@ void policy_mgr_soc_set_dual_mac_cfg_cb(struct wlan_objmgr_psoc *psoc,
 bool policy_mgr_map_concurrency_mode(enum QDF_OPMODE *old_mode,
 				     enum policy_mgr_con_mode *new_mode);
 
-/**
- * policy_mgr_get_channel_from_scan_result() - to get channel from scan result
- * @psoc: PSOC object information
- * @roam_profile: pointer to roam profile
- * @ch_freq: channel frequency to be filled
- * @vdev_id: vdev id
- *
- * This routine gets channel which most likely a candidate to which STA
- * will make connection.
- *
- * Return: QDF_STATUS
- */
-QDF_STATUS
-policy_mgr_get_channel_from_scan_result(struct wlan_objmgr_psoc *psoc,
-					void *roam_profile,
-					uint32_t *ch_freq, uint8_t vdev_id);
-
 /**
  * policy_mgr_mode_specific_num_open_sessions() - to get number of open sessions
  *                                                for a specific mode

+ 1 - 85
components/cmn_services/policy_mgr/src/wlan_policy_mgr_get_set_utils.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012-2020 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2012-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
@@ -2683,45 +2683,6 @@ uint32_t policy_mgr_get_concurrency_mode(struct wlan_objmgr_psoc *psoc)
 	return pm_ctx->concurrency_mode;
 }
 
-QDF_STATUS policy_mgr_get_channel_from_scan_result(
-		struct wlan_objmgr_psoc *psoc,
-		void *roam_profile, uint32_t *ch_freq, uint8_t vdev_id)
-{
-	QDF_STATUS status = QDF_STATUS_E_FAILURE;
-	void *scan_cache = NULL;
-	struct policy_mgr_psoc_priv_obj *pm_ctx;
-
-	pm_ctx = policy_mgr_get_context(psoc);
-	if (!pm_ctx) {
-		policy_mgr_err("Invalid context");
-		return QDF_STATUS_E_INVAL;
-	}
-
-	if (!roam_profile || !ch_freq) {
-		policy_mgr_err("Invalid input parameters");
-		return QDF_STATUS_E_INVAL;
-	}
-
-	if (pm_ctx->sme_cbacks.sme_get_ap_channel_from_scan) {
-		status = pm_ctx->sme_cbacks.sme_get_ap_channel_from_scan
-			(roam_profile, &scan_cache, ch_freq, vdev_id);
-		if (status != QDF_STATUS_SUCCESS) {
-			policy_mgr_err("Get AP channel failed");
-			return status;
-		}
-	} else {
-		policy_mgr_err("sme_get_ap_channel_from_scan_cache NULL");
-		return QDF_STATUS_E_FAILURE;
-	}
-
-	if (pm_ctx->sme_cbacks.sme_scan_result_purge)
-		status = pm_ctx->sme_cbacks.sme_scan_result_purge(scan_cache);
-	else
-		policy_mgr_err("sme_scan_result_purge NULL");
-
-	return status;
-}
-
 QDF_STATUS policy_mgr_set_user_cfg(struct wlan_objmgr_psoc *psoc,
 				struct policy_mgr_user_cfg *user_cfg)
 {
@@ -2748,51 +2709,6 @@ QDF_STATUS policy_mgr_set_user_cfg(struct wlan_objmgr_psoc *psoc,
 	return QDF_STATUS_SUCCESS;
 }
 
-uint32_t policy_mgr_search_and_check_for_session_conc(
-		struct wlan_objmgr_psoc *psoc,
-		uint8_t session_id,
-		void *roam_profile)
-{
-	uint32_t ch_freq = 0;
-	QDF_STATUS status;
-	enum policy_mgr_con_mode mode;
-	bool ret;
-	struct policy_mgr_psoc_priv_obj *pm_ctx;
-
-	pm_ctx = policy_mgr_get_context(psoc);
-	if (!pm_ctx) {
-		policy_mgr_err("Invalid Context");
-		return ch_freq;
-	}
-
-	if (pm_ctx->hdd_cbacks.get_mode_for_non_connected_vdev) {
-		mode = pm_ctx->hdd_cbacks.get_mode_for_non_connected_vdev(
-			psoc, session_id);
-		if (PM_MAX_NUM_OF_MODE == mode) {
-			policy_mgr_err("Invalid mode");
-			return ch_freq;
-		}
-	} else
-		return ch_freq;
-
-	status = policy_mgr_get_channel_from_scan_result(
-			psoc, roam_profile, &ch_freq, session_id);
-	if (QDF_STATUS_SUCCESS != status || ch_freq == 0) {
-		policy_mgr_err("status: %d ch_freq: %d", status, ch_freq);
-		return 0;
-	}
-
-	/* Take care of 160MHz and 80+80Mhz later */
-	ret = policy_mgr_allow_concurrency(psoc, mode, ch_freq,
-					   HW_MODE_20_MHZ);
-	if (false == ret) {
-		policy_mgr_err("Connection failed due to conc check fail");
-		return 0;
-	}
-
-	return ch_freq;
-}
-
 /**
  * policy_mgr_is_two_connection_mcc() - Check if MCC scenario
  * when there are two connections

+ 1 - 5
components/cmn_services/policy_mgr/src/wlan_policy_mgr_init_deinit.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012-2020 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2012-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
@@ -673,10 +673,6 @@ QDF_STATUS policy_mgr_register_sme_cb(struct wlan_objmgr_psoc *psoc,
 		sme_cbacks->sme_soc_set_dual_mac_config;
 	pm_ctx->sme_cbacks.sme_change_mcc_beacon_interval =
 		sme_cbacks->sme_change_mcc_beacon_interval;
-	pm_ctx->sme_cbacks.sme_get_ap_channel_from_scan =
-		sme_cbacks->sme_get_ap_channel_from_scan;
-	pm_ctx->sme_cbacks.sme_scan_result_purge =
-		sme_cbacks->sme_scan_result_purge;
 	pm_ctx->sme_cbacks.sme_rso_start_cb =
 		sme_cbacks->sme_rso_start_cb;
 	pm_ctx->sme_cbacks.sme_rso_stop_cb =

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

@@ -2931,7 +2931,6 @@ bool wlan_is_channel_present_in_list(qdf_freq_t *freq_lst,
 	return false;
 }
 
-
 #if defined(WLAN_FEATURE_HOST_ROAM) || defined(WLAN_FEATURE_ROAM_OFFLOAD)
 static
 const char *mlme_roam_state_to_string(enum roam_offload_state state)

+ 0 - 2
components/umac/mlme/connection_mgr/core/src/wlan_cm_vdev_api.h

@@ -93,7 +93,6 @@ struct cm_vdev_disconnect_rsp {
  * @connect_rsp: Connect response to be sent to CM
  * @ric_resp_ie: ric ie data
  * @tspec_ie: tspec ie
- * @supported_nss_1x1: if 1x1 is supported
  * @nss: used nss
  * @uapsd_mask: uapsd mask
  */
@@ -104,7 +103,6 @@ struct cm_vdev_join_rsp {
 #ifdef FEATURE_WLAN_ESE
 	struct element_info tspec_ie;
 #endif
-	bool supported_nss_1x1;
 	uint8_t nss;
 	uint8_t uapsd_mask;
 };

+ 23 - 0
components/umac/mlme/connection_mgr/dispatcher/inc/wlan_cm_roam_api.h

@@ -403,6 +403,29 @@ QDF_STATUS wlan_cm_rso_config_init(struct wlan_objmgr_vdev *vdev,
 void wlan_cm_rso_config_deinit(struct wlan_objmgr_vdev *vdev,
 			       struct rso_config *rso_cfg);
 
+/**
+ * wlan_cm_fill_crypto_filter_from_vdev() - fill scan filter crypto from vdev
+ * given vdev id
+ * @vdev: vdev
+ * @filter: filetr to fill
+ *
+ * Return: void
+ */
+void wlan_cm_fill_crypto_filter_from_vdev(struct wlan_objmgr_vdev *vdev,
+					  struct scan_filter *filter);
+
+/**
+ * wlan_cm_init_occupied_ch_freq_list  - init occupied chan freq list
+ * @pdev: pdev pointer
+ * @psoc: psoc
+ * @vdev_id: vdev_id of vdev for which init is required
+ *
+ * Return: void
+ */
+void wlan_cm_init_occupied_ch_freq_list(struct wlan_objmgr_pdev *pdev,
+					struct wlan_objmgr_psoc *psoc,
+					uint8_t vdev_id);
+
 #ifdef WLAN_FEATURE_FILS_SK
 /**
  * wlan_cm_get_fils_connection_info  - Copy fils connection information from

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

@@ -26,6 +26,10 @@
 #include "wlan_policy_mgr_api.h"
 #include <wmi_unified_priv.h>
 #include <../../core/src/wlan_cm_vdev_api.h>
+#include "wlan_crypto_global_api.h"
+
+/* Support for "Fast roaming" (i.e., ESE, LFR, or 802.11r.) */
+#define BG_SCAN_OCCUPIED_CHANNEL_LIST_LEN 15
 
 #if defined(WLAN_FEATURE_HOST_ROAM) || defined(WLAN_FEATURE_ROAM_OFFLOAD)
 QDF_STATUS
@@ -1071,6 +1075,222 @@ struct rso_config *wlan_cm_get_rso_config_fl(struct wlan_objmgr_vdev *vdev,
 }
 #endif
 
+void wlan_cm_fill_crypto_filter_from_vdev(struct wlan_objmgr_vdev *vdev,
+					  struct scan_filter *filter)
+{
+	struct rso_config *rso_cfg;
+
+	filter->authmodeset =
+		wlan_crypto_get_param(vdev, WLAN_CRYPTO_PARAM_AUTH_MODE);
+	filter->mcastcipherset =
+		wlan_crypto_get_param(vdev, WLAN_CRYPTO_PARAM_MCAST_CIPHER);
+	filter->ucastcipherset =
+		wlan_crypto_get_param(vdev, WLAN_CRYPTO_PARAM_UCAST_CIPHER);
+	filter->key_mgmt =
+		wlan_crypto_get_param(vdev, WLAN_CRYPTO_PARAM_KEY_MGMT);
+	filter->mgmtcipherset =
+		wlan_crypto_get_param(vdev, WLAN_CRYPTO_PARAM_MGMT_CIPHER);
+
+	rso_cfg = wlan_cm_get_rso_config(vdev);
+	if (!rso_cfg)
+		return;
+
+	if (rso_cfg->rsn_cap & WLAN_CRYPTO_RSN_CAP_MFP_REQUIRED)
+		filter->pmf_cap = WLAN_PMF_REQUIRED;
+	else if (rso_cfg->rsn_cap & WLAN_CRYPTO_RSN_CAP_MFP_ENABLED)
+		filter->pmf_cap = WLAN_PMF_CAPABLE;
+}
+
+static void cm_dump_occupied_chan_list(struct wlan_chan_list *occupied_ch)
+{
+	uint8_t idx;
+	uint32_t buff_len;
+	char *chan_buff;
+	uint32_t len = 0;
+
+	buff_len = (occupied_ch->num_chan * 5) + 1;
+	chan_buff = qdf_mem_malloc(buff_len);
+	if (!chan_buff)
+		return;
+
+	for (idx = 0; idx < occupied_ch->num_chan; idx++)
+		len += qdf_scnprintf(chan_buff + len, buff_len - len, " %d",
+				     occupied_ch->freq_list[idx]);
+
+	mlme_nofl_debug("Occupied chan list[%d]:%s",
+			occupied_ch->num_chan, chan_buff);
+
+	qdf_mem_free(chan_buff);
+}
+
+/**
+ * cm_should_add_to_occupied_channels() - validates bands of active_ch_freq and
+ * curr node freq before addition of curr node freq to occupied channels
+ *
+ * @active_ch_freq: active channel frequency
+ * @cur_node_chan_freq: curr channel frequency
+ * @dual_sta_roam_active: dual sta roam active
+ *
+ * Return: True if active_ch_freq and cur_node_chan_freq belongs to same
+ * bands else false
+ **/
+static bool cm_should_add_to_occupied_channels(qdf_freq_t active_ch_freq,
+					       qdf_freq_t cur_node_chan_freq,
+					       bool dual_sta_roam_active)
+{
+	/* all channels can be added if dual STA roam is not active */
+	if (!dual_sta_roam_active)
+		return true;
+
+	/* when dual STA roam is active, channels must be in the same band */
+	if (WLAN_REG_IS_24GHZ_CH_FREQ(active_ch_freq) &&
+	    WLAN_REG_IS_24GHZ_CH_FREQ(cur_node_chan_freq))
+		return true;
+
+	if (!WLAN_REG_IS_24GHZ_CH_FREQ(active_ch_freq) &&
+	    !WLAN_REG_IS_24GHZ_CH_FREQ(cur_node_chan_freq))
+		return true;
+
+	/* not in same band */
+	return false;
+}
+
+static QDF_STATUS cm_add_to_freq_list_front(qdf_freq_t *ch_freq_lst,
+					    int num_chan, qdf_freq_t chan_freq)
+{
+	int i = 0;
+
+	/* Check for NULL pointer */
+	if (!ch_freq_lst)
+		return QDF_STATUS_E_NULL_VALUE;
+
+	/* Make room for the addition.  (Start moving from the back.) */
+	for (i = num_chan; i > 0; i--)
+		ch_freq_lst[i] = ch_freq_lst[i - 1];
+
+	/* Now add the NEW channel...at the front */
+	ch_freq_lst[0] = chan_freq;
+
+	return QDF_STATUS_SUCCESS;
+}
+
+/* Add the channel to the occupied channels array */
+static void cm_add_to_occupied_channels(qdf_freq_t ch_freq,
+					struct rso_config *rso_cfg,
+					bool is_init_list)
+{
+	QDF_STATUS status;
+	uint8_t num_occupied_ch = rso_cfg->occupied_chan_lst.num_chan;
+	qdf_freq_t *occupied_ch_lst = rso_cfg->occupied_chan_lst.freq_list;
+
+	if (is_init_list)
+		rso_cfg->roam_candidate_count++;
+
+	if (wlan_is_channel_present_in_list(occupied_ch_lst,
+					    num_occupied_ch, ch_freq))
+		return;
+
+	status = cm_add_to_freq_list_front(occupied_ch_lst,
+					   num_occupied_ch, ch_freq);
+	if (QDF_IS_STATUS_SUCCESS(status)) {
+		rso_cfg->occupied_chan_lst.num_chan++;
+		if (rso_cfg->occupied_chan_lst.num_chan >
+		    BG_SCAN_OCCUPIED_CHANNEL_LIST_LEN)
+			rso_cfg->occupied_chan_lst.num_chan =
+				BG_SCAN_OCCUPIED_CHANNEL_LIST_LEN;
+	}
+}
+
+void wlan_cm_init_occupied_ch_freq_list(struct wlan_objmgr_pdev *pdev,
+					struct wlan_objmgr_psoc *psoc,
+					uint8_t vdev_id)
+{
+	qdf_list_t *list = NULL;
+	qdf_list_node_t *cur_lst = NULL;
+	qdf_list_node_t *next_lst = NULL;
+	struct scan_cache_node *cur_node = NULL;
+	struct scan_filter *filter;
+	bool dual_sta_roam_active;
+	struct wlan_objmgr_vdev *vdev;
+	QDF_STATUS status;
+	struct rso_config *rso_cfg;
+	struct rso_cfg_params *cfg_params;
+	struct wlan_ssid ssid;
+	qdf_freq_t op_freq, freq;
+
+	vdev = wlan_objmgr_get_vdev_by_id_from_pdev(pdev, vdev_id,
+						    WLAN_MLME_CM_ID);
+	if (!vdev) {
+		mlme_err("vdev object is NULL for vdev %d", vdev_id);
+		return;
+	}
+	rso_cfg = wlan_cm_get_rso_config(vdev);
+	if (!rso_cfg)
+		goto rel_vdev_ref;
+	op_freq = wlan_get_operation_chan_freq(vdev);
+	if (!op_freq) {
+		mlme_debug("failed to get op freq");
+		goto rel_vdev_ref;
+	}
+	status = wlan_vdev_mlme_get_ssid(vdev, ssid.ssid, &ssid.length);
+	if (QDF_IS_STATUS_ERROR(status)) {
+		mlme_err("failed to find SSID for vdev %d", vdev_id);
+		goto rel_vdev_ref;
+	}
+
+	cfg_params = &rso_cfg->cfg_param;
+
+	if (cfg_params->specific_chan_info.num_chan) {
+		/*
+		 * Ini file contains neighbor scan channel list, hence NO need
+		 * to build occupied channel list"
+		 */
+		mlme_debug("Ini contains neighbor scan ch list");
+		goto rel_vdev_ref;
+	}
+
+	filter = qdf_mem_malloc(sizeof(*filter));
+	if (!filter)
+		goto rel_vdev_ref;
+
+	wlan_cm_fill_crypto_filter_from_vdev(vdev, filter);
+	filter->num_of_ssid = 1;
+	qdf_mem_copy(&filter->ssid_list[0], &ssid, sizeof(ssid));
+
+	/* Empty occupied channels here */
+	rso_cfg->occupied_chan_lst.num_chan = 0;
+	rso_cfg->roam_candidate_count = 0;
+
+	cm_add_to_occupied_channels(op_freq, rso_cfg, true);
+	list = wlan_scan_get_result(pdev, filter);
+	qdf_mem_free(filter);
+	if (!list || (list && !qdf_list_size(list)))
+		goto err;
+
+	dual_sta_roam_active =
+			wlan_mlme_get_dual_sta_roaming_enabled(psoc);
+
+	qdf_list_peek_front(list, &cur_lst);
+	while (cur_lst) {
+		cur_node = qdf_container_of(cur_lst, struct scan_cache_node,
+					    node);
+		freq = cur_node->entry->channel.chan_freq;
+		if (cm_should_add_to_occupied_channels(op_freq, freq,
+						       dual_sta_roam_active))
+			cm_add_to_occupied_channels(freq, rso_cfg, true);
+
+		qdf_list_peek_next(list, cur_lst, &next_lst);
+		cur_lst = next_lst;
+		next_lst = NULL;
+	}
+err:
+	cm_dump_occupied_chan_list(&rso_cfg->occupied_chan_lst);
+	if (list)
+		wlan_scan_purge_results(list);
+rel_vdev_ref:
+	wlan_objmgr_vdev_release_ref(vdev, WLAN_MLME_CM_ID);
+}
+
 #ifdef WLAN_FEATURE_FILS_SK
 QDF_STATUS wlan_cm_update_mlme_fils_connection_info(
 		struct wlan_objmgr_psoc *psoc,

+ 0 - 134
core/hdd/src/wlan_hdd_cfg80211.c

@@ -6200,7 +6200,6 @@ static int __wlan_hdd_cfg80211_keymgmt_set_key(struct wiphy *wiphy,
 	struct hdd_adapter *hdd_adapter = WLAN_HDD_GET_PRIV_PTR(dev);
 	struct hdd_context *hdd_ctx;
 	int status;
-	struct pmkid_mode_bits pmkid_modes;
 	mac_handle_t mac_handle;
 
 	hdd_enter_dev(dev);
@@ -6226,12 +6225,7 @@ static int __wlan_hdd_cfg80211_keymgmt_set_key(struct wiphy *wiphy,
 	if (status)
 		return status;
 
-	hdd_get_pmkid_modes(hdd_ctx, &pmkid_modes);
-
 	mac_handle = hdd_ctx->mac_handle;
-	sme_update_roam_key_mgmt_offload_enabled(mac_handle,
-						 hdd_adapter->vdev_id,
-						 &pmkid_modes);
 	qdf_mem_zero(&local_pmk, SIR_ROAM_SCAN_PSK_SIZE);
 	qdf_mem_copy(local_pmk, data, data_len);
 	sme_roam_set_psk_pmk(mac_handle, hdd_adapter->vdev_id,
@@ -18599,124 +18593,6 @@ void hdd_select_cbmode(struct hdd_adapter *adapter, qdf_freq_t oper_freq,
 }
 
 #ifndef FEATURE_CM_ENABLE
-/**
- * wlan_hdd_handle_sap_sta_dfs_conc() - to handle SAP STA DFS conc
- * @adapter: STA adapter
- * @roam_profile: STA roam profile
- *
- * This routine will move SAP from dfs to non-dfs, if sta is coming up.
- *
- * Return: false if sta-sap conc is not allowed, else return true
- */
-static
-bool wlan_hdd_handle_sap_sta_dfs_conc(struct hdd_adapter *adapter,
-				      struct csr_roam_profile *roam_profile)
-{
-	struct hdd_context *hdd_ctx;
-	struct hdd_adapter *ap_adapter;
-	struct hdd_ap_ctx *hdd_ap_ctx;
-	struct hdd_hostapd_state *hostapd_state;
-	QDF_STATUS status;
-	uint32_t ch_freq = 0;
-
-	hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
-	if (!hdd_ctx)
-		return true;
-
-	ap_adapter = hdd_get_adapter(hdd_ctx, QDF_SAP_MODE);
-	/* probably no sap running, no handling required */
-	if (!ap_adapter)
-		return true;
-
-	/*
-	 * sap is not in started state, so it is fine to go ahead with sta.
-	 * if sap is currently doing CAC then don't allow sta to go further.
-	 */
-	if (!test_bit(SOFTAP_BSS_STARTED, &(ap_adapter)->event_flags) &&
-	    (hdd_ctx->dev_dfs_cac_status != DFS_CAC_IN_PROGRESS))
-		return true;
-
-	if (hdd_ctx->dev_dfs_cac_status == DFS_CAC_IN_PROGRESS) {
-		hdd_err("Concurrent SAP is in CAC state, STA is not allowed");
-		return false;
-	}
-
-	/*
-	 * log and return error, if we allow STA to go through, we don't
-	 * know what is going to happen better stop sta connection
-	 */
-	hdd_ap_ctx = WLAN_HDD_GET_AP_CTX_PTR(ap_adapter);
-	if (!hdd_ap_ctx) {
-		hdd_err("AP context not found");
-		return false;
-	}
-
-	/* sap is on non-dfs channel, nothing to handle */
-	if (!wlan_reg_is_dfs_for_freq(hdd_ctx->pdev,
-				      hdd_ap_ctx->operating_chan_freq)) {
-		hdd_debug("sap is on non-dfs channel, sta is allowed");
-		return true;
-	}
-	/*
-	 * find out by looking in to scan cache where sta is going to
-	 * connect by passing its roam_profile.
-	 */
-	status = policy_mgr_get_channel_from_scan_result(
-			hdd_ctx->psoc, roam_profile, &ch_freq,
-			adapter->vdev_id);
-
-	/*
-	 * If the STA's channel is 2.4 GHz, then set pcl with only 2.4 GHz
-	 * channels for roaming case.
-	 */
-	if (WLAN_REG_IS_24GHZ_CH_FREQ(ch_freq)) {
-		hdd_info("sap is on dfs, new sta conn on 2.4 is allowed");
-		return true;
-	}
-
-	/*
-	 * If channel is 0 or DFS or LTE unsafe then better to call pcl and
-	 * find out the best channel. If channel is non-dfs 5 GHz then
-	 * better move SAP to STA's channel to make scc, so we have room
-	 * for 3port MCC scenario.
-	 */
-	if (!ch_freq || wlan_reg_is_dfs_for_freq(hdd_ctx->pdev, ch_freq) ||
-	    !policy_mgr_is_safe_channel(hdd_ctx->psoc, ch_freq))
-		ch_freq = policy_mgr_get_nondfs_preferred_channel(
-			hdd_ctx->psoc, PM_SAP_MODE, true);
-
-	hostapd_state = WLAN_HDD_GET_HOSTAP_STATE_PTR(ap_adapter);
-	qdf_event_reset(&hostapd_state->qdf_event);
-	wlan_hdd_set_sap_csa_reason(hdd_ctx->psoc, ap_adapter->vdev_id,
-				    CSA_REASON_STA_CONNECT_DFS_TO_NON_DFS);
-
-	status = wlansap_set_channel_change_with_csa(
-			WLAN_HDD_GET_SAP_CTX_PTR(ap_adapter), ch_freq,
-			hdd_ap_ctx->sap_config.ch_width_orig, false);
-
-	if (QDF_STATUS_SUCCESS != status) {
-		hdd_err("Set channel with CSA IE failed, can't allow STA");
-		return false;
-	}
-
-	/*
-	 * wait here for SAP to finish the channel switch. When channel
-	 * switch happens, SAP sends few beacons with CSA_IE. After
-	 * successfully Transmission of those beacons, it will move its
-	 * state from started to disconnected and move to new channel.
-	 * once it moves to new channel, sap again moves its state
-	 * machine from disconnected to started and set this event.
-	 * wait for 10 secs to finish this.
-	 */
-	status = qdf_wait_for_event_completion(&hostapd_state->qdf_event, 10000);
-	if (!QDF_IS_STATUS_SUCCESS(status)) {
-		hdd_err("wait for qdf_event failed, STA not allowed!!");
-		return false;
-	}
-
-	return true;
-}
-
 #ifdef WLAN_FEATURE_11W
 /**
  * wlan_hdd_cfg80211_check_pmf_valid() - check if pmf status is ok
@@ -19012,16 +18888,6 @@ static int wlan_hdd_cfg80211_connect_start(struct hdd_adapter *adapter,
 						    oper_freq);
 		roam_profile->phyMode = csr_convert_from_reg_phy_mode(phy_mode);
 
-		if ((policy_mgr_is_hw_dbs_capable(hdd_ctx->psoc) == true)
-			&& (false == wlan_hdd_handle_sap_sta_dfs_conc(adapter,
-				roam_profile))) {
-			hdd_err("sap-sta conc will fail, can't allow sta");
-			hdd_conn_set_connection_state(adapter,
-					eConnectionState_NotConnected);
-			status = -ENOMEM;
-			goto conn_failure;
-		}
-
 		sme_config = qdf_mem_malloc(sizeof(*sme_config));
 		if (!sme_config) {
 			hdd_conn_set_connection_state(adapter,

+ 1 - 3
core/hdd/src/wlan_hdd_main.c

@@ -18391,9 +18391,7 @@ int hdd_get_rssi_snr_by_bssid(struct hdd_adapter *adapter, const uint8_t *bssid,
 
 	roam_profile = hdd_roam_profile(adapter);
 	mac_handle = hdd_adapter_get_mac_handle(adapter);
-	status = sme_get_rssi_snr_by_bssid(mac_handle,
-					   roam_profile, bssid, rssi, snr,
-					   adapter->vdev_id);
+	status = sme_get_rssi_snr_by_bssid(mac_handle, bssid, rssi, snr);
 	if (QDF_STATUS_SUCCESS != status) {
 		hdd_debug("sme_get_rssi_snr_by_bssid failed");
 		return -EINVAL;

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

@@ -972,7 +972,6 @@ struct join_rsp {
 #endif
 	uint8_t nss;
 	uint32_t max_rate_flags;
-	bool supported_nss_1x1;
 	tDot11fIEHTCaps ht_caps;
 	tDot11fIEVHTCaps vht_caps;
 	tDot11fIEHTInfo ht_operation;

+ 2 - 4
core/mac/src/pe/lim/lim_process_action_frame.c

@@ -1773,8 +1773,7 @@ void lim_process_action_frame(struct mac_context *mac_ctx,
 	case ACTION_CATEGORY_RRM:
 		/* Ignore RRM measurement request until DHCP is set */
 		if (mac_ctx->rrm.rrmPEContext.rrmEnable &&
-		    mac_ctx->roam.roamSession
-		    [session->smeSessionId].dhcp_done) {
+		    mac_ctx->roam.roamSession[session->smeSessionId].dhcp_done) {
 			switch (action_hdr->actionID) {
 			case RRM_RADIO_MEASURE_REQ:
 				__lim_process_radio_measure_request(mac_ctx,
@@ -1811,8 +1810,7 @@ void lim_process_action_frame(struct mac_context *mac_ctx,
 			/* Else we will just ignore the RRM messages. */
 			pe_debug("RRM frm ignored, it is disabled in cfg: %d or DHCP not completed: %d",
 			  mac_ctx->rrm.rrmPEContext.rrmEnable,
-			  mac_ctx->roam.roamSession
-			  [session->smeSessionId].dhcp_done);
+			  mac_ctx->roam.roamSession[session->smeSessionId].dhcp_done);
 		}
 		break;
 

+ 0 - 6
core/mac/src/pe/lim/lim_send_sme_rsp_messages.c

@@ -317,7 +317,6 @@ lim_cm_prepare_join_rsp_from_pe_session(struct mac_context *mac_ctx,
 		lim_copy_tspec_ie(pe_session, rsp);
 
 		lim_send_smps_intolerent(mac_ctx, pe_session, bcn_len, bcn_ptr);
-		rsp->supported_nss_1x1 = pe_session->supported_nss_1x1;
 		lim_cm_fill_rsp_from_stads(mac_ctx, pe_session, rsp);
 		rsp->uapsd_mask = pe_session->gUapsdPerAcBitmask;
 	}
@@ -862,11 +861,6 @@ void lim_send_sme_join_reassoc_rsp(struct mac_context *mac_ctx,
 		lim_handle_join_rsp_status(mac_ctx, session_entry, result_code,
 			sme_join_rsp);
 		sme_join_rsp->uapsd_mask = session_entry->gUapsdPerAcBitmask;
-		/* Send supported NSS 1x1 to SME */
-		sme_join_rsp->supported_nss_1x1 =
-			session_entry->supported_nss_1x1;
-		pe_debug("SME Join Rsp is supported NSS 1X1: %d",
-		       sme_join_rsp->supported_nss_1x1);
 	}
 
 	sme_join_rsp->messageType = msg_type;

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

@@ -1329,26 +1329,6 @@ QDF_STATUS csr_update_owe_info(struct mac_context *mac,
 
 typedef void (*csr_ani_callback)(int8_t *ani, void *context);
 
-#ifdef WLAN_FEATURE_11W
-/**
- * csr_update_pmf_cap_from_connected_profile() - Update pmf cap from profile
- * @mac: mac
- * @vdev_id: vdev id
- * @filter: scan filter
- *
- * Return: None
- */
-void
-csr_update_pmf_cap_from_connected_profile(struct mac_context *mac,
-					  uint8_t vdev_id,
-					  struct scan_filter *filter);
-#else
-void
-csr_update_pmf_cap_from_connected_profile(struct mac_context *mac,
-					  uint8_t vdev_id,
-					  struct scan_filter *filter);
-#endif
-
 /*
  * csr_convert_to_reg_phy_mode() - CSR API to convert CSR phymode into
  * regulatory phymode

+ 8 - 24
core/sme/inc/csr_internal.h

@@ -74,8 +74,6 @@
 	)
 #define CSR_IS_CHANNEL_24GHZ(chnNum) \
 	(((chnNum) > 0) && ((chnNum) <= 14))
-/* Support for "Fast roaming" (i.e., ESE, LFR, or 802.11r.) */
-#define CSR_BG_SCAN_OCCUPIED_CHANNEL_LIST_LEN 15
 
 /* Used to determine what to set to the MLME_DOT11_MODE */
 enum csr_cfgdot11mode {
@@ -540,7 +538,14 @@ struct csr_roam_session {
 	uint32_t nAddIEScanLength;      /* the byte count of pAddIeScanIE; */
 	/* contains the additional IE in (unicast) probe req at time of join */
 	uint8_t *pAddIEScan;
-#endif
+	/* This count represents the number of bssid's we try to join. */
+	uint8_t join_bssid_count;
+	enum wlan_reason_code disconnect_reason;
+	struct scan_cmd_info scan_info;
+	bool is_fils_connection;
+	uint16_t fils_seq_num;
+	bool discon_in_progress;
+#endif /* ndef FEATURE_CM_ENABLE */
 	struct csr_timer_info roamingTimerInfo;
 	enum csr_roaming_reason roamingReason;
 	bool fCancelRoaming;
@@ -561,8 +566,6 @@ struct csr_roam_session {
 	tCsrEseCckmInfo eseCckmInfo;
 	bool isPrevApInfoValid;
 	tSirMacSSid prevApSSID;
-	struct qdf_mac_addr prevApBssid;
-	uint16_t clientDissSecs;
 	uint32_t roamTS1;
 	tCsrEseCckmIe suppCckmIeInfo;
 #endif
@@ -571,30 +574,13 @@ struct csr_roam_session {
 	uint8_t psk_pmk[SIR_ROAM_SCAN_PSK_SIZE];
 	size_t pmk_len;
 	struct roam_offload_synch_ind *roam_synch_data;
-	struct pmkid_mode_bits pmkid_modes;
 #endif
 	tftSMEContext ftSmeContext;
-#ifndef FEATURE_CM_ENABLE
-	/* This count represents the number of bssid's we try to join. */
-	uint8_t join_bssid_count;
-#endif
-	struct csr_roam_stored_profile stored_roam_profile;
 	bool ch_switch_in_progress;
-	bool supported_nss_1x1;
-	uint8_t vdev_nss;
 	uint8_t nss;
 	bool dhcp_done;
-#ifndef FEATURE_CM_ENABLE
-	enum wlan_reason_code disconnect_reason;
-#endif
 	uint8_t uapsd_mask;
-	struct scan_cmd_info scan_info;
 	qdf_mc_timer_t roaming_offload_timer;
-#ifndef FEATURE_CM_ENABLE
-	bool is_fils_connection;
-	uint16_t fils_seq_num;
-#endif
-	bool discon_in_progress;
 	bool is_adaptive_11r_connection;
 	struct csr_disconnect_stats disconnect_stats;
 	qdf_mc_timer_t wait_for_key_timer;
@@ -928,8 +914,6 @@ QDF_STATUS csr_get_tsm_stats(struct mac_context *mac,
 bool csr_roam_is_fast_roam_enabled(struct mac_context *mac,  uint8_t vdev_id);
 bool csr_roam_is_roam_offload_scan_enabled(
 	struct mac_context *mac);
-QDF_STATUS csr_add_to_channel_list_front(uint32_t *pChannelList,
-					 int numChannels, uint32_t chan_freq);
 #if defined(WLAN_FEATURE_HOST_ROAM) || defined(WLAN_FEATURE_ROAM_OFFLOAD)
 QDF_STATUS csr_roam_offload_scan_rsp_hdlr(struct mac_context *mac,
 		struct roam_offload_scan_rsp *scanOffloadRsp);

+ 4 - 2
core/sme/inc/csr_neighbor_roam.h

@@ -285,6 +285,7 @@ csr_roam_auth_offload_callback(struct mac_context *mac_ctx,
 			       uint8_t vdev_id,
 			       struct qdf_mac_addr bssid);
 
+#ifndef FEATURE_CM_ENABLE
 /**
  * csr_fast_reassoc() - invokes FAST REASSOC command
  * @mac_handle: handle returned by mac_open
@@ -300,7 +301,7 @@ QDF_STATUS csr_fast_reassoc(mac_handle_t mac_handle,
 			    struct csr_roam_profile *profile,
 			    const tSirMacAddr bssid, uint32_t ch_freq,
 			    uint8_t vdev_id, const tSirMacAddr connected_bssid);
-
+#endif
 #ifdef WLAN_FEATURE_FIPS
 /**
  * csr_roam_pmkid_req_callback() - Registered CSR Callback function to handle
@@ -351,6 +352,7 @@ csr_roam_auth_offload_callback(struct mac_context *mac_ctx,
 	return QDF_STATUS_E_NOSUPPORT;
 }
 
+#ifndef FEATURE_CM_ENABLE
 static inline
 QDF_STATUS csr_fast_reassoc(mac_handle_t mac_handle,
 			    struct csr_roam_profile *profile,
@@ -359,7 +361,7 @@ QDF_STATUS csr_fast_reassoc(mac_handle_t mac_handle,
 {
 	return QDF_STATUS_SUCCESS;
 }
-
+#endif
 static inline QDF_STATUS
 csr_roam_pmkid_req_callback(uint8_t vdev_id,
 			    struct roam_pmkid_req_event *bss_list)

+ 5 - 29
core/sme/inc/sme_api.h

@@ -522,6 +522,7 @@ QDF_STATUS sme_scan_get_result(mac_handle_t mac_handle, uint8_t vdev_id,
 			       struct scan_filter *filter,
 			       tScanResultHandle *phResult);
 
+#ifndef FEATURE_CM_ENABLE
 /**
  * sme_get_ap_channel_from_scan_cache() - a wrapper function to get AP's channel
  * from CSR by filtering the result which matches our roam profile.
@@ -539,24 +540,7 @@ QDF_STATUS sme_get_ap_channel_from_scan_cache(struct csr_roam_profile *profile,
 					      tScanResultHandle *scan_cache,
 					      uint32_t *ap_ch_freq,
 					      uint8_t vdev_id);
-/**
- * sme_get_ap_channel_from_scan() - a wrapper function to get AP's channel id
- * from CSR by filtering the result which matches our roam profile.
- * @profile: SAP profile
- * @ap_ch_freq: pointer to channel id of SAP. Fill the value after finding the
- *              best ap from scan cache.
- * @vdev_id: vdev id
- *
- * This function is written to get AP's channel id from CSR by filtering
- * the result which matches our roam profile. This is a synchronous call.
- *
- * Return: QDF_STATUS.
- */
-QDF_STATUS sme_get_ap_channel_from_scan(void *profile,
-					tScanResultHandle *scan_cache,
-					uint32_t *ap_ch_freq,
-					uint8_t vdev_id);
-
+#endif
 tCsrScanResultInfo *sme_scan_result_get_first(mac_handle_t,
 		tScanResultHandle hScanResult);
 tCsrScanResultInfo *sme_scan_result_get_next(mac_handle_t,
@@ -1677,12 +1661,6 @@ sme_reset_link_layer_stats_ind_cb(mac_handle_t mac_handle)
 
 QDF_STATUS sme_set_wisa_params(mac_handle_t mac_handle,
 			       struct sir_wisa_params *wisa_params);
-#ifdef WLAN_FEATURE_ROAM_OFFLOAD
-QDF_STATUS
-sme_update_roam_key_mgmt_offload_enabled(mac_handle_t mac_handle,
-					 uint8_t session_id,
-					 struct pmkid_mode_bits *pmkid_modes);
-#endif
 QDF_STATUS sme_get_link_status(mac_handle_t mac_handle,
 			       csr_link_status_callback callback,
 			       void *context, uint8_t session_id);
@@ -2412,19 +2390,17 @@ void sme_set_chan_info_callback(mac_handle_t mac_handle,
 /**
  * sme_get_rssi_snr_by_bssid() - gets the rssi and snr by bssid from scan cache
  * @mac_handle: handle returned by mac_open
- * @profile: current connected profile
  * @bssid: bssid to look for in scan cache
  * @rssi: rssi value found
  * @snr: snr value found
- * @vdev_id: vdev id
  *
  * Return: QDF_STATUS
  */
 QDF_STATUS sme_get_rssi_snr_by_bssid(mac_handle_t mac_handle,
-				     struct csr_roam_profile *profile,
 				     const uint8_t *bssid, int8_t *rssi,
-				     int8_t *snr, uint8_t vdev_id);
+				     int8_t *snr);
 
+#ifndef FEATURE_CM_ENABLE
 /**
  * sme_get_beacon_frm() - gets the bss descriptor from scan cache and prepares
  * beacon frame
@@ -2443,7 +2419,7 @@ QDF_STATUS sme_get_beacon_frm(mac_handle_t mac_handle,
 			      const tSirMacAddr bssid,
 			      uint8_t **frame_buf, uint32_t *frame_len,
 			      uint32_t *ch_freq, uint8_t vdev_id);
-
+#endif
 #ifdef WLAN_FEATURE_ROAM_OFFLOAD
 /**
  * sme_fast_reassoc() - invokes FAST REASSOC command

+ 56 - 112
core/sme/src/common/sme_api.c

@@ -1275,9 +1275,6 @@ QDF_STATUS sme_start(mac_handle_t mac_handle)
 			sme_soc_set_dual_mac_config;
 		sme_cbacks.sme_change_mcc_beacon_interval =
 			sme_change_mcc_beacon_interval;
-		sme_cbacks.sme_get_ap_channel_from_scan =
-			sme_get_ap_channel_from_scan;
-		sme_cbacks.sme_scan_result_purge = sme_scan_result_purge;
 		sme_cbacks.sme_rso_start_cb = sme_start_roaming;
 		sme_cbacks.sme_rso_stop_cb = sme_stop_roaming;
 		status = policy_mgr_register_sme_cb(mac->psoc, &sme_cbacks);
@@ -2793,20 +2790,7 @@ QDF_STATUS sme_scan_get_result_for_bssid(mac_handle_t mac_handle,
 	return status;
 }
 
-QDF_STATUS sme_get_ap_channel_from_scan(void *profile,
-					tScanResultHandle *scan_cache,
-					uint32_t *ap_ch_freq,
-					uint8_t vdev_id)
-{
-	QDF_STATUS status;
-
-	status = sme_get_ap_channel_from_scan_cache((struct csr_roam_profile *)
-						  profile,
-						  scan_cache,
-						  ap_ch_freq, vdev_id);
-	return status;
-}
-
+#ifndef FEATURE_CM_ENABLE
 QDF_STATUS sme_get_ap_channel_from_scan_cache(
 	struct csr_roam_profile *profile, tScanResultHandle *scan_cache,
 	uint32_t *ap_ch_freq, uint8_t vdev_id)
@@ -2828,7 +2812,7 @@ QDF_STATUS sme_get_ap_channel_from_scan_cache(
 
 	qdf_mem_zero(&first_ap_profile, sizeof(struct bss_description));
 	if (!profile) {
-		csr_set_open_mode_in_scan_filter(scan_filter);
+		QDF_SET_PARAM(scan_filter->authmodeset, WLAN_CRYPTO_AUTH_OPEN);
 	} else {
 		/* Here is the profile we need to connect to */
 		status = csr_roam_get_scan_filter_from_profile(mac_ctx, profile,
@@ -2880,6 +2864,7 @@ QDF_STATUS sme_get_ap_channel_from_scan_cache(
 
 	return status;
 }
+#endif
 
 /*
  * sme_scan_result_get_first() -
@@ -10231,39 +10216,6 @@ QDF_STATUS sme_beacon_debug_stats_req(
 }
 #endif
 
-#ifdef WLAN_FEATURE_ROAM_OFFLOAD
-/**
- * sme_update_roam_key_mgmt_offload_enabled() - enable/disable key mgmt offload
- * This is a synchronous call
- * @mac_handle: The handle returned by mac_open.
- * @session_id: Session Identifier
- * @pmkid_modes: PMKID modes of PMKSA caching and OKC
- * Return: QDF_STATUS_SUCCESS - SME updated config successfully.
- * Other status means SME is failed to update.
- */
-
-QDF_STATUS sme_update_roam_key_mgmt_offload_enabled(mac_handle_t mac_handle,
-					uint8_t session_id,
-					struct pmkid_mode_bits *pmkid_modes)
-{
-	struct mac_context *mac_ctx = MAC_CONTEXT(mac_handle);
-	QDF_STATUS status = QDF_STATUS_SUCCESS;
-
-	status = sme_acquire_global_lock(&mac_ctx->sme);
-	if (QDF_IS_STATUS_SUCCESS(status)) {
-		if (CSR_IS_SESSION_VALID(mac_ctx, session_id)) {
-			status = csr_roam_set_key_mgmt_offload(mac_ctx,
-						session_id,
-						pmkid_modes);
-		} else
-			status = QDF_STATUS_E_INVAL;
-		sme_release_global_lock(&mac_ctx->sme);
-	}
-
-	return status;
-}
-#endif
-
 /**
  * sme_get_temperature() - SME API to get the pdev temperature
  * @mac_handle: Handle to global MAC context
@@ -13264,58 +13216,9 @@ QDF_STATUS sme_set_wow_pulse(struct wow_pulse_mode *wow_pulse_set_info)
 }
 #endif
 
-/**
- * sme_prepare_beacon_from_bss_descp() - prepares beacon frame by populating
- * different fields and IEs from bss descriptor.
- * @frame_buf: frame buffer to populate
- * @bss_descp: bss descriptor
- * @bssid: bssid of the beacon frame to populate
- * @ie_len: length of IE fields
- *
- * Return: None
- */
-static void sme_prepare_beacon_from_bss_descp(uint8_t *frame_buf,
-					      struct bss_description *bss_descp,
-					      const tSirMacAddr bssid,
-					      uint32_t ie_len)
-{
-	tDot11fBeacon1 *bcn_fixed;
-	tpSirMacMgmtHdr mac_hdr = (tpSirMacMgmtHdr)frame_buf;
-
-	/* populate mac header first to indicate beacon */
-	mac_hdr->fc.protVer = SIR_MAC_PROTOCOL_VERSION;
-	mac_hdr->fc.type = SIR_MAC_MGMT_FRAME;
-	mac_hdr->fc.subType = SIR_MAC_MGMT_BEACON;
-	qdf_mem_copy((uint8_t *) mac_hdr->da,
-		     (uint8_t *) "\xFF\xFF\xFF\xFF\xFF\xFF",
-		     sizeof(struct qdf_mac_addr));
-	qdf_mem_copy((uint8_t *) mac_hdr->sa, bssid,
-		     sizeof(struct qdf_mac_addr));
-	qdf_mem_copy((uint8_t *) mac_hdr->bssId, bssid,
-		     sizeof(struct qdf_mac_addr));
-
-	/* now populate fixed params */
-	bcn_fixed = (tDot11fBeacon1 *)(frame_buf + SIR_MAC_HDR_LEN_3A);
-	/* populate timestamp */
-	qdf_mem_copy(&bcn_fixed->TimeStamp.timestamp, &bss_descp->timeStamp,
-			sizeof(bss_descp->timeStamp));
-	/* populate beacon interval */
-	bcn_fixed->BeaconInterval.interval = bss_descp->beaconInterval;
-	/* populate capability */
-	qdf_mem_copy(&bcn_fixed->Capabilities, &bss_descp->capabilityInfo,
-			sizeof(bss_descp->capabilityInfo));
-
-	/* copy IEs now */
-	qdf_mem_copy(frame_buf + SIR_MAC_HDR_LEN_3A
-		     + SIR_MAC_B_PR_SSID_OFFSET,
-		     &bss_descp->ieFields, ie_len);
-}
-
 QDF_STATUS sme_get_rssi_snr_by_bssid(mac_handle_t mac_handle,
-				     struct csr_roam_profile *profile,
 				     const uint8_t *bssid,
-				     int8_t *rssi, int8_t *snr,
-				     uint8_t vdev_id)
+				     int8_t *rssi, int8_t *snr)
 {
 	struct bss_description *bss_descp;
 	struct scan_filter *scan_filter;
@@ -13330,19 +13233,11 @@ QDF_STATUS sme_get_rssi_snr_by_bssid(mac_handle_t mac_handle,
 		goto exit;
 	}
 
-	status = csr_roam_get_scan_filter_from_profile(mac_ctx,
-						       profile, scan_filter,
-						       false, vdev_id);
-	if (QDF_STATUS_SUCCESS != status) {
-		sme_err("prepare_filter failed");
-		qdf_mem_free(scan_filter);
-		goto exit;
-	}
-
 	/* update filter to get scan result with just target BSSID */
 	scan_filter->num_of_bssid = 1;
 	qdf_mem_copy(scan_filter->bssid_list[0].bytes,
 		     bssid, sizeof(struct qdf_mac_addr));
+	scan_filter->ignore_auth_enc_type = true;
 
 	status = csr_scan_get_result(mac_ctx, scan_filter, &result_handle,
 				     false);
@@ -13375,6 +13270,54 @@ exit:
 	return status;
 }
 
+#ifndef FEATURE_CM_ENABLE
+/**
+ * sme_prepare_beacon_from_bss_descp() - prepares beacon frame by populating
+ * different fields and IEs from bss descriptor.
+ * @frame_buf: frame buffer to populate
+ * @bss_descp: bss descriptor
+ * @bssid: bssid of the beacon frame to populate
+ * @ie_len: length of IE fields
+ *
+ * Return: None
+ */
+static void sme_prepare_beacon_from_bss_descp(uint8_t *frame_buf,
+					      struct bss_description *bss_descp,
+					      const tSirMacAddr bssid,
+					      uint32_t ie_len)
+{
+	tDot11fBeacon1 *bcn_fixed;
+	tpSirMacMgmtHdr mac_hdr = (tpSirMacMgmtHdr)frame_buf;
+
+	/* populate mac header first to indicate beacon */
+	mac_hdr->fc.protVer = SIR_MAC_PROTOCOL_VERSION;
+	mac_hdr->fc.type = SIR_MAC_MGMT_FRAME;
+	mac_hdr->fc.subType = SIR_MAC_MGMT_BEACON;
+	qdf_mem_copy((uint8_t *) mac_hdr->da,
+		     (uint8_t *) "\xFF\xFF\xFF\xFF\xFF\xFF",
+		     sizeof(struct qdf_mac_addr));
+	qdf_mem_copy((uint8_t *) mac_hdr->sa, bssid,
+		     sizeof(struct qdf_mac_addr));
+	qdf_mem_copy((uint8_t *) mac_hdr->bssId, bssid,
+		     sizeof(struct qdf_mac_addr));
+
+	/* now populate fixed params */
+	bcn_fixed = (tDot11fBeacon1 *)(frame_buf + SIR_MAC_HDR_LEN_3A);
+	/* populate timestamp */
+	qdf_mem_copy(&bcn_fixed->TimeStamp.timestamp, &bss_descp->timeStamp,
+			sizeof(bss_descp->timeStamp));
+	/* populate beacon interval */
+	bcn_fixed->BeaconInterval.interval = bss_descp->beaconInterval;
+	/* populate capability */
+	qdf_mem_copy(&bcn_fixed->Capabilities, &bss_descp->capabilityInfo,
+			sizeof(bss_descp->capabilityInfo));
+
+	/* copy IEs now */
+	qdf_mem_copy(frame_buf + SIR_MAC_HDR_LEN_3A
+		     + SIR_MAC_B_PR_SSID_OFFSET,
+		     &bss_descp->ieFields, ie_len);
+}
+
 QDF_STATUS sme_get_beacon_frm(mac_handle_t mac_handle,
 			      struct csr_roam_profile *profile,
 			      const tSirMacAddr bssid,
@@ -13460,7 +13403,7 @@ exit:
 
 	return status;
 }
-
+#endif
 #ifdef WLAN_FEATURE_ROAM_OFFLOAD
 QDF_STATUS sme_roam_invoke_nud_fail(mac_handle_t mac_handle, uint8_t vdev_id)
 {
@@ -13572,9 +13515,10 @@ QDF_STATUS sme_fast_reassoc(mac_handle_t mac_handle,
 	if (QDF_IS_STATUS_ERROR(sme_acquire_global_lock(&mac->sme)))
 		return QDF_STATUS_E_FAILURE;
 
+#ifndef FEATURE_CM_ENABLE
 	status = csr_fast_reassoc(mac_handle, profile, bssid, ch_freq, vdev_id,
 				  connected_bssid);
-
+#endif
 	sme_release_global_lock(&mac->sme);
 
 	return status;

+ 64 - 156
core/sme/src/csr/csr_api_roam.c

@@ -559,11 +559,7 @@ static void csr_roam_de_init_globals(struct mac_context *mac)
 	for (i = 0; i < WLAN_MAX_VDEVS; i++) {
 		if (mac->roam.roamSession[i].pCurRoamProfile)
 			csr_release_profile(mac,
-					    mac->roam.roamSession[i].
-					    pCurRoamProfile);
-		csr_release_profile(mac,
-				    &mac->roam.roamSession[i].
-				    stored_roam_profile.profile);
+					    mac->roam.roamSession[i].pCurRoamProfile);
 	}
 	csr_roam_free_globals();
 	mac->roam.roamSession = NULL;
@@ -3043,9 +3039,7 @@ csr_connect_info(struct mac_context *mac_ctx,
 	qdf_mem_copy(conn_stats.ssid, conn_profile->SSID.ssId,
 		     conn_stats.ssid_len);
 	sme_get_rssi_snr_by_bssid(MAC_HANDLE(mac_ctx),
-				  session->pCurRoamProfile,
-				  &conn_stats.bssid[0],
-				  &conn_stats.rssi, NULL, session->vdev_id);
+				  &conn_stats.bssid[0], &conn_stats.rssi, NULL);
 	conn_stats.est_link_speed = 0;
 	conn_stats.chnl_bw =
 		diag_ch_width_from_csr_type(conn_profile->vht_channel_width);
@@ -3078,7 +3072,7 @@ csr_connect_info(struct mac_context *mac_ctx,
 	sme_nofl_debug("AKM: %s Encry-type: %s",
 		       csr_get_akm_str(conn_profile->AuthType),
 		       csr_get_encr_type_str(conn_stats.encryption_type));
-	sme_nofl_debug("DUT_NSS: %d | Intersected NSS:%d", session->vdev_nss,
+	sme_nofl_debug("DUT_NSS: %d | Intersected NSS:%d", session->nss,
 		  csr_get_sta_ap_intersected_nss(mac_ctx, session->vdev_id));
 	sme_nofl_debug("Qos enable: %d | Associated: %s",
 		       conn_stats.qos_capability,
@@ -3118,9 +3112,7 @@ void csr_get_sta_cxn_info(struct mac_context *mac_ctx,
 			     "\n\tssid: %.*s", conn_profile->SSID.length,
 			     conn_profile->SSID.ssId);
 	sme_get_rssi_snr_by_bssid(MAC_HANDLE(mac_ctx),
-				  session->pCurRoamProfile,
-				  conn_profile->bssid.bytes,
-				  &rssi, NULL, session->vdev_id);
+				  conn_profile->bssid.bytes, &rssi, NULL);
 	len += qdf_scnprintf(buf + len, buf_sz - len,
 			     "\n\trssi: %d", rssi);
 	ch_width = diag_ch_width_from_csr_type(conn_profile->vht_channel_width);
@@ -6188,7 +6180,7 @@ static void csr_roam_process_results_default(struct mac_context *mac_ctx,
 		csr_roam_completion(mac_ctx, session_id, NULL, cmd,
 			eCSR_ROAM_RESULT_FAILURE, false);
 		break;
-#endif
+#endif  /* ndef FEATURE_CM_ENABLE */
 	case eCsrHddIssuedReassocToSameAP:
 	case eCsrSmeIssuedReassocToSameAP:
 		csr_roam_state_change(mac_ctx, eCSR_ROAMING_STATE_IDLE,
@@ -7054,7 +7046,7 @@ static bool csr_roam_process_results(struct mac_context *mac_ctx, tSmeCmd *cmd,
 		csr_roam_completion(mac_ctx, session_id, NULL, cmd,
 				eCSR_ROAM_RESULT_ASSOCIATED, true);
 		break;
-#endif
+#endif /* ndef FEATURE_CM_ENABLE */
 	case eCsrReassocFailure:
 		/*
 		 * Currently Reassoc failure is handled through eCsrJoinFailure
@@ -7609,42 +7601,6 @@ static bool csr_is_fils_connection(struct csr_roam_profile *pProfile)
 }
 #endif
 
-#ifndef FEATURE_CM_ENABLE
-/**
- * csr_roam_print_candidate_aps() - print all candidate AP in sorted
- * score.
- * @results: scan result
- *
- * Return : void
- */
-static void csr_roam_print_candidate_aps(tScanResultHandle results)
-{
-	tListElem *entry;
-	struct tag_csrscan_result *bss_desc = NULL;
-	struct scan_result_list *bss_list = NULL;
-
-	if (!results)
-		return;
-	bss_list = (struct scan_result_list *)results;
-	entry = csr_ll_peek_head(&bss_list->List, LL_ACCESS_NOLOCK);
-	while (entry) {
-		bss_desc = GET_BASE_ADDR(entry,
-				struct tag_csrscan_result, Link);
-		sme_nofl_debug(QDF_MAC_ADDR_FMT " score: %d",
-			QDF_MAC_ADDR_REF(bss_desc->Result.BssDescriptor.bssId),
-			bss_desc->bss_score);
-
-		entry = csr_ll_next(&bss_list->List, entry,
-				LL_ACCESS_NOLOCK);
-	}
-}
-#endif
-
-void csr_set_open_mode_in_scan_filter(struct scan_filter *filter)
-{
-	QDF_SET_PARAM(filter->authmodeset, WLAN_CRYPTO_AUTH_OPEN);
-}
-
 #ifdef FEATURE_CM_ENABLE
 QDF_STATUS csr_roam_connect(struct mac_context *mac, uint32_t vdev_id,
 		struct csr_roam_profile *profile,
@@ -7686,9 +7642,37 @@ QDF_STATUS csr_roam_connect(struct mac_context *mac, uint32_t vdev_id,
 
 	return status;
 }
-
 #else
 
+/**
+ * csr_roam_print_candidate_aps() - print all candidate AP in sorted
+ * score.
+ * @results: scan result
+ *
+ * Return : void
+ */
+static void csr_roam_print_candidate_aps(tScanResultHandle results)
+{
+	tListElem *entry;
+	struct tag_csrscan_result *bss_desc = NULL;
+	struct scan_result_list *bss_list = NULL;
+
+	if (!results)
+		return;
+	bss_list = (struct scan_result_list *)results;
+	entry = csr_ll_peek_head(&bss_list->List, LL_ACCESS_NOLOCK);
+	while (entry) {
+		bss_desc = GET_BASE_ADDR(entry,
+				struct tag_csrscan_result, Link);
+		sme_nofl_debug(QDF_MAC_ADDR_FMT " score: %d",
+			QDF_MAC_ADDR_REF(bss_desc->Result.BssDescriptor.bssId),
+			bss_desc->bss_score);
+
+		entry = csr_ll_next(&bss_list->List, entry,
+				LL_ACCESS_NOLOCK);
+	}
+}
+
 #ifdef CONFIG_BAND_6GHZ
 bool csr_connect_security_valid_for_6ghz(struct wlan_objmgr_psoc *psoc,
 					 uint8_t vdev_id,
@@ -8522,10 +8506,6 @@ static void csr_roam_join_rsp_processor(struct mac_context *mac,
 		}
 
 		session_ptr->nss = pSmeJoinRsp->nss;
-		session_ptr->vdev_nss = pSmeJoinRsp->nss;
-
-		session_ptr->supported_nss_1x1 = pSmeJoinRsp->supported_nss_1x1;
-
 		/*
 		 * The join bssid count can be reset as soon as
 		 * we are done with the join requests and returning
@@ -8997,14 +8977,8 @@ static void csr_roam_roaming_state_reassoc_rsp_processor(struct mac_context *mac
 			 "CSR SmeReassocReq Successful");
 		result = eCsrReassocSuccess;
 		csr_session = CSR_GET_SESSION(mac, pSmeJoinRsp->vdev_id);
-		if (csr_session) {
+		if (csr_session)
 			csr_session->nss = pSmeJoinRsp->nss;
-			csr_session->vdev_nss = pSmeJoinRsp->nss;
-			csr_session->supported_nss_1x1 =
-				pSmeJoinRsp->supported_nss_1x1;
-			sme_debug("SME session supported nss: %d",
-				csr_session->supported_nss_1x1);
-		}
 		/*
 		 * Since the neighbor roam algorithm uses reassoc req for
 		 * handoff instead of join, we need the response contents while
@@ -10258,6 +10232,7 @@ csr_issue_set_context_req_helper(struct mac_context *mac_ctx,
 					      (struct qdf_mac_addr *)bssid);
 }
 
+#ifndef FEATURE_CM_ENABLE
 #ifdef WLAN_FEATURE_FILS_SK
 /*
  * csr_create_fils_realm_hash: API to create hash using realm
@@ -10313,6 +10288,7 @@ static void csr_update_fils_scan_filter(struct scan_filter *filter,
 					struct csr_roam_profile *profile)
 { }
 #endif
+#endif
 
 static inline void csr_copy_ssids(struct wlan_ssid *ssid, tSirMacSSid *from)
 {
@@ -10338,6 +10314,20 @@ void csr_copy_ssids_from_roam_params(struct roam_ext_params *roam_params,
 			       &roam_params->ssid_allowed_list[i]);
 }
 
+void csr_update_scan_filter_dot11mode(struct mac_context *mac_ctx,
+				      struct scan_filter *filter)
+{
+	eCsrPhyMode phymode = mac_ctx->roam.configParam.phyMode;
+
+	if (phymode == eCSR_DOT11_MODE_11n_ONLY)
+		filter->dot11mode = ALLOW_11N_ONLY;
+	else if (phymode == eCSR_DOT11_MODE_11ac_ONLY)
+		filter->dot11mode = ALLOW_11AC_ONLY;
+	else if (phymode == eCSR_DOT11_MODE_11ax_ONLY)
+		filter->dot11mode = ALLOW_11AX_ONLY;
+}
+
+#ifndef FEATURE_CM_ENABLE
 static void csr_copy_ssids_from_profile(tCsrSSIDs *ssid_list,
 					struct scan_filter *filter)
 {
@@ -10351,31 +10341,7 @@ static void csr_copy_ssids_from_profile(tCsrSSIDs *ssid_list,
 			       &ssid_list->SSIDList[i].SSID);
 }
 
-#ifdef WLAN_FEATURE_11W
-
-/**
- * csr_update_pmf_cap_from_profile: Updates PMF cap
- * @profile: Source profile
- * @filter: scan filter
- *
- * Return: None
- */
-static void csr_update_pmf_cap_from_profile(struct csr_roam_profile *profile,
-					    struct scan_filter *filter)
-{
-	if (profile->MFPCapable || profile->MFPEnabled)
-		filter->pmf_cap = WLAN_PMF_CAPABLE;
-	if (profile->MFPRequired)
-		filter->pmf_cap = WLAN_PMF_REQUIRED;
-}
-#else
-static inline
-void csr_update_pmf_cap_from_profile(struct csr_roam_profile *profile,
-				     struct scan_filter *filter)
-{}
-#endif
-
-QDF_STATUS csr_fill_filter_from_vdev_crypto(struct mac_context *mac_ctx,
+static QDF_STATUS csr_fill_filter_from_vdev_crypto(struct mac_context *mac_ctx,
 					    struct scan_filter *filter,
 					    uint8_t vdev_id)
 {
@@ -10388,16 +10354,7 @@ QDF_STATUS csr_fill_filter_from_vdev_crypto(struct mac_context *mac_ctx,
 		return QDF_STATUS_E_FAILURE;
 	}
 
-	filter->authmodeset =
-		wlan_crypto_get_param(vdev, WLAN_CRYPTO_PARAM_AUTH_MODE);
-	filter->mcastcipherset =
-		wlan_crypto_get_param(vdev, WLAN_CRYPTO_PARAM_MCAST_CIPHER);
-	filter->ucastcipherset =
-		wlan_crypto_get_param(vdev, WLAN_CRYPTO_PARAM_UCAST_CIPHER);
-	filter->key_mgmt =
-		wlan_crypto_get_param(vdev, WLAN_CRYPTO_PARAM_KEY_MGMT);
-	filter->mgmtcipherset =
-		wlan_crypto_get_param(vdev, WLAN_CRYPTO_PARAM_MGMT_CIPHER);
+	wlan_cm_fill_crypto_filter_from_vdev(vdev, filter);
 
 	wlan_objmgr_vdev_release_ref(vdev, WLAN_LEGACY_SME_ID);
 
@@ -10418,19 +10375,6 @@ static QDF_STATUS csr_fill_crypto_params(struct mac_context *mac_ctx,
 	return csr_fill_filter_from_vdev_crypto(mac_ctx, filter, vdev_id);
 }
 
-void csr_update_scan_filter_dot11mode(struct mac_context *mac_ctx,
-				      struct scan_filter *filter)
-{
-	eCsrPhyMode phymode = mac_ctx->roam.configParam.phyMode;
-
-	if (phymode == eCSR_DOT11_MODE_11n_ONLY)
-		filter->dot11mode = ALLOW_11N_ONLY;
-	else if (phymode == eCSR_DOT11_MODE_11ac_ONLY)
-		filter->dot11mode = ALLOW_11AC_ONLY;
-	else if (phymode == eCSR_DOT11_MODE_11ax_ONLY)
-		filter->dot11mode = ALLOW_11AX_ONLY;
-}
-
 QDF_STATUS
 csr_roam_get_scan_filter_from_profile(struct mac_context *mac_ctx,
 				      struct csr_roam_profile *profile,
@@ -10514,8 +10458,6 @@ csr_roam_get_scan_filter_from_profile(struct mac_context *mac_ctx,
 	qdf_mem_copy(filter->bssid_hint.bytes, profile->bssid_hint.bytes,
 		     QDF_MAC_ADDR_SIZE);
 
-	csr_update_pmf_cap_from_profile(profile, filter);
-
 	csr_update_fils_scan_filter(filter, profile);
 
 	filter->enable_adaptive_11r =
@@ -10524,6 +10466,7 @@ csr_roam_get_scan_filter_from_profile(struct mac_context *mac_ctx,
 
 	return QDF_STATUS_SUCCESS;
 }
+#endif
 
 static
 bool csr_roam_issue_wm_status_change(struct mac_context *mac, uint32_t sessionId,
@@ -11369,7 +11312,8 @@ csr_roam_chk_lnk_swt_ch_ind(struct mac_context *mac_ctx, tSirSmeRsp *msg_ptr)
 	session->connectedProfile.op_freq = pSwitchChnInd->freq;
 
 	/* Update the occupied channel list with the new switched channel */
-	csr_init_occupied_channels_list(mac_ctx, sessionId);
+	wlan_cm_init_occupied_ch_freq_list(mac_ctx->pdev, mac_ctx->psoc,
+					   sessionId);
 
 	if (session->pConnectBssDesc) {
 		session->pConnectBssDesc->chan_freq = pSwitchChnInd->freq;
@@ -13767,7 +13711,6 @@ void csr_update_prev_ap_info(struct csr_roam_session *session,
 {
 	struct wlan_ssid ssid;
 	QDF_STATUS status;
-	struct qdf_mac_addr bssid;
 	enum QDF_OPMODE opmode;
 	struct rso_config *rso_cfg;
 
@@ -13783,14 +13726,8 @@ void csr_update_prev_ap_info(struct csr_roam_session *session,
 		sme_err(" failed to find SSID for vdev %d", session->vdev_id);
 		return;
 	}
-	status = wlan_vdev_get_bss_peer_mac(vdev, &bssid);
-	if (QDF_IS_STATUS_ERROR(status)) {
-		sme_err(" failed to find BSSID for vdev %d", session->vdev_id);
-		return;
-	}
 	session->prevApSSID.length = ssid.length;
 	qdf_mem_copy(&session->prevApSSID.ssId, &ssid.ssid, ssid.length);
-	qdf_copy_macaddr(&session->prevApBssid, &bssid);
 	session->isPrevApInfoValid = true;
 	session->roamTS1 = qdf_mc_timer_get_system_time();
 }
@@ -14022,20 +13959,13 @@ static void csr_fill_connected_profile(struct mac_context *mac_ctx,
 	if (!filter)
 		return;
 
-	status = csr_fill_filter_from_vdev_crypto(mac_ctx, filter, vdev_id);
-	if (QDF_IS_STATUS_ERROR(status)) {
-		sme_err("fail to fill filter crypto");
-		qdf_mem_free(filter);
-		return;
-	}
-
+	wlan_cm_fill_crypto_filter_from_vdev(vdev, filter);
 	filter->num_of_ssid = 1;
 	filter->ssid_list[0].length = rsp->connect_rsp.ssid.length;
 	qdf_mem_copy(filter->ssid_list[0].ssid, rsp->connect_rsp.ssid.ssid,
 		     rsp->connect_rsp.ssid.length);
 	filter->num_of_bssid = 1;
 	qdf_copy_macaddr(&filter->bssid_list[0], &rsp->connect_rsp.bssid);
-	csr_update_pmf_cap_from_connected_profile(mac_ctx, vdev_id, filter);
 
 	list = ucfg_scan_get_result(mac_ctx->pdev, filter);
 	qdf_mem_free(filter);
@@ -14150,8 +14080,6 @@ QDF_STATUS cm_csr_connect_rsp(struct wlan_objmgr_vdev *vdev,
 	}
 
 	session->nss = rsp->nss;
-	session->vdev_nss = rsp->nss;
-	session->supported_nss_1x1 = rsp->supported_nss_1x1;
 	if (rsp->uapsd_mask)
 		sme_ps_start_uapsd(MAC_HANDLE(mac_ctx), vdev_id);
 	csr_fill_connected_info(mac_ctx, session, rsp);
@@ -16137,31 +16065,6 @@ QDF_STATUS csr_get_snr(struct mac_context *mac,
 }
 
 #ifdef WLAN_FEATURE_ROAM_OFFLOAD
-/**
- * csr_roam_set_key_mgmt_offload() - enable/disable key mgmt offload
- * @mac_ctx: mac context.
- * @session_id: Session Identifier
- * @pmkid_modes: PMKID modes of PMKSA caching and OKC
- *
- * Return: QDF_STATUS_SUCCESS - CSR updated config successfully.
- * Other status means CSR is failed to update.
- */
-
-QDF_STATUS csr_roam_set_key_mgmt_offload(struct mac_context *mac_ctx,
-					 uint32_t session_id,
-					 struct pmkid_mode_bits *pmkid_modes)
-{
-	struct csr_roam_session *session = CSR_GET_SESSION(mac_ctx, session_id);
-
-	if (!session) {
-		sme_err("session %d not found", session_id);
-		return QDF_STATUS_E_FAILURE;
-	}
-	session->pmkid_modes.fw_okc = pmkid_modes->fw_okc;
-	session->pmkid_modes.fw_pmksa_cache = pmkid_modes->fw_pmksa_cache;
-	return QDF_STATUS_SUCCESS;
-}
-
 #ifdef WLAN_FEATURE_FIPS
 QDF_STATUS
 csr_process_roam_pmkid_req_callback(struct mac_context *mac_ctx,
@@ -19322,6 +19225,7 @@ void csr_update_fils_erp_seq_num(struct csr_roam_profile *roam_profile,
 #endif
 
 #ifdef WLAN_FEATURE_ROAM_OFFLOAD
+#ifndef FEATURE_CM_ENABLE
 QDF_STATUS csr_fast_reassoc(mac_handle_t mac_handle,
 			    struct csr_roam_profile *profile,
 			    const tSirMacAddr bssid, uint32_t ch_freq,
@@ -19450,6 +19354,8 @@ QDF_STATUS csr_fast_reassoc(mac_handle_t mac_handle,
 
 	return status;
 }
+#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
@@ -19681,13 +19587,15 @@ csr_process_roam_sync_callback(struct mac_context *mac_ctx,
 		csr_roam_roaming_offload_timer_action(mac_ctx,
 				0, session_id, ROAMING_OFFLOAD_TIMER_STOP);
 
+		/* This is temp ifdef will be removed in near future */
+#ifndef FEATURE_CM_ENABLE
 		if (session->discon_in_progress) {
 			sme_err("LFR3: vdev:%d Disconnect is in progress roam_synch is not allowed",
 				session_id);
 			status = QDF_STATUS_E_FAILURE;
 			goto end;
 		}
-
+#endif
 		status = csr_post_roam_state_change(mac_ctx, session_id,
 						    WLAN_ROAM_SYNCH_IN_PROG,
 						    REASON_ROAM_HANDOFF_DONE);

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

@@ -315,35 +315,6 @@ QDF_STATUS csr_scan_result_purge(struct mac_context *mac,
 	return status;
 }
 
-/* Add the channel to the occupiedChannels array */
-static void csr_add_to_occupied_channels(struct mac_context *mac,
-					 uint32_t ch_freq,
-					 uint8_t sessionId,
-					 struct rso_config *rso_cfg,
-					 bool is_init_list)
-{
-	QDF_STATUS status;
-	uint8_t num_occupied_ch = rso_cfg->occupied_chan_lst.num_chan;
-	uint32_t *occupied_ch_lst = rso_cfg->occupied_chan_lst.freq_list;
-
-	if (is_init_list)
-		rso_cfg->roam_candidate_count++;
-
-	if (wlan_is_channel_present_in_list(occupied_ch_lst,
-					    num_occupied_ch, ch_freq))
-		return;
-
-	status = csr_add_to_channel_list_front(occupied_ch_lst,
-					       num_occupied_ch, ch_freq);
-	if (QDF_IS_STATUS_SUCCESS(status)) {
-		rso_cfg->occupied_chan_lst.num_chan++;
-		if (rso_cfg->occupied_chan_lst.num_chan >
-		    CSR_BG_SCAN_OCCUPIED_CHANNEL_LIST_LEN)
-			rso_cfg->occupied_chan_lst.num_chan =
-				CSR_BG_SCAN_OCCUPIED_CHANNEL_LIST_LEN;
-	}
-}
-
 /* Put the BSS into the scan result list */
 /* pIes can not be NULL */
 static void csr_scan_add_result(struct mac_context *mac_ctx,
@@ -1760,6 +1731,8 @@ csr_get_fst_bssdescr_ptr(tScanResultHandle result_handle)
 	return &scan_result->Result.BssDescriptor;
 }
 
+#ifndef FEATURE_CM_ENABLE
+
 /**
  * csr_get_bssdescr_from_scan_handle() - This function to extract
  *                                       first bss description from scan handle
@@ -1801,7 +1774,6 @@ csr_get_bssdescr_from_scan_handle(tScanResultHandle result_handle,
 	return bss_descr;
 }
 
-#ifndef FEATURE_CM_ENABLE
 uint32_t
 csr_get_channel_for_hw_mode_change(struct mac_context *mac_ctx,
 				   tScanResultHandle result_handle,
@@ -2404,184 +2376,6 @@ void csr_remove_bssid_from_scan_list(struct mac_context *mac_ctx,
 	csr_flush_bssid(mac_ctx, bssid);
 }
 
-static void csr_dump_occupied_chan_list(struct wlan_chan_list *occupied_ch)
-{
-	uint8_t idx;
-	uint32_t buff_len;
-	char *chan_buff;
-	uint32_t len = 0;
-
-	buff_len = (occupied_ch->num_chan * 5) + 1;
-	chan_buff = qdf_mem_malloc(buff_len);
-	if (!chan_buff)
-		return;
-
-	for (idx = 0; idx < occupied_ch->num_chan; idx++)
-		len += qdf_scnprintf(chan_buff + len, buff_len - len, " %d",
-				     occupied_ch->freq_list[idx]);
-
-	sme_nofl_debug("Occupied chan list[%d]:%s",
-		       occupied_ch->num_chan, chan_buff);
-
-	qdf_mem_free(chan_buff);
-}
-
-/**
- * csr_should_add_to_occupied_channels() - validates bands of active_ch_freq and
- * curr node freq before addition of curr node freq to occupied channels
- *
- * @active_ch_freq: active channel frequency
- * @cur_node_chan_freq: curr channel frequency
- * @dual_sta_roam_active: dual sta roam active
- *
- * Return: True if active_ch_freq and cur_node_chan_freq belongs to same
- * bands else false
- **/
-static bool csr_should_add_to_occupied_channels(uint16_t active_ch_freq,
-						uint16_t cur_node_chan_freq,
-						bool dual_sta_roam_active)
-{
-	/* all channels can be added if dual STA roam is not active */
-	if (!dual_sta_roam_active)
-		return true;
-
-	/* when dual STA roam is active, channels must be in the same band */
-	if (WLAN_REG_IS_24GHZ_CH_FREQ(active_ch_freq) &&
-	    WLAN_REG_IS_24GHZ_CH_FREQ(cur_node_chan_freq))
-		return true;
-
-	if (!WLAN_REG_IS_24GHZ_CH_FREQ(active_ch_freq) &&
-	    !WLAN_REG_IS_24GHZ_CH_FREQ(cur_node_chan_freq))
-		return true;
-
-	/* not in same band */
-	return false;
-}
-
-void csr_init_occupied_channels_list(struct mac_context *mac_ctx,
-				     uint8_t sessionId)
-{
-	qdf_list_t *list = NULL;
-	struct wlan_objmgr_pdev *pdev = NULL;
-	qdf_list_node_t *cur_lst = NULL;
-	qdf_list_node_t *next_lst = NULL;
-	struct scan_cache_node *cur_node = NULL;
-	struct scan_filter *filter;
-	bool dual_sta_roam_active;
-	struct wlan_channel *chan;
-	struct wlan_objmgr_vdev *vdev;
-	tCsrRoamConnectedProfile *profile = NULL;
-	QDF_STATUS status;
-	struct rso_config *rso_cfg;
-	struct rso_cfg_params *cfg_params;
-
-	if (!(mac_ctx && mac_ctx->roam.roamSession &&
-	      CSR_IS_SESSION_VALID(mac_ctx, sessionId))) {
-		sme_debug("Invalid session");
-		return;
-	}
-
-	vdev = wlan_objmgr_get_vdev_by_id_from_pdev(mac_ctx->pdev, sessionId,
-						    WLAN_LEGACY_SME_ID);
-	if (!vdev) {
-		sme_err("vdev object is NULL for vdev %d", sessionId);
-		return;
-	}
-	rso_cfg = wlan_cm_get_rso_config(vdev);
-	if (!rso_cfg)
-		goto rel_vdev_ref;
-
-	cfg_params = &rso_cfg->cfg_param;
-
-	if (cfg_params->specific_chan_info.num_chan) {
-		/*
-		 * Ini file contains neighbor scan channel list, hence NO need
-		 * to build occupied channel list"
-		 */
-		sme_debug("Ini contains neighbor scan ch list");
-		goto rel_vdev_ref;
-	}
-
-	profile = &mac_ctx->roam.roamSession[sessionId].connectedProfile;
-	if (!profile)
-		goto rel_vdev_ref;
-
-	filter = qdf_mem_malloc(sizeof(*filter));
-	if (!filter)
-		goto rel_vdev_ref;
-
-	status = csr_fill_filter_from_vdev_crypto(mac_ctx, filter, sessionId);
-	if (QDF_IS_STATUS_ERROR(status)) {
-		sme_err("fail to fill filter crypto");
-		qdf_mem_free(filter);
-		goto rel_vdev_ref;
-	}
-	filter->num_of_ssid = 1;
-	filter->ssid_list[0].length = profile->SSID.length;
-	qdf_mem_copy(filter->ssid_list[0].ssid, profile->SSID.ssId,
-		     profile->SSID.length);
-	csr_update_pmf_cap_from_connected_profile(mac_ctx, sessionId, filter);
-
-	pdev = wlan_objmgr_get_pdev_by_id(mac_ctx->psoc, 0, WLAN_LEGACY_MAC_ID);
-
-	if (!pdev) {
-		sme_err("pdev is NULL");
-		qdf_mem_free(filter);
-		goto rel_vdev_ref;
-	}
-
-	/* Empty occupied channels here */
-	rso_cfg->occupied_chan_lst.num_chan = 0;
-	rso_cfg->roam_candidate_count = 0;
-
-	csr_add_to_occupied_channels(mac_ctx, profile->op_freq, sessionId,
-				     rso_cfg, true);
-	list = ucfg_scan_get_result(pdev, filter);
-	if (!list || (list && !qdf_list_size(list))) {
-		wlan_objmgr_vdev_release_ref(vdev, WLAN_LEGACY_SME_ID);
-		goto err;
-	}
-
-	chan = wlan_vdev_get_active_channel(vdev);
-	if (!chan) {
-		sme_err("no active channel");
-		goto err;
-	}
-
-	dual_sta_roam_active =
-			wlan_mlme_get_dual_sta_roaming_enabled(mac_ctx->psoc);
-
-	qdf_list_peek_front(list, &cur_lst);
-	while (cur_lst) {
-		cur_node = qdf_container_of(cur_lst, struct scan_cache_node,
-					    node);
-
-		if (csr_should_add_to_occupied_channels
-					(chan->ch_freq,
-					 cur_node->entry->channel.chan_freq,
-					 dual_sta_roam_active))
-
-			csr_add_to_occupied_channels
-				   (mac_ctx, cur_node->entry->channel.chan_freq,
-				    sessionId, rso_cfg, true);
-
-		qdf_list_peek_next(list, cur_lst, &next_lst);
-		cur_lst = next_lst;
-		next_lst = NULL;
-	}
-err:
-	csr_dump_occupied_chan_list(&rso_cfg->occupied_chan_lst);
-	wlan_objmgr_vdev_release_ref(vdev, WLAN_LEGACY_SME_ID);
-	qdf_mem_free(filter);
-	if (list)
-		ucfg_scan_purge_results(list);
-	wlan_objmgr_pdev_release_ref(pdev, WLAN_LEGACY_MAC_ID);
-	return;
-
-rel_vdev_ref:
-	wlan_objmgr_vdev_release_ref(vdev, WLAN_LEGACY_SME_ID);
-}
-
 /**
  * csr_scan_filter_results: filter scan result based
  * on valid channel list number.

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

@@ -409,18 +409,6 @@ enum csr_cfgdot11mode csr_find_best_phy_mode(struct mac_context *mac,
 void csr_copy_ssids_from_roam_params(struct roam_ext_params *roam_params,
 				     struct scan_filter *filter);
 
-/*
- * csr_fill_filter_from_vdev_crypto() - fill scan filter crypto from vdev crypto
- * @mac_ctx: csr auth type
- * @filter: scan filter
- * @vdev_id: vdev
- *
- * Return QDF_STATUS
- */
-QDF_STATUS csr_fill_filter_from_vdev_crypto(struct mac_context *mac_ctx,
-					    struct scan_filter *filter,
-					    uint8_t vdev_id);
-
 /*
  * csr_update_scan_filter_dot11mode() - update dot11mode for scan filter
  * @mac_ctx: csr auth type
@@ -431,14 +419,7 @@ QDF_STATUS csr_fill_filter_from_vdev_crypto(struct mac_context *mac_ctx,
 void csr_update_scan_filter_dot11mode(struct mac_context *mac_ctx,
 				      struct scan_filter *filter);
 
-/*
- * csr_set_open_mode_in_scan_filter() - set open mode in scan filter
- * @filter: scan filter
- *
- * Return void
- */
-void csr_set_open_mode_in_scan_filter(struct scan_filter *filter);
-
+#ifndef FEATURE_CM_ENABLE
 /**
  * csr_roam_get_scan_filter_from_profile() - prepare scan filter from
  * given roam profile
@@ -458,7 +439,7 @@ csr_roam_get_scan_filter_from_profile(struct mac_context *mac_ctx,
 				      struct csr_roam_profile *profile,
 				      struct scan_filter *filter,
 				      bool is_roam, uint8_t vdev_id);
-
+#endif
 /**
  * csr_neighbor_roam_get_scan_filter_from_profile() - prepare scan filter from
  * connected profile
@@ -768,10 +749,6 @@ void csr_get_pmk_info(struct mac_context *mac_ctx, uint8_t session_id,
 QDF_STATUS csr_roam_set_psk_pmk(struct mac_context *mac, uint8_t vdev_id,
 				uint8_t *psk_pmk, size_t pmk_len,
 				bool update_to_fw);
-
-QDF_STATUS csr_roam_set_key_mgmt_offload(struct mac_context *mac_ctx,
-					 uint32_t session_id,
-					 struct pmkid_mode_bits *pmkid_modes);
 #endif
 
 #ifndef FEATURE_CM_ENABLE
@@ -899,8 +876,6 @@ 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);
-void csr_init_occupied_channels_list(struct mac_context *mac, uint8_t sessionId);
-
 QDF_STATUS csr_scan_create_entry_in_scan_cache(struct mac_context *mac,
 						uint32_t sessionId,
 						struct qdf_mac_addr bssid,
@@ -985,10 +960,11 @@ void csr_saved_scan_cmd_free_fields(struct mac_context *mac_ctx,
 struct bss_description*
 csr_get_fst_bssdescr_ptr(tScanResultHandle result_handle);
 
+#ifndef FEATURE_CM_ENABLE
 struct bss_description*
 csr_get_bssdescr_from_scan_handle(tScanResultHandle result_handle,
 				  struct bss_description *bss_descr);
-
+#endif
 bool is_disconnect_pending(struct mac_context *mac_ctx,
 				   uint8_t sessionid);
 

+ 2 - 42
core/sme/src/csr/csr_neighbor_roam.c

@@ -335,39 +335,6 @@ static void csr_neighbor_roam_reset_init_state_control_info(struct mac_context *
 	csr_neighbor_roam_reset_report_scan_state_control_info(mac, sessionId);
 }
 
-#ifdef WLAN_FEATURE_11W
-void
-csr_update_pmf_cap_from_connected_profile(struct mac_context *mac,
-					  uint8_t vdev_id,
-					  struct scan_filter *filter)
-{
-	struct rso_config *rso_cfg;
-	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("Invalid vdev");
-		return;
-	}
-	rso_cfg = wlan_cm_get_rso_config(vdev);
-	if (!rso_cfg)
-		goto rel_ref;
-
-	if (rso_cfg->rsn_cap & WLAN_CRYPTO_RSN_CAP_MFP_REQUIRED)
-		filter->pmf_cap = WLAN_PMF_REQUIRED;
-	else if (rso_cfg->rsn_cap & WLAN_CRYPTO_RSN_CAP_MFP_ENABLED)
-		filter->pmf_cap = WLAN_PMF_CAPABLE;
-rel_ref:
-	wlan_objmgr_vdev_release_ref(vdev, WLAN_LEGACY_SME_ID);
-}
-#else
-void
-csr_update_pmf_cap_from_connected_profile(tCsrRoamConnectedProfile *profile,
-					  struct scan_filter *filter)
-{}
-#endif
-
 QDF_STATUS
 csr_neighbor_roam_get_scan_filter_from_profile(struct mac_context *mac,
 					       struct scan_filter *filter,
@@ -377,7 +344,6 @@ csr_neighbor_roam_get_scan_filter_from_profile(struct mac_context *mac,
 	tCsrRoamConnectedProfile *profile;
 	struct roam_ext_params *roam_params;
 	uint8_t num_ch = 0;
-	QDF_STATUS status;
 	struct wlan_objmgr_vdev *vdev;
 	struct rso_config *rso_cfg;
 	struct rso_chan_info *chan_lst;
@@ -421,17 +387,13 @@ csr_neighbor_roam_get_scan_filter_from_profile(struct mac_context *mac,
 			  filter->ssid_list[0].length);
 	}
 
-	status = csr_fill_filter_from_vdev_crypto(mac, filter, vdev_id);
-
-	if (QDF_IS_STATUS_ERROR(status))
-		return status;
-
 	vdev = wlan_objmgr_get_vdev_by_id_from_psoc(mac->psoc, vdev_id,
 						    WLAN_LEGACY_SME_ID);
 	if (!vdev) {
 		sme_err("vdev object is NULL");
 		return QDF_STATUS_E_FAILURE;
 	}
+	wlan_cm_fill_crypto_filter_from_vdev(vdev, filter);
 
 	rso_cfg = wlan_cm_get_rso_config(vdev);
 	if (!rso_cfg) {
@@ -457,8 +419,6 @@ csr_neighbor_roam_get_scan_filter_from_profile(struct mac_context *mac,
 		 */
 		filter->mobility_domain = profile->mdid.mobility_domain;
 
-	csr_update_pmf_cap_from_connected_profile(mac, vdev_id, filter);
-
 	filter->enable_adaptive_11r =
 		wlan_mlme_adaptive_11r_enabled(mac->psoc);
 	csr_update_scan_filter_dot11mode(mac, filter);
@@ -804,7 +764,7 @@ static void csr_neighbor_roam_info_ctx_init(struct mac_context *mac,
 	struct csr_roam_session *session = &mac->roam.roamSession[session_id];
 	int init_ft_flag = false;
 
-	csr_init_occupied_channels_list(mac, session_id);
+	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);
 

+ 0 - 19
core/sme/src/csr/csr_util.c

@@ -3807,25 +3807,6 @@ const char *sme_bss_type_to_string(const uint8_t bss_type)
 	}
 }
 
-QDF_STATUS csr_add_to_channel_list_front(uint32_t *pChannelList,
-					 int numChannels, uint32_t chan_freq)
-{
-	int i = 0;
-
-	/* Check for NULL pointer */
-	if (!pChannelList)
-		return QDF_STATUS_E_NULL_VALUE;
-
-	/* Make room for the addition.  (Start moving from the back.) */
-	for (i = numChannels; i > 0; i--)
-		pChannelList[i] = pChannelList[i - 1];
-
-	/* Now add the NEW channel...at the front */
-	pChannelList[0] = chan_freq;
-
-	return QDF_STATUS_SUCCESS;
-}
-
 /**
  * csr_wait_for_connection_update() - Wait for hw mode update
  * @mac: Pointer to the MAC context