Kaynağa Gözat

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

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

Change-Id: Iaef2e4b08853f559a2da2c26b774ea29ecde04aa
CRs-Fixed: 2857072
gaurank kathpalia 4 yıl önce
ebeveyn
işleme
4abae1f448

+ 2 - 18
components/target_if/connection_mgr/src/target_if_cm_roam_offload.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2020, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2020-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 above
@@ -979,8 +979,6 @@ target_if_cm_roam_send_stop(struct wlan_objmgr_vdev *vdev,
 {
 	QDF_STATUS status = QDF_STATUS_SUCCESS;
 	wmi_unified_t wmi_handle;
-	uint32_t mode = 0;
-	bool is_roam_offload_enabled = false;
 	struct wlan_objmgr_psoc *psoc;
 	uint8_t vdev_id;
 
@@ -1011,20 +1009,6 @@ target_if_cm_roam_send_stop(struct wlan_objmgr_vdev *vdev,
 		return QDF_STATUS_E_INVAL;
 	}
 
-	wlan_mlme_get_roaming_offload(psoc, &is_roam_offload_enabled);
-	if (req->reason == REASON_ROAM_STOP_ALL ||
-	    req->reason == REASON_DISCONNECTED ||
-	    req->reason == REASON_ROAM_SYNCH_FAILED ||
-	    req->reason == REASON_SUPPLICANT_DISABLED_ROAMING) {
-		mode = WMI_ROAM_SCAN_MODE_NONE;
-	} else {
-		if (is_roam_offload_enabled)
-			mode = WMI_ROAM_SCAN_MODE_NONE |
-				WMI_ROAM_SCAN_MODE_ROAMOFFLOAD;
-		else
-			mode = WMI_ROAM_SCAN_MODE_NONE;
-	}
-
 	status = target_if_cm_roam_scan_offload_mode(wmi_handle,
 						     &req->rso_config);
 	if (QDF_IS_STATUS_ERROR(status)) {
@@ -1067,7 +1051,7 @@ target_if_cm_roam_send_stop(struct wlan_objmgr_vdev *vdev,
 	 * disconnect
 	 */
 	vdev_id = wlan_vdev_get_id(vdev);
-	if (mode == WMI_ROAM_SCAN_MODE_NONE) {
+	if (req->rso_config.rso_mode_info.roam_scan_mode == WMI_ROAM_SCAN_MODE_NONE) {
 		req->roam_triggers.vdev_id = vdev_id;
 		req->roam_triggers.trigger_bitmap = 0;
 		req->roam_triggers.roam_scan_scheme_bitmap = 0;

+ 237 - 11
components/umac/mlme/connection_mgr/core/src/wlan_cm_roam_offload.c

@@ -30,6 +30,7 @@
 #include "wlan_crypto_global_api.h"
 #include "wlan_psoc_mlme_api.h"
 #include "pld_common.h"
+#include "wlan_blm_api.h"
 
 /**
  * cm_roam_scan_bmiss_cnt() - set roam beacon miss count
@@ -1262,6 +1263,174 @@ cm_fill_rso_channel_list(struct wlan_objmgr_psoc *psoc,
 		   chan_info->chan_count, ch_cache_str);
 }
 
+static void
+cm_add_blacklist_ap_list(struct wlan_objmgr_pdev *pdev,
+			 struct roam_scan_filter_params *params)
+{
+	int i = 0;
+	struct reject_ap_config_params *reject_list;
+
+	reject_list = qdf_mem_malloc(sizeof(*reject_list) *
+				     MAX_RSSI_AVOID_BSSID_LIST);
+	if (!reject_list)
+		return;
+
+	params->num_bssid_black_list =
+		wlan_blm_get_bssid_reject_list(pdev, reject_list,
+					       MAX_RSSI_AVOID_BSSID_LIST,
+					       USERSPACE_BLACKLIST_TYPE);
+	if (!params->num_bssid_black_list) {
+		qdf_mem_free(reject_list);
+		return;
+	}
+
+	for (i = 0; i < params->num_bssid_black_list; i++) {
+		qdf_copy_macaddr(&params->bssid_avoid_list[i],
+				 &reject_list[i].bssid);
+		mlme_debug("Blacklist bssid[%d]:" QDF_MAC_ADDR_FMT, i,
+			   QDF_MAC_ADDR_REF(params->bssid_avoid_list[i].bytes));
+	}
+
+	qdf_mem_free(reject_list);
+}
+
+/**
+ * cm_roam_scan_filter() - set roam scan filter parameters
+ * @psoc: psoc
+ * @pdev: pdev
+ * @vdev_id: vdev id
+ * @command: rso command
+ * @reason:  reason to roam
+ * @scan_filter_params:  roam scan filter related parameters
+ *
+ * There are filters such as whitelist, blacklist and preferred
+ * list that need to be applied to the scan results to form the
+ * probable candidates for roaming.
+ *
+ * Return: None
+ */
+static void
+cm_roam_scan_filter(struct wlan_objmgr_psoc *psoc,
+		    struct wlan_objmgr_pdev *pdev,
+		    uint8_t vdev_id, uint8_t command, uint8_t reason,
+		    struct wlan_roam_scan_filter_params *scan_filter_params)
+{
+	int i;
+	uint32_t num_ssid_white_list = 0, num_bssid_preferred_list = 0;
+	uint32_t op_bitmap = 0;
+	struct roam_scan_filter_params *params;
+	struct wlan_mlme_psoc_ext_obj *mlme_obj;
+	struct rso_config_params *rso_usr_cfg;
+
+	mlme_obj = mlme_get_psoc_ext_obj(psoc);
+	if (!mlme_obj)
+		return;
+
+	scan_filter_params->reason = reason;
+	params = &scan_filter_params->filter_params;
+	rso_usr_cfg = &mlme_obj->cfg.lfr.rso_user_config;
+	if (command != ROAM_SCAN_OFFLOAD_STOP) {
+		switch (reason) {
+		case REASON_ROAM_SET_BLACKLIST_BSSID:
+			op_bitmap |= 0x1;
+			cm_add_blacklist_ap_list(pdev, params);
+			break;
+		case REASON_ROAM_SET_SSID_ALLOWED:
+			op_bitmap |= 0x2;
+			num_ssid_white_list =
+				rso_usr_cfg->num_ssid_allowed_list;
+			break;
+		case REASON_ROAM_SET_FAVORED_BSSID:
+			op_bitmap |= 0x4;
+			num_bssid_preferred_list =
+				rso_usr_cfg->num_bssid_favored;
+			break;
+		case REASON_CTX_INIT:
+			if (command == ROAM_SCAN_OFFLOAD_START) {
+				params->lca_disallow_config_present = true;
+				/*
+				 * If rssi disallow bssid list have any member
+				 * fill it and send it to firmware so that
+				 * firmware does not try to roam to these BSS
+				 * until RSSI OR time condition are matched.
+				 */
+				params->num_rssi_rejection_ap =
+					wlan_blm_get_bssid_reject_list(pdev,
+						params->rssi_rejection_ap,
+						MAX_RSSI_AVOID_BSSID_LIST,
+						DRIVER_RSSI_REJECT_TYPE);
+			} else {
+				mlme_debug("Roam Filter need not be sent, no need to fill parameters");
+				return;
+			}
+			break;
+		default:
+			mlme_debug("Roam Filter need not be sent, no need to fill parameters");
+			return;
+		}
+	} else {
+		/* In case of STOP command, reset all the variables
+		 * except for blacklist BSSID which should be retained
+		 * across connections.
+		 */
+		op_bitmap = 0x2 | 0x4;
+		if (reason == REASON_ROAM_SET_SSID_ALLOWED)
+			num_ssid_white_list =
+					rso_usr_cfg->num_ssid_allowed_list;
+		num_bssid_preferred_list = rso_usr_cfg->num_bssid_favored;
+	}
+
+	/* fill in fixed values */
+	params->vdev_id = vdev_id;
+	params->op_bitmap = op_bitmap;
+	params->num_ssid_white_list = num_ssid_white_list;
+	params->num_bssid_preferred_list = num_bssid_preferred_list;
+	params->delta_rssi =
+		wlan_blm_get_rssi_blacklist_threshold(pdev);
+
+	for (i = 0; i < num_ssid_white_list; i++) {
+		qdf_mem_copy(params->ssid_allowed_list[i].ssid,
+			     rso_usr_cfg->ssid_allowed_list[i].ssid,
+			     rso_usr_cfg->ssid_allowed_list[i].length);
+		params->ssid_allowed_list[i].length =
+				rso_usr_cfg->ssid_allowed_list[i].length;
+		mlme_debug("SSID %d: %.*s", i,
+			   params->ssid_allowed_list[i].length,
+			   params->ssid_allowed_list[i].ssid);
+	}
+
+	if (params->num_bssid_preferred_list) {
+		qdf_mem_copy(params->bssid_favored, rso_usr_cfg->bssid_favored,
+			     MAX_BSSID_FAVORED * sizeof(struct qdf_mac_addr));
+		qdf_mem_copy(params->bssid_favored_factor,
+			     rso_usr_cfg->bssid_favored_factor,
+			     MAX_BSSID_FAVORED);
+	}
+	for (i = 0; i < params->num_rssi_rejection_ap; i++)
+		mlme_debug("RSSI reject BSSID "QDF_MAC_ADDR_FMT" expected rssi %d remaining duration %d",
+			   QDF_MAC_ADDR_REF(params->rssi_rejection_ap[i].bssid.bytes),
+			   params->rssi_rejection_ap[i].expected_rssi,
+			   params->rssi_rejection_ap[i].reject_duration);
+
+	for (i = 0; i < params->num_bssid_preferred_list; i++)
+		mlme_debug("Preferred Bssid[%d]:"QDF_MAC_ADDR_FMT" score: %d", i,
+			   QDF_MAC_ADDR_REF(params->bssid_favored[i].bytes),
+			   params->bssid_favored_factor[i]);
+
+	if (params->lca_disallow_config_present) {
+		params->disallow_duration
+				= mlme_obj->cfg.lfr.lfr3_disallow_duration;
+		params->rssi_channel_penalization
+			= mlme_obj->cfg.lfr.lfr3_rssi_channel_penalization;
+		params->num_disallowed_aps
+			= mlme_obj->cfg.lfr.lfr3_num_disallowed_aps;
+		mlme_debug("disallow_dur %d rssi_chan_pen %d num_disallowed_aps %d",
+			   params->disallow_duration,
+			   params->rssi_channel_penalization,
+			   params->num_disallowed_aps);
+	}
+}
+
 /**
  * cm_roam_start_req() - roam start request handling
  * @psoc: psoc pointer
@@ -1278,6 +1447,7 @@ cm_roam_start_req(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id,
 	QDF_STATUS status = QDF_STATUS_E_INVAL;
 	struct rso_config *rso_cfg;
 	struct wlan_objmgr_vdev *vdev;
+	struct wlan_objmgr_pdev *pdev;
 
 	start_req = qdf_mem_malloc(sizeof(*start_req));
 	if (!start_req)
@@ -1293,6 +1463,10 @@ cm_roam_start_req(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id,
 	if (!rso_cfg)
 		goto rel_vdev_ref;
 
+	pdev = wlan_vdev_get_pdev(vdev);
+	if (!pdev)
+		goto rel_vdev_ref;
+
 	cm_roam_set_roam_reason_better_ap(psoc, vdev_id, false);
 	/* fill from mlme directly */
 	cm_roam_scan_bmiss_cnt(psoc, vdev_id, &start_req->beacon_miss_cnt);
@@ -1313,6 +1487,8 @@ cm_roam_start_req(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id,
 					&start_req->profile_params);
 	cm_fill_rso_channel_list(psoc, vdev, rso_cfg, &start_req->rso_chan_info,
 				 reason);
+	cm_roam_scan_filter(psoc, pdev, vdev_id, ROAM_SCAN_OFFLOAD_START,
+			    reason, &start_req->scan_filter_params);
 
 	/* fill from legacy through this API */
 	wlan_cm_roam_fill_start_req(psoc, vdev_id, start_req, reason);
@@ -1345,6 +1521,7 @@ cm_roam_update_config_req(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id,
 	QDF_STATUS status = QDF_STATUS_E_INVAL;
 	struct rso_config *rso_cfg;
 	struct wlan_objmgr_vdev *vdev;
+	struct wlan_objmgr_pdev *pdev;
 
 	cm_roam_set_roam_reason_better_ap(psoc, vdev_id, false);
 
@@ -1362,6 +1539,10 @@ cm_roam_update_config_req(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id,
 	if (!rso_cfg)
 		goto rel_vdev_ref;
 
+	pdev = wlan_vdev_get_pdev(vdev);
+	if (!pdev)
+		goto rel_vdev_ref;
+
 	/* fill from mlme directly */
 	cm_roam_scan_bmiss_cnt(psoc, vdev_id, &update_req->beacon_miss_cnt);
 	cm_roam_fill_rssi_change_params(psoc, vdev_id,
@@ -1383,6 +1564,8 @@ cm_roam_update_config_req(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id,
 					&update_req->profile_params);
 	cm_fill_rso_channel_list(psoc, vdev, rso_cfg,
 				 &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);
@@ -1457,32 +1640,63 @@ cm_roam_abort_req(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id,
 	return status;
 }
 
+static void cm_fill_stop_reason(struct wlan_roam_stop_config *stop_req,
+				uint8_t reason)
+{
+	if (reason == REASON_ROAM_SYNCH_FAILED)
+		stop_req->reason = REASON_ROAM_SYNCH_FAILED;
+	else if (reason == REASON_DRIVER_DISABLED)
+		stop_req->reason = REASON_ROAM_STOP_ALL;
+	else if (reason == REASON_SUPPLICANT_DISABLED_ROAMING)
+		stop_req->reason = REASON_SUPPLICANT_DISABLED_ROAMING;
+	else if (reason == REASON_DISCONNECTED)
+		stop_req->reason = REASON_DISCONNECTED;
+	else if (reason == REASON_OS_REQUESTED_ROAMING_NOW)
+		stop_req->reason = REASON_OS_REQUESTED_ROAMING_NOW;
+	else
+		stop_req->reason = REASON_SME_ISSUED;
+}
+
 QDF_STATUS
 cm_roam_stop_req(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id,
 		 uint8_t reason)
 {
 	struct wlan_roam_stop_config *stop_req;
 	QDF_STATUS status;
+	struct rso_config *rso_cfg;
+	struct wlan_objmgr_vdev *vdev;
+	struct wlan_objmgr_pdev *pdev;
 
 	cm_roam_set_roam_reason_better_ap(psoc, vdev_id, false);
 	stop_req = qdf_mem_malloc(sizeof(*stop_req));
 	if (!stop_req)
 		return QDF_STATUS_E_NOMEM;
 
+	vdev = wlan_objmgr_get_vdev_by_id_from_psoc(psoc, vdev_id,
+						    WLAN_MLME_CM_ID);
+	if (!vdev) {
+		mlme_err("vdev object is NULL for vdev %d", vdev_id);
+		goto free_mem;
+	}
+	rso_cfg = wlan_cm_get_rso_config(vdev);
+	if (!rso_cfg)
+		goto rel_vdev_ref;
+
+	pdev = wlan_vdev_get_pdev(vdev);
+	if (!pdev)
+		goto rel_vdev_ref;
+
 	stop_req->btm_config.vdev_id = vdev_id;
 	stop_req->disconnect_params.vdev_id = vdev_id;
 	stop_req->idle_params.vdev_id = vdev_id;
 	stop_req->roam_triggers.vdev_id = vdev_id;
 	stop_req->rssi_params.vdev_id = vdev_id;
-
-	/* 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");
-		qdf_mem_free(stop_req);
-		return status;
-	}
-
+	stop_req->roam_11k_params.vdev_id = vdev_id;
+	cm_fill_stop_reason(stop_req, reason);
+	if (wlan_cm_host_roam_in_progress(psoc, vdev_id))
+		stop_req->middle_of_roaming = 1;
+	else
+		wlan_roam_reset_roam_params(psoc);
 	/*
 	 * If roam synch propagation is in progress and an user space
 	 * disconnect is requested, then there is no need to send the
@@ -1507,8 +1721,17 @@ cm_roam_stop_req(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id,
 	    stop_req->reason == REASON_ROAM_STOP_ALL) {
 		mlme_info("vdev_id:%d : Drop RSO stop during roam sync",
 			  vdev_id);
-		qdf_mem_free(stop_req);
-		return QDF_STATUS_SUCCESS;
+		goto rel_vdev_ref;
+	}
+
+	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;
 	}
 
 	status = wlan_cm_tgt_send_roam_stop_req(psoc, vdev_id, stop_req);
@@ -1520,6 +1743,9 @@ cm_roam_stop_req(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id,
 			mlme_debug("fail to send rso rsp msg");
 	}
 
+rel_vdev_ref:
+	wlan_objmgr_vdev_release_ref(vdev, WLAN_MLME_CM_ID);
+free_mem:
 	qdf_mem_free(stop_req);
 
 	return QDF_STATUS_SUCCESS;

+ 10 - 2
components/umac/mlme/connection_mgr/dispatcher/inc/wlan_cm_roam_api.h

@@ -165,8 +165,8 @@ wlan_cm_enable_roaming_on_connected_sta(struct wlan_objmgr_pdev *pdev,
  *
  * Return: True or False
  */
-bool wlan_cm_neighbor_roam_in_progress(struct wlan_objmgr_psoc *psoc,
-				       uint8_t vdev_id);
+bool wlan_cm_host_roam_in_progress(struct wlan_objmgr_psoc *psoc,
+				   uint8_t vdev_id);
 
 /**
  * cm_roam_acquire_lock() - Wrapper for sme_acquire_global_lock.
@@ -383,6 +383,14 @@ bool wlan_cm_get_ese_assoc(struct wlan_objmgr_pdev *pdev,
 }
 #endif
 
+/**
+ * wlan_roam_reset_roam_params  - reset_roam params
+ * @psoc: vdev pointer
+ *
+ * Return: QDF_STATUS
+ */
+void wlan_roam_reset_roam_params(struct wlan_objmgr_psoc *psoc);
+
 /**
  * wlan_cm_rso_config_init  - initialize RSO config
  * @vdev: vdev pointer

+ 28 - 4
components/umac/mlme/connection_mgr/dispatcher/inc/wlan_cm_roam_public_struct.h

@@ -98,6 +98,9 @@
 #define ROAM_MAX_CFG_VALUE 0xffffffff
 
 #define CFG_VALID_CHANNEL_LIST_LEN 100
+#define MAX_SSID_ALLOWED_LIST    4
+#define MAX_BSSID_AVOID_LIST     16
+#define MAX_BSSID_FAVORED      16
 
 /**
  * struct rso_chan_info - chan info
@@ -226,15 +229,40 @@ struct rso_roam_policy_params {
 
 /**
  * struct rso_params - global RSO params
+ * @num_ssid_allowed_list: The number of SSID profiles that are
+ *                         in the Whitelist. When roaming, we
+ *                         consider the BSSID's with this SSID
+ *                         also for roaming apart from the connected one's
+ * @ssid_allowed_list: Whitelist SSID's
+ * @num_bssid_favored: Number of BSSID's which have a preference over others
+ * @bssid_favored: Favorable BSSID's
+ * @bssid_favored_factor: RSSI to be added to this BSSID to prefer it
  * @good_rssi_roam: Lazy Roam
  * @alert_rssi_threshold: Alert RSSI
  * @rssi: rssi diff
+ * @raise_rssi_thresh_5g: The RSSI threshold below which the
+ *                        raise_factor_5g (boost factor) should be applied.
+ * @drop_rssi_thresh_5g: The RSSI threshold beyond which the
+ *                       drop_factor_5g (penalty factor) should be applied
+ * @raise_factor_5g: Boost factor
+ * @drop_factor_5g: Penalty factor
+ * @max_raise_rssi_5g: Maximum amount of Boost that can added
  * @policy_params: roam policy params
  */
 struct rso_config_params {
+	uint8_t num_ssid_allowed_list;
+	struct wlan_ssid ssid_allowed_list[MAX_SSID_ALLOWED_LIST];
+	uint8_t num_bssid_favored;
+	struct qdf_mac_addr bssid_favored[MAX_BSSID_FAVORED];
+	uint8_t bssid_favored_factor[MAX_BSSID_FAVORED];
 	int good_rssi_roam;
 	int alert_rssi_threshold;
 	int rssi_diff;
+	int raise_rssi_thresh_5g;
+	int drop_rssi_thresh_5g;
+	uint8_t raise_factor_5g;
+	uint8_t drop_factor_5g;
+	int max_raise_rssi_5g;
 	struct rso_roam_policy_params policy_params;
 };
 
@@ -576,10 +604,6 @@ struct wlan_roam_mawc_params {
 	uint8_t rssi_stationary_low_adjust;
 };
 
-#define MAX_SSID_ALLOWED_LIST    4
-#define MAX_BSSID_AVOID_LIST     16
-#define MAX_BSSID_FAVORED      16
-
 /**
  * struct roam_scan_filter_params - Structure holding roaming scan
  *                                  parameters

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

@@ -166,6 +166,30 @@ QDF_STATUS wlan_cm_enable_rso(struct wlan_objmgr_pdev *pdev, uint8_t vdev_id,
 	return status;
 }
 
+#ifdef FEATURE_CM_ENABLE
+bool wlan_cm_host_roam_in_progress(struct wlan_objmgr_psoc *psoc,
+				   uint8_t vdev_id)
+{
+	struct wlan_objmgr_vdev *vdev;
+	bool host_roam_in_progress = false;
+
+	vdev = wlan_objmgr_get_vdev_by_id_from_psoc(psoc, vdev_id,
+						    WLAN_MLME_CM_ID);
+	if (!vdev) {
+		mlme_err("vdev object is NULL for vdev %d", vdev_id);
+		return host_roam_in_progress;
+	}
+
+	if (wlan_cm_is_vdev_roam_preauth_state(vdev) ||
+	    wlan_cm_is_vdev_roam_reassoc_state(vdev))
+		host_roam_in_progress = true;
+
+	wlan_objmgr_vdev_release_ref(vdev, WLAN_MLME_CM_ID);
+
+	return host_roam_in_progress;
+}
+#endif
+
 QDF_STATUS wlan_cm_abort_rso(struct wlan_objmgr_pdev *pdev, uint8_t vdev_id)
 {
 	struct wlan_objmgr_psoc *psoc = wlan_pdev_get_psoc(pdev);
@@ -176,7 +200,7 @@ QDF_STATUS wlan_cm_abort_rso(struct wlan_objmgr_pdev *pdev, uint8_t vdev_id)
 		return QDF_STATUS_E_FAILURE;
 
 	if (MLME_IS_ROAM_SYNCH_IN_PROGRESS(psoc, vdev_id) ||
-	    wlan_cm_neighbor_roam_in_progress(psoc, vdev_id)) {
+	    wlan_cm_host_roam_in_progress(psoc, vdev_id)) {
 		cm_roam_release_lock();
 		return QDF_STATUS_E_BUSY;
 	}
@@ -203,7 +227,7 @@ bool wlan_cm_roaming_in_progress(struct wlan_objmgr_pdev *pdev, uint8_t vdev_id)
 	if (MLME_IS_ROAM_SYNCH_IN_PROGRESS(psoc, vdev_id) ||
 	    MLME_IS_ROAMING_IN_PROG(psoc, vdev_id) ||
 	    mlme_is_roam_invoke_in_progress(psoc, vdev_id) ||
-	    wlan_cm_neighbor_roam_in_progress(psoc, vdev_id)) {
+	    wlan_cm_host_roam_in_progress(psoc, vdev_id)) {
 		cm_roam_release_lock();
 		return true;
 	}
@@ -912,6 +936,26 @@ wlan_cm_roam_cfg_set_value(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id,
 	return status;
 }
 
+void wlan_roam_reset_roam_params(struct wlan_objmgr_psoc *psoc)
+{
+	struct wlan_mlme_psoc_ext_obj *mlme_obj;
+	struct rso_config_params *rso_usr_cfg;
+
+	mlme_obj = mlme_get_psoc_ext_obj(psoc);
+	if (!mlme_obj)
+		return;
+
+	rso_usr_cfg = &mlme_obj->cfg.lfr.rso_user_config;
+
+	/*
+	 * clear all the whitelist parameters and remaining
+	 * needs to be retained across connections.
+	 */
+	rso_usr_cfg->num_ssid_allowed_list = 0;
+	qdf_mem_zero(&rso_usr_cfg->ssid_allowed_list,
+		     sizeof(struct wlan_ssid) * MAX_SSID_ALLOWED_LIST);
+}
+
 static void cm_rso_chan_to_freq_list(struct wlan_objmgr_pdev *pdev,
 				     qdf_freq_t *freq_list,
 				     const uint8_t *chan_list,

+ 62 - 66
core/hdd/src/wlan_hdd_cfg80211.c

@@ -4215,14 +4215,14 @@ const struct nla_policy wlan_hdd_set_roam_param_policy[
 /**
  * hdd_set_white_list() - parse white list
  * @hdd_ctx:        HDD context
- * @roam_params:   roam params
+ * @rso_config: rso config
  * @tb:            list of attributes
  * @vdev_id:    vdev id
  *
  * Return: 0 on success; error number on failure
  */
 static int hdd_set_white_list(struct hdd_context *hdd_ctx,
-			      struct roam_ext_params *roam_params,
+			      struct rso_config_params *rso_config,
 			      struct nlattr **tb, uint8_t vdev_id)
 {
 	int rem, i;
@@ -4269,14 +4269,14 @@ static int hdd_set_white_list(struct hdd_context *hdd_ctx,
 			 */
 			if (buf_len > 1 &&
 			    ((buf_len - 1) <= WLAN_SSID_MAX_LEN)) {
-				nla_memcpy(roam_params->ssid_allowed_list[i].ssId,
+				nla_memcpy(rso_config->ssid_allowed_list[i].ssid,
 					tb2[PARAM_LIST_SSID], buf_len - 1);
-				roam_params->ssid_allowed_list[i].length = buf_len - 1;
+				rso_config->ssid_allowed_list[i].length = buf_len - 1;
 				hdd_debug("SSID[%d]: %.*s,length = %d",
 					i,
-					roam_params->ssid_allowed_list[i].length,
-					roam_params->ssid_allowed_list[i].ssId,
-					roam_params->ssid_allowed_list[i].length);
+					rso_config->ssid_allowed_list[i].length,
+					rso_config->ssid_allowed_list[i].ssid,
+					rso_config->ssid_allowed_list[i].length);
 					i++;
 			} else {
 				hdd_err("Invalid buffer length");
@@ -4289,11 +4289,11 @@ static int hdd_set_white_list(struct hdd_context *hdd_ctx,
 		goto fail;
 	}
 
-	roam_params->num_ssid_allowed_list = i;
-	hdd_debug("Num of Allowed SSID %d", roam_params->num_ssid_allowed_list);
+	rso_config->num_ssid_allowed_list = i;
+	hdd_debug("Num of Allowed SSID %d", rso_config->num_ssid_allowed_list);
 	mac_handle = hdd_ctx->mac_handle;
-	sme_update_roam_params(mac_handle, vdev_id,
-			       roam_params, REASON_ROAM_SET_SSID_ALLOWED);
+	sme_update_roam_params(mac_handle, vdev_id, rso_config,
+			       REASON_ROAM_SET_SSID_ALLOWED);
 	return 0;
 
 fail:
@@ -4303,14 +4303,14 @@ fail:
 /**
  * hdd_set_bssid_prefs() - parse set bssid prefs
  * @hdd_ctx:        HDD context
- * @roam_params:   roam params
+ * @rso_config: rso config
  * @tb:            list of attributes
  * @vdev_id:    vdev id
  *
  * Return: 0 on success; error number on failure
  */
 static int hdd_set_bssid_prefs(struct hdd_context *hdd_ctx,
-			       struct roam_ext_params *roam_params,
+			       struct rso_config_params *rso_config,
 			       struct nlattr **tb, uint8_t vdev_id)
 {
 	int rem, i;
@@ -4358,30 +4358,30 @@ static int hdd_set_bssid_prefs(struct hdd_context *hdd_ctx,
 			hdd_err("attr mac address failed");
 			goto fail;
 		}
-		nla_memcpy(roam_params->bssid_favored[i].bytes,
+		nla_memcpy(rso_config->bssid_favored[i].bytes,
 			  tb2[PARAM_ROAM_BSSID],
 			  QDF_MAC_ADDR_SIZE);
 		hdd_debug(QDF_MAC_ADDR_FMT,
-			  QDF_MAC_ADDR_REF(roam_params->bssid_favored[i].bytes));
+			  QDF_MAC_ADDR_REF(rso_config->bssid_favored[i].bytes));
 		/* Parse and fetch preference factor*/
 		if (!tb2[PARAM_RSSI_MODIFIER]) {
 			hdd_err("BSSID Preference score failed");
 			goto fail;
 		}
-		roam_params->bssid_favored_factor[i] = nla_get_u32(
+		rso_config->bssid_favored_factor[i] = nla_get_u32(
 			tb2[PARAM_RSSI_MODIFIER]);
 		hdd_debug("BSSID Preference score (%d)",
-			  roam_params->bssid_favored_factor[i]);
+			  rso_config->bssid_favored_factor[i]);
 		i++;
 	}
 	if (i < count)
 		hdd_warn("Num Preferred BSSID %u less than expected %u",
 				 i, count);
 
-	roam_params->num_bssid_favored = i;
+	rso_config->num_bssid_favored = i;
 	mac_handle = hdd_ctx->mac_handle;
 	sme_update_roam_params(mac_handle, vdev_id,
-			       roam_params, REASON_ROAM_SET_FAVORED_BSSID);
+			       rso_config, REASON_ROAM_SET_FAVORED_BSSID);
 
 	return 0;
 
@@ -4392,14 +4392,14 @@ fail:
 /**
  * hdd_set_blacklist_bssid() - parse set blacklist bssid
  * @hdd_ctx:        HDD context
- * @roam_params:   roam params
+ * @rso_config:   roam params
  * @tb:            list of attributes
  * @vdev_id:    vdev id
  *
  * Return: 0 on success; error number on failure
  */
 static int hdd_set_blacklist_bssid(struct hdd_context *hdd_ctx,
-				   struct roam_ext_params *roam_params,
+				   struct rso_config_params *rso_config,
 				   struct nlattr **tb,
 				   uint8_t vdev_id)
 {
@@ -4408,6 +4408,7 @@ static int hdd_set_blacklist_bssid(struct hdd_context *hdd_ctx,
 	uint8_t j = 0;
 	struct nlattr *tb2[MAX_ROAMING_PARAM + 1];
 	struct nlattr *curr_attr = NULL;
+	struct qdf_mac_addr *black_list_bssid;
 	mac_handle_t mac_handle;
 
 	/* Parse and fetch number of blacklist BSSID */
@@ -4422,6 +4423,10 @@ static int hdd_set_blacklist_bssid(struct hdd_context *hdd_ctx,
 		goto fail;
 	}
 	hdd_debug("Num of blacklist BSSID (%d)", count);
+	black_list_bssid = qdf_mem_malloc(sizeof(*black_list_bssid) *
+					  MAX_BSSID_AVOID_LIST);
+	if (!black_list_bssid)
+		goto fail;
 
 	i = 0;
 	if (count && tb[PARAM_BSSID_PARAMS]) {
@@ -4439,11 +4444,13 @@ static int hdd_set_blacklist_bssid(struct hdd_context *hdd_ctx,
 					 nla_len(curr_attr),
 					 wlan_hdd_set_roam_param_policy)) {
 				hdd_err("nla_parse failed");
+				qdf_mem_free(black_list_bssid);
 				goto fail;
 			}
 			/* Parse and fetch MAC address */
 			if (!tb2[PARAM_SET_BSSID]) {
 				hdd_err("attr blacklist addr failed");
+				qdf_mem_free(black_list_bssid);
 				goto fail;
 			}
 			if (tb2[PARAM_SET_BSSID_HINT]) {
@@ -4463,11 +4470,10 @@ static int hdd_set_blacklist_bssid(struct hdd_context *hdd_ctx,
 				i++;
 				continue;
 			}
-			nla_memcpy(roam_params->bssid_avoid_list[j].bytes,
+			nla_memcpy(black_list_bssid[j].bytes,
 				   tb2[PARAM_SET_BSSID], QDF_MAC_ADDR_SIZE);
 			hdd_debug(QDF_MAC_ADDR_FMT,
-				  QDF_MAC_ADDR_REF(roam_params->
-						    bssid_avoid_list[j].bytes));
+				  QDF_MAC_ADDR_REF(black_list_bssid[j].bytes));
 			i++;
 			j++;
 		}
@@ -4477,15 +4483,12 @@ static int hdd_set_blacklist_bssid(struct hdd_context *hdd_ctx,
 		hdd_warn("Num Blacklist BSSID %u less than expected %u",
 			 i, count);
 
-	roam_params->num_bssid_avoid_list = j;
 	/* Send the blacklist to the blacklist mgr component */
-	ucfg_blm_add_userspace_black_list(hdd_ctx->pdev,
-					  roam_params->bssid_avoid_list,
-					  roam_params->num_bssid_avoid_list);
-
+	ucfg_blm_add_userspace_black_list(hdd_ctx->pdev, black_list_bssid, j);
+	qdf_mem_free(black_list_bssid);
 	mac_handle = hdd_ctx->mac_handle;
 	sme_update_roam_params(mac_handle, vdev_id,
-			       roam_params, REASON_ROAM_SET_BLACKLIST_BSSID);
+			       rso_config, REASON_ROAM_SET_BLACKLIST_BSSID);
 
 	return 0;
 fail:
@@ -5437,16 +5440,16 @@ static int hdd_get_roam_control_config(struct hdd_context *hdd_ctx,
 /**
  * hdd_set_ext_roam_params() - parse ext roam params
  * @hdd_ctx:        HDD context
- * @roam_params:   roam params
  * @tb:            list of attributes
- * @vdev_id:    vdev id
+ * @vdev_id:       vdev id
+ * @rso_config:    roam params
  *
  * Return: 0 on success; error number on failure
  */
 static int hdd_set_ext_roam_params(struct hdd_context *hdd_ctx,
 				   const void *data, int data_len,
 				   uint8_t vdev_id,
-				   struct roam_ext_params *roam_params)
+				   struct rso_config_params *rso_config)
 {
 	uint32_t cmd_type, req_id;
 	struct nlattr *tb[MAX_ROAMING_PARAM + 1];
@@ -5475,7 +5478,7 @@ static int hdd_set_ext_roam_params(struct hdd_context *hdd_ctx,
 	hdd_debug("Req Id: %u Cmd Type: %u", req_id, cmd_type);
 	switch (cmd_type) {
 	case QCA_WLAN_VENDOR_ROAMING_SUBCMD_SSID_WHITE_LIST:
-		ret = hdd_set_white_list(hdd_ctx, roam_params, tb, vdev_id);
+		ret = hdd_set_white_list(hdd_ctx, rso_config, tb, vdev_id);
 		if (ret)
 			goto fail;
 		break;
@@ -5486,66 +5489,65 @@ static int hdd_set_ext_roam_params(struct hdd_context *hdd_ctx,
 			hdd_err("5G boost threshold failed");
 			goto fail;
 		}
-		roam_params->raise_rssi_thresh_5g = nla_get_s32(
+		rso_config->raise_rssi_thresh_5g = nla_get_s32(
 			tb[PARAM_A_BAND_BOOST_THLD]);
 		hdd_debug("5G Boost Threshold (%d)",
-			roam_params->raise_rssi_thresh_5g);
+			rso_config->raise_rssi_thresh_5g);
 		/* Parse and fetch 5G Penalty Threshold */
 		if (!tb[PARAM_A_BAND_PELT_THLD]) {
 			hdd_err("5G penalty threshold failed");
 			goto fail;
 		}
-		roam_params->drop_rssi_thresh_5g = nla_get_s32(
+		rso_config->drop_rssi_thresh_5g = nla_get_s32(
 			tb[PARAM_A_BAND_PELT_THLD]);
 		hdd_debug("5G Penalty Threshold (%d)",
-			roam_params->drop_rssi_thresh_5g);
+			rso_config->drop_rssi_thresh_5g);
 		/* Parse and fetch 5G Boost Factor */
 		if (!tb[PARAM_A_BAND_BOOST_FACTOR]) {
 			hdd_err("5G boost Factor failed");
 			goto fail;
 		}
-		roam_params->raise_factor_5g = nla_get_u32(
+		rso_config->raise_factor_5g = nla_get_u32(
 			tb[PARAM_A_BAND_BOOST_FACTOR]);
 		hdd_debug("5G Boost Factor (%d)",
-			roam_params->raise_factor_5g);
+			rso_config->raise_factor_5g);
 		/* Parse and fetch 5G Penalty factor */
 		if (!tb[PARAM_A_BAND_PELT_FACTOR]) {
 			hdd_err("5G Penalty Factor failed");
 			goto fail;
 		}
-		roam_params->drop_factor_5g = nla_get_u32(
+		rso_config->drop_factor_5g = nla_get_u32(
 			tb[PARAM_A_BAND_PELT_FACTOR]);
 		hdd_debug("5G Penalty factor (%d)",
-			roam_params->drop_factor_5g);
+			rso_config->drop_factor_5g);
 		/* Parse and fetch 5G Max Boost */
 		if (!tb[PARAM_A_BAND_MAX_BOOST]) {
 			hdd_err("5G Max Boost failed");
 			goto fail;
 		}
-		roam_params->max_raise_rssi_5g = nla_get_u32(
+		rso_config->max_raise_rssi_5g = nla_get_u32(
 			tb[PARAM_A_BAND_MAX_BOOST]);
 		hdd_debug("5G Max Boost (%d)",
-			roam_params->max_raise_rssi_5g);
+			rso_config->max_raise_rssi_5g);
 		/* Parse and fetch Rssi Diff */
 		if (!tb[PARAM_ROAM_HISTERESYS]) {
 			hdd_err("Rssi Diff failed");
 			goto fail;
 		}
-		roam_params->rssi_diff = nla_get_s32(
+		rso_config->rssi_diff = nla_get_s32(
 			tb[PARAM_ROAM_HISTERESYS]);
 		hdd_debug("RSSI Diff (%d)",
-			roam_params->rssi_diff);
+			rso_config->rssi_diff);
 		/* Parse and fetch Alert Rssi Threshold */
 		if (!tb[PARAM_RSSI_TRIGGER]) {
 			hdd_err("Alert Rssi Threshold failed");
 			goto fail;
 		}
-		roam_params->alert_rssi_threshold = nla_get_u32(
+		rso_config->alert_rssi_threshold = nla_get_u32(
 			tb[PARAM_RSSI_TRIGGER]);
 		hdd_debug("Alert RSSI Threshold (%d)",
-			roam_params->alert_rssi_threshold);
-		sme_update_roam_params(mac_handle, vdev_id,
-				       roam_params,
+			rso_config->alert_rssi_threshold);
+		sme_update_roam_params(mac_handle, vdev_id, rso_config,
 				       REASON_ROAM_EXT_SCAN_PARAMS_CHANGED);
 		break;
 	case QCA_WLAN_VENDOR_ROAMING_SUBCMD_SET_LAZY_ROAM:
@@ -5554,22 +5556,20 @@ static int hdd_set_ext_roam_params(struct hdd_context *hdd_ctx,
 			hdd_err("Activate Good Rssi Roam failed");
 			goto fail;
 		}
-		roam_params->good_rssi_roam = nla_get_s32(
+		rso_config->good_rssi_roam = nla_get_s32(
 			tb[PARAM_ROAM_ENABLE]);
 		hdd_debug("Activate Good Rssi Roam (%d)",
-			  roam_params->good_rssi_roam);
-		sme_update_roam_params(mac_handle, vdev_id,
-				       roam_params,
+			  rso_config->good_rssi_roam);
+		sme_update_roam_params(mac_handle, vdev_id, rso_config,
 				       REASON_ROAM_GOOD_RSSI_CHANGED);
 		break;
 	case QCA_WLAN_VENDOR_ROAMING_SUBCMD_SET_BSSID_PREFS:
-		ret = hdd_set_bssid_prefs(hdd_ctx, roam_params, tb, vdev_id);
+		ret = hdd_set_bssid_prefs(hdd_ctx, rso_config, tb, vdev_id);
 		if (ret)
 			goto fail;
 		break;
 	case QCA_WLAN_VENDOR_ROAMING_SUBCMD_SET_BLACKLIST_BSSID:
-		ret = hdd_set_blacklist_bssid(hdd_ctx, roam_params,
-					      tb, vdev_id);
+		ret = hdd_set_blacklist_bssid(hdd_ctx, rso_config, tb, vdev_id);
 		if (ret)
 			goto fail;
 		break;
@@ -5615,7 +5615,7 @@ __wlan_hdd_cfg80211_set_ext_roam_params(struct wiphy *wiphy,
 	struct net_device *dev = wdev->netdev;
 	struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev);
 	struct hdd_context *hdd_ctx = wiphy_priv(wiphy);
-	struct roam_ext_params *roam_params = NULL;
+	struct rso_config_params *rso_config;
 	int ret;
 
 	if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
@@ -5632,22 +5632,18 @@ __wlan_hdd_cfg80211_set_ext_roam_params(struct wiphy *wiphy,
 		return -EINVAL;
 	}
 
-	roam_params = qdf_mem_malloc(sizeof(*roam_params));
-	if (!roam_params)
+	rso_config = qdf_mem_malloc(sizeof(*rso_config));
+	if (!rso_config)
 		return -ENOMEM;
 
 	ret = hdd_set_ext_roam_params(hdd_ctx, data, data_len,
-				      adapter->vdev_id, roam_params);
+				      adapter->vdev_id, rso_config);
+	qdf_mem_free(rso_config);
 	if (ret)
 		goto fail;
 
-	if (roam_params)
-		qdf_mem_free(roam_params);
 	return 0;
 fail:
-	if (roam_params)
-		qdf_mem_free(roam_params);
-
 	return ret;
 }
 #undef PARAM_NUM_NW

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

@@ -176,17 +176,6 @@ typedef enum eSirScanType {
 	eSIR_BEACON_TABLE,
 } tSirScanType;
 
-/* Rsn Capabilities structure */
-struct rsn_caps {
-	uint16_t PreAuthSupported:1;
-	uint16_t NoPairwise:1;
-	uint16_t PTKSAReplayCounter:2;
-	uint16_t GTKSAReplayCounter:2;
-	uint16_t MFPRequired:1;
-	uint16_t MFPCapable:1;
-	uint16_t Reserved:8;
-};
-
 /**
  * struct roam_scan_ch_resp - roam scan chan list response to userspace
  * @vdev_id: vdev id
@@ -1952,103 +1941,12 @@ typedef struct {
 } tSirAcUapsd, *tpSirAcUapsd;
 #endif
 
-typedef struct {
-	tSirMacSSid ssId;
-	uint8_t currAPbssid[QDF_MAC_ADDR_SIZE];
-	uint32_t authentication;
-	uint8_t encryption;
-	uint8_t mcencryption;
-	tAniEdType gp_mgmt_cipher_suite;
-	uint8_t ChannelCount;
-	uint32_t chan_freq_cache[ROAM_MAX_CHANNELS];
-#ifdef WLAN_FEATURE_11W
-	bool mfp_enabled;
-#endif
-} tSirRoamNetworkType;
-
 typedef enum {
 	SIR_ROAMING_DFS_CHANNEL_DISABLED = 0,
 	SIR_ROAMING_DFS_CHANNEL_ENABLED_NORMAL = 1,
 	SIR_ROAMING_DFS_CHANNEL_ENABLED_ACTIVE = 2
 } eSirDFSRoamScanMode;
 
-/**
- * struct roam_ext_params - Structure holding roaming parameters
- * @num_bssid_avoid_list:       The number of BSSID's that we should
- *                              avoid connecting to. It is like a
- *                              blacklist of BSSID's.
- * @num_ssid_allowed_list:      The number of SSID profiles that are
- *                              in the Whitelist. When roaming, we
- *                              consider the BSSID's with this SSID
- *                              also for roaming apart from the connected one's
- * @num_bssid_favored:          Number of BSSID's which have a preference over
- *                              others
- * @ssid_allowed_list:          Whitelist SSID's
- * @bssid_avoid_list:           Blacklist SSID's
- * @bssid_favored:              Favorable BSSID's
- * @bssid_favored_factor:       RSSI to be added to this BSSID to prefer it
- * @raise_rssi_thresh_5g:       The RSSI threshold below which the
- *                              raise_factor_5g (boost factor) should be
- *                              applied.
- * @drop_rssi_thresh_5g:        The RSSI threshold beyond which the
- *                              drop_factor_5g (penalty factor) should be
- *                              applied
- * @raise_rssi_type_5g:         Algorithm to apply the boost factor
- * @raise_factor_5g:            Boost factor
- * @drop_rssi_type_5g:          Algorithm to apply the penalty factor
- * @drop_factor_5g:             Penalty factor
- * @max_raise_rssi_5g:          Maximum amount of Boost that can added
- * @max_drop_rssi_5g:           Maximum amount of penalty that can be subtracted
- * @good_rssi_threshold:        The Lookup UP threshold beyond which roaming
- *                              scan should be performed.
- * @rssi_diff:                  RSSI difference for the AP to be better over the
- *                              current AP to avoid ping pong effects
- * @good_rssi_roam:             Lazy Roam
- * @rssi_reject_list:           RSSI reject list (APs rejected by OCE, BTM)
- * @bg_scan_bad_rssi_thresh:    Bad RSSI threshold to perform bg scan.
- * @bad_rssi_thresh_offset_2g:  Offset from Bad RSSI threshold for 2G to 5G Roam
- * @bg_scan_client_bitmap:      Bitmap to identify the client scans to snoop.
- * @roam_data_rssi_threshold_triggers:    Bad data RSSI threshold to roam
- * @roam_data_rssi_threshold:    Bad data RSSI threshold to roam
- * @rx_data_inactivity_time:    rx duration to check data RSSI
- *
- * This structure holds all the key parameters related to
- * initial connection and also roaming connections.
- * */
-struct roam_ext_params {
-	uint8_t num_bssid_avoid_list;
-	uint8_t num_ssid_allowed_list;
-	uint8_t num_bssid_favored;
-	tSirMacSSid ssid_allowed_list[MAX_SSID_ALLOWED_LIST];
-	struct qdf_mac_addr bssid_avoid_list[MAX_BSSID_AVOID_LIST];
-	struct qdf_mac_addr bssid_favored[MAX_BSSID_FAVORED];
-	uint8_t bssid_favored_factor[MAX_BSSID_FAVORED];
-	int raise_rssi_thresh_5g;
-	int drop_rssi_thresh_5g;
-	uint8_t raise_rssi_type_5g;
-	uint8_t raise_factor_5g;
-	uint8_t drop_rssi_type_5g;
-	uint8_t drop_factor_5g;
-	int max_raise_rssi_5g;
-	int max_drop_rssi_5g;
-	int alert_rssi_threshold;
-	int rssi_diff;
-	int good_rssi_roam;
-	int dense_rssi_thresh_offset;
-	int dense_min_aps_cnt;
-	int initial_dense_status;
-	int traffic_threshold;
-	uint8_t num_rssi_rejection_ap;
-	struct reject_ap_config_params
-			rssi_reject_bssid_list[MAX_RSSI_AVOID_BSSID_LIST];
-	int8_t bg_scan_bad_rssi_thresh;
-	uint8_t roam_bad_rssi_thresh_offset_2g;
-	uint32_t bg_scan_client_bitmap;
-	uint32_t roam_data_rssi_threshold_triggers;
-	int32_t roam_data_rssi_threshold;
-	uint32_t rx_data_inactivity_time;
-};
-
 /**
  * struct pmkid_mode_bits - Bit flags for PMKID usage in RSN IE
  * @fw_okc: Opportunistic key caching enable in firmware
@@ -2061,38 +1959,6 @@ struct pmkid_mode_bits {
 	uint32_t unused:30;
 };
 
-/**
- * struct lca_disallow_config_params - LCA[Last Connected AP]
- *                                     disallow config params
- * @disallow_duration: LCA AP disallowed duration
- * @rssi_channel_penalization: RSSI channel Penalization
- * @num_disallowed_aps: Maximum number of AP's in LCA list
- *
- */
-struct lca_disallow_config_params {
-    uint32_t disallow_duration;
-    uint32_t rssi_channel_penalization;
-    uint32_t num_disallowed_aps;
-};
-
-/**
- * struct mawc_params - Motion Aided Wireless Connectivity configuration
- * @mawc_enabled: Global configuration for MAWC (Roaming/PNO/ExtScan)
- * @mawc_roam_enabled: MAWC roaming enable/disable
- * @mawc_roam_traffic_threshold: Traffic threshold in kBps for MAWC roaming
- * @mawc_roam_ap_rssi_threshold: AP RSSI threshold for MAWC roaming
- * @mawc_roam_rssi_high_adjust: High Adjustment value for suppressing scan
- * @mawc_roam_rssi_low_adjust: Low Adjustment value for suppressing scan
- */
-struct mawc_params {
-	bool mawc_enabled;
-	bool mawc_roam_enabled;
-	uint32_t mawc_roam_traffic_threshold;
-	int8_t mawc_roam_ap_rssi_threshold;
-	uint8_t mawc_roam_rssi_high_adjust;
-	uint8_t mawc_roam_rssi_low_adjust;
-};
-
 /**
  * struct roam_init_params - Firmware roam module initialization parameters
  * @vdev_id: vdev for which the roaming has to be enabled/disabled
@@ -2111,105 +1977,6 @@ struct roam_sync_timeout_timer_info {
 	uint8_t vdev_id;
 };
 
-struct roam_offload_scan_req {
-	uint16_t message_type;
-	uint16_t length;
-	bool RoamScanOffloadEnabled;
-	struct mawc_params mawc_roam_params;
-	int8_t LookupThreshold;
-	int8_t rssi_thresh_offset_5g;
-	uint8_t delay_before_vdev_stop;
-	uint8_t OpportunisticScanThresholdDiff;
-	uint8_t RoamRescanRssiDiff;
-	uint8_t RoamRssiDiff;
-	uint8_t bg_rssi_threshold;
-	struct rsn_caps rsn_caps;
-	int32_t rssi_abs_thresh;
-	uint8_t ChannelCacheType;
-	uint8_t Command;
-	uint8_t reason;
-	uint16_t NeighborScanTimerPeriod;
-	uint16_t neighbor_scan_min_timer_period;
-	uint16_t NeighborScanChannelMinTime;
-	uint16_t NeighborScanChannelMaxTime;
-	uint16_t EmptyRefreshScanPeriod;
-	bool IsESEAssoc;
-	bool is_11r_assoc;
-	uint8_t nProbes;
-	uint16_t HomeAwayTime;
-	tSirRoamNetworkType ConnectedNetwork;
-	struct mobility_domain_info mdid;
-	uint8_t sessionId;
-	uint8_t RoamBmissFirstBcnt;
-	uint8_t RoamBmissFinalBcnt;
-	eSirDFSRoamScanMode allowDFSChannelRoam;
-#ifdef WLAN_FEATURE_ROAM_OFFLOAD
-	uint8_t roam_offload_enabled;
-	bool enable_self_bss_roam;
-	uint8_t PSK_PMK[SIR_ROAM_SCAN_PSK_SIZE];
-	uint32_t pmk_len;
-	uint8_t Prefer5GHz;
-	uint8_t RoamRssiCatGap;
-	uint8_t Select5GHzMargin;
-	uint8_t KRK[SIR_KRK_KEY_LEN];
-	uint8_t BTK[SIR_BTK_KEY_LEN];
-	uint32_t ReassocFailureTimeout;
-	tSirAcUapsd AcUapsd;
-	uint8_t R0KH_ID[SIR_ROAM_R0KH_ID_MAX_LEN];
-	uint32_t R0KH_ID_Length;
-	uint8_t RoamKeyMgmtOffloadEnabled;
-	struct pmkid_mode_bits pmkid_modes;
-	bool is_adaptive_11r_connection;
-	bool is_sae_single_pmk;
-	bool enable_ft_im_roaming;
-	/* Idle/Disconnect roam parameters */
-	struct wlan_roam_idle_params idle_roam_params;
-	struct wlan_roam_disconnect_params disconnect_roam_params;
-#endif
-	struct roam_ext_params roam_params;
-	struct wlan_roam_triggers roam_triggers;
-	uint8_t  middle_of_roaming;
-	uint32_t hi_rssi_scan_max_count;
-	uint32_t hi_rssi_scan_rssi_delta;
-	uint32_t hi_rssi_scan_delay;
-	int32_t hi_rssi_scan_rssi_ub;
-	uint8_t early_stop_scan_enable;
-	int8_t early_stop_scan_min_threshold;
-	int8_t early_stop_scan_max_threshold;
-	enum scan_dwelltime_adaptive_mode roamscan_adaptive_dwell_mode;
-	tSirAddie assoc_ie;
-	struct lca_disallow_config_params lca_config_params;
-	struct scoring_param score_params;
-#ifdef WLAN_FEATURE_FILS_SK
-	bool is_fils_connection;
-#endif
-	uint32_t btm_offload_config;
-	uint32_t btm_solicited_timeout;
-	uint32_t btm_max_attempt_cnt;
-	uint32_t btm_sticky_time;
-	uint32_t rct_validity_timer;
-	uint32_t disassoc_timer_threshold;
-	uint32_t btm_trig_min_candidate_score;
-	struct wlan_roam_11k_offload_params offload_11k_params;
-	uint32_t ho_delay_for_rx;
-	uint32_t roam_preauth_retry_count;
-	uint32_t roam_preauth_no_ack_timeout;
-	uint32_t min_delay_btw_roam_scans;
-	uint32_t roam_trigger_reason_bitmask;
-	bool roam_force_rssi_trigger;
-	/* bss load triggered roam related params */
-	bool bss_load_trig_enabled;
-	struct wlan_roam_bss_load_config bss_load_config;
-	bool roaming_scan_policy;
-	uint32_t roam_scan_inactivity_time;
-	uint32_t roam_inactive_data_packet_count;
-	uint32_t roam_scan_period_after_inactivity;
-	uint32_t btm_query_bitmask;
-	struct roam_trigger_min_rssi min_rssi_params[NUM_OF_ROAM_MIN_RSSI];
-	struct roam_trigger_score_delta score_delta_param[NUM_OF_ROAM_TRIGGERS];
-	uint32_t full_roam_scan_period;
-};
-
 struct roam_offload_scan_rsp {
 	uint8_t sessionId;
 	uint32_t reason;

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

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017-2020, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2017-2021, The Linux Foundation. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -319,8 +319,4 @@ static inline bool lim_verify_fils_params_assoc_rsp(struct mac_context *mac_ctx,
 {
 	return true;
 }
-
-static inline void lim_update_fils_rik(struct pe_session *pe_session,
-				       struct roam_offload_scan_req *req_buffer)
-{ }
 #endif

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

@@ -358,7 +358,6 @@ struct csr_config {
 	uint8_t conc_custom_rule1;
 	uint8_t conc_custom_rule2;
 	uint8_t is_sta_connection_in_5gz_enabled;
-	struct roam_ext_params roam_params;
 	enum force_1x1_type is_force_1x1;
 	uint32_t offload_11k_enable_bitmask;
 	bool wep_tkip_in_he;

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

@@ -154,7 +154,6 @@ QDF_STATUS csr_neighbor_roam_merge_channel_lists(struct mac_context *mac,
 		uint32_t *out_chan_freq_list,
 		uint8_t outputNumOfChannels,
 		uint8_t *pMergedOutputNumOfChannels);
-void csr_roam_reset_roam_params(struct mac_context *mac_ptr);
 
 #if defined(WLAN_FEATURE_HOST_ROAM) || defined(WLAN_FEATURE_ROAM_OFFLOAD)
 QDF_STATUS csr_roam_offload_scan(struct mac_context *mac, uint8_t sessionId,

+ 11 - 2
core/sme/inc/sme_api.h

@@ -440,9 +440,18 @@ void sme_set_curr_device_mode(mac_handle_t mac_handle,
  */
 void sme_update_nud_config(mac_handle_t mac_handle, uint8_t nud_fail_behavior);
 
+/**
+ * sme_update_roam_params() - Store/Update the roaming params
+ * @mac_handle: Opaque handle to the global MAC context
+ * @vdev_id:                  vdev ID
+ * @src_rso_config:           The source to copy
+ * @update_param:             Type of parameter to be updated
+ *
+ * Return: Return the status of the updation.
+ */
 QDF_STATUS sme_update_roam_params(mac_handle_t mac_handle,
-				  uint8_t session_id,
-				  struct roam_ext_params *roam_params_src,
+				  uint8_t vdev_id,
+				  struct rso_config_params *src_rso_config,
 				  int update_param);
 QDF_STATUS sme_update_config(mac_handle_t mac_handle,
 			     struct sme_config_params *pSmeConfigParams);

+ 34 - 55
core/sme/src/common/sme_api.c

@@ -999,88 +999,67 @@ QDF_STATUS sme_update_config(mac_handle_t mac_handle,
 	return status;
 }
 
-/**
- * sme_update_roam_params() - Store/Update the roaming params
- * @mac_handle: Opaque handle to the global MAC context
- * @session_id:               SME Session ID
- * @roam_params_src:          The source buffer to copy
- * @update_param:             Type of parameter to be updated
- *
- * Return: Return the status of the updation.
- */
 QDF_STATUS sme_update_roam_params(mac_handle_t mac_handle,
-				  uint8_t session_id,
-				  struct roam_ext_params *roam_params_src,
+				  uint8_t vdev_id,
+				  struct rso_config_params *src_rso_config,
 				  int update_param)
 {
 	struct mac_context *mac_ctx = MAC_CONTEXT(mac_handle);
-	struct roam_ext_params *roam_params_dst;
 	QDF_STATUS status;
 	uint8_t i;
 	struct wlan_mlme_psoc_ext_obj *mlme_obj;
+	struct rso_config_params *dst_rso_usr_cfg;
 
 	mlme_obj = mlme_get_psoc_ext_obj(mac_ctx->psoc);
 	if (!mlme_obj)
 		return QDF_STATUS_E_FAILURE;
 
-	roam_params_dst = &mac_ctx->roam.configParam.roam_params;
+	dst_rso_usr_cfg = &mlme_obj->cfg.lfr.rso_user_config;
 	switch (update_param) {
 	case REASON_ROAM_EXT_SCAN_PARAMS_CHANGED:
 		mac_ctx->mlme_cfg->lfr.rssi_boost_threshold_5g =
-			roam_params_src->raise_rssi_thresh_5g;
+			src_rso_config->raise_rssi_thresh_5g;
 		mac_ctx->mlme_cfg->lfr.rssi_penalize_threshold_5g =
-			roam_params_src->drop_rssi_thresh_5g;
+			src_rso_config->drop_rssi_thresh_5g;
 		mac_ctx->mlme_cfg->lfr.rssi_boost_factor_5g =
-			roam_params_src->raise_factor_5g;
+			src_rso_config->raise_factor_5g;
 		mac_ctx->mlme_cfg->lfr.rssi_penalize_factor_5g =
-			roam_params_src->drop_factor_5g;
+			src_rso_config->drop_factor_5g;
 		mac_ctx->mlme_cfg->lfr.max_rssi_boost_5g =
-			roam_params_src->max_raise_rssi_5g;
-		mac_ctx->mlme_cfg->lfr.max_rssi_penalize_5g =
-			roam_params_src->max_drop_rssi_5g;
-		mlme_obj->cfg.lfr.rso_user_config.alert_rssi_threshold =
-			roam_params_src->alert_rssi_threshold;
+			src_rso_config->max_raise_rssi_5g;
+		dst_rso_usr_cfg->alert_rssi_threshold =
+			src_rso_config->alert_rssi_threshold;
+		dst_rso_usr_cfg->rssi_diff = src_rso_config->rssi_diff;
 		mac_ctx->mlme_cfg->lfr.enable_5g_band_pref = true;
 		break;
 	case REASON_ROAM_SET_SSID_ALLOWED:
-		qdf_mem_zero(&roam_params_dst->ssid_allowed_list,
-				sizeof(tSirMacSSid) * MAX_SSID_ALLOWED_LIST);
-		roam_params_dst->num_ssid_allowed_list =
-			roam_params_src->num_ssid_allowed_list;
-		for (i = 0; i < roam_params_dst->num_ssid_allowed_list; i++) {
-			roam_params_dst->ssid_allowed_list[i].length =
-				roam_params_src->ssid_allowed_list[i].length;
-			qdf_mem_copy(roam_params_dst->ssid_allowed_list[i].ssId,
-				roam_params_src->ssid_allowed_list[i].ssId,
-				roam_params_dst->ssid_allowed_list[i].length);
+		qdf_mem_zero(&dst_rso_usr_cfg->ssid_allowed_list,
+			     sizeof(struct wlan_ssid) * MAX_SSID_ALLOWED_LIST);
+		dst_rso_usr_cfg->num_ssid_allowed_list =
+			src_rso_config->num_ssid_allowed_list;
+		for (i = 0; i < dst_rso_usr_cfg->num_ssid_allowed_list; i++) {
+			dst_rso_usr_cfg->ssid_allowed_list[i].length =
+				src_rso_config->ssid_allowed_list[i].length;
+			qdf_mem_copy(dst_rso_usr_cfg->ssid_allowed_list[i].ssid,
+				src_rso_config->ssid_allowed_list[i].ssid,
+				dst_rso_usr_cfg->ssid_allowed_list[i].length);
 		}
 		break;
 	case REASON_ROAM_SET_FAVORED_BSSID:
-		qdf_mem_zero(&roam_params_dst->bssid_favored,
-			sizeof(tSirMacAddr) * MAX_BSSID_FAVORED);
-		roam_params_dst->num_bssid_favored =
-			roam_params_src->num_bssid_favored;
-		for (i = 0; i < roam_params_dst->num_bssid_favored; i++) {
-			qdf_mem_copy(&roam_params_dst->bssid_favored[i],
-				&roam_params_src->bssid_favored[i],
-				sizeof(tSirMacAddr));
-			roam_params_dst->bssid_favored_factor[i] =
-				roam_params_src->bssid_favored_factor[i];
-		}
-		break;
-	case REASON_ROAM_SET_BLACKLIST_BSSID:
-		qdf_mem_zero(&roam_params_dst->bssid_avoid_list,
-			QDF_MAC_ADDR_SIZE * MAX_BSSID_AVOID_LIST);
-		roam_params_dst->num_bssid_avoid_list =
-			roam_params_src->num_bssid_avoid_list;
-		for (i = 0; i < roam_params_dst->num_bssid_avoid_list; i++) {
-			qdf_copy_macaddr(&roam_params_dst->bssid_avoid_list[i],
-					&roam_params_src->bssid_avoid_list[i]);
+		qdf_mem_zero(&dst_rso_usr_cfg->bssid_favored,
+			sizeof(struct qdf_mac_addr) * MAX_BSSID_FAVORED);
+		dst_rso_usr_cfg->num_bssid_favored =
+			src_rso_config->num_bssid_favored;
+		for (i = 0; i < dst_rso_usr_cfg->num_bssid_favored; i++) {
+			qdf_copy_macaddr(&dst_rso_usr_cfg->bssid_favored[i],
+					 &src_rso_config->bssid_favored[i]);
+			dst_rso_usr_cfg->bssid_favored_factor[i] =
+				src_rso_config->bssid_favored_factor[i];
 		}
 		break;
 	case REASON_ROAM_GOOD_RSSI_CHANGED:
-		mlme_obj->cfg.lfr.rso_user_config.good_rssi_roam =
-			roam_params_src->good_rssi_roam;
+		dst_rso_usr_cfg->good_rssi_roam =
+					src_rso_config->good_rssi_roam;
 		break;
 	default:
 		break;
@@ -1088,7 +1067,7 @@ QDF_STATUS sme_update_roam_params(mac_handle_t mac_handle,
 
 	status = sme_acquire_global_lock(&mac_ctx->sme);
 	if (QDF_IS_STATUS_SUCCESS(status)) {
-		csr_roam_update_cfg(mac_ctx, session_id, update_param);
+		csr_roam_update_cfg(mac_ctx, vdev_id, update_param);
 		sme_release_global_lock(&mac_ctx->sme);
 	}
 

+ 42 - 248
core/sme/src/csr/csr_api_roam.c

@@ -4710,19 +4710,27 @@ csr_check_for_allowed_ssid(struct mac_context *mac,
 			   tDot11fBeaconIEs *roamed_bss_ies)
 {
 	uint8_t i;
-	tSirMacSSid *ssid_list =
-		mac->roam.configParam.roam_params.ssid_allowed_list;
-	uint8_t num_ssid_allowed_list =
-		mac->roam.configParam.roam_params.num_ssid_allowed_list;
+	struct wlan_ssid *ssid_list;
+	uint8_t num_ssid_allowed_list;
+	struct wlan_mlme_psoc_ext_obj *mlme_obj;
+	struct rso_config_params *rso_usr_cfg;
+
+	mlme_obj = mlme_get_psoc_ext_obj(mac->psoc);
+	if (!mlme_obj)
+		return false;
+
+	rso_usr_cfg = &mlme_obj->cfg.lfr.rso_user_config;
 
 	if (!roamed_bss_ies) {
 		sme_debug(" Roamed BSS IEs NULL");
 		return false;
 	}
+	num_ssid_allowed_list = rso_usr_cfg->num_ssid_allowed_list;
+	ssid_list =  rso_usr_cfg->ssid_allowed_list;
 
 	for (i = 0; i < num_ssid_allowed_list; i++) {
 		if (ssid_list[i].length == roamed_bss_ies->SSID.num_ssid &&
-		    !qdf_mem_cmp(ssid_list[i].ssId, roamed_bss_ies->SSID.ssid,
+		    !qdf_mem_cmp(ssid_list[i].ssid, roamed_bss_ies->SSID.ssid,
 				 ssid_list[i].length))
 			return true;
 	}
@@ -10290,28 +10298,23 @@ static void csr_update_fils_scan_filter(struct scan_filter *filter,
 #endif
 #endif
 
-static inline void csr_copy_ssids(struct wlan_ssid *ssid, tSirMacSSid *from)
-{
-	ssid->length = from->length;
-	if (ssid->length > WLAN_SSID_MAX_LEN)
-		ssid->length = WLAN_SSID_MAX_LEN;
-	qdf_mem_copy(ssid->ssid, from->ssId, ssid->length);
-}
-
-void csr_copy_ssids_from_roam_params(struct roam_ext_params *roam_params,
+void csr_copy_ssids_from_roam_params(struct rso_config_params *rso_usr_cfg,
 				     struct scan_filter *filter)
 {
 	uint8_t i;
+	uint8_t max_ssid;
 
-	if (!roam_params->num_ssid_allowed_list)
+	if (!rso_usr_cfg->num_ssid_allowed_list)
 		return;
+	max_ssid = QDF_MIN(WLAN_SCAN_FILTER_NUM_SSID, MAX_SSID_ALLOWED_LIST);
 
-	filter->num_of_ssid = roam_params->num_ssid_allowed_list;
-	if (filter->num_of_ssid > WLAN_SCAN_FILTER_NUM_SSID)
-		filter->num_of_ssid = WLAN_SCAN_FILTER_NUM_SSID;
+	filter->num_of_ssid = rso_usr_cfg->num_ssid_allowed_list;
+	if (filter->num_of_ssid > max_ssid)
+		filter->num_of_ssid = max_ssid;
 	for  (i = 0; i < filter->num_of_ssid; i++)
-		csr_copy_ssids(&filter->ssid_list[i],
-			       &roam_params->ssid_allowed_list[i]);
+		qdf_mem_copy(&filter->ssid_list[i],
+			     &rso_usr_cfg->ssid_allowed_list[i],
+			     sizeof(struct wlan_ssid));
 }
 
 void csr_update_scan_filter_dot11mode(struct mac_context *mac_ctx,
@@ -10328,6 +10331,14 @@ void csr_update_scan_filter_dot11mode(struct mac_context *mac_ctx,
 }
 
 #ifndef FEATURE_CM_ENABLE
+static inline void csr_copy_ssids(struct wlan_ssid *ssid, tSirMacSSid *from)
+{
+	ssid->length = from->length;
+	if (ssid->length > WLAN_SSID_MAX_LEN)
+		ssid->length = WLAN_SSID_MAX_LEN;
+	qdf_mem_copy(ssid->ssid, from->ssId, ssid->length);
+}
+
 static void csr_copy_ssids_from_profile(tCsrSSIDs *ssid_list,
 					struct scan_filter *filter)
 {
@@ -10383,16 +10394,21 @@ csr_roam_get_scan_filter_from_profile(struct mac_context *mac_ctx,
 				      uint8_t vdev_id)
 {
 	tCsrChannelInfo *ch_info;
-	struct roam_ext_params *roam_params;
 	uint8_t i;
 	QDF_STATUS status;
+	struct wlan_mlme_psoc_ext_obj *mlme_obj;
+	struct rso_config_params *rso_usr_cfg;
+
+	mlme_obj = mlme_get_psoc_ext_obj(mac_ctx->psoc);
+	if (!mlme_obj)
+		return QDF_STATUS_E_FAILURE;
+
+	rso_usr_cfg = &mlme_obj->cfg.lfr.rso_user_config;
 
 	if (!filter || !profile) {
 		sme_err("filter or profile is NULL");
 		return QDF_STATUS_E_FAILURE;
 	}
-	roam_params = &mac_ctx->roam.configParam.roam_params;
-
 	qdf_mem_zero(filter, sizeof(*filter));
 	if (profile->BSSIDs.numOfBSSIDs) {
 		filter->num_of_bssid = profile->BSSIDs.numOfBSSIDs;
@@ -10405,8 +10421,8 @@ csr_roam_get_scan_filter_from_profile(struct mac_context *mac_ctx,
 	}
 
 	if (profile->SSIDs.numOfSSIDs) {
-		if (is_roam && roam_params->num_ssid_allowed_list)
-			csr_copy_ssids_from_roam_params(roam_params, filter);
+		if (is_roam && rso_usr_cfg->num_ssid_allowed_list)
+			csr_copy_ssids_from_roam_params(rso_usr_cfg, filter);
 		else
 			csr_copy_ssids_from_profile(&profile->SSIDs, filter);
 	}
@@ -14261,7 +14277,7 @@ QDF_STATUS cm_csr_handle_diconnect_req(struct wlan_objmgr_vdev *vdev,
 	csr_update_prev_ap_info(session, vdev);
 	csr_qos_send_disconnect_ind(mac_ctx, vdev_id);
 
-	csr_roam_reset_roam_params(mac_ctx);
+	wlan_roam_reset_roam_params(mac_ctx->psoc);
 	csr_roam_restore_default_config(mac_ctx, vdev_id);
 
 	/* Fill legacy struct */
@@ -16129,15 +16145,6 @@ csr_roam_pmkid_req_callback(uint8_t vdev_id,
 	return status;
 }
 #endif /* WLAN_FEATURE_FIPS */
-#else
-static inline void
-csr_update_roam_scan_offload_request(struct mac_context *mac_ctx,
-				     struct roam_offload_scan_req *req_buf,
-				     struct csr_roam_session *session)
-{
-	req_buf->roam_force_rssi_trigger =
-			mac_ctx->mlme_cfg->lfr.roam_force_rssi_trigger;
-}
 #endif /* WLAN_FEATURE_ROAM_OFFLOAD */
 
 #if defined(WLAN_FEATURE_HOST_ROAM) || defined(WLAN_FEATURE_ROAM_OFFLOAD)
@@ -16223,48 +16230,6 @@ static void csr_update_btm_offload_config(struct mac_context *mac_ctx,
 		  QDF_MAC_ADDR_REF(session->pConnectBssDesc->bssId));
 }
 
-/**
- * csr_add_rssi_reject_ap_list() - add rssi reject AP list to the
- * roam params
- * @mac_ctx: mac ctx.
- * @roam_params: roam params in which reject AP list needs
- * to be populated.
- *
- * Return: None
- */
-static void
-csr_add_rssi_reject_ap_list(struct mac_context *mac_ctx,
-			    struct roam_ext_params *roam_params)
-{
-	int i = 0;
-	struct reject_ap_config_params *reject_list;
-
-	reject_list = qdf_mem_malloc(sizeof(*reject_list) *
-				     MAX_RSSI_AVOID_BSSID_LIST);
-	if (!reject_list)
-		return;
-
-	roam_params->num_rssi_rejection_ap =
-		wlan_blm_get_bssid_reject_list(mac_ctx->pdev, reject_list,
-					       MAX_RSSI_AVOID_BSSID_LIST,
-					       DRIVER_RSSI_REJECT_TYPE);
-	if (!roam_params->num_rssi_rejection_ap) {
-		qdf_mem_free(reject_list);
-		return;
-	}
-
-	for (i = 0; i < roam_params->num_rssi_rejection_ap; i++) {
-		roam_params->rssi_reject_bssid_list[i] = reject_list[i];
-		sme_debug("BSSID "QDF_MAC_ADDR_FMT" expected rssi %d remaining duration %d",
-			  QDF_MAC_ADDR_REF(roam_params->rssi_reject_bssid_list[i].bssid.bytes),
-			  roam_params->rssi_reject_bssid_list[i].expected_rssi,
-			  roam_params->rssi_reject_bssid_list[i].
-							reject_duration);
-	}
-
-	qdf_mem_free(reject_list);
-}
-
 /**
  * csr_update_11k_offload_params - Update 11K offload params
  * @mac_ctx: MAC context
@@ -17362,147 +17327,6 @@ static void csr_cm_roam_scan_offload_fill_rso_configs(
 					     vdev_id);
 }
 
-/**
- * csr_cm_roam_scan_filter() - set roam scan filter parameters
- * @mac_ctx: global mac ctx
- * @vdev_id: vdev id
- * @command: rso command
- * @reason:  reason to roam
- * @scan_filter_params:  roam scan filter related parameters
- *
- * There are filters such as whitelist, blacklist and preferred
- * list that need to be applied to the scan results to form the
- * probable candidates for roaming.
- *
- * Return: None
- */
-static void
-csr_cm_roam_scan_filter(struct mac_context *mac_ctx, uint8_t vdev_id,
-			uint8_t command, uint8_t reason,
-			struct wlan_roam_scan_filter_params *scan_filter_params)
-{
-	int i;
-	uint32_t num_bssid_black_list = 0, num_ssid_white_list = 0,
-	   num_bssid_preferred_list = 0,  num_rssi_rejection_ap = 0;
-	uint32_t op_bitmap = 0;
-	struct roam_ext_params *roam_params;
-	struct roam_scan_filter_params *params;
-
-	scan_filter_params->reason = reason;
-	params = &scan_filter_params->filter_params;
-	roam_params = &mac_ctx->roam.configParam.roam_params;
-	/*
-	 * If rssi disallow bssid list have any member
-	 * fill it and send it to firmware so that firmware does not
-	 * try to roam to these BSS until RSSI OR time condition are
-	 * matched.
-	 */
-	csr_add_rssi_reject_ap_list(mac_ctx, roam_params);
-
-	if (command != ROAM_SCAN_OFFLOAD_STOP) {
-		switch (reason) {
-		case REASON_ROAM_SET_BLACKLIST_BSSID:
-			op_bitmap |= 0x1;
-			num_bssid_black_list =
-				roam_params->num_bssid_avoid_list;
-			break;
-		case REASON_ROAM_SET_SSID_ALLOWED:
-			op_bitmap |= 0x2;
-			num_ssid_white_list =
-				roam_params->num_ssid_allowed_list;
-			break;
-		case REASON_ROAM_SET_FAVORED_BSSID:
-			op_bitmap |= 0x4;
-			num_bssid_preferred_list =
-				roam_params->num_bssid_favored;
-			break;
-		case REASON_CTX_INIT:
-			if (command == ROAM_SCAN_OFFLOAD_START) {
-				params->lca_disallow_config_present = true;
-				num_rssi_rejection_ap =
-					roam_params->num_rssi_rejection_ap;
-			} else {
-				sme_debug("Roam Filter need not be sent, no need to fill parameters");
-				return;
-			}
-			break;
-		default:
-			sme_debug("Roam Filter need not be sent, no need to fill parameters");
-			return;
-		}
-	} else {
-		/* In case of STOP command, reset all the variables
-		 * except for blacklist BSSID which should be retained
-		 * across connections.
-		 */
-		op_bitmap = 0x2 | 0x4;
-		if (reason == REASON_ROAM_SET_SSID_ALLOWED)
-			num_ssid_white_list =
-					roam_params->num_ssid_allowed_list;
-		num_bssid_preferred_list = roam_params->num_bssid_favored;
-	}
-
-	/* fill in fixed values */
-	params->vdev_id = vdev_id;
-	params->op_bitmap = op_bitmap;
-	params->num_bssid_black_list = num_bssid_black_list;
-	params->num_ssid_white_list = num_ssid_white_list;
-	params->num_bssid_preferred_list = num_bssid_preferred_list;
-	params->num_rssi_rejection_ap = num_rssi_rejection_ap;
-	params->delta_rssi =
-		wlan_blm_get_rssi_blacklist_threshold(mac_ctx->pdev);
-	if (params->num_bssid_black_list)
-		qdf_mem_copy(params->bssid_avoid_list,
-			     roam_params->bssid_avoid_list,
-			     MAX_BSSID_AVOID_LIST *
-					sizeof(struct qdf_mac_addr));
-
-	for (i = 0; i < num_ssid_white_list; i++) {
-		qdf_mem_copy(params->ssid_allowed_list[i].ssid,
-			     roam_params->ssid_allowed_list[i].ssId,
-			     roam_params->ssid_allowed_list[i].length);
-		params->ssid_allowed_list[i].length =
-				roam_params->ssid_allowed_list[i].length;
-		sme_debug("SSID %d: %.*s", i,
-			  params->ssid_allowed_list[i].length,
-			  params->ssid_allowed_list[i].ssid);
-	}
-
-	for (i = 0; i < params->num_bssid_black_list; i++)
-		sme_debug("Blacklist bssid[%d]:" QDF_MAC_ADDR_FMT, i,
-			  QDF_MAC_ADDR_REF(params->bssid_avoid_list[i].bytes));
-	if (params->num_bssid_preferred_list) {
-		qdf_mem_copy(params->bssid_favored, roam_params->bssid_favored,
-			     MAX_BSSID_FAVORED * sizeof(struct qdf_mac_addr));
-		qdf_mem_copy(params->bssid_favored_factor,
-			     roam_params->bssid_favored_factor,
-			     MAX_BSSID_FAVORED);
-	}
-	if (params->num_rssi_rejection_ap)
-		qdf_mem_copy(params->rssi_rejection_ap,
-			     roam_params->rssi_reject_bssid_list,
-			     MAX_RSSI_AVOID_BSSID_LIST *
-			     sizeof(struct reject_ap_config_params));
-
-	for (i = 0; i < params->num_bssid_preferred_list; i++)
-		sme_debug("Preferred Bssid[%d]:"QDF_MAC_ADDR_FMT" score: %d", i,
-			  QDF_MAC_ADDR_REF(params->bssid_favored[i].bytes),
-			  params->bssid_favored_factor[i]);
-
-	if (params->lca_disallow_config_present) {
-		params->disallow_duration
-				= mac_ctx->mlme_cfg->lfr.lfr3_disallow_duration;
-		params->rssi_channel_penalization
-			= mac_ctx->mlme_cfg->lfr.lfr3_rssi_channel_penalization;
-		params->num_disallowed_aps
-			= mac_ctx->mlme_cfg->lfr.lfr3_num_disallowed_aps;
-		sme_debug("disallow_dur %d rssi_chan_pen %d num_disallowed_aps %d",
-			  params->disallow_duration,
-			  params->rssi_channel_penalization,
-			  params->num_disallowed_aps);
-	}
-}
-
 /**
  * csr_cm_roam_scan_btm_offload() - set roam scan btm offload parameters
  * @mac_ctx: global mac ctx
@@ -17579,9 +17403,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_filter(mac_ctx, vdev_id, ROAM_SCAN_OFFLOAD_START,
-				reason, &req->scan_filter_params);
-
 	csr_cm_roam_scan_offload_fill_rso_configs(mac_ctx, session,
 						  &req->rso_config,
 						  &req->rso_chan_info,
@@ -17618,30 +17439,6 @@ wlan_cm_roam_fill_stop_req(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id,
 		return QDF_STATUS_E_FAILURE;
 	}
 
-	if (reason == REASON_ROAM_SYNCH_FAILED)
-		return status;
-	else if (reason == REASON_DRIVER_DISABLED)
-		req->reason = REASON_ROAM_STOP_ALL;
-	else if (reason == REASON_SUPPLICANT_DISABLED_ROAMING)
-		req->reason = REASON_SUPPLICANT_DISABLED_ROAMING;
-	else if (reason == REASON_DISCONNECTED)
-		req->reason = REASON_DISCONNECTED;
-	else if (reason == REASON_OS_REQUESTED_ROAMING_NOW)
-		req->reason = REASON_OS_REQUESTED_ROAMING_NOW;
-	else
-		req->reason = REASON_SME_ISSUED;
-
-	if (csr_neighbor_middle_of_roaming(mac_ctx, vdev_id))
-		req->middle_of_roaming = 1;
-	else
-		csr_roam_reset_roam_params(mac_ctx);
-
-	/*
-	 * Disable offload_11k_params for current vdev
-	 */
-	req->roam_11k_params.vdev_id = vdev_id;
-	csr_cm_roam_scan_filter(mac_ctx, vdev_id, ROAM_SCAN_OFFLOAD_STOP,
-				reason, &req->scan_filter_params);
 	csr_cm_roam_scan_offload_fill_rso_configs(mac_ctx, session,
 						  &req->rso_config,
 						  NULL,
@@ -17673,9 +17470,6 @@ wlan_cm_roam_fill_update_config_req(struct wlan_objmgr_psoc *psoc,
 		return QDF_STATUS_E_FAILURE;
 	}
 
-	csr_cm_roam_scan_filter(mac_ctx, vdev_id, ROAM_SCAN_OFFLOAD_UPDATE_CFG,
-				reason, &req->scan_filter_params);
-
 	csr_cm_roam_scan_offload_fill_rso_configs(mac_ctx, session,
 						  &req->rso_config,
 						  &req->rso_chan_info,

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

@@ -401,12 +401,12 @@ enum csr_cfgdot11mode csr_find_best_phy_mode(struct mac_context *mac,
 
 /*
  * csr_copy_ssids_from_roam_params() - copy SSID from roam_params to scan filter
- * @roam_params: roam params
+ * @rso_usr_cfg: rso user config
  * @filter: scan filter
  *
  * Return void
  */
-void csr_copy_ssids_from_roam_params(struct roam_ext_params *roam_params,
+void csr_copy_ssids_from_roam_params(struct rso_config_params *rso_usr_cfg,
 				     struct scan_filter *filter);
 
 /*

+ 16 - 33
core/sme/src/csr/csr_neighbor_roam.c

@@ -342,11 +342,18 @@ csr_neighbor_roam_get_scan_filter_from_profile(struct mac_context *mac,
 {
 	tpCsrNeighborRoamControlInfo nbr_roam_info;
 	tCsrRoamConnectedProfile *profile;
-	struct roam_ext_params *roam_params;
 	uint8_t num_ch = 0;
 	struct wlan_objmgr_vdev *vdev;
 	struct rso_config *rso_cfg;
 	struct rso_chan_info *chan_lst;
+	struct wlan_mlme_psoc_ext_obj *mlme_obj;
+	struct rso_config_params *rso_usr_cfg;
+
+	mlme_obj = mlme_get_psoc_ext_obj(mac->psoc);
+	if (!mlme_obj)
+		return QDF_STATUS_E_FAILURE;
+
+	rso_usr_cfg = &mlme_obj->cfg.lfr.rso_user_config;
 
 	if (!filter)
 		return QDF_STATUS_E_FAILURE;
@@ -356,7 +363,6 @@ csr_neighbor_roam_get_scan_filter_from_profile(struct mac_context *mac,
 	qdf_mem_zero(filter, sizeof(*filter));
 	nbr_roam_info = &mac->roam.neighborRoamInfo[vdev_id];
 	profile = &mac->roam.roamSession[vdev_id].connectedProfile;
-	roam_params = &mac->roam.configParam.roam_params;
 
 	/* only for HDD requested handoff fill in the BSSID in the filter */
 	if (nbr_roam_info->uOsRequestedHandoff) {
@@ -367,10 +373,10 @@ csr_neighbor_roam_get_scan_filter_from_profile(struct mac_context *mac,
 			     QDF_MAC_ADDR_SIZE);
 	}
 	sme_debug("No of Allowed SSID List:%d",
-		  roam_params->num_ssid_allowed_list);
+		  rso_usr_cfg->num_ssid_allowed_list);
 
-	if (roam_params->num_ssid_allowed_list) {
-		csr_copy_ssids_from_roam_params(roam_params, filter);
+	if (rso_usr_cfg->num_ssid_allowed_list) {
+		csr_copy_ssids_from_roam_params(rso_usr_cfg, filter);
 	} else {
 		filter->num_of_ssid = 1;
 
@@ -585,30 +591,6 @@ QDF_STATUS csr_neighbor_roam_merge_channel_lists(struct mac_context *mac,
 	return QDF_STATUS_SUCCESS;
 }
 
-/**
- * csr_roam_reset_roam_params - API to reset the roaming parameters
- * @mac_ctx:          Pointer to the global MAC structure
- *
- * The BSSID blacklist should not be cleared since it has to
- * be used across connections. These parameters will be cleared
- * and sent to firmware with with the roaming STOP command.
- *
- * Return: VOID
- */
-void csr_roam_reset_roam_params(struct mac_context *mac_ctx)
-{
-	struct roam_ext_params *roam_params = NULL;
-
-	/*
-	 * clear all the whitelist parameters and remaining
-	 * needs to be retained across connections.
-	 */
-	roam_params = &mac_ctx->roam.configParam.roam_params;
-	roam_params->num_ssid_allowed_list = 0;
-	qdf_mem_zero(&roam_params->ssid_allowed_list,
-			sizeof(tSirMacSSid) * MAX_SSID_ALLOWED_LIST);
-}
-
 #if defined(WLAN_FEATURE_HOST_ROAM) || defined(WLAN_FEATURE_ROAM_OFFLOAD)
 void csr_roam_restore_default_config(struct mac_context *mac_ctx,
 				     uint8_t vdev_id)
@@ -733,7 +715,7 @@ QDF_STATUS csr_neighbor_roam_indicate_disconnect(struct mac_context *mac,
 	 * For a new connection, they have to be programmed again.
 	 */
 	if (!csr_neighbor_middle_of_roaming(mac, sessionId)) {
-		csr_roam_reset_roam_params(mac);
+		wlan_roam_reset_roam_params(mac->psoc);
 		csr_roam_restore_default_config(mac, sessionId);
 	}
 
@@ -1099,9 +1081,10 @@ bool csr_neighbor_middle_of_roaming(struct mac_context *mac, uint8_t sessionId)
 	return val;
 }
 
+#ifndef FEATURE_CM_ENABLE
 bool
-wlan_cm_neighbor_roam_in_progress(struct wlan_objmgr_psoc *psoc,
-				  uint8_t vdev_id)
+wlan_cm_host_roam_in_progress(struct wlan_objmgr_psoc *psoc,
+			      uint8_t vdev_id)
 {
 	struct csr_roam_session *session;
 	struct mac_context *mac_ctx;
@@ -1120,7 +1103,7 @@ wlan_cm_neighbor_roam_in_progress(struct wlan_objmgr_psoc *psoc,
 
 	return csr_neighbor_middle_of_roaming(mac_ctx, vdev_id);
 }
-
+#endif
 /**
  * csr_neighbor_roam_process_handoff_req - Processes handoff request
  *