Эх сурвалжийг харах

qcacld-3.0: Move code from CSR to new RSO structs part 2

Move code from CSR to roam scan offload to use new converged
structures.

Change-Id: Ic67be46bd33930cdacc49e2e410a5e1ae7b303ee
CRs-Fixed: 2857319
gaurank kathpalia 4 жил өмнө
parent
commit
85f376f0a9

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

@@ -31,6 +31,22 @@
 #include "wlan_cm_roam_public_struct.h"
 #include "wlan_wfa_config_public_struct.h"
 
+#define MAC_MAX_ADD_IE_LENGTH       2048
+
+/* QCN IE definitions */
+#define QCN_IE_HDR_LEN     6
+
+#define QCN_IE_VERSION_SUBATTR_ID        1
+#define QCN_IE_VERSION_SUBATTR_DATA_LEN  2
+#define QCN_IE_VERSION_SUBATTR_LEN       4
+#define QCN_IE_VERSION_SUPPORTED    1
+#define QCN_IE_SUBVERSION_SUPPORTED 0
+
+#define QCN_IE_ATTR_ID_VERSION 1
+#define QCN_IE_ATTR_ID_VHT_MCS11 2
+#define QCN_IE_ATTR_ID_ALL 0xFF
+
+
 #define mlme_legacy_fatal(params...) QDF_TRACE_FATAL(QDF_MODULE_ID_MLME, params)
 #define mlme_legacy_err(params...) QDF_TRACE_ERROR(QDF_MODULE_ID_MLME, params)
 #define mlme_legacy_warn(params...) QDF_TRACE_WARN(QDF_MODULE_ID_MLME, params)
@@ -42,6 +58,12 @@ enum size_of_len_field {
 	TWO_BYTE = 2
 };
 
+struct pwr_channel_info {
+	uint32_t first_freq;
+	uint8_t num_chan;
+	int8_t max_tx_pwr;
+};
+
 /**
  * struct wlan_mlme_psoc_ext_obj -MLME ext psoc priv object
  * @cfg:     cfg items
@@ -715,6 +737,10 @@ QDF_STATUS wlan_strip_ie(uint8_t *addn_ie, uint16_t *addn_ielen,
 bool wlan_is_channel_present_in_list(qdf_freq_t *freq_lst,
 				     uint32_t num_chan, qdf_freq_t chan_freq);
 
+int8_t wlan_get_cfg_max_tx_power(struct wlan_objmgr_psoc *psoc,
+				 struct wlan_objmgr_pdev *pdev,
+				 uint32_t ch_freq);
+
 #if defined(WLAN_FEATURE_HOST_ROAM) || defined(WLAN_FEATURE_ROAM_OFFLOAD)
 /**
  * mlme_get_supplicant_disabled_roaming() - Get supplicant disabled roaming

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

@@ -1828,6 +1828,7 @@ static void mlme_init_lfr_cfg(struct wlan_objmgr_psoc *psoc,
 	mlme_init_bss_load_trigger_params(psoc, &lfr->bss_load_trig);
 	mlme_init_adaptive_11r_cfg(psoc, lfr);
 	mlme_init_subnet_detection(psoc, lfr);
+	lfr->rso_user_config.cat_rssi_offset = DEFAULT_RSSI_DB_GAP;
 }
 
 static void mlme_init_power_cfg(struct wlan_objmgr_psoc *psoc,
@@ -2931,6 +2932,76 @@ bool wlan_is_channel_present_in_list(qdf_freq_t *freq_lst,
 	return false;
 }
 
+int8_t wlan_get_cfg_max_tx_power(struct wlan_objmgr_psoc *psoc,
+				 struct wlan_objmgr_pdev *pdev,
+				 uint32_t ch_freq)
+{
+	uint32_t cfg_length = 0;
+	int8_t max_tx_pwr = 0;
+	struct pwr_channel_info *country_info = NULL;
+	uint8_t count = 0;
+	uint8_t maxChannels;
+	int32_t rem_length = 0;
+	struct wlan_mlme_psoc_ext_obj *mlme_obj;
+
+	mlme_obj = mlme_get_psoc_ext_obj(psoc);
+	if (!mlme_obj)
+		return max_tx_pwr;
+
+	if (WLAN_REG_IS_5GHZ_CH_FREQ(ch_freq)) {
+		cfg_length = mlme_obj->cfg.power.max_tx_power_5.len;
+	} else if (WLAN_REG_IS_24GHZ_CH_FREQ(ch_freq)) {
+		cfg_length = mlme_obj->cfg.power.max_tx_power_24.len;
+
+	} else if (wlan_reg_is_6ghz_chan_freq(ch_freq)) {
+		return wlan_reg_get_channel_reg_power_for_freq(pdev,
+							       ch_freq);
+	} else {
+		return max_tx_pwr;
+	}
+
+	if (!cfg_length)
+		goto error;
+
+	country_info = qdf_mem_malloc(cfg_length);
+	if (!country_info)
+		goto error;
+
+	if (WLAN_REG_IS_5GHZ_CH_FREQ(ch_freq)) {
+		if (cfg_length > CFG_MAX_TX_POWER_5_LEN)
+			goto error;
+		qdf_mem_copy(country_info,
+			     mlme_obj->cfg.power.max_tx_power_5.data,
+			     cfg_length);
+	} else if (WLAN_REG_IS_24GHZ_CH_FREQ(ch_freq)) {
+		if (cfg_length > CFG_MAX_TX_POWER_2_4_LEN)
+			goto error;
+		qdf_mem_copy(country_info,
+			     mlme_obj->cfg.power.max_tx_power_24.data,
+			     cfg_length);
+	}
+
+	/* Identify the channel and maxtxpower */
+	rem_length = cfg_length;
+	while (rem_length >= (sizeof(tSirMacChanInfo))) {
+		maxChannels = country_info[count].num_chan;
+		max_tx_pwr = country_info[count].max_tx_pwr;
+		count++;
+		rem_length -= (sizeof(tSirMacChanInfo));
+
+		if (ch_freq >= country_info[count].first_freq &&
+		    ch_freq < (country_info[count].first_freq + maxChannels)) {
+			break;
+		}
+	}
+
+error:
+	if (country_info)
+		qdf_mem_free(country_info);
+
+	return max_tx_pwr;
+}
+
 #if defined(WLAN_FEATURE_HOST_ROAM) || defined(WLAN_FEATURE_ROAM_OFFLOAD)
 static
 const char *mlme_roam_state_to_string(enum roam_offload_state state)

+ 373 - 17
components/umac/mlme/connection_mgr/core/src/wlan_cm_roam_offload.c

@@ -31,6 +31,7 @@
 #include "wlan_psoc_mlme_api.h"
 #include "pld_common.h"
 #include "wlan_blm_api.h"
+#include "wlan_scan_api.h"
 
 /**
  * cm_roam_scan_bmiss_cnt() - set roam beacon miss count
@@ -218,13 +219,25 @@ cm_roam_idle_params(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id,
 		    struct wlan_roam_idle_params *params)
 {
 }
+static inline QDF_STATUS
+wlan_cm_roam_scan_offload_fill_lfr3_config(struct wlan_objmgr_vdev *vdev,
+			struct rso_config *rso_cfg,
+			struct wlan_roam_scan_offload_params *rso_config,
+			struct wlan_mlme_psoc_ext_obj *mlme_obj,
+			uint8_t command, uint32_t *mode)
+{
+	if (mlme_obj->cfg.lfr.roam_force_rssi_trigger)
+		*mode |= WMI_ROAM_SCAN_MODE_RSSI_CHANGE;
+
+	return QDF_STATUS_SUCCESS;
+}
 #endif
 
 #if defined(WLAN_FEATURE_ROAM_OFFLOAD) && defined(WLAN_FEATURE_FILS_SK)
-QDF_STATUS cm_roam_scan_offload_add_fils_params(
-		struct wlan_objmgr_psoc *psoc,
-		struct wlan_roam_scan_offload_params *rso_cfg,
-		uint8_t vdev_id)
+static QDF_STATUS
+cm_roam_scan_offload_add_fils_params(struct wlan_objmgr_psoc *psoc,
+				struct wlan_roam_scan_offload_params *rso_cfg,
+				uint8_t vdev_id)
 {
 	QDF_STATUS status;
 	uint32_t usr_name_len;
@@ -295,6 +308,14 @@ QDF_STATUS cm_roam_scan_offload_add_fils_params(
 
 	return status;
 }
+#else
+static inline
+QDF_STATUS cm_roam_scan_offload_add_fils_params(struct wlan_objmgr_psoc *psoc,
+			struct wlan_roam_scan_offload_params *rso_cfg,
+			uint8_t vdev_id)
+{
+	return QDF_STATUS_SUCCESS;
+}
 #endif
 
 /**
@@ -746,9 +767,8 @@ static uint32_t cm_get_wapi_wmi_auth_type(int32_t akm)
 		return WMI_AUTH_NONE;
 }
 
-static uint32_t cm_crpto_authmode_to_wmi_authmode(int32_t authmodeset,
-						  int32_t akm,
-						  int32_t ucastcipherset)
+uint32_t cm_crpto_authmode_to_wmi_authmode(int32_t authmodeset,
+					   int32_t akm, int32_t ucastcipherset)
 {
 	if (!authmodeset || authmodeset < 0)
 		return WMI_AUTH_OPEN;
@@ -1119,6 +1139,18 @@ static inline bool cm_is_ese_assoc(struct rso_config *rso_cfg)
 {
 	return rso_cfg->is_ese_assoc;
 }
+static void cm_esr_populate_version_ie(
+			struct wlan_mlme_psoc_ext_obj *mlme_obj,
+			struct wlan_roam_scan_offload_params *rso_mode_cfg)
+{
+	static const uint8_t ese_ie[] = {0x0, 0x40, 0x96, 0x3,
+					 ESE_VERSION_SUPPORTED};
+
+	/* Append ESE version IE if isEseIniFeatureEnabled INI is enabled */
+	if (mlme_obj->cfg.lfr.ese_enabled)
+		wlan_cm_append_assoc_ies(rso_mode_cfg, WLAN_ELEMID_VENDOR,
+					 sizeof(ese_ie), ese_ie);
+}
 
 #else
 static inline void
@@ -1131,6 +1163,10 @@ static inline bool cm_is_ese_assoc(struct rso_config *rso_cfg)
 {
 	return false;
 }
