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 int wilc_debugfs_init(void);
42 void wilc_debugfs_remove(void);
44 extern atomic_t REGION;
45 extern atomic_t DEBUG_LEVEL;
52 #define PRINT_D(region, ...) \
54 if ((atomic_read(&DEBUG_LEVEL) & DEBUG) && \
55 ((atomic_read(®ION)) & (region))) { \
56 printk("DBG [%s: %d]", __func__, __LINE__); \
57 printk(__VA_ARGS__); \
61 #define PRINT_INFO(region, ...) \
63 if ((atomic_read(&DEBUG_LEVEL) & INFO) && \
64 ((atomic_read(®ION)) & (region))) { \
65 printk("INFO [%s]", __func__); \
66 printk(__VA_ARGS__); \
70 #define PRINT_WRN(region, ...) \
72 if ((atomic_read(&DEBUG_LEVEL) & WRN) && \
73 ((atomic_read(®ION)) & (region))) { \
74 printk("WRN [%s: %d]", __func__, __LINE__); \
75 printk(__VA_ARGS__); \
79 #define PRINT_ER(...) \
81 if ((atomic_read(&DEBUG_LEVEL) & ERR)) { \
82 printk("ERR [%s: %d]", __func__, __LINE__); \
83 printk(__VA_ARGS__); \
89 #define REGION (INIT_DBG | GENERIC_DBG | CFG80211_DBG | FIRM_DBG | HOSTAPD_DBG)
95 #define PRINT_D(region, ...) \
97 if (DEBUG == 1 && ((REGION)&(region))) { \
98 printk("DBG [%s: %d]", __func__, __LINE__); \
99 printk(__VA_ARGS__); \
103 #define PRINT_INFO(region, ...) \
105 if (INFO == 1 && ((REGION)&(region))) { \
106 printk("INFO [%s]", __func__); \
107 printk(__VA_ARGS__); \
111 #define PRINT_WRN(region, ...) \
113 if (WRN == 1 && ((REGION)&(region))) { \
114 printk("WRN [%s: %d]", __func__, __LINE__); \
115 printk(__VA_ARGS__); \
119 #define PRINT_ER(...) \
121 printk("ERR [%s: %d]", __func__, __LINE__); \
122 printk(__VA_ARGS__); \
126 #define FN_IN /* PRINT_D(">>> \n") */
127 #define FN_OUT /* PRINT_D("<<<\n") */
130 #define LINUX_RX_SIZE (96 * 1024)
132 #define LINUX_TX_SIZE (64 * 1024)
135 #define WILC_MULTICAST_TABLE_SIZE 8
137 #if defined (BEAGLE_BOARD)
138 #define SPI_CHANNEL 4
141 #define MODALIAS "wilc_spi4"
144 #define MODALIAS "wilc_spi3"
147 #elif defined(PLAT_WMS8304) /* rachel */
148 #define MODALIAS "wilc_spi"
150 #elif defined (PLAT_RKXXXX)
151 #define MODALIAS "WILC_IRQ"
152 #define GPIO_NUM RK30_PIN3_PD2 /* RK30_PIN3_PA1 */
154 /* RK2928_PIN1_PA7 */
156 #elif defined(CUSTOMER_PLATFORM)
158 TODO : specify MODALIAS name and GPIO number. This is certainly necessary for SPI interface.
161 * #define MODALIAS "WILC_SPI"
162 * #define GPIO_NUM 139
166 /* base on SAMA5D3_Xplained Board */
167 #define MODALIAS "WILC_SPI"
168 #define GPIO_NUM 0x44