qcacmn: Add wmi support for btcoex duty cycle command

A new iwpriv command has been added to configure the period
and wlan duration for a btcoex duty cycle.

As a part of this registring the wmi_service_btcoex_duty_cycle
for WMI_SERVICE_BTCOEX_DUTY_CYCLE.

Also send_btcoex_wlan_priority_cmd registrtaion for btcoex
duty cycle command in non_tlv_ops.

Change-Id: I7f3bfdfd9804566d6d0b7cce7025e99db57d0e23
Acked-by: Basamma Yakkanahalli <ybasamma@qti.qualcomm.com>
CRs-Fixed: 1064437
This commit is contained in:
Sathish Kumar
2016-11-10 15:30:22 +05:30
committed by qcabuildsw
parent 2081ee00ff
commit 699f6b597d
3 changed files with 65 additions and 6 deletions

View File

@@ -5214,12 +5214,13 @@ send_pdev_caldata_version_check_cmd_non_tlv(wmi_unified_t wmi_handle,
/**
* send_btcoex_wlan_priority_cmd_non_tlv() - send btcoex wlan priority fw
* @wmi_handle: wmi handle
* @value: priority value
* @param: btcoex config params
*
* Return: 0 for success or error code
*/
QDF_STATUS
send_btcoex_wlan_priority_cmd_non_tlv(wmi_unified_t wmi_handle, int value)
send_btcoex_wlan_priority_cmd_non_tlv(wmi_unified_t wmi_handle,
struct btcoex_cfg_params *param)
{
wmi_buf_t buf;
wmi_btcoex_cfg_cmd *cmd;
@@ -5231,7 +5232,41 @@ send_btcoex_wlan_priority_cmd_non_tlv(wmi_unified_t wmi_handle, int value)
return QDF_STATUS_E_FAILURE;
}
cmd = (wmi_btcoex_cfg_cmd *) wmi_buf_data(buf);
cmd->btcoex_wlan_priority_bitmap = value;
cmd->btcoex_wlan_priority_bitmap = param->btcoex_wlan_priority_bitmap;
cmd->btcoex_param_flags = param->btcoex_param_flags;
if (wmi_unified_cmd_send(wmi_handle, buf, len, WMI_BTCOEX_CFG_CMDID)) {
wmi_buf_free(buf);
return QDF_STATUS_E_FAILURE;
}
return QDF_STATUS_SUCCESS;
}
/**
* send_btcoex_duty_cycle_cmd_non_tlv() - send btcoex wlan priority fw
* @wmi_handle: wmi handle
* @param: period and duration
*
* Return: 0 for success or error code
*/
QDF_STATUS
send_btcoex_duty_cycle_cmd_non_tlv(wmi_unified_t wmi_handle,
struct btcoex_cfg_params *param)
{
wmi_buf_t buf;
wmi_btcoex_cfg_cmd *cmd;
int len = sizeof(wmi_btcoex_cfg_cmd);
buf = wmi_buf_alloc(wmi_handle, len);
if (!buf) {
qdf_print("%s:wmi_buf_alloc failed\n", __func__);
return QDF_STATUS_E_FAILURE;
}
cmd = (wmi_btcoex_cfg_cmd *) wmi_buf_data(buf);
cmd->wlan_duration = param->wlan_duration;
cmd->period = param->period;
cmd->btcoex_param_flags = param->btcoex_param_flags;
if (wmi_unified_cmd_send(wmi_handle, buf, len, WMI_BTCOEX_CFG_CMDID)) {
wmi_buf_free(buf);
return QDF_STATUS_E_FAILURE;
@@ -7879,6 +7914,7 @@ struct wmi_ops non_tlv_ops = {
.send_pdev_caldata_version_check_cmd =
send_pdev_caldata_version_check_cmd_non_tlv,
.send_btcoex_wlan_priority_cmd = send_btcoex_wlan_priority_cmd_non_tlv,
.send_btcoex_duty_cycle_cmd = send_btcoex_duty_cycle_cmd_non_tlv,
.get_target_cap_from_service_ready = extract_service_ready_non_tlv,
.extract_fw_version = extract_fw_version_non_tlv,
@@ -8039,6 +8075,8 @@ static void populate_non_tlv_service(uint32_t *wmi_service)
wmi_service[wmi_service_tx_mode_dynamic] = WMI_SERVICE_TX_MODE_DYNAMIC;
wmi_service[wmi_service_check_cal_version] =
WMI_SERVICE_CHECK_CAL_VERSION;
wmi_service[wmi_service_btcoex_duty_cycle] =
WMI_SERVICE_BTCOEX_DUTY_CYCLE;
wmi_service[wmi_service_roam_scan_offload] = WMI_SERVICE_UNAVAILABLE;
wmi_service[wmi_service_arpns_offload] = WMI_SERVICE_UNAVAILABLE;