+static inline void cm_esr_populate_version_ie(
+			struct wlan_mlme_psoc_ext_obj *mlme_obj,
+			struct wlan_roam_scan_offload_params *rso_mode_cfg)
+{}
 #endif
 
 /**
@@ -1431,6 +1467,322 @@ cm_roam_scan_filter(struct wlan_objmgr_psoc *psoc,
 	}
 }
 
+static void
+cm_roam_scan_offload_fill_scan_params(struct wlan_objmgr_psoc *psoc,
+			struct rso_config *rso_cfg,
+			struct wlan_mlme_psoc_ext_obj *mlme_obj,
+			struct wlan_roam_scan_offload_params *rso_mode_cfg,
+			struct wlan_roam_scan_channel_list *rso_chan_info,
+			uint8_t command)
+{
+	struct wlan_roam_scan_params *scan_params =
+			&rso_mode_cfg->rso_scan_params;
+	uint8_t channels_per_burst = 0;
+	uint16_t roam_scan_home_away_time;
+	enum roaming_dfs_channel_type allow_dfs_ch_roam;
+	struct rso_cfg_params *cfg_params;
+
+	qdf_mem_zero(scan_params, sizeof(*scan_params));
+	if (command == ROAM_SCAN_OFFLOAD_STOP)
+		return;
+
+	cfg_params = &rso_cfg->cfg_param;
+
+	/* Parameters updated after association is complete */
+	wlan_scan_cfg_get_passive_dwelltime(psoc,
+					    &scan_params->dwell_time_passive);
+	/*
+	 * Here is the formula,
+	 * T(HomeAway) = N * T(dwell) + (N+1) * T(cs)
+	 * where N is number of channels scanned in single burst
+	 */
+	scan_params->dwell_time_active = cfg_params->max_chan_scan_time;
+
+	roam_scan_home_away_time = cfg_params->roam_scan_home_away_time;
+	if (roam_scan_home_away_time <
+	    (scan_params->dwell_time_active +
+	     (2 * ROAM_SCAN_CHANNEL_SWITCH_TIME))) {
+		mlme_debug("Disable Home away time(%d) as it is less than (2*RF switching time + channel max time)(%d)",
+			  roam_scan_home_away_time,
+			  (scan_params->dwell_time_active +
+			   (2 * ROAM_SCAN_CHANNEL_SWITCH_TIME)));
+		roam_scan_home_away_time = 0;
+	}
+
+	if (roam_scan_home_away_time < (2 * ROAM_SCAN_CHANNEL_SWITCH_TIME)) {
+		/* clearly we can't follow home away time.
+		 * Make it a split scan.
+		 */
+		scan_params->burst_duration = 0;
+	} else {
+		channels_per_burst =
+		  (roam_scan_home_away_time - ROAM_SCAN_CHANNEL_SWITCH_TIME) /
+		  (scan_params->dwell_time_active + ROAM_SCAN_CHANNEL_SWITCH_TIME);
+
+		if (channels_per_burst < 1) {
+			/* dwell time and home away time conflicts */
+			/* we will override dwell time */
+			scan_params->dwell_time_active =
+				roam_scan_home_away_time -
+				(2 * ROAM_SCAN_CHANNEL_SWITCH_TIME);
+			scan_params->burst_duration =
+				scan_params->dwell_time_active;
+		} else {
+			scan_params->burst_duration =
+				channels_per_burst *
+				scan_params->dwell_time_active;
+		}
+	}
+
+	allow_dfs_ch_roam = mlme_obj->cfg.lfr.roaming_dfs_channel;
+	/* Roaming on DFS channels is supported and it is not
+	 * app channel list. It is ok to override homeAwayTime
+	 * to accommodate DFS dwell time in burst
+	 * duration.
+	 */
+	if (allow_dfs_ch_roam == ROAMING_DFS_CHANNEL_ENABLED_NORMAL &&
+	    roam_scan_home_away_time > 0  &&
+	    rso_chan_info->chan_cache_type != CHANNEL_LIST_STATIC)
+		scan_params->burst_duration =
+			QDF_MAX(scan_params->burst_duration,
+				scan_params->dwell_time_passive);
+
+	scan_params->min_rest_time = cfg_params->neighbor_scan_min_period;
+	scan_params->max_rest_time = cfg_params->neighbor_scan_period;
+	scan_params->repeat_probe_time =
+		(cfg_params->roam_scan_n_probes > 0) ?
+			QDF_MAX(scan_params->dwell_time_active /
+				cfg_params->roam_scan_n_probes, 1) : 0;
+	scan_params->probe_spacing_time = 0;
+	scan_params->probe_delay = 0;
+	/* 30 seconds for full scan cycle */
+	scan_params->max_scan_time = ROAM_SCAN_HW_DEF_SCAN_MAX_DURATION;
+	scan_params->idle_time = scan_params->min_rest_time;
+	scan_params->n_probes = cfg_params->roam_scan_n_probes;
+
+	if (allow_dfs_ch_roam == ROAMING_DFS_CHANNEL_DISABLED) {
+		scan_params->scan_ctrl_flags |= WMI_SCAN_BYPASS_DFS_CHN;
+	} else {
+		/* Roaming scan on DFS channel is allowed.
+		 * No need to change any flags for default
+		 * allowDFSChannelRoam = 1.
+		 * Special case where static channel list is given by\
+		 * application that contains DFS channels.
+		 * Assume that the application has knowledge of matching
+		 * APs being active and that probe request transmission
+		 * is permitted on those channel.
+		 * Force active scans on those channels.
+		 */
+
+		if (allow_dfs_ch_roam ==
+		    ROAMING_DFS_CHANNEL_ENABLED_ACTIVE &&
+		    rso_chan_info->chan_cache_type == CHANNEL_LIST_STATIC &&
+		    rso_chan_info->chan_count)
+			scan_params->scan_ctrl_flags |=
+				WMI_SCAN_FLAG_FORCE_ACTIVE_ON_DFS;
+	}
+
+	scan_params->rso_adaptive_dwell_mode =
+		mlme_obj->cfg.lfr.adaptive_roamscan_dwell_mode;
+}
+
+void wlan_cm_append_assoc_ies(struct wlan_roam_scan_offload_params *rso_mode_cfg,
+			      uint8_t ie_id, uint8_t ie_len,
+			      const uint8_t *ie_data)
+{
+	uint32_t curr_length = rso_mode_cfg->assoc_ie_length;
+
+	if ((MAC_MAX_ADD_IE_LENGTH - curr_length) < ie_len) {
+		mlme_err("Appending IE id: %d failed", ie_id);
+		return;
+	}
+
+	rso_mode_cfg->assoc_ie[curr_length] = ie_id;
+	rso_mode_cfg->assoc_ie[curr_length + 1] = ie_len;
+	qdf_mem_copy(&rso_mode_cfg->assoc_ie[curr_length + 2], ie_data, ie_len);
+	rso_mode_cfg->assoc_ie_length += (ie_len + 2);
+}
+
+void wlan_add_supported_5Ghz_channels(struct wlan_objmgr_psoc *psoc,
+				      struct wlan_objmgr_pdev *pdev,
+				      uint8_t *chan_list,
+				      uint8_t *num_chnl,
+				      bool supp_chan_ie)
+{
+	uint16_t i, j = 0;
+	uint32_t size = 0;
+	uint32_t *freq_list;
+	struct wlan_mlme_psoc_ext_obj *mlme_obj;
+
+	mlme_obj = mlme_get_psoc_ext_obj(psoc);
+	if (!mlme_obj)
+		return;
+
+	if (!chan_list) {
+		mlme_err("chan_list buffer NULL");
+		*num_chnl = 0;
+		return;
+	}
+	size = mlme_obj->cfg.reg.valid_channel_list_num;
+	freq_list = mlme_obj->cfg.reg.valid_channel_freq_list;
+	for (i = 0, j = 0; i < size; i++) {
+		if (wlan_reg_is_dsrc_freq(freq_list[i]))
+			continue;
+		/* Only add 5ghz channels.*/
+		if (WLAN_REG_IS_5GHZ_CH_FREQ(freq_list[i])) {
+			chan_list[j] =
+				wlan_reg_freq_to_chan(pdev,
+						      freq_list[i]);
+				j++;
+
+			if (supp_chan_ie) {
+				chan_list[j] = 1;
+				j++;
+			}
+		}
+	}
+	*num_chnl = (uint8_t)j;
+}
+
+static void cm_update_driver_assoc_ies(struct wlan_objmgr_psoc *psoc,
+			struct wlan_objmgr_vdev *vdev,
+			struct rso_config *rso_cfg,
+			struct wlan_mlme_psoc_ext_obj *mlme_obj,
+			struct wlan_roam_scan_offload_params *rso_mode_cfg)
+{
+	bool power_caps_populated = false;
+	uint8_t *rrm_cap_ie_data;
+	uint8_t vdev_id = wlan_vdev_get_id(vdev);
+	uint8_t power_cap_ie_data[DOT11F_IE_POWERCAPS_MAX_LEN] = {
+		MIN_TX_PWR_CAP, MAX_TX_PWR_CAP};
+	uint8_t max_tx_pwr_cap = 0;
+	struct wlan_objmgr_pdev *pdev;
+	uint8_t supp_chan_ie[DOT11F_IE_SUPPCHANNELS_MAX_LEN], supp_chan_ie_len;
+	static const uint8_t qcn_ie[] = {0x8C, 0xFD, 0xF0, 0x1,
+					 QCN_IE_VERSION_SUBATTR_ID,
+					 QCN_IE_VERSION_SUBATTR_DATA_LEN,
+					 QCN_IE_VERSION_SUPPORTED,
+					 QCN_IE_SUBVERSION_SUPPORTED};
+
+	pdev = wlan_vdev_get_pdev(vdev);
+	if (!pdev)
+		return;
+
+	rrm_cap_ie_data = wlan_cm_get_rrm_cap_ie_data();
+	/* Re-Assoc IE TLV parameters */
+	rso_mode_cfg->assoc_ie_length = rso_cfg->assoc_ie.len;
+	qdf_mem_copy(rso_mode_cfg->assoc_ie, rso_cfg->assoc_ie.ptr,
+		     rso_mode_cfg->assoc_ie_length);
+
+	max_tx_pwr_cap = wlan_get_cfg_max_tx_power(psoc, pdev,
+					wlan_get_operation_chan_freq(vdev));
+
+	if (max_tx_pwr_cap && max_tx_pwr_cap < MAX_TX_PWR_CAP)
+		power_cap_ie_data[1] = max_tx_pwr_cap;
+	else
+		power_cap_ie_data[1] = MAX_TX_PWR_CAP;
+
+	if (mlme_obj->cfg.gen.enabled_11h) {
+		/* Append power cap IE */
+		wlan_cm_append_assoc_ies(rso_mode_cfg, WLAN_ELEMID_PWRCAP,
+					 DOT11F_IE_POWERCAPS_MAX_LEN,
+					 power_cap_ie_data);
+		power_caps_populated = true;
+
+		/* Append Supported channels IE */
+		wlan_add_supported_5Ghz_channels(psoc, pdev, supp_chan_ie,
+						&supp_chan_ie_len, true);
+
+		wlan_cm_append_assoc_ies(rso_mode_cfg,
+					 WLAN_ELEMID_SUPPCHAN,
+					 supp_chan_ie_len, supp_chan_ie);
+	}
+
+	cm_esr_populate_version_ie(mlme_obj, rso_mode_cfg);
+
+	if (mlme_obj->cfg.rrm_config.rrm_enabled) {
+		/* Append RRM IE */
+		if (rrm_cap_ie_data)
+			wlan_cm_append_assoc_ies(rso_mode_cfg, WLAN_ELEMID_RRM,
+						 DOT11F_IE_RRMENABLEDCAP_MAX_LEN,
+						 rrm_cap_ie_data);
+
+		/* Append Power cap IE if not appended already */
+		if (!power_caps_populated)
+			wlan_cm_append_assoc_ies(rso_mode_cfg,
+						 WLAN_ELEMID_PWRCAP,
+						 DOT11F_IE_POWERCAPS_MAX_LEN,
+						  power_cap_ie_data);
+	}
+
+	wlan_cm_ese_populate_addtional_ies(pdev, mlme_obj, vdev_id,
+					  rso_mode_cfg);
+
+	/* Append QCN IE if g_support_qcn_ie INI is enabled */
+	if (mlme_obj->cfg.sta.qcn_ie_support)
+		wlan_cm_append_assoc_ies(rso_mode_cfg, WLAN_ELEMID_VENDOR,
+					 sizeof(qcn_ie), qcn_ie);
+}
+
+static void
+cm_roam_scan_offload_fill_rso_configs(struct wlan_objmgr_psoc *psoc,
+			struct wlan_objmgr_vdev *vdev,
+			struct rso_config *rso_cfg,
+			struct wlan_roam_scan_offload_params *rso_mode_cfg,
+			struct wlan_roam_scan_channel_list *rso_chan_info,
+			uint8_t command, uint16_t reason)
+{
+	uint32_t mode = 0;
+	struct wlan_mlme_psoc_ext_obj *mlme_obj;
+	uint8_t vdev_id = wlan_vdev_get_id(vdev);
+
+	mlme_obj = mlme_get_psoc_ext_obj(psoc);
+	if (!mlme_obj)
+		return;
+
+	qdf_mem_zero(rso_mode_cfg, sizeof(*rso_mode_cfg));
+	rso_mode_cfg->vdev_id = vdev_id;
+	rso_mode_cfg->is_rso_stop = (command == ROAM_SCAN_OFFLOAD_STOP);
+	rso_mode_cfg->roaming_scan_policy =
+		mlme_obj->cfg.lfr.roaming_scan_policy;
+
+	/* Fill ROAM SCAN mode TLV parameters */
+	if (rso_cfg->cfg_param.empty_scan_refresh_period)
+		mode |= WMI_ROAM_SCAN_MODE_PERIODIC;
+
+	rso_mode_cfg->rso_mode_info.min_delay_btw_scans =
+			mlme_obj->cfg.lfr.min_delay_btw_roam_scans;
+	rso_mode_cfg->rso_mode_info.min_delay_roam_trigger_bitmask =
+			mlme_obj->cfg.lfr.roam_trigger_reason_bitmask;
+
+	if (command == ROAM_SCAN_OFFLOAD_STOP) {
+		if (reason == REASON_ROAM_STOP_ALL ||
+		    reason == REASON_DISCONNECTED ||
+		    reason == REASON_ROAM_SYNCH_FAILED) {
+			mode = WMI_ROAM_SCAN_MODE_NONE;
+		} else {
+			if (wlan_is_roam_offload_enabled(mlme_obj->cfg.lfr))
+				mode = WMI_ROAM_SCAN_MODE_NONE |
+					WMI_ROAM_SCAN_MODE_ROAMOFFLOAD;
+			else
+				mode = WMI_ROAM_SCAN_MODE_NONE;
+		}
+	}
+
+	rso_mode_cfg->rso_mode_info.roam_scan_mode = mode;
+	if (command == ROAM_SCAN_OFFLOAD_STOP)
+		return;
+
+	wlan_cm_roam_scan_offload_fill_lfr3_config(vdev, rso_cfg, rso_mode_cfg,
+						   mlme_obj, command, &mode);
+	rso_mode_cfg->rso_mode_info.roam_scan_mode = mode;
+	cm_roam_scan_offload_fill_scan_params(psoc, rso_cfg, mlme_obj,
+					      rso_mode_cfg, rso_chan_info,
+					      command);
+	cm_update_driver_assoc_ies(psoc, vdev, rso_cfg, mlme_obj, rso_mode_cfg);
+	cm_roam_scan_offload_add_fils_params(psoc, rso_mode_cfg, vdev_id);
+}
+
 /**
  * cm_roam_start_req() - roam start request handling
  * @psoc: psoc pointer
@@ -1489,6 +1841,11 @@ cm_roam_start_req(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id,
 				 reason);
 	cm_roam_scan_filter(psoc, pdev, vdev_id, ROAM_SCAN_OFFLOAD_START,
 			    reason, &start_req->scan_filter_params);
+	cm_roam_scan_offload_fill_rso_configs(psoc, vdev, rso_cfg,
+					      &start_req->rso_config,
+					      &start_req->rso_chan_info,
+					      ROAM_SCAN_OFFLOAD_START,
+					      reason);
 
 	/* fill from legacy through this API */
 	wlan_cm_roam_fill_start_req(psoc, vdev_id, start_req, reason);
