Ver Fonte

qcacld-3.0: Send roam score delta and min rssi params

When "wmi_service_configure_roam_trigger_param_support" service
bit is set populate roam score delta and min rssi parameters
and send via WMI_ROAM_ENABLE_DISABLE_TRIGGER_REASON_CMDID.

Change-Id: I3c7fc56a95c28c43992763be3351d91d9fd44041
CRs-Fixed: 2890148
Amruta Kulkarni há 4 anos atrás
pai
commit
604d76d660

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

@@ -146,6 +146,8 @@ cm_roam_triggers(struct wlan_objmgr_psoc *psoc, uint8_t vdev_id,
 		wlan_cm_get_roam_scan_scheme_bitmap(psoc, vdev_id);
 	wlan_cm_roam_get_vendor_btm_params(psoc, vdev_id,
 					   &params->vendor_btm_param);
+	wlan_cm_roam_get_score_delta_params(psoc, params);
+	wlan_cm_roam_get_min_rssi_params(psoc, params);
 }
 
 /**

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

@@ -783,6 +783,28 @@ wlan_cm_roam_get_vendor_btm_params(struct wlan_objmgr_psoc *psoc,
 				   struct wlan_cm_roam_vendor_btm_params
 								*param);
 
+/**
+ * wlan_cm_roam_get_score_delta_params() - API to get roam score delta param
+ * @psoc: PSOC pointer
+ * @params: roam trigger param
+ *
+ * Return: none
+ */
+void
+wlan_cm_roam_get_score_delta_params(struct wlan_objmgr_psoc *psoc,
+				    struct wlan_roam_triggers *params);
+
+/**
+ * wlan_cm_roam_get_min_rssi_params() - API to get roam trigger min rssi param
+ * @psoc: PSOC pointer
+ * @params: roam trigger param
+ *
+ * Return: none
+ */
+void
+wlan_cm_roam_get_min_rssi_params(struct wlan_objmgr_psoc *psoc,
+				 struct wlan_roam_triggers *params);
+
 /**
  * wlan_cm_update_roam_scan_scheme_bitmap() - Set roam scan scheme bitmap for
  * each vdev
@@ -905,6 +927,17 @@ wlan_cm_roam_get_vendor_btm_params(struct wlan_objmgr_psoc *psoc,
 				   struct wlan_cm_roam_vendor_btm_params *param)
 {}
 
+static inline void
+wlan_cm_roam_get_score_delta_params(struct wlan_objmgr_psoc *psoc,
+				    uint8_t vdev_id,
+				    struct roam_trigger_score_delta *param)
+{}
+
+static inline void
+wlan_cm_roam_get_min_rssi_params(struct wlan_objmgr_psoc *psoc,
+				 struct wlan_roam_triggers *params)
+{}
+
 static inline QDF_STATUS
 wlan_cm_update_roam_scan_scheme_bitmap(struct wlan_objmgr_psoc *psoc,
 				       uint8_t vdev_id,

+ 37 - 33
components/umac/mlme/connection_mgr/dispatcher/inc/wlan_cm_roam_public_struct.h

@@ -146,6 +146,19 @@
  */
 #define NEIGHBOR_REPORT_PARAM_INVALID (0xFFFFFFFFU)
 
