0001
0002
0003
0004 #ifndef __RTL_DEBUG_H__
0005 #define __RTL_DEBUG_H__
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025 #define DBG_WARNING 2
0026
0027
0028
0029
0030
0031
0032
0033 #define DBG_DMESG 3
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043 #define DBG_LOUD 4
0044
0045
0046
0047
0048
0049 #define DBG_TRACE 5
0050
0051
0052
0053
0054 #define COMP_ERR BIT(0)
0055 #define COMP_FW BIT(1)
0056 #define COMP_INIT BIT(2)
0057 #define COMP_RECV BIT(3)
0058 #define COMP_SEND BIT(4)
0059 #define COMP_MLME BIT(5)
0060 #define COMP_SCAN BIT(6)
0061 #define COMP_INTR BIT(7)
0062 #define COMP_LED BIT(8)
0063 #define COMP_SEC BIT(9)
0064 #define COMP_BEACON BIT(10)
0065 #define COMP_RATE BIT(11)
0066 #define COMP_RXDESC BIT(12)
0067 #define COMP_DIG BIT(13)
0068 #define COMP_TXAGC BIT(14)
0069 #define COMP_HIPWR BIT(15)
0070 #define COMP_POWER BIT(16)
0071 #define COMP_POWER_TRACKING BIT(17)
0072 #define COMP_BB_POWERSAVING BIT(18)
0073 #define COMP_SWAS BIT(19)
0074 #define COMP_RF BIT(20)
0075 #define COMP_TURBO BIT(21)
0076 #define COMP_RATR BIT(22)
0077 #define COMP_CMD BIT(23)
0078 #define COMP_EFUSE BIT(24)
0079 #define COMP_QOS BIT(25)
0080 #define COMP_MAC80211 BIT(26)
0081 #define COMP_REGD BIT(27)
0082 #define COMP_CHAN BIT(28)
0083 #define COMP_USB BIT(29)
0084 #define COMP_EASY_CONCURRENT COMP_USB
0085 #define COMP_BT_COEXIST BIT(30)
0086 #define COMP_IQK BIT(31)
0087 #define COMP_TX_REPORT BIT_ULL(32)
0088
0089
0090
0091
0092
0093 #define EEPROM_W BIT(0)
0094 #define EFUSE_PG BIT(1)
0095 #define EFUSE_READ_ALL BIT(2)
0096
0097
0098 #define INIT_EEPROM BIT(0)
0099 #define INIT_TXPOWER BIT(1)
0100 #define INIT_IQK BIT(2)
0101 #define INIT_RF BIT(3)
0102
0103
0104 #define PHY_BBR BIT(0)
0105 #define PHY_BBW BIT(1)
0106 #define PHY_RFR BIT(2)
0107 #define PHY_RFW BIT(3)
0108 #define PHY_MACR BIT(4)
0109 #define PHY_MACW BIT(5)
0110 #define PHY_ALLR BIT(6)
0111 #define PHY_ALLW BIT(7)
0112 #define PHY_TXPWR BIT(8)
0113 #define PHY_PWRDIFF BIT(9)
0114
0115
0116 #define WA_IOT BIT(0)
0117 #define DM_PWDB BIT(1)
0118 #define DM_MONITOR BIT(2)
0119 #define DM_DIG BIT(3)
0120 #define DM_EDCA_TURBO BIT(4)
0121
0122 #define DM_PWDB BIT(1)
0123
0124 enum dbgp_flag_e {
0125 FQOS = 0,
0126 FTX = 1,
0127 FRX = 2,
0128 FSEC = 3,
0129 FMGNT = 4,
0130 FMLME = 5,
0131 FRESOURCE = 6,
0132 FBEACON = 7,
0133 FISR = 8,
0134 FPHY = 9,
0135 FMP = 10,
0136 FEEPROM = 11,
0137 FPWR = 12,
0138 FDM = 13,
0139 FDBGCTRL = 14,
0140 FC2H = 15,
0141 FBT = 16,
0142 FINIT = 17,
0143 FIOCTL = 18,
0144 DBGP_TYPE_MAX
0145 };
0146
0147 #ifdef CONFIG_RTLWIFI_DEBUG
0148
0149 struct rtl_priv;
0150
0151 __printf(4, 5)
0152 void _rtl_dbg_print(struct rtl_priv *rtlpriv, u64 comp, int level,
0153 const char *fmt, ...);
0154
0155 void _rtl_dbg_print_data(struct rtl_priv *rtlpriv, u64 comp, int level,
0156 const char *titlestring,
0157 const void *hexdata, int hexdatalen);
0158
0159 #define rtl_dbg(rtlpriv, comp, level, fmt, ...) \
0160 _rtl_dbg_print(rtlpriv, comp, level, \
0161 fmt, ##__VA_ARGS__)
0162
0163 #define RTPRINT(rtlpriv, dbgtype, dbgflag, fmt, ...) \
0164 _rtl_dbg_print(rtlpriv, dbgtype, dbgflag, fmt, ##__VA_ARGS__)
0165
0166 #define RT_PRINT_DATA(rtlpriv, _comp, _level, _titlestring, _hexdata, \
0167 _hexdatalen) \
0168 _rtl_dbg_print_data(rtlpriv, _comp, _level, \
0169 _titlestring, _hexdata, _hexdatalen)
0170
0171 #else
0172
0173 struct rtl_priv;
0174
0175 __printf(4, 5)
0176 static inline void rtl_dbg(struct rtl_priv *rtlpriv,
0177 u64 comp, int level,
0178 const char *fmt, ...)
0179 {
0180 }
0181
0182 __printf(4, 5)
0183 static inline void RTPRINT(struct rtl_priv *rtlpriv,
0184 int dbgtype, int dbgflag,
0185 const char *fmt, ...)
0186 {
0187 }
0188
0189 static inline void RT_PRINT_DATA(struct rtl_priv *rtlpriv,
0190 u64 comp, int level,
0191 const char *titlestring,
0192 const void *hexdata, size_t hexdatalen)
0193 {
0194 }
0195
0196 #endif
0197
0198 #ifdef CONFIG_RTLWIFI_DEBUG
0199 void rtl_debug_add_one(struct ieee80211_hw *hw);
0200 void rtl_debug_remove_one(struct ieee80211_hw *hw);
0201 void rtl_debugfs_add_topdir(void);
0202 void rtl_debugfs_remove_topdir(void);
0203 #else
0204 #define rtl_debug_add_one(hw)
0205 #define rtl_debug_remove_one(hw)
0206 #define rtl_debugfs_add_topdir()
0207 #define rtl_debugfs_remove_topdir()
0208 #endif
0209 #endif