1 /******************************************************************************
3 * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of version 2 of the GNU General Public License as
7 * published by the Free Software Foundation.
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14 * You should have received a copy of the GNU General Public License along with
15 * this program; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
19 ******************************************************************************/
20 #ifndef __RTW_DEBUG_H__
21 #define __RTW_DEBUG_H__
23 #include <osdep_service.h>
24 #include <drv_types.h>
27 #define _drv_always_ 1
32 #define _drv_warning_ 6
33 #define _drv_notice_ 7
38 #define _module_rtl871x_xmit_c_ BIT(0)
39 #define _module_xmit_osdep_c_ BIT(1)
40 #define _module_rtl871x_recv_c_ BIT(2)
41 #define _module_recv_osdep_c_ BIT(3)
42 #define _module_rtl871x_mlme_c_ BIT(4)
43 #define _module_mlme_osdep_c_ BIT(5)
44 #define _module_rtl871x_sta_mgt_c_ BIT(6)
45 #define _module_rtl871x_cmd_c_ BIT(7)
46 #define _module_cmd_osdep_c_ BIT(8)
47 #define _module_rtl871x_io_c_ BIT(9)
48 #define _module_io_osdep_c_ BIT(10)
49 #define _module_os_intfs_c_ BIT(11)
50 #define _module_rtl871x_security_c_ BIT(12)
51 #define _module_rtl871x_eeprom_c_ BIT(13)
52 #define _module_hal_init_c_ BIT(14)
53 #define _module_hci_hal_init_c_ BIT(15)
54 #define _module_rtl871x_ioctl_c_ BIT(16)
55 #define _module_rtl871x_ioctl_set_c_ BIT(17)
56 #define _module_rtl871x_ioctl_query_c_ BIT(18)
57 #define _module_rtl871x_pwrctrl_c_ BIT(19)
58 #define _module_hci_intfs_c_ BIT(20)
59 #define _module_hci_ops_c_ BIT(21)
60 #define _module_osdep_service_c_ BIT(22)
61 #define _module_mp_ BIT(23)
62 #define _module_hci_ops_os_c_ BIT(24)
63 #define _module_rtl871x_ioctl_os_c BIT(25)
64 #define _module_rtl8712_cmd_c_ BIT(26)
65 #define _module_rtl8192c_xmit_c_ BIT(27)
66 #define _module_hal_xmit_c_ BIT(28)
67 #define _module_efuse_ BIT(29)
68 #define _module_rtl8712_recv_c_ BIT(30)
69 #define _module_rtl8712_led_c_ BIT(31)
71 #define DRIVER_PREFIX "R8188EU: "
73 extern u32 GlobalDebugLevel;
75 #define DBG_88E_LEVEL(_level, fmt, arg...) \
77 if (_level <= GlobalDebugLevel) \
78 pr_info(DRIVER_PREFIX"ERROR " fmt, ##arg); \
81 #define DBG_88E(...) \
83 if (_drv_err_ <= GlobalDebugLevel) \
84 pr_info(DRIVER_PREFIX __VA_ARGS__); \
87 #define MSG_88E(...) \
89 if (_drv_err_ <= GlobalDebugLevel) \
90 pr_info(DRIVER_PREFIX __VA_ARGS__); \
93 #define RT_TRACE(_comp, _level, fmt) \
95 if (_level <= GlobalDebugLevel) { \
96 pr_info("%s [0x%08x,%d]", DRIVER_PREFIX, \
97 (unsigned int)_comp, _level); \
102 #define _func_enter_ \
104 if (GlobalDebugLevel >= _drv_debug_) \
105 pr_info("%s : %s enters at %d\n", \
106 DRIVER_PREFIX, __func__, __LINE__); \
109 #define _func_exit_ \
111 if (GlobalDebugLevel >= _drv_debug_) \
112 pr_info("%s : %s exits at %d\n", \
113 DRIVER_PREFIX, __func__, __LINE__); \
116 #define RT_PRINT_DATA(_comp, _level, _titlestring, _hexdata, _hexdatalen)\
118 if (_level <= GlobalDebugLevel) { \
120 u8 *ptr = (u8 *)_hexdata; \
121 pr_info("%s", DRIVER_PREFIX); \
122 pr_info(_titlestring); \
123 for (__i = 0; __i < (int)_hexdatalen; __i++ ) { \
124 pr_info("%02X%s", ptr[__i], \
125 (((__i + 1) % 4) == 0) ? \
127 if (((__i + 1) % 16) == 0) \
134 int proc_get_drv_version(char *page, char **start,
135 off_t offset, int count,
136 int *eof, void *data);
138 int proc_get_write_reg(char *page, char **start,
139 off_t offset, int count,
140 int *eof, void *data);
142 int proc_set_write_reg(struct file *file, const char __user *buffer,
143 unsigned long count, void *data);
144 int proc_get_read_reg(char *page, char **start,
145 off_t offset, int count,
146 int *eof, void *data);
148 int proc_set_read_reg(struct file *file, const char __user *buffer,
149 unsigned long count, void *data);
151 int proc_get_fwstate(char *page, char **start,
152 off_t offset, int count,
153 int *eof, void *data);
154 int proc_get_sec_info(char *page, char **start,
155 off_t offset, int count,
156 int *eof, void *data);
157 int proc_get_mlmext_state(char *page, char **start,
158 off_t offset, int count,
159 int *eof, void *data);
161 int proc_get_qos_option(char *page, char **start,
162 off_t offset, int count,
163 int *eof, void *data);
164 int proc_get_ht_option(char *page, char **start,
165 off_t offset, int count,
166 int *eof, void *data);
167 int proc_get_rf_info(char *page, char **start,
168 off_t offset, int count,
169 int *eof, void *data);
170 int proc_get_ap_info(char *page, char **start,
171 off_t offset, int count,
172 int *eof, void *data);
174 int proc_get_adapter_state(char *page, char **start,
175 off_t offset, int count,
176 int *eof, void *data);
178 int proc_get_trx_info(char *page, char **start,
179 off_t offset, int count,
180 int *eof, void *data);
182 int proc_get_mac_reg_dump1(char *page, char **start,
183 off_t offset, int count,
184 int *eof, void *data);
186 int proc_get_mac_reg_dump2(char *page, char **start,
187 off_t offset, int count,
188 int *eof, void *data);
190 int proc_get_mac_reg_dump3(char *page, char **start,
191 off_t offset, int count,
192 int *eof, void *data);
194 int proc_get_bb_reg_dump1(char *page, char **start,
195 off_t offset, int count,
196 int *eof, void *data);
198 int proc_get_bb_reg_dump2(char *page, char **start,
199 off_t offset, int count,
200 int *eof, void *data);
202 int proc_get_bb_reg_dump3(char *page, char **start,
203 off_t offset, int count,
204 int *eof, void *data);
206 int proc_get_rf_reg_dump1(char *page, char **start,
207 off_t offset, int count,
208 int *eof, void *data);
210 int proc_get_rf_reg_dump2(char *page, char **start,
211 off_t offset, int count,
212 int *eof, void *data);
214 int proc_get_rf_reg_dump3(char *page, char **start,
215 off_t offset, int count,
216 int *eof, void *data);
218 int proc_get_rf_reg_dump4(char *page, char **start,
219 off_t offset, int count,
220 int *eof, void *data);
222 #ifdef CONFIG_88EU_AP_MODE
224 int proc_get_all_sta_info(char *page, char **start,
225 off_t offset, int count,
226 int *eof, void *data);
230 int proc_get_best_channel(char *page, char **start,
231 off_t offset, int count,
232 int *eof, void *data);
234 int proc_get_rx_signal(char *page, char **start,
235 off_t offset, int count,
236 int *eof, void *data);
238 int proc_set_rx_signal(struct file *file, const char __user *buffer,
239 unsigned long count, void *data);
241 int proc_get_ht_enable(char *page, char **start,
242 off_t offset, int count,
243 int *eof, void *data);
245 int proc_set_ht_enable(struct file *file, const char __user *buffer,
246 unsigned long count, void *data);
248 int proc_get_cbw40_enable(char *page, char **start,
249 off_t offset, int count,
250 int *eof, void *data);
252 int proc_set_cbw40_enable(struct file *file, const char __user *buffer,
253 unsigned long count, void *data);
255 int proc_get_ampdu_enable(char *page, char **start,
256 off_t offset, int count,
257 int *eof, void *data);
259 int proc_set_ampdu_enable(struct file *file, const char __user *buffer,
260 unsigned long count, void *data);
262 int proc_get_rx_stbc(char *page, char **start,
263 off_t offset, int count,
264 int *eof, void *data);
266 int proc_set_rx_stbc(struct file *file, const char __user *buffer,
267 unsigned long count, void *data);
269 int proc_get_two_path_rssi(char *page, char **start,
270 off_t offset, int count,
271 int *eof, void *data);
273 int proc_get_rssi_disp(char *page, char **start,
274 off_t offset, int count,
275 int *eof, void *data);
277 int proc_set_rssi_disp(struct file *file, const char __user *buffer,
278 unsigned long count, void *data);
280 #ifdef CONFIG_BT_COEXIST
281 int proc_get_btcoex_dbg(char *page, char **start,
282 off_t offset, int count,
283 int *eof, void *data);
285 int proc_set_btcoex_dbg(struct file *file, const char *buffer,
286 signed long count, void *data);
288 #endif /* CONFIG_BT_COEXIST */
290 #endif /* __RTW_DEBUG_H__ */