debug.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
  2. /* Copyright(c) 2018-2019 Realtek Corporation
  3. */
  4. #ifndef __RTW_DEBUG_H
  5. #define __RTW_DEBUG_H
  6. enum rtw_debug_mask {
  7. RTW_DBG_PCI = 0x00000001,
  8. RTW_DBG_TX = 0x00000002,
  9. RTW_DBG_RX = 0x00000004,
  10. RTW_DBG_PHY = 0x00000008,
  11. RTW_DBG_FW = 0x00000010,
  12. RTW_DBG_EFUSE = 0x00000020,
  13. RTW_DBG_COEX = 0x00000040,
  14. RTW_DBG_RFK = 0x00000080,
  15. RTW_DBG_REGD = 0x00000100,
  16. RTW_DBG_DEBUGFS = 0x00000200,
  17. RTW_DBG_PS = 0x00000400,
  18. RTW_DBG_BF = 0x00000800,
  19. RTW_DBG_WOW = 0x00001000,
  20. RTW_DBG_CFO = 0x00002000,
  21. RTW_DBG_PATH_DIV = 0x00004000,
  22. RTW_DBG_ADAPTIVITY = 0x00008000,
  23. RTW_DBG_HW_SCAN = 0x00010000,
  24. RTW_DBG_STATE = 0x00020000,
  25. RTW_DBG_ALL = 0xffffffff
  26. };
  27. #ifdef CONFIG_RTW88_DEBUGFS
  28. void rtw_debugfs_init(struct rtw_dev *rtwdev);
  29. void rtw_debugfs_get_simple_phy_info(struct seq_file *m);
  30. #else
  31. static inline void rtw_debugfs_init(struct rtw_dev *rtwdev) {}
  32. #endif /* CONFIG_RTW88_DEBUGFS */
  33. #ifdef CONFIG_RTW88_DEBUG
  34. __printf(3, 4)
  35. void __rtw_dbg(struct rtw_dev *rtwdev, enum rtw_debug_mask mask,
  36. const char *fmt, ...);
  37. #define rtw_dbg(rtwdev, a...) __rtw_dbg(rtwdev, ##a)
  38. #else
  39. static inline void rtw_dbg(struct rtw_dev *rtwdev, enum rtw_debug_mask mask,
  40. const char *fmt, ...) {}
  41. #endif /* CONFIG_RTW88_DEBUG */
  42. #define rtw_info(rtwdev, a...) dev_info(rtwdev->dev, ##a)
  43. #define rtw_warn(rtwdev, a...) dev_warn(rtwdev->dev, ##a)
  44. #define rtw_err(rtwdev, a...) dev_err(rtwdev->dev, ##a)
  45. #endif