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