1 /* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
2 /* Copyright(c) 2007 - 2011 Realtek Corporation. */
4 #ifndef __RTW_DEBUG_H__
5 #define __RTW_DEBUG_H__
7 #include "osdep_service.h"
10 #define _drv_always_ 1
15 #define _drv_warning_ 6
16 #define _drv_notice_ 7
20 #define _module_rtl871x_xmit_c_ BIT(0)
21 #define _module_xmit_osdep_c_ BIT(1)
22 #define _module_rtl871x_recv_c_ BIT(2)
23 #define _module_recv_osdep_c_ BIT(3)
24 #define _module_rtl871x_mlme_c_ BIT(4)
25 #define _module_mlme_osdep_c_ BIT(5)
26 #define _module_rtl871x_sta_mgt_c_ BIT(6)
27 #define _module_rtl871x_cmd_c_ BIT(7)
28 #define _module_cmd_osdep_c_ BIT(8)
29 #define _module_rtl871x_io_c_ BIT(9)
30 #define _module_io_osdep_c_ BIT(10)
31 #define _module_os_intfs_c_ BIT(11)
32 #define _module_rtl871x_security_c_ BIT(12)
33 #define _module_rtl871x_eeprom_c_ BIT(13)
34 #define _module_hal_init_c_ BIT(14)
35 #define _module_hci_hal_init_c_ BIT(15)
36 #define _module_rtl871x_ioctl_c_ BIT(16)
37 #define _module_rtl871x_ioctl_set_c_ BIT(17)
38 #define _module_rtl871x_ioctl_query_c_ BIT(18)
39 #define _module_rtl871x_pwrctrl_c_ BIT(19)
40 #define _module_hci_intfs_c_ BIT(20)
41 #define _module_hci_ops_c_ BIT(21)
42 #define _module_osdep_service_c_ BIT(22)
43 #define _module_mp_ BIT(23)
44 #define _module_hci_ops_os_c_ BIT(24)
45 #define _module_rtl871x_ioctl_os_c BIT(25)
46 #define _module_rtl8712_cmd_c_ BIT(26)
47 #define _module_rtl8192c_xmit_c_ BIT(27)
48 #define _module_hal_xmit_c_ BIT(28)
49 #define _module_efuse_ BIT(29)
50 #define _module_rtl8712_recv_c_ BIT(30)
51 #define _module_rtl8712_led_c_ BIT(31)
53 #define DRIVER_PREFIX "R8188EU: "
55 extern u32 GlobalDebugLevel;
57 #define DBG_88E_LEVEL(_level, fmt, arg...) \
59 if (_level <= GlobalDebugLevel) \
60 pr_info(DRIVER_PREFIX"INFO " fmt, ##arg); \
63 #define DBG_88E(...) \
65 if (_drv_err_ <= GlobalDebugLevel) \
66 pr_info(DRIVER_PREFIX __VA_ARGS__); \
69 #define MSG_88E(...) \
71 if (_drv_err_ <= GlobalDebugLevel) \
72 pr_info(DRIVER_PREFIX __VA_ARGS__); \
75 #define RT_TRACE(_comp, _level, fmt) \
77 if (_level <= GlobalDebugLevel) { \
78 pr_info("%s [0x%08x,%d]", DRIVER_PREFIX, \
79 (unsigned int)_comp, _level); \
84 #define RT_PRINT_DATA(_comp, _level, _titlestring, _hexdata, _hexdatalen)\
86 if (_level <= GlobalDebugLevel) { \
88 u8 *ptr = (u8 *)_hexdata; \
89 pr_info("%s", DRIVER_PREFIX); \
90 pr_info(_titlestring); \
91 for (__i = 0; __i < (int)_hexdatalen; __i++ ) { \
92 pr_info("%02X%s", ptr[__i], \
93 (((__i + 1) % 4) == 0) ? \
95 if (((__i + 1) % 16) == 0) \
102 int proc_get_drv_version(char *page, char **start,
103 off_t offset, int count,
104 int *eof, void *data);
106 int proc_get_write_reg(char *page, char **start,
107 off_t offset, int count,
108 int *eof, void *data);
110 int proc_set_write_reg(struct file *file, const char __user *buffer,
111 unsigned long count, void *data);
112 int proc_get_read_reg(char *page, char **start,
113 off_t offset, int count,
114 int *eof, void *data);
116 int proc_set_read_reg(struct file *file, const char __user *buffer,
117 unsigned long count, void *data);
119 int proc_get_fwstate(char *page, char **start,
120 off_t offset, int count,
121 int *eof, void *data);
122 int proc_get_sec_info(char *page, char **start,
123 off_t offset, int count,
124 int *eof, void *data);
125 int proc_get_mlmext_state(char *page, char **start,
126 off_t offset, int count,
127 int *eof, void *data);
129 int proc_get_qos_option(char *page, char **start,
130 off_t offset, int count,
131 int *eof, void *data);
132 int proc_get_ht_option(char *page, char **start,
133 off_t offset, int count,
134 int *eof, void *data);
135 int proc_get_rf_info(char *page, char **start,
136 off_t offset, int count,
137 int *eof, void *data);
138 int proc_get_ap_info(char *page, char **start,
139 off_t offset, int count,
140 int *eof, void *data);
142 int proc_get_adapter_state(char *page, char **start,
143 off_t offset, int count,
144 int *eof, void *data);
146 int proc_get_trx_info(char *page, char **start,
147 off_t offset, int count,
148 int *eof, void *data);
150 int proc_get_mac_reg_dump1(char *page, char **start,
151 off_t offset, int count,
152 int *eof, void *data);
154 int proc_get_mac_reg_dump2(char *page, char **start,
155 off_t offset, int count,
156 int *eof, void *data);
158 int proc_get_mac_reg_dump3(char *page, char **start,
159 off_t offset, int count,
160 int *eof, void *data);
162 int proc_get_bb_reg_dump1(char *page, char **start,
163 off_t offset, int count,
164 int *eof, void *data);
166 int proc_get_bb_reg_dump2(char *page, char **start,
167 off_t offset, int count,
168 int *eof, void *data);
170 int proc_get_bb_reg_dump3(char *page, char **start,
171 off_t offset, int count,
172 int *eof, void *data);
174 int proc_get_rf_reg_dump1(char *page, char **start,
175 off_t offset, int count,
176 int *eof, void *data);
178 int proc_get_rf_reg_dump2(char *page, char **start,
179 off_t offset, int count,
180 int *eof, void *data);
182 int proc_get_rf_reg_dump3(char *page, char **start,
183 off_t offset, int count,
184 int *eof, void *data);
186 int proc_get_rf_reg_dump4(char *page, char **start,
187 off_t offset, int count,
188 int *eof, void *data);
190 #ifdef CONFIG_88EU_AP_MODE
192 int proc_get_all_sta_info(char *page, char **start,
193 off_t offset, int count,
194 int *eof, void *data);
198 int proc_get_best_channel(char *page, char **start,
199 off_t offset, int count,
200 int *eof, void *data);
202 int proc_get_rx_signal(char *page, char **start,
203 off_t offset, int count,
204 int *eof, void *data);
206 int proc_set_rx_signal(struct file *file, const char __user *buffer,
207 unsigned long count, void *data);
209 int proc_get_ht_enable(char *page, char **start,
210 off_t offset, int count,
211 int *eof, void *data);
213 int proc_set_ht_enable(struct file *file, const char __user *buffer,
214 unsigned long count, void *data);
216 int proc_get_cbw40_enable(char *page, char **start,
217 off_t offset, int count,
218 int *eof, void *data);
220 int proc_set_cbw40_enable(struct file *file, const char __user *buffer,
221 unsigned long count, void *data);
223 int proc_get_ampdu_enable(char *page, char **start,
224 off_t offset, int count,
225 int *eof, void *data);
227 int proc_set_ampdu_enable(struct file *file, const char __user *buffer,
228 unsigned long count, void *data);
230 int proc_get_rx_stbc(char *page, char **start,
231 off_t offset, int count,
232 int *eof, void *data);
234 int proc_set_rx_stbc(struct file *file, const char __user *buffer,
235 unsigned long count, void *data);
237 int proc_get_two_path_rssi(char *page, char **start,
238 off_t offset, int count,
239 int *eof, void *data);
241 int proc_get_rssi_disp(char *page, char **start,
242 off_t offset, int count,
243 int *eof, void *data);
245 int proc_set_rssi_disp(struct file *file, const char __user *buffer,
246 unsigned long count, void *data);
248 #ifdef CONFIG_BT_COEXIST
249 int proc_get_btcoex_dbg(char *page, char **start,
250 off_t offset, int count,
251 int *eof, void *data);
253 int proc_set_btcoex_dbg(struct file *file, const char *buffer,
254 signed long count, void *data);
256 #endif /* CONFIG_BT_COEXIST */
258 #endif /* __RTW_DEBUG_H__ */