1e3037485SYan-Hsuan Chuang /* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
2e3037485SYan-Hsuan Chuang /* Copyright(c) 2018-2019 Realtek Corporation
3e3037485SYan-Hsuan Chuang */
4e3037485SYan-Hsuan Chuang
5e3037485SYan-Hsuan Chuang #ifndef __RTW_DEBUG_H
6e3037485SYan-Hsuan Chuang #define __RTW_DEBUG_H
7e3037485SYan-Hsuan Chuang
8e3037485SYan-Hsuan Chuang enum rtw_debug_mask {
9e3037485SYan-Hsuan Chuang RTW_DBG_PCI = 0x00000001,
10e3037485SYan-Hsuan Chuang RTW_DBG_TX = 0x00000002,
11e3037485SYan-Hsuan Chuang RTW_DBG_RX = 0x00000004,
12e3037485SYan-Hsuan Chuang RTW_DBG_PHY = 0x00000008,
13e3037485SYan-Hsuan Chuang RTW_DBG_FW = 0x00000010,
14e3037485SYan-Hsuan Chuang RTW_DBG_EFUSE = 0x00000020,
15e3037485SYan-Hsuan Chuang RTW_DBG_COEX = 0x00000040,
16e3037485SYan-Hsuan Chuang RTW_DBG_RFK = 0x00000080,
17e3037485SYan-Hsuan Chuang RTW_DBG_REGD = 0x00000100,
18e3037485SYan-Hsuan Chuang RTW_DBG_DEBUGFS = 0x00000200,
1927e117e4SYan-Hsuan Chuang RTW_DBG_PS = 0x00000400,
200bd95573STzu-En Huang RTW_DBG_BF = 0x00000800,
2144bc17f7SChin-Yen Lee RTW_DBG_WOW = 0x00001000,
22fb8517f4SPo-Hao Huang RTW_DBG_CFO = 0x00002000,
231188301fSPo-Hao Huang RTW_DBG_PATH_DIV = 0x00004000,
24fe7bc23aSChin-Yen Lee RTW_DBG_ADAPTIVITY = 0x00008000,
2510d162b2SPo-Hao Huang RTW_DBG_HW_SCAN = 0x00010000,
26a0061be4SPing-Ke Shih RTW_DBG_STATE = 0x00020000,
27*65371a3fSMartin Blumenstingl RTW_DBG_SDIO = 0x00040000,
28e3037485SYan-Hsuan Chuang
29e3037485SYan-Hsuan Chuang RTW_DBG_ALL = 0xffffffff
30e3037485SYan-Hsuan Chuang };
31e3037485SYan-Hsuan Chuang
32e3037485SYan-Hsuan Chuang #ifdef CONFIG_RTW88_DEBUGFS
33e3037485SYan-Hsuan Chuang
34e3037485SYan-Hsuan Chuang void rtw_debugfs_init(struct rtw_dev *rtwdev);
351a589bd5SChing-Te Ku void rtw_debugfs_get_simple_phy_info(struct seq_file *m);
36e3037485SYan-Hsuan Chuang
37e3037485SYan-Hsuan Chuang #else
38e3037485SYan-Hsuan Chuang
rtw_debugfs_init(struct rtw_dev * rtwdev)39e3037485SYan-Hsuan Chuang static inline void rtw_debugfs_init(struct rtw_dev *rtwdev) {}
40e3037485SYan-Hsuan Chuang
41e3037485SYan-Hsuan Chuang #endif /* CONFIG_RTW88_DEBUGFS */
42e3037485SYan-Hsuan Chuang
43e3037485SYan-Hsuan Chuang #ifdef CONFIG_RTW88_DEBUG
44e3037485SYan-Hsuan Chuang
45e3037485SYan-Hsuan Chuang __printf(3, 4)
46e3037485SYan-Hsuan Chuang void __rtw_dbg(struct rtw_dev *rtwdev, enum rtw_debug_mask mask,
47e3037485SYan-Hsuan Chuang const char *fmt, ...);
48e3037485SYan-Hsuan Chuang
49e3037485SYan-Hsuan Chuang #define rtw_dbg(rtwdev, a...) __rtw_dbg(rtwdev, ##a)
50e3037485SYan-Hsuan Chuang
51e3037485SYan-Hsuan Chuang #else
52e3037485SYan-Hsuan Chuang
rtw_dbg(struct rtw_dev * rtwdev,enum rtw_debug_mask mask,const char * fmt,...)53e3037485SYan-Hsuan Chuang static inline void rtw_dbg(struct rtw_dev *rtwdev, enum rtw_debug_mask mask,
54e3037485SYan-Hsuan Chuang const char *fmt, ...) {}
55e3037485SYan-Hsuan Chuang
56e3037485SYan-Hsuan Chuang #endif /* CONFIG_RTW88_DEBUG */
57e3037485SYan-Hsuan Chuang
58e3037485SYan-Hsuan Chuang #define rtw_info(rtwdev, a...) dev_info(rtwdev->dev, ##a)
59e3037485SYan-Hsuan Chuang #define rtw_warn(rtwdev, a...) dev_warn(rtwdev->dev, ##a)
60e3037485SYan-Hsuan Chuang #define rtw_err(rtwdev, a...) dev_err(rtwdev->dev, ##a)
61e3037485SYan-Hsuan Chuang
62e3037485SYan-Hsuan Chuang #endif
63