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