GNU Linux-libre 4.9.337-gnu1
[releases.git] / 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  ******************************************************************************/
15 #ifndef __RTW_DEBUG_H__
16 #define __RTW_DEBUG_H__
17
18 #include <osdep_service.h>
19 #include <drv_types.h>
20
21 #define DRIVERVERSION   "v4.1.4_6773.20130222"
22 #define _drv_always_                    1
23 #define _drv_emerg_                     2
24 #define _drv_alert_                     3
25 #define _drv_crit_                      4
26 #define _drv_err_                       5
27 #define _drv_warning_                   6
28 #define _drv_notice_                    7
29 #define _drv_info_                      8
30 #define _drv_debug_                     9
31
32
33 #define _module_rtl871x_xmit_c_         BIT(0)
34 #define _module_xmit_osdep_c_           BIT(1)
35 #define _module_rtl871x_recv_c_         BIT(2)
36 #define _module_recv_osdep_c_           BIT(3)
37 #define _module_rtl871x_mlme_c_         BIT(4)
38 #define _module_mlme_osdep_c_           BIT(5)
39 #define _module_rtl871x_sta_mgt_c_      BIT(6)
40 #define _module_rtl871x_cmd_c_          BIT(7)
41 #define _module_cmd_osdep_c_            BIT(8)
42 #define _module_rtl871x_io_c_           BIT(9)
43 #define _module_io_osdep_c_             BIT(10)
44 #define _module_os_intfs_c_             BIT(11)
45 #define _module_rtl871x_security_c_     BIT(12)
46 #define _module_rtl871x_eeprom_c_       BIT(13)
47 #define _module_hal_init_c_             BIT(14)
48 #define _module_hci_hal_init_c_         BIT(15)
49 #define _module_rtl871x_ioctl_c_        BIT(16)
50 #define _module_rtl871x_ioctl_set_c_    BIT(17)
51 #define _module_rtl871x_ioctl_query_c_  BIT(18)
52 #define _module_rtl871x_pwrctrl_c_      BIT(19)
53 #define _module_hci_intfs_c_            BIT(20)
54 #define _module_hci_ops_c_              BIT(21)
55 #define _module_osdep_service_c_        BIT(22)
56 #define _module_mp_                     BIT(23)
57 #define _module_hci_ops_os_c_           BIT(24)
58 #define _module_rtl871x_ioctl_os_c      BIT(25)
59 #define _module_rtl8712_cmd_c_          BIT(26)
60 #define _module_rtl8192c_xmit_c_        BIT(27)
61 #define _module_hal_xmit_c_             BIT(28)
62 #define _module_efuse_                  BIT(29)
63 #define _module_rtl8712_recv_c_         BIT(30)
64 #define _module_rtl8712_led_c_          BIT(31)
65
66 #define DRIVER_PREFIX   "R8188EU: "
67
68 extern u32 GlobalDebugLevel;
69
70 #define DBG_88E_LEVEL(_level, fmt, arg...)                              \
71         do {                                                            \
72                 if (_level <= GlobalDebugLevel)                         \
73                         pr_info(DRIVER_PREFIX fmt, ##arg);      \
74         } while (0)
75
76 #define DBG_88E(...)                                                    \
77         do {                                                            \
78                 if (_drv_err_ <= GlobalDebugLevel)                      \
79                         pr_info(DRIVER_PREFIX __VA_ARGS__);             \
80         } while (0)
81
82 #define MSG_88E(...)                                                    \
83         do {                                                            \
84                 if (_drv_err_ <= GlobalDebugLevel)                      \
85                         pr_info(DRIVER_PREFIX __VA_ARGS__);                     \
86         } while (0)
87
88 #define RT_TRACE(_comp, _level, fmt)                                    \
89         do {                                                            \
90                 if (_level <= GlobalDebugLevel) {                       \
91                         pr_info("%s [0x%08x,%d]", DRIVER_PREFIX,        \
92                                  (unsigned int)_comp, _level);          \
93                         pr_info fmt;                                    \
94                 }                                                       \
95         } while (0)
96
97 #define RT_PRINT_DATA(_comp, _level, _titlestring, _hexdata, _hexdatalen)\
98         do {                                                            \
99                 if (_level <= GlobalDebugLevel) {                       \
100                         int __i;                                        \
101                         u8      *ptr = (u8 *)_hexdata;                  \
102                         pr_info("%s", DRIVER_PREFIX);                   \
103                         pr_info(_titlestring);                          \
104                         for (__i = 0; __i < (int)_hexdatalen; __i++) {  \
105                                 pr_info("%02X%s", ptr[__i],             \
106                                          (((__i + 1) % 4) == 0) ?       \
107                                          "  " : " ");   \
108                                 if (((__i + 1) % 16) == 0)              \
109                                         printk("\n");                   \
110                         }                                               \
111                         printk("\n");                                   \
112                 }                                                       \
113         } while (0)
114
115 int proc_get_drv_version(char *page, char **start,
116                          off_t offset, int count,
117                          int *eof, void *data);
118
119 int proc_get_write_reg(char *page, char **start,
120                        off_t offset, int count,
121                        int *eof, void *data);
122
123 int proc_set_write_reg(struct file *file, const char __user *buffer,
124                        unsigned long count, void *data);
125 int proc_get_read_reg(char *page, char **start,
126                       off_t offset, int count,
127                       int *eof, void *data);
128
129 int proc_set_read_reg(struct file *file, const char __user *buffer,
130                       unsigned long count, void *data);
131
132 int proc_get_adapter_state(char *page, char **start,
133                            off_t offset, int count,
134                            int *eof, void *data);
135
136 int proc_get_best_channel(char *page, char **start,
137                           off_t offset, int count,
138                           int *eof, void *data);
139
140 #endif  /* __RTW_DEBUG_H__ */