qca-wifi: Move gpio config/output tlv to cmn code
Move gpio config and output tlv send command to common code for WIN and MCC for both to use CRs-Fixed: 2755642 Change-Id: I124ae90b6c854e5bbab013e27b7b11d303c3299c
This commit is contained in:
@@ -564,26 +564,6 @@ wmi_unified_set_qboost_param_cmd_send(wmi_unified_t wmi_handle,
|
|||||||
uint8_t macaddr[QDF_MAC_ADDR_SIZE],
|
uint8_t macaddr[QDF_MAC_ADDR_SIZE],
|
||||||
struct set_qboost_params *param);
|
struct set_qboost_params *param);
|
||||||
|
|
||||||
/**
|
|
||||||
* wmi_unified_gpio_config_cmd_send() - WMI gpio config function
|
|
||||||
* @wmi_handle: handle to WMI.
|
|
||||||
* @param: pointer to hold gpio config param
|
|
||||||
*
|
|
||||||
* Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
|
|
||||||
*/
|
|
||||||
QDF_STATUS wmi_unified_gpio_config_cmd_send(wmi_unified_t wmi_handle,
|
|
||||||
struct gpio_config_params *param);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* wmi_unified_gpio_output_cmd_send() - WMI gpio config function
|
|
||||||
* @wmi_handle: handle to WMI.
|
|
||||||
* @param param: pointer to hold gpio config param
|
|
||||||
*
|
|
||||||
* Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
|
|
||||||
*/
|
|
||||||
QDF_STATUS wmi_unified_gpio_output_cmd_send(wmi_unified_t wmi_handle,
|
|
||||||
struct gpio_output_params *param);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* wmi_unified_mcast_group_update_cmd_send() - WMI mcast grp update cmd function
|
* wmi_unified_mcast_group_update_cmd_send() - WMI mcast grp update cmd function
|
||||||
* @wmi_handle: handle to WMI.
|
* @wmi_handle: handle to WMI.
|
||||||
|
@@ -455,25 +455,6 @@ QDF_STATUS wmi_unified_set_qboost_param_cmd_send(
|
|||||||
return QDF_STATUS_E_FAILURE;
|
return QDF_STATUS_E_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
QDF_STATUS wmi_unified_gpio_config_cmd_send(
|
|
||||||
wmi_unified_t wmi_handle,
|
|
||||||
struct gpio_config_params *param)
|
|
||||||
{
|
|
||||||
if (wmi_handle->ops->send_gpio_config_cmd)
|
|
||||||
return wmi_handle->ops->send_gpio_config_cmd(wmi_handle, param);
|
|
||||||
|
|
||||||
return QDF_STATUS_E_FAILURE;
|
|
||||||
}
|
|
||||||
|
|
||||||
QDF_STATUS wmi_unified_gpio_output_cmd_send(wmi_unified_t wmi_handle,
|
|
||||||
struct gpio_output_params *param)
|
|
||||||
{
|
|
||||||
if (wmi_handle->ops->send_gpio_output_cmd)
|
|
||||||
return wmi_handle->ops->send_gpio_output_cmd(wmi_handle, param);
|
|
||||||
|
|
||||||
return QDF_STATUS_E_FAILURE;
|
|
||||||
}
|
|
||||||
|
|
||||||
QDF_STATUS wmi_unified_mcast_group_update_cmd_send(
|
QDF_STATUS wmi_unified_mcast_group_update_cmd_send(
|
||||||
wmi_unified_t wmi_handle,
|
wmi_unified_t wmi_handle,
|
||||||
struct mcast_group_update_params *param)
|
struct mcast_group_update_params *param)
|
||||||
|
@@ -1979,103 +1979,6 @@ send_set_qboost_param_cmd_tlv(wmi_unified_t wmi_handle,
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* send_gpio_config_cmd_tlv() - send gpio config to fw
|
|
||||||
* @wmi_handle: wmi handle
|
|
||||||
* @param: pointer to hold gpio config param
|
|
||||||
*
|
|
||||||
* Return: 0 for success or error code
|
|
||||||
*/
|
|
||||||
static QDF_STATUS
|
|
||||||
send_gpio_config_cmd_tlv(wmi_unified_t wmi_handle,
|
|
||||||
struct gpio_config_params *param)
|
|
||||||
{
|
|
||||||
wmi_gpio_config_cmd_fixed_param *cmd;
|
|
||||||
wmi_buf_t buf;
|
|
||||||
int32_t len;
|
|
||||||
QDF_STATUS ret;
|
|
||||||
|
|
||||||
len = sizeof(*cmd);
|
|
||||||
|
|
||||||
/* Sanity Checks */
|
|
||||||
if (param->pull_type > WMI_GPIO_PULL_DOWN ||
|
|
||||||
param->intr_mode > WMI_GPIO_INTTYPE_LEVEL_HIGH) {
|
|
||||||
return QDF_STATUS_E_FAILURE;
|
|
||||||
}
|
|
||||||
|
|
||||||
buf = wmi_buf_alloc(wmi_handle, len);
|
|
||||||
if (!buf) {
|
|
||||||
WMI_LOGE("%s: wmi_buf_alloc failed", __func__);
|
|
||||||
return QDF_STATUS_E_FAILURE;
|
|
||||||
}
|
|
||||||
|
|
||||||
cmd = (wmi_gpio_config_cmd_fixed_param *)wmi_buf_data(buf);
|
|
||||||
WMITLV_SET_HDR(&cmd->tlv_header,
|
|
||||||
WMITLV_TAG_STRUC_wmi_gpio_config_cmd_fixed_param,
|
|
||||||
WMITLV_GET_STRUCT_TLVLEN(
|
|
||||||
wmi_gpio_config_cmd_fixed_param));
|
|
||||||
cmd->gpio_num = param->gpio_num;
|
|
||||||
cmd->input = param->input;
|
|
||||||
cmd->pull_type = param->pull_type;
|
|
||||||
cmd->intr_mode = param->intr_mode;
|
|
||||||
|
|
||||||
wmi_mtrace(WMI_GPIO_CONFIG_CMDID, NO_SESSION, 0);
|
|
||||||
ret = wmi_unified_cmd_send(wmi_handle, buf, sizeof(*cmd),
|
|
||||||
WMI_GPIO_CONFIG_CMDID);
|
|
||||||
|
|
||||||
if (ret != 0) {
|
|
||||||
WMI_LOGE("Sending GPIO config cmd failed");
|
|
||||||
wmi_buf_free(buf);
|
|
||||||
}
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* send_gpio_output_cmd_tlv() - send gpio output to fw
|
|
||||||
* @wmi_handle: wmi handle
|
|
||||||
* @param: pointer to hold gpio output param
|
|
||||||
*
|
|
||||||
* Return: 0 for success or error code
|
|
||||||
*/
|
|
||||||
static QDF_STATUS
|
|
||||||
send_gpio_output_cmd_tlv(wmi_unified_t wmi_handle,
|
|
||||||
struct gpio_output_params *param)
|
|
||||||
{
|
|
||||||
wmi_gpio_output_cmd_fixed_param *cmd;
|
|
||||||
wmi_buf_t buf;
|
|
||||||
int32_t len;
|
|
||||||
QDF_STATUS ret;
|
|
||||||
|
|
||||||
len = sizeof(*cmd);
|
|
||||||
|
|
||||||
buf = wmi_buf_alloc(wmi_handle, len);
|
|
||||||
if (!buf) {
|
|
||||||
WMI_LOGE("%s: wmi_buf_alloc failed", __func__);
|
|
||||||
return QDF_STATUS_E_FAILURE;
|
|
||||||
}
|
|
||||||
|
|
||||||
cmd = (wmi_gpio_output_cmd_fixed_param *)wmi_buf_data(buf);
|
|
||||||
WMITLV_SET_HDR(&cmd->tlv_header,
|
|
||||||
WMITLV_TAG_STRUC_wmi_gpio_output_cmd_fixed_param,
|
|
||||||
WMITLV_GET_STRUCT_TLVLEN(
|
|
||||||
wmi_gpio_output_cmd_fixed_param));
|
|
||||||
cmd->gpio_num = param->gpio_num;
|
|
||||||
cmd->set = param->set;
|
|
||||||
|
|
||||||
wmi_mtrace(WMI_GPIO_OUTPUT_CMDID, NO_SESSION, 0);
|
|
||||||
ret = wmi_unified_cmd_send(wmi_handle, buf, sizeof(*cmd),
|
|
||||||
WMI_GPIO_OUTPUT_CMDID);
|
|
||||||
|
|
||||||
if (ret != 0) {
|
|
||||||
WMI_LOGE("Sending GPIO output cmd failed");
|
|
||||||
wmi_buf_free(buf);
|
|
||||||
}
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* send_mcast_group_update_cmd_tlv() - send mcast group update cmd to fw
|
* send_mcast_group_update_cmd_tlv() - send mcast group update cmd to fw
|
||||||
* @wmi_handle: wmi handle
|
* @wmi_handle: wmi handle
|
||||||
@@ -2709,8 +2612,6 @@ void wmi_ap_attach_tlv(wmi_unified_t wmi_handle)
|
|||||||
ops->send_fils_discovery_send_cmd = send_fils_discovery_send_cmd_tlv;
|
ops->send_fils_discovery_send_cmd = send_fils_discovery_send_cmd_tlv;
|
||||||
#endif /* WLAN_SUPPORT_FILS */
|
#endif /* WLAN_SUPPORT_FILS */
|
||||||
ops->send_set_qboost_param_cmd = send_set_qboost_param_cmd_tlv;
|
ops->send_set_qboost_param_cmd = send_set_qboost_param_cmd_tlv;
|
||||||
ops->send_gpio_config_cmd = send_gpio_config_cmd_tlv;
|
|
||||||
ops->send_gpio_output_cmd = send_gpio_output_cmd_tlv;
|
|
||||||
ops->send_mcast_group_update_cmd = send_mcast_group_update_cmd_tlv;
|
ops->send_mcast_group_update_cmd = send_mcast_group_update_cmd_tlv;
|
||||||
ops->send_pdev_qvit_cmd = send_pdev_qvit_cmd_tlv;
|
ops->send_pdev_qvit_cmd = send_pdev_qvit_cmd_tlv;
|
||||||
ops->send_wmm_update_cmd = send_wmm_update_cmd_tlv;
|
ops->send_wmm_update_cmd = send_wmm_update_cmd_tlv;
|
||||||
|
@@ -5773,6 +5773,7 @@ send_packet_power_info_get_cmd_non_tlv(wmi_unified_t wmi_handle,
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef WLAN_FEATURE_GPIO_CFG
|
||||||
/**
|
/**
|
||||||
* send_gpio_config_cmd_non_tlv() - send gpio config to fw
|
* send_gpio_config_cmd_non_tlv() - send gpio config to fw
|
||||||
* @wmi_handle: wmi handle
|
* @wmi_handle: wmi handle
|
||||||
@@ -5790,8 +5791,8 @@ send_gpio_config_cmd_non_tlv(wmi_unified_t wmi_handle,
|
|||||||
u_int32_t len = sizeof(wmi_gpio_config_cmd);
|
u_int32_t len = sizeof(wmi_gpio_config_cmd);
|
||||||
|
|
||||||
/* Sanity Checks */
|
/* Sanity Checks */
|
||||||
if (param->pull_type > WMI_GPIO_PULL_DOWN ||
|
if (param->pin_pull_type > WMI_HOST_GPIO_PULL_DOWN ||
|
||||||
param->intr_mode > WMI_GPIO_INTTYPE_LEVEL_HIGH) {
|
param->pin_intr_mode > WMI_HOST_GPIO_INTMODE_LEVEL_HIGH) {
|
||||||
return QDF_STATUS_E_FAILURE;
|
return QDF_STATUS_E_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -5800,10 +5801,10 @@ send_gpio_config_cmd_non_tlv(wmi_unified_t wmi_handle,
|
|||||||
return QDF_STATUS_E_FAILURE;
|
return QDF_STATUS_E_FAILURE;
|
||||||
|
|
||||||
cmd = (wmi_gpio_config_cmd *)wmi_buf_data(wmibuf);
|
cmd = (wmi_gpio_config_cmd *)wmi_buf_data(wmibuf);
|
||||||
cmd->gpio_num = param->gpio_num;
|
cmd->gpio_num = param->pin_num;
|
||||||
cmd->input = param->input;
|
cmd->input = param->pin_dir;
|
||||||
cmd->pull_type = param->pull_type;
|
cmd->pull_type = param->pin_pull_type;
|
||||||
cmd->intr_mode = param->intr_mode;
|
cmd->intr_mode = param->pin_intr_mode;
|
||||||
ret = wmi_unified_cmd_send(wmi_handle, wmibuf, len,
|
ret = wmi_unified_cmd_send(wmi_handle, wmibuf, len,
|
||||||
WMI_GPIO_CONFIG_CMDID);
|
WMI_GPIO_CONFIG_CMDID);
|
||||||
if (QDF_IS_STATUS_ERROR(ret)) {
|
if (QDF_IS_STATUS_ERROR(ret)) {
|
||||||
@@ -5836,8 +5837,8 @@ send_gpio_output_cmd_non_tlv(wmi_unified_t wmi_handle,
|
|||||||
return QDF_STATUS_E_FAILURE;
|
return QDF_STATUS_E_FAILURE;
|
||||||
|
|
||||||
cmd = (wmi_gpio_output_cmd *)wmi_buf_data(wmibuf);
|
cmd = (wmi_gpio_output_cmd *)wmi_buf_data(wmibuf);
|
||||||
cmd->gpio_num = param->gpio_num;
|
cmd->gpio_num = param->pin_num;
|
||||||
cmd->set = param->set;
|
cmd->set = param->pin_set;
|
||||||
ret = wmi_unified_cmd_send(wmi_handle, wmibuf, len,
|
ret = wmi_unified_cmd_send(wmi_handle, wmibuf, len,
|
||||||
WMI_GPIO_OUTPUT_CMDID);
|
WMI_GPIO_OUTPUT_CMDID);
|
||||||
if (QDF_IS_STATUS_ERROR(ret)) {
|
if (QDF_IS_STATUS_ERROR(ret)) {
|
||||||
@@ -5848,6 +5849,7 @@ send_gpio_output_cmd_non_tlv(wmi_unified_t wmi_handle,
|
|||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* send_rtt_meas_req_test_cmd_non_tlv() - send rtt meas req test cmd to fw
|
* send_rtt_meas_req_test_cmd_non_tlv() - send rtt meas req test cmd to fw
|
||||||
@@ -10356,8 +10358,10 @@ struct wmi_ops non_tlv_ops = {
|
|||||||
.send_nf_dbr_dbm_info_get_cmd = send_nf_dbr_dbm_info_get_cmd_non_tlv,
|
.send_nf_dbr_dbm_info_get_cmd = send_nf_dbr_dbm_info_get_cmd_non_tlv,
|
||||||
.send_packet_power_info_get_cmd =
|
.send_packet_power_info_get_cmd =
|
||||||
send_packet_power_info_get_cmd_non_tlv,
|
send_packet_power_info_get_cmd_non_tlv,
|
||||||
|
#ifdef WLAN_FEATURE_GPIO_CFG
|
||||||
.send_gpio_config_cmd = send_gpio_config_cmd_non_tlv,
|
.send_gpio_config_cmd = send_gpio_config_cmd_non_tlv,
|
||||||
.send_gpio_output_cmd = send_gpio_output_cmd_non_tlv,
|
.send_gpio_output_cmd = send_gpio_output_cmd_non_tlv,
|
||||||
|
#endif
|
||||||
.send_rtt_meas_req_test_cmd = send_rtt_meas_req_test_cmd_non_tlv,
|
.send_rtt_meas_req_test_cmd = send_rtt_meas_req_test_cmd_non_tlv,
|
||||||
.send_rtt_meas_req_cmd = send_rtt_meas_req_cmd_non_tlv,
|
.send_rtt_meas_req_cmd = send_rtt_meas_req_cmd_non_tlv,
|
||||||
.send_lci_set_cmd = send_lci_set_cmd_non_tlv,
|
.send_lci_set_cmd = send_lci_set_cmd_non_tlv,
|
||||||
|
Reference in New Issue
Block a user