qcacmn: Add support for WMI_PDEV_WAL_POWER_DEBUG_CMD

Add host support for WMI POWER DEBUG command to control mac_core power features
for run time debugging.

Change-Id: Ifc810b24222507f1445a84a54caa8aee5e815b38
CRs-Fixed: 1007598
This commit is contained in:
Govind Singh
2016-05-02 17:59:24 +05:30
committed by Akash Patel
parent 2c3575e635
commit 2a56c22843
5 changed files with 109 additions and 0 deletions

View File

@@ -1226,4 +1226,7 @@ QDF_STATUS wmi_extract_vdev_stats(void *wmi_hdl, void *evt_buf,
QDF_STATUS wmi_extract_vdev_extd_stats(void *wmi_hdl, void *evt_buf,
uint32_t index, wmi_host_vdev_extd_stats *vdev_extd_stats);
QDF_STATUS wmi_unified_send_power_dbg_cmd(void *wmi_hdl,
struct wmi_power_dbg_params *param);
#endif /* _WMI_UNIFIED_API_H_ */

View File

@@ -6293,5 +6293,22 @@ typedef struct {
typedef struct {
uint32_t channel;
} wmi_host_ath_dcs_cw_int;
#define WMI_MAX_POWER_DBG_ARGS 8
/**
* struct wmi_power_dbg_params - power debug command parameter
* @pdev_id: subsystem identifier
* @module_id: parameter id
* @num_arg: no of arguments
* @args: arguments
*/
struct wmi_power_dbg_params {
uint32_t pdev_id;
uint32_t module_id;
uint32_t num_args;
uint32_t args[WMI_MAX_POWER_DBG_ARGS];
};
#endif /* _WMI_UNIFIED_PARAM_H_ */

View File

@@ -1020,6 +1020,9 @@ QDF_STATUS (*extract_tx_data_traffic_ctrl_ev)(wmi_unified_t wmi_handle,
QDF_STATUS (*extract_vdev_extd_stats)(wmi_unified_t wmi_handle, void *evt_buf,
uint32_t index, wmi_host_vdev_extd_stats *vdev_extd_stats);
QDF_STATUS (*send_power_dbg_cmd)(wmi_unified_t wmi_handle,
struct wmi_power_dbg_params *param);
};
struct target_abi_version {

View File

@@ -6018,3 +6018,24 @@ QDF_STATUS wmi_extract_vdev_extd_stats(void *wmi_hdl, void *evt_buf,
return QDF_STATUS_E_FAILURE;
}
/**
* wmi_unified_send_power_dbg_cmd() - send power debug commands
* @wmi_handle: wmi handle
* @param: wmi power debug parameter
*
* Send WMI_POWER_DEBUG_CMDID parameters to fw.
*
* Return: QDF_STATUS_SUCCESS on success, QDF_STATUS_E_** on error
*/
QDF_STATUS wmi_unified_send_power_dbg_cmd(void *wmi_hdl,
struct wmi_power_dbg_params *param)
{
wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl;
if (wmi_handle->ops->send_power_dbg_cmd)
return wmi_handle->ops->send_power_dbg_cmd(wmi_handle,
param);
return QDF_STATUS_E_FAILURE;
}

View File

@@ -10313,6 +10313,70 @@ QDF_STATUS send_get_buf_extscan_hotlist_cmd_tlv(wmi_unified_t wmi_handle,
return QDF_STATUS_SUCCESS;
}
/**
* send_power_dbg_cmd_tlv() - send power debug commands
* @wmi_handle: wmi handle
* @param: wmi power debug parameter
*
* Send WMI_POWER_DEBUG_CMDID parameters to fw.
*
* Return: QDF_STATUS_SUCCESS on success, QDF_STATUS_E_** on error
*/
QDF_STATUS send_power_dbg_cmd_tlv(wmi_unified_t wmi_handle,
struct wmi_power_dbg_params *param)
{
wmi_buf_t buf = NULL;
QDF_STATUS status;
int len, args_tlv_len;
uint8_t *buf_ptr;
uint8_t i;
wmi_pdev_wal_power_debug_cmd_fixed_param *cmd;
uint32_t *cmd_args;
/* Prepare and send power debug cmd parameters */
args_tlv_len = WMI_TLV_HDR_SIZE + param->num_args * sizeof(uint32_t);
len = sizeof(*cmd) + args_tlv_len;
buf = wmi_buf_alloc(wmi_handle, len);
if (!buf) {
WMI_LOGE("%s : wmi_buf_alloc failed", __func__);
return QDF_STATUS_E_NOMEM;
}
buf_ptr = (uint8_t *) wmi_buf_data(buf);
cmd = (wmi_pdev_wal_power_debug_cmd_fixed_param *) buf_ptr;
WMITLV_SET_HDR(&cmd->tlv_header,
WMITLV_TAG_STRUC_wmi_pdev_wal_power_debug_cmd_fixed_param,
WMITLV_GET_STRUCT_TLVLEN
(wmi_pdev_wal_power_debug_cmd_fixed_param));
cmd->pdev_id = param->pdev_id;
cmd->module_id = param->module_id;
cmd->num_args = param->num_args;
buf_ptr += sizeof(*cmd);
WMITLV_SET_HDR(buf_ptr, WMITLV_TAG_ARRAY_UINT32,
(param->num_args * sizeof(uint32_t)));
cmd_args = (uint32_t *) (buf_ptr + WMI_TLV_HDR_SIZE);
WMI_LOGI("%s: %d num of args = ", __func__, param->num_args);
for (i = 0; (i < param->num_args && i < WMI_MAX_NUM_ARGS); i++) {
cmd_args[i] = param->args[i];
WMI_LOGI("%d,", param->args[i]);
}
status = wmi_unified_cmd_send(wmi_handle, buf,
len, WMI_PDEV_WAL_POWER_DEBUG_CMDID);
if (QDF_IS_STATUS_ERROR(status)) {
WMI_LOGE("wmi_unified_cmd_send WMI_PDEV_WAL_POWER_DEBUG_CMDID returned Error %d",
status);
goto error;
}
return QDF_STATUS_SUCCESS;
error:
wmi_buf_free(buf);
return status;
}
struct wmi_ops tlv_ops = {
.send_vdev_create_cmd = send_vdev_create_cmd_tlv,
.send_vdev_delete_cmd = send_vdev_delete_cmd_tlv,
@@ -10514,6 +10578,7 @@ struct wmi_ops tlv_ops = {
send_roam_scan_offload_rssi_change_cmd_tlv,
.send_get_buf_extscan_hotlist_cmd =
send_get_buf_extscan_hotlist_cmd_tlv,
.send_power_dbg_cmd = send_power_dbg_cmd_tlv,
/* TODO - Add other tlv apis here */
};