+/*
+ * Currently roam score delta value is sent for 2 triggers and min rssi
+ * values are sent for 3 triggers
+ */
+#define NUM_OF_ROAM_TRIGGERS 2
+#define IDLE_ROAM_TRIGGER 0
+#define BTM_ROAM_TRIGGER  1
+
+#define NUM_OF_ROAM_MIN_RSSI 3
+#define DEAUTH_MIN_RSSI 0
+#define BMISS_MIN_RSSI  1
+#define MIN_RSSI_2G_TO_5G_ROAM 2
+
 /**
  * struct cm_roam_neighbor_report_offload_params - neighbor report offload
  *                                                 parameters
@@ -502,26 +515,6 @@ struct wlan_cm_roam_vendor_btm_params {
 	uint32_t user_roam_reason;
 };
 
-/**
- * struct wlan_roam_triggers - vendor configured roam triggers
- * @vdev_id: vdev id
- * @trigger_bitmap: vendor configured roam trigger bitmap as
- *		    defined @enum roam_control_trigger_reason
- * @roam_score_delta: Value of roam score delta
- * percentage to trigger roam
- * @roam_scan_scheme_bitmap: Bitmap of roam triggers as defined in
- * enum roam_trigger_reason, for which the roam scan scheme should
- * be partial scan
- * @control_param: roam trigger param
- */
-struct wlan_roam_triggers {
-	uint32_t vdev_id;
-	uint32_t trigger_bitmap;
-	uint32_t roam_score_delta;
-	uint32_t roam_scan_scheme_bitmap;
-	struct wlan_cm_roam_vendor_btm_params vendor_btm_param;
-};
-
 /**
  * struct ap_profile - Structure ap profile to match candidate
  * @flags: flags
@@ -626,19 +619,6 @@ struct scoring_param {
 	struct per_slot_score oce_wan_scoring;
 };
 
-/*
- * Currently roam score delta value is sent for 2 triggers and min rssi
- * values are sent for 3 triggers
- */
-#define NUM_OF_ROAM_TRIGGERS 2
-#define IDLE_ROAM_TRIGGER 0
-#define BTM_ROAM_TRIGGER  1
-
-#define NUM_OF_ROAM_MIN_RSSI 3
-#define DEAUTH_MIN_RSSI 0
-#define BMISS_MIN_RSSI  1
-#define MIN_RSSI_2G_TO_5G_ROAM 2
-
 /**
  * enum roam_trigger_reason - Reason for triggering roam
  * ROAM_TRIGGER_REASON_NONE: Roam trigger reason none
@@ -718,6 +698,30 @@ struct roam_trigger_score_delta {
 	enum roam_trigger_reason trigger_reason;
 };
 
+/**
+ * struct wlan_roam_triggers - vendor configured roam triggers
+ * @vdev_id: vdev id
+ * @trigger_bitmap: vendor configured roam trigger bitmap as
+ *		    defined @enum roam_control_trigger_reason
+ * @roam_score_delta: Value of roam score delta
+ * percentage to trigger roam
+ * @roam_scan_scheme_bitmap: Bitmap of roam triggers as defined in
+ * enum roam_trigger_reason, for which the roam scan scheme should
+ * be partial scan
+ * @control_param: roam trigger param
+ * @min_rssi_params: Min RSSI values for different roam triggers
+ * @score_delta_params: Roam score delta values for different triggers
+ */
+struct wlan_roam_triggers {
+	uint32_t vdev_id;
+	uint32_t trigger_bitmap;
+	uint32_t roam_score_delta;
+	uint32_t roam_scan_scheme_bitmap;
+	struct wlan_cm_roam_vendor_btm_params vendor_btm_param;
+	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];
+};
+
 /**
  * struct ap_profile_params - ap profile params
  * @vdev_id: vdev id

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

@@ -626,6 +626,39 @@ void wlan_cm_get_psk_pmk(struct wlan_objmgr_pdev *pdev,
 	wlan_objmgr_vdev_release_ref(vdev, WLAN_MLME_CM_ID);
 }
 
+void
+wlan_cm_roam_get_score_delta_params(struct wlan_objmgr_psoc *psoc,
+				    struct wlan_roam_triggers *params)
+{
+	struct wlan_mlme_psoc_ext_obj *mlme_obj;
+
+	mlme_obj = mlme_get_psoc_ext_obj(psoc);
+	if (!mlme_obj)
+		return;
+
+	params->score_delta_param[IDLE_ROAM_TRIGGER] =
+			mlme_obj->cfg.trig_score_delta[IDLE_ROAM_TRIGGER];
+	params->score_delta_param[BTM_ROAM_TRIGGER] =
+			mlme_obj->cfg.trig_score_delta[BTM_ROAM_TRIGGER];
+}
+
+void
+wlan_cm_roam_get_min_rssi_params(struct wlan_objmgr_psoc *psoc,
+				 struct wlan_roam_triggers *params)
+{
+	struct wlan_mlme_psoc_ext_obj *mlme_obj;
+
+	mlme_obj = mlme_get_psoc_ext_obj(psoc);
+	if (!mlme_obj)
+		return;
+
+	params->min_rssi_params[DEAUTH_MIN_RSSI] =
+			mlme_obj->cfg.trig_min_rssi[DEAUTH_MIN_RSSI];
+	params->min_rssi_params[BMISS_MIN_RSSI] =
+			mlme_obj->cfg.trig_min_rssi[BMISS_MIN_RSSI];
+	params->min_rssi_params[MIN_RSSI_2G_TO_5G_ROAM] =
+			mlme_obj->cfg.trig_min_rssi[MIN_RSSI_2G_TO_5G_ROAM];
+}
 #endif
 
 QDF_STATUS wlan_cm_roam_cfg_get_value(struct wlan_objmgr_psoc *psoc,

+ 214 - 126
components/wmi/src/wmi_unified_roam_tlv.c

@@ -767,6 +767,63 @@ void wmi_ese_attach_tlv(wmi_unified_t wmi_handle)
 }
 #endif /* FEATURE_WLAN_ESE */
 
