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

Commit 03d103d8 authored by yeshwanth sriram guntuka's avatar yeshwanth sriram guntuka Committed by Abhinav Kumar
Browse files

qcacmn: Add config support for BTM offload

Add ini to configure BTM offload configuration
which is sent to firmware as part of RSO start
via wmi btm config cmd.

Change-Id: I69c792705b208014af8f1878f7645d957dde6c06
CRs-Fixed: 2105112
parent 4b04b726
Loading
Loading
Loading
Loading
+11 −1
Original line number Diff line number Diff line
/*
 * Copyright (c) 2013-2018 The Linux Foundation. All rights reserved.
 * Copyright (c) 2013-2019 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
@@ -1623,4 +1623,14 @@ QDF_STATUS wmi_unified_offload_11k_cmd(void *wmi_hdl,
 */
QDF_STATUS wmi_unified_invoke_neighbor_report_cmd(void *wmi_hdl,
			struct wmi_invoke_neighbor_report_params *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_btm_config(void *wmi_hdl,
				       struct wmi_btm_config *params);
#endif /* _WMI_UNIFIED_API_H_ */
+10 −1
Original line number Diff line number Diff line
/*
 * Copyright (c) 2016-2018 The Linux Foundation. All rights reserved.
 * Copyright (c) 2016-2019 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
@@ -7597,6 +7597,15 @@ struct wmi_mawc_roam_params {
	uint8_t rssi_stationary_high_adjust;
	uint8_t rssi_stationary_low_adjust;
};
/**
 * struct wmi_btm_config - BSS Transition Management offload params
 * @vdev_id: VDEV on which the parameters should be applied
 * @btm_offload_config: BTM config
 */
struct wmi_btm_config {
	uint8_t vdev_id;
	uint32_t btm_offload_config;
};

/**
 * @time_offset: time offset after 11k offload command to trigger a neighbor
+3 −1
Original line number Diff line number Diff line
/*
 * Copyright (c) 2013-2018 The Linux Foundation. All rights reserved.
 * Copyright (c) 2013-2019 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
@@ -1250,6 +1250,8 @@ QDF_STATUS (*send_offload_11k_cmd)(wmi_unified_t wmi_handle,

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

struct target_abi_version {
+13 −1
Original line number Diff line number Diff line
/*
 * Copyright (c) 2016-2018 The Linux Foundation. All rights reserved.
 * Copyright (c) 2016-2019 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
@@ -6586,3 +6586,15 @@ wmi_extract_roam_scan_stats_res_evt(wmi_unified_t wmi, void *evt_buf,

	return QDF_STATUS_E_FAILURE;
}

QDF_STATUS wmi_unified_send_btm_config(void *wmi_hdl,
				       struct wmi_btm_config *params)
{
	wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;

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

	return QDF_STATUS_E_FAILURE;
}
+39 −0
Original line number Diff line number Diff line
@@ -15057,6 +15057,44 @@ static QDF_STATUS send_invoke_neighbor_report_cmd_tlv(wmi_unified_t wmi_handle,
	return status;
}

/*
 * send_btm_config_cmd_tlv() - Send wmi cmd for BTM config
 * @wmi_handle: wmi handle
 * @params: pointer to wmi_btm_config
 *
 * Return: QDF_STATUS
 */
static QDF_STATUS send_btm_config_cmd_tlv(wmi_unified_t wmi_handle,
					  struct wmi_btm_config *params)
{

	wmi_btm_config_fixed_param *cmd;
	wmi_buf_t buf;
	uint32_t len;

	len = sizeof(*cmd);
	buf = wmi_buf_alloc(wmi_handle, len);
	if (!buf) {
		qdf_print("%s:wmi_buf_alloc failed\n", __func__);
		return QDF_STATUS_E_NOMEM;
	}

	cmd = (wmi_btm_config_fixed_param *)wmi_buf_data(buf);
	WMITLV_SET_HDR(&cmd->tlv_header,
		       WMITLV_TAG_STRUC_wmi_btm_config_fixed_param,
		       WMITLV_GET_STRUCT_TLVLEN(wmi_btm_config_fixed_param));
	cmd->vdev_id = params->vdev_id;
	cmd->flags = params->btm_offload_config;
	if (wmi_unified_cmd_send(wmi_handle, buf, len,
	    WMI_ROAM_BTM_CONFIG_CMDID)) {
		WMI_LOGE("%s: failed to send WMI_ROAM_BTM_CONFIG_CMDID",
			 __func__);
		wmi_buf_free(buf);
		return QDF_STATUS_E_FAILURE;
	}
	return QDF_STATUS_SUCCESS;
}

struct wmi_ops tlv_ops =  {
	.send_vdev_create_cmd = send_vdev_create_cmd_tlv,
	.send_vdev_delete_cmd = send_vdev_delete_cmd_tlv,
@@ -15359,6 +15397,7 @@ struct wmi_ops tlv_ops = {
	.extract_roam_scan_stats_res_evt = extract_roam_scan_stats_res_evt_tlv,
	.send_offload_11k_cmd = send_offload_11k_cmd_tlv,
	.send_invoke_neighbor_report_cmd = send_invoke_neighbor_report_cmd_tlv,
	.send_btm_config = send_btm_config_cmd_tlv,
};

#ifdef WMI_TLV_AND_NON_TLV_SUPPORT