Browse Source

qcacld-3.0: Add support to send RSSI_CHANGE_THRESHOLD

Add support to send WMI_RSSI_CHANGE_THRESHOLD command to firmware
in connection manager.

Change-Id: I97d4b8f8fc0e938ede0e61d44eb8ffbcbb0fb4ff
CRs-Fixed: 2761043
Pragaspathi Thilagaraj 4 years ago
parent
commit
eec05fff64

+ 38 - 0
components/target_if/connection_mgr/src/target_if_cm_roam_offload.c

@@ -808,6 +808,28 @@ target_if_cm_roam_send_roam_init(struct wlan_objmgr_vdev *vdev,
 	return status;
 }
 
+/**
+ * target_if_cm_roam_scan_rssi_change_cmd()  - Send WMI_ROAM_SCAN_RSSI_CHANGE
+ * command to firmware
+ * @vdev:  Vdev object
+ * @params: RSSI change parameters
+ *
+ * Return: QDF_STATUS
+ */
+static QDF_STATUS target_if_cm_roam_scan_rssi_change_cmd(
+			wmi_unified_t wmi_handle,
+			struct wlan_roam_rssi_change_params *params)
+{
+	/*
+	 * Start new rssi triggered scan only if it changes by
+	 * RoamRssiDiff value. Beacon weight of 14 means average rssi
+	 * is taken over 14 previous samples + 2 times the current
+	 * beacon's rssi.
+	 */
+	return wmi_unified_roam_scan_offload_rssi_change_cmd(wmi_handle,
+							     params);
+}
+
 /**
  * target_if_cm_roam_send_start() - Send roam start related commands
  * to wmi
@@ -862,6 +884,14 @@ target_if_cm_roam_send_start(struct wlan_objmgr_vdev *vdev,
 			goto end;
 	}
 
+	status = target_if_cm_roam_scan_rssi_change_cmd(
+			wmi_handle, &req->rssi_change_params);
+	if (QDF_IS_STATUS_ERROR(status)) {
+		target_if_err("vdev:%d Sending rssi change threshold failed",
+			      req->rssi_change_params.vdev_id);
+		goto end;
+	}
+
 	status = target_if_cm_roam_scan_offload_ap_profile(
 							vdev, wmi_handle,
 							&req->profile_params);
@@ -1083,6 +1113,14 @@ target_if_cm_roam_send_update_config(struct wlan_objmgr_vdev *vdev,
 			goto end;
 	}
 
+	status = target_if_cm_roam_scan_rssi_change_cmd(
+			wmi_handle, &req->rssi_change_params);
+	if (QDF_IS_STATUS_ERROR(status)) {
+		target_if_err("vdev:%d Sending rssi change threshold failed",
+			      req->rssi_change_params.vdev_id);
+		goto end;
+	}
+
 	status = target_if_cm_roam_scan_offload_ap_profile(
 							vdev, wmi_handle,
 							&req->profile_params);

+ 27 - 0
components/umac/mlme/connection_mgr/core/src/wlan_cm_roam_offload.c

@@ -53,6 +53,28 @@ cm_roam_scan_bmiss_cnt(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id,
 	params->roam_bmiss_final_bcnt = beacon_miss_count;
 }
 
+QDF_STATUS
+cm_roam_fill_rssi_change_params(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id,
+				struct wlan_roam_rssi_change_params *params)
+{
+	struct cm_roam_values_copy temp;
+
+	params->vdev_id = vdev_id;
+	wlan_cm_roam_cfg_get_value(psoc, vdev_id,
+				   RSSI_CHANGE_THRESHOLD, &temp);
+	params->rssi_change_thresh = temp.int_value;
+
+	wlan_cm_roam_cfg_get_value(psoc, vdev_id,
+				   BEACON_RSSI_WEIGHT, &temp);
+	params->bcn_rssi_weight = temp.uint_value;
+
+	wlan_cm_roam_cfg_get_value(psoc, vdev_id,
+				   HI_RSSI_DELAY_BTW_SCANS, &temp);
+	params->hirssi_delay_btw_scans = temp.uint_value;
+
+	return QDF_STATUS_SUCCESS;
+}
+
 #ifdef WLAN_FEATURE_ROAM_OFFLOAD
 /**
  * cm_roam_reason_vsie() - set roam reason vsie
@@ -274,6 +296,8 @@ cm_roam_start_req(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id,
 	cm_roam_scan_bmiss_cnt(psoc, vdev_id, &start_req->beacon_miss_cnt);
 	cm_roam_reason_vsie(psoc, vdev_id, &start_req->reason_vsie_enable);
 	cm_roam_triggers(psoc, vdev_id, &start_req->roam_triggers);
+	cm_roam_fill_rssi_change_params(psoc, vdev_id,
+					&start_req->rssi_change_params);
 	cm_roam_mawc_params(psoc, vdev_id, &start_req->mawc_params);
 	cm_roam_bss_load_config(psoc, vdev_id, &start_req->bss_load_config);
 	cm_roam_disconnect_params(psoc, vdev_id, &start_req->disconnect_params);
@@ -311,8 +335,11 @@ cm_roam_update_config_req(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id,
 	update_req = qdf_mem_malloc(sizeof(*update_req));
 	if (!update_req)
 		return QDF_STATUS_E_NOMEM;
+
 	/* 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,
+					&update_req->rssi_change_params);
 	if (!MLME_IS_ROAM_STATE_RSO_ENABLED(psoc, vdev_id)) {
 		cm_roam_disconnect_params(psoc, vdev_id,
 					  &update_req->disconnect_params);

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

@@ -75,5 +75,16 @@ QDF_STATUS
 cm_roam_stop_req(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id,
 		 uint8_t reason);
 
+/**
+ * wlan_cm_rso_fill_rssi_change_params  - Fill roam scan rssi change parameters
+ * @psoc: PSOC pointer
+ * @vdev_id: vdev_id
+ * @params: RSSI change parameters
+ *
+ * Return: QDF_STATUS
+ */
+QDF_STATUS
+cm_roam_fill_rssi_change_params(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id,
+				struct wlan_roam_rssi_change_params *params);
 #endif
 #endif

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

