xref: /OK3568_Linux_fs/kernel/drivers/net/wireless/rockchip_wlan/rtl8723bs/include/rtw_debug.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1 /******************************************************************************
2  *
3  * Copyright(c) 2007 - 2017 Realtek Corporation.
4  *
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.
8  *
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
12  * more details.
13  *
14  *****************************************************************************/
15 #ifndef __RTW_DEBUG_H__
16 #define __RTW_DEBUG_H__
17 
18 /* driver log level*/
19 enum {
20 	_DRV_NONE_ = 0,
21 	_DRV_ALWAYS_ = 1,
22 	_DRV_ERR_ = 2,
23 	_DRV_WARNING_ = 3,
24 	_DRV_INFO_ = 4,
25 	_DRV_DEBUG_ = 5,
26 	_DRV_MAX_ = 6
27 };
28 
29 #define DRIVER_PREFIX "RTW: "
30 
31 #ifdef PLATFORM_OS_CE
32 extern void rtl871x_cedbg(const char *fmt, ...);
33 #endif
34 
35 #ifdef PLATFORM_WINDOWS
36 	#define RTW_PRINT do {} while (0)
37 	#define RTW_ERR do {} while (0)
38 	#define RTW_WARN do {} while (0)
39 	#define RTW_INFO do {} while (0)
40 	#define RTW_DBG do {} while (0)
41 	#define RTW_PRINT_SEL do {} while (0)
42 	#define _RTW_PRINT do {} while (0)
43 	#define _RTW_ERR do {} while (0)
44 	#define _RTW_WARN do {} while (0)
45 	#define _RTW_INFO do {} while (0)
46 	#define _RTW_DBG do {} while (0)
47 	#define _RTW_PRINT_SEL do {} while (0)
48 #else
49 	#define RTW_PRINT(x, ...) do {} while (0)
50 	#define RTW_ERR(x, ...) do {} while (0)
51 	#define RTW_WARN(x,...) do {} while (0)
52 	#define RTW_INFO(x,...) do {} while (0)
53 	#define RTW_DBG(x,...) do {} while (0)
54 	#define RTW_PRINT_SEL(x,...) do {} while (0)
55 	#define _RTW_PRINT(x, ...) do {} while (0)
56 	#define _RTW_ERR(x, ...) do {} while (0)
57 	#define _RTW_WARN(x,...) do {} while (0)
58 	#define _RTW_INFO(x,...) do {} while (0)
59 	#define _RTW_DBG(x,...) do {} while (0)
60 	#define _RTW_PRINT_SEL(x,...) do {} while (0)
61 #endif
62 
63 #define RTW_INFO_DUMP(_TitleString, _HexData, _HexDataLen) do {} while (0)
64 #define RTW_DBG_DUMP(_TitleString, _HexData, _HexDataLen) do {} while (0)
65 #define RTW_PRINT_DUMP(_TitleString, _HexData, _HexDataLen) do {} while (0)
66 #define _RTW_INFO_DUMP(_TitleString, _HexData, _HexDataLen) do {} while (0)
67 #define _RTW_DBG_DUMP(_TitleString, _HexData, _HexDataLen) do {} while (0)
68 
69 #define RTW_DBG_EXPR(EXPR) do {} while (0)
70 
71 #define RTW_DBGDUMP 0 /* 'stream' for _dbgdump */
72 
73 /* don't use these 3 APIs anymore, will be removed later */
74 #define RT_TRACE(_Comp, _Level, Fmt) do {} while (0)
75 
76 
77 #undef _dbgdump
78 #undef _seqdump
79 
80 #if defined(PLATFORM_WINDOWS) && defined(PLATFORM_OS_XP)
81 	#define _dbgdump DbgPrint
82 	#define _seqdump(sel, fmt, arg...) _dbgdump(fmt, ##arg)
83 #elif defined(PLATFORM_WINDOWS) && defined(PLATFORM_OS_CE)
84 	#define _dbgdump rtl871x_cedbg
85 	#define _seqdump(sel, fmt, arg...) _dbgdump(fmt, ##arg)
86 #elif defined PLATFORM_LINUX
87 	#define _dbgdump printk
88 	#define _seqdump seq_printf
89 #elif defined PLATFORM_FREEBSD
90 	#define _dbgdump printf
91 	#define _seqdump(sel, fmt, arg...) _dbgdump(fmt, ##arg)
92 #endif
93 
94 #ifdef CONFIG_RTW_DEBUG
95 
96 #ifndef _OS_INTFS_C_
97 extern uint rtw_drv_log_level;
98 #endif
99 
100 #if defined(_dbgdump)
101 
102 /* with driver-defined prefix */
103 #undef RTW_PRINT
104 #define RTW_PRINT(fmt, arg...)     \
105 	do {\
106 		if (_DRV_ALWAYS_ <= rtw_drv_log_level) {\
107 			_dbgdump(DRIVER_PREFIX fmt, ##arg);\
108 		} \
109 	} while (0)
110 
111 #undef RTW_ERR
112 #define RTW_ERR(fmt, arg...)     \
113 	do {\
114 		if (_DRV_ERR_ <= rtw_drv_log_level) {\
115 			_dbgdump(DRIVER_PREFIX"ERROR " fmt, ##arg);\
116 		} \
117 	} while (0)
118 
119 
120 #undef RTW_WARN
121 #define RTW_WARN(fmt, arg...)     \
122 	do {\
123 		if (_DRV_WARNING_ <= rtw_drv_log_level) {\
124 			_dbgdump(DRIVER_PREFIX"WARN " fmt, ##arg);\
125 		} \
126 	} while (0)
127 
128 #undef RTW_INFO
129 #define RTW_INFO(fmt, arg...)     \
130 	do {\
131 		if (_DRV_INFO_ <= rtw_drv_log_level) {\
132 			_dbgdump(DRIVER_PREFIX fmt, ##arg);\
133 		} \
134 	} while (0)
135 
136 
137 #undef RTW_DBG
138 #define RTW_DBG(fmt, arg...)     \
139 	do {\
140 		if (_DRV_DEBUG_ <= rtw_drv_log_level) {\
141 			_dbgdump(DRIVER_PREFIX fmt, ##arg);\
142 		} \
143 	} while (0)
144 
145 
146 #undef RTW_INFO_DUMP
147 #define RTW_INFO_DUMP(_TitleString, _HexData, _HexDataLen)			\
148 	do {\
149 		if (_DRV_INFO_ <= rtw_drv_log_level) {	\
150 			int __i;								\
151 			u8	*ptr = (u8 *)_HexData;				\
152 			_dbgdump("%s", DRIVER_PREFIX);						\
153 			_dbgdump(_TitleString);						\
154 			for (__i = 0; __i < (int)_HexDataLen; __i++) {				\
155 				_dbgdump("%02X%s", ptr[__i], (((__i + 1) % 4) == 0) ? "  " : " ");	\
156 				if (((__i + 1) % 16) == 0)	\
157 					_dbgdump("\n");			\
158 			}								\
159 			_dbgdump("\n");							\
160 		} \
161 	} while (0)
162 
163 #undef RTW_DBG_DUMP
164 #define RTW_DBG_DUMP(_TitleString, _HexData, _HexDataLen)			\
165 	do {\
166 		if (_DRV_DEBUG_ <= rtw_drv_log_level) { \
167 			int __i;								\
168 			u8	*ptr = (u8 *)_HexData;				\
169 			_dbgdump("%s", DRIVER_PREFIX);						\
170 			_dbgdump(_TitleString);						\
171 			for (__i = 0; __i < (int)_HexDataLen; __i++) {				\
172 				_dbgdump("%02X%s", ptr[__i], (((__i + 1) % 4) == 0) ? "  " : " ");	\
173 				if (((__i + 1) % 16) == 0)	\
174 					_dbgdump("\n");			\
175 			}								\
176 			_dbgdump("\n");							\
177 		} \
178 	} while (0)
179 
180 
181 #undef RTW_PRINT_DUMP
182 #define RTW_PRINT_DUMP(_TitleString, _HexData, _HexDataLen)			\
183 	do {\
184 		if (_DRV_ALWAYS_ <= rtw_drv_log_level) { \
185 			int __i;								\
186 			u8	*ptr = (u8 *)_HexData;				\
187 			_dbgdump("%s", DRIVER_PREFIX);						\
188 			_dbgdump(_TitleString); 					\
189 			for (__i = 0; __i < (int)_HexDataLen; __i++) {				\
190 				_dbgdump("%02X%s", ptr[__i], (((__i + 1) % 4) == 0) ? "  " : " ");	\
191 				if (((__i + 1) % 16) == 0)	\
192 					_dbgdump("\n"); 		\
193 			}								\
194 			_dbgdump("\n"); 						\
195 		} \
196 	} while (0)
197 
198 /* without driver-defined prefix */
199 #undef _RTW_PRINT
200 #define _RTW_PRINT(fmt, arg...)     \
201 	do {\
202 		if (_DRV_ALWAYS_ <= rtw_drv_log_level) {\
203 			_dbgdump(fmt, ##arg);\
204 		} \
205 	} while (0)
206 
207 #undef _RTW_ERR
208 #define _RTW_ERR(fmt, arg...)     \
209 	do {\
210 		if (_DRV_ERR_ <= rtw_drv_log_level) {\
211 			_dbgdump(fmt, ##arg);\
212 		} \
213 	} while (0)
214 
215 
216 #undef _RTW_WARN
217 #define _RTW_WARN(fmt, arg...)     \
218 	do {\
219 		if (_DRV_WARNING_ <= rtw_drv_log_level) {\
220 			_dbgdump(fmt, ##arg);\
221 		} \
222 	} while (0)
223 
224 #undef _RTW_INFO
225 #define _RTW_INFO(fmt, arg...)     \
226 	do {\
227 		if (_DRV_INFO_ <= rtw_drv_log_level) {\
228 			_dbgdump(fmt, ##arg);\
229 		} \
230 	} while (0)
231 
232 #undef _RTW_DBG
233 #define _RTW_DBG(fmt, arg...)     \
234 	do {\
235 		if (_DRV_DEBUG_ <= rtw_drv_log_level) {\
236 			_dbgdump(fmt, ##arg);\
237 		} \
238 	} while (0)
239 
240 
241 #undef _RTW_INFO_DUMP
242 #define _RTW_INFO_DUMP(_TitleString, _HexData, _HexDataLen)			\
243 	if (_DRV_INFO_ <= rtw_drv_log_level) {	\
244 		int __i;								\
245 		u8	*ptr = (u8 *)_HexData;				\
246 		_dbgdump(_TitleString);						\
247 		for (__i = 0; __i<(int)_HexDataLen; __i++)				\
248 		{								\
249 			_dbgdump("%02X%s", ptr[__i], (((__i + 1) % 4) == 0) ? "  " : " ");	\
250 			if (((__i + 1) % 16) == 0)	_dbgdump("\n");			\
251 		}								\
252 		_dbgdump("\n");							\
253 	}
254 
255 #undef _RTW_DBG_DUMP
256 #define _RTW_DBG_DUMP(_TitleString, _HexData, _HexDataLen)			\
257 	if (_DRV_DEBUG_ <= rtw_drv_log_level) { \
258 		int __i;								\
259 		u8	*ptr = (u8 *)_HexData;				\
260 		_dbgdump(_TitleString);						\
261 		for (__i = 0; __i<(int)_HexDataLen; __i++)				\
262 		{								\
263 			_dbgdump("%02X%s", ptr[__i], (((__i + 1) % 4) == 0) ? "  " : " ");	\
264 			if (((__i + 1) % 16) == 0)	_dbgdump("\n");			\
265 		}								\
266 		_dbgdump("\n");							\
267 	}
268 
269 /* other debug APIs */
270 #undef RTW_DBG_EXPR
271 #define RTW_DBG_EXPR(EXPR) do { if (_DRV_DEBUG_ <= rtw_drv_log_level) EXPR; } while (0)
272 
273 #endif /* defined(_dbgdump) */
274 #endif /* CONFIG_RTW_DEBUG */
275 
276 
277 #if defined(_seqdump)
278 /* dump message to selected 'stream' with driver-defined prefix */
279 #undef RTW_PRINT_SEL
280 #define RTW_PRINT_SEL(sel, fmt, arg...) \
281 	do {\
282 		if (sel == RTW_DBGDUMP)\
283 			RTW_PRINT(fmt, ##arg); \
284 		else {\
285 			_seqdump(sel, fmt, ##arg) /*rtw_warn_on(1)*/; \
286 		} \
287 	} while (0)
288 
289 /* dump message to selected 'stream' */
290 #undef _RTW_PRINT_SEL
291 #define _RTW_PRINT_SEL(sel, fmt, arg...) \
292 	do {\
293 		if (sel == RTW_DBGDUMP)\
294 			_RTW_PRINT(fmt, ##arg); \
295 		else {\
296 			_seqdump(sel, fmt, ##arg) /*rtw_warn_on(1)*/; \
297 		} \
298 	} while (0)
299 
300 /* dump message to selected 'stream' */
301 #undef _RTW_DUMP_SEL
302 #define _RTW_DUMP_SEL(sel, _HexData, _HexDataLen) \
303 	do {\
304 		if (sel == RTW_DBGDUMP) {\
305 			int __i;								\
306 			u8	*ptr = (u8 *)_HexData;				\
307 			for (__i = 0; __i < (int)_HexDataLen; __i++) {				\
308 				_dbgdump("%02X%s", ptr[__i], (((__i + 1) % 4) == 0) ? "  " : " ");	\
309 				if (((__i + 1) % 16) == 0)	\
310 					_dbgdump("\n");			\
311 			}								\
312 			_dbgdump("\n");							\
313 		} \
314 		else {\
315 			int __i;								\
316 			u8	*ptr = (u8 *)_HexData;				\
317 			for (__i = 0; __i < (int)_HexDataLen; __i++) {				\
318 				_seqdump(sel, "%02X%s", ptr[__i], (((__i + 1) % 4) == 0) ? "  " : " ");	\
319 				if (((__i + 1) % 16) == 0)	\
320 					_seqdump(sel, "\n");			\
321 			}								\
322 			_seqdump(sel, "\n");							\
323 		} \
324 	} while (0)
325 
326 #endif /* defined(_seqdump) */
327 
328 
329 #ifdef CONFIG_DBG_COUNTER
330 	#define DBG_COUNTER(counter) counter++
331 #else
332 	#define DBG_COUNTER(counter)
333 #endif
334 
335 void dump_drv_version(void *sel);
336 void dump_log_level(void *sel);
337 void dump_drv_cfg(void *sel);
338 
339 #ifdef CONFIG_SDIO_HCI
340 void sd_f0_reg_dump(void *sel, _adapter *adapter);
341 void sdio_local_reg_dump(void *sel, _adapter *adapter);
342 #endif /* CONFIG_SDIO_HCI */
343 
344 void mac_reg_dump(void *sel, _adapter *adapter);
345 void bb_reg_dump(void *sel, _adapter *adapter);
346 void bb_reg_dump_ex(void *sel, _adapter *adapter);
347 void rf_reg_dump(void *sel, _adapter *adapter);
348 
349 void rtw_sink_rtp_seq_dbg(_adapter *adapter, _pkt *pkt);
350 
351 struct sta_info;
352 void sta_rx_reorder_ctl_dump(void *sel, struct sta_info *sta);
353 
354 struct dvobj_priv;
355 void dump_tx_rate_bmp(void *sel, struct dvobj_priv *dvobj);
356 void dump_adapters_status(void *sel, struct dvobj_priv *dvobj);
357 
358 struct sec_cam_ent;
359 void dump_sec_cam_ent(void *sel, struct sec_cam_ent *ent, int id);
360 void dump_sec_cam_ent_title(void *sel, u8 has_id);
361 void dump_sec_cam(void *sel, _adapter *adapter);
362 void dump_sec_cam_cache(void *sel, _adapter *adapter);
363 
364 #ifdef CONFIG_PROC_DEBUG
365 ssize_t proc_set_write_reg(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
366 int proc_get_read_reg(struct seq_file *m, void *v);
367 ssize_t proc_set_read_reg(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
368 
369 int proc_get_fwstate(struct seq_file *m, void *v);
370 int proc_get_sec_info(struct seq_file *m, void *v);
371 int proc_get_mlmext_state(struct seq_file *m, void *v);
372 #ifdef CONFIG_LAYER2_ROAMING
373 int proc_get_roam_flags(struct seq_file *m, void *v);
374 ssize_t proc_set_roam_flags(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
375 int proc_get_roam_param(struct seq_file *m, void *v);
376 ssize_t proc_set_roam_param(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
377 ssize_t proc_set_roam_tgt_addr(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
378 #endif /* CONFIG_LAYER2_ROAMING */
379 #ifdef CONFIG_RTW_80211R
380 int proc_get_ft_flags(struct seq_file *m, void *v);
381 ssize_t proc_set_ft_flags(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
382 #endif
383 int proc_get_qos_option(struct seq_file *m, void *v);
384 int proc_get_ht_option(struct seq_file *m, void *v);
385 int proc_get_rf_info(struct seq_file *m, void *v);
386 int proc_get_scan_param(struct seq_file *m, void *v);
387 ssize_t proc_set_scan_param(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
388 int proc_get_scan_abort(struct seq_file *m, void *v);
389 #ifdef CONFIG_SCAN_BACKOP
390 int proc_get_backop_flags_sta(struct seq_file *m, void *v);
391 ssize_t proc_set_backop_flags_sta(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
392 int proc_get_backop_flags_ap(struct seq_file *m, void *v);
393 ssize_t proc_set_backop_flags_ap(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
394 #endif /* CONFIG_SCAN_BACKOP */
395 #ifdef CONFIG_RTW_REPEATER_SON
396 int proc_get_rson_data(struct seq_file *m, void *v);
397 ssize_t proc_set_rson_data(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
398 #endif
399 int proc_get_survey_info(struct seq_file *m, void *v);
400 ssize_t proc_set_survey_info(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
401 int proc_get_ap_info(struct seq_file *m, void *v);
402 ssize_t proc_reset_trx_info(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
403 int proc_get_trx_info(struct seq_file *m, void *v);
404 ssize_t proc_set_tx_power_offset(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
405 int proc_get_tx_power_offset(struct seq_file *m, void *v);
406 int proc_get_rate_ctl(struct seq_file *m, void *v);
407 int proc_get_wifi_spec(struct seq_file *m, void *v);
408 ssize_t proc_set_rate_ctl(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
409 int proc_get_bw_ctl(struct seq_file *m, void *v);
410 ssize_t proc_set_bw_ctl(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
411 #ifdef DBG_RX_COUNTER_DUMP
412 int proc_get_rx_cnt_dump(struct seq_file *m, void *v);
413 ssize_t proc_set_rx_cnt_dump(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
414 #endif
415 
416 #ifdef CONFIG_AP_MODE
417 int proc_get_bmc_tx_rate(struct seq_file *m, void *v);
418 ssize_t proc_set_bmc_tx_rate(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
419 #endif /*CONFIG_AP_MODE*/
420 
421 int proc_get_dis_pwt(struct seq_file *m, void *v);
422 ssize_t proc_set_dis_pwt(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
423 
424 int proc_get_ps_dbg_info(struct seq_file *m, void *v);
425 ssize_t proc_set_ps_dbg_info(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
426 
427 bool rtw_fwdl_test_trigger_chksum_fail(void);
428 bool rtw_fwdl_test_trigger_wintint_rdy_fail(void);
429 ssize_t proc_set_fwdl_test_case(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
430 bool rtw_del_rx_ampdu_test_trigger_no_tx_fail(void);
431 ssize_t proc_set_del_rx_ampdu_test_case(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
432 #ifdef CONFIG_DFS_MASTER
433 int proc_get_dfs_master_test_case(struct seq_file *m, void *v);
434 ssize_t proc_set_dfs_master_test_case(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
435 #endif /* CONFIG_DFS_MASTER */
436 u32 rtw_get_wait_hiq_empty_ms(void);
437 ssize_t proc_set_wait_hiq_empty(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
438 void rtw_sta_linking_test_set_start(void);
439 bool rtw_sta_linking_test_wait_done(void);
440 bool rtw_sta_linking_test_force_fail(void);
441 ssize_t proc_set_sta_linking_test(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
442 
443 int proc_get_rx_stat(struct seq_file *m, void *v);
444 int proc_get_tx_stat(struct seq_file *m, void *v);
445 #ifdef CONFIG_AP_MODE
446 int proc_get_all_sta_info(struct seq_file *m, void *v);
447 #endif /* CONFIG_AP_MODE */
448 
449 #ifdef DBG_MEMORY_LEAK
450 int proc_get_malloc_cnt(struct seq_file *m, void *v);
451 #endif /* DBG_MEMORY_LEAK */
452 
453 #ifdef CONFIG_FIND_BEST_CHANNEL
454 int proc_get_best_channel(struct seq_file *m, void *v);
455 ssize_t proc_set_best_channel(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
456 #endif /* CONFIG_FIND_BEST_CHANNEL */
457 
458 int proc_get_trx_info_debug(struct seq_file *m, void *v);
459 
460 int proc_get_rx_signal(struct seq_file *m, void *v);
461 ssize_t proc_set_rx_signal(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
462 int proc_get_hw_status(struct seq_file *m, void *v);
463 ssize_t proc_set_hw_status(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
464 
465 #ifdef CONFIG_80211N_HT
466 int proc_get_ht_enable(struct seq_file *m, void *v);
467 ssize_t proc_set_ht_enable(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
468 
469 int proc_get_bw_mode(struct seq_file *m, void *v);
470 ssize_t proc_set_bw_mode(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
471 
472 int proc_get_ampdu_enable(struct seq_file *m, void *v);
473 ssize_t proc_set_ampdu_enable(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
474 
475 int proc_get_mac_rptbuf(struct seq_file *m, void *v);
476 
477 void dump_regsty_rx_ampdu_size_limit(void *sel, _adapter *adapter);
478 int proc_get_rx_ampdu(struct seq_file *m, void *v);
479 ssize_t proc_set_rx_ampdu(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
480 
481 void rtw_dump_dft_phy_cap(void *sel, _adapter *adapter);
482 void rtw_get_dft_phy_cap(void *sel, _adapter *adapter);
483 void rtw_dump_drv_phy_cap(void *sel, _adapter *adapter);
484 
485 int proc_get_rx_stbc(struct seq_file *m, void *v);
486 ssize_t proc_set_rx_stbc(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
487 int proc_get_stbc_cap(struct seq_file *m, void *v);
488 ssize_t proc_set_stbc_cap(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
489 int proc_get_ldpc_cap(struct seq_file *m, void *v);
490 ssize_t proc_set_ldpc_cap(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
491 #ifdef CONFIG_BEAMFORMING
492 int proc_get_txbf_cap(struct seq_file *m, void *v);
493 ssize_t proc_set_txbf_cap(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
494 #endif
495 int proc_get_rx_ampdu_factor(struct seq_file *m, void *v);
496 ssize_t proc_set_rx_ampdu_factor(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
497 
498 int proc_get_tx_max_agg_num(struct seq_file *m, void *v);
499 ssize_t proc_set_tx_max_agg_num(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
500 
501 int proc_get_rx_ampdu_density(struct seq_file *m, void *v);
502 ssize_t proc_set_rx_ampdu_density(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
503 
504 int proc_get_tx_ampdu_density(struct seq_file *m, void *v);
505 ssize_t proc_set_tx_ampdu_density(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
506 
507 #ifdef CONFIG_TX_AMSDU
508 int proc_get_tx_amsdu(struct seq_file *m, void *v);
509 ssize_t proc_set_tx_amsdu(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
510 int proc_get_tx_amsdu_rate(struct seq_file *m, void *v);
511 ssize_t proc_set_tx_amsdu_rate(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
512 #endif
513 #endif /* CONFIG_80211N_HT */
514 
515 int proc_get_en_fwps(struct seq_file *m, void *v);
516 ssize_t proc_set_en_fwps(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
517 
518 #if 0
519 int proc_get_two_path_rssi(struct seq_file *m, void *v);
520 int proc_get_rssi_disp(struct seq_file *m, void *v);
521 ssize_t proc_set_rssi_disp(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
522 #endif
523 
524 #ifdef CONFIG_BT_COEXIST
525 int proc_get_btcoex_dbg(struct seq_file *m, void *v);
526 ssize_t proc_set_btcoex_dbg(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
527 int proc_get_btcoex_info(struct seq_file *m, void *v);
528 #ifdef CONFIG_RF4CE_COEXIST
529 int proc_get_rf4ce_state(struct seq_file *m, void *v);
530 ssize_t proc_set_rf4ce_state(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
531 #endif
532 #endif /* CONFIG_BT_COEXIST */
533 
534 #if defined(DBG_CONFIG_ERROR_DETECT)
535 int proc_get_sreset(struct seq_file *m, void *v);
536 ssize_t proc_set_sreset(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
537 #endif /* DBG_CONFIG_ERROR_DETECT */
538 
539 int proc_get_odm_adaptivity(struct seq_file *m, void *v);
540 ssize_t proc_set_odm_adaptivity(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
541 
542 #ifdef CONFIG_DBG_COUNTER
543 int proc_get_rx_logs(struct seq_file *m, void *v);
544 int proc_get_tx_logs(struct seq_file *m, void *v);
545 int proc_get_int_logs(struct seq_file *m, void *v);
546 #endif
547 
548 #ifdef CONFIG_PCI_HCI
549 int proc_get_rx_ring(struct seq_file *m, void *v);
550 int proc_get_tx_ring(struct seq_file *m, void *v);
551 int proc_get_pci_aspm(struct seq_file *m, void *v);
552 #ifdef DBG_TXBD_DESC_DUMP
553 int proc_get_tx_ring_ext(struct seq_file *m, void *v);
554 ssize_t proc_set_tx_ring_ext(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
555 #endif
556 #endif
557 
558 #ifdef CONFIG_WOWLAN
559 int proc_get_pattern_info(struct seq_file *m, void *v);
560 ssize_t proc_set_pattern_info(struct file *file, const char __user *buffer,
561 		size_t count, loff_t *pos, void *data);
562 int proc_get_wakeup_event(struct seq_file *m, void *v);
563 ssize_t proc_set_wakeup_event(struct file *file, const char __user *buffer,
564 		size_t count, loff_t *pos, void *data);
565 int proc_get_wakeup_reason(struct seq_file *m, void *v);
566 #endif
567 
568 #ifdef CONFIG_GPIO_WAKEUP
569 int proc_get_wowlan_gpio_info(struct seq_file *m, void *v);
570 ssize_t proc_set_wowlan_gpio_info(struct file *file, const char __user *buffer,
571 		size_t count, loff_t *pos, void *data);
572 #endif /*CONFIG_GPIO_WAKEUP*/
573 
574 #ifdef CONFIG_P2P_WOWLAN
575 int proc_get_p2p_wowlan_info(struct seq_file *m, void *v);
576 #endif /* CONFIG_P2P_WOWLAN */
577 
578 int proc_get_new_bcn_max(struct seq_file *m, void *v);
579 ssize_t proc_set_new_bcn_max(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
580 
581 #ifdef CONFIG_POWER_SAVING
582 int proc_get_ps_info(struct seq_file *m, void *v);
583 #ifdef CONFIG_WMMPS_STA
584 int proc_get_wmmps_info(struct seq_file *m, void *v);
585 ssize_t proc_set_wmmps_info(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
586 #endif /* CONFIG_WMMPS_STA */
587 #endif /* CONFIG_POWER_SAVING */
588 
589 #ifdef CONFIG_TDLS
590 int proc_get_tdls_enable(struct seq_file *m, void *v);
591 ssize_t proc_set_tdls_enable(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
592 int proc_get_tdls_info(struct seq_file *m, void *v);
593 #endif
594 
595 int proc_get_monitor(struct seq_file *m, void *v);
596 ssize_t proc_set_monitor(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
597 
598 #ifdef DBG_XMIT_BLOCK
599 int proc_get_xmit_block(struct seq_file *m, void *v);
600 ssize_t proc_set_xmit_block(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
601 #endif
602 
603 #ifdef CONFIG_PREALLOC_RX_SKB_BUFFER
604 int proc_get_rtkm_info(struct seq_file *m, void *v);
605 #endif /* CONFIG_PREALLOC_RX_SKB_BUFFER */
606 
607 #ifdef CONFIG_IEEE80211W
608 ssize_t proc_set_tx_sa_query(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
609 int proc_get_tx_sa_query(struct seq_file *m, void *v);
610 ssize_t proc_set_tx_deauth(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
611 int proc_get_tx_deauth(struct seq_file *m, void *v);
612 ssize_t proc_set_tx_auth(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
613 int proc_get_tx_auth(struct seq_file *m, void *v);
614 #endif /* CONFIG_IEEE80211W */
615 
616 #endif /* CONFIG_PROC_DEBUG */
617 
618 int proc_get_efuse_map(struct seq_file *m, void *v);
619 ssize_t proc_set_efuse_map(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
620 
621 #ifdef CONFIG_MCC_MODE
622 int proc_get_mcc_info(struct seq_file *m, void *v);
623 ssize_t proc_set_mcc_enable(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
624 ssize_t proc_set_mcc_single_tx_criteria(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
625 ssize_t proc_set_mcc_ap_bw20_target_tp(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
626 ssize_t proc_set_mcc_ap_bw40_target_tp(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
627 ssize_t proc_set_mcc_ap_bw80_target_tp(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
628 ssize_t proc_set_mcc_sta_bw20_target_tp(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
629 ssize_t proc_set_mcc_sta_bw40_target_tp(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
630 ssize_t proc_set_mcc_sta_bw80_target_tp(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
631 int proc_get_mcc_policy_table(struct seq_file *m, void *v);
632 ssize_t proc_set_mcc_policy_table(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
633 #endif /* CONFIG_MCC_MODE */
634 
635 int proc_get_ack_timeout(struct seq_file *m, void *v);
636 ssize_t proc_set_ack_timeout(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
637 
638 int proc_get_iqk_fw_offload(struct seq_file *m, void *v);
639 ssize_t proc_set_iqk_fw_offload(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
640 
641 #ifdef CONFIG_DBG_RF_CAL
642 int proc_get_iqk_info(struct seq_file *m, void *v);
643 ssize_t proc_set_iqk(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
644 int proc_get_lck_info(struct seq_file *m, void *v);
645 ssize_t proc_set_lck(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
646 #endif /*CONFIG_DBG_RF_CAL*/
647 
648 #define _drv_always_		1
649 #define _drv_emerg_			2
650 #define _drv_alert_			3
651 #define _drv_crit_			4
652 #define _drv_err_			5
653 #define _drv_warning_		6
654 #define _drv_notice_		7
655 #define _drv_info_			8
656 #define _drv_dump_			9
657 #define _drv_debug_			10
658 
659 #define _module_rtl871x_xmit_c_		BIT(0)
660 #define _module_xmit_osdep_c_		BIT(1)
661 #define _module_rtl871x_recv_c_		BIT(2)
662 #define _module_recv_osdep_c_		BIT(3)
663 #define _module_rtl871x_mlme_c_		BIT(4)
664 #define _module_mlme_osdep_c_		BIT(5)
665 #define _module_rtl871x_sta_mgt_c_		BIT(6)
666 #define _module_rtl871x_cmd_c_			BIT(7)
667 #define _module_cmd_osdep_c_		BIT(8)
668 #define _module_rtl871x_io_c_				BIT(9)
669 #define _module_io_osdep_c_		BIT(10)
670 #define _module_os_intfs_c_			BIT(11)
671 #define _module_rtl871x_security_c_		BIT(12)
672 #define _module_rtl871x_eeprom_c_			BIT(13)
673 #define _module_hal_init_c_		BIT(14)
674 #define _module_hci_hal_init_c_		BIT(15)
675 #define _module_rtl871x_ioctl_c_		BIT(16)
676 #define _module_rtl871x_ioctl_set_c_		BIT(17)
677 #define _module_rtl871x_ioctl_query_c_	BIT(18)
678 #define _module_rtl871x_pwrctrl_c_			BIT(19)
679 #define _module_hci_intfs_c_			BIT(20)
680 #define _module_hci_ops_c_			BIT(21)
681 #define _module_osdep_service_c_			BIT(22)
682 #define _module_mp_			BIT(23)
683 #define _module_hci_ops_os_c_			BIT(24)
684 #define _module_rtl871x_ioctl_os_c		BIT(25)
685 #define _module_rtl8712_cmd_c_		BIT(26)
686 /* #define _module_efuse_			BIT(27) */
687 #define	_module_rtl8192c_xmit_c_ BIT(28)
688 #define _module_hal_xmit_c_	BIT(28)
689 #define _module_efuse_			BIT(29)
690 #define _module_rtl8712_recv_c_		BIT(30)
691 #define _module_rtl8712_led_c_		BIT(31)
692 
693 #endif /* __RTW_DEBUG_H__ */
694