56af0751f70e6ecf169b46719fa2c7b554171916
[linux-2.6-microblaze.git] / drivers / staging / r8188eu / include / rtw_debug.h
1 /* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
2 /* Copyright(c) 2007 - 2011 Realtek Corporation. */
3
4 #ifndef __RTW_DEBUG_H__
5 #define __RTW_DEBUG_H__
6
7 #include "osdep_service.h"
8 #include "drv_types.h"
9
10 #define _drv_always_                    1
11 #define _drv_emerg_                     2
12 #define _drv_alert_                     3
13 #define _drv_crit_                      4
14 #define _drv_err_                       5
15 #define _drv_warning_                   6
16 #define _drv_notice_                    7
17 #define _drv_info_                      8
18 #define _drv_debug_                     9
19
20 #define _module_rtl871x_xmit_c_         BIT(0)
21 #define _module_xmit_osdep_c_           BIT(1)
22 #define _module_rtl871x_recv_c_         BIT(2)
23 #define _module_recv_osdep_c_           BIT(3)
24 #define _module_rtl871x_mlme_c_         BIT(4)
25 #define _module_mlme_osdep_c_           BIT(5)
26 #define _module_rtl871x_sta_mgt_c_      BIT(6)
27 #define _module_rtl871x_cmd_c_          BIT(7)
28 #define _module_cmd_osdep_c_            BIT(8)
29 #define _module_rtl871x_io_c_           BIT(9)
30 #define _module_io_osdep_c_             BIT(10)
31 #define _module_os_intfs_c_             BIT(11)
32 #define _module_rtl871x_security_c_     BIT(12)
33 #define _module_rtl871x_eeprom_c_       BIT(13)
34 #define _module_hal_init_c_             BIT(14)
35 #define _module_hci_hal_init_c_         BIT(15)
36 #define _module_rtl871x_ioctl_c_        BIT(16)
37 #define _module_rtl871x_ioctl_set_c_    BIT(17)
38 #define _module_rtl871x_ioctl_query_c_  BIT(18)
39 #define _module_rtl871x_pwrctrl_c_      BIT(19)
40 #define _module_hci_intfs_c_            BIT(20)
41 #define _module_hci_ops_c_              BIT(21)
42 #define _module_osdep_service_c_        BIT(22)
43 #define _module_mp_                     BIT(23)
44 #define _module_hci_ops_os_c_           BIT(24)
45 #define _module_rtl871x_ioctl_os_c      BIT(25)
46 #define _module_rtl8712_cmd_c_          BIT(26)
47 #define _module_rtl8192c_xmit_c_        BIT(27)
48 #define _module_hal_xmit_c_             BIT(28)
49 #define _module_efuse_                  BIT(29)
50 #define _module_rtl8712_recv_c_         BIT(30)
51 #define _module_rtl8712_led_c_          BIT(31)
52
53 #define DRIVER_PREFIX   "R8188EU: "
54
55 extern u32 GlobalDebugLevel;
56
57 #define DBG_88E_LEVEL(_level, fmt, arg...)                              \
58         do {                                                            \
59                 if (_level <= GlobalDebugLevel)                         \
60                         pr_info(DRIVER_PREFIX"INFO " fmt, ##arg);       \
61         } while (0)
62
63 #define DBG_88E(...)                                                    \
64         do {                                                            \
65                 if (_drv_err_ <= GlobalDebugLevel)                      \
66                         pr_info(DRIVER_PREFIX __VA_ARGS__);             \
67         } while (0)
68
69 #define MSG_88E(...)                                                    \
70         do {                                                            \
71                 if (_drv_err_ <= GlobalDebugLevel)                      \
72                         pr_info(DRIVER_PREFIX __VA_ARGS__);                     \
73         } while (0)
74
75 #define RT_TRACE(_comp, _level, fmt)                                    \
76         do {                                                            \
77                 if (_level <= GlobalDebugLevel) {                       \
78                         pr_info("%s [0x%08x,%d]", DRIVER_PREFIX,        \
79                                  (unsigned int)_comp, _level);          \
80                         pr_info fmt;                                    \
81                 }                                                       \
82         } while (0)
83
84 #define RT_PRINT_DATA(_comp, _level, _titlestring, _hexdata, _hexdatalen)\
85         do {                                                            \
86                 if (_level <= GlobalDebugLevel) {                       \
87                         int __i;                                        \
88                         u8      *ptr = (u8 *)_hexdata;                  \
89                         pr_info("%s", DRIVER_PREFIX);                   \
90                         pr_info(_titlestring);                          \
91                         for (__i = 0; __i < (int)_hexdatalen; __i++ ) { \
92                                 pr_info("%02X%s", ptr[__i],             \
93                                          (((__i + 1) % 4) == 0) ?       \
94                                          "  " : " ");   \
95                                 if (((__i + 1) % 16) == 0)              \
96                                         printk("\n");                   \
97                         }                                               \
98                         printk("\n");                                   \
99                 }                                                       \
100         } while (0)
101
102 int proc_get_drv_version(char *page, char **start,
103                          off_t offset, int count,
104                          int *eof, void *data);
105
106 int proc_get_write_reg(char *page, char **start,
107                        off_t offset, int count,
108                        int *eof, void *data);
109
110 int proc_set_write_reg(struct file *file, const char __user *buffer,
111                        unsigned long count, void *data);
112 int proc_get_read_reg(char *page, char **start,
113                       off_t offset, int count,
114                       int *eof, void *data);
115
116 int proc_set_read_reg(struct file *file, const char __user *buffer,
117                       unsigned long count, void *data);
118
119 int proc_get_fwstate(char *page, char **start,
120                      off_t offset, int count,
121                      int *eof, void *data);
122 int proc_get_sec_info(char *page, char **start,
123                       off_t offset, int count,
124                       int *eof, void *data);
125 int proc_get_mlmext_state(char *page, char **start,
126                           off_t offset, int count,
127                           int *eof, void *data);
128
129 int proc_get_qos_option(char *page, char **start,
130                         off_t offset, int count,
131                         int *eof, void *data);
132 int proc_get_ht_option(char *page, char **start,
133                        off_t offset, int count,
134                        int *eof, void *data);
135 int proc_get_rf_info(char *page, char **start,
136                      off_t offset, int count,
137                      int *eof, void *data);
138 int proc_get_ap_info(char *page, char **start,
139                      off_t offset, int count,
140                      int *eof, void *data);
141
142 int proc_get_adapter_state(char *page, char **start,
143                            off_t offset, int count,
144                            int *eof, void *data);
145
146 int proc_get_trx_info(char *page, char **start,
147                       off_t offset, int count,
148                       int *eof, void *data);
149
150 int proc_get_mac_reg_dump1(char *page, char **start,
151                            off_t offset, int count,
152                            int *eof, void *data);
153
154 int proc_get_mac_reg_dump2(char *page, char **start,
155                            off_t offset, int count,
156                            int *eof, void *data);
157
158 int proc_get_mac_reg_dump3(char *page, char **start,
159                            off_t offset, int count,
160                            int *eof, void *data);
161
162 int proc_get_bb_reg_dump1(char *page, char **start,
163                           off_t offset, int count,
164                           int *eof, void *data);
165
166 int proc_get_bb_reg_dump2(char *page, char **start,
167                           off_t offset, int count,
168                           int *eof, void *data);
169
170 int proc_get_bb_reg_dump3(char *page, char **start,
171                           off_t offset, int count,
172                           int *eof, void *data);
173
174 int proc_get_rf_reg_dump1(char *page, char **start,
175                           off_t offset, int count,
176                           int *eof, void *data);
177
178 int proc_get_rf_reg_dump2(char *page, char **start,
179                           off_t offset, int count,
180                           int *eof, void *data);
181
182 int proc_get_rf_reg_dump3(char *page, char **start,
183                           off_t offset, int count,
184                           int *eof, void *data);
185
186 int proc_get_rf_reg_dump4(char *page, char **start,
187                           off_t offset, int count,
188                           int *eof, void *data);
189
190 #ifdef CONFIG_88EU_AP_MODE
191
192 int proc_get_all_sta_info(char *page, char **start,
193                           off_t offset, int count,
194                           int *eof, void *data);
195
196 #endif
197
198 int proc_get_best_channel(char *page, char **start,
199                           off_t offset, int count,
200                           int *eof, void *data);
201
202 int proc_get_rx_signal(char *page, char **start,
203                        off_t offset, int count,
204                        int *eof, void *data);
205
206 int proc_set_rx_signal(struct file *file, const char __user *buffer,
207                        unsigned long count, void *data);
208
209 int proc_get_ht_enable(char *page, char **start,
210                        off_t offset, int count,
211                        int *eof, void *data);
212
213 int proc_set_ht_enable(struct file *file, const char __user *buffer,
214                        unsigned long count, void *data);
215
216 int proc_get_cbw40_enable(char *page, char **start,
217                           off_t offset, int count,
218                           int *eof, void *data);
219
220 int proc_set_cbw40_enable(struct file *file, const char __user *buffer,
221                           unsigned long count, void *data);
222
223 int proc_get_ampdu_enable(char *page, char **start,
224                           off_t offset, int count,
225                           int *eof, void *data);
226
227 int proc_set_ampdu_enable(struct file *file, const char __user *buffer,
228                           unsigned long count, void *data);
229
230 int proc_get_rx_stbc(char *page, char **start,
231                      off_t offset, int count,
232                      int *eof, void *data);
233
234 int proc_set_rx_stbc(struct file *file, const char __user *buffer,
235                      unsigned long count, void *data);
236
237 int proc_get_two_path_rssi(char *page, char **start,
238                            off_t offset, int count,
239                            int *eof, void *data);
240
241 int proc_get_rssi_disp(char *page, char **start,
242                        off_t offset, int count,
243                        int *eof, void *data);
244
245 int proc_set_rssi_disp(struct file *file, const char __user *buffer,
246                        unsigned long count, void *data);
247
248 #ifdef CONFIG_BT_COEXIST
249 int proc_get_btcoex_dbg(char *page, char **start,
250                         off_t offset, int count,
251                         int *eof, void *data);
252
253 int proc_set_btcoex_dbg(struct file *file, const char *buffer,
254                         signed long count, void *data);
255
256 #endif /* CONFIG_BT_COEXIST */
257
258 #endif  /* __RTW_DEBUG_H__ */