@@ -24,7 +24,7 @@
 #define WLAN_CM_ROAM_API_H__
 
 #include "wlan_mlme_dbg.h"
-#include "wlan_cm_roam_public_struct.h"
+#include "../../core/src/wlan_cm_roam_offload.h"
 #include "wlan_mlme_main.h"
 #include "wlan_mlme_api.h"
 
@@ -242,6 +242,43 @@ QDF_STATUS wlan_cm_roam_send_rso_cmd(struct wlan_objmgr_psoc *psoc,
  */
 QDF_STATUS wlan_cm_roam_stop_req(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id,
 				 uint8_t reason);
+
+/**
+ * wlan_cm_roam_cfg_get_value  - Get RSO config value from mlme vdev private
+ * object
+ * @psoc: psoc pointer
+ * @vdev_id: vdev id
+ * @roam_cfg_type: Value needed
+ * @dst_config: Destination config
+ *
+ * Return: QDF_STATUS
+ */
+QDF_STATUS wlan_cm_roam_cfg_get_value(struct wlan_objmgr_psoc *psoc,
+				      uint8_t vdev_id,
+				      enum roam_cfg_param roam_cfg_type,
+				      struct cm_roam_values_copy *dst_config);
+
+/**
+ * wlan_cm_roam_cfg_set_value  - Set RSO config value
+ * @psoc: psoc pointer
+ * @vdev_id: vdev id
+ * @roam_cfg_type: Roam configuration type to set
+ * @src_config: Source config
+ *
+ * Return: QDF_STATUS
+ */
+QDF_STATUS
+wlan_cm_roam_cfg_set_value(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id,
+			   enum roam_cfg_param roam_cfg_type,
+			   struct cm_roam_values_copy *src_config);
+#else
+static inline QDF_STATUS
+wlan_cm_roam_cfg_set_value(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id,
+			   enum roam_cfg_param roam_cfg_type,
+			   struct cm_roam_values_copy *src_config)
+{
+	return QDF_STATUS_SUCCESS;
+}
 #endif
 
 #ifdef WLAN_FEATURE_ROAM_OFFLOAD

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

@@ -88,6 +88,19 @@
 #define REASON_ROAM_HANDOFF_DONE                    52
 #define REASON_ROAM_ABORT                           53
 
+/**
+ * enum roam_cfg_param  - Type values for roaming parameters used as index
+ * for get/set of roaming config values(pNeighborRoamInfo in legacy)
+ * @RSSI_CHANGE_THRESHOLD: Rssi change threshold
+ * @BEACON_RSSI_WEIGHT: Beacon Rssi weight parameter
+ * @HI_RSSI_DELAY_BTW_SCANS: High Rssi delay between scans
+ */
+enum roam_cfg_param {
+	RSSI_CHANGE_THRESHOLD,
+	BEACON_RSSI_WEIGHT,
+	HI_RSSI_DELAY_BTW_SCANS,
+};
+
 /**
  * enum roam_offload_init_flags  - Flags sent in Roam offload initialization.
  * @WLAN_ROAM_FW_OFFLOAD_ENABLE: Init roaming module at firwmare
@@ -984,7 +997,25 @@ struct wlan_roam_scan_period_params {
 	uint32_t roam_scan_period_after_inactivity;
 	uint32_t full_scan_period;
 };
+#endif
+
+/**
+ * struct wlan_roam_rssi_change_params  - RSSI change parameters to be sent over
+ * WMI_ROAM_SCAN_RSSI_CHANGE_THRESHOLD command
+ * @vdev_id: vdev id
+ * only if current RSSI changes by rssi_change_thresh value.
+ * @bcn_rssi_weight: Beacon RSSI weightage
+ * @hirssi_delay_btw_scans: Delay between high RSSI scans
+ * @rssi_change_thresh: RSSI change threshold. Start new rssi triggered scan
+ */
+struct wlan_roam_rssi_change_params {
+	uint32_t vdev_id;
+	uint32_t bcn_rssi_weight;
+	uint32_t hirssi_delay_btw_scans;
+	int32_t rssi_change_thresh;
+};
 
+#ifdef ROAM_OFFLOAD_V1
 /**
  * struct wlan_roam_start_config - structure containing parameters for
  * roam start config
@@ -993,6 +1024,7 @@ struct wlan_roam_scan_period_params {
  * @reason_vsie_enable: roam reason vsie enable parameters
  * @roam_triggers: roam triggers parameters
  * @scan_period_params: roam scan period parameters
+ * @rssi_change_params: Roam offload RSSI change parameters
  * @profile_params: ap profile parameters
  * @mawc_params: mawc parameters
  * @scan_filter_params: roam scan filter parameters
@@ -1009,6 +1041,7 @@ struct wlan_roam_start_config {
 	struct wlan_roam_triggers roam_triggers;
 	struct wlan_roam_scan_period_params scan_period_params;
 	struct wlan_roam_scan_offload_params rso_config;
+	struct wlan_roam_rssi_change_params rssi_change_params;
 	struct ap_profile_params profile_params;
 	struct wlan_roam_mawc_params mawc_params;
 	struct wlan_roam_scan_filter_params scan_filter_params;
@@ -1051,6 +1084,7 @@ struct wlan_roam_stop_config {
  * @beacon_miss_cnt: roam beacon miss count parameters
  * @scan_filter_params: roam scan filter parameters
  * @scan_period_params: roam scan period parameters
+ * @rssi_change_params: roam scan rssi change parameters
  * @profile_params: ap profile parameters
  * @rssi_params: roam scan rssi threshold parameters
  * @disconnect_params: disconnect params
@@ -1061,6 +1095,7 @@ struct wlan_roam_update_config {
 	struct wlan_roam_beacon_miss_cnt beacon_miss_cnt;
 	struct wlan_roam_scan_filter_params scan_filter_params;
 	struct wlan_roam_scan_period_params scan_period_params;
+	struct wlan_roam_rssi_change_params rssi_change_params;
 	struct ap_profile_params profile_params;
 	struct wlan_roam_offload_scan_rssi_params rssi_params;
 	struct wlan_roam_disconnect_params disconnect_params;
@@ -1210,6 +1245,22 @@ enum roam_scan_freq_scheme {
 	ROAM_SCAN_FREQ_SCHEME_FULL_SCAN = 2,
 };
 
+/**
+ * struct wlan_cm_rso_configs  - Roam scan offload related per vdev
+ * configuration parameters.
+ * @rescan_rssi_delta: Roam scan rssi delta. Start new rssi triggered scan only
+ * if it changes by rescan_rssi_delta value.
+ * @beacon_rssi_weight: Number of beacons to be used to calculate the average
+ * rssi of the AP.
+ * @hi_rssi_scan_delay: Roam scan delay in ms for High RSSI roam trigger.
+ */
+struct wlan_cm_rso_configs {
+	uint8_t rescan_rssi_delta;
+	uint8_t beacon_rssi_weight;
+	uint32_t hi_rssi_scan_delay;
+
+};
+
 /**
  * struct wlan_cm_roam  - Connection manager roam configs, state and roam
  * data related structure
@@ -1217,10 +1268,26 @@ enum roam_scan_freq_scheme {
  * @pcl_vdev_cmd_active:  Flag to check if vdev level pcl command needs to be
  * sent or PDEV level PCL command needs to be sent
  * @control_param: vendor configured roam control param
+ * @vdev_rso_config: Roam scan offload related configurations. Equivalent to the
+ * legacy tpCsrNeighborRoamControlInfo structure.
  */
 struct wlan_cm_roam {
 	struct wlan_cm_roam_tx_ops tx_ops;
 	bool pcl_vdev_cmd_active;
 	struct wlan_cm_roam_vendor_btm_params vendor_btm_param;
+	struct wlan_cm_rso_configs vdev_rso_config;
+};
+
+/**
+ * struct cm_roam_values_copy  - Structure for values copy buffer
+ * @uint_value: Unsigned integer value to be copied
+ * @int_value: Integer value
+ * @bool_value: boolean value
+ */
+struct cm_roam_values_copy {
+	uint32_t uint_value;
+	int32_t int_value;
+	bool bool_value;
+
 };
 #endif

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

@@ -25,7 +25,6 @@
 #include "wlan_mlme_main.h"
 #include "wlan_policy_mgr_api.h"
 #include <wmi_unified_priv.h>
-#include "../../core/src/wlan_cm_roam_offload.h"
 
 #ifdef ROAM_OFFLOAD_V1
 #if defined(WLAN_FEATURE_HOST_ROAM) || defined(WLAN_FEATURE_ROAM_OFFLOAD)
@@ -427,3 +426,91 @@ wlan_cm_roam_get_vendor_btm_params(struct wlan_objmgr_psoc *psoc,
 	wlan_objmgr_vdev_release_ref(vdev, WLAN_MLME_NB_ID);
 }
 #endif
+
+#ifdef ROAM_OFFLOAD_V1
+QDF_STATUS wlan_cm_roam_cfg_get_value(struct wlan_objmgr_psoc *psoc,
+				      uint8_t vdev_id,
+				      enum roam_cfg_param roam_cfg_type,
+				      struct cm_roam_values_copy *dst_config)
+{
+	struct wlan_objmgr_vdev *vdev;
+	struct mlme_legacy_priv *mlme_priv;
+	struct wlan_cm_rso_configs *src_config;
+
+	vdev = wlan_objmgr_get_vdev_by_id_from_psoc(psoc, vdev_id,
+						    WLAN_MLME_NB_ID);
+	if (!vdev) {
+		mlme_err("vdev object is NULL");
+		return QDF_STATUS_E_FAILURE;
+	}
+
+	mlme_priv = wlan_vdev_mlme_get_ext_hdl(vdev);
+	if (!mlme_priv) {
+		mlme_err("vdev legacy private object is NULL");
+		wlan_objmgr_vdev_release_ref(vdev, WLAN_MLME_NB_ID);
+		return QDF_STATUS_E_FAILURE;
+	}
+
+	src_config = &mlme_priv->cm_roam.vdev_rso_config;
+	switch (roam_cfg_type) {
+	case RSSI_CHANGE_THRESHOLD:
+		dst_config->int_value = src_config->rescan_rssi_delta;
+		break;
+	case BEACON_RSSI_WEIGHT:
+		dst_config->uint_value = src_config->beacon_rssi_weight;
+		break;
+	case HI_RSSI_DELAY_BTW_SCANS:
+		dst_config->uint_value = src_config->hi_rssi_scan_delay;
+		break;
+	default:
+		mlme_err("Invalid roam config requested:%d", roam_cfg_type);
+		return QDF_STATUS_E_FAILURE;
+	}
+
+	wlan_objmgr_vdev_release_ref(vdev, WLAN_MLME_NB_ID);
+
+	return QDF_STATUS_E_FAILURE;
+}
+
+QDF_STATUS
+wlan_cm_roam_cfg_set_value(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id,
+			   enum roam_cfg_param roam_cfg_type,
+			   struct cm_roam_values_copy *src_config)
+{
+	struct wlan_objmgr_vdev *vdev;
+	struct mlme_legacy_priv *mlme_priv;
+	struct wlan_cm_rso_configs *dst_config;
+
+	vdev = wlan_objmgr_get_vdev_by_id_from_psoc(psoc, vdev_id,
+						    WLAN_MLME_NB_ID);
+	if (!vdev) {
+		mlme_err("vdev object is NULL");
+		return QDF_STATUS_E_FAILURE;
+	}
+
+	mlme_priv = wlan_vdev_mlme_get_ext_hdl(vdev);
+	if (!mlme_priv) {
+		mlme_err("vdev legacy private object is NULL");
+		wlan_objmgr_vdev_release_ref(vdev, WLAN_MLME_NB_ID);
+		return QDF_STATUS_E_FAILURE;
+	}
+
+	dst_config = &mlme_priv->cm_roam.vdev_rso_config;
+	switch (roam_cfg_type) {
+	case RSSI_CHANGE_THRESHOLD:
+		dst_config->rescan_rssi_delta  = src_config->uint_value;
+		break;
+	case BEACON_RSSI_WEIGHT:
+		dst_config->beacon_rssi_weight = src_config->uint_value;
+		break;
+	case HI_RSSI_DELAY_BTW_SCANS:
+		dst_config->hi_rssi_scan_delay = src_config->uint_value;
+		break;
+	default:
+		mlme_err("Invalid roam config requested:%d", roam_cfg_type);
+	}
+	wlan_objmgr_vdev_release_ref(vdev, WLAN_MLME_NB_ID);
+
+	return QDF_STATUS_SUCCESS;
+}
+#endif

+ 18 - 2
components/wmi/inc/wmi_unified_roam_api.h

@@ -22,7 +22,7 @@
 #define _WMI_UNIFIED_ROAM_API_H_
 
 #include <wmi_unified_roam_param.h>
-#include <wlan_cm_roam_public_struct.h>
+#include "wlan_cm_roam_public_struct.h"
 
 #ifdef FEATURE_LFR_SUBNET_DETECTION
 /**
@@ -333,7 +333,22 @@ wmi_unified_roam_scan_offload_chan_list_cmd(wmi_unified_t wmi_handle,
 					    uint32_t *chan_list,
 					    uint8_t list_type,
 					    uint32_t vdev_id);
-
+#ifdef ROAM_OFFLOAD_V1
+/**
+ * wmi_unified_roam_scan_offload_rssi_change_cmd() - set roam offload RSSI
+ * threshold
+ * @wmi_handle: wmi handle
+ * @params: RSSI change params
+ *
+ * Send WMI_ROAM_SCAN_RSSI_CHANGE_THRESHOLD parameters to fw.
+ *
+ * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
+ */
+QDF_STATUS
+wmi_unified_roam_scan_offload_rssi_change_cmd(
+		wmi_unified_t wmi_handle,
+		struct wlan_roam_rssi_change_params *params);
+#else
 /**
  * wmi_unified_roam_scan_offload_rssi_change_cmd() - set roam offload RSSI th
  * @wmi_handle: wmi handle
@@ -351,6 +366,7 @@ wmi_unified_roam_scan_offload_rssi_change_cmd(wmi_unified_t wmi_handle,
 					      int32_t rssi_change_thresh,
 					      uint32_t bcn_rssi_weight,
 					      uint32_t hirssi_delay_btw_scans);
+#endif
 
 /**
  * wmi_unified_set_per_roam_config() - set PER roam config in FW

+ 13 - 0
components/wmi/src/wmi_unified_roam_api.c

@@ -261,6 +261,18 @@ wmi_unified_roam_scan_offload_chan_list_cmd(wmi_unified_t wmi_handle,
 	return QDF_STATUS_E_FAILURE;
 }
 
+#ifdef ROAM_OFFLOAD_V1
+QDF_STATUS wmi_unified_roam_scan_offload_rssi_change_cmd(
+		wmi_unified_t wmi_handle,
+		struct wlan_roam_rssi_change_params *params)
+{
+	if (wmi_handle->ops->send_roam_scan_offload_rssi_change_cmd)
+		return wmi_handle->ops->send_roam_scan_offload_rssi_change_cmd(
+					wmi_handle, params);
+
+	return QDF_STATUS_E_FAILURE;
+}
+#else
 QDF_STATUS
 wmi_unified_roam_scan_offload_rssi_change_cmd(wmi_unified_t wmi_handle,
 					      uint32_t vdev_id,
@@ -275,6 +287,7 @@ wmi_unified_roam_scan_offload_rssi_change_cmd(wmi_unified_t wmi_handle,
 
 	return QDF_STATUS_E_FAILURE;
 }
+#endif
 
 QDF_STATUS
 wmi_unified_set_per_roam_config(wmi_unified_t wmi_handle,

+ 62 - 0
components/wmi/src/wmi_unified_roam_tlv.c

@@ -2548,6 +2548,67 @@ error:
 	return status;
 }
 
+#ifdef ROAM_OFFLOAD_V1
+/**
+ * send_roam_scan_offload_rssi_change_cmd_tlv() - set roam offload RSSI th
+ * @wmi_handle: wmi handle
+ * @rssi_change_thresh: RSSI Change threshold
+ * @bcn_rssi_weight: beacon RSSI weight
+ * @vdev_id: vdev id
+ *
+ * Send WMI_ROAM_SCAN_RSSI_CHANGE_THRESHOLD parameters to fw.
+ *
+ * Return: CDF status
+ */
+static QDF_STATUS send_roam_scan_offload_rssi_change_cmd_tlv(
+		wmi_unified_t wmi_handle,
+		struct wlan_roam_rssi_change_params *params)
+{
+	wmi_buf_t buf = NULL;
+	QDF_STATUS status;
+	int len;
+	uint8_t *buf_ptr;
+	wmi_roam_scan_rssi_change_threshold_fixed_param *rssi_change_fp;
+
+	/* Send rssi change parameters */
+	len = sizeof(wmi_roam_scan_rssi_change_threshold_fixed_param);
+	buf = wmi_buf_alloc(wmi_handle, len);
+	if (!buf)
+		return QDF_STATUS_E_NOMEM;
+
+	buf_ptr = (uint8_t *)wmi_buf_data(buf);
+	rssi_change_fp =
+		(wmi_roam_scan_rssi_change_threshold_fixed_param *)buf_ptr;
+	WMITLV_SET_HDR(&rssi_change_fp->tlv_header,
+		WMITLV_TAG_STRUC_wmi_roam_scan_rssi_change_threshold_fixed_param,
+		WMITLV_GET_STRUCT_TLVLEN
+		       (wmi_roam_scan_rssi_change_threshold_fixed_param));
+	/* fill in rssi change threshold (hysteresis) values */
+	rssi_change_fp->vdev_id = params->vdev_id;
+	rssi_change_fp->roam_scan_rssi_change_thresh =
+				params->rssi_change_thresh;
+	rssi_change_fp->bcn_rssi_weight = params->bcn_rssi_weight;
+	rssi_change_fp->hirssi_delay_btw_scans = params->hirssi_delay_btw_scans;
+
+	wmi_mtrace(WMI_ROAM_SCAN_RSSI_CHANGE_THRESHOLD,
+		   rssi_change_fp->vdev_id, 0);
+	status = wmi_unified_cmd_send(wmi_handle, buf, len,
+				      WMI_ROAM_SCAN_RSSI_CHANGE_THRESHOLD);
+	if (QDF_IS_STATUS_ERROR(status))
+		goto error;
+
+	wmi_nofl_debug("RSO_PARAM: rssi_change_thresh:%d bcn_rssi_weight:%d hirssi_delay_btw_scans:%d",
+		       rssi_change_fp->roam_scan_rssi_change_thresh,
+		       rssi_change_fp->bcn_rssi_weight,
+		       rssi_change_fp->hirssi_delay_btw_scans);
+
+	return QDF_STATUS_SUCCESS;
+error:
+	wmi_buf_free(buf);
+
+	return status;
+}
+#else
 /**
  * send_roam_scan_offload_rssi_change_cmd_tlv() - set roam offload RSSI th
  * @wmi_handle: wmi handle
@@ -2607,6 +2668,7 @@ error:
 
 	return status;
 }
+#endif
 
 /**
  * send_per_roam_config_cmd_tlv() - set per roaming config to FW

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

@@ -27,6 +27,7 @@
 #define CSR_NEIGHBOR_ROAM_H
 
 #include "sme_api.h"
+#include "wlan_cm_roam_api.h"
 
 #define ROAM_AP_AGE_LIMIT_MS                     10000
 

+ 25 - 0
core/sme/src/csr/csr_neighbor_roam.c

@@ -162,12 +162,14 @@ QDF_STATUS csr_neighbor_roam_update_fast_roaming_enabled(struct mac_context *mac
 	}
 	return qdf_status;
 }
+
 QDF_STATUS csr_neighbor_roam_update_config(struct mac_context *mac_ctx,
 		uint8_t session_id, uint8_t value, uint8_t reason)
 {
 	tpCsrNeighborRoamControlInfo pNeighborRoamInfo =
 	    &mac_ctx->roam.neighborRoamInfo[session_id];
 	tpCsrNeighborRoamCfgParams cfg_params;
+	struct cm_roam_values_copy src_cfg;
 	eCsrNeighborRoamState state;
 	uint8_t old_value;
 
@@ -196,6 +198,10 @@ QDF_STATUS csr_neighbor_roam_update_config(struct mac_context *mac_ctx,
 			old_value = cfg_params->nRoamRescanRssiDiff;
 			cfg_params->nRoamRescanRssiDiff = value;
 			pNeighborRoamInfo->currentRoamRescanRssiDiff = value;
+			src_cfg.uint_value = value;
+			wlan_cm_roam_cfg_set_value(mac_ctx->psoc, session_id,
+						   RSSI_CHANGE_THRESHOLD,
+						   &src_cfg);
 			break;
 		case REASON_ROAM_BMISS_FIRST_BCNT_CHANGED:
 			old_value = cfg_params->nRoamBmissFirstBcnt;
@@ -211,6 +217,10 @@ QDF_STATUS csr_neighbor_roam_update_config(struct mac_context *mac_ctx,
 			old_value = cfg_params->nRoamBeaconRssiWeight;
 			cfg_params->nRoamBeaconRssiWeight = value;
 			pNeighborRoamInfo->currentRoamBeaconRssiWeight = value;
+			src_cfg.uint_value = value;
+			wlan_cm_roam_cfg_set_value(mac_ctx->psoc, session_id,
+						   BEACON_RSSI_WEIGHT,
+						   &src_cfg);
 			break;
 		default:
 			sme_debug("Unknown update cfg reason");
@@ -1021,6 +1031,7 @@ QDF_STATUS csr_neighbor_roam_init(struct mac_context *mac, uint8_t sessionId)
 {
 	QDF_STATUS status;
 	tCsrChannelInfo *specific_chan_info;
+	struct cm_roam_values_copy src_cfg;
 	tpCsrNeighborRoamControlInfo pNeighborRoamInfo =
 		&mac->roam.neighborRoamInfo[sessionId];
 
@@ -1041,12 +1052,21 @@ QDF_STATUS csr_neighbor_roam_init(struct mac_context *mac, uint8_t sessionId)
 		mac->mlme_cfg->lfr.opportunistic_scan_threshold_diff;
 	pNeighborRoamInfo->cfgParams.nRoamRescanRssiDiff =
 		mac->mlme_cfg->lfr.roam_rescan_rssi_diff;
+	src_cfg.uint_value = mac->mlme_cfg->lfr.roam_rescan_rssi_diff;
+	wlan_cm_roam_cfg_set_value(mac->psoc, sessionId,
+				   RSSI_CHANGE_THRESHOLD, &src_cfg);
+
 	pNeighborRoamInfo->cfgParams.nRoamBmissFirstBcnt =
 		mac->mlme_cfg->lfr.roam_bmiss_first_bcnt;
 	pNeighborRoamInfo->cfgParams.nRoamBmissFinalBcnt =
 		mac->mlme_cfg->lfr.roam_bmiss_final_bcnt;
+
 	pNeighborRoamInfo->cfgParams.nRoamBeaconRssiWeight =
 		mac->mlme_cfg->lfr.roam_beacon_rssi_weight;
+	src_cfg.uint_value = mac->mlme_cfg->lfr.roam_beacon_rssi_weight;
+	wlan_cm_roam_cfg_set_value(mac->psoc, sessionId,
+				   BEACON_RSSI_WEIGHT, &src_cfg);
+
 	pNeighborRoamInfo->cfgParams.neighborScanPeriod =
 		mac->mlme_cfg->lfr.neighbor_scan_timer_period;
 	pNeighborRoamInfo->cfgParams.neighbor_scan_min_period =
@@ -1098,8 +1118,13 @@ QDF_STATUS csr_neighbor_roam_init(struct mac_context *mac, uint8_t sessionId)
 		mac->mlme_cfg->lfr.roam_scan_hi_rssi_maxcount;
 	pNeighborRoamInfo->cfgParams.hi_rssi_scan_rssi_delta =
 		mac->mlme_cfg->lfr.roam_scan_hi_rssi_delta;
+
 	pNeighborRoamInfo->cfgParams.hi_rssi_scan_delay =
 		mac->mlme_cfg->lfr.roam_scan_hi_rssi_delay;
+	src_cfg.uint_value = mac->mlme_cfg->lfr.roam_scan_hi_rssi_delay;
+	wlan_cm_roam_cfg_set_value(mac->psoc, sessionId,
+				   HI_RSSI_DELAY_BTW_SCANS, &src_cfg);
+
 	pNeighborRoamInfo->cfgParams.hi_rssi_scan_rssi_ub =
 		mac->mlme_cfg->lfr.roam_scan_hi_rssi_ub;
 	pNeighborRoamInfo->cfgParams.roam_rssi_diff =

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

@@ -411,11 +411,23 @@ QDF_STATUS
 wma_roam_scan_offload_scan_period(tp_wma_handle wma_handle,
 				  struct roam_offload_scan_req *roam_req);
 
+#ifndef ROAM_OFFLOAD_V1
 QDF_STATUS wma_roam_scan_offload_rssi_change(tp_wma_handle wma_handle,
 					     uint32_t vdev_id,
 					     int32_t rssi_change_thresh,
 					     uint32_t bcn_rssi_weight,
 					     uint32_t hirssi_delay_btw_scans);
+#else
+static inline
+QDF_STATUS wma_roam_scan_offload_rssi_change(tp_wma_handle wma_handle,
+					     uint32_t vdev_id,
+					     int32_t rssi_change_thresh,
+					     uint32_t bcn_rssi_weight,
+					     uint32_t hirssi_delay_btw_scans)
+{
+	return QDF_STATUS_E_NOSUPPORT;
+}
+#endif
 
 QDF_STATUS wma_roam_scan_offload_chan_list(tp_wma_handle wma_handle,
 					   uint8_t chan_count,

+ 15 - 14
core/wma/src/wma_scan_roam.c

@@ -740,21 +740,7 @@ wma_roam_scan_offload_scan_period(tp_wma_handle wma_handle,
 	return wmi_unified_roam_scan_offload_scan_period(wma_handle->wmi_handle,
 							 &scan_period_params);
 }
-#else
-QDF_STATUS
-wma_roam_scan_offload_rssi_thresh(tp_wma_handle wma_handle,
-				  struct roam_offload_scan_req *roam_req)
-{
-	return QDF_STATUS_E_NOSUPPORT;
-}
 
-QDF_STATUS
-wma_roam_scan_offload_scan_period(tp_wma_handle wma_handle,
-				  struct roam_offload_scan_req *roam_req)
-{
-	return QDF_STATUS_E_NOSUPPORT;
-}
-#endif
 /**
  * wma_roam_scan_offload_rssi_change() - set roam offload RSSI change threshold
  * @wma_handle: wma handle
@@ -782,6 +768,21 @@ QDF_STATUS wma_roam_scan_offload_rssi_change(tp_wma_handle wma_handle,
 				vdev_id, rssi_change_thresh,
 				bcn_rssi_weight, hirssi_delay_btw_scans);
 }
+#else
+QDF_STATUS
+wma_roam_scan_offload_rssi_thresh(tp_wma_handle wma_handle,
+				  struct roam_offload_scan_req *roam_req)
+{
+	return QDF_STATUS_E_NOSUPPORT;
+}
+
+QDF_STATUS
+wma_roam_scan_offload_scan_period(tp_wma_handle wma_handle,
+				  struct roam_offload_scan_req *roam_req)
+{
+	return QDF_STATUS_E_NOSUPPORT;
+}
+#endif
 
 /**
  * wma_roam_scan_offload_chan_list() - set roam offload channel list