qcacmn: Enhance MGMT frame logging in WMI
More detailed logging needed for mgmt frames Add vdev_id, frame type, subtype, and channel to logs by defining wrapper function around logging macro and calling it from send_mgmt_cmd_tlv Change-Id: I0c8c26e3194d97be7d903f64c5c5909c2d4b9799 CRs-Fixed: 1011346
This commit is contained in:

committed by
Nandini Suresh

parent
c968be6f73
commit
ac71f152d4
@@ -111,6 +111,11 @@ void *wmi_unified_attach(void *scn_handle,
|
|||||||
osdev_t osdev, enum wmi_target_type target_type,
|
osdev_t osdev, enum wmi_target_type target_type,
|
||||||
bool use_cookie, struct wmi_rx_ops *ops);
|
bool use_cookie, struct wmi_rx_ops *ops);
|
||||||
|
|
||||||
|
|
||||||
|
void wmi_mgmt_cmd_record(wmi_unified_t wmi_handle, WMI_CMD_ID cmd,
|
||||||
|
uint32_t type, uint32_t subtype,
|
||||||
|
uint32_t vdev_id, uint32_t chanfreq);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* detach for unified WMI
|
* detach for unified WMI
|
||||||
*
|
*
|
||||||
|
@@ -76,6 +76,28 @@ struct wmi_event_debug {
|
|||||||
uint64_t time;
|
uint64_t time;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* struct wmi_command_header - Type for accessing frame data
|
||||||
|
* @ type - 802.11 Frame type
|
||||||
|
* @ subType - 802.11 Frame subtype
|
||||||
|
* @ protVer - 802.11 Version
|
||||||
|
*/
|
||||||
|
struct wmi_command_header {
|
||||||
|
#ifndef ANI_LITTLE_BIT_ENDIAN
|
||||||
|
|
||||||
|
uint32_t sub_type:4;
|
||||||
|
uint32_t type:2;
|
||||||
|
uint32_t prot_ver:2;
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
uint32_t prot_ver:2;
|
||||||
|
uint32_t type:2;
|
||||||
|
uint32_t sub_type:4;
|
||||||
|
|
||||||
|
#endif
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* struct wmi_log_buf_t - WMI log buffer information type
|
* struct wmi_log_buf_t - WMI log buffer information type
|
||||||
* @buf - Refernce to WMI log buffer
|
* @buf - Refernce to WMI log buffer
|
||||||
|
@@ -178,25 +178,18 @@ uint32_t g_wmi_mgmt_event_buf_idx = 0;
|
|||||||
struct wmi_event_debug
|
struct wmi_event_debug
|
||||||
wmi_mgmt_event_log_buffer[WMI_MGMT_EVENT_DEBUG_MAX_ENTRY];
|
wmi_mgmt_event_log_buffer[WMI_MGMT_EVENT_DEBUG_MAX_ENTRY];
|
||||||
|
|
||||||
#define WMI_MGMT_COMMAND_RECORD(h, a, b) { \
|
#define WMI_MGMT_COMMAND_RECORD(a, b, c, d, e) { \
|
||||||
if (wmi_mgmt_log_max_entry <= \
|
if (WMI_MGMT_EVENT_DEBUG_MAX_ENTRY <= \
|
||||||
*(h->log_info.wmi_mgmt_command_log_buf_info.p_buf_tail_idx)) \
|
g_wmi_mgmt_command_buf_idx) \
|
||||||
*(h->log_info.wmi_mgmt_command_log_buf_info.p_buf_tail_idx) = 0;\
|
g_wmi_mgmt_command_buf_idx = 0; \
|
||||||
((struct wmi_command_debug *)h->log_info. \
|
wmi_mgmt_command_log_buffer[g_wmi_mgmt_command_buf_idx].command = a; \
|
||||||
wmi_mgmt_command_log_buf_info.buf) \
|
wmi_mgmt_command_log_buffer[g_wmi_mgmt_command_buf_idx].data[0] = b; \
|
||||||
[*(h->log_info.wmi_mgmt_command_log_buf_info.p_buf_tail_idx)].\
|
wmi_mgmt_command_log_buffer[g_wmi_mgmt_command_buf_idx].data[1] = c; \
|
||||||
command = a; \
|
wmi_mgmt_command_log_buffer[g_wmi_mgmt_command_buf_idx].data[2] = d; \
|
||||||
qdf_mem_copy(((struct wmi_command_debug *)h->log_info. \
|
wmi_mgmt_command_log_buffer[g_wmi_mgmt_command_buf_idx].data[3] = e; \
|
||||||
wmi_mgmt_command_log_buf_info.buf) \
|
wmi_mgmt_command_log_buffer[g_wmi_mgmt_command_buf_idx].time = \
|
||||||
[*(h->log_info.wmi_mgmt_command_log_buf_info.p_buf_tail_idx)].\
|
qdf_get_log_timestamp(); \
|
||||||
data, b, \
|
g_wmi_mgmt_command_buf_idx++; \
|
||||||
wmi_record_max_length); \
|
|
||||||
((struct wmi_command_debug *)h->log_info. \
|
|
||||||
wmi_mgmt_command_log_buf_info.buf) \
|
|
||||||
[*(h->log_info.wmi_mgmt_command_log_buf_info.p_buf_tail_idx)].\
|
|
||||||
time = qdf_get_log_timestamp(); \
|
|
||||||
(*(h->log_info.wmi_mgmt_command_log_buf_info.p_buf_tail_idx))++;\
|
|
||||||
h->log_info.wmi_mgmt_command_log_buf_info.length++; \
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#define WMI_MGMT_COMMAND_TX_CMP_RECORD(h, a, b) { \
|
#define WMI_MGMT_COMMAND_TX_CMP_RECORD(h, a, b) { \
|
||||||
@@ -893,6 +886,29 @@ static QDF_STATUS wmi_debugfs_init(wmi_unified_t wmi_handle)
|
|||||||
|
|
||||||
return QDF_STATUS_SUCCESS;
|
return QDF_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* wmi_mgmt_cmd_record() - Wrapper function for mgmt command logging macro
|
||||||
|
*
|
||||||
|
* @wmi_handle: wmi handle
|
||||||
|
* @cmd: mgmt command
|
||||||
|
* @type: 802.11 frame type
|
||||||
|
* @subtype: 802.11 fram subtype
|
||||||
|
* @vdev_id: vdev id
|
||||||
|
* @chanfreq: channel frequency
|
||||||
|
*
|
||||||
|
* Return: none
|
||||||
|
*/
|
||||||
|
void wmi_mgmt_cmd_record(wmi_unified_t wmi_handle, WMI_CMD_ID cmd,
|
||||||
|
uint32_t type, uint32_t subtype,
|
||||||
|
uint32_t vdev_id, uint32_t chanfreq)
|
||||||
|
{
|
||||||
|
qdf_spin_lock_bh(&wmi_handle->log_info.wmi_record_lock);
|
||||||
|
|
||||||
|
WMI_MGMT_COMMAND_RECORD(cmd, type, subtype, vdev_id, chanfreq);
|
||||||
|
|
||||||
|
qdf_spin_unlock_bh(&wmi_handle->log_info.wmi_record_lock);
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
/**
|
/**
|
||||||
* wmi_debugfs_remove() - Remove debugfs entry for wmi logging.
|
* wmi_debugfs_remove() - Remove debugfs entry for wmi logging.
|
||||||
@@ -903,6 +919,9 @@ static QDF_STATUS wmi_debugfs_init(wmi_unified_t wmi_handle)
|
|||||||
* Return: none
|
* Return: none
|
||||||
*/
|
*/
|
||||||
static void wmi_debugfs_remove(wmi_unified_t wmi_handle) { }
|
static void wmi_debugfs_remove(wmi_unified_t wmi_handle) { }
|
||||||
|
void wmi_mgmt_cmd_record(wmi_unified_t wmi_handle, WMI_CMD_ID cmd,
|
||||||
|
uint32_t type, uint32_t subtype,
|
||||||
|
uint32_t vdev_id, uint32_t chanfreq) { }
|
||||||
#endif /*WMI_INTERFACE_EVENT_LOGGING */
|
#endif /*WMI_INTERFACE_EVENT_LOGGING */
|
||||||
|
|
||||||
int wmi_get_host_credits(wmi_unified_t wmi_handle);
|
int wmi_get_host_credits(wmi_unified_t wmi_handle);
|
||||||
@@ -1717,18 +1736,11 @@ int wmi_unified_cmd_send(wmi_unified_t wmi_handle, wmi_buf_t buf, uint32_t len,
|
|||||||
#ifdef WMI_INTERFACE_EVENT_LOGGING
|
#ifdef WMI_INTERFACE_EVENT_LOGGING
|
||||||
if (wmi_handle->log_info.wmi_logging_enable) {
|
if (wmi_handle->log_info.wmi_logging_enable) {
|
||||||
qdf_spin_lock_bh(&wmi_handle->log_info.wmi_record_lock);
|
qdf_spin_lock_bh(&wmi_handle->log_info.wmi_record_lock);
|
||||||
/*Record 16 bytes of WMI cmd data -
|
if (!wmi_handle->log_info.is_management_record(cmd_id)) {
|
||||||
* exclude TLV and WMI headers */
|
|
||||||
if (wmi_handle->log_info.is_management_record(cmd_id)) {
|
|
||||||
WMI_MGMT_COMMAND_RECORD(wmi_handle, cmd_id,
|
|
||||||
((uint32_t *) qdf_nbuf_data(buf) +
|
|
||||||
wmi_handle->log_info.buf_offset_command));
|
|
||||||
} else {
|
|
||||||
WMI_COMMAND_RECORD(wmi_handle, cmd_id,
|
WMI_COMMAND_RECORD(wmi_handle, cmd_id,
|
||||||
((uint32_t *) qdf_nbuf_data(buf) +
|
((uint32_t *) qdf_nbuf_data(buf) +
|
||||||
wmi_handle->log_info.buf_offset_command));
|
wmi_handle->log_info.buf_offset_command));
|
||||||
}
|
}
|
||||||
|
|
||||||
qdf_spin_unlock_bh(&wmi_handle->log_info.wmi_record_lock);
|
qdf_spin_unlock_bh(&wmi_handle->log_info.wmi_record_lock);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@@ -1640,6 +1640,11 @@ QDF_STATUS send_mgmt_cmd_tlv(wmi_unified_t wmi_handle,
|
|||||||
cmd->frame_len = param->frm_len;
|
cmd->frame_len = param->frm_len;
|
||||||
cmd->buf_len = bufp_len;
|
cmd->buf_len = bufp_len;
|
||||||
|
|
||||||
|
wmi_mgmt_cmd_record(wmi_handle, WMI_MGMT_TX_SEND_CMDID,
|
||||||
|
((struct wmi_command_header *)bufp)->type,
|
||||||
|
((struct wmi_command_header *)bufp)->sub_type,
|
||||||
|
cmd->vdev_id, cmd->chanfreq);
|
||||||
|
|
||||||
if (wmi_unified_cmd_send(wmi_handle, buf, cmd_len,
|
if (wmi_unified_cmd_send(wmi_handle, buf, cmd_len,
|
||||||
WMI_MGMT_TX_SEND_CMDID)) {
|
WMI_MGMT_TX_SEND_CMDID)) {
|
||||||
WMI_LOGE("%s: Failed to send mgmt Tx", __func__);
|
WMI_LOGE("%s: Failed to send mgmt Tx", __func__);
|
||||||
|
Reference in New Issue
Block a user