+/**
+ * convert_roam_trigger_reason() - Function to convert unified Roam trigger
+ * enum to TLV specific WMI_ROAM_TRIGGER_REASON_ID
+ * @reason: Roam trigger reason
+ *
+ * Return: WMI roam trigger reason
+ */
+static uint32_t
+convert_roam_trigger_reason(enum roam_trigger_reason trigger_reason)
+{
+	switch (trigger_reason) {
+	case ROAM_TRIGGER_REASON_NONE:
+		return WMI_ROAM_TRIGGER_REASON_NONE;
+	case ROAM_TRIGGER_REASON_PER:
+		return WMI_ROAM_TRIGGER_REASON_PER;
+	case ROAM_TRIGGER_REASON_BMISS:
+		return WMI_ROAM_TRIGGER_REASON_BMISS;
+	case ROAM_TRIGGER_REASON_LOW_RSSI:
+		return WMI_ROAM_TRIGGER_REASON_LOW_RSSI;
+	case ROAM_TRIGGER_REASON_HIGH_RSSI:
+		return WMI_ROAM_TRIGGER_REASON_HIGH_RSSI;
+	case ROAM_TRIGGER_REASON_PERIODIC:
+		return WMI_ROAM_TRIGGER_REASON_PERIODIC;
+	case ROAM_TRIGGER_REASON_MAWC:
+		return WMI_ROAM_TRIGGER_REASON_MAWC;
+	case ROAM_TRIGGER_REASON_DENSE:
+		return WMI_ROAM_TRIGGER_REASON_DENSE;
+	case ROAM_TRIGGER_REASON_BACKGROUND:
+		return WMI_ROAM_TRIGGER_REASON_BACKGROUND;
+	case ROAM_TRIGGER_REASON_FORCED:
+		return WMI_ROAM_TRIGGER_REASON_FORCED;
+	case ROAM_TRIGGER_REASON_BTM:
+		return WMI_ROAM_TRIGGER_REASON_BTM;
+	case ROAM_TRIGGER_REASON_UNIT_TEST:
+		return WMI_ROAM_TRIGGER_REASON_UNIT_TEST;
+	case ROAM_TRIGGER_REASON_BSS_LOAD:
+		return WMI_ROAM_TRIGGER_REASON_BSS_LOAD;
+	case ROAM_TRIGGER_REASON_DEAUTH:
+		return WMI_ROAM_TRIGGER_REASON_DEAUTH;
+	case ROAM_TRIGGER_REASON_IDLE:
+		return WMI_ROAM_TRIGGER_REASON_IDLE;
+	case ROAM_TRIGGER_REASON_STA_KICKOUT:
+		return WMI_ROAM_TRIGGER_REASON_STA_KICKOUT;
+	case ROAM_TRIGGER_REASON_ESS_RSSI:
+		return WMI_ROAM_TRIGGER_REASON_ESS_RSSI;
+	case ROAM_TRIGGER_REASON_WTC_BTM:
+		return WMI_ROAM_TRIGGER_REASON_WTC_BTM;
+	case ROAM_TRIGGER_REASON_PMK_TIMEOUT:
+		return WMI_ROAM_TRIGGER_REASON_PMK_TIMEOUT;
+	case ROAM_TRIGGER_REASON_MAX:
+		return WMI_ROAM_TRIGGER_REASON_MAX;
+	default:
+		return WMI_ROAM_TRIGGER_REASON_NONE;
+	}
+}
+
+
 #ifdef WLAN_FEATURE_ROAM_OFFLOAD
 /* send_set_ric_req_cmd_tlv() - set ric request element
  * @wmi_handle: wmi handle
@@ -1163,6 +1220,53 @@ static void wmi_fill_default_roam_trigger_parameters(
 	roam_trigger_params->reason_code = ROAM_MAX_CFG_VALUE;
 }
 
+static void wmi_fill_score_delta_params(
+		wmi_configure_roam_trigger_parameters *roam_trigger_params,
+		struct wlan_roam_triggers *triggers,
+		uint8_t trig_index)
+{
+	enum roam_trigger_reason trig_reason;
+
+	if (trig_index >= NUM_OF_ROAM_TRIGGERS)
+		return;
+
+	trig_reason =
+		triggers->score_delta_param[trig_index].trigger_reason;
+	wmi_fill_default_roam_trigger_parameters(
+		roam_trigger_params,
+		convert_roam_trigger_reason(trig_reason));
+	roam_trigger_params->roam_score_delta_percentage =
+		triggers->score_delta_param[trig_index].roam_score_delta;
+
+	wmi_debug("RSO_CFG: Score delta per: %d converted trig_reason: %d",
+		  roam_trigger_params->roam_score_delta_percentage,
+		  convert_roam_trigger_reason(trig_reason));
+
+}
+
+static void wmi_fill_min_rssi_params(
+		wmi_configure_roam_trigger_parameters *roam_trigger_params,
+		struct wlan_roam_triggers *triggers,
+		uint8_t trig_index)
+{
+	enum roam_trigger_reason trig_reason;
+
+	if (trig_index >= NUM_OF_ROAM_MIN_RSSI)
+		return;
+
+	trig_reason =
+		triggers->min_rssi_params[trig_index].trigger_reason;
+	wmi_fill_default_roam_trigger_parameters(
+		roam_trigger_params,
+		convert_roam_trigger_reason(trig_reason));
+	roam_trigger_params->cand_ap_min_rssi_threshold =
+		triggers->min_rssi_params[trig_index].min_rssi;
+
+	wmi_debug("RSO_CFG: Min rssi thresh: %d converted trig_reason: %d",
+		  roam_trigger_params->cand_ap_min_rssi_threshold,
+		  convert_roam_trigger_reason(trig_reason));
+}
+
 /**
  * send_set_roam_trigger_cmd_tlv() - send set roam triggers to fw
  * @wmi_handle: wmi handle
@@ -1185,7 +1289,7 @@ static QDF_STATUS send_set_roam_trigger_cmd_tlv(wmi_unified_t wmi_handle,
 					*roam_trigger_parameters;
 	uint32_t num_triggers_enabled = 0;
 	uint32_t roam_scan_scheme_bitmap = triggers->roam_scan_scheme_bitmap;
-	uint32_t total_tlv_len;
+	uint32_t total_tlv_len = 0;
 
 	if (BIT(ROAM_TRIGGER_REASON_PER) & roam_scan_scheme_bitmap)
 		num_triggers_enabled++;
@@ -1202,7 +1306,12 @@ static QDF_STATUS send_set_roam_trigger_cmd_tlv(wmi_unified_t wmi_handle,
 	if (BIT(ROAM_TRIGGER_REASON_BSS_LOAD) & roam_scan_scheme_bitmap)
 		num_triggers_enabled++;
 
-	total_tlv_len = 2 * sizeof(wmi_configure_roam_trigger_parameters) +
+	if (wmi_service_enabled(wmi_handle,
+			wmi_service_configure_roam_trigger_param_support))
+		total_tlv_len += (NUM_OF_ROAM_TRIGGERS + NUM_OF_ROAM_MIN_RSSI) *
+			sizeof(wmi_configure_roam_trigger_parameters);
+
+	total_tlv_len += 2 * sizeof(wmi_configure_roam_trigger_parameters) +
 			num_triggers_enabled *
 			sizeof(wmi_configure_roam_trigger_parameters);
 	len += WMI_TLV_HDR_SIZE + total_tlv_len;
@@ -1259,6 +1368,34 @@ static QDF_STATUS send_set_roam_trigger_cmd_tlv(wmi_unified_t wmi_handle,
 
 	roam_trigger_parameters++;
 
+	if (wmi_service_enabled(wmi_handle,
+			wmi_service_configure_roam_trigger_param_support)) {
+		wmi_fill_score_delta_params(roam_trigger_parameters,
+					    triggers,
+					    IDLE_ROAM_TRIGGER);
+		roam_trigger_parameters++;
+
+		wmi_fill_score_delta_params(roam_trigger_parameters,
+					    triggers,
+					    BTM_ROAM_TRIGGER);
+		roam_trigger_parameters++;
+
+		wmi_fill_min_rssi_params(roam_trigger_parameters,
+					 triggers,
+					 DEAUTH_MIN_RSSI);
+		roam_trigger_parameters++;
+
+		wmi_fill_min_rssi_params(roam_trigger_parameters,
+					 triggers,
+					 BMISS_MIN_RSSI);
+		roam_trigger_parameters++;
+
+		wmi_fill_min_rssi_params(roam_trigger_parameters,
+					 triggers,
+					 MIN_RSSI_2G_TO_5G_ROAM);
+		roam_trigger_parameters++;
+	}
+
 	wmi_fill_default_roam_trigger_parameters(
 				roam_trigger_parameters,
 				WMI_ROAM_TRIGGER_REASON_PMK_TIMEOUT);
@@ -2292,62 +2429,6 @@ send_roam_scan_mode_cmd:
 	return status;
 }
 
-/**
- * convert_roam_trigger_reason() - Function to convert unified Roam trigger
- * enum to TLV specific WMI_ROAM_TRIGGER_REASON_ID
- * @reason: Roam trigger reason
- *
- * Return: WMI roam trigger reason
- */
-static uint32_t
-convert_roam_trigger_reason(enum roam_trigger_reason trigger_reason)
-{
-	switch (trigger_reason) {
-	case ROAM_TRIGGER_REASON_NONE:
-		return WMI_ROAM_TRIGGER_REASON_NONE;
-	case ROAM_TRIGGER_REASON_PER:
-		return WMI_ROAM_TRIGGER_REASON_PER;
-	case ROAM_TRIGGER_REASON_BMISS:
-		return WMI_ROAM_TRIGGER_REASON_BMISS;
-	case ROAM_TRIGGER_REASON_LOW_RSSI:
-		return WMI_ROAM_TRIGGER_REASON_LOW_RSSI;
-	case ROAM_TRIGGER_REASON_HIGH_RSSI:
-		return WMI_ROAM_TRIGGER_REASON_HIGH_RSSI;
-	case ROAM_TRIGGER_REASON_PERIODIC:
-		return WMI_ROAM_TRIGGER_REASON_PERIODIC;
-	case ROAM_TRIGGER_REASON_MAWC:
-		return WMI_ROAM_TRIGGER_REASON_MAWC;
-	case ROAM_TRIGGER_REASON_DENSE:
-		return WMI_ROAM_TRIGGER_REASON_DENSE;
-	case ROAM_TRIGGER_REASON_BACKGROUND:
-		return WMI_ROAM_TRIGGER_REASON_BACKGROUND;
-	case ROAM_TRIGGER_REASON_FORCED:
-		return WMI_ROAM_TRIGGER_REASON_FORCED;
-	case ROAM_TRIGGER_REASON_BTM:
-		return WMI_ROAM_TRIGGER_REASON_BTM;
-	case ROAM_TRIGGER_REASON_UNIT_TEST:
-		return WMI_ROAM_TRIGGER_REASON_UNIT_TEST;
-	case ROAM_TRIGGER_REASON_BSS_LOAD:
-		return WMI_ROAM_TRIGGER_REASON_BSS_LOAD;
-	case ROAM_TRIGGER_REASON_DEAUTH:
-		return WMI_ROAM_TRIGGER_REASON_DEAUTH;
-	case ROAM_TRIGGER_REASON_IDLE:
-		return WMI_ROAM_TRIGGER_REASON_IDLE;
-	case ROAM_TRIGGER_REASON_STA_KICKOUT:
-		return WMI_ROAM_TRIGGER_REASON_STA_KICKOUT;
-	case ROAM_TRIGGER_REASON_ESS_RSSI:
-		return WMI_ROAM_TRIGGER_REASON_ESS_RSSI;
-	case ROAM_TRIGGER_REASON_WTC_BTM:
-		return WMI_ROAM_TRIGGER_REASON_WTC_BTM;
-	case ROAM_TRIGGER_REASON_PMK_TIMEOUT:
-		return WMI_ROAM_TRIGGER_REASON_PMK_TIMEOUT;
-	case ROAM_TRIGGER_REASON_MAX:
-		return WMI_ROAM_TRIGGER_REASON_MAX;
-	default:
-		return WMI_ROAM_TRIGGER_REASON_NONE;
-	}
-}
-
 /**
  * send_roam_scan_offload_ap_profile_cmd_tlv() - set roam ap profile in fw
  * @wmi_handle: wmi handle
@@ -2374,10 +2455,14 @@ send_roam_scan_offload_ap_profile_cmd_tlv(wmi_unified_t wmi_handle,
 
 	len = sizeof(wmi_roam_ap_profile_fixed_param) + sizeof(wmi_ap_profile);
 	len += sizeof(*score_param);
-	len += WMI_TLV_HDR_SIZE;
-	len += NUM_OF_ROAM_TRIGGERS * sizeof(*score_delta_param);
-	len += WMI_TLV_HDR_SIZE;
-	len += NUM_OF_ROAM_MIN_RSSI * sizeof(*min_rssi_param);
+
+	if (!wmi_service_enabled(wmi_handle,
+			wmi_service_configure_roam_trigger_param_support)) {
+		len += WMI_TLV_HDR_SIZE;
+		len += NUM_OF_ROAM_TRIGGERS * sizeof(*score_delta_param);
+		len += WMI_TLV_HDR_SIZE;
+		len += NUM_OF_ROAM_MIN_RSSI * sizeof(*min_rssi_param);
+	}
 	buf = wmi_buf_alloc(wmi_handle, len);
 	if (!buf)
 		return QDF_STATUS_E_NOMEM;
@@ -2552,73 +2637,76 @@ send_roam_scan_offload_ap_profile_cmd_tlv(wmi_unified_t wmi_handle,
 		 score_param->candidate_min_roam_score_delta);
 
 	buf_ptr += sizeof(*score_param);
-	WMITLV_SET_HDR(buf_ptr, WMITLV_TAG_ARRAY_STRUC,
-		       (NUM_OF_ROAM_TRIGGERS * sizeof(*score_delta_param)));
-	buf_ptr += WMI_TLV_HDR_SIZE;
-
-	score_delta_param = (wmi_roam_score_delta_param *)buf_ptr;
-	WMITLV_SET_HDR(&score_delta_param->tlv_header,
-		       WMITLV_TAG_STRUC_wmi_roam_score_delta_param,
-		       WMITLV_GET_STRUCT_TLVLEN(wmi_roam_score_delta_param));
-	trig_reason =
-		ap_profile->score_delta_param[IDLE_ROAM_TRIGGER].trigger_reason;
-	score_delta_param->roam_trigger_reason =
-		convert_roam_trigger_reason(trig_reason);
-	score_delta_param->roam_score_delta =
-		ap_profile->score_delta_param[IDLE_ROAM_TRIGGER].roam_score_delta;
-
-	buf_ptr += sizeof(*score_delta_param);
-	score_delta_param = (wmi_roam_score_delta_param *)buf_ptr;
-	WMITLV_SET_HDR(&score_delta_param->tlv_header,
-		       WMITLV_TAG_STRUC_wmi_roam_score_delta_param,
-		       WMITLV_GET_STRUCT_TLVLEN(wmi_roam_score_delta_param));
-	trig_reason =
-		ap_profile->score_delta_param[BTM_ROAM_TRIGGER].trigger_reason;
-	score_delta_param->roam_trigger_reason =
-		convert_roam_trigger_reason(trig_reason);
-	score_delta_param->roam_score_delta =
-		ap_profile->score_delta_param[BTM_ROAM_TRIGGER].roam_score_delta;
 
-	buf_ptr += sizeof(*score_delta_param);
-	WMITLV_SET_HDR(buf_ptr, WMITLV_TAG_ARRAY_STRUC,
-		       (NUM_OF_ROAM_MIN_RSSI * sizeof(*min_rssi_param)));
-	buf_ptr += WMI_TLV_HDR_SIZE;
+	if (!wmi_service_enabled(wmi_handle,
+			wmi_service_configure_roam_trigger_param_support)) {
+		WMITLV_SET_HDR(buf_ptr, WMITLV_TAG_ARRAY_STRUC,
+			       (NUM_OF_ROAM_TRIGGERS * sizeof(*score_delta_param)));
+		buf_ptr += WMI_TLV_HDR_SIZE;
 
-	min_rssi_param = (wmi_roam_cnd_min_rssi_param *)buf_ptr;
-	WMITLV_SET_HDR(&min_rssi_param->tlv_header,
-		       WMITLV_TAG_STRUC_wmi_roam_cnd_min_rssi_param,
-		       WMITLV_GET_STRUCT_TLVLEN(wmi_roam_cnd_min_rssi_param));
-	trig_reason =
-		ap_profile->min_rssi_params[DEAUTH_MIN_RSSI].trigger_reason;
-	min_rssi_param->roam_trigger_reason =
-		convert_roam_trigger_reason(trig_reason);
-	min_rssi_param->candidate_min_rssi =
-		ap_profile->min_rssi_params[DEAUTH_MIN_RSSI].min_rssi;
-
-	buf_ptr += sizeof(*min_rssi_param);
-	min_rssi_param = (wmi_roam_cnd_min_rssi_param *)buf_ptr;
-	WMITLV_SET_HDR(&min_rssi_param->tlv_header,
-		       WMITLV_TAG_STRUC_wmi_roam_cnd_min_rssi_param,
-		       WMITLV_GET_STRUCT_TLVLEN(wmi_roam_cnd_min_rssi_param));
-	trig_reason =
-		ap_profile->min_rssi_params[BMISS_MIN_RSSI].trigger_reason;
-	min_rssi_param->roam_trigger_reason =
-		convert_roam_trigger_reason(trig_reason);
-	min_rssi_param->candidate_min_rssi =
-		ap_profile->min_rssi_params[BMISS_MIN_RSSI].min_rssi;
-
-	buf_ptr += sizeof(*min_rssi_param);
-	min_rssi_param = (wmi_roam_cnd_min_rssi_param *)buf_ptr;
-	WMITLV_SET_HDR(&min_rssi_param->tlv_header,
-		       WMITLV_TAG_STRUC_wmi_roam_cnd_min_rssi_param,
-		       WMITLV_GET_STRUCT_TLVLEN(wmi_roam_cnd_min_rssi_param));
-	trig_reason =
-	     ap_profile->min_rssi_params[MIN_RSSI_2G_TO_5G_ROAM].trigger_reason;
-	min_rssi_param->roam_trigger_reason =
-		convert_roam_trigger_reason(trig_reason);
-	min_rssi_param->candidate_min_rssi =
-		ap_profile->min_rssi_params[MIN_RSSI_2G_TO_5G_ROAM].min_rssi;
+		score_delta_param = (wmi_roam_score_delta_param *)buf_ptr;
+		WMITLV_SET_HDR(&score_delta_param->tlv_header,
+			       WMITLV_TAG_STRUC_wmi_roam_score_delta_param,
+			       WMITLV_GET_STRUCT_TLVLEN(wmi_roam_score_delta_param));
+		trig_reason =
+			ap_profile->score_delta_param[IDLE_ROAM_TRIGGER].trigger_reason;
+		score_delta_param->roam_trigger_reason =
+			convert_roam_trigger_reason(trig_reason);
+		score_delta_param->roam_score_delta =
+			ap_profile->score_delta_param[IDLE_ROAM_TRIGGER].roam_score_delta;
+
+		buf_ptr += sizeof(*score_delta_param);
+		score_delta_param = (wmi_roam_score_delta_param *)buf_ptr;
+		WMITLV_SET_HDR(&score_delta_param->tlv_header,
+			       WMITLV_TAG_STRUC_wmi_roam_score_delta_param,
+			       WMITLV_GET_STRUCT_TLVLEN(wmi_roam_score_delta_param));
+		trig_reason =
+			ap_profile->score_delta_param[BTM_ROAM_TRIGGER].trigger_reason;
+		score_delta_param->roam_trigger_reason =
+			convert_roam_trigger_reason(trig_reason);
+		score_delta_param->roam_score_delta =
+			ap_profile->score_delta_param[BTM_ROAM_TRIGGER].roam_score_delta;
+
+		buf_ptr += sizeof(*score_delta_param);
+		WMITLV_SET_HDR(buf_ptr, WMITLV_TAG_ARRAY_STRUC,
+			       (NUM_OF_ROAM_MIN_RSSI * sizeof(*min_rssi_param)));
+		buf_ptr += WMI_TLV_HDR_SIZE;
 
+		min_rssi_param = (wmi_roam_cnd_min_rssi_param *)buf_ptr;
+		WMITLV_SET_HDR(&min_rssi_param->tlv_header,
+			       WMITLV_TAG_STRUC_wmi_roam_cnd_min_rssi_param,
+			       WMITLV_GET_STRUCT_TLVLEN(wmi_roam_cnd_min_rssi_param));
+		trig_reason =
+			ap_profile->min_rssi_params[DEAUTH_MIN_RSSI].trigger_reason;
+		min_rssi_param->roam_trigger_reason =
+			convert_roam_trigger_reason(trig_reason);
+		min_rssi_param->candidate_min_rssi =
+			ap_profile->min_rssi_params[DEAUTH_MIN_RSSI].min_rssi;
+
+		buf_ptr += sizeof(*min_rssi_param);
+		min_rssi_param = (wmi_roam_cnd_min_rssi_param *)buf_ptr;
+		WMITLV_SET_HDR(&min_rssi_param->tlv_header,
+			       WMITLV_TAG_STRUC_wmi_roam_cnd_min_rssi_param,
+			       WMITLV_GET_STRUCT_TLVLEN(wmi_roam_cnd_min_rssi_param));
+		trig_reason =
+			ap_profile->min_rssi_params[BMISS_MIN_RSSI].trigger_reason;
+		min_rssi_param->roam_trigger_reason =
+			convert_roam_trigger_reason(trig_reason);
+		min_rssi_param->candidate_min_rssi =
+			ap_profile->min_rssi_params[BMISS_MIN_RSSI].min_rssi;
+
+		buf_ptr += sizeof(*min_rssi_param);
+		min_rssi_param = (wmi_roam_cnd_min_rssi_param *)buf_ptr;
+		WMITLV_SET_HDR(&min_rssi_param->tlv_header,
+			       WMITLV_TAG_STRUC_wmi_roam_cnd_min_rssi_param,
+			       WMITLV_GET_STRUCT_TLVLEN(wmi_roam_cnd_min_rssi_param));
+		trig_reason =
+		     ap_profile->min_rssi_params[MIN_RSSI_2G_TO_5G_ROAM].trigger_reason;
+		min_rssi_param->roam_trigger_reason =
+			convert_roam_trigger_reason(trig_reason);
+		min_rssi_param->candidate_min_rssi =
+			ap_profile->min_rssi_params[MIN_RSSI_2G_TO_5G_ROAM].min_rssi;
+	}
 	wmi_mtrace(WMI_ROAM_AP_PROFILE, NO_SESSION, 0);
 	status = wmi_unified_cmd_send(wmi_handle, buf,
 				      len, WMI_ROAM_AP_PROFILE);