qcacmn: CE Debug Enhancements WMI interface
Add WMI interface for the smart logging feature. Change-Id: Ife3784020d1b9458c2b09b6a2f31f55aab5f57ec CRs-Fixed: 2001507
This commit is contained in:
@@ -1243,6 +1243,9 @@ enum _ol_ath_param_t {
|
||||
OL_ATH_PARAM_DFS_HOST_WAIT_TIMEOUT = 367,
|
||||
#endif
|
||||
OL_ATH_PARAM_NF_THRESH = 368,
|
||||
OL_ATH_PARAM_SMARTLOG_ENABLE = 369,
|
||||
OL_ATH_PARAM_SMARTLOG_FATAL_EVENT = 370,
|
||||
|
||||
};
|
||||
|
||||
/* Enumeration of PDEV Configuration parameter */
|
||||
|
@@ -199,6 +199,7 @@ struct tgt_info {
|
||||
* @add_11ax_modes: Adds 11ax modes to reg cap
|
||||
* @set_default_tgt_config: Sets target config with default values
|
||||
* @sw_version_check: Checks the SW version
|
||||
* @smart_log_enable: Enable Smart Logs feature
|
||||
*/
|
||||
struct target_ops {
|
||||
QDF_STATUS (*ext_resource_config_enable)
|
||||
@@ -253,6 +254,9 @@ struct target_ops {
|
||||
struct wlan_objmgr_psoc *psoc,
|
||||
struct target_psoc_info *tgt_hdl,
|
||||
uint8_t *evt_buf);
|
||||
void (*smart_log_enable)
|
||||
(struct wlan_objmgr_psoc *psoc,
|
||||
struct target_psoc_info *tgt_info, uint8_t *event);
|
||||
};
|
||||
|
||||
|
||||
@@ -2067,5 +2071,24 @@ static inline int32_t target_psoc_get_num_hw_modes
|
||||
|
||||
return tgt_hdl->info.service_ext_param.num_hw_modes;
|
||||
}
|
||||
|
||||
/**
|
||||
* target_if_smart_log enable() - Enable Smart Logs
|
||||
* @psoc: psoc object
|
||||
* @tgt_hdl: target_psoc_info pointer
|
||||
* @evt_buf: Service ready Event buffer received from FW
|
||||
*
|
||||
* API to enable Smart Logs
|
||||
*
|
||||
* Return: none
|
||||
*/
|
||||
static inline void target_if_smart_log_enable
|
||||
(struct wlan_objmgr_psoc *psoc,
|
||||
struct target_psoc_info *tgt_hdl,
|
||||
uint8_t *evt_buf)
|
||||
{
|
||||
if ((tgt_hdl->tif_ops) && (tgt_hdl->tif_ops->smart_log_enable))
|
||||
tgt_hdl->tif_ops->smart_log_enable(psoc, tgt_hdl, evt_buf);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@@ -162,6 +162,7 @@ static int init_deinit_service_ready_event_handler(ol_scn_t scn_handle,
|
||||
target_if_info("Wait for EXT message");
|
||||
}
|
||||
|
||||
target_if_smart_log_enable(psoc, tgt_hdl, event);
|
||||
exit:
|
||||
return err_code;
|
||||
}
|
||||
|
@@ -2331,4 +2331,42 @@ wmi_unified_dfs_send_avg_params_cmd(void *wmi_hdl,
|
||||
QDF_STATUS wmi_extract_dfs_status_from_fw(void *wmi_hdl, void *evt_buf,
|
||||
uint32_t *dfs_status_check);
|
||||
#endif
|
||||
#ifdef OL_ATH_SMART_LOGGING
|
||||
/**
|
||||
* wmi_unified_send_smart_logging_enable_cmd() - send smart logging enable cmd
|
||||
* @wmi_hdl: wmi handle
|
||||
* @params: enable/disable
|
||||
*
|
||||
* This function enables/disable the smart logging feature
|
||||
*
|
||||
* Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
|
||||
*/
|
||||
QDF_STATUS wmi_unified_send_smart_logging_enable_cmd(void *wmi_hdl,
|
||||
uint32_t param);
|
||||
|
||||
/**
|
||||
* wmi_unified_send_smart_logging_fatal_cmd() - send smart logging fatal cmd
|
||||
* @wmi_hdl: wmi handle
|
||||
* @param: Fatal event
|
||||
*
|
||||
* This function sends the smart log fatal events to the FW
|
||||
*
|
||||
* Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
|
||||
*/
|
||||
QDF_STATUS wmi_unified_send_smart_logging_fatal_cmd
|
||||
(void *wmi_hdl,
|
||||
struct wmi_debug_fatal_events *param);
|
||||
|
||||
/**
|
||||
* wmi_extract_smartlog_ev() - extract smartlog event info from event
|
||||
* @wmi_handle: wmi handle
|
||||
* @param evt_buf: pointer to event buffer
|
||||
* @param ev: Pointer to hold fatal events
|
||||
*
|
||||
* Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
|
||||
*/
|
||||
QDF_STATUS wmi_extract_smartlog_ev
|
||||
(void *wmi_hdl, void *evt_buf,
|
||||
struct wmi_debug_fatal_events *ev);
|
||||
#endif /* OL_ATH_SMART_LOGGING */
|
||||
#endif /* _WMI_UNIFIED_API_H_ */
|
||||
|
@@ -5531,6 +5531,9 @@ typedef enum {
|
||||
wmi_twt_enable_complete_event_id,
|
||||
wmi_apf_get_vdev_work_memory_resp_event_id,
|
||||
|
||||
#ifdef OL_ATH_SMART_LOGGING
|
||||
wmi_debug_fatal_condition_eventid,
|
||||
#endif /* OL_ATH_SMART_LOGGING */
|
||||
wmi_events_max,
|
||||
} wmi_conv_event_id;
|
||||
|
||||
@@ -5962,6 +5965,9 @@ typedef enum {
|
||||
wmi_service_twt_responder,
|
||||
wmi_service_listen_interval_offload_support,
|
||||
|
||||
#ifdef OL_ATH_SMART_LOGGING
|
||||
wmi_service_smart_logging_support,
|
||||
#endif
|
||||
wmi_services_max,
|
||||
} wmi_conv_service_ids;
|
||||
#define WMI_SERVICE_UNAVAILABLE 0xFFFF
|
||||
@@ -7916,6 +7922,33 @@ struct wmi_host_pdev_band_to_mac {
|
||||
};
|
||||
#define WMI_HOST_MAX_PDEV 3
|
||||
|
||||
#ifdef OL_ATH_SMART_LOGGING
|
||||
/**
|
||||
* struct wmi_fatal_condition_event - Fatal condition event param
|
||||
* @type: Type of event
|
||||
* @subtype: subtype of event
|
||||
* @reserved0: reserved
|
||||
*/
|
||||
struct wmi_fatal_condition_event {
|
||||
uint32_t type;
|
||||
uint32_t subtype;
|
||||
uint32_t reserved0;
|
||||
};
|
||||
|
||||
/*Currently the Max fatal events is 3 */
|
||||
#define FATAL_EVENTS_MAX 3
|
||||
|
||||
/**
|
||||
* struct wmi_debug_fatal_events: Fatal events list
|
||||
* @num_events:Number of events
|
||||
* @event[FATAL_EVENTS_MAX]: Each event data
|
||||
*/
|
||||
struct wmi_debug_fatal_events {
|
||||
uint32_t num_events;
|
||||
struct wmi_fatal_condition_event event[FATAL_EVENTS_MAX];
|
||||
};
|
||||
#endif /* OL_ATH_SMART_LOGGING */
|
||||
|
||||
/**
|
||||
* struct wmi_init_cmd_param - INIT command params
|
||||
* @target_resource_config: pointer to resource config
|
||||
|
@@ -1147,7 +1147,14 @@ QDF_STATUS
|
||||
|
||||
QDF_STATUS (*send_bcn_offload_control_cmd)(wmi_unified_t wmi_handle,
|
||||
struct bcn_offload_control *bcn_ctrl_param);
|
||||
#ifdef OL_ATH_SMART_LOGGING
|
||||
QDF_STATUS
|
||||
(*send_smart_logging_enable_cmd)(wmi_unified_t wmi_handle, uint32_t param);
|
||||
|
||||
QDF_STATUS
|
||||
(*send_smart_logging_fatal_cmd)(wmi_unified_t wmi_handle,
|
||||
struct wmi_debug_fatal_events *param);
|
||||
#endif /* OL_ATH_SMART_LOGGING */
|
||||
QDF_STATUS (*extract_wds_addr_event)(wmi_unified_t wmi_handle,
|
||||
void *evt_buf, uint16_t len, wds_addr_event_t *wds_ev);
|
||||
|
||||
@@ -1366,6 +1373,10 @@ QDF_STATUS (*extract_vdev_nac_rssi_stats)(wmi_unified_t wmi_handle, void *evt_bu
|
||||
QDF_STATUS (*extract_bcn_stats)(wmi_unified_t wmi_handle, void *evt_buf,
|
||||
uint32_t index, wmi_host_bcn_stats *bcn_stats);
|
||||
|
||||
#ifdef OL_ATH_SMART_LOGGING
|
||||
QDF_STATUS (*extract_smartlog_event)(wmi_unified_t wmi_handle, void *evt_buf,
|
||||
struct wmi_debug_fatal_events *event);
|
||||
#endif /* OL_ATH_SMART_LOGGING */
|
||||
QDF_STATUS (*send_power_dbg_cmd)(wmi_unified_t wmi_handle,
|
||||
struct wmi_power_dbg_params *param);
|
||||
|
||||
|
@@ -7355,3 +7355,43 @@ QDF_STATUS wmi_extract_dfs_status_from_fw(void *wmi_hdl, void *evt_buf,
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef OL_ATH_SMART_LOGGING
|
||||
QDF_STATUS wmi_unified_send_smart_logging_enable_cmd(void *wmi_hdl,
|
||||
uint32_t param)
|
||||
{
|
||||
wmi_unified_t wmi_handle = (wmi_unified_t)wmi_hdl;
|
||||
|
||||
if (wmi_handle->ops->send_smart_logging_enable_cmd)
|
||||
return wmi_handle->ops->send_smart_logging_enable_cmd(
|
||||
wmi_handle,
|
||||
param);
|
||||
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
QDF_STATUS
|
||||
wmi_unified_send_smart_logging_fatal_cmd(void *wmi_hdl,
|
||||
struct wmi_debug_fatal_events *param)
|
||||
{
|
||||
wmi_unified_t wmi_handle = (wmi_unified_t)wmi_hdl;
|
||||
|
||||
if (wmi_handle->ops->send_smart_logging_fatal_cmd)
|
||||
return wmi_handle->ops->send_smart_logging_fatal_cmd(wmi_handle,
|
||||
param);
|
||||
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
QDF_STATUS wmi_extract_smartlog_ev(void *wmi_hdl,
|
||||
void *evt_buf,
|
||||
struct wmi_debug_fatal_events *ev)
|
||||
{
|
||||
wmi_unified_t wmi = (wmi_unified_t)wmi_hdl;
|
||||
|
||||
if (wmi->ops->extract_smartlog_event)
|
||||
return wmi->ops->extract_smartlog_event(wmi, evt_buf, ev);
|
||||
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
#endif /* OL_ATH_SMART_LOGGING */
|
||||
|
@@ -5474,6 +5474,90 @@ send_coex_ver_cfg_cmd_non_tlv(wmi_unified_t wmi_handle, coex_ver_cfg_t *param)
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
#ifdef OL_ATH_SMART_LOGGING
|
||||
/**
|
||||
* send_smart_logging_enable_cmd_non_tlv() - send smartlog enable/disable
|
||||
* @wmi_handle: wmi handle
|
||||
* @param: enable/disable
|
||||
*
|
||||
* Return: 0 for success or error code
|
||||
*/
|
||||
static QDF_STATUS
|
||||
send_smart_logging_enable_cmd_non_tlv(wmi_unified_t wmi_handle,
|
||||
unsigned int enable)
|
||||
{
|
||||
wmi_buf_t buf;
|
||||
wmi_smart_logging *cmd;
|
||||
int len = sizeof(wmi_smart_logging);
|
||||
|
||||
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_smart_logging *)wmi_buf_data(buf);
|
||||
cmd->enable = enable;
|
||||
|
||||
if (wmi_unified_cmd_send(wmi_handle, buf, len,
|
||||
WMI_CONFIG_SMART_LOGGING_CMDID)) {
|
||||
wmi_buf_free(buf);
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
* send_smart_logging_fatal_cmd_non_tlv() - send smartlog fatal event
|
||||
* @wmi_handle: wmi handle
|
||||
* @param: number of fatal events
|
||||
* of type struct wmi_debug_fatal_condition_list_t followed by
|
||||
* events of type wmi_fatal_condition
|
||||
*
|
||||
* Return: 0 for success or error code
|
||||
*/
|
||||
|
||||
static QDF_STATUS
|
||||
send_smart_logging_fatal_cmd_non_tlv(wmi_unified_t wmi_handle,
|
||||
struct wmi_debug_fatal_events *param)
|
||||
{
|
||||
wmi_buf_t buf;
|
||||
wmi_debug_fatal_condition_list *list;
|
||||
int len, ev;
|
||||
wmi_fatal_condition *event;
|
||||
|
||||
len = sizeof(wmi_debug_fatal_condition_list) +
|
||||
((param->num_events) * (sizeof(wmi_fatal_condition)));
|
||||
|
||||
buf = wmi_buf_alloc(wmi_handle, len);
|
||||
|
||||
if (!buf) {
|
||||
qdf_print("%s:wmi_buf_alloc failed\n", __func__);
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
list = (wmi_debug_fatal_condition_list *)wmi_buf_data(buf);
|
||||
list->num_events = param->num_events;
|
||||
event = (wmi_fatal_condition *)(list + 1);
|
||||
|
||||
for (ev = 0; ev < param->num_events; ev++) {
|
||||
event[ev].type = param->event[ev].type;
|
||||
event[ev].subtype = param->event[ev].subtype;
|
||||
event[ev].reserved0 = param->event[ev].reserved0;
|
||||
}
|
||||
|
||||
if (wmi_unified_cmd_send(wmi_handle, buf, len,
|
||||
WMI_DEBUG_FATAL_CONDITION_CMDID)) {
|
||||
wmi_buf_free(buf);
|
||||
return QDF_STATUS_E_FAILURE;
|
||||
}
|
||||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
#endif /* OL_ATH_SMART_LOGGING */
|
||||
|
||||
/**
|
||||
* wmi_copy_resource_config_non_tlv() - copy resource configuration function
|
||||
* @param resource_cfg: pointer to resource configuration
|
||||
@@ -8324,6 +8408,41 @@ static QDF_STATUS extract_wds_entry_non_tlv(wmi_unified_t wmi_handle,
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
#ifdef OL_ATH_SMART_LOGGING
|
||||
/**
|
||||
* extract_smartlog_event_non_tlv() - extract smartlog event
|
||||
* from event
|
||||
* @wmi_handle: wmi handle
|
||||
* @param evt_buf: pointer to event buffer
|
||||
* @param atf_token_info: Pointer to hold fatal event
|
||||
*
|
||||
* Return: 0 for success or error code
|
||||
*/
|
||||
static QDF_STATUS extract_smartlog_event_non_tlv
|
||||
(wmi_unified_t wmi_handle,
|
||||
void *evt_buf,
|
||||
struct wmi_debug_fatal_events *evt_list)
|
||||
{
|
||||
uint32_t ev = 0;
|
||||
wmi_fatal_condition *event;
|
||||
wmi_debug_fatal_condition_list *list =
|
||||
(wmi_debug_fatal_condition_list *)evt_buf;
|
||||
|
||||
evt_list->num_events = list->num_events;
|
||||
|
||||
if (evt_list->num_events > FATAL_EVENTS_MAX)
|
||||
return QDF_STATUS_E_INVAL;
|
||||
|
||||
event = (wmi_fatal_condition *)&list[1];
|
||||
|
||||
for (ev = 0; ev < evt_list->num_events; ev++) {
|
||||
evt_list->event[ev].type = event[ev].type;
|
||||
evt_list->event[ev].subtype = event[ev].subtype;
|
||||
evt_list->event[ev].reserved0 = event[ev].reserved0;
|
||||
}
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
#endif /* OL_ATH_SMART_LOGGING */
|
||||
|
||||
static bool is_management_record_non_tlv(uint32_t cmd_id)
|
||||
{
|
||||
@@ -8640,7 +8759,10 @@ struct wmi_ops non_tlv_ops = {
|
||||
.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,
|
||||
|
||||
#ifdef OL_ATH_SMART_LOGGING
|
||||
.send_smart_logging_enable_cmd = send_smart_logging_enable_cmd_non_tlv,
|
||||
.send_smart_logging_fatal_cmd = send_smart_logging_fatal_cmd_non_tlv,
|
||||
#endif
|
||||
.get_target_cap_from_service_ready = extract_service_ready_non_tlv,
|
||||
.extract_fw_version = extract_fw_version_non_tlv,
|
||||
.extract_fw_abi_version = extract_fw_abi_version_non_tlv,
|
||||
@@ -8736,6 +8858,9 @@ struct wmi_ops non_tlv_ops = {
|
||||
.extract_swfda_vdev_id = extract_swfda_vdev_id_non_tlv,
|
||||
#endif /* WLAN_SUPPORT_FILS */
|
||||
.wmi_pdev_id_conversion_enable = wmi_non_tlv_pdev_id_conversion_enable,
|
||||
#ifdef OL_ATH_SMART_LOGGING
|
||||
.extract_smartlog_event = extract_smartlog_event_non_tlv,
|
||||
#endif /* OL_ATH_SMART_LOGGING */
|
||||
#if defined(WLAN_DFS_PARTIAL_OFFLOAD) && defined(HOST_DFS_SPOOF_TEST)
|
||||
.send_dfs_average_radar_params_cmd =
|
||||
send_dfs_average_radar_params_cmd_non_tlv,
|
||||
@@ -8827,7 +8952,10 @@ static void populate_non_tlv_service(uint32_t *wmi_service)
|
||||
WMI_SERVICE_4_WIRE_COEX_SUPPORT;
|
||||
wmi_service[wmi_service_extended_nss_support] =
|
||||
WMI_SERVICE_EXTENDED_NSS_SUPPORT;
|
||||
|
||||
#ifdef OL_ATH_SMART_LOGGING
|
||||
wmi_service[wmi_service_smart_logging_support] =
|
||||
WMI_SERVICE_SMART_LOGGING_SUPPORT;
|
||||
#endif /* OL_ATH_SMART_LOGGING */
|
||||
wmi_service[wmi_service_roam_scan_offload] = WMI_SERVICE_UNAVAILABLE;
|
||||
wmi_service[wmi_service_arpns_offload] = WMI_SERVICE_UNAVAILABLE;
|
||||
wmi_service[wmi_service_nlo] = WMI_SERVICE_UNAVAILABLE;
|
||||
@@ -9035,6 +9163,10 @@ static void populate_non_tlv_events_id(uint32_t *event_ids)
|
||||
event_ids[wmi_pdev_wds_entry_list_event_id] =
|
||||
WMI_PDEV_WDS_ENTRY_LIST_EVENTID;
|
||||
event_ids[wmi_host_swfda_event_id] = WMI_HOST_SWFDA_EVENTID;
|
||||
#ifdef OL_ATH_SMART_LOGGING
|
||||
event_ids[wmi_debug_fatal_condition_eventid] =
|
||||
WMI_DEBUG_FATAL_CONDITION_EVENTID;
|
||||
#endif /* OL_ATH_SMART_LOGGING */
|
||||
#if defined(WLAN_DFS_PARTIAL_OFFLOAD) && defined(HOST_DFS_SPOOF_TEST)
|
||||
event_ids[wmi_host_dfs_status_check_event_id] =
|
||||
WMI_HOST_DFS_STATUS_CHECK_EVENTID;
|
||||
|
Reference in New Issue
Block a user