qcacmn: Call log handler in case of HTT command/event

htt_command_record, htt_event_record, htt_wbm_event_record
function is used to log command,event, wbm event to
in-memory data-structure.
We call these function from htt path.

Change-Id: Ib3e18b895485c84f0010f8c3ba95c2da85b00bde
CRs-Fixed: 2428742
This commit is contained in:
Ankit Kumar
2019-04-29 15:32:49 +05:30
committed by nshrivas
parent b2569fd660
commit 0ead45c2d7
4 changed files with 87 additions and 13 deletions

View File

@@ -43,12 +43,6 @@
#define HTT_PID_BIT_MASK 0x3 #define HTT_PID_BIT_MASK 0x3
#define DP_EXT_MSG_LENGTH 2048 #define DP_EXT_MSG_LENGTH 2048
#define DP_HTT_SEND_HTC_PKT(soc, pkt) \
do { \
if (htc_send_pkt(soc->htc_soc, &pkt->htc_pkt) == \
QDF_STATUS_SUCCESS) \
htt_htc_misc_pkt_list_add(soc, pkt); \
} while (0)
#define HTT_MGMT_CTRL_TLV_HDR_RESERVERD_LEN 16 #define HTT_MGMT_CTRL_TLV_HDR_RESERVERD_LEN 16
@@ -391,6 +385,28 @@ htt_htc_misc_pkt_list_add(struct htt_soc *soc, struct dp_htt_htc_pkt *pkt)
htt_htc_misc_pkt_list_trim(soc, misclist_trim_level); htt_htc_misc_pkt_list_trim(soc, misclist_trim_level);
} }
/**
* DP_HTT_SEND_HTC_PKT() - Send htt packet from host
* @soc : HTT SOC handle
* @pkt: pkt to be send
* @cmd : command to be recorded in dp htt logger
* @buf : Pointer to buffer needs to be recored for above cmd
* Note: Changed from macro function to statis inline function
* due to error reported by checkpatch for multiple use
* of same variable.
*
* Return: None
*/
static inline void DP_HTT_SEND_HTC_PKT(struct htt_soc *soc,
struct dp_htt_htc_pkt *pkt, uint8_t cmd,
uint8_t *buf)
{
htt_command_record(soc->htt_logger_handle, cmd, buf);
if (htc_send_pkt(soc->htc_soc, &pkt->htc_pkt) ==
QDF_STATUS_SUCCESS)
htt_htc_misc_pkt_list_add(soc, pkt);
}
/* /*
* htt_htc_misc_pkt_pool_free() - free pkts in misc list * htt_htc_misc_pkt_pool_free() - free pkts in misc list
* @htt_soc: HTT SOC handle * @htt_soc: HTT SOC handle
@@ -554,7 +570,7 @@ static int htt_h2t_ver_req_msg(struct htt_soc *soc)
1); /* tag - not relevant here */ 1); /* tag - not relevant here */
SET_HTC_PACKET_NET_BUF_CONTEXT(&pkt->htc_pkt, msg); SET_HTC_PACKET_NET_BUF_CONTEXT(&pkt->htc_pkt, msg);
DP_HTT_SEND_HTC_PKT(soc, pkt); DP_HTT_SEND_HTC_PKT(soc, pkt, HTT_H2T_MSG_TYPE_VERSION_REQ, NULL);
return 0; return 0;
} }
@@ -579,6 +595,7 @@ int htt_srng_setup(void *htt_soc, int mac_id, void *hal_srng,
uint32_t ring_entry_size = uint32_t ring_entry_size =
hal_srng_get_entrysize(soc->hal_soc, hal_ring_type); hal_srng_get_entrysize(soc->hal_soc, hal_ring_type);
int htt_ring_type, htt_ring_id; int htt_ring_type, htt_ring_id;
uint8_t *htt_logger_bufp;
/* Sizes should be set in 4-byte words */ /* Sizes should be set in 4-byte words */
ring_entry_size = ring_entry_size >> 2; ring_entry_size = ring_entry_size >> 2;
@@ -682,6 +699,7 @@ int htt_srng_setup(void *htt_soc, int mac_id, void *hal_srng,
/* word 0 */ /* word 0 */
*msg_word = 0; *msg_word = 0;
htt_logger_bufp = (uint8_t *)msg_word;
HTT_H2T_MSG_TYPE_SET(*msg_word, HTT_H2T_MSG_TYPE_SRING_SETUP); HTT_H2T_MSG_TYPE_SET(*msg_word, HTT_H2T_MSG_TYPE_SRING_SETUP);
if ((htt_ring_type == HTT_SW_TO_HW_RING) || if ((htt_ring_type == HTT_SW_TO_HW_RING) ||
@@ -809,7 +827,8 @@ int htt_srng_setup(void *htt_soc, int mac_id, void *hal_srng,
HTC_TX_PACKET_TAG_RUNTIME_PUT); /* tag for no FW response msg */ HTC_TX_PACKET_TAG_RUNTIME_PUT); /* tag for no FW response msg */
SET_HTC_PACKET_NET_BUF_CONTEXT(&pkt->htc_pkt, htt_msg); SET_HTC_PACKET_NET_BUF_CONTEXT(&pkt->htc_pkt, htt_msg);
DP_HTT_SEND_HTC_PKT(soc, pkt); DP_HTT_SEND_HTC_PKT(soc, pkt, HTT_H2T_MSG_TYPE_SRING_SETUP,
htt_logger_bufp);
return QDF_STATUS_SUCCESS; return QDF_STATUS_SUCCESS;
@@ -841,6 +860,7 @@ int htt_h2t_rx_ring_cfg(void *htt_soc, int pdev_id, void *hal_srng,
struct hal_srng_params srng_params; struct hal_srng_params srng_params;
uint32_t htt_ring_type, htt_ring_id; uint32_t htt_ring_type, htt_ring_id;
uint32_t tlv_filter; uint32_t tlv_filter;
uint8_t *htt_logger_bufp;
htt_msg = qdf_nbuf_alloc(soc->osdev, htt_msg = qdf_nbuf_alloc(soc->osdev,
HTT_MSG_BUF_SIZE(HTT_RX_RING_SELECTION_CFG_SZ), HTT_MSG_BUF_SIZE(HTT_RX_RING_SELECTION_CFG_SZ),
@@ -902,6 +922,7 @@ int htt_h2t_rx_ring_cfg(void *htt_soc, int pdev_id, void *hal_srng,
qdf_nbuf_push_head(htt_msg, HTC_HDR_ALIGNMENT_PADDING); qdf_nbuf_push_head(htt_msg, HTC_HDR_ALIGNMENT_PADDING);
/* word 0 */ /* word 0 */
htt_logger_bufp = (uint8_t *)msg_word;
*msg_word = 0; *msg_word = 0;
HTT_H2T_MSG_TYPE_SET(*msg_word, HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG); HTT_H2T_MSG_TYPE_SET(*msg_word, HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG);
@@ -1511,7 +1532,8 @@ int htt_h2t_rx_ring_cfg(void *htt_soc, int pdev_id, void *hal_srng,
1); /* tag - not relevant here */ 1); /* tag - not relevant here */
SET_HTC_PACKET_NET_BUF_CONTEXT(&pkt->htc_pkt, htt_msg); SET_HTC_PACKET_NET_BUF_CONTEXT(&pkt->htc_pkt, htt_msg);
DP_HTT_SEND_HTC_PKT(soc, pkt); DP_HTT_SEND_HTC_PKT(soc, pkt, HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG,
htt_logger_bufp);
return QDF_STATUS_SUCCESS; return QDF_STATUS_SUCCESS;
fail1: fail1:
@@ -3197,6 +3219,8 @@ static void dp_htt_t2h_msg_handler(void *context, HTC_PACKET *pkt)
msg_word = (u_int32_t *) qdf_nbuf_data(htt_t2h_msg); msg_word = (u_int32_t *) qdf_nbuf_data(htt_t2h_msg);
msg_type = HTT_T2H_MSG_TYPE_GET(*msg_word); msg_type = HTT_T2H_MSG_TYPE_GET(*msg_word);
htt_event_record(soc->htt_logger_handle,
msg_type, (uint8_t *)msg_word);
switch (msg_type) { switch (msg_type) {
case HTT_T2H_MSG_TYPE_PEER_MAP: case HTT_T2H_MSG_TYPE_PEER_MAP:
{ {
@@ -3508,6 +3532,8 @@ htt_htc_soc_attach(struct htt_soc *soc)
soc->htc_endpoint = response.Endpoint; soc->htc_endpoint = response.Endpoint;
hif_save_htc_htt_config_endpoint(dpsoc->hif_handle, soc->htc_endpoint); hif_save_htc_htt_config_endpoint(dpsoc->hif_handle, soc->htc_endpoint);
htt_interface_logging_init(&soc->htt_logger_handle);
dp_hif_update_pipe_callback(soc->dp_soc, (void *)soc, dp_hif_update_pipe_callback(soc->dp_soc, (void *)soc,
dp_htt_hif_t2h_hp_callback, DP_HTT_T2H_HP_PIPE); dp_htt_hif_t2h_hp_callback, DP_HTT_T2H_HP_PIPE);
@@ -3546,6 +3572,7 @@ fail2:
void htt_soc_htc_dealloc(struct htt_soc *htt_handle) void htt_soc_htc_dealloc(struct htt_soc *htt_handle)
{ {
htt_interface_logging_deinit(htt_handle->htt_logger_handle);
htt_htc_misc_pkt_pool_free(htt_handle); htt_htc_misc_pkt_pool_free(htt_handle);
htt_htc_pkt_pool_free(htt_handle); htt_htc_pkt_pool_free(htt_handle);
} }
@@ -3611,6 +3638,7 @@ QDF_STATUS dp_h2t_ext_stats_msg_send(struct dp_pdev *pdev,
qdf_nbuf_t msg; qdf_nbuf_t msg;
uint32_t *msg_word; uint32_t *msg_word;
uint8_t pdev_mask = 0; uint8_t pdev_mask = 0;
uint8_t *htt_logger_bufp;
msg = qdf_nbuf_alloc( msg = qdf_nbuf_alloc(
soc->osdev, soc->osdev,
@@ -3652,6 +3680,7 @@ QDF_STATUS dp_h2t_ext_stats_msg_send(struct dp_pdev *pdev,
msg_word = (uint32_t *) qdf_nbuf_data(msg); msg_word = (uint32_t *) qdf_nbuf_data(msg);
qdf_nbuf_push_head(msg, HTC_HDR_ALIGNMENT_PADDING); qdf_nbuf_push_head(msg, HTC_HDR_ALIGNMENT_PADDING);
htt_logger_bufp = (uint8_t *)msg_word;
*msg_word = 0; *msg_word = 0;
HTT_H2T_MSG_TYPE_SET(*msg_word, HTT_H2T_MSG_TYPE_EXT_STATS_REQ); HTT_H2T_MSG_TYPE_SET(*msg_word, HTT_H2T_MSG_TYPE_EXT_STATS_REQ);
HTT_H2T_EXT_STATS_REQ_PDEV_MASK_SET(*msg_word, pdev_mask); HTT_H2T_EXT_STATS_REQ_PDEV_MASK_SET(*msg_word, pdev_mask);
@@ -3709,7 +3738,8 @@ QDF_STATUS dp_h2t_ext_stats_msg_send(struct dp_pdev *pdev,
1); /* tag - not relevant here */ 1); /* tag - not relevant here */
SET_HTC_PACKET_NET_BUF_CONTEXT(&pkt->htc_pkt, msg); SET_HTC_PACKET_NET_BUF_CONTEXT(&pkt->htc_pkt, msg);
DP_HTT_SEND_HTC_PKT(soc, pkt); DP_HTT_SEND_HTC_PKT(soc, pkt, HTT_H2T_MSG_TYPE_EXT_STATS_REQ,
htt_logger_bufp);
return 0; return 0;
} }
@@ -3794,7 +3824,8 @@ QDF_STATUS dp_h2t_cfg_stats_msg_send(struct dp_pdev *pdev,
1); /* tag - not relevant here */ 1); /* tag - not relevant here */
SET_HTC_PACKET_NET_BUF_CONTEXT(&pkt->htc_pkt, msg); SET_HTC_PACKET_NET_BUF_CONTEXT(&pkt->htc_pkt, msg);
DP_HTT_SEND_HTC_PKT(soc, pkt); DP_HTT_SEND_HTC_PKT(soc, pkt, HTT_H2T_MSG_TYPE_PPDU_STATS_CFG,
(uint8_t *)msg_word);
return 0; return 0;
} }
#endif #endif

View File

@@ -26,6 +26,42 @@
#include "cdp_txrx_cmn_struct.h" #include "cdp_txrx_cmn_struct.h"
#include "dp_types.h" #include "dp_types.h"
#ifdef HTT_LOGGER
#include "dp_htt_logger.h"
#else
struct htt_logger;
static inline
void htt_interface_logging_init(struct htt_logger **htt_logger_handle)
{
}
static inline
void htt_interface_logging_deinit(struct htt_logger *htt_logger_handle)
{
}
static inline
int htt_command_record(struct htt_logger *h, uint8_t msg_type,
uint8_t *msg_data)
{
return 0;
}
static inline
int htt_event_record(struct htt_logger *h, uint8_t msg_type,
uint8_t *msg_data)
{
return 0;
}
static inline
int htt_wbm_event_record(struct htt_logger *h, uint8_t tx_status,
uint8_t *msg_data)
{
return 0;
}
#endif
#define HTT_TX_MUTEX_TYPE qdf_spinlock_t #define HTT_TX_MUTEX_TYPE qdf_spinlock_t
@@ -81,6 +117,8 @@ struct htt_soc {
void *ctrl_psoc; void *ctrl_psoc;
void *dp_soc; void *dp_soc;
void *hal_soc; void *hal_soc;
/* htt_logger handle */
struct htt_logger *htt_logger_handle;
HTC_HANDLE htc_soc; HTC_HANDLE htc_soc;
qdf_device_t osdev; qdf_device_t osdev;
HTC_ENDPOINT_ID htc_endpoint; HTC_ENDPOINT_ID htc_endpoint;

View File

@@ -17,6 +17,7 @@
*/ */
#include "htt.h" #include "htt.h"
#include "dp_htt.h"
#include "hal_hw_headers.h" #include "hal_hw_headers.h"
#include "dp_tx.h" #include "dp_tx.h"
#include "dp_tx_desc.h" #include "dp_tx_desc.h"
@@ -3187,6 +3188,7 @@ void dp_tx_process_htt_completion(struct dp_tx_desc_s *tx_desc, uint8_t *status,
uint32_t *htt_desc = (uint32_t *)status; uint32_t *htt_desc = (uint32_t *)status;
struct dp_peer *peer; struct dp_peer *peer;
struct cdp_tid_tx_stats *tid_stats = NULL; struct cdp_tid_tx_stats *tid_stats = NULL;
struct htt_soc *htt_handle;
qdf_assert(tx_desc->pdev); qdf_assert(tx_desc->pdev);
@@ -3196,8 +3198,9 @@ void dp_tx_process_htt_completion(struct dp_tx_desc_s *tx_desc, uint8_t *status,
if (!vdev) if (!vdev)
return; return;
tx_status = HTT_TX_WBM_COMPLETION_V2_TX_STATUS_GET(htt_desc[0]); tx_status = HTT_TX_WBM_COMPLETION_V2_TX_STATUS_GET(htt_desc[0]);
htt_handle = (struct htt_soc *)soc->htt_handle;
htt_wbm_event_record(htt_handle->htt_logger_handle, tx_status, status);
switch (tx_status) { switch (tx_status) {
case HTT_TX_FW2WBM_TX_STATUS_OK: case HTT_TX_FW2WBM_TX_STATUS_OK:

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2017-2018 The Linux Foundation. All rights reserved. * Copyright (c) 2017-2019 The Linux Foundation. All rights reserved.
* *
* Permission to use, copy, modify, and/or distribute this software for * Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the * any purpose with or without fee is hereby granted, provided that the
@@ -165,6 +165,8 @@ void qdf_debugfs_printf(qdf_debugfs_file_t file, const char *f, ...)
va_end(args); va_end(args);
} }
qdf_export_symbol(qdf_debugfs_printf);
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 0)) #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 0))
void qdf_debugfs_hexdump(qdf_debugfs_file_t file, const uint8_t *buf, void qdf_debugfs_hexdump(qdf_debugfs_file_t file, const uint8_t *buf,