xref: /OK3568_Linux_fs/kernel/drivers/net/wireless/rockchip_wlan/rtl8821cs/include/rtw_debug.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /******************************************************************************
3  *
4  * Copyright(c) 2007 - 2019 Realtek Corporation.
5  *
6  * This program is free software; you can redistribute it and/or modify it
7  * under the terms of version 2 of the GNU General Public License as
8  * published by the Free Software Foundation.
9  *
10  * This program is distributed in the hope that it will be useful, but WITHOUT
11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13  * more details.
14  *
15  *****************************************************************************/
16 #ifndef __RTW_DEBUG_H__
17 #define __RTW_DEBUG_H__
18 
19 /* driver log level*/
20 enum {
21 	_DRV_NONE_ = 0,
22 	_DRV_ALWAYS_ = 1,
23 	_DRV_ERR_ = 2,
24 	_DRV_WARNING_ = 3,
25 	_DRV_INFO_ = 4,
26 	_DRV_DEBUG_ = 5,
27 	_DRV_MAX_ = 6
28 };
29 
30 #define DRIVER_PREFIX "RTW: "
31 
32 #ifdef PLATFORM_OS_CE
33 extern void rtl871x_cedbg(const char *fmt, ...);
34 #endif
35 
36 #ifdef PLATFORM_WINDOWS
37 	#define RTW_PRINT do {} while (0)
38 	#define RTW_ERR do {} while (0)
39 	#define RTW_WARN do {} while (0)
40 	#define RTW_INFO do {} while (0)
41 	#define RTW_DBG do {} while (0)
42 	#define RTW_PRINT_SEL do {} while (0)
43 	#define _RTW_PRINT do {} while (0)
44 	#define _RTW_ERR do {} while (0)
45 	#define _RTW_WARN do {} while (0)
46 	#define _RTW_INFO do {} while (0)
47 	#define _RTW_DBG do {} while (0)
48 	#define _RTW_PRINT_SEL do {} while (0)
49 #else
50 	#define RTW_PRINT(x, ...) do {} while (0)
51 	#define RTW_ERR(x, ...) do {} while (0)
52 	#define RTW_WARN(x,...) do {} while (0)
53 	#define RTW_INFO(x,...) do {} while (0)
54 	#define RTW_DBG(x,...) do {} while (0)
55 	#define RTW_PRINT_SEL(x,...) do {} while (0)
56 	#define _RTW_PRINT(x, ...) do {} while (0)
57 	#define _RTW_ERR(x, ...) do {} while (0)
58 	#define _RTW_WARN(x,...) do {} while (0)
59 	#define _RTW_INFO(x,...) do {} while (0)
60 	#define _RTW_DBG(x,...) do {} while (0)
61 	#define _RTW_PRINT_SEL(x,...) do {} while (0)
62 #endif
63 
64 #define RTW_INFO_DUMP(_TitleString, _HexData, _HexDataLen) do {} while (0)
65 #define RTW_DBG_DUMP(_TitleString, _HexData, _HexDataLen) do {} while (0)
66 #define RTW_PRINT_DUMP(_TitleString, _HexData, _HexDataLen) do {} while (0)
67 
68 #define RTW_DBG_EXPR(EXPR) do {} while (0)
69 
70 #define RTW_DBGDUMP 0 /* 'stream' for _dbgdump */
71 
72 
73 
74 #undef _dbgdump
75 #undef _seqdump
76 
77 #if defined(PLATFORM_WINDOWS) && defined(PLATFORM_OS_XP)
78 	#define _dbgdump DbgPrint
79 	#define KERN_CONT
80 	#define _seqdump(sel, fmt, arg...) _dbgdump(fmt, ##arg)
81 #elif defined(PLATFORM_WINDOWS) && defined(PLATFORM_OS_CE)
82 	#define _dbgdump rtl871x_cedbg
83 	#define KERN_CONT
84 	#define _seqdump(sel, fmt, arg...) _dbgdump(fmt, ##arg)
85 #elif defined PLATFORM_LINUX
86 	#define _dbgdump printk
87 	#if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24))
88 	#define KERN_CONT
89 	#endif
90 	#define _seqdump seq_printf
91 #elif defined PLATFORM_FREEBSD
92 	#define _dbgdump printf
93 	#if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24))
94 	#define KERN_CONT
95 	#endif
96 	#define _seqdump(sel, fmt, arg...) _dbgdump(fmt, ##arg)
97 #endif
98 
99 void RTW_BUF_DUMP_SEL(uint _loglevel, void *sel, u8 *_titlestring,
100 								bool _idx_show, const u8 *_hexdata, int _hexdatalen);
101 
102 #ifdef CONFIG_RTW_DEBUG
103 
104 #ifndef _OS_INTFS_C_
105 extern uint rtw_drv_log_level;
106 #endif
107 
108 #if defined(_dbgdump)
109 
110 #ifdef PLATFORM_LINUX
111 #ifdef DBG_THREAD_PID
112 #define T_PID_FMT	"(%5u) "
113 #define T_PID_ARG	current->pid
114 #else /* !DBG_THREAD_PID */
115 #define T_PID_FMT	"%s"
116 #define T_PID_ARG	""
117 #endif /* !DBG_THREAD_PID */
118 
119 #ifdef DBG_CPU_INFO
120 #define CPU_INFO_FMT	"[%u] "
121 #define CPU_INFO_ARG	get_cpu()
122 #else /* !DBG_CPU_INFO */
123 #define CPU_INFO_FMT	"%s"
124 #define CPU_INFO_ARG	""
125 #endif /* !DBG_CPU_INFO */
126 
127 /* Extra information in prefix */
128 #define EX_INFO_FMT	T_PID_FMT CPU_INFO_FMT
129 #define EX_INFO_ARG	T_PID_ARG, CPU_INFO_ARG
130 #else /* !PLATFORM_LINUX */
131 #define EX_INFO_FMT	"%s"
132 #define EX_INFO_ARG	""
133 #endif /* !PLATFORM_LINUX */
134 
135 #define DBG_PREFIX	EX_INFO_FMT DRIVER_PREFIX
136 #define DBG_PREFIX_ARG	EX_INFO_ARG
137 
138 /* with driver-defined prefix */
139 #undef RTW_PRINT
140 #define RTW_PRINT(fmt, arg...)     \
141 	do {\
142 		if (_DRV_ALWAYS_ <= rtw_drv_log_level) {\
143 			_dbgdump(DBG_PREFIX fmt, DBG_PREFIX_ARG, ##arg);\
144 		} \
145 	} while (0)
146 
147 #undef RTW_ERR
148 #define RTW_ERR(fmt, arg...)     \
149 	do {\
150 		if (_DRV_ERR_ <= rtw_drv_log_level) {\
151 			_dbgdump(DBG_PREFIX "ERROR " fmt, \
152 				 DBG_PREFIX_ARG, ##arg);\
153 		} \
154 	} while (0)
155 
156 
157 #undef RTW_WARN
158 #define RTW_WARN(fmt, arg...)     \
159 	do {\
160 		if (_DRV_WARNING_ <= rtw_drv_log_level) {\
161 			_dbgdump(DBG_PREFIX "WARN " fmt, \
162 				 DBG_PREFIX_ARG, ##arg);\
163 		} \
164 	} while (0)
165 
166 #undef RTW_INFO
167 #define RTW_INFO(fmt, arg...)     \
168 	do {\
169 		if (_DRV_INFO_ <= rtw_drv_log_level) {\
170 			_dbgdump(DBG_PREFIX fmt, DBG_PREFIX_ARG, ##arg);\
171 		} \
172 	} while (0)
173 
174 
175 #undef RTW_DBG
176 #define RTW_DBG(fmt, arg...)     \
177 	do {\
178 		if (_DRV_DEBUG_ <= rtw_drv_log_level) {\
179 			_dbgdump(DBG_PREFIX fmt, DBG_PREFIX_ARG, ##arg);\
180 		} \
181 	} while (0)
182 
183 #undef RTW_INFO_DUMP
184 #define RTW_INFO_DUMP(_TitleString, _HexData, _HexDataLen)	\
185 	RTW_BUF_DUMP_SEL(_DRV_INFO_, RTW_DBGDUMP, _TitleString, _FALSE, _HexData, _HexDataLen)
186 
187 #undef RTW_DBG_DUMP
188 #define RTW_DBG_DUMP(_TitleString, _HexData, _HexDataLen)	\
189 	RTW_BUF_DUMP_SEL(_DRV_DEBUG_, RTW_DBGDUMP, _TitleString, _FALSE, _HexData, _HexDataLen)
190 
191 
192 #undef RTW_PRINT_DUMP
193 #define RTW_PRINT_DUMP(_TitleString, _HexData, _HexDataLen)	\
194 	RTW_BUF_DUMP_SEL(_DRV_ALWAYS_, RTW_DBGDUMP, _TitleString, _FALSE, _HexData, _HexDataLen)
195 
196 /* without driver-defined prefix */
197 #undef _RTW_PRINT
198 #define _RTW_PRINT(fmt, arg...)     \
199 	do {\
200 		if (_DRV_ALWAYS_ <= rtw_drv_log_level) {\
201 			_dbgdump(KERN_CONT fmt, ##arg);\
202 		} \
203 	} while (0)
204 
205 #undef _RTW_ERR
206 #define _RTW_ERR(fmt, arg...)     \
207 	do {\
208 		if (_DRV_ERR_ <= rtw_drv_log_level) {\
209 			_dbgdump(KERN_CONT fmt, ##arg);\
210 		} \
211 	} while (0)
212 
213 
214 #undef _RTW_WARN
215 #define _RTW_WARN(fmt, arg...)     \
216 	do {\
217 		if (_DRV_WARNING_ <= rtw_drv_log_level) {\
218 			_dbgdump(KERN_CONT fmt, ##arg);\
219 		} \
220 	} while (0)
221 
222 #undef _RTW_INFO
223 #define _RTW_INFO(fmt, arg...)     \
224 	do {\
225 		if (_DRV_INFO_ <= rtw_drv_log_level) {\
226 			_dbgdump(KERN_CONT fmt, ##arg);\
227 		} \
228 	} while (0)
229 
230 #undef _RTW_DBG
231 #define _RTW_DBG(fmt, arg...)     \
232 	do {\
233 		if (_DRV_DEBUG_ <= rtw_drv_log_level) {\
234 			_dbgdump(KERN_CONT fmt, ##arg);\
235 		} \
236 	} while (0)
237 
238 
239 /* other debug APIs */
240 #undef RTW_DBG_EXPR
241 #define RTW_DBG_EXPR(EXPR) do { if (_DRV_DEBUG_ <= rtw_drv_log_level) EXPR; } while (0)
242 
243 #endif /* defined(_dbgdump) */
244 #endif /* CONFIG_RTW_DEBUG */
245 
246 
247 #if defined(_seqdump)
248 /* dump message to selected 'stream' with driver-defined prefix */
249 #undef RTW_PRINT_SEL
250 #define RTW_PRINT_SEL(sel, fmt, arg...) \
251 	do {\
252 		if (sel == RTW_DBGDUMP)\
253 			RTW_PRINT(fmt, ##arg); \
254 		else {\
255 			_seqdump(sel, fmt, ##arg) /*rtw_warn_on(1)*/; \
256 		} \
257 	} while (0)
258 
259 /* dump message to selected 'stream' */
260 #undef _RTW_PRINT_SEL
261 #define _RTW_PRINT_SEL(sel, fmt, arg...) \
262 	do {\
263 		if (sel == RTW_DBGDUMP)\
264 			_RTW_PRINT(fmt, ##arg); \
265 		else {\
266 			_seqdump(sel, fmt, ##arg) /*rtw_warn_on(1)*/; \
267 		} \
268 	} while (0)
269 
270 /* dump message to selected 'stream' */
271 #undef RTW_DUMP_SEL
272 #define RTW_DUMP_SEL(sel, _HexData, _HexDataLen) \
273 	RTW_BUF_DUMP_SEL(_DRV_ALWAYS_, sel, NULL, _FALSE, _HexData, _HexDataLen)
274 
275 #define RTW_MAP_DUMP_SEL(sel, _TitleString, _HexData, _HexDataLen) \
276 	RTW_BUF_DUMP_SEL(_DRV_ALWAYS_, sel, _TitleString, _TRUE, _HexData, _HexDataLen)
277 #endif /* defined(_seqdump) */
278 
279 
280 #ifdef CONFIG_DBG_COUNTER
281 	#define DBG_COUNTER(counter) counter++
282 #else
283 	#define DBG_COUNTER(counter)
284 #endif
285 
286 void dump_drv_version(void *sel);
287 void dump_log_level(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 #if defined(CONFIG_RTW_DEBUG) || defined(CONFIG_PROC_DEBUG)
310 void dump_sec_cam_ent(void *sel, struct sec_cam_ent *ent, int id);
311 void dump_sec_cam_ent_title(void *sel, u8 has_id);
312 #endif
313 void dump_sec_cam(void *sel, _adapter *adapter);
314 void dump_sec_cam_cache(void *sel, _adapter *adapter);
315 
316 bool rtw_fwdl_test_trigger_chksum_fail(void);
317 bool rtw_fwdl_test_trigger_wintint_rdy_fail(void);
318 bool rtw_del_rx_ampdu_test_trigger_no_tx_fail(void);
319 u32 rtw_get_wait_hiq_empty_ms(void);
320 void rtw_sta_linking_test_set_start(void);
321 bool rtw_sta_linking_test_wait_done(void);
322 bool rtw_sta_linking_test_force_fail(void);
323 #ifdef CONFIG_AP_MODE
324 u16 rtw_ap_linking_test_force_auth_fail(void);
325 u16 rtw_ap_linking_test_force_asoc_fail(void);
326 #endif
327 
328 #ifdef CONFIG_PROC_DEBUG
329 ssize_t proc_set_write_reg(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
330 int proc_get_read_reg(struct seq_file *m, void *v);
331 ssize_t proc_set_read_reg(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
332 void dump_drv_cfg(void *sel);
333 int proc_get_fwstate(struct seq_file *m, void *v);
334 int proc_get_sec_info(struct seq_file *m, void *v);
335 int proc_get_mlmext_state(struct seq_file *m, void *v);
336 #ifdef CONFIG_LAYER2_ROAMING
337 int proc_get_roam_flags(struct seq_file *m, void *v);
338 ssize_t proc_set_roam_flags(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
339 int proc_get_roam_param(struct seq_file *m, void *v);
340 ssize_t proc_set_roam_param(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
341 ssize_t proc_set_roam_tgt_addr(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
342 #endif /* CONFIG_LAYER2_ROAMING */
343 int proc_get_qos_option(struct seq_file *m, void *v);
344 int proc_get_ht_option(struct seq_file *m, void *v);
345 int proc_get_rf_info(struct seq_file *m, void *v);
346 int proc_get_scan_param(struct seq_file *m, void *v);
347 ssize_t proc_set_scan_param(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
348 int proc_get_scan_abort(struct seq_file *m, void *v);
349 #ifdef CONFIG_RTW_REPEATER_SON
350 int proc_get_rson_data(struct seq_file *m, void *v);
351 ssize_t proc_set_rson_data(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
352 #endif
353 int proc_get_survey_info(struct seq_file *m, void *v);
354 ssize_t proc_set_survey_info(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
355 int proc_get_ap_info(struct seq_file *m, void *v);
356 #ifdef ROKU_PRIVATE
357 int proc_get_infra_ap(struct seq_file *m, void *v);
358 #endif /* ROKU_PRIVATE */
359 ssize_t proc_reset_trx_info(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
360 int proc_get_trx_info(struct seq_file *m, void *v);
361 ssize_t proc_set_tx_power_offset(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
362 int proc_get_tx_power_offset(struct seq_file *m, void *v);
363 int proc_get_rate_ctl(struct seq_file *m, void *v);
364 int proc_get_wifi_spec(struct seq_file *m, void *v);
365 ssize_t proc_set_rate_ctl(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
366 int proc_get_bw_ctl(struct seq_file *m, void *v);
367 ssize_t proc_set_bw_ctl(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
368 #ifdef DBG_RX_COUNTER_DUMP
369 int proc_get_rx_cnt_dump(struct seq_file *m, void *v);
370 ssize_t proc_set_rx_cnt_dump(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
371 #endif
372 
373 #ifdef CONFIG_AP_MODE
374 int proc_get_bmc_tx_rate(struct seq_file *m, void *v);
375 ssize_t proc_set_bmc_tx_rate(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
376 #endif /*CONFIG_AP_MODE*/
377 
378 int proc_get_ps_dbg_info(struct seq_file *m, void *v);
379 ssize_t proc_set_ps_dbg_info(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
380 
381 ssize_t proc_set_fwdl_test_case(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
382 ssize_t proc_set_del_rx_ampdu_test_case(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
383 ssize_t proc_set_wait_hiq_empty(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
384 ssize_t proc_set_sta_linking_test(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
385 #ifdef CONFIG_AP_MODE
386 ssize_t proc_set_ap_linking_test(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
387 #endif
388 
389 int proc_get_rx_stat(struct seq_file *m, void *v);
390 int proc_get_tx_stat(struct seq_file *m, void *v);
391 #ifdef CONFIG_AP_MODE
392 int proc_get_all_sta_info(struct seq_file *m, void *v);
393 #endif /* CONFIG_AP_MODE */
394 
395 #ifdef DBG_MEMORY_LEAK
396 int proc_get_malloc_cnt(struct seq_file *m, void *v);
397 #endif /* DBG_MEMORY_LEAK */
398 
399 #ifdef CONFIG_FIND_BEST_CHANNEL
400 int proc_get_best_channel(struct seq_file *m, void *v);
401 ssize_t proc_set_best_channel(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
402 #endif /* CONFIG_FIND_BEST_CHANNEL */
403 
404 int proc_get_trx_info_debug(struct seq_file *m, void *v);
405 
406 #ifdef CONFIG_HUAWEI_PROC
407 int proc_get_huawei_trx_info(struct seq_file *m, void *v);
408 #endif
409 
410 int proc_get_rx_signal(struct seq_file *m, void *v);
411 ssize_t proc_set_rx_signal(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
412 int proc_get_hw_status(struct seq_file *m, void *v);
413 ssize_t proc_set_hw_status(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
414 int proc_get_mac_rptbuf(struct seq_file *m, void *v);
415 
416 #ifdef CONFIG_80211N_HT
417 int proc_get_ht_enable(struct seq_file *m, void *v);
418 ssize_t proc_set_ht_enable(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
419 
420 int proc_get_bw_mode(struct seq_file *m, void *v);
421 ssize_t proc_set_bw_mode(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
422 
423 int proc_get_ampdu_enable(struct seq_file *m, void *v);
424 ssize_t proc_set_ampdu_enable(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
425 
426 void dump_regsty_rx_ampdu_size_limit(void *sel, _adapter *adapter);
427 int proc_get_rx_ampdu(struct seq_file *m, void *v);
428 ssize_t proc_set_rx_ampdu(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
429 
430 void rtw_dump_dft_phy_cap(void *sel, _adapter *adapter);
431 void rtw_get_dft_phy_cap(void *sel, _adapter *adapter);
432 void rtw_dump_drv_phy_cap(void *sel, _adapter *adapter);
433 
434 int proc_get_rx_stbc(struct seq_file *m, void *v);
435 ssize_t proc_set_rx_stbc(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
436 int proc_get_stbc_cap(struct seq_file *m, void *v);
437 ssize_t proc_set_stbc_cap(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
438 int proc_get_ldpc_cap(struct seq_file *m, void *v);
439 ssize_t proc_set_ldpc_cap(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
440 #ifdef CONFIG_BEAMFORMING
441 int proc_get_txbf_cap(struct seq_file *m, void *v);
442 ssize_t proc_set_txbf_cap(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
443 #endif
444 #ifdef CONFIG_SDIO_TX_ENABLE_AVAL_INT
445 int proc_get_tx_aval_th(struct seq_file *m, void *v);
446 ssize_t proc_set_tx_aval_th(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
447 #endif /*CONFIG_SDIO_TX_ENABLE_AVAL_INT*/
448 int proc_get_rx_ampdu_factor(struct seq_file *m, void *v);
449 ssize_t proc_set_rx_ampdu_factor(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
450 
451 int proc_get_tx_max_agg_num(struct seq_file *m, void *v);
452 ssize_t proc_set_tx_max_agg_num(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
453 
454 int proc_get_rx_ampdu_density(struct seq_file *m, void *v);
455 ssize_t proc_set_rx_ampdu_density(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
456 
457 int proc_get_tx_ampdu_density(struct seq_file *m, void *v);
458 ssize_t proc_set_tx_ampdu_density(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
459 
460 int proc_get_tx_quick_addba_req(struct seq_file *m, void *v);
461 ssize_t proc_set_tx_quick_addba_req(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
462 #ifdef CONFIG_TX_AMSDU
463 int proc_get_tx_amsdu(struct seq_file *m, void *v);
464 ssize_t proc_set_tx_amsdu(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
465 int proc_get_tx_amsdu_rate(struct seq_file *m, void *v);
466 ssize_t proc_set_tx_amsdu_rate(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
467 #endif
468 #endif /* CONFIG_80211N_HT */
469 
470 #ifdef CONFIG_80211AC_VHT
471 int proc_get_vht_24g_enable(struct seq_file *m, void *v);
472 ssize_t proc_set_vht_24g_enable(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
473 #endif
474 
475 ssize_t proc_set_dyn_rrsr(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
476 int proc_get_dyn_rrsr(struct seq_file *m, void *v);
477 
478 int proc_get_en_fwps(struct seq_file *m, void *v);
479 ssize_t proc_set_en_fwps(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
480 
481 #if 0
482 int proc_get_two_path_rssi(struct seq_file *m, void *v);
483 int proc_get_rssi_disp(struct seq_file *m, void *v);
484 ssize_t proc_set_rssi_disp(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
485 #endif
486 
487 #ifdef CONFIG_BT_COEXIST
488 int proc_get_btcoex_dbg(struct seq_file *m, void *v);
489 ssize_t proc_set_btcoex_dbg(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
490 int proc_get_btcoex_info(struct seq_file *m, void *v);
491 #ifdef CONFIG_RF4CE_COEXIST
492 int proc_get_rf4ce_state(struct seq_file *m, void *v);
493 ssize_t proc_set_rf4ce_state(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
494 #endif
495 #endif /* CONFIG_BT_COEXIST */
496 
497 #if defined(DBG_CONFIG_ERROR_DETECT)
498 int proc_get_sreset(struct seq_file *m, void *v);
499 ssize_t proc_set_sreset(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
500 #endif /* DBG_CONFIG_ERROR_DETECT */
501 
502 int proc_get_odm_adaptivity(struct seq_file *m, void *v);
503 ssize_t proc_set_odm_adaptivity(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
504 
505 #ifdef CONFIG_DBG_COUNTER
506 int proc_get_rx_logs(struct seq_file *m, void *v);
507 int proc_get_tx_logs(struct seq_file *m, void *v);
508 int proc_get_int_logs(struct seq_file *m, void *v);
509 #endif
510 
511 #ifdef CONFIG_PCI_HCI
512 int proc_get_rx_ring(struct seq_file *m, void *v);
513 int proc_get_tx_ring(struct seq_file *m, void *v);
514 int proc_get_pci_aspm(struct seq_file *m, void *v);
515 int proc_get_pci_conf_space(struct seq_file *m, void *v);
516 ssize_t proc_set_pci_conf_space(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
517 
518 int proc_get_pci_bridge_conf_space(struct seq_file *m, void *v);
519 ssize_t proc_set_pci_bridge_conf_space(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
520 
521 
522 #ifdef DBG_TXBD_DESC_DUMP
523 int proc_get_tx_ring_ext(struct seq_file *m, void *v);
524 ssize_t proc_set_tx_ring_ext(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
525 #endif
526 #endif
527 
528 #ifdef CONFIG_WOWLAN
529 int proc_get_wow_enable(struct seq_file *m, void *v);
530 ssize_t proc_set_wow_enable(struct file *file, const char __user *buffer,
531 		size_t count, loff_t *pos, void *data);
532 int proc_get_pattern_info(struct seq_file *m, void *v);
533 ssize_t proc_set_pattern_info(struct file *file, const char __user *buffer,
534 		size_t count, loff_t *pos, void *data);
535 int proc_get_wakeup_event(struct seq_file *m, void *v);
536 ssize_t proc_set_wakeup_event(struct file *file, const char __user *buffer,
537 		size_t count, loff_t *pos, void *data);
538 int proc_get_wakeup_reason(struct seq_file *m, void *v);
539 #ifdef CONFIG_WOW_KEEP_ALIVE_PATTERN
540 int proc_dump_wow_keep_alive_info(struct seq_file *m, void *v);
541 #endif /*CONFIG_WOW_KEEP_ALIVE_PATTERN*/
542 #endif
543 
544 #ifdef CONFIG_WAR_OFFLOAD
545 int proc_get_war_offload_enable(struct seq_file *m, void *v);
546 ssize_t proc_set_war_offload_enable(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
547 int proc_get_war_offload_ipv4_addr(struct seq_file *m, void *v);
548 ssize_t proc_set_war_offload_ipv4_addr(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
549 int proc_get_war_offload_ipv6_addr(struct seq_file *m, void *v);
550 ssize_t proc_set_war_offload_ipv6_addr(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
551 int proc_get_war_offload_mdns_domain_name(struct seq_file *m, void *v);
552 ssize_t proc_set_war_offload_mdns_domain_name(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
553 int proc_get_war_offload_mdns_machine_name(struct seq_file *m, void *v);
554 ssize_t proc_set_war_offload_mdns_machine_name(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
555 int proc_get_war_offload_mdns_txt_rsp(struct seq_file *m, void *v);
556 ssize_t proc_set_war_offload_mdns_txt_rsp(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
557 int proc_get_war_offload_mdns_service_info(struct seq_file *m, void *v);
558 ssize_t proc_set_war_offload_mdns_service_info(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
559 #endif /* CONFIG_WAR_OFFLOAD */
560 
561 
562 #ifdef CONFIG_GPIO_WAKEUP
563 int proc_get_wowlan_gpio_info(struct seq_file *m, void *v);
564 ssize_t proc_set_wowlan_gpio_info(struct file *file, const char __user *buffer,
565 		size_t count, loff_t *pos, void *data);
566 #endif /*CONFIG_GPIO_WAKEUP*/
567 
568 #ifdef CONFIG_P2P_WOWLAN
569 int proc_get_p2p_wowlan_info(struct seq_file *m, void *v);
570 #endif /* CONFIG_P2P_WOWLAN */
571 
572 int proc_get_new_bcn_max(struct seq_file *m, void *v);
573 ssize_t proc_set_new_bcn_max(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
574 
575 #ifdef CONFIG_POWER_SAVING
576 int proc_get_ps_info(struct seq_file *m, void *v);
577 ssize_t proc_set_ps_info(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
578 #ifdef CONFIG_WMMPS_STA
579 int proc_get_wmmps_info(struct seq_file *m, void *v);
580 ssize_t proc_set_wmmps_info(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
581 #endif /* CONFIG_WMMPS_STA */
582 #endif /* CONFIG_POWER_SAVING */
583 
584 #ifdef CONFIG_TDLS
585 int proc_get_tdls_enable(struct seq_file *m, void *v);
586 ssize_t proc_set_tdls_enable(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
587 int proc_get_tdls_info(struct seq_file *m, void *v);
588 #endif
589 
590 int proc_get_monitor(struct seq_file *m, void *v);
591 ssize_t proc_set_monitor(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
592 
593 #ifdef RTW_SIMPLE_CONFIG
594 int proc_get_simple_config(struct seq_file *m, void *v);
595 ssize_t proc_set_simple_config(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
596 #endif
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_CUSTOMER01_SMART_ANTENNA
622 int proc_get_pathb_phase(struct seq_file *m, void *v);
623 ssize_t proc_set_pathb_phase(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
624 #endif
625 
626 #ifdef CONFIG_MCC_MODE
627 int proc_get_mcc_info(struct seq_file *m, void *v);
628 ssize_t proc_set_mcc_enable(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
629 ssize_t proc_set_mcc_duration(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
630 #ifdef CONFIG_MCC_PHYDM_OFFLOAD
631 ssize_t proc_set_mcc_phydm_offload_enable(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
632 #endif
633 ssize_t proc_set_mcc_single_tx_criteria(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
634 ssize_t proc_set_mcc_ap_bw20_target_tp(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
635 ssize_t proc_set_mcc_ap_bw40_target_tp(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
636 ssize_t proc_set_mcc_ap_bw80_target_tp(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
637 ssize_t proc_set_mcc_sta_bw20_target_tp(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
638 ssize_t proc_set_mcc_sta_bw40_target_tp(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
639 ssize_t proc_set_mcc_sta_bw80_target_tp(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
640 int proc_get_mcc_policy_table(struct seq_file *m, void *v);
641 #endif /* CONFIG_MCC_MODE */
642 
643 int proc_get_ack_timeout(struct seq_file *m, void *v);
644 ssize_t proc_set_ack_timeout(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
645 
646 int proc_get_fw_offload(struct seq_file *m, void *v);
647 ssize_t proc_set_fw_offload(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
648 
649 #ifdef CONFIG_FW_HANDLE_TXBCN
650 ssize_t proc_set_fw_tbtt_rpt(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
651 int proc_get_fw_tbtt_rpt(struct seq_file *m, void *v);
652 #endif
653 
654 #ifdef CONFIG_DBG_RF_CAL
655 int proc_get_iqk_info(struct seq_file *m, void *v);
656 ssize_t proc_set_iqk(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
657 int proc_get_lck_info(struct seq_file *m, void *v);
658 ssize_t proc_set_lck(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
659 #endif /*CONFIG_DBG_RF_CAL*/
660 
661 #ifdef CONFIG_CTRL_TXSS_BY_TP
662 ssize_t proc_set_txss_tp(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
663 int proc_get_txss_tp(struct seq_file *m, void *v);
664 #ifdef DBG_CTRL_TXSS
665 ssize_t proc_set_txss_ctrl(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
666 int proc_get_txss_ctrl(struct seq_file *m, void *v);
667 #endif
668 #endif
669 
670 #ifdef CONFIG_LPS_CHK_BY_TP
671 ssize_t proc_set_lps_chk_tp(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
672 int proc_get_lps_chk_tp(struct seq_file *m, void *v);
673 #endif
674 
675 #ifdef CONFIG_SUPPORT_STATIC_SMPS
676 ssize_t proc_set_smps(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
677 int proc_get_smps(struct seq_file *m, void *v);
678 #endif
679 
680 int proc_get_defs_param(struct seq_file *m, void *v);
681 ssize_t proc_set_defs_param(struct file *file, const char __user *buffer, size_t count, loff_t *pos, void *data);
682 
683 #define _drv_always_		1
684 #define _drv_emerg_			2
685 #define _drv_alert_			3
686 #define _drv_crit_			4
687 #define _drv_err_			5
688 #define _drv_warning_		6
689 #define _drv_notice_		7
690 #define _drv_info_			8
691 #define _drv_dump_			9
692 #define _drv_debug_			10
693 
694 #define _module_rtl871x_xmit_c_		BIT(0)
695 #define _module_xmit_osdep_c_		BIT(1)
696 #define _module_rtl871x_recv_c_		BIT(2)
697 #define _module_recv_osdep_c_		BIT(3)
698 #define _module_rtl871x_mlme_c_		BIT(4)
699 #define _module_mlme_osdep_c_		BIT(5)
700 #define _module_rtl871x_sta_mgt_c_		BIT(6)
701 #define _module_rtl871x_cmd_c_			BIT(7)
702 #define _module_cmd_osdep_c_		BIT(8)
703 #define _module_rtl871x_io_c_				BIT(9)
704 #define _module_io_osdep_c_		BIT(10)
705 #define _module_os_intfs_c_			BIT(11)
706 #define _module_rtl871x_security_c_		BIT(12)
707 #define _module_rtl871x_eeprom_c_			BIT(13)
708 #define _module_hal_init_c_		BIT(14)
709 #define _module_hci_hal_init_c_		BIT(15)
710 #define _module_rtl871x_ioctl_c_		BIT(16)
711 #define _module_rtl871x_ioctl_set_c_		BIT(17)
712 #define _module_rtl871x_ioctl_query_c_	BIT(18)
713 #define _module_rtl871x_pwrctrl_c_			BIT(19)
714 #define _module_hci_intfs_c_			BIT(20)
715 #define _module_hci_ops_c_			BIT(21)
716 #define _module_osdep_service_c_			BIT(22)
717 #define _module_mp_			BIT(23)
718 #define _module_hci_ops_os_c_			BIT(24)
719 #define _module_rtl871x_ioctl_os_c		BIT(25)
720 #define _module_rtl8712_cmd_c_		BIT(26)
721 /* #define _module_efuse_			BIT(27) */
722 #define	_module_rtl8192c_xmit_c_ BIT(28)
723 #define _module_hal_xmit_c_	BIT(28)
724 #define _module_efuse_			BIT(29)
725 #define _module_rtl8712_recv_c_		BIT(30)
726 #define _module_rtl8712_led_c_		BIT(31)
727 
728 #endif /* __RTW_DEBUG_H__ */
729