@@ -1566,9 +1923,11 @@ cm_roam_update_config_req(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id,
 				 &update_req->rso_chan_info, reason);
 	cm_roam_scan_filter(psoc, pdev, vdev_id, ROAM_SCAN_OFFLOAD_UPDATE_CFG,
 			    reason, &update_req->scan_filter_params);
-
-	/* fill from legacy through this API */
-	wlan_cm_roam_fill_update_config_req(psoc, vdev_id, update_req, reason);
+	cm_roam_scan_offload_fill_rso_configs(psoc, vdev, rso_cfg,
+					      &update_req->rso_config,
+					      &update_req->rso_chan_info,
+					      ROAM_SCAN_OFFLOAD_UPDATE_CFG,
+					      reason);
 
 	status = wlan_cm_tgt_send_roam_update_req(psoc, vdev_id, update_req);
 	if (QDF_IS_STATUS_ERROR(status))
@@ -1726,13 +2085,10 @@ cm_roam_stop_req(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id,
 
 	cm_roam_scan_filter(psoc, pdev, vdev_id, ROAM_SCAN_OFFLOAD_STOP,
 			    reason, &stop_req->scan_filter_params);
-
-	/* do the filling as csr_post_rso_stop */
-	status = wlan_cm_roam_fill_stop_req(psoc, vdev_id, stop_req, reason);
-	if (QDF_IS_STATUS_ERROR(status)) {
-		mlme_debug("fail to fill stop config req");
-		goto rel_vdev_ref;
-	}
+	cm_roam_scan_offload_fill_rso_configs(psoc, vdev, rso_cfg,
+					      &stop_req->rso_config,
+					      NULL, ROAM_SCAN_OFFLOAD_STOP,
+					      stop_req->reason);
 
 	status = wlan_cm_tgt_send_roam_stop_req(psoc, vdev_id, stop_req);
 	if (QDF_IS_STATUS_ERROR(status)) {

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

@@ -121,20 +121,4 @@ void cm_dump_freq_list(struct rso_chan_info *chan_info);
 QDF_STATUS
 cm_roam_send_disable_config(struct wlan_objmgr_psoc *psoc,
 			    uint8_t vdev_id, uint8_t cfg);
-
-#if defined(WLAN_FEATURE_ROAM_OFFLOAD) && defined(WLAN_FEATURE_FILS_SK)
-QDF_STATUS cm_roam_scan_offload_add_fils_params(
-		struct wlan_objmgr_psoc *psoc,
-		struct wlan_roam_scan_offload_params *rso_cfg,
-		uint8_t vdev_id);
-#else
-static inline
-QDF_STATUS cm_roam_scan_offload_add_fils_params(
-		struct wlan_objmgr_psoc *psoc,
-		struct wlan_roam_scan_offload_params *rso_cfg,
-		uint8_t vdev_id)
-{
-	return QDF_STATUS_SUCCESS;
-}
-#endif /* FEATURE_ROAM_OFFLOAD && WLAN_FEATURE_FILS_SK */
 #endif /* _WLAN_CM_ROAM_OFFLOAD_H_ */

+ 61 - 33
components/umac/mlme/connection_mgr/dispatcher/inc/wlan_cm_roam_api.h

@@ -74,39 +74,6 @@ QDF_STATUS
 wlan_cm_roam_fill_start_req(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id,
 			    struct wlan_roam_start_config *req, uint8_t reason);
 
-/**
- * wlan_cm_roam_fill_stop_req() - fill stop request structure content
- * @psoc: pointer to psoc object
- * @vdev_id: vdev id
- * @req: roam stop config pointer
- * @reason: reason to roam
- *
- * This function gets called to fill stop request structure content
- *
- * Return: QDF_STATUS
- */
-QDF_STATUS
-wlan_cm_roam_fill_stop_req(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id,
-			   struct wlan_roam_stop_config *req, uint8_t reason);
-
-/**
- * wlan_cm_roam_fill_update_config_req() - fill update config request
- * structure content
- * @psoc: pointer to psoc object
- * @vdev_id: vdev id
- * @req: roam update config pointer
- * @reason: reason to roam
- *
- * This function gets called to fill update config request structure content
- *
- * Return: QDF_STATUS
- */
-QDF_STATUS
-wlan_cm_roam_fill_update_config_req(struct wlan_objmgr_psoc *psoc,
-				    uint8_t vdev_id,
-				    struct wlan_roam_update_config *req,
-				    uint8_t reason);
-
 /**
  * wlan_cm_roam_scan_offload_rsp() - send roam scan offload response message
  * @vdev_id: vdev id
@@ -157,6 +124,13 @@ wlan_cm_enable_roaming_on_connected_sta(struct wlan_objmgr_pdev *pdev,
 }
 #endif
 
+#ifdef WLAN_FEATURE_ROAM_OFFLOAD
+#define wlan_is_roam_offload_enabled(lfr) \
+	(lfr.lfr3_roaming_offload)
+#else
+#define wlan_is_roam_offload_enabled(lfr)  false
+#endif
+
 /**
  * wlan_cm_neighbor_roam_in_progress() -Check if STA is in the middle of
  * roaming states
@@ -372,6 +346,10 @@ void wlan_cm_set_ese_assoc(struct wlan_objmgr_pdev *pdev,
  */
 bool wlan_cm_get_ese_assoc(struct wlan_objmgr_pdev *pdev,
 			   uint8_t vdev_id);
+void wlan_cm_ese_populate_addtional_ies(struct wlan_objmgr_pdev *pdev,
+			struct wlan_mlme_psoc_ext_obj *mlme_obj,
+			uint8_t vdev_id,
+			struct wlan_roam_scan_offload_params *rso_mode_cfg);
 #else
 static inline void wlan_cm_set_ese_assoc(struct wlan_objmgr_pdev *pdev,
 					 uint8_t vdev_id, bool value) {}
@@ -381,6 +359,12 @@ bool wlan_cm_get_ese_assoc(struct wlan_objmgr_pdev *pdev,
 {
 	return false;
 }
+static inline void wlan_cm_ese_populate_addtional_ies(
+		struct wlan_objmgr_pdev *pdev,
+		struct wlan_mlme_psoc_ext_obj *mlme_obj,
+		uint8_t vdev_id,
+		struct wlan_roam_scan_offload_params *rso_mode_cfg)
+{}
 #endif
 
 /**
@@ -434,6 +418,44 @@ void wlan_cm_init_occupied_ch_freq_list(struct wlan_objmgr_pdev *pdev,
 					struct wlan_objmgr_psoc *psoc,
 					uint8_t vdev_id);
 
+uint32_t cm_crpto_authmode_to_wmi_authmode(int32_t authmodeset,
+					   int32_t akm, int32_t ucastcipherset);
+uint8_t *wlan_cm_get_rrm_cap_ie_data(void);
+
+/**
+ * wlan_cm_append_assoc_ies() - Append specific IE to assoc IE's buffer
+ * @req_buf: Pointer to Roam offload scan request
+ * @ie_id: IE ID to be appended
+ * @ie_len: IE length to be appended
+ * @ie_data: IE data to be appended
+ *
+ * Return: None
+ */
+void wlan_cm_append_assoc_ies(struct wlan_roam_scan_offload_params *rso_mode_cfg,
+			      uint8_t ie_id, uint8_t ie_len,
+			      const uint8_t *ie_data);
+/**
+ * wlan_add_supported_5Ghz_channels()- Add valid 5Ghz channels
+ * in Join req.
+ * @psoc: psoc ptr
+ * @pdev: pdev
+ * @chan_list: Pointer to channel list buffer to populate
+ * @num_chan: Pointer to number of channels value to update
+ * @supp_chan_ie: Boolean to check if we need to populate as IE
+ *
+ * This function is called to update valid 5Ghz channels
+ * in Join req. If @supp_chan_ie is true, supported channels IE
+ * format[chan num 1, num of channels 1, chan num 2, num of
+ * channels 2, ..] is populated. Else, @chan_list would be a list
+ * of supported channels[chan num 1, chan num 2..]
+ *
+ * Return: void
+ */
+void wlan_add_supported_5Ghz_channels(struct wlan_objmgr_psoc *psoc,
+				      struct wlan_objmgr_pdev *pdev,
+				      uint8_t *chan_list,
+				      uint8_t *num_chnl,
+				      bool supp_chan_ie);
 #ifdef WLAN_FEATURE_FILS_SK
 /**
  * wlan_cm_get_fils_connection_info  - Copy fils connection information from
@@ -485,6 +507,12 @@ struct wlan_fils_connection_info *wlan_cm_get_fils_connection_info(
 #endif
 
 #ifdef WLAN_FEATURE_ROAM_OFFLOAD
+QDF_STATUS
+wlan_cm_roam_scan_offload_fill_lfr3_config(struct wlan_objmgr_vdev *vdev,
+			struct rso_config *rso_cfg,
+			struct wlan_roam_scan_offload_params *rso_config,
+			struct wlan_mlme_psoc_ext_obj *mlme_obj,
+			uint8_t command, uint32_t *mode);
 /**
  * wlan_cm_roam_extract_btm_response() - Extract BTM rsp stats
  * @wmi:       wmi handle

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

@@ -227,6 +227,8 @@ struct rso_roam_policy_params {
 	uint8_t sap_operating_band;
 };
 
+#define DEFAULT_RSSI_DB_GAP     30  /* every 30 dbm for one category */
+
 /**
  * struct rso_params - global RSO params
  * @num_ssid_allowed_list: The number of SSID profiles that are
@@ -263,6 +265,7 @@ struct rso_config_params {
 	uint8_t raise_factor_5g;
 	uint8_t drop_factor_5g;
 	int max_raise_rssi_5g;
+	uint8_t cat_rssi_offset;
 	struct rso_roam_policy_params policy_params;
 };
 

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

@@ -27,6 +27,7 @@
 #include <wmi_unified_priv.h>
 #include <../../core/src/wlan_cm_vdev_api.h>
 #include "wlan_crypto_global_api.h"
+#include <wlan_cm_api.h>
 
 /* Support for "Fast roaming" (i.e., ESE, LFR, or 802.11r.) */
 #define BG_SCAN_OCCUPIED_CHANNEL_LIST_LEN 15

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

@@ -1941,12 +1941,6 @@ typedef struct {
 } tSirAcUapsd, *tpSirAcUapsd;
 #endif
 
-typedef enum {
-	SIR_ROAMING_DFS_CHANNEL_DISABLED = 0,
-	SIR_ROAMING_DFS_CHANNEL_ENABLED_NORMAL = 1,
-	SIR_ROAMING_DFS_CHANNEL_ENABLED_ACTIVE = 2
-} eSirDFSRoamScanMode;
-
 /**
  * struct pmkid_mode_bits - Bit flags for PMKID usage in RSN IE
  * @fw_okc: Opportunistic key caching enable in firmware

+ 0 - 15
core/mac/src/include/parser_api.h

@@ -61,19 +61,6 @@
 #define NSS_4x4_MODE 4
 #define MBO_IE_ASSOC_DISALLOWED_SUBATTR_ID 0x04
 
-/* QCN IE definitions */
-#define QCN_IE_HDR_LEN     6
-
-#define QCN_IE_VERSION_SUBATTR_ID        1
-#define QCN_IE_VERSION_SUBATTR_DATA_LEN  2
-#define QCN_IE_VERSION_SUBATTR_LEN       4
-#define QCN_IE_VERSION_SUPPORTED    1
-#define QCN_IE_SUBVERSION_SUPPORTED 0
-
-#define QCN_IE_ATTR_ID_VERSION 1
-#define QCN_IE_ATTR_ID_VHT_MCS11 2
-#define QCN_IE_ATTR_ID_ALL 0xFF
-
 #define SIZE_OF_FIXED_PARAM 12
 #define SIZE_OF_TAG_PARAM_NUM 1
 #define SIZE_OF_TAG_PARAM_LEN 1
@@ -1262,8 +1249,6 @@ wlan_get_parsed_bss_description_ies(struct mac_context *mac_ctx,
 				    struct bss_description *bss_desc,
 				    tDot11fBeaconIEs **ie_struct);
 
-int8_t wlan_get_cfg_max_tx_power(struct mac_context *mac, uint32_t ch_freq);
-
 QDF_STATUS
 wlan_fill_bss_desc_from_scan_entry(struct mac_context *mac_ctx,
 				   struct bss_description *bss_desc,

+ 1 - 1
core/mac/src/pe/lim/lim_ft.c

@@ -476,7 +476,7 @@ static void lim_fill_dot11mode(struct mac_context *mac_ctx,
 			       enum wlan_phymode bss_phymode)
 {
 	if (pe_session->ftPEContext.pFTPreAuthReq &&
-	    !csr_is_roam_offload_enabled(mac_ctx)) {
+	    !wlan_is_roam_offload_enabled(mac_ctx->mlme_cfg->lfr)) {
 		ft_session->dot11mode =
 			pe_session->ftPEContext.pFTPreAuthReq->dot11mode;
 		return;

+ 1 - 1
core/mac/src/pe/lim/lim_process_sme_req_messages.c

@@ -2410,7 +2410,7 @@ lim_enable_twt(struct mac_context *mac_ctx, tDot11fBeaconIEs *ie)
 static int8_t lim_get_cfg_max_tx_power(struct mac_context *mac,
 				       uint32_t ch_freq)
 {
-	return wlan_get_cfg_max_tx_power(mac, ch_freq);
+	return wlan_get_cfg_max_tx_power(mac->psoc, mac->pdev, ch_freq);
 }
 
 #ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH

+ 0 - 63
core/mac/src/sys/legacy/src/utils/src/parser_api.c

@@ -6343,69 +6343,6 @@ wlan_get_parsed_bss_description_ies(struct mac_context *mac_ctx,
 	return status;
 }
 
-int8_t wlan_get_cfg_max_tx_power(struct mac_context *mac, uint32_t ch_freq)
-{
-	uint32_t cfg_length = 0;
-	int8_t maxTxPwr = 0;
-	tSirMacChanInfo *pCountryInfo = NULL;
-	uint8_t count = 0;
-	uint8_t maxChannels;
-	int32_t rem_length = 0;
-
-	if (WLAN_REG_IS_5GHZ_CH_FREQ(ch_freq)) {
-		cfg_length = mac->mlme_cfg->power.max_tx_power_5.len;
-	} else if (WLAN_REG_IS_24GHZ_CH_FREQ(ch_freq)) {
-		cfg_length = mac->mlme_cfg->power.max_tx_power_24.len;
-
-	} else if (wlan_reg_is_6ghz_chan_freq(ch_freq)) {
-		return wlan_reg_get_channel_reg_power_for_freq(mac->pdev,
-							       ch_freq);
-	} else {
-		return maxTxPwr;
-	}
-
-	if (!cfg_length)
-		goto error;
-
-	pCountryInfo = qdf_mem_malloc(cfg_length);
-	if (!pCountryInfo)
-		goto error;
-
-	if (WLAN_REG_IS_5GHZ_CH_FREQ(ch_freq)) {
-		if (cfg_length > CFG_MAX_TX_POWER_5_LEN)
-			goto error;
-		qdf_mem_copy(pCountryInfo,
-			     mac->mlme_cfg->power.max_tx_power_5.data,
-			     cfg_length);
-	} else if (WLAN_REG_IS_24GHZ_CH_FREQ(ch_freq)) {
-		if (cfg_length > CFG_MAX_TX_POWER_2_4_LEN)
-			goto error;
-		qdf_mem_copy(pCountryInfo,
-			     mac->mlme_cfg->power.max_tx_power_24.data,
-			     cfg_length);
-	}
-
-	/* Identify the channel and maxtxpower */
-	rem_length = cfg_length;
-	while (rem_length >= (sizeof(tSirMacChanInfo))) {
-		maxChannels = pCountryInfo[count].numChannels;
-		maxTxPwr = pCountryInfo[count].maxTxPower;
-		count++;
-		rem_length -= (sizeof(tSirMacChanInfo));
-
-		if (ch_freq >= pCountryInfo[count].first_freq &&
-		    ch_freq < (pCountryInfo[count].first_freq + maxChannels)) {
-			break;
-		}
-	}
-
-error:
-	if (pCountryInfo)
-		qdf_mem_free(pCountryInfo);
-
-	return maxTxPwr;
-}
-
 #ifdef FEATURE_WLAN_ESE
 static void wlan_fill_qbss_load_param(tDot11fBeaconIEs *bcn_ies,
 				      struct bss_description *bss_desc)

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

@@ -788,12 +788,6 @@ struct csr_config_params {
 	eCsrRoamWmmUserModeType WMMSupportMode;
 	bool Is11eSupportEnabled;
 	bool ProprietaryRatesEnabled;
-	/*
-	 * this number minus one is the number of times a scan doesn't find it
-	 * before it is removed
-	 */
-	/* to set the RSSI difference for each category */
-	uint8_t bCatRssiOffset;
 	/* to set MCC Enable/Disable mode */
 	uint8_t fEnableMCCMode;
 	bool mcc_rts_cts_prot_enable;
@@ -834,11 +828,7 @@ struct csr_config_params {
 };
 
 #ifdef WLAN_FEATURE_ROAM_OFFLOAD
-#define csr_is_roam_offload_enabled(mac) \
-	(mac->mlme_cfg->lfr.lfr3_roaming_offload)
 #define DEFAULT_REASSOC_FAILURE_TIMEOUT 1000
-#else
-#define csr_is_roam_offload_enabled(mac)  false
 #endif
 
 #ifdef WLAN_FEATURE_ROAM_OFFLOAD

+ 0 - 1
core/sme/inc/csr_internal.h

@@ -347,7 +347,6 @@ struct csr_config {
 	bool mcc_rts_cts_prot_enable;
 	bool mcc_bcast_prob_resp_enable;
 	uint8_t fAllowMCCGODiffBI;
-	uint8_t bCatRssiOffset; /* to set RSSI difference for each category */
 	bool nRoamScanControl;
 	uint32_t nVhtChannelWidth;
 	bool send_smps_action;

+ 1 - 1
core/sme/src/common/sme_api.c

@@ -6066,7 +6066,7 @@ QDF_STATUS sme_send_rso_connect_params(mac_handle_t mac_handle,
 		return QDF_STATUS_E_PERM;
 	}
 
-	if (csr_is_roam_offload_enabled(mac)) {
+	if (wlan_is_roam_offload_enabled(mac->mlme_cfg->lfr)) {
 		status = sme_acquire_global_lock(&mac->sme);
 		if (QDF_IS_STATUS_SUCCESS(status)) {
 			sme_debug("Updating fils config to fw");

+ 117 - 618
core/sme/src/csr/csr_api_roam.c

@@ -1645,7 +1645,6 @@ static void init_config_param(struct mac_context *mac)
 	mac->roam.configParam.Is11eSupportEnabled = true;
 	mac->roam.configParam.WMMSupportMode = eCsrRoamWmmAuto;
 	mac->roam.configParam.ProprietaryRatesEnabled = true;
-	mac->roam.configParam.bCatRssiOffset = CSR_DEFAULT_RSSI_DB_GAP;
 
 	mac->roam.configParam.nVhtChannelWidth =
 		WNI_CFG_VHT_CHANNEL_WIDTH_80MHZ + 1;
@@ -2291,9 +2290,6 @@ QDF_STATUS csr_change_default_config_param(struct mac_context *mac,
 							mac->roam.configParam.
 						ProprietaryRatesEnabled);
 
-		if (pParam->bCatRssiOffset)
-			mac->roam.configParam.bCatRssiOffset =
-							pParam->bCatRssiOffset;
 		/* Assign this before calling csr_init11d_info */
 		if (wlan_reg_11d_enabled_on_host(mac->psoc))
 			status = csr_init11d_info(mac, &pParam->Csr11dinfo);
@@ -2387,7 +2383,6 @@ QDF_STATUS csr_get_config_param(struct mac_context *mac,
 	pParam->phyMode = cfg_params->phyMode;
 	pParam->HeartbeatThresh50 = cfg_params->HeartbeatThresh50;
 	pParam->ProprietaryRatesEnabled = cfg_params->ProprietaryRatesEnabled;
-	pParam->bCatRssiOffset = cfg_params->bCatRssiOffset;
 	pParam->fEnableDFSChnlScan = mac->scan.fEnableDFSChnlScan;
 	pParam->fEnableMCCMode = cfg_params->fenableMCCMode;
 	pParam->fAllowMCCGODiffBI = cfg_params->fAllowMCCGODiffBI;
@@ -12655,7 +12650,7 @@ QDF_STATUS csr_get_cfg_valid_channels(struct mac_context *mac,
 
 int8_t csr_get_cfg_max_tx_power(struct mac_context *mac, uint32_t ch_freq)
 {
-	return wlan_get_cfg_max_tx_power(mac, ch_freq);
+	return wlan_get_cfg_max_tx_power(mac->psoc, mac->pdev, ch_freq);
 }
 
 bool csr_roam_is_channel_valid(struct mac_context *mac, uint32_t chan_freq)
@@ -13670,57 +13665,6 @@ static QDF_STATUS csr_roam_start_wds(struct mac_context *mac, uint32_t sessionId
 	return status;
 }
 
-/**
- * csr_add_supported_5Ghz_channels()- Add valid 5Ghz channels
- * in Join req.
- * @mac_ctx: pointer to global mac structure
- * @chan_list: Pointer to channel list buffer to populate
- * @num_chan: Pointer to number of channels value to update
- * @supp_chan_ie: Boolean to check if we need to populate as IE
- *
- * This function is called to update valid 5Ghz channels
- * in Join req. If @supp_chan_ie is true, supported channels IE
- * format[chan num 1, num of channels 1, chan num 2, num of
- * channels 2, ..] is populated. Else, @chan_list would be a list
- * of supported channels[chan num 1, chan num 2..]
- *
- * Return: void
- */
-static void csr_add_supported_5Ghz_channels(struct mac_context *mac_ctx,
-						uint8_t *chan_list,
-						uint8_t *num_chnl,
-						bool supp_chan_ie)
-{
-	uint16_t i, j = 0;
-	uint32_t size = 0;
-	uint32_t *freq_list;
-
-	if (!chan_list) {
-		sme_err("chan_list buffer NULL");
-		*num_chnl = 0;
-		return;
-	}
-	size = mac_ctx->mlme_cfg->reg.valid_channel_list_num;
-	freq_list = mac_ctx->mlme_cfg->reg.valid_channel_freq_list;
-	for (i = 0, j = 0; i < size; i++) {
-		if (wlan_reg_is_dsrc_freq(freq_list[i]))
-			continue;
-		/* Only add 5ghz channels.*/
-		if (WLAN_REG_IS_5GHZ_CH_FREQ(freq_list[i])) {
-			chan_list[j] =
-				wlan_reg_freq_to_chan(mac_ctx->pdev,
-						      freq_list[i]);
-				j++;
-
-			if (supp_chan_ie) {
-				chan_list[j] = 1;
-				j++;
-			}
-		}
-	}
-	*num_chnl = (uint8_t)j;
-}
-
 #ifdef FEATURE_WLAN_ESE
 void csr_update_prev_ap_info(struct csr_roam_session *session,
 			     struct wlan_objmgr_vdev *vdev)
@@ -15050,7 +14994,7 @@ QDF_STATUS csr_send_join_req_msg(struct mac_context *mac, uint32_t sessionId,
 		else
 			csr_join_req->isOSENConnection = false;
 
-		csr_add_supported_5Ghz_channels(mac,
+		wlan_add_supported_5Ghz_channels(mac->psoc, mac->pdev,
 				csr_join_req->supportedChannels.channelList,
 				&csr_join_req->supportedChannels.numChnl,
 				false);
@@ -16375,73 +16319,36 @@ QDF_STATUS csr_invoke_neighbor_report_request(
 	return QDF_STATUS_SUCCESS;
 }
 
-/**
- * csr_cm_apend_assoc_ies() - Append specific IE to assoc IE's buffer
- * @req_buf: Pointer to Roam offload scan request
- * @ie_id: IE ID to be appended
- * @ie_len: IE length to be appended
- * @ie_data: IE data to be appended
- *
- * Return: None
- */
-static void
-csr_cm_append_assoc_ies(struct wlan_roam_scan_offload_params *rso_mode_cfg,
-			uint8_t ie_id, uint8_t ie_len,
-			const uint8_t *ie_data)
-{
-	uint32_t curr_length = rso_mode_cfg->assoc_ie_length;
-
-	if ((SIR_MAC_MAX_ADD_IE_LENGTH - curr_length) < ie_len) {
-		sme_err("Appending IE id: %d failed", ie_id);
-		return;
-	}
-
-	rso_mode_cfg->assoc_ie[curr_length] = ie_id;
-	rso_mode_cfg->assoc_ie[curr_length + 1] = ie_len;
-	qdf_mem_copy(&rso_mode_cfg->assoc_ie[curr_length + 2], ie_data, ie_len);
-	rso_mode_cfg->assoc_ie_length += (ie_len + 2);
-}
-
 #ifdef FEATURE_WLAN_ESE
-static void csr_cm_esr_populate_version_ie(
-			struct mac_context *mac_ctx,
+void wlan_cm_ese_populate_addtional_ies(struct wlan_objmgr_pdev *pdev,
+			struct wlan_mlme_psoc_ext_obj *mlme_obj,
+			uint8_t vdev_id,
 			struct wlan_roam_scan_offload_params *rso_mode_cfg)
-{
-	static const uint8_t ese_ie[] = {0x0, 0x40, 0x96, 0x3,
-					 ESE_VERSION_SUPPORTED};
-
-	/* Append ESE version IE if isEseIniFeatureEnabled INI is enabled */
-	if (mac_ctx->mlme_cfg->lfr.ese_enabled)
-		csr_cm_append_assoc_ies(rso_mode_cfg, WLAN_ELEMID_VENDOR,
-					sizeof(ese_ie), ese_ie);
-}
-
-/**
- * csr_cm_ese_populate_addtional_ies() - add IEs to reassoc frame
- * @mac_ctx: Pointer to global mac structure
- * @session: pointer to CSR session
- * @req_buf: Pointer to Roam offload scan request
- *
- * This function populates the TSPEC ie and appends the info
- * to assoc buffer.
- *
- * Return: None
- */
-static void csr_cm_ese_populate_addtional_ies(
-		struct mac_context *mac_ctx,
-		struct csr_roam_session *session,
-		struct wlan_roam_scan_offload_params *rso_mode_cfg)
 {
 	uint8_t tspec_ie_hdr[SIR_MAC_OUI_WME_HDR_MIN]
 			= { 0x00, 0x50, 0xf2, 0x02, 0x02, 0x01 };
 	uint8_t tspec_ie_buf[DOT11F_IE_WMMTSPEC_MAX_LEN], j;
 	ese_wmm_tspec_ie *tspec_ie;
 	tESETspecInfo ese_tspec;
+	struct mac_context *mac_ctx;
+	struct csr_roam_session *session;
+
+	mac_ctx = sme_get_mac_context();
+	if (!mac_ctx) {
+		sme_err("mac_ctx is NULL");
+		return;
+	}
+
+	session = CSR_GET_SESSION(mac_ctx, vdev_id);
+	if (!session) {
+		sme_err("session is null %d", vdev_id);
+		return;
+	}
 
 	tspec_ie = (ese_wmm_tspec_ie *)(tspec_ie_buf + SIR_MAC_OUI_WME_HDR_MIN);
 	if (csr_is_wmm_supported(mac_ctx) &&
-	    mac_ctx->mlme_cfg->lfr.ese_enabled &&
-	    csr_roam_is_ese_assoc(mac_ctx, session->sessionId)) {
+	    mlme_obj->cfg.lfr.ese_enabled &&
+	    wlan_cm_get_ese_assoc(pdev, session->sessionId)) {
 		ese_tspec.numTspecs = sme_qos_ese_retrieve_tspec_info(
 					mac_ctx, session->sessionId,
 					(tTspecInfo *)&ese_tspec.tspec[0]);
@@ -16451,123 +16358,26 @@ static void csr_cm_ese_populate_addtional_ies(
 			/* Populate the tspec_ie */
 			ese_populate_wmm_tspec(&ese_tspec.tspec[j].tspec,
 					       tspec_ie);
-			csr_cm_append_assoc_ies(rso_mode_cfg,
-						WLAN_ELEMID_VENDOR,
-						DOT11F_IE_WMMTSPEC_MAX_LEN,
-						tspec_ie_buf);
+			wlan_cm_append_assoc_ies(rso_mode_cfg,
+						 WLAN_ELEMID_VENDOR,
+						  DOT11F_IE_WMMTSPEC_MAX_LEN,
+						 tspec_ie_buf);
 		}
 	}
 }
-#else
-static inline void csr_cm_esr_populate_version_ie(
-			struct mac_context *mac_ctx,
-			struct wlan_roam_scan_offload_params *rso_mode_cfg)
-{}
-
-static inline void csr_cm_ese_populate_addtional_ies(
-		struct mac_context *mac_ctx,
-		struct csr_roam_session *session,
-		struct wlan_roam_scan_offload_params *rso_mode_cfg)
-{}
 #endif
 
-/**
- * csr_cm_update_driver_assoc_ies  - Append driver built IE's to assoc IE's
- * @mac_ctx: Pointer to global mac structure
- * @session: pointer to CSR session
- * @rso_mode_cfg: Pointer to Roam offload scan request
- *
- * Return: None
- */
-static void csr_cm_update_driver_assoc_ies(
-		struct mac_context *mac_ctx,
-		struct csr_roam_session *session,
-		struct wlan_roam_scan_offload_params *rso_mode_cfg)
+uint8_t *wlan_cm_get_rrm_cap_ie_data(void)
 {
-	uint32_t csr_11henable;
-	bool power_caps_populated = false;
-	struct rso_config *rso_cfg;
-	struct wlan_objmgr_vdev *vdev;
-	uint8_t *rrm_cap_ie_data =
-		(uint8_t *)&mac_ctx->rrm.rrmPEContext.rrmEnabledCaps;
-	uint8_t power_cap_ie_data[DOT11F_IE_POWERCAPS_MAX_LEN] = {
-		MIN_TX_PWR_CAP, MAX_TX_PWR_CAP};
-	uint8_t max_tx_pwr_cap = 0;
-	uint8_t supp_chan_ie[DOT11F_IE_SUPPCHANNELS_MAX_LEN], supp_chan_ie_len;
-	static const uint8_t qcn_ie[] = {0x8C, 0xFD, 0xF0, 0x1,
-					 QCN_IE_VERSION_SUBATTR_ID,
-					 QCN_IE_VERSION_SUBATTR_DATA_LEN,
-					 QCN_IE_VERSION_SUPPORTED,
-					 QCN_IE_SUBVERSION_SUPPORTED};
-
-	vdev = wlan_objmgr_get_vdev_by_id_from_psoc(mac_ctx->psoc,
-						    session->vdev_id,
-						    WLAN_MLME_CM_ID);
-	if (!vdev) {
-		mlme_err("vdev object is NULL for vdev %d", session->vdev_id);
-		return;
-	}
-	rso_cfg = wlan_cm_get_rso_config(vdev);
-	if (!rso_cfg) {
-		wlan_objmgr_vdev_release_ref(vdev, WLAN_MLME_CM_ID);
-		return;
-	}
-	/* Re-Assoc IE TLV parameters */
-	rso_mode_cfg->assoc_ie_length = rso_cfg->assoc_ie.len;
-	qdf_mem_copy(rso_mode_cfg->assoc_ie, rso_cfg->assoc_ie.ptr,
-		     rso_mode_cfg->assoc_ie_length);
-	wlan_objmgr_vdev_release_ref(vdev, WLAN_MLME_CM_ID);
-
-	if (session->pConnectBssDesc)
-		max_tx_pwr_cap = csr_get_cfg_max_tx_power(
-					mac_ctx,
-					session->pConnectBssDesc->chan_freq);
-
-	if (max_tx_pwr_cap && max_tx_pwr_cap < MAX_TX_PWR_CAP)
-		power_cap_ie_data[1] = max_tx_pwr_cap;
-	else
-		power_cap_ie_data[1] = MAX_TX_PWR_CAP;
-
-	csr_11henable = mac_ctx->mlme_cfg->gen.enabled_11h;
-
-	if (csr_11henable && csr_is11h_supported(mac_ctx)) {
-		/* Append power cap IE */
-		csr_cm_append_assoc_ies(rso_mode_cfg, WLAN_ELEMID_PWRCAP,
-					DOT11F_IE_POWERCAPS_MAX_LEN,
-					power_cap_ie_data);
-		power_caps_populated = true;
-
-		/* Append Supported channels IE */
-		csr_add_supported_5Ghz_channels(mac_ctx, supp_chan_ie,
-						&supp_chan_ie_len, true);
-
-		csr_cm_append_assoc_ies(rso_mode_cfg,
-					WLAN_ELEMID_SUPPCHAN,
-					supp_chan_ie_len, supp_chan_ie);
-	}
-
-	csr_cm_esr_populate_version_ie(mac_ctx, rso_mode_cfg);
-
-	if (mac_ctx->rrm.rrmPEContext.rrmEnable) {
-		/* Append RRM IE */
-		csr_cm_append_assoc_ies(rso_mode_cfg, WLAN_ELEMID_RRM,
-					DOT11F_IE_RRMENABLEDCAP_MAX_LEN,
-					rrm_cap_ie_data);
+	struct mac_context *mac_ctx;
 
-		/* Append Power cap IE if not appended already */
-		if (!power_caps_populated)
-			csr_cm_append_assoc_ies(rso_mode_cfg,
-						WLAN_ELEMID_PWRCAP,
-						DOT11F_IE_POWERCAPS_MAX_LEN,
-						power_cap_ie_data);
+	mac_ctx = sme_get_mac_context();
+	if (!mac_ctx) {
+		sme_err("mac_ctx is NULL");
+		return NULL;
 	}
 
-	csr_cm_ese_populate_addtional_ies(mac_ctx, session, rso_mode_cfg);
-
-	/* Append QCN IE if g_support_qcn_ie INI is enabled */
-	if (mac_ctx->mlme_cfg->sta.qcn_ie_support)
-		csr_cm_append_assoc_ies(rso_mode_cfg, WLAN_ELEMID_VENDOR,
-					sizeof(qcn_ie), qcn_ie);
+	return (uint8_t *)&mac_ctx->rrm.rrmPEContext.rrmEnabledCaps;
 }
 
 #if defined(WLAN_FEATURE_FILS_SK)
@@ -16676,8 +16486,7 @@ wlan_cm_roam_cmd_allowed(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id,
 
 	session = CSR_GET_SESSION(mac_ctx, vdev_id);
 	if (!session) {
-		QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR,
-			  "session is null");
+		mlme_err("session is null for vdev %d", vdev_id);
 		return QDF_STATUS_E_FAILURE;
 	}
 
@@ -16803,25 +16612,17 @@ wlan_cm_roam_cmd_allowed(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id,
 #ifdef WLAN_FEATURE_ROAM_OFFLOAD
 #ifdef WLAN_SAE_SINGLE_PMK
 static bool
-csr_cm_fill_rso_sae_single_pmk_info(struct mac_context *mac_ctx,
-				    struct wlan_rso_11i_params *rso_11i_info,
-				    uint8_t vdev_id)
+csr_cm_fill_rso_sae_single_pmk_info(struct wlan_objmgr_vdev *vdev,
+				    struct wlan_mlme_psoc_ext_obj *mlme_obj,
+				    struct wlan_rso_11i_params *rso_11i_info)
 {
 	struct wlan_mlme_sae_single_pmk single_pmk;
-	struct wlan_objmgr_vdev *vdev;
-
-	vdev = wlan_objmgr_get_vdev_by_id_from_psoc(mac_ctx->psoc, vdev_id,
-						    WLAN_LEGACY_SME_ID);
-	if (!vdev) {
-		sme_err("vdev is NULL");
-		return QDF_STATUS_E_NULL_VALUE;
-	}
 
 	wlan_mlme_get_sae_single_pmk_info(vdev, &single_pmk);
 
 	if (single_pmk.pmk_info.pmk_len && single_pmk.sae_single_pmk_ap &&
-	    mac_ctx->mlme_cfg->lfr.sae_single_pmk_feature_enabled) {
-		sme_debug("Update pmk with len %d same_pmk_info %d",
+	    mlme_obj->cfg.lfr.sae_single_pmk_feature_enabled) {
+		mlme_debug("Update pmk with len %d same_pmk_info %d",
 			  single_pmk.pmk_info.pmk_len,
 			  single_pmk.sae_single_pmk_ap);
 
@@ -16830,20 +16631,16 @@ csr_cm_fill_rso_sae_single_pmk_info(struct mac_context *mac_ctx,
 		qdf_mem_copy(rso_11i_info->psk_pmk, single_pmk.pmk_info.pmk,
 			     rso_11i_info->pmk_len);
 		rso_11i_info->is_sae_same_pmk = single_pmk.sae_single_pmk_ap;
-
-		wlan_objmgr_vdev_release_ref(vdev, WLAN_LEGACY_SME_ID);
 		return true;
 	}
 
-	wlan_objmgr_vdev_release_ref(vdev, WLAN_LEGACY_SME_ID);
-
 	return false;
 }
 #else
 static inline bool
-csr_cm_fill_rso_sae_single_pmk_info(struct mac_context *mac_ctx,
-				    struct wlan_rso_11i_params *rso_11i_info,
-				    uint8_t vdev_id)
+csr_cm_fill_rso_sae_single_pmk_info(struct wlan_objmgr_vdev *vdev,
+				    struct wlan_mlme_psoc_ext_obj *mlme_obj,
+				    struct wlan_rso_11i_params *rso_11i_info)
 {
 	return false;
 }
@@ -16869,99 +16666,97 @@ csr_cm_update_rso_adaptive_11r(struct wlan_rso_11r_params *dst,
 
 #ifdef FEATURE_WLAN_ESE
 static void
-csr_cm_update_rso_ese_info(struct mac_context *mac,
+csr_cm_update_rso_ese_info(struct wlan_objmgr_pdev *pdev,
 			   struct wlan_roam_scan_offload_params *rso_config,
-			   tpCsrNeighborRoamControlInfo roam_info,
-			   struct csr_roam_session *session)
+			   uint8_t vdev_id)
 {
-	enum csr_akm_type akm =
-	   mac->roam.roamSession[session->vdev_id].connectedProfile.AuthType;
+	struct mac_context *mac;
+	tpCsrNeighborRoamControlInfo roam_info;
+
+	mac = sme_get_mac_context();
+	if (!mac) {
+		mlme_err("mac_ctx is NULL");
+		return;
+	}
+
+	roam_info = &mac->roam.neighborRoamInfo[vdev_id];
 
 	rso_config->rso_ese_info.is_ese_assoc =
-		(csr_roam_is_ese_assoc(mac, session->vdev_id) &&
-		 akm == eCSR_AUTH_TYPE_OPEN_SYSTEM)  ||
-		(csr_is_auth_type_ese(akm));
+		wlan_cm_get_ese_assoc(pdev, vdev_id);
 	rso_config->rso_11r_info.is_11r_assoc = roam_info->is11rAssoc;
 }
 #else
 static inline void
-csr_cm_update_rso_ese_info(struct mac_context *mac,
+csr_cm_update_rso_ese_info(struct wlan_objmgr_pdev *pdev,
 			   struct wlan_roam_scan_offload_params *rso_config,
-			   tpCsrNeighborRoamControlInfo roam_info,
-			   struct csr_roam_session *session)
+			   uint8_t vdev_id)
 {}
 #endif
 
-/**
- * csr_cm_roam_scan_offload_fill_lfr3_config  - Fill Roam scan offload
- * related configs for WMI_ROAM_SCAN_MODE command to firmware.
- * @mac: Pointer to mac context
- * @session: Pointer to csr_roam_session
- * @vdev_id: vdev_id
- *
- * Return: QDF_STATUS
- */
-static QDF_STATUS csr_cm_roam_scan_offload_fill_lfr3_config(
-			struct mac_context *mac,
-			struct csr_roam_session *session,
+QDF_STATUS
+wlan_cm_roam_scan_offload_fill_lfr3_config(struct wlan_objmgr_vdev *vdev,
+			struct rso_config *rso_cfg,
 			struct wlan_roam_scan_offload_params *rso_config,
+			struct wlan_mlme_psoc_ext_obj *mlme_obj,
 			uint8_t command, uint32_t *mode)
 {
 	tSirMacCapabilityInfo self_caps;
 	tSirMacQosInfoStation sta_qos_info;
-	enum csr_akm_type akm;
-	eCsrEncryptionType encr;
 	uint16_t *final_caps_val;
 	uint8_t *qos_cfg_val, temp_val;
-	uint32_t pmkid_modes = mac->mlme_cfg->sta.pmkid_modes;
+	uint32_t pmkid_modes = mlme_obj->cfg.sta.pmkid_modes;
 	uint32_t val = 0;
-	uint16_t vdev_id = session->vdev_id;
+	uint8_t vdev_id = wlan_vdev_get_id(vdev);
 	qdf_size_t val_len;
 	QDF_STATUS status;
 	uint16_t rsn_caps = 0;
-	tpCsrNeighborRoamControlInfo roam_info =
-		&mac->roam.neighborRoamInfo[vdev_id];
-	struct wlan_objmgr_vdev *vdev;
-	struct rso_config *rso_cfg;
-
-	rso_config->roam_offload_enabled =
-		mac->mlme_cfg->lfr.lfr3_roaming_offload;
-	if (!rso_config->roam_offload_enabled)
-		return QDF_STATUS_SUCCESS;
+	int32_t uccipher, authmode, akm;
+	struct wlan_objmgr_pdev *pdev;
+	struct csr_roam_session *session;
+	struct mac_context *mac;
 
-	vdev = wlan_objmgr_get_vdev_by_id_from_pdev(mac->pdev, vdev_id,
-						    WLAN_LEGACY_SME_ID);
-	if (!vdev) {
-		sme_err("vdev object is NULL for vdev %d", vdev_id);
+	mac = sme_get_mac_context();
+	if (!mac) {
+		sme_err("mac_ctx is NULL");
 		return QDF_STATUS_E_FAILURE;
 	}
-	rso_cfg = wlan_cm_get_rso_config(vdev);
-	if (!rso_cfg) {
-		wlan_objmgr_vdev_release_ref(vdev, WLAN_LEGACY_SME_ID);
+
+	pdev = wlan_vdev_get_pdev(vdev);
+	if (!pdev)
+		return QDF_STATUS_E_INVAL;
+
+	session = CSR_GET_SESSION(mac, vdev_id);
+	if (!session) {
+		mlme_err("session is null for vdev %d", vdev_id);
 		return QDF_STATUS_E_FAILURE;
 	}
 
+	rso_config->roam_offload_enabled =
+		mlme_obj->cfg.lfr.lfr3_roaming_offload;
+	if (!rso_config->roam_offload_enabled)
+		return QDF_STATUS_SUCCESS;
+
 	/* FILL LFR3 specific roam scan mode TLV parameters */
 	rso_config->rso_lfr3_params.roam_rssi_cat_gap =
-		mac->roam.configParam.bCatRssiOffset;
+		mlme_obj->cfg.lfr.rso_user_config.cat_rssi_offset;
 	rso_config->rso_lfr3_params.prefer_5ghz =
-		(uint8_t)mac->mlme_cfg->lfr.roam_prefer_5ghz;
+		mlme_obj->cfg.lfr.roam_prefer_5ghz;
 	rso_config->rso_lfr3_params.select_5ghz_margin =
-		mac->mlme_cfg->gen.select_5ghz_margin;
+		mlme_obj->cfg.gen.select_5ghz_margin;
 	rso_config->rso_lfr3_params.reassoc_failure_timeout =
-		mac->mlme_cfg->timeouts.reassoc_failure_timeout;
+		mlme_obj->cfg.timeouts.reassoc_failure_timeout;
 	rso_config->rso_lfr3_params.ho_delay_for_rx =
-		mac->mlme_cfg->lfr.ho_delay_for_rx;
+		mlme_obj->cfg.lfr.ho_delay_for_rx;
 	rso_config->rso_lfr3_params.roam_retry_count =
-		mac->mlme_cfg->lfr.roam_preauth_retry_count;
+		mlme_obj->cfg.lfr.roam_preauth_retry_count;
 	rso_config->rso_lfr3_params.roam_preauth_no_ack_timeout =
-		mac->mlme_cfg->lfr.roam_preauth_no_ack_timeout;
+		mlme_obj->cfg.lfr.roam_preauth_no_ack_timeout;
 	rso_config->rso_lfr3_params.rct_validity_timer =
-		mac->mlme_cfg->btm.rct_validity_timer;
+		mlme_obj->cfg.btm.rct_validity_timer;
 	rso_config->rso_lfr3_params.disable_self_roam =
-		!mac->mlme_cfg->lfr.enable_self_bss_roam;
+		!mlme_obj->cfg.lfr.enable_self_bss_roam;
 	if (!rso_cfg->roam_control_enable &&
-	    mac->mlme_cfg->lfr.roam_force_rssi_trigger)
+	    mlme_obj->cfg.lfr.roam_force_rssi_trigger)
 		*mode |= WMI_ROAM_SCAN_MODE_RSSI_CHANGE;
 	/*
 	 * Self rsn caps aren't sent to firmware, so in case of PMF required,
@@ -16973,37 +16768,36 @@ static QDF_STATUS csr_cm_roam_scan_offload_fill_lfr3_config(
 	 * beacon Caps.
 	 */
 	rsn_caps = rso_cfg->rsn_cap;
-	wlan_objmgr_vdev_release_ref(vdev, WLAN_LEGACY_SME_ID);
 
 	/* Fill LFR3 specific self capabilities for roam scan mode TLV */
 	self_caps.ess = 1;
 	self_caps.ibss = 0;
 
-	val = mac->mlme_cfg->wep_params.is_privacy_enabled;
+	val = mlme_obj->cfg.wep_params.is_privacy_enabled;
 	if (val)
 		self_caps.privacy = 1;
 
-	if (mac->mlme_cfg->ht_caps.short_preamble)
+	if (mlme_obj->cfg.ht_caps.short_preamble)
 		self_caps.shortPreamble = 1;
 
 	self_caps.pbcc = 0;
 	self_caps.channelAgility = 0;
 
-	if (mac->mlme_cfg->feature_flags.enable_short_slot_time_11g)
+	if (mlme_obj->cfg.feature_flags.enable_short_slot_time_11g)
 		self_caps.shortSlotTime = 1;
 
-	if (mac->mlme_cfg->gen.enabled_11h)
+	if (mlme_obj->cfg.gen.enabled_11h)
 		self_caps.spectrumMgt = 1;
 
-	if (mac->mlme_cfg->wmm_params.qos_enabled)
+	if (mlme_obj->cfg.wmm_params.qos_enabled)
 		self_caps.qos = 1;
 
-	if (mac->mlme_cfg->roam_scoring.apsd_enabled)
+	if (mlme_obj->cfg.roam_scoring.apsd_enabled)
 		self_caps.apsd = 1;
 
-	self_caps.rrm = mac->rrm.rrmConfig.rrm_enabled;
+	self_caps.rrm = mlme_obj->cfg.rrm_config.rrm_enabled;
 
-	val = mac->mlme_cfg->feature_flags.enable_block_ack;
+	val = mlme_obj->cfg.feature_flags.enable_block_ack;
 	self_caps.delayedBA =
 		(uint16_t)((val >> WNI_CFG_BLOCK_ACK_ENABLED_DELAYED) & 1);
 	self_caps.immediateBA =
@@ -17014,20 +16808,20 @@ static QDF_STATUS csr_cm_roam_scan_offload_fill_lfr3_config(
 		(rsn_caps << RSN_CAPS_SHIFT) | ((*final_caps_val) & 0xFFFF);
 
 	rso_config->rso_lfr3_caps.ht_caps_info =
-		*(uint16_t *)&mac->mlme_cfg->ht_caps.ht_cap_info;
+		*(uint16_t *)&mlme_obj->cfg.ht_caps.ht_cap_info;
 	rso_config->rso_lfr3_caps.ampdu_param =
-		*(uint8_t *)&mac->mlme_cfg->ht_caps.ampdu_params;
+		*(uint8_t *)&mlme_obj->cfg.ht_caps.ampdu_params;
 	rso_config->rso_lfr3_caps.ht_ext_cap =
-		*(uint16_t *)&mac->mlme_cfg->ht_caps.ext_cap_info;
+		*(uint16_t *)&mlme_obj->cfg.ht_caps.ext_cap_info;
 
-	temp_val = (uint8_t)mac->mlme_cfg->vht_caps.vht_cap_info.tx_bf_cap;
+	temp_val = (uint8_t)mlme_obj->cfg.vht_caps.vht_cap_info.tx_bf_cap;
 	rso_config->rso_lfr3_caps.ht_txbf = temp_val & 0xFF;
-	temp_val = (uint8_t)mac->mlme_cfg->vht_caps.vht_cap_info.as_cap;
+	temp_val = (uint8_t)mlme_obj->cfg.vht_caps.vht_cap_info.as_cap;
 	rso_config->rso_lfr3_caps.asel_cap = temp_val & 0xFF;
 
 	qdf_mem_zero(&sta_qos_info, sizeof(tSirMacQosInfoStation));
 	sta_qos_info.maxSpLen =
-		(uint8_t)mac->mlme_cfg->wmm_params.max_sp_length;
+		(uint8_t)mlme_obj->cfg.wmm_params.max_sp_length;
 	sta_qos_info.moreDataAck = 0;
 	sta_qos_info.qack = 0;
 	sta_qos_info.acbe_uapsd = SIR_UAPSD_GET(ACBE, session->uapsd_mask);
@@ -17044,7 +16838,7 @@ static QDF_STATUS csr_cm_roam_scan_offload_fill_lfr3_config(
 	val_len = ROAM_OFFLOAD_NUM_MCS_SET;
 	status =
 	    wlan_mlme_get_cfg_str((uint8_t *)rso_config->rso_lfr3_caps.mcsset,
-				  &mac->mlme_cfg->rates.supported_mcs_set,
+				  &mlme_obj->cfg.rates.supported_mcs_set,
 				  &val_len);
 	if (QDF_IS_STATUS_ERROR(status)) {
 		mlme_err("Failed to get CFG_SUPPORTED_MCS_SET");
@@ -17053,16 +16847,15 @@ static QDF_STATUS csr_cm_roam_scan_offload_fill_lfr3_config(
 
 	/* Update 11i TLV related Fields */
 	rso_config->rso_11i_info.roam_key_mgmt_offload_enabled =
-			mac->mlme_cfg->lfr.lfr3_roaming_offload;
+			mlme_obj->cfg.lfr.lfr3_roaming_offload;
 	rso_config->rso_11i_info.fw_okc =
 			(pmkid_modes & CFG_PMKID_MODES_OKC) ? 1 : 0;
 	rso_config->rso_11i_info.fw_pmksa_cache =
 			(pmkid_modes & CFG_PMKID_MODES_PMKSA_CACHING) ? 1 : 0;
 
 	/* Check whether to send psk_pmk or sae_single pmk info */
-	if (!csr_cm_fill_rso_sae_single_pmk_info(mac,
-						 &rso_config->rso_11i_info,
-						 vdev_id)) {
+	if (!csr_cm_fill_rso_sae_single_pmk_info(vdev, mlme_obj,
+						 &rso_config->rso_11i_info)) {
 		rso_config->rso_11i_info.is_sae_same_pmk = false;
 		qdf_mem_copy(rso_config->rso_11i_info.psk_pmk, session->psk_pmk,
 			     sizeof(rso_config->rso_11i_info.psk_pmk));
@@ -17070,7 +16863,7 @@ static QDF_STATUS csr_cm_roam_scan_offload_fill_lfr3_config(
 	}
 
 	rso_config->rso_11r_info.enable_ft_im_roaming =
-		mac->mlme_cfg->lfr.enable_ft_im_roaming;
+		mlme_obj->cfg.lfr.enable_ft_im_roaming;
 	rso_config->rso_11r_info.mdid.mdie_present =
 		session->connectedProfile.mdid.mdie_present;
 	rso_config->rso_11r_info.mdid.mobility_domain =
@@ -17087,246 +16880,18 @@ static QDF_STATUS csr_cm_roam_scan_offload_fill_lfr3_config(
 
 	csr_cm_update_rso_adaptive_11r(&rso_config->rso_11r_info,
 				       session);
-	csr_cm_update_rso_ese_info(mac, rso_config, roam_info, session);
+	csr_cm_update_rso_ese_info(pdev, rso_config, vdev_id);
+	uccipher = wlan_crypto_get_param(vdev, WLAN_CRYPTO_PARAM_UCAST_CIPHER);
+	authmode = wlan_crypto_get_param(vdev, WLAN_CRYPTO_PARAM_AUTH_MODE);
+	akm = wlan_crypto_get_param(vdev, WLAN_CRYPTO_PARAM_KEY_MGMT);
 
-	akm = mac->roam.roamSession[vdev_id].connectedProfile.AuthType;
-	encr =
-	mac->roam.roamSession[vdev_id].connectedProfile.EncryptionType;
-	rso_config->akm = e_csr_auth_type_to_rsn_authmode(akm, encr);
-
-	return QDF_STATUS_SUCCESS;
-}
-#else
-static inline QDF_STATUS
-csr_cm_roam_scan_offload_fill_lfr3_config(
-			struct mac_context *mac,
-			struct csr_roam_session *session,
-			struct wlan_roam_scan_offload_params *rso_config,
-			uint8_t command, uint32_t *mode)
-{
-	if (mac->mlme_cfg->lfr.roam_force_rssi_trigger)
-		*mode |= WMI_ROAM_SCAN_MODE_RSSI_CHANGE;
+	rso_config->akm =
+		cm_crpto_authmode_to_wmi_authmode(authmode, akm, uccipher);
 
 	return QDF_STATUS_SUCCESS;
 }
 #endif
 
-static void
-csr_cm_roam_scan_offload_fill_scan_params(
-		struct mac_context *mac,
-		struct csr_roam_session *session,
-		struct wlan_roam_scan_offload_params *rso_mode_cfg,
-		struct wlan_roam_scan_channel_list *rso_chan_info,
-		uint8_t command)
-{
-	struct wlan_roam_scan_params *scan_params =
-			&rso_mode_cfg->rso_scan_params;
-	uint8_t channels_per_burst = 0;
-	uint16_t roam_scan_home_away_time;
-	eSirDFSRoamScanMode allow_dfs_ch_roam;
-	struct wlan_objmgr_vdev *vdev;
-	struct rso_config *rso_cfg;
-	struct rso_cfg_params *cfg_params;
-	struct wlan_mlme_psoc_ext_obj *mlme_obj;
-
-	qdf_mem_zero(scan_params, sizeof(*scan_params));
-	if (command == ROAM_SCAN_OFFLOAD_STOP)
-		return;
-
-	mlme_obj = mlme_get_psoc_ext_obj(mac->psoc);
-	if (!mlme_obj)
-		return;
-
-	vdev = wlan_objmgr_get_vdev_by_id_from_pdev(mac->pdev, session->vdev_id,
-						    WLAN_LEGACY_SME_ID);
-	if (!vdev) {
-		sme_err("vdev object is NULL for vdev %d", session->vdev_id);
-		return;
-	}
-	rso_cfg = wlan_cm_get_rso_config(vdev);
-	if (!rso_cfg) {
-		wlan_objmgr_vdev_release_ref(vdev, WLAN_LEGACY_SME_ID);
-		return;
-	}
-	cfg_params = &rso_cfg->cfg_param;
-
-	/* Parameters updated after association is complete */
-	wlan_scan_cfg_get_passive_dwelltime(mac->psoc,
-					    &scan_params->dwell_time_passive);
-	/*
-	 * Here is the formula,
-	 * T(HomeAway) = N * T(dwell) + (N+1) * T(cs)
-	 * where N is number of channels scanned in single burst
-	 */
-	scan_params->dwell_time_active = cfg_params->max_chan_scan_time;
-
-	roam_scan_home_away_time = cfg_params->roam_scan_home_away_time;
-	if (roam_scan_home_away_time <
-	    (scan_params->dwell_time_active +
-	     (2 * ROAM_SCAN_CHANNEL_SWITCH_TIME))) {
-		sme_debug("Disable Home away time(%d) as it is less than (2*RF switching time + channel max time)(%d)",
-			  roam_scan_home_away_time,
-			  (scan_params->dwell_time_active +
-			   (2 * ROAM_SCAN_CHANNEL_SWITCH_TIME)));
-		roam_scan_home_away_time = 0;
-	}
-
-	if (roam_scan_home_away_time < (2 * ROAM_SCAN_CHANNEL_SWITCH_TIME)) {
-		/* clearly we can't follow home away time.
-		 * Make it a split scan.
-		 */
-		scan_params->burst_duration = 0;
-	} else {
-		channels_per_burst =
-		  (roam_scan_home_away_time - ROAM_SCAN_CHANNEL_SWITCH_TIME) /
-		  (scan_params->dwell_time_active + ROAM_SCAN_CHANNEL_SWITCH_TIME);
-
-		if (channels_per_burst < 1) {
-			/* dwell time and home away time conflicts */
-			/* we will override dwell time */
-			scan_params->dwell_time_active =
-				roam_scan_home_away_time -
-				(2 * ROAM_SCAN_CHANNEL_SWITCH_TIME);
-			scan_params->burst_duration =
-				scan_params->dwell_time_active;
-		} else {
-			scan_params->burst_duration =
-				channels_per_burst *
-				scan_params->dwell_time_active;
-		}
-	}
-
-	allow_dfs_ch_roam =
-		(eSirDFSRoamScanMode)mlme_obj->cfg.lfr.roaming_dfs_channel;
-	/* Roaming on DFS channels is supported and it is not
-	 * app channel list. It is ok to override homeAwayTime
-	 * to accommodate DFS dwell time in burst
-	 * duration.
-	 */
-	if (allow_dfs_ch_roam == SIR_ROAMING_DFS_CHANNEL_ENABLED_NORMAL &&
-	    roam_scan_home_away_time > 0  &&
-	    rso_chan_info->chan_cache_type != CHANNEL_LIST_STATIC)
-		scan_params->burst_duration =
-			QDF_MAX(scan_params->burst_duration,
-				scan_params->dwell_time_passive);
-
-	scan_params->min_rest_time = cfg_params->neighbor_scan_min_period;
-	scan_params->max_rest_time = cfg_params->neighbor_scan_period;
-	scan_params->repeat_probe_time =
-		(cfg_params->roam_scan_n_probes > 0) ?
-			QDF_MAX(scan_params->dwell_time_active /
-				cfg_params->roam_scan_n_probes, 1) : 0;
-	scan_params->probe_spacing_time = 0;
-	scan_params->probe_delay = 0;
-	/* 30 seconds for full scan cycle */
-	scan_params->max_scan_time = ROAM_SCAN_HW_DEF_SCAN_MAX_DURATION;
-	scan_params->idle_time = scan_params->min_rest_time;
-	scan_params->n_probes = cfg_params->roam_scan_n_probes;
-
-	if (allow_dfs_ch_roam == SIR_ROAMING_DFS_CHANNEL_DISABLED) {
-		scan_params->scan_ctrl_flags |= WMI_SCAN_BYPASS_DFS_CHN;
-	} else {
-		/* Roaming scan on DFS channel is allowed.
-		 * No need to change any flags for default
-		 * allowDFSChannelRoam = 1.
-		 * Special case where static channel list is given by\
-		 * application that contains DFS channels.
-		 * Assume that the application has knowledge of matching
-		 * APs being active and that probe request transmission
-		 * is permitted on those channel.
-		 * Force active scans on those channels.
-		 */
-
-		if (allow_dfs_ch_roam ==
-		    SIR_ROAMING_DFS_CHANNEL_ENABLED_ACTIVE &&
-		    rso_chan_info->chan_cache_type == CHANNEL_LIST_STATIC &&
-		    rso_chan_info->chan_count)
-			scan_params->scan_ctrl_flags |=
-				WMI_SCAN_FLAG_FORCE_ACTIVE_ON_DFS;
-	}
-
-	scan_params->rso_adaptive_dwell_mode =
-		mlme_obj->cfg.lfr.adaptive_roamscan_dwell_mode;
-	wlan_objmgr_vdev_release_ref(vdev, WLAN_LEGACY_SME_ID);
-}
-
-/**
- * csr_cm_roam_scan_offload_fill_rso_configs  - Fill Roam scan offload related
- * configs for WMI_ROAM_SCAN_MODE command to firmware.
- * @mac: Pointer to mac context
- * @session: Pointer to csr_roam_session
- * @vdev_id: vdev_id
- */
-static void csr_cm_roam_scan_offload_fill_rso_configs(
-			struct mac_context *mac,
-			struct csr_roam_session *session,
-			struct wlan_roam_scan_offload_params *rso_mode_cfg,
-			struct wlan_roam_scan_channel_list *rso_chan_info,
-			uint8_t command, uint16_t reason)
-{
-	uint8_t vdev_id = session->vdev_id;
-	uint32_t mode = 0;
-	struct wlan_objmgr_vdev *vdev;
-	struct rso_config *rso_cfg;
-
-	vdev = wlan_objmgr_get_vdev_by_id_from_pdev(mac->pdev, vdev_id,
-						    WLAN_LEGACY_SME_ID);
-	if (!vdev) {
-		sme_err("vdev object is NULL for vdev %d", vdev_id);
-		return;
-	}
-	rso_cfg = wlan_cm_get_rso_config(vdev);
-	if (!rso_cfg) {
-		wlan_objmgr_vdev_release_ref(vdev, WLAN_LEGACY_SME_ID);
-		return;
-	}
-
-	qdf_mem_zero(rso_mode_cfg, sizeof(*rso_mode_cfg));
-
-	rso_mode_cfg->vdev_id = session->vdev_id;
-	rso_mode_cfg->is_rso_stop = (command == ROAM_SCAN_OFFLOAD_STOP);
-	rso_mode_cfg->roaming_scan_policy =
-		mac->mlme_cfg->lfr.roaming_scan_policy;
-
-	/* Fill ROAM SCAN mode TLV parameters */
-	if (rso_cfg->cfg_param.empty_scan_refresh_period)
-		mode |= WMI_ROAM_SCAN_MODE_PERIODIC;
-	wlan_objmgr_vdev_release_ref(vdev, WLAN_LEGACY_SME_ID);
-
-	rso_mode_cfg->rso_mode_info.min_delay_btw_scans =
-			mac->mlme_cfg->lfr.min_delay_btw_roam_scans;
-	rso_mode_cfg->rso_mode_info.min_delay_roam_trigger_bitmask =
-			mac->mlme_cfg->lfr.roam_trigger_reason_bitmask;
-
-	if (command == ROAM_SCAN_OFFLOAD_STOP) {
-		if (reason == REASON_ROAM_STOP_ALL ||
-		    reason == REASON_DISCONNECTED ||
-		    reason == REASON_ROAM_SYNCH_FAILED) {
-			mode = WMI_ROAM_SCAN_MODE_NONE;
-		} else {
-			if (csr_is_roam_offload_enabled(mac))
-				mode = WMI_ROAM_SCAN_MODE_NONE |
-					WMI_ROAM_SCAN_MODE_ROAMOFFLOAD;
-			else
-				mode = WMI_ROAM_SCAN_MODE_NONE;
-		}
-	}
-
-	rso_mode_cfg->rso_mode_info.roam_scan_mode = mode;
-	if (command == ROAM_SCAN_OFFLOAD_STOP)
-		return;
-
-	csr_cm_roam_scan_offload_fill_lfr3_config(mac, session, rso_mode_cfg,
-						  command, &mode);
-	rso_mode_cfg->rso_mode_info.roam_scan_mode = mode;
-	csr_cm_roam_scan_offload_fill_scan_params(mac, session, rso_mode_cfg,
-						  rso_chan_info,
-						  command);
-	csr_cm_update_driver_assoc_ies(mac, session, rso_mode_cfg);
-	cm_roam_scan_offload_add_fils_params(mac->psoc, rso_mode_cfg,
-					     vdev_id);
-}
-
 /**
  * csr_cm_roam_scan_btm_offload() - set roam scan btm offload parameters
  * @mac_ctx: global mac ctx
@@ -17403,12 +16968,6 @@ wlan_cm_roam_fill_start_req(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id,
 		return QDF_STATUS_E_FAILURE;
 	}
 
-	csr_cm_roam_scan_offload_fill_rso_configs(mac_ctx, session,
-						  &req->rso_config,
-						  &req->rso_chan_info,
-						  ROAM_SCAN_OFFLOAD_START,
-						  reason);
-
 	csr_cm_roam_scan_btm_offload(mac_ctx, session, &req->btm_config);
 
 	/* 11k offload is enabled during RSO Start after connect indication */
@@ -17419,66 +16978,6 @@ wlan_cm_roam_fill_start_req(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id,
 	return QDF_STATUS_SUCCESS;
 }
 
-QDF_STATUS
-wlan_cm_roam_fill_stop_req(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id,
-			   struct wlan_roam_stop_config *req, uint8_t reason)
-{
-	QDF_STATUS status = QDF_STATUS_SUCCESS;
-	struct mac_context *mac_ctx;
-	struct csr_roam_session *session;
-
-	mac_ctx = sme_get_mac_context();
-	if (!mac_ctx) {
-		sme_err("mac_ctx is NULL");
-		return QDF_STATUS_E_FAILURE;
-	}
-
-	session = CSR_GET_SESSION(mac_ctx, vdev_id);
-	if (!session) {
-		sme_err("session is null %d", vdev_id);
-		return QDF_STATUS_E_FAILURE;
-	}
-
-	csr_cm_roam_scan_offload_fill_rso_configs(mac_ctx, session,
-						  &req->rso_config,
-						  NULL,
-						  ROAM_SCAN_OFFLOAD_STOP,
-						  req->reason);
-
-	return status;
-}
-
-QDF_STATUS
-wlan_cm_roam_fill_update_config_req(struct wlan_objmgr_psoc *psoc,
-				    uint8_t vdev_id,
-				    struct wlan_roam_update_config *req,
-				    uint8_t reason)
-{
-	struct csr_roam_session *session;
-	struct mac_context *mac_ctx;
-
-	mac_ctx = sme_get_mac_context();
-	if (!mac_ctx) {
-		sme_err("mac_ctx is NULL");
-		return QDF_STATUS_E_FAILURE;
-	}
-
-	session = CSR_GET_SESSION(mac_ctx, vdev_id);
-	if (!session) {
-		QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR,
-			  "session is null");
-		return QDF_STATUS_E_FAILURE;
-	}
-
-	csr_cm_roam_scan_offload_fill_rso_configs(mac_ctx, session,
-						  &req->rso_config,
-						  &req->rso_chan_info,
-						  ROAM_SCAN_OFFLOAD_UPDATE_CFG,
-						  reason);
-
-	return QDF_STATUS_SUCCESS;
-}
-
 QDF_STATUS
 wlan_cm_roam_scan_offload_rsp(uint8_t vdev_id, uint8_t reason)
 {

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

@@ -29,8 +29,6 @@
 #include "cds_reg_service.h"
 #include "wlan_objmgr_vdev_obj.h"
 
-#define CSR_DEFAULT_RSSI_DB_GAP     30  /* every 30 dbm for one category */
-
 #ifdef QCA_WIFI_3_0_EMU
 #define CSR_ACTIVE_SCAN_LIST_CMD_TIMEOUT (1000*30*20)
 #else

+ 0 - 4
core/wma/inc/wma.h

@@ -1431,10 +1431,6 @@ struct wma_roam_invoke_cmd {
 	bool forced_roaming;
 };
 
-A_UINT32 e_csr_auth_type_to_rsn_authmode(enum csr_akm_type authtype,
-					 eCsrEncryptionType encr);
-A_UINT32 e_csr_encryption_type_to_rsn_cipherset(eCsrEncryptionType encr);
-
 /**
  * wma_trigger_uapsd_params() - set trigger uapsd parameter
  * @wmi_handle: wma handle

+ 0 - 5
core/wma/inc/wma_internal.h

@@ -347,11 +347,6 @@ wma_roam_scan_chan_list_event_handler(WMA_HANDLE handle, uint8_t *event,
 QDF_STATUS wma_update_channel_list(WMA_HANDLE handle,
 				   tSirUpdateChanList *chan_list);
 
-A_UINT32 e_csr_auth_type_to_rsn_authmode(enum csr_akm_type authtype,
-					 eCsrEncryptionType encr);
-
-A_UINT32 e_csr_encryption_type_to_rsn_cipherset(eCsrEncryptionType encr);
-
 QDF_STATUS wma_roam_scan_bmiss_cnt(tp_wma_handle wma_handle,
 				   A_INT32 first_bcnt,
 				   A_UINT32 final_bcnt, uint32_t vdev_id);

+ 0 - 123
core/wma/src/wma_scan_roam.c

@@ -292,129 +292,6 @@ int wma_roam_vdev_disconnect_event_handler(void *handle, uint8_t *event,
 }
 #endif
 
-/**
- * e_csr_auth_type_to_rsn_authmode() - map csr auth type to rsn authmode
- * @authtype: CSR authtype
- * @encr: CSR Encryption
- *
- * Map CSR's authentication type into RSN auth mode used by firmware
- *
- * Return: WMI RSN auth mode
- */
-A_UINT32 e_csr_auth_type_to_rsn_authmode(enum csr_akm_type authtype,
-					 eCsrEncryptionType encr)
-{
-	switch (authtype) {
-	case eCSR_AUTH_TYPE_OPEN_SYSTEM:
-		return WMI_AUTH_OPEN;
-	case eCSR_AUTH_TYPE_WPA:
-		return WMI_AUTH_WPA;
-	case eCSR_AUTH_TYPE_WPA_PSK:
-		return WMI_AUTH_WPA_PSK;
-	case eCSR_AUTH_TYPE_RSN:
-		return WMI_AUTH_RSNA;
-	case eCSR_AUTH_TYPE_RSN_PSK:
-		return WMI_AUTH_RSNA_PSK;
-	case eCSR_AUTH_TYPE_FT_RSN:
-		return WMI_AUTH_FT_RSNA;
-	case eCSR_AUTH_TYPE_FT_RSN_PSK:
-		return WMI_AUTH_FT_RSNA_PSK;
-#ifdef FEATURE_WLAN_WAPI
-	case eCSR_AUTH_TYPE_WAPI_WAI_CERTIFICATE:
-		return WMI_AUTH_WAPI;
-	case eCSR_AUTH_TYPE_WAPI_WAI_PSK:
-		return WMI_AUTH_WAPI_PSK;
-#endif /* FEATURE_WLAN_WAPI */
-#ifdef FEATURE_WLAN_ESE
-	case eCSR_AUTH_TYPE_CCKM_WPA:
-		return WMI_AUTH_CCKM_WPA;
-	case eCSR_AUTH_TYPE_CCKM_RSN:
-		return WMI_AUTH_CCKM_RSNA;
-#endif /* FEATURE_WLAN_ESE */
-#ifdef WLAN_FEATURE_11W
-	case eCSR_AUTH_TYPE_RSN_PSK_SHA256:
-		return WMI_AUTH_RSNA_PSK_SHA256;
-	case eCSR_AUTH_TYPE_RSN_8021X_SHA256:
-		return WMI_AUTH_RSNA_8021X_SHA256;
-#endif /* WLAN_FEATURE_11W */
-	case eCSR_AUTH_TYPE_NONE:
-	case eCSR_AUTH_TYPE_AUTOSWITCH:
-		/* In case of WEP and other keys, NONE means OPEN auth */
-		if (encr == eCSR_ENCRYPT_TYPE_WEP40_STATICKEY ||
-		    encr == eCSR_ENCRYPT_TYPE_WEP104_STATICKEY ||
-		    encr == eCSR_ENCRYPT_TYPE_WEP40 ||
-		    encr == eCSR_ENCRYPT_TYPE_WEP104 ||
-		    encr == eCSR_ENCRYPT_TYPE_TKIP ||
-		    encr == eCSR_ENCRYPT_TYPE_AES ||
-		    encr == eCSR_ENCRYPT_TYPE_AES_GCMP ||
-		    encr == eCSR_ENCRYPT_TYPE_AES_GCMP_256) {
-			return WMI_AUTH_OPEN;
-		}
-		return WMI_AUTH_NONE;
-	case eCSR_AUTH_TYPE_SHARED_KEY:
-		return WMI_AUTH_SHARED;
-	case eCSR_AUTH_TYPE_FILS_SHA256:
-		return WMI_AUTH_RSNA_FILS_SHA256;
-	case eCSR_AUTH_TYPE_FILS_SHA384:
-		return WMI_AUTH_RSNA_FILS_SHA384;
-	case eCSR_AUTH_TYPE_FT_FILS_SHA256:
-		return WMI_AUTH_FT_RSNA_FILS_SHA256;
-	case eCSR_AUTH_TYPE_FT_FILS_SHA384:
-		return WMI_AUTH_FT_RSNA_FILS_SHA384;
-	case eCSR_AUTH_TYPE_SUITEB_EAP_SHA256:
-		return WMI_AUTH_RSNA_SUITE_B_8021X_SHA256;
-	case eCSR_AUTH_TYPE_SUITEB_EAP_SHA384:
-		return WMI_AUTH_RSNA_SUITE_B_8021X_SHA384;
-	case eCSR_AUTH_TYPE_OWE:
-		return WMI_AUTH_WPA3_OWE;
-	case eCSR_AUTH_TYPE_SAE:
-		return WMI_AUTH_WPA3_SAE;
-	case eCSR_AUTH_TYPE_FT_SAE:
-		return WMI_AUTH_FT_RSNA_SAE;
-	case eCSR_AUTH_TYPE_FT_SUITEB_EAP_SHA384:
-		return WMI_AUTH_FT_RSNA_SUITE_B_8021X_SHA384;
-	default:
-		return WMI_AUTH_NONE;
-	}
-}
-
-/**
- * e_csr_encryption_type_to_rsn_cipherset() - map csr enc type to ESN cipher
- * @encr: CSR Encryption
- *
- * Map CSR's encryption type into RSN cipher types used by firmware
- *
- * Return: WMI RSN cipher
- */
-A_UINT32 e_csr_encryption_type_to_rsn_cipherset(eCsrEncryptionType encr)
-{
-
-	switch (encr) {
-	case eCSR_ENCRYPT_TYPE_WEP40_STATICKEY:
-	case eCSR_ENCRYPT_TYPE_WEP104_STATICKEY:
-	case eCSR_ENCRYPT_TYPE_WEP40:
-	case eCSR_ENCRYPT_TYPE_WEP104:
-		return WMI_CIPHER_WEP;
-	case eCSR_ENCRYPT_TYPE_TKIP:
-		return WMI_CIPHER_TKIP;
-	case eCSR_ENCRYPT_TYPE_AES:
-		return WMI_CIPHER_AES_CCM;
-	/* FWR will use key length to distinguish GCMP 128 or 256 */
-	case eCSR_ENCRYPT_TYPE_AES_GCMP:
-	case eCSR_ENCRYPT_TYPE_AES_GCMP_256:
-		return WMI_CIPHER_AES_GCM;
-#ifdef FEATURE_WLAN_WAPI
-	case eCSR_ENCRYPT_TYPE_WPI:
-		return WMI_CIPHER_WAPI;
-#endif /* FEATURE_WLAN_WAPI */
-	case eCSR_ENCRYPT_TYPE_ANY:
-		return WMI_CIPHER_ANY;
-	case eCSR_ENCRYPT_TYPE_NONE:
-	default:
-		return WMI_CIPHER_NONE;
-	}
-}
-
 /**
  * wma_process_set_pdev_ie_req() - process the pdev set IE req
  * @wma: Pointer to wma handle