1 /* SPDX-License-Identifier: BSD-3-Clause-Clear */
3 * Copyright (c) 2018-2019 The Linux Foundation. All rights reserved.
4 * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
7 #ifndef _ATH11K_DEBUG_H_
8 #define _ATH11K_DEBUG_H_
13 enum ath11k_debug_mask {
14 ATH11K_DBG_AHB = 0x00000001,
15 ATH11K_DBG_WMI = 0x00000002,
16 ATH11K_DBG_HTC = 0x00000004,
17 ATH11K_DBG_DP_HTT = 0x00000008,
18 ATH11K_DBG_MAC = 0x00000010,
19 ATH11K_DBG_BOOT = 0x00000020,
20 ATH11K_DBG_QMI = 0x00000040,
21 ATH11K_DBG_DATA = 0x00000080,
22 ATH11K_DBG_MGMT = 0x00000100,
23 ATH11K_DBG_REG = 0x00000200,
24 ATH11K_DBG_TESTMODE = 0x00000400,
25 ATH11K_DBG_HAL = 0x00000800,
26 ATH11K_DBG_PCI = 0x00001000,
27 ATH11K_DBG_DP_TX = 0x00002000,
28 ATH11K_DBG_DP_RX = 0x00004000,
29 ATH11K_DBG_CE = 0x00008000,
32 static inline const char *ath11k_dbg_str(enum ath11k_debug_mask mask)
41 case ATH11K_DBG_DP_HTT:
55 case ATH11K_DBG_TESTMODE:
61 case ATH11K_DBG_DP_TX:
63 case ATH11K_DBG_DP_RX:
68 /* no default handler to allow compiler to check that the
69 * enum is fully handled
76 __printf(2, 3) void ath11k_info(struct ath11k_base *ab, const char *fmt, ...);
77 __printf(2, 3) void ath11k_err(struct ath11k_base *ab, const char *fmt, ...);
78 __printf(2, 3) void ath11k_warn(struct ath11k_base *ab, const char *fmt, ...);
80 extern unsigned int ath11k_debug_mask;
82 #ifdef CONFIG_ATH11K_DEBUG
83 __printf(3, 4) void __ath11k_dbg(struct ath11k_base *ab,
84 enum ath11k_debug_mask mask,
85 const char *fmt, ...);
86 void ath11k_dbg_dump(struct ath11k_base *ab,
87 enum ath11k_debug_mask mask,
88 const char *msg, const char *prefix,
89 const void *buf, size_t len);
90 #else /* CONFIG_ATH11K_DEBUG */
91 static inline int __ath11k_dbg(struct ath11k_base *ab,
92 enum ath11k_debug_mask dbg_mask,
98 static inline void ath11k_dbg_dump(struct ath11k_base *ab,
99 enum ath11k_debug_mask mask,
100 const char *msg, const char *prefix,
101 const void *buf, size_t len)
104 #endif /* CONFIG_ATH11K_DEBUG */
106 #define ath11k_dbg(ar, dbg_mask, fmt, ...) \
108 if ((ath11k_debug_mask & dbg_mask) || \
109 trace_ath11k_log_dbg_enabled()) \
110 __ath11k_dbg(ar, dbg_mask, fmt, ##__VA_ARGS__); \
113 #endif /* _ATH11K_DEBUG_H_ */