Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 1 | #ifndef WILC_WLAN_H |
| 2 | #define WILC_WLAN_H |
| 3 | |
Arnd Bergmann | 491880e | 2015-11-16 15:04:55 +0100 | [diff] [blame] | 4 | #include <linux/types.h> |
| 5 | |
Leo Kim | 7cf241a | 2015-11-06 11:19:56 +0900 | [diff] [blame] | 6 | #define ISWILC1000(id) ((id & 0xfffff000) == 0x100000 ? 1 : 0) |
Arnd Bergmann | 491880e | 2015-11-16 15:04:55 +0100 | [diff] [blame] | 7 | |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 8 | /******************************************** |
| 9 | * |
| 10 | * Mac eth header length |
| 11 | * |
| 12 | ********************************************/ |
Leo Kim | 7cf241a | 2015-11-06 11:19:56 +0900 | [diff] [blame] | 13 | #define DRIVER_HANDLER_SIZE 4 |
| 14 | #define MAX_MAC_HDR_LEN 26 /* QOS_MAC_HDR_LEN */ |
| 15 | #define SUB_MSDU_HEADER_LENGTH 14 |
| 16 | #define SNAP_HDR_LEN 8 |
| 17 | #define ETHERNET_HDR_LEN 14 |
| 18 | #define WORD_ALIGNMENT_PAD 0 |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 19 | |
Leo Kim | 7cf241a | 2015-11-06 11:19:56 +0900 | [diff] [blame] | 20 | #define ETH_ETHERNET_HDR_OFFSET (MAX_MAC_HDR_LEN + \ |
| 21 | SUB_MSDU_HEADER_LENGTH + \ |
| 22 | SNAP_HDR_LEN - \ |
| 23 | ETHERNET_HDR_LEN + \ |
| 24 | WORD_ALIGNMENT_PAD) |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 25 | |
Leo Kim | 7cf241a | 2015-11-06 11:19:56 +0900 | [diff] [blame] | 26 | #define HOST_HDR_OFFSET 4 |
| 27 | #define ETHERNET_HDR_LEN 14 |
| 28 | #define IP_HDR_LEN 20 |
| 29 | #define IP_HDR_OFFSET ETHERNET_HDR_LEN |
| 30 | #define UDP_HDR_OFFSET (IP_HDR_LEN + IP_HDR_OFFSET) |
| 31 | #define UDP_HDR_LEN 8 |
| 32 | #define UDP_DATA_OFFSET (UDP_HDR_OFFSET + UDP_HDR_LEN) |
| 33 | #define ETH_CONFIG_PKT_HDR_LEN UDP_DATA_OFFSET |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 34 | |
Leo Kim | 7cf241a | 2015-11-06 11:19:56 +0900 | [diff] [blame] | 35 | #define ETH_CONFIG_PKT_HDR_OFFSET (ETH_ETHERNET_HDR_OFFSET + \ |
| 36 | ETH_CONFIG_PKT_HDR_LEN) |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 37 | |
| 38 | /******************************************** |
| 39 | * |
| 40 | * Endian Conversion |
| 41 | * |
| 42 | ********************************************/ |
| 43 | |
Leo Kim | 7cf241a | 2015-11-06 11:19:56 +0900 | [diff] [blame] | 44 | #define BYTE_SWAP(val) (((val & 0x000000FF) << 24) + \ |
| 45 | ((val & 0x0000FF00) << 8) + \ |
| 46 | ((val & 0x00FF0000) >> 8) + \ |
| 47 | ((val & 0xFF000000) >> 24)) |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 48 | |
| 49 | /******************************************** |
| 50 | * |
| 51 | * Register Defines |
| 52 | * |
| 53 | ********************************************/ |
Leo Kim | 7cf241a | 2015-11-06 11:19:56 +0900 | [diff] [blame] | 54 | #define WILC_PERIPH_REG_BASE 0x1000 |
| 55 | #define WILC_CHANGING_VIR_IF 0x108c |
| 56 | #define WILC_CHIPID WILC_PERIPH_REG_BASE |
| 57 | #define WILC_GLB_RESET_0 (WILC_PERIPH_REG_BASE + 0x400) |
| 58 | #define WILC_PIN_MUX_0 (WILC_PERIPH_REG_BASE + 0x408) |
| 59 | #define WILC_HOST_TX_CTRL (WILC_PERIPH_REG_BASE + 0x6c) |
| 60 | #define WILC_HOST_RX_CTRL_0 (WILC_PERIPH_REG_BASE + 0x70) |
| 61 | #define WILC_HOST_RX_CTRL_1 (WILC_PERIPH_REG_BASE + 0x74) |
| 62 | #define WILC_HOST_VMM_CTL (WILC_PERIPH_REG_BASE + 0x78) |
| 63 | #define WILC_HOST_RX_CTRL (WILC_PERIPH_REG_BASE + 0x80) |
| 64 | #define WILC_HOST_RX_EXTRA_SIZE (WILC_PERIPH_REG_BASE + 0x84) |
| 65 | #define WILC_HOST_TX_CTRL_1 (WILC_PERIPH_REG_BASE + 0x88) |
| 66 | #define WILC_MISC (WILC_PERIPH_REG_BASE + 0x428) |
| 67 | #define WILC_INTR_REG_BASE (WILC_PERIPH_REG_BASE + 0xa00) |
| 68 | #define WILC_INTR_ENABLE WILC_INTR_REG_BASE |
| 69 | #define WILC_INTR2_ENABLE (WILC_INTR_REG_BASE + 4) |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 70 | |
Leo Kim | 7cf241a | 2015-11-06 11:19:56 +0900 | [diff] [blame] | 71 | #define WILC_INTR_POLARITY (WILC_INTR_REG_BASE + 0x10) |
| 72 | #define WILC_INTR_TYPE (WILC_INTR_REG_BASE + 0x20) |
| 73 | #define WILC_INTR_CLEAR (WILC_INTR_REG_BASE + 0x30) |
| 74 | #define WILC_INTR_STATUS (WILC_INTR_REG_BASE + 0x40) |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 75 | |
Leo Kim | 7cf241a | 2015-11-06 11:19:56 +0900 | [diff] [blame] | 76 | #define WILC_VMM_TBL_SIZE 64 |
| 77 | #define WILC_VMM_TX_TBL_BASE 0x150400 |
| 78 | #define WILC_VMM_RX_TBL_BASE 0x150500 |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 79 | |
Leo Kim | 7cf241a | 2015-11-06 11:19:56 +0900 | [diff] [blame] | 80 | #define WILC_VMM_BASE 0x150000 |
| 81 | #define WILC_VMM_CORE_CTL WILC_VMM_BASE |
| 82 | #define WILC_VMM_TBL_CTL (WILC_VMM_BASE + 0x4) |
| 83 | #define WILC_VMM_TBL_ENTRY (WILC_VMM_BASE + 0x8) |
| 84 | #define WILC_VMM_TBL0_SIZE (WILC_VMM_BASE + 0xc) |
| 85 | #define WILC_VMM_TO_HOST_SIZE (WILC_VMM_BASE + 0x10) |
| 86 | #define WILC_VMM_CORE_CFG (WILC_VMM_BASE + 0x14) |
| 87 | #define WILC_VMM_TBL_ACTIVE (WILC_VMM_BASE + 040) |
| 88 | #define WILC_VMM_TBL_STATUS (WILC_VMM_BASE + 0x44) |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 89 | |
Leo Kim | 7cf241a | 2015-11-06 11:19:56 +0900 | [diff] [blame] | 90 | #define WILC_SPI_REG_BASE 0xe800 |
| 91 | #define WILC_SPI_CTL WILC_SPI_REG_BASE |
| 92 | #define WILC_SPI_MASTER_DMA_ADDR (WILC_SPI_REG_BASE + 0x4) |
| 93 | #define WILC_SPI_MASTER_DMA_COUNT (WILC_SPI_REG_BASE + 0x8) |
| 94 | #define WILC_SPI_SLAVE_DMA_ADDR (WILC_SPI_REG_BASE + 0xc) |
| 95 | #define WILC_SPI_SLAVE_DMA_COUNT (WILC_SPI_REG_BASE + 0x10) |
| 96 | #define WILC_SPI_TX_MODE (WILC_SPI_REG_BASE + 0x20) |
| 97 | #define WILC_SPI_PROTOCOL_CONFIG (WILC_SPI_REG_BASE + 0x24) |
| 98 | #define WILC_SPI_INTR_CTL (WILC_SPI_REG_BASE + 0x2c) |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 99 | |
Leo Kim | 7cf241a | 2015-11-06 11:19:56 +0900 | [diff] [blame] | 100 | #define WILC_SPI_PROTOCOL_OFFSET (WILC_SPI_PROTOCOL_CONFIG - \ |
| 101 | WILC_SPI_REG_BASE) |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 102 | |
Leo Kim | 7cf241a | 2015-11-06 11:19:56 +0900 | [diff] [blame] | 103 | #define WILC_AHB_DATA_MEM_BASE 0x30000 |
| 104 | #define WILC_AHB_SHARE_MEM_BASE 0xd0000 |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 105 | |
Leo Kim | 7cf241a | 2015-11-06 11:19:56 +0900 | [diff] [blame] | 106 | #define WILC_VMM_TBL_RX_SHADOW_BASE WILC_AHB_SHARE_MEM_BASE |
| 107 | #define WILC_VMM_TBL_RX_SHADOW_SIZE 256 |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 108 | |
Leo Kim | 7cf241a | 2015-11-06 11:19:56 +0900 | [diff] [blame] | 109 | #define WILC_GP_REG_0 0x149c |
| 110 | #define WILC_GP_REG_1 0x14a0 |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 111 | |
Leo Kim | 97c14e8 | 2015-11-06 11:19:57 +0900 | [diff] [blame] | 112 | #define WILC_HAVE_SDIO_IRQ_GPIO BIT(0) |
| 113 | #define WILC_HAVE_USE_PMU BIT(1) |
| 114 | #define WILC_HAVE_SLEEP_CLK_SRC_RTC BIT(2) |
| 115 | #define WILC_HAVE_SLEEP_CLK_SRC_XO BIT(3) |
| 116 | #define WILC_HAVE_EXT_PA_INV_TX_RX BIT(4) |
| 117 | #define WILC_HAVE_LEGACY_RF_SETTINGS BIT(5) |
| 118 | #define WILC_HAVE_XTAL_24 BIT(6) |
| 119 | #define WILC_HAVE_DISABLE_WILC_UART BIT(7) |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 120 | |
| 121 | /******************************************** |
| 122 | * |
| 123 | * Wlan Defines |
| 124 | * |
| 125 | ********************************************/ |
Leo Kim | 7cf241a | 2015-11-06 11:19:56 +0900 | [diff] [blame] | 126 | #define WILC_CFG_PKT 1 |
| 127 | #define WILC_NET_PKT 0 |
| 128 | #define WILC_MGMT_PKT 2 |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 129 | |
Leo Kim | 7cf241a | 2015-11-06 11:19:56 +0900 | [diff] [blame] | 130 | #define WILC_CFG_SET 1 |
| 131 | #define WILC_CFG_QUERY 0 |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 132 | |
Leo Kim | 7cf241a | 2015-11-06 11:19:56 +0900 | [diff] [blame] | 133 | #define WILC_CFG_RSP 1 |
| 134 | #define WILC_CFG_RSP_STATUS 2 |
| 135 | #define WILC_CFG_RSP_SCAN 3 |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 136 | |
| 137 | #ifdef WILC_SDIO |
Leo Kim | 7cf241a | 2015-11-06 11:19:56 +0900 | [diff] [blame] | 138 | #define WILC_PLL_TO 4 |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 139 | #else |
Leo Kim | 7cf241a | 2015-11-06 11:19:56 +0900 | [diff] [blame] | 140 | #define WILC_PLL_TO 2 |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 141 | #endif |
Leo Kim | 7cf241a | 2015-11-06 11:19:56 +0900 | [diff] [blame] | 142 | #define ABORT_INT BIT(31) |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 143 | |
| 144 | /*******************************************/ |
| 145 | /* E0 and later Interrupt flags. */ |
| 146 | /*******************************************/ |
| 147 | /*******************************************/ |
| 148 | /* E0 and later Interrupt flags. */ |
| 149 | /* IRQ Status word */ |
| 150 | /* 15:0 = DMA count in words. */ |
| 151 | /* 16: INT0 flag */ |
| 152 | /* 17: INT1 flag */ |
| 153 | /* 18: INT2 flag */ |
| 154 | /* 19: INT3 flag */ |
| 155 | /* 20: INT4 flag */ |
| 156 | /* 21: INT5 flag */ |
| 157 | /*******************************************/ |
Leo Kim | 7cf241a | 2015-11-06 11:19:56 +0900 | [diff] [blame] | 158 | #define IRG_FLAGS_OFFSET 16 |
| 159 | #define IRQ_DMA_WD_CNT_MASK ((1ul << IRG_FLAGS_OFFSET) - 1) |
Leo Kim | 97c14e8 | 2015-11-06 11:19:57 +0900 | [diff] [blame] | 160 | #define INT_0 BIT(IRG_FLAGS_OFFSET) |
| 161 | #define INT_1 BIT(IRG_FLAGS_OFFSET + 1) |
| 162 | #define INT_2 BIT(IRG_FLAGS_OFFSET + 2) |
| 163 | #define INT_3 BIT(IRG_FLAGS_OFFSET + 3) |
| 164 | #define INT_4 BIT(IRG_FLAGS_OFFSET + 4) |
| 165 | #define INT_5 BIT(IRG_FLAGS_OFFSET + 5) |
Leo Kim | 7cf241a | 2015-11-06 11:19:56 +0900 | [diff] [blame] | 166 | #define MAX_NUM_INT 6 |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 167 | |
| 168 | /*******************************************/ |
| 169 | /* E0 and later Interrupt flags. */ |
| 170 | /* IRQ Clear word */ |
| 171 | /* 0: Clear INT0 */ |
| 172 | /* 1: Clear INT1 */ |
| 173 | /* 2: Clear INT2 */ |
| 174 | /* 3: Clear INT3 */ |
| 175 | /* 4: Clear INT4 */ |
| 176 | /* 5: Clear INT5 */ |
| 177 | /* 6: Select VMM table 1 */ |
| 178 | /* 7: Select VMM table 2 */ |
| 179 | /* 8: Enable VMM */ |
| 180 | /*******************************************/ |
Leo Kim | 7cf241a | 2015-11-06 11:19:56 +0900 | [diff] [blame] | 181 | #define CLR_INT0 BIT(0) |
| 182 | #define CLR_INT1 BIT(1) |
| 183 | #define CLR_INT2 BIT(2) |
| 184 | #define CLR_INT3 BIT(3) |
| 185 | #define CLR_INT4 BIT(4) |
| 186 | #define CLR_INT5 BIT(5) |
| 187 | #define SEL_VMM_TBL0 BIT(6) |
| 188 | #define SEL_VMM_TBL1 BIT(7) |
| 189 | #define EN_VMM BIT(8) |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 190 | |
Leo Kim | 7cf241a | 2015-11-06 11:19:56 +0900 | [diff] [blame] | 191 | #define DATA_INT_EXT INT_0 |
| 192 | #define PLL_INT_EXT INT_1 |
| 193 | #define SLEEP_INT_EXT INT_2 |
| 194 | #define ALL_INT_EXT (DATA_INT_EXT | PLL_INT_EXT | SLEEP_INT_EXT) |
| 195 | #define NUM_INT_EXT 3 |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 196 | |
Leo Kim | 7cf241a | 2015-11-06 11:19:56 +0900 | [diff] [blame] | 197 | #define DATA_INT_CLR CLR_INT0 |
| 198 | #define PLL_INT_CLR CLR_INT1 |
| 199 | #define SLEEP_INT_CLR CLR_INT2 |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 200 | |
Leo Kim | 7cf241a | 2015-11-06 11:19:56 +0900 | [diff] [blame] | 201 | #define ENABLE_RX_VMM (SEL_VMM_TBL1 | EN_VMM) |
| 202 | #define ENABLE_TX_VMM (SEL_VMM_TBL0 | EN_VMM) |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 203 | /*time for expiring the semaphores of cfg packets*/ |
| 204 | #define CFG_PKTS_TIMEOUT 2000 |
| 205 | /******************************************** |
| 206 | * |
| 207 | * Debug Type |
| 208 | * |
| 209 | ********************************************/ |
Chaehyun Lim | fbc2fe1 | 2015-09-15 14:06:16 +0900 | [diff] [blame] | 210 | typedef void (*wilc_debug_func)(u32, char *, ...); |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 211 | |
| 212 | /******************************************** |
| 213 | * |
| 214 | * Tx/Rx Queue Structure |
| 215 | * |
| 216 | ********************************************/ |
| 217 | |
| 218 | struct txq_entry_t { |
| 219 | struct txq_entry_t *next; |
| 220 | struct txq_entry_t *prev; |
| 221 | int type; |
Leo Kim | 8e55639 | 2015-11-06 11:19:51 +0900 | [diff] [blame] | 222 | int index; |
Chaehyun Lim | 51e825f | 2015-09-15 14:06:14 +0900 | [diff] [blame] | 223 | u8 *buffer; |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 224 | int buffer_size; |
| 225 | void *priv; |
| 226 | int status; |
| 227 | void (*tx_complete_func)(void *, int); |
| 228 | }; |
| 229 | |
| 230 | struct rxq_entry_t { |
| 231 | struct rxq_entry_t *next; |
Chaehyun Lim | 51e825f | 2015-09-15 14:06:14 +0900 | [diff] [blame] | 232 | u8 *buffer; |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 233 | int buffer_size; |
| 234 | }; |
| 235 | |
| 236 | /******************************************** |
| 237 | * |
| 238 | * Host IF Structure |
| 239 | * |
| 240 | ********************************************/ |
Glen Lee | 9c80032 | 2015-11-06 18:40:22 +0900 | [diff] [blame] | 241 | struct wilc; |
Leo Kim | 48d0aa9 | 2015-11-06 11:20:02 +0900 | [diff] [blame] | 242 | struct wilc_hif_func { |
Glen Lee | 9c80032 | 2015-11-06 18:40:22 +0900 | [diff] [blame] | 243 | int (*hif_init)(struct wilc *, wilc_debug_func); |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 244 | int (*hif_deinit)(void *); |
Chaehyun Lim | fbc2fe1 | 2015-09-15 14:06:16 +0900 | [diff] [blame] | 245 | int (*hif_read_reg)(u32, u32 *); |
| 246 | int (*hif_write_reg)(u32, u32); |
| 247 | int (*hif_block_rx)(u32, u8 *, u32); |
| 248 | int (*hif_block_tx)(u32, u8 *, u32); |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 249 | int (*hif_sync)(void); |
| 250 | int (*hif_clear_int)(void); |
Chaehyun Lim | fbc2fe1 | 2015-09-15 14:06:16 +0900 | [diff] [blame] | 251 | int (*hif_read_int)(u32 *); |
| 252 | int (*hif_clear_int_ext)(u32); |
| 253 | int (*hif_read_size)(u32 *); |
| 254 | int (*hif_block_tx_ext)(u32, u8 *, u32); |
| 255 | int (*hif_block_rx_ext)(u32, u8 *, u32); |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 256 | int (*hif_sync_ext)(int); |
| 257 | void (*hif_set_max_bus_speed)(void); |
| 258 | void (*hif_set_default_bus_speed)(void); |
Arnd Bergmann | 5547c1f | 2015-11-16 15:05:06 +0100 | [diff] [blame^] | 259 | int (*enable_interrupt)(struct wilc *nic); |
| 260 | void (*disable_interrupt)(struct wilc *nic); |
Leo Kim | 48d0aa9 | 2015-11-06 11:20:02 +0900 | [diff] [blame] | 261 | }; |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 262 | |
Arnd Bergmann | 7d37a4a | 2015-11-16 15:05:05 +0100 | [diff] [blame] | 263 | extern const struct wilc_hif_func wilc_hif_spi; |
| 264 | extern const struct wilc_hif_func wilc_hif_sdio; |
Arnd Bergmann | 491880e | 2015-11-16 15:04:55 +0100 | [diff] [blame] | 265 | |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 266 | /******************************************** |
| 267 | * |
| 268 | * Configuration Structure |
| 269 | * |
| 270 | ********************************************/ |
| 271 | |
Leo Kim | 7cf241a | 2015-11-06 11:19:56 +0900 | [diff] [blame] | 272 | #define MAX_CFG_FRAME_SIZE 1468 |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 273 | |
Leo Kim | 14cdc0a | 2015-11-06 11:19:59 +0900 | [diff] [blame] | 274 | struct wilc_cfg_frame { |
Chaehyun Lim | 51e825f | 2015-09-15 14:06:14 +0900 | [diff] [blame] | 275 | u8 ether_header[14]; |
| 276 | u8 ip_header[20]; |
| 277 | u8 udp_header[8]; |
| 278 | u8 wid_header[8]; |
| 279 | u8 frame[MAX_CFG_FRAME_SIZE]; |
Leo Kim | 14cdc0a | 2015-11-06 11:19:59 +0900 | [diff] [blame] | 280 | }; |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 281 | |
Leo Kim | bcddd48 | 2015-11-06 11:20:01 +0900 | [diff] [blame] | 282 | struct wilc_cfg_rsp { |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 283 | int type; |
Chaehyun Lim | fbc2fe1 | 2015-09-15 14:06:16 +0900 | [diff] [blame] | 284 | u32 seq_no; |
Leo Kim | bcddd48 | 2015-11-06 11:20:01 +0900 | [diff] [blame] | 285 | }; |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 286 | |
Arnd Bergmann | 491880e | 2015-11-16 15:04:55 +0100 | [diff] [blame] | 287 | struct wilc; |
| 288 | |
Glen Lee | 63d7ab8 | 2015-10-01 16:03:32 +0900 | [diff] [blame] | 289 | int wilc_wlan_firmware_download(const u8 *buffer, u32 buffer_size); |
Glen Lee | e42563b | 2015-10-01 16:03:33 +0900 | [diff] [blame] | 290 | int wilc_wlan_start(void); |
Glen Lee | 8cec741 | 2015-10-01 16:03:34 +0900 | [diff] [blame] | 291 | int wilc_wlan_stop(void); |
Glen Lee | 691bbd4 | 2015-10-27 18:28:02 +0900 | [diff] [blame] | 292 | int wilc_wlan_txq_add_net_pkt(struct net_device *dev, void *priv, u8 *buffer, |
| 293 | u32 buffer_size, wilc_tx_complete_func_t func); |
Leo Kim | b1d1929 | 2015-11-06 11:13:01 +0900 | [diff] [blame] | 294 | int wilc_wlan_handle_txq(struct net_device *dev, u32 *txq_count); |
Glen Lee | 50b929e | 2015-10-27 18:27:40 +0900 | [diff] [blame] | 295 | void wilc_handle_isr(void *wilc); |
Glen Lee | 2de7cbe | 2015-10-27 18:27:54 +0900 | [diff] [blame] | 296 | void wilc_wlan_cleanup(struct net_device *dev); |
Glen Lee | 1028e5a | 2015-10-01 16:03:40 +0900 | [diff] [blame] | 297 | int wilc_wlan_cfg_set(int start, u32 wid, u8 *buffer, u32 buffer_size, |
Leo Kim | 9cd034b | 2015-11-06 11:13:09 +0900 | [diff] [blame] | 298 | int commit, u32 drv_handler); |
Leo Kim | 4878bd6 | 2015-11-06 11:13:10 +0900 | [diff] [blame] | 299 | int wilc_wlan_cfg_get(int start, u32 wid, int commit, u32 drv_handler); |
Glen Lee | 894de36b | 2015-10-01 16:03:42 +0900 | [diff] [blame] | 300 | int wilc_wlan_cfg_get_val(u32 wid, u8 *buffer, u32 buffer_size); |
Glen Lee | 829c477 | 2015-10-29 12:18:44 +0900 | [diff] [blame] | 301 | int wilc_wlan_txq_add_mgmt_pkt(struct net_device *dev, void *priv, u8 *buffer, |
| 302 | u32 buffer_size, wilc_tx_complete_func_t func); |
Arnd Bergmann | 0e1af73 | 2015-11-16 15:04:54 +0100 | [diff] [blame] | 303 | void wilc_chip_sleep_manually(void); |
Arnd Bergmann | 491880e | 2015-11-16 15:04:55 +0100 | [diff] [blame] | 304 | |
| 305 | void wilc_enable_tcp_ack_filter(bool value); |
| 306 | int wilc_wlan_get_num_conn_ifcs(void); |
| 307 | int wilc_mac_xmit(struct sk_buff *skb, struct net_device *dev); |
| 308 | |
| 309 | int wilc_mac_open(struct net_device *ndev); |
| 310 | int wilc_mac_close(struct net_device *ndev); |
| 311 | |
| 312 | int wilc_wlan_set_bssid(struct net_device *wilc_netdev, u8 *pBSSID); |
| 313 | void WILC_WFI_p2p_rx(struct net_device *dev, u8 *buff, u32 size); |
| 314 | |
| 315 | extern bool wilc_enable_ps; |
| 316 | |
Johnny Kim | c5c77ba | 2015-05-11 14:30:56 +0900 | [diff] [blame] | 317 | #endif |