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