1
2
3
4
5
6
7
8
9
10
11
12
13
14#ifndef __RTL_DEBUG_H__
15#define __RTL_DEBUG_H__
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34#define DBG_WARNING 2
35
36
37
38
39
40
41#define DBG_DMESG 3
42
43
44
45
46
47
48
49
50#define DBG_LOUD 4
51
52
53
54
55#define DBG_TRACE 5
56
57
58
59
60
61#define COMP_ERR BIT(0)
62#define COMP_FW BIT(1)
63#define COMP_INIT BIT(2)
64#define COMP_RECV BIT(3)
65#define COMP_SEND BIT(4)
66#define COMP_MLME BIT(5)
67#define COMP_SCAN BIT(6)
68#define COMP_INTR BIT(7)
69#define COMP_LED BIT(8)
70#define COMP_SEC BIT(9)
71#define COMP_BEACON BIT(10)
72#define COMP_RATE BIT(11)
73#define COMP_RXDESC BIT(12)
74#define COMP_DIG BIT(13)
75#define COMP_TXAGC BIT(14)
76#define COMP_HIPWR BIT(15)
77#define COMP_POWER BIT(16)
78#define COMP_POWER_TRACKING BIT(17)
79#define COMP_BB_POWERSAVING BIT(18)
80#define COMP_SWAS BIT(19)
81#define COMP_RF BIT(20)
82#define COMP_TURBO BIT(21)
83#define COMP_RATR BIT(22)
84#define COMP_CMD BIT(23)
85#define COMP_EFUSE BIT(24)
86#define COMP_QOS BIT(25)
87#define COMP_MAC80211 BIT(26)
88#define COMP_REGD BIT(27)
89#define COMP_CHAN BIT(28)
90#define COMP_USB BIT(29)
91#define COMP_EASY_CONCURRENT COMP_USB
92#define COMP_BT_COEXIST BIT(30)
93#define COMP_IQK BIT(31)
94#define COMP_TX_REPORT BIT_ULL(32)
95#define COMP_HALMAC BIT_ULL(34)
96#define COMP_PHYDM BIT_ULL(35)
97
98
99
100
101
102
103#define EEPROM_W BIT(0)
104#define EFUSE_PG BIT(1)
105#define EFUSE_READ_ALL BIT(2)
106
107
108#define INIT_EEPROM BIT(0)
109#define INIT_TXPOWER BIT(1)
110#define INIT_IQK BIT(2)
111#define INIT_RF BIT(3)
112
113
114#define PHY_BBR BIT(0)
115#define PHY_BBW BIT(1)
116#define PHY_RFR BIT(2)
117#define PHY_RFW BIT(3)
118#define PHY_MACR BIT(4)
119#define PHY_MACW BIT(5)
120#define PHY_ALLR BIT(6)
121#define PHY_ALLW BIT(7)
122#define PHY_TXPWR BIT(8)
123#define PHY_PWRDIFF BIT(9)
124
125
126#define WA_IOT BIT(0)
127#define DM_PWDB BIT(1)
128#define DM_MONITOR BIT(2)
129#define DM_DIG BIT(3)
130#define DM_EDCA_TURBO BIT(4)
131
132#define DM_PWDB BIT(1)
133
134enum dbgp_flag_e {
135 FQOS = 0,
136 FTX = 1,
137 FRX = 2,
138 FSEC = 3,
139 FMGNT = 4,
140 FMLME = 5,
141 FRESOURCE = 6,
142 FBEACON = 7,
143 FISR = 8,
144 FPHY = 9,
145 FMP = 10,
146 FEEPROM = 11,
147 FPWR = 12,
148 FDM = 13,
149 FDBGCTRL = 14,
150 FC2H = 15,
151 FBT = 16,
152 FINIT = 17,
153 FIOCTL = 18,
154 DBGP_TYPE_MAX
155};
156
157#ifdef CONFIG_RTLWIFI_DEBUG_ST
158
159struct rtl_priv;
160
161__printf(4, 5)
162void _rtl_dbg_trace(struct rtl_priv *rtlpriv, u64 comp, int level,
163 const char *fmt, ...);
164
165__printf(4, 5)
166void _rtl_dbg_print(struct rtl_priv *rtlpriv, u64 comp, int level,
167 const char *fmt, ...);
168
169void _rtl_dbg_print_data(struct rtl_priv *rtlpriv, u64 comp, int level,
170 const char *titlestring,
171 const void *hexdata, int hexdatalen);
172
173#define RT_TRACE(rtlpriv, comp, level, fmt, ...) \
174 _rtl_dbg_trace(rtlpriv, comp, level, \
175 fmt, ##__VA_ARGS__)
176
177#define RTPRINT(rtlpriv, dbgtype, dbgflag, fmt, ...) \
178 _rtl_dbg_print(rtlpriv, dbgtype, dbgflag, fmt, ##__VA_ARGS__)
179
180#define RT_PRINT_DATA(rtlpriv, _comp, _level, _titlestring, _hexdata, \
181 _hexdatalen) \
182 _rtl_dbg_print_data(rtlpriv, _comp, _level, \
183 _titlestring, _hexdata, _hexdatalen)
184
185#else
186
187struct rtl_priv;
188
189__printf(4, 5)
190static inline void RT_TRACE(struct rtl_priv *rtlpriv,
191 u64 comp, int level,
192 const char *fmt, ...)
193{
194}
195
196__printf(4, 5)
197static inline void RTPRINT(struct rtl_priv *rtlpriv,
198 int dbgtype, int dbgflag,
199 const char *fmt, ...)
200{
201}
202
203static inline void RT_PRINT_DATA(struct rtl_priv *rtlpriv,
204 u64 comp, int level,
205 const char *titlestring,
206 const void *hexdata, size_t hexdatalen)
207{
208}
209
210#endif
211
212#ifdef CONFIG_RTLWIFI_DEBUG_ST
213void rtl_debug_add_one(struct ieee80211_hw *hw);
214void rtl_debug_remove_one(struct ieee80211_hw *hw);
215void rtl_debugfs_add_topdir(void);
216void rtl_debugfs_remove_topdir(void);
217#else
218#define rtl_debug_add_one(hw)
219#define rtl_debug_remove_one(hw)
220#define rtl_debugfs_add_topdir()
221#define rtl_debugfs_remove_topdir()
222#endif
223#endif
224