qcacmn: Add wmi support for 4-wire coex configuration
This patch adds support of new WMI command WMI_COEX_VERSION_CFG_CMID for 4-wire coex configuration in non_tlv_ops. Change-Id: I63da2c7ae99c38d297f7f13a8086611263f7fc5b Acked-by: Daniel Kim <kimdan@codeaurora.org> CRs-Fixed: 1081065
This commit is contained in:

committed by
qcabuildsw

parent
2244d20424
commit
6d72606ecf
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2016 The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2016-2017 The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* Previously licensed under the ISC license by Qualcomm Atheros, Inc.
|
||||
*
|
||||
@@ -472,6 +472,7 @@ typedef enum _ol_ath_param_t {
|
||||
OL_ATH_PARAM_PREFERRED_UPLINK = 344,
|
||||
OL_ATH_PARAM_PRECAC_ENABLE = 345,
|
||||
OL_ATH_PARAM_PRECAC_TIMEOUT = 346,
|
||||
OL_ATH_COEX_VER_CFG = 347,
|
||||
} ol_ath_param_t;
|
||||
|
||||
/*
|
||||
|
@@ -929,6 +929,9 @@ QDF_STATUS wmi_unified_send_btcoex_wlan_priority_cmd(void *wmi_hdl,
|
||||
QDF_STATUS wmi_unified_send_btcoex_duty_cycle_cmd(void *wmi_hdl,
|
||||
struct btcoex_cfg_params *param);
|
||||
|
||||
QDF_STATUS wmi_unified_send_coex_ver_cfg_cmd(void *wmi_hdl,
|
||||
coex_ver_cfg_t *param);
|
||||
|
||||
QDF_STATUS wmi_unified_set_atf_cmd_send(void *wmi_hdl,
|
||||
struct set_atf_params *param);
|
||||
|
||||
|
@@ -3457,6 +3457,49 @@ typedef struct {
|
||||
*/
|
||||
uint32_t wlan_priority_gpio;
|
||||
|
||||
/* Host will notify target which coex algorithm has to be
|
||||
* enabled based on HW, FW capability and device tree config.
|
||||
* Till now the coex algorithms were target specific. Now the
|
||||
* same target can choose between multiple coex algorithms
|
||||
* depending on device tree config on host. For backward
|
||||
* compatibility, version support will have option 0 and will
|
||||
* rely on FW compile time flags to decide the coex version
|
||||
* between VERSION_1, VERSION_2 and VERSION_3. Version info is
|
||||
* mandatory from VERSION_4 onwards for any new coex algorithms.
|
||||
*
|
||||
* 0 = no version support
|
||||
* 1 = COEX_VERSION_1 (3 wire coex)
|
||||
* 2 = COEX_VERSION_2 (2.5 wire coex)
|
||||
* 3 = COEX_VERSION_3 (2.5 wire coex+duty cycle)
|
||||
* 4 = COEX_VERSION_4 (4 wire coex)
|
||||
*/
|
||||
uint32_t coex_version;
|
||||
|
||||
/* There are multiple coex implementations on FW to support different
|
||||
* hardwares. Since the coex algos are mutually exclusive, host will
|
||||
* use below fields to send GPIO info to FW and these GPIO pins will
|
||||
* have different usages depending on the feature enabled. This is to
|
||||
* avoid adding multiple GPIO fields here for different features.
|
||||
*
|
||||
* COEX VERSION_4 (4 wire coex) :
|
||||
* 4 wire coex feature uses 1 common input request line from BT/ZB/
|
||||
* Thread which interrupts the WLAN target processor directly, 1 input
|
||||
* priority line from BT and ZB each, 1 output line to grant access to
|
||||
* requesting IOT subsystem. WLAN uses the input priority line to
|
||||
* identify the requesting IOT subsystem. Request is granted based on
|
||||
* IOT interface priority and WLAN traffic. GPIO pin usage is as below:
|
||||
* coex_gpio_pin_1 = BT PRIORITY INPUT GPIO
|
||||
* coex_gpio_pin_2 = ZIGBEE PRIORITY INPUT GPIO
|
||||
* coex_gpio_pin_3 = GRANT OUTPUT GPIO
|
||||
* when a BT active interrupt is raised, WLAN reads
|
||||
* BT and ZB priority input GPIO pins to compare against the coex
|
||||
* priority table and accordingly sets the grant output GPIO to give
|
||||
* access to requesting IOT subsystem.
|
||||
*/
|
||||
uint32_t coex_gpio_pin_1;
|
||||
uint32_t coex_gpio_pin_2;
|
||||
uint32_t coex_gpio_pin_3;
|
||||
|
||||
/* add new members here */
|
||||
} wmi_host_ext_resource_config;
|
||||
|
||||
@@ -4276,6 +4319,25 @@ struct btcoex_cfg_params {
|
||||
uint32_t wlan_duration;
|
||||
};
|
||||
|
||||
#define WMI_HOST_COEX_CONFIG_BUF_MAX_LEN 32 /* 128 bytes */
|
||||
/**
|
||||
* coex_ver_cfg_t
|
||||
* @coex_version: Version for 4 wire coex
|
||||
* @length: Length of payload buffer based on version
|
||||
* @config_buf: Payload Buffer
|
||||
*/
|
||||
typedef struct {
|
||||
/* VERSION_4 (4 wire coex) */
|
||||
uint32_t coex_version;
|
||||
|
||||
/* No. of A_UINT32 elements in payload buffer. Will depend on the coex
|
||||
* version
|
||||
*/
|
||||
uint32_t length;
|
||||
|
||||
/* Payload buffer */
|
||||
uint32_t config_buf[WMI_HOST_COEX_CONFIG_BUF_MAX_LEN];
|
||||
} coex_ver_cfg_t;
|
||||
|
||||
#define WMI_HOST_RTT_REPORT_CFR 0
|
||||
#define WMI_HOST_RTT_NO_REPORT_CFR 1
|
||||
@@ -5120,6 +5182,7 @@ typedef enum {
|
||||
wmi_pdev_param_tx_chain_mask_1ss,
|
||||
wmi_pdev_param_enable_btcoex,
|
||||
wmi_pdev_param_atf_peer_stats,
|
||||
wmi_pdev_param_btcoex_cfg,
|
||||
|
||||
wmi_pdev_param_max,
|
||||
} wmi_conv_pdev_params_id;
|
||||
@@ -5339,6 +5402,7 @@ typedef enum {
|
||||
wmi_service_tx_mode_dynamic,
|
||||
wmi_service_check_cal_version,
|
||||
wmi_service_btcoex_duty_cycle,
|
||||
wmi_service_4_wire_coex_support,
|
||||
|
||||
wmi_services_max,
|
||||
} wmi_conv_service_ids;
|
||||
|
@@ -996,6 +996,9 @@ QDF_STATUS
|
||||
(*send_btcoex_duty_cycle_cmd)(wmi_unified_t wmi_handle,
|
||||
struct btcoex_cfg_params *param);
|
||||
|
||||
QDF_STATUS
|
||||
(*send_coex_ver_cfg_cmd)(wmi_unified_t wmi_handle, coex_ver_cfg_t *param);
|
||||
|
||||
QDF_STATUS (*extract_wds_addr_event)(wmi_unified_t wmi_handle,
|
||||
void *evt_buf, uint16_t len, wds_addr_event_t *wds_ev);
|
||||
|
||||
|
@@ -6555,6 +6555,27 @@ QDF_STATUS wmi_extract_pdev_utf_event(void *wmi_hdl,
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
/**
|
||||
* wmi_unified_send_coex_ver_cfg_cmd() - send coex ver cfg command
|
||||
* @wmi_handle: wmi handle
|
||||
* @param: wmi coex ver cfg params
|
||||
*
|
||||
* Send WMI_COEX_VERSION_CFG_CMID parameters to fw.
|
||||
*
|
||||
* Return: QDF_STATUS_SUCCESS on success, QDF_STATUS_E_** on error
|
||||
*/
|
||||
QDF_STATUS wmi_unified_send_coex_ver_cfg_cmd(void *wmi_hdl,
|
||||
coex_ver_cfg_t *param)
|
||||
{
|
||||
wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
|
||||
|
||||
if (wmi_handle->ops->send_coex_ver_cfg_cmd)
|
||||
return wmi_handle->ops->send_coex_ver_cfg_cmd(wmi_handle,
|
||||
param);
|
||||
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
/**
|
||||
* wmi_extract_peer_delete_response_event() -
|
||||
* extract vdev id and peer mac addresse from peer delete response event
|
||||
|
@@ -5216,6 +5216,40 @@ send_btcoex_duty_cycle_cmd_non_tlv(wmi_unified_t wmi_handle,
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
* send_coex_ver_cfg_cmd_non_tlv() - send coex ver cfg
|
||||
* @wmi_handle: wmi handle
|
||||
* @param: coex ver and configuration
|
||||
*
|
||||
* Return: 0 for success or error code
|
||||
*/
|
||||
QDF_STATUS
|
||||
send_coex_ver_cfg_cmd_non_tlv(wmi_unified_t wmi_handle, coex_ver_cfg_t *param)
|
||||
{
|
||||
wmi_buf_t buf;
|
||||
coex_ver_cfg_t *cmd;
|
||||
int len = sizeof(wmi_coex_ver_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 = (coex_ver_cfg_t *)wmi_buf_data(buf);
|
||||
cmd->coex_version = param->coex_version;
|
||||
cmd->length = param->length;
|
||||
qdf_mem_copy(cmd->config_buf, param->config_buf,
|
||||
sizeof(cmd->config_buf));
|
||||
if (wmi_unified_cmd_send(wmi_handle, buf, len,
|
||||
WMI_COEX_VERSION_CFG_CMID)) {
|
||||
wmi_buf_free(buf);
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
* wmi_copy_resource_config_non_tlv() - copy resource configuration function
|
||||
* @param resource_cfg: pointer to resource configuration
|
||||
@@ -7959,6 +7993,7 @@ struct wmi_ops non_tlv_ops = {
|
||||
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,
|
||||
.send_coex_ver_cfg_cmd = send_coex_ver_cfg_cmd_non_tlv,
|
||||
|
||||
.get_target_cap_from_service_ready = extract_service_ready_non_tlv,
|
||||
.extract_fw_version = extract_fw_version_non_tlv,
|
||||
@@ -8120,6 +8155,8 @@ static void populate_non_tlv_service(uint32_t *wmi_service)
|
||||
WMI_SERVICE_CHECK_CAL_VERSION;
|
||||
wmi_service[wmi_service_btcoex_duty_cycle] =
|
||||
WMI_SERVICE_BTCOEX_DUTY_CYCLE;
|
||||
wmi_service[wmi_service_4_wire_coex_support] =
|
||||
WMI_SERVICE_4_WIRE_COEX_SUPPORT;
|
||||
|
||||
wmi_service[wmi_service_roam_scan_offload] = WMI_SERVICE_UNAVAILABLE;
|
||||
wmi_service[wmi_service_arpns_offload] = WMI_SERVICE_UNAVAILABLE;
|
||||
|
@@ -14008,6 +14008,7 @@ static void populate_tlv_service(uint32_t *wmi_service)
|
||||
wmi_service[wmi_service_tx_mode_push_pull] = WMI_SERVICE_UNAVAILABLE;
|
||||
wmi_service[wmi_service_tx_mode_dynamic] = WMI_SERVICE_UNAVAILABLE;
|
||||
wmi_service[wmi_service_btcoex_duty_cycle] = WMI_SERVICE_UNAVAILABLE;
|
||||
wmi_service[wmi_service_4_wire_coex_support] = WMI_SERVICE_UNAVAILABLE;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user