aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/wl12xx/wl12xx.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/wl12xx/wl12xx.h')
-rw-r--r--drivers/net/wireless/wl12xx/wl12xx.h66
1 files changed, 56 insertions, 10 deletions
diff --git a/drivers/net/wireless/wl12xx/wl12xx.h b/drivers/net/wireless/wl12xx/wl12xx.h
index 86be83e25ec5..7c521af58e7d 100644
--- a/drivers/net/wireless/wl12xx/wl12xx.h
+++ b/drivers/net/wireless/wl12xx/wl12xx.h
@@ -131,9 +131,16 @@ extern u32 wl12xx_debug_level;
131 131
132 132
133#define WL1271_FW_NAME "ti-connectivity/wl1271-fw-2.bin" 133#define WL1271_FW_NAME "ti-connectivity/wl1271-fw-2.bin"
134#define WL1271_AP_FW_NAME "ti-connectivity/wl1271-fw-ap.bin" 134#define WL128X_FW_NAME "ti-connectivity/wl128x-fw.bin"
135#define WL127X_AP_FW_NAME "ti-connectivity/wl1271-fw-ap.bin"
136#define WL128X_AP_FW_NAME "ti-connectivity/wl128x-fw-ap.bin"
135 137
136#define WL1271_NVS_NAME "ti-connectivity/wl1271-nvs.bin" 138/*
139 * wl127x and wl128x are using the same NVS file name. However, the
140 * ini parameters between them are different. The driver validates
141 * the correct NVS size in wl1271_boot_upload_nvs().
142 */
143#define WL12XX_NVS_NAME "ti-connectivity/wl1271-nvs.bin"
137 144
138#define WL1271_TX_SECURITY_LO16(s) ((u16)((s) & 0xffff)) 145#define WL1271_TX_SECURITY_LO16(s) ((u16)((s) & 0xffff))
139#define WL1271_TX_SECURITY_HI32(s) ((u32)(((s) >> 16) & 0xffffffff)) 146#define WL1271_TX_SECURITY_HI32(s) ((u32)(((s) >> 16) & 0xffffffff))
@@ -165,7 +172,6 @@ extern u32 wl12xx_debug_level;
165#define WL1271_PS_STA_MAX_BLOCKS (2 * 9) 172#define WL1271_PS_STA_MAX_BLOCKS (2 * 9)
166 173
167#define WL1271_AP_BSS_INDEX 0 174#define WL1271_AP_BSS_INDEX 0
168#define WL1271_AP_DEF_INACTIV_SEC 300
169#define WL1271_AP_DEF_BEACON_EXP 20 175#define WL1271_AP_DEF_BEACON_EXP 20
170 176
171#define ACX_TX_DESCRIPTORS 32 177#define ACX_TX_DESCRIPTORS 32
@@ -200,13 +206,29 @@ struct wl1271_partition_set {
200 206
201struct wl1271; 207struct wl1271;
202 208
203#define WL12XX_NUM_FW_VER 5 209enum {
210 FW_VER_CHIP,
211 FW_VER_IF_TYPE,
212 FW_VER_MAJOR,
213 FW_VER_SUBTYPE,
214 FW_VER_MINOR,
215
216 NUM_FW_VER
217};
218
219#define FW_VER_CHIP_WL127X 6
220#define FW_VER_CHIP_WL128X 7
221
222#define FW_VER_IF_TYPE_STA 1
223#define FW_VER_IF_TYPE_AP 2
224
225#define FW_VER_MINOR_1_SPARE_STA_MIN 58
226#define FW_VER_MINOR_1_SPARE_AP_MIN 47
204 227
205/* FIXME: I'm not sure about this structure name */
206struct wl1271_chip { 228struct wl1271_chip {
207 u32 id; 229 u32 id;
208 char fw_ver_str[ETHTOOL_BUSINFO_LEN]; 230 char fw_ver_str[ETHTOOL_BUSINFO_LEN];
209 unsigned int fw_ver[WL12XX_NUM_FW_VER]; 231 unsigned int fw_ver[NUM_FW_VER];
210}; 232};
211 233
212struct wl1271_stats { 234struct wl1271_stats {
@@ -261,6 +283,8 @@ struct wl1271_fw_sta_status {
261 u8 tx_total; 283 u8 tx_total;
262 u8 reserved1; 284 u8 reserved1;
263 __le16 reserved2; 285 __le16 reserved2;
286 /* Total structure size is 68 bytes */
287 u32 padding;
264} __packed; 288} __packed;
265 289
266struct wl1271_fw_full_status { 290struct wl1271_fw_full_status {
@@ -277,9 +301,10 @@ struct wl1271_rx_mem_pool_addr {
277 u32 addr_extra; 301 u32 addr_extra;
278}; 302};
279 303
304#define WL1271_MAX_CHANNELS 64
280struct wl1271_scan { 305struct wl1271_scan {
281 struct cfg80211_scan_request *req; 306 struct cfg80211_scan_request *req;
282 bool *scanned_ch; 307 unsigned long scanned_ch[BITS_TO_LONGS(WL1271_MAX_CHANNELS)];
283 bool failed; 308 bool failed;
284 u8 state; 309 u8 state;
285 u8 ssid[IW_ESSID_MAX_SIZE+1]; 310 u8 ssid[IW_ESSID_MAX_SIZE+1];
@@ -297,6 +322,7 @@ struct wl1271_if_operations {
297 struct device* (*dev)(struct wl1271 *wl); 322 struct device* (*dev)(struct wl1271 *wl);
298 void (*enable_irq)(struct wl1271 *wl); 323 void (*enable_irq)(struct wl1271 *wl);
299 void (*disable_irq)(struct wl1271 *wl); 324 void (*disable_irq)(struct wl1271 *wl);
325 void (*set_block_size) (struct wl1271 *wl, unsigned int blksz);
300}; 326};
301 327
302#define MAX_NUM_KEYS 14 328#define MAX_NUM_KEYS 14
@@ -327,7 +353,9 @@ enum wl12xx_flags {
327 WL1271_FLAG_PSPOLL_FAILURE, 353 WL1271_FLAG_PSPOLL_FAILURE,
328 WL1271_FLAG_STA_STATE_SENT, 354 WL1271_FLAG_STA_STATE_SENT,
329 WL1271_FLAG_FW_TX_BUSY, 355 WL1271_FLAG_FW_TX_BUSY,
330 WL1271_FLAG_AP_STARTED 356 WL1271_FLAG_AP_STARTED,
357 WL1271_FLAG_IF_INITIALIZED,
358 WL1271_FLAG_DUMMY_PACKET_PENDING,
331}; 359};
332 360
333struct wl1271_link { 361struct wl1271_link {
@@ -371,7 +399,7 @@ struct wl1271 {
371 u8 *fw; 399 u8 *fw;
372 size_t fw_len; 400 size_t fw_len;
373 u8 fw_bss_type; 401 u8 fw_bss_type;
374 struct wl1271_nvs_file *nvs; 402 void *nvs;
375 size_t nvs_len; 403 size_t nvs_len;
376 404
377 s8 hw_pg_ver; 405 s8 hw_pg_ver;
@@ -389,6 +417,7 @@ struct wl1271 {
389 /* Accounting for allocated / available TX blocks on HW */ 417 /* Accounting for allocated / available TX blocks on HW */
390 u32 tx_blocks_freed[NUM_TX_QUEUES]; 418 u32 tx_blocks_freed[NUM_TX_QUEUES];
391 u32 tx_blocks_available; 419 u32 tx_blocks_available;
420 u32 tx_allocated_blocks;
392 u32 tx_results_count; 421 u32 tx_results_count;
393 422
394 /* Transmitted TX packets counter for chipset interface */ 423 /* Transmitted TX packets counter for chipset interface */
@@ -430,6 +459,9 @@ struct wl1271 {
430 /* Intermediate buffer, used for packet aggregation */ 459 /* Intermediate buffer, used for packet aggregation */
431 u8 *aggr_buf; 460 u8 *aggr_buf;
432 461
462 /* Reusable dummy packet template */
463 struct sk_buff *dummy_packet;
464
433 /* Network stack work */ 465 /* Network stack work */
434 struct work_struct netstack_work; 466 struct work_struct netstack_work;
435 467
@@ -527,6 +559,8 @@ struct wl1271 {
527 bool ba_support; 559 bool ba_support;
528 u8 ba_rx_bitmap; 560 u8 ba_rx_bitmap;
529 561
562 int tcxo_clock;
563
530 /* 564 /*
531 * AP-mode - links indexed by HLID. The global and broadcast links 565 * AP-mode - links indexed by HLID. The global and broadcast links
532 * are always active. 566 * are always active.
@@ -544,6 +578,9 @@ struct wl1271 {
544 578
545 /* Quirks of specific hardware revisions */ 579 /* Quirks of specific hardware revisions */
546 unsigned int quirks; 580 unsigned int quirks;
581
582 /* Platform limitations */
583 unsigned int platform_quirks;
547}; 584};
548 585
549struct wl1271_station { 586struct wl1271_station {
@@ -576,6 +613,15 @@ int wl1271_plt_stop(struct wl1271 *wl);
576/* Quirks */ 613/* Quirks */
577 614
578/* Each RX/TX transaction requires an end-of-transaction transfer */ 615/* Each RX/TX transaction requires an end-of-transaction transfer */
579#define WL12XX_QUIRK_END_OF_TRANSACTION BIT(0) 616#define WL12XX_QUIRK_END_OF_TRANSACTION BIT(0)
617
618/*
619 * Older firmwares use 2 spare TX blocks
620 * (for STA < 6.1.3.50.58 or for AP < 6.2.0.0.47)
621 */
622#define WL12XX_QUIRK_USE_2_SPARE_BLOCKS BIT(1)
623
624/* WL128X requires aggregated packets to be aligned to the SDIO block size */
625#define WL12XX_QUIRK_BLOCKSIZE_ALIGNMENT BIT(2)
580 626
581#endif 627#endif