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, 19*27e117e4SYan-Hsuan Chuang RTW_DBG_PS = 0x00000400, 20e3037485SYan-Hsuan Chuang 21e3037485SYan-Hsuan Chuang RTW_DBG_ALL = 0xffffffff 22e3037485SYan-Hsuan Chuang }; 23e3037485SYan-Hsuan Chuang 24e3037485SYan-Hsuan Chuang #ifdef CONFIG_RTW88_DEBUGFS 25e3037485SYan-Hsuan Chuang 26e3037485SYan-Hsuan Chuang void rtw_debugfs_init(struct rtw_dev *rtwdev); 27e3037485SYan-Hsuan Chuang 28e3037485SYan-Hsuan Chuang #else 29e3037485SYan-Hsuan Chuang 30e3037485SYan-Hsuan Chuang static inline void rtw_debugfs_init(struct rtw_dev *rtwdev) {} 31e3037485SYan-Hsuan Chuang 32e3037485SYan-Hsuan Chuang #endif /* CONFIG_RTW88_DEBUGFS */ 33e3037485SYan-Hsuan Chuang 34e3037485SYan-Hsuan Chuang #ifdef CONFIG_RTW88_DEBUG 35e3037485SYan-Hsuan Chuang 36e3037485SYan-Hsuan Chuang __printf(3, 4) 37e3037485SYan-Hsuan Chuang void __rtw_dbg(struct rtw_dev *rtwdev, enum rtw_debug_mask mask, 38e3037485SYan-Hsuan Chuang const char *fmt, ...); 39e3037485SYan-Hsuan Chuang 40e3037485SYan-Hsuan Chuang #define rtw_dbg(rtwdev, a...) __rtw_dbg(rtwdev, ##a) 41e3037485SYan-Hsuan Chuang 42e3037485SYan-Hsuan Chuang #else 43e3037485SYan-Hsuan Chuang 44e3037485SYan-Hsuan Chuang static inline void rtw_dbg(struct rtw_dev *rtwdev, enum rtw_debug_mask mask, 45e3037485SYan-Hsuan Chuang const char *fmt, ...) {} 46e3037485SYan-Hsuan Chuang 47e3037485SYan-Hsuan Chuang #endif /* CONFIG_RTW88_DEBUG */ 48e3037485SYan-Hsuan Chuang 49e3037485SYan-Hsuan Chuang #define rtw_info(rtwdev, a...) dev_info(rtwdev->dev, ##a) 50e3037485SYan-Hsuan Chuang #define rtw_warn(rtwdev, a...) dev_warn(rtwdev->dev, ##a) 51e3037485SYan-Hsuan Chuang #define rtw_err(rtwdev, a...) dev_err(rtwdev->dev, ##a) 52e3037485SYan-Hsuan Chuang 53e3037485SYan-Hsuan Chuang #endif 54