icnss2: Fix incomplete fw_build_id in IPC logs

Fix incomplete fw_build_id in IPC logging due to MAX
character limit. Cleaned up in debug code.

Change-Id: Ia0f104158645e27f774d9598883cfcd8ec765d3c
Signed-off-by: Naman Padhiar <quic_npadhiar@quicinc.com>
This commit is contained in:
Naman Padhiar 2021-10-21 14:28:04 +05:30
commit 6d1ea40ef8
2 changed files with 14 additions and 55 deletions

View file

@ -17,6 +17,7 @@ extern void *icnss_ipc_log_long_context;
extern void *icnss_ipc_log_smp2p_context;
extern void *icnss_ipc_soc_wake_context;
#if IS_ENABLED(CONFIG_IPC_LOGGING)
#define icnss_ipc_log_string(_x...) \
ipc_log_string(icnss_ipc_log_context, _x)
@ -28,6 +29,15 @@ extern void *icnss_ipc_soc_wake_context;
#define icnss_ipc_soc_wake_string(_x...) \
ipc_log_string(icnss_ipc_soc_wake_context, _x)
#else
#define icnss_ipc_log_string(_x...)
#define icnss_ipc_log_long_string(_x...)
#define icnss_ipc_log_smp2p_string(_x...)
#define icnss_ipc_soc_wake_string(_x...)
#endif
#define icnss_pr_err(_fmt, ...) do { \
printk("%s" pr_fmt(_fmt), KERN_ERR, ##__VA_ARGS__); \
@ -47,7 +57,6 @@ extern void *icnss_ipc_soc_wake_context;
##__VA_ARGS__); \
} while (0)
#if defined(CONFIG_DYNAMIC_DEBUG)
#define icnss_pr_dbg(_fmt, ...) do { \
pr_debug(_fmt, ##__VA_ARGS__); \
icnss_ipc_log_string(pr_fmt(_fmt), ##__VA_ARGS__); \
@ -68,58 +77,6 @@ extern void *icnss_ipc_soc_wake_context;
icnss_ipc_soc_wake_string(pr_fmt(_fmt), ##__VA_ARGS__); \
} while (0)
#elif defined(DEBUG)
#define icnss_pr_dbg(_fmt, ...) do { \
printk("%s" pr_fmt(_fmt), KERN_DEBUG, ##__VA_ARGS__); \
icnss_ipc_log_string("%s" pr_fmt(_fmt), "", \
##__VA_ARGS__); \
} while (0)
#define icnss_pr_vdbg(_fmt, ...) do { \
printk("%s" pr_fmt(_fmt), KERN_DEBUG, ##__VA_ARGS__); \
icnss_ipc_log_long_string("%s" pr_fmt(_fmt), "", \
##__VA_ARGS__); \
} while (0)
#define icnss_pr_smp2p(_fmt, ...) do { \
pr_debug(_fmt, ##__VA_ARGS__); \
icnss_ipc_log_smp2p_string("%s" pr_fmt(_fmt), "", \
##__VA_ARGS__); \
} while (0)
#define icnss_pr_soc_wake(_fmt, ...) do { \
pr_debug(_fmt, ##__VA_ARGS__); \
icnss_ipc_soc_wake_string("%s" pr_fmt(_fmt), "", \
##__VA_ARGS__); \
} while (0)
#else
#define icnss_pr_dbg(_fmt, ...) do { \
no_printk("%s" pr_fmt(_fmt), KERN_DEBUG, ##__VA_ARGS__); \
icnss_ipc_log_string("%s" pr_fmt(_fmt), "", \
##__VA_ARGS__); \
} while (0)
#define icnss_pr_vdbg(_fmt, ...) do { \
no_printk("%s" pr_fmt(_fmt), KERN_DEBUG, ##__VA_ARGS__); \
icnss_ipc_log_long_string("%s" pr_fmt(_fmt), "", \
##__VA_ARGS__); \
} while (0)
#define icnss_pr_smp2p(_fmt, ...) do { \
no_printk("%s" pr_fmt(_fmt), KERN_DEBUG, ##__VA_ARGS__); \
icnss_ipc_log_smp2p_string("%s" pr_fmt(_fmt), "", \
##__VA_ARGS__); \
} while (0)
#define icnss_pr_soc_wake(_fmt, ...) do { \
no_printk("%s" pr_fmt(_fmt), KERN_DEBUG, ##__VA_ARGS__); \
icnss_ipc_soc_wake_string("%s" pr_fmt(_fmt), "", \
##__VA_ARGS__); \
} while (0)
#endif
#ifdef CONFIG_ICNSS2_DEBUG
#define ICNSS_ASSERT(_condition) do { \
if (!(_condition)) { \

View file

@ -710,9 +710,11 @@ int wlfw_cap_send_sync_msg(struct icnss_priv *priv)
resp->rd_card_chain_cap == WLFW_RD_CARD_CHAIN_CAP_1x1_V01)
priv->is_chain1_supported = false;
icnss_pr_dbg("Capability, chip_id: 0x%x, chip_family: 0x%x, board_id: 0x%x, soc_id: 0x%x, fw_version: 0x%x, fw_build_timestamp: %s, fw_build_id: %s",
icnss_pr_dbg("Capability, chip_id: 0x%x, chip_family: 0x%x, board_id: 0x%x, soc_id: 0x%x",
priv->chip_info.chip_id, priv->chip_info.chip_family,
priv->board_id, priv->soc_id,
priv->board_id, priv->soc_id);
icnss_pr_dbg("fw_version: 0x%x, fw_build_timestamp: %s, fw_build_id: %s",
priv->fw_version_info.fw_version,
priv->fw_version_info.fw_build_timestamp,
priv->fw_build_id);