staging: wilc1000: remove unused log message using the RX_DBG tag
[cascardo/linux.git] / drivers / staging / wilc1000 / linux_wlan_common.h
1 #ifndef LINUX_WLAN_COMMON_H
2 #define LINUX_WLAN_COMMON_H
3
4 enum debug_region {
5         Generic_debug = 0,
6         Hostapd_debug,
7         CFG80211_debug,
8         Interrupt_debug,
9         Lock_debug,
10         Tcp_enhance,
11         Spin_debug,
12
13         Init_debug,
14         Bus_debug,
15         Mem_debug,
16         Firmware_debug,
17         COMP = 0xFFFFFFFF,
18 };
19
20 #define GENERIC_DBG             (1 << Generic_debug)
21 #define HOSTAPD_DBG             (1 << Hostapd_debug)
22 #define CFG80211_DBG            (1 << CFG80211_debug)
23 #define INT_DBG                 (1 << Interrupt_debug)
24 #define LOCK_DBG                (1 << Lock_debug)
25 #define TCP_ENH                 (1 << Tcp_enhance)
26 #define SPIN_DEBUG              (1 << Spin_debug)
27 #define INIT_DBG                (1 << Init_debug)
28 #define BUS_DBG                 (1 << Bus_debug)
29 #define MEM_DBG                 (1 << Mem_debug)
30 #define FIRM_DBG                (1 << Firmware_debug)
31
32 #if defined (WILC_DEBUGFS)
33 extern atomic_t WILC_REGION;
34 extern atomic_t WILC_DEBUG_LEVEL;
35
36 #define DEBUG           BIT(0)
37 #define INFO            BIT(1)
38 #define WRN             BIT(2)
39 #define ERR             BIT(3)
40
41 #define PRINT_D(region, ...)                                            \
42         do {                                                            \
43                 if ((atomic_read(&WILC_DEBUG_LEVEL) & DEBUG) && \
44                    ((atomic_read(&WILC_REGION)) & (region))) {  \
45                         printk("DBG [%s: %d]", __func__, __LINE__);     \
46                         printk(__VA_ARGS__);                            \
47                 }                                                       \
48         } while (0)
49
50 #define PRINT_INFO(region, ...)                                         \
51         do {                                                            \
52                 if ((atomic_read(&WILC_DEBUG_LEVEL) & INFO) &&  \
53                    ((atomic_read(&WILC_REGION)) & (region))) {  \
54                         printk("INFO [%s]", __func__);                  \
55                         printk(__VA_ARGS__);                            \
56                 }                                                       \
57         } while (0)
58
59 #define PRINT_WRN(region, ...)                                          \
60         do {                                                            \
61                 if ((atomic_read(&WILC_DEBUG_LEVEL) & WRN) &&   \
62                    ((atomic_read(&WILC_REGION)) & (region))) {  \
63                         printk("WRN [%s: %d]", __func__, __LINE__);     \
64                         printk(__VA_ARGS__);                            \
65                 }                                                       \
66         } while (0)
67
68 #define PRINT_ER(...)                                                   \
69         do {                                                            \
70                 if ((atomic_read(&WILC_DEBUG_LEVEL) & ERR)) {   \
71                         printk("ERR [%s: %d]", __func__, __LINE__);     \
72                         printk(__VA_ARGS__);                            \
73                 }                                                       \
74         } while (0)
75
76 #else
77
78 #define REGION  (INIT_DBG | GENERIC_DBG | CFG80211_DBG | FIRM_DBG | HOSTAPD_DBG)
79
80 #define DEBUG       1
81 #define INFO        0
82 #define WRN         0
83
84 #define PRINT_D(region, ...)                                            \
85         do {                                                            \
86                 if (DEBUG == 1 && ((REGION)&(region))) {                \
87                         printk("DBG [%s: %d]", __func__, __LINE__);     \
88                         printk(__VA_ARGS__);                            \
89                 }                                                       \
90         } while (0)
91
92 #define PRINT_INFO(region, ...)                                         \
93         do {                                                            \
94                 if (INFO == 1 && ((REGION)&(region))) {                 \
95                         printk("INFO [%s]", __func__);                  \
96                         printk(__VA_ARGS__);                            \
97                 }                                                       \
98         } while (0)
99
100 #define PRINT_WRN(region, ...)                                          \
101         do {                                                            \
102                 if (WRN == 1 && ((REGION)&(region))) {                  \
103                         printk("WRN [%s: %d]", __func__, __LINE__);     \
104                         printk(__VA_ARGS__);                            \
105                 }                                                       \
106         } while (0)
107
108 #define PRINT_ER(...)                                                   \
109         do {                                                            \
110                 printk("ERR [%s: %d]", __func__, __LINE__);             \
111                 printk(__VA_ARGS__);                                    \
112         } while (0)
113
114 #endif
115
116 #define FN_IN   /* PRINT_D(">>> \n") */
117 #define FN_OUT  /* PRINT_D("<<<\n") */
118
119 #define LINUX_RX_SIZE   (96 * 1024)
120 #define LINUX_TX_SIZE   (64 * 1024)
121
122
123 #define WILC_MULTICAST_TABLE_SIZE       8
124
125 #if defined (BEAGLE_BOARD)
126         #define SPI_CHANNEL     4
127
128         #if SPI_CHANNEL == 4
129                 #define MODALIAS        "wilc_spi4"
130                 #define GPIO_NUM        162
131         #else
132                 #define MODALIAS        "wilc_spi3"
133                 #define GPIO_NUM        133
134         #endif
135 #elif defined(PLAT_WMS8304)             /* rachel */
136         #define MODALIAS        "wilc_spi"
137         #define GPIO_NUM        139
138 #elif defined (PLAT_RKXXXX)
139  #define MODALIAS       "WILC_IRQ"
140  #define GPIO_NUM       RK30_PIN3_PD2 /* RK30_PIN3_PA1 */
141 /* RK30_PIN3_PD2 */
142 /* RK2928_PIN1_PA7 */
143
144 #elif defined(CUSTOMER_PLATFORM)
145 /*
146  TODO : specify MODALIAS name and GPIO number. This is certainly necessary for SPI interface.
147  *
148  * ex)
149  * #define MODALIAS  "WILC_SPI"
150  * #define GPIO_NUM  139
151  */
152
153 #else
154 /* base on SAMA5D3_Xplained Board */
155         #define MODALIAS        "WILC_SPI"
156         #define GPIO_NUM        0x44
157 #endif
158 #endif