Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 31d34e09 authored by Pragaspathi Thilagaraj's avatar Pragaspathi Thilagaraj Committed by nshrivas
Browse files

qcacmn: wmi changes to send bss load trigger config to firmware

Populate the load bss trigger configuration values based on the
ini values and send them to firmware.

Add wmi changes to send bss load trigger config to firmware.

Change-Id: Ib2e21904bc7b8d87e5f51824d2694b90a3ac53f2
CRs-Fixed: 2367773
parent 2d00654a
Loading
Loading
Loading
Loading
+10 −0
Original line number Original line Diff line number Diff line
@@ -2215,6 +2215,16 @@ QDF_STATUS wmi_extract_ndp_sch_update(wmi_unified_t wmi_handle, uint8_t *data,
QDF_STATUS wmi_unified_send_btm_config(void *wmi_hdl,
QDF_STATUS wmi_unified_send_btm_config(void *wmi_hdl,
				       struct wmi_btm_config *params);
				       struct wmi_btm_config *params);


/**
 * wmi_unified_send_btm_config() - Send BTM config to fw
 * @wmi_hdl:  wmi handle
 * @params: pointer to wmi_btm_config
 *
 * Return: QDF_STATUS
 */
QDF_STATUS wmi_unified_send_bss_load_config(void *wmi_hdl,
					    struct wmi_bss_load_config *params);

/**
/**
 * wmi_unified_send_obss_detection_cfg_cmd() - WMI function to send obss
 * wmi_unified_send_obss_detection_cfg_cmd() - WMI function to send obss
 *  detection configuration to FW.
 *  detection configuration to FW.
+11 −0
Original line number Original line Diff line number Diff line
@@ -8122,6 +8122,17 @@ struct wmi_btm_config {
	uint32_t disassoc_timer_threshold;
	uint32_t disassoc_timer_threshold;
};
};


/**
 * struct wmi_bss_load_config - BSS load trigger parameters
 * @vdev_id: VDEV on which the parameters should be applied
 * @bss_load_threshold: BSS load threshold after which roam scan should trigger
 */
struct wmi_bss_load_config {
	uint32_t vdev_id;
	uint32_t bss_load_threshold;
	uint32_t bss_load_sample_time;
};

/**
/**
 * struct set_arp_stats - set/reset arp stats
 * struct set_arp_stats - set/reset arp stats
 * @vdev_id: session id
 * @vdev_id: session id
+4 −0
Original line number Original line Diff line number Diff line
@@ -1609,6 +1609,10 @@ QDF_STATUS (*extract_ndp_sch_update)(wmi_unified_t wmi_handle,


QDF_STATUS (*send_btm_config)(wmi_unified_t wmi_handle,
QDF_STATUS (*send_btm_config)(wmi_unified_t wmi_handle,
			      struct wmi_btm_config *params);
			      struct wmi_btm_config *params);

QDF_STATUS (*send_roam_bss_load_config)(wmi_unified_t wmi_handle,
					struct wmi_bss_load_config *params);

QDF_STATUS (*send_obss_detection_cfg_cmd)(wmi_unified_t wmi_handle,
QDF_STATUS (*send_obss_detection_cfg_cmd)(wmi_unified_t wmi_handle,
		struct wmi_obss_detection_cfg_param *obss_cfg_param);
		struct wmi_obss_detection_cfg_param *obss_cfg_param);
QDF_STATUS (*extract_obss_detection_info)(uint8_t *evt_buf,
QDF_STATUS (*extract_obss_detection_info)(uint8_t *evt_buf,
+12 −0
Original line number Original line Diff line number Diff line
@@ -7327,6 +7327,18 @@ QDF_STATUS wmi_unified_send_btm_config(void *wmi_hdl,
	return QDF_STATUS_E_FAILURE;
	return QDF_STATUS_E_FAILURE;
}
}


QDF_STATUS wmi_unified_send_bss_load_config(void *wmi_hdl,
					    struct wmi_bss_load_config *params)
{
	wmi_unified_t wmi_handle = (wmi_unified_t)wmi_hdl;

	if (wmi_handle->ops->send_roam_bss_load_config)
		return wmi_handle->ops->send_roam_bss_load_config(wmi_handle,
								  params);

	return QDF_STATUS_E_FAILURE;
}

QDF_STATUS wmi_unified_send_obss_detection_cfg_cmd(void *wmi_hdl,
QDF_STATUS wmi_unified_send_obss_detection_cfg_cmd(void *wmi_hdl,
		struct wmi_obss_detection_cfg_param *obss_cfg_param)
		struct wmi_obss_detection_cfg_param *obss_cfg_param)
{
{
+46 −0
Original line number Original line Diff line number Diff line
@@ -21861,6 +21861,51 @@ static QDF_STATUS send_btm_config_cmd_tlv(wmi_unified_t wmi_handle,
	return QDF_STATUS_SUCCESS;
	return QDF_STATUS_SUCCESS;
}
}
/**
 * send_roam_bss_load_config_tlv() - send roam load bss trigger configuration
 * @wmi_handle: wmi handle
 * @parms: pointer to wmi_bss_load_config
 *
 * This function sends the roam load bss trigger configuration to fw.
 * the bss_load_threshold parameter is used to configure the maximum
 * bss load percentage, above which the firmware should trigger roaming
 *
 * Return: QDF status
 */
static QDF_STATUS
send_roam_bss_load_config_tlv(wmi_unified_t wmi_handle,
			      struct wmi_bss_load_config *params)
{
	wmi_roam_bss_load_config_cmd_fixed_param *cmd;
	wmi_buf_t buf;
	uint32_t len;
	len = sizeof(*cmd);
	buf = wmi_buf_alloc(wmi_handle, len);
	if (!buf)
		return QDF_STATUS_E_NOMEM;
	cmd = (wmi_roam_bss_load_config_cmd_fixed_param *)wmi_buf_data(buf);
	WMITLV_SET_HDR(
	   &cmd->tlv_header,
	   WMITLV_TAG_STRUC_wmi_roam_bss_load_config_cmd_fixed_param,
	   WMITLV_GET_STRUCT_TLVLEN(wmi_roam_bss_load_config_cmd_fixed_param));
	cmd->vdev_id = params->vdev_id;
	cmd->bss_load_threshold = params->bss_load_threshold;
	cmd->monitor_time_window = params->bss_load_sample_time;
	wmi_mtrace(WMI_ROAM_BSS_LOAD_CONFIG_CMDID, cmd->vdev_id, 0);
	if (wmi_unified_cmd_send(wmi_handle, buf, len,
				 WMI_ROAM_BSS_LOAD_CONFIG_CMDID)) {
		WMI_LOGE("%s: failed to send WMI_ROAM_BSS_LOAD_CONFIG_CMDID ",
			 __func__);
		wmi_buf_free(buf);
		return QDF_STATUS_E_FAILURE;
	}
	return QDF_STATUS_SUCCESS;
}
/**
/**
 * send_obss_detection_cfg_cmd_tlv() - send obss detection
 * send_obss_detection_cfg_cmd_tlv() - send obss detection
 *   configurations to firmware.
 *   configurations to firmware.
@@ -23166,6 +23211,7 @@ struct wmi_ops tlv_ops = {
	.extract_ndp_sch_update = extract_ndp_sch_update_tlv,
	.extract_ndp_sch_update = extract_ndp_sch_update_tlv,
#endif
#endif
	.send_btm_config = send_btm_config_cmd_tlv,
	.send_btm_config = send_btm_config_cmd_tlv,
	.send_roam_bss_load_config = send_roam_bss_load_config_tlv,
	.send_obss_detection_cfg_cmd = send_obss_detection_cfg_cmd_tlv,
	.send_obss_detection_cfg_cmd = send_obss_detection_cfg_cmd_tlv,
	.extract_obss_detection_info = extract_obss_detection_info_tlv,
	.extract_obss_detection_info = extract_obss_detection_info_tlv,
#ifdef WLAN_SUPPORT_FILS
#ifdef WLAN_SUPPORT_FILS