Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: BSD-3-Clause-Clear */
0002 /*
0003  * Copyright (c) 2018-2019 The Linux Foundation. All rights reserved.
0004  */
0005 
0006 #ifndef _ATH11K_DEBUG_H_
0007 #define _ATH11K_DEBUG_H_
0008 
0009 #include "trace.h"
0010 #include "debugfs.h"
0011 
0012 enum ath11k_debug_mask {
0013     ATH11K_DBG_AHB      = 0x00000001,
0014     ATH11K_DBG_WMI      = 0x00000002,
0015     ATH11K_DBG_HTC      = 0x00000004,
0016     ATH11K_DBG_DP_HTT   = 0x00000008,
0017     ATH11K_DBG_MAC      = 0x00000010,
0018     ATH11K_DBG_BOOT     = 0x00000020,
0019     ATH11K_DBG_QMI      = 0x00000040,
0020     ATH11K_DBG_DATA     = 0x00000080,
0021     ATH11K_DBG_MGMT     = 0x00000100,
0022     ATH11K_DBG_REG      = 0x00000200,
0023     ATH11K_DBG_TESTMODE = 0x00000400,
0024     ATH11k_DBG_HAL      = 0x00000800,
0025     ATH11K_DBG_PCI      = 0x00001000,
0026     ATH11K_DBG_DP_TX    = 0x00002000,
0027     ATH11K_DBG_DP_RX    = 0x00004000,
0028     ATH11K_DBG_ANY      = 0xffffffff,
0029 };
0030 
0031 __printf(2, 3) void ath11k_info(struct ath11k_base *ab, const char *fmt, ...);
0032 __printf(2, 3) void ath11k_err(struct ath11k_base *ab, const char *fmt, ...);
0033 __printf(2, 3) void ath11k_warn(struct ath11k_base *ab, const char *fmt, ...);
0034 
0035 extern unsigned int ath11k_debug_mask;
0036 
0037 #ifdef CONFIG_ATH11K_DEBUG
0038 __printf(3, 4) void __ath11k_dbg(struct ath11k_base *ab,
0039                  enum ath11k_debug_mask mask,
0040                  const char *fmt, ...);
0041 void ath11k_dbg_dump(struct ath11k_base *ab,
0042              enum ath11k_debug_mask mask,
0043              const char *msg, const char *prefix,
0044              const void *buf, size_t len);
0045 #else /* CONFIG_ATH11K_DEBUG */
0046 static inline int __ath11k_dbg(struct ath11k_base *ab,
0047                    enum ath11k_debug_mask dbg_mask,
0048                    const char *fmt, ...)
0049 {
0050     return 0;
0051 }
0052 
0053 static inline void ath11k_dbg_dump(struct ath11k_base *ab,
0054                    enum ath11k_debug_mask mask,
0055                    const char *msg, const char *prefix,
0056                    const void *buf, size_t len)
0057 {
0058 }
0059 #endif /* CONFIG_ATH11K_DEBUG */
0060 
0061 #define ath11k_dbg(ar, dbg_mask, fmt, ...)          \
0062 do {                                \
0063     if ((ath11k_debug_mask & dbg_mask) ||           \
0064         trace_ath11k_log_dbg_enabled())         \
0065         __ath11k_dbg(ar, dbg_mask, fmt, ##__VA_ARGS__); \
0066 } while (0)
0067 
0068 #endif /* _ATH11K_DEBUG_H_ */