ea121f9b7fb0888864b8bb81174f40aead9ed590
[deliverable/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 Hostinf_debug,
8 CFG80211_debug,
9 Coreconfig_debug,
10 Interrupt_debug,
11 TX_debug,
12 RX_debug,
13 Lock_debug,
14 Tcp_enhance,
15 /*Added by amr - BugID_4720*/
16 Spin_debug,
17
18 Init_debug,
19 Bus_debug,
20 Mem_debug,
21 Firmware_debug,
22 COMP = 0xFFFFFFFF,
23 };
24
25 #define GENERIC_DBG (1 << Generic_debug)
26 #define HOSTAPD_DBG (1 << Hostapd_debug)
27 #define HOSTINF_DBG (1 << Hostinf_debug)
28 #define CORECONFIG_DBG (1 << Coreconfig_debug)
29 #define CFG80211_DBG (1 << CFG80211_debug)
30 #define INT_DBG (1 << Interrupt_debug)
31 #define TX_DBG (1 << TX_debug)
32 #define RX_DBG (1 << RX_debug)
33 #define LOCK_DBG (1 << Lock_debug)
34 #define TCP_ENH (1 << Tcp_enhance)
35 #define SPIN_DEBUG (1 << Spin_debug)
36 #define INIT_DBG (1 << Init_debug)
37 #define BUS_DBG (1 << Bus_debug)
38 #define MEM_DBG (1 << Mem_debug)
39 #define FIRM_DBG (1 << Firmware_debug)
40
41 #if defined (WILC_DEBUGFS)
42 int wilc_debugfs_init(void);
43 void wilc_debugfs_remove(void);
44
45 extern atomic_t REGION;
46 extern atomic_t DEBUG_LEVEL;
47
48 #define DEBUG (1 << 0)
49 #define INFO (1 << 1)
50 #define WRN (1 << 2)
51 #define ERR (1 << 3)
52
53 #define PRINT_D(region, ...) \
54 do { \
55 if ((atomic_read(&DEBUG_LEVEL) & DEBUG) && \
56 ((atomic_read(&REGION)) & (region))) { \
57 printk("DBG [%s: %d]", __func__, __LINE__); \
58 printk(__VA_ARGS__); \
59 } \
60 } while (0)
61
62 #define PRINT_INFO(region, ...) \
63 do { \
64 if ((atomic_read(&DEBUG_LEVEL) & INFO) && \
65 ((atomic_read(&REGION)) & (region))) { \
66 printk("INFO [%s]", __func__); \
67 printk(__VA_ARGS__); \
68 } \
69 } while (0)
70
71 #define PRINT_WRN(region, ...) \
72 do { \
73 if ((atomic_read(&DEBUG_LEVEL) & WRN) && \
74 ((atomic_read(&REGION)) & (region))) { \
75 printk("WRN [%s: %d]", __func__, __LINE__); \
76 printk(__VA_ARGS__); \
77 } \
78 } while (0)
79
80 #define PRINT_ER(...) \
81 do { \
82 if ((atomic_read(&DEBUG_LEVEL) & ERR)) { \
83 printk("ERR [%s: %d]", __func__, __LINE__); \
84 printk(__VA_ARGS__); \
85 } \
86 } while (0)
87
88 #else
89
90 #define REGION (INIT_DBG | GENERIC_DBG | CFG80211_DBG | FIRM_DBG | HOSTAPD_DBG)
91
92 #define DEBUG 1
93 #define INFO 0
94 #define WRN 0
95
96 #define PRINT_D(region, ...) \
97 do { \
98 if (DEBUG == 1 && ((REGION)&(region))) { \
99 printk("DBG [%s: %d]", __func__, __LINE__); \
100 printk(__VA_ARGS__); \
101 } \
102 } while (0)
103
104 #define PRINT_INFO(region, ...) \
105 do { \
106 if (INFO == 1 && ((REGION)&(region))) { \
107 printk("INFO [%s]", __func__); \
108 printk(__VA_ARGS__); \
109 } \
110 } while (0)
111
112 #define PRINT_WRN(region, ...) \
113 do { \
114 if (WRN == 1 && ((REGION)&(region))) { \
115 printk("WRN [%s: %d]", __func__, __LINE__); \
116 printk(__VA_ARGS__); \
117 } \
118 } while (0)
119
120 #define PRINT_ER(...) \
121 do { \
122 printk("ERR [%s: %d]", __func__, __LINE__); \
123 printk(__VA_ARGS__); \
124 } while (0)
125 #endif
126
127 #define FN_IN /* PRINT_D(">>> \n") */
128 #define FN_OUT /* PRINT_D("<<<\n") */
129
130 #ifdef MEMORY_STATIC
131 #define LINUX_RX_SIZE (96 * 1024)
132 #endif
133 #define LINUX_TX_SIZE (64 * 1024)
134
135
136 #define WILC_MULTICAST_TABLE_SIZE 8
137
138 #if defined (BEAGLE_BOARD)
139 #define SPI_CHANNEL 4
140
141 #if SPI_CHANNEL == 4
142 #define MODALIAS "wilc_spi4"
143 #define GPIO_NUM 162
144 #else
145 #define MODALIAS "wilc_spi3"
146 #define GPIO_NUM 133
147 #endif
148 #elif defined(PANDA_BOARD)
149 #define MODALIAS "WILC_SPI"
150 #define GPIO_NUM 139
151 #elif defined(PLAT_WMS8304) /* rachel */
152 #define MODALIAS "wilc_spi"
153 #define GPIO_NUM 139
154 #elif defined (PLAT_RKXXXX)
155 #define MODALIAS "WILC_IRQ"
156 #define GPIO_NUM RK30_PIN3_PD2 /* RK30_PIN3_PA1 */
157 /* RK30_PIN3_PD2 */
158 /* RK2928_PIN1_PA7 */
159
160 #elif defined(CUSTOMER_PLATFORM)
161 /*
162 TODO : specify MODALIAS name and GPIO number. This is certainly necessary for SPI interface.
163 *
164 * ex)
165 * #define MODALIAS "WILC_SPI"
166 * #define GPIO_NUM 139
167 */
168
169 #else
170 /* base on SAMA5D3_Xplained Board */
171 #define MODALIAS "WILC_SPI"
172 #define GPIO_NUM 0x44
173 #endif
174
175
176 void linux_wlan_enable_irq(void);
177 #endif
This page took 0.035386 seconds and 4 git commands to generate.