1 #ifndef LINUX_WLAN_COMMON_H
2 #define LINUX_WLAN_COMMON_H
24 #define GENERIC_DBG (1 << Generic_debug)
25 #define HOSTAPD_DBG (1 << Hostapd_debug)
26 #define HOSTINF_DBG (1 << Hostinf_debug)
27 #define CORECONFIG_DBG (1 << Coreconfig_debug)
28 #define CFG80211_DBG (1 << CFG80211_debug)
29 #define INT_DBG (1 << Interrupt_debug)
30 #define TX_DBG (1 << TX_debug)
31 #define RX_DBG (1 << RX_debug)
32 #define LOCK_DBG (1 << Lock_debug)
33 #define TCP_ENH (1 << Tcp_enhance)
34 #define SPIN_DEBUG (1 << Spin_debug)
35 #define INIT_DBG (1 << Init_debug)
36 #define BUS_DBG (1 << Bus_debug)
37 #define MEM_DBG (1 << Mem_debug)
38 #define FIRM_DBG (1 << Firmware_debug)
40 #if defined (WILC_DEBUGFS)
41 extern atomic_t WILC_REGION;
42 extern atomic_t WILC_DEBUG_LEVEL;
49 #define PRINT_D(region, ...) \
51 if ((atomic_read(&WILC_DEBUG_LEVEL) & DEBUG) && \
52 ((atomic_read(&WILC_REGION)) & (region))) { \
53 printk("DBG [%s: %d]", __func__, __LINE__); \
54 printk(__VA_ARGS__); \
58 #define PRINT_INFO(region, ...) \
60 if ((atomic_read(&WILC_DEBUG_LEVEL) & INFO) && \
61 ((atomic_read(&WILC_REGION)) & (region))) { \
62 printk("INFO [%s]", __func__); \
63 printk(__VA_ARGS__); \
67 #define PRINT_WRN(region, ...) \
69 if ((atomic_read(&WILC_DEBUG_LEVEL) & WRN) && \
70 ((atomic_read(&WILC_REGION)) & (region))) { \
71 printk("WRN [%s: %d]", __func__, __LINE__); \
72 printk(__VA_ARGS__); \
76 #define PRINT_ER(...) \
78 if ((atomic_read(&WILC_DEBUG_LEVEL) & ERR)) { \
79 printk("ERR [%s: %d]", __func__, __LINE__); \
80 printk(__VA_ARGS__); \
86 #define REGION (INIT_DBG | GENERIC_DBG | CFG80211_DBG | FIRM_DBG | HOSTAPD_DBG)
92 #define PRINT_D(region, ...) \
94 if (DEBUG == 1 && ((REGION)&(region))) { \
95 printk("DBG [%s: %d]", __func__, __LINE__); \
96 printk(__VA_ARGS__); \
100 #define PRINT_INFO(region, ...) \
102 if (INFO == 1 && ((REGION)&(region))) { \
103 printk("INFO [%s]", __func__); \
104 printk(__VA_ARGS__); \
108 #define PRINT_WRN(region, ...) \
110 if (WRN == 1 && ((REGION)&(region))) { \
111 printk("WRN [%s: %d]", __func__, __LINE__); \
112 printk(__VA_ARGS__); \
116 #define PRINT_ER(...) \
118 printk("ERR [%s: %d]", __func__, __LINE__); \
119 printk(__VA_ARGS__); \
124 #define FN_IN /* PRINT_D(">>> \n") */
125 #define FN_OUT /* PRINT_D("<<<\n") */
127 #define LINUX_RX_SIZE (96 * 1024)
128 #define LINUX_TX_SIZE (64 * 1024)
131 #define WILC_MULTICAST_TABLE_SIZE 8
133 #if defined (BEAGLE_BOARD)
134 #define SPI_CHANNEL 4
137 #define MODALIAS "wilc_spi4"
140 #define MODALIAS "wilc_spi3"
143 #elif defined(PLAT_WMS8304) /* rachel */
144 #define MODALIAS "wilc_spi"
146 #elif defined (PLAT_RKXXXX)
147 #define MODALIAS "WILC_IRQ"
148 #define GPIO_NUM RK30_PIN3_PD2 /* RK30_PIN3_PA1 */
150 /* RK2928_PIN1_PA7 */
152 #elif defined(CUSTOMER_PLATFORM)
154 TODO : specify MODALIAS name and GPIO number. This is certainly necessary for SPI interface.
157 * #define MODALIAS "WILC_SPI"
158 * #define GPIO_NUM 139
162 /* base on SAMA5D3_Xplained Board */
163 #define MODALIAS "WILC_SPI"
164 #define GPIO_NUM 0x44