aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/wl12xx/wl1271.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/wl12xx/wl1271.h')
-rw-r--r--drivers/net/wireless/wl12xx/wl1271.h63
1 files changed, 47 insertions, 16 deletions
diff --git a/drivers/net/wireless/wl12xx/wl1271.h b/drivers/net/wireless/wl12xx/wl1271.h
index 97ea5096bc8c..6f1b6b5640c0 100644
--- a/drivers/net/wireless/wl12xx/wl1271.h
+++ b/drivers/net/wireless/wl12xx/wl1271.h
@@ -53,6 +53,9 @@ enum {
53 DEBUG_MAC80211 = BIT(11), 53 DEBUG_MAC80211 = BIT(11),
54 DEBUG_CMD = BIT(12), 54 DEBUG_CMD = BIT(12),
55 DEBUG_ACX = BIT(13), 55 DEBUG_ACX = BIT(13),
56 DEBUG_SDIO = BIT(14),
57 DEBUG_FILTERS = BIT(15),
58 DEBUG_ADHOC = BIT(16),
56 DEBUG_ALL = ~0, 59 DEBUG_ALL = ~0,
57}; 60};
58 61
@@ -110,6 +113,9 @@ enum {
110#define WL1271_FW_NAME "wl1271-fw.bin" 113#define WL1271_FW_NAME "wl1271-fw.bin"
111#define WL1271_NVS_NAME "wl1271-nvs.bin" 114#define WL1271_NVS_NAME "wl1271-nvs.bin"
112 115
116#define WL1271_TX_SECURITY_LO16(s) ((u16)((s) & 0xffff))
117#define WL1271_TX_SECURITY_HI32(s) ((u32)(((s) >> 16) & 0xffffffff))
118
113/* NVS data structure */ 119/* NVS data structure */
114#define WL1271_NVS_SECTION_SIZE 468 120#define WL1271_NVS_SECTION_SIZE 468
115 121
@@ -142,14 +148,7 @@ struct wl1271_nvs_file {
142 */ 148 */
143#undef WL1271_80211A_ENABLED 149#undef WL1271_80211A_ENABLED
144 150
145/* 151#define WL1271_BUSY_WORD_CNT 1
146 * FIXME: for the wl1271, a busy word count of 1 here will result in a more
147 * optimal SPI interface. There is some SPI bug however, causing RXS time outs
148 * with this mode occasionally on boot, so lets have three for now. A value of
149 * three should make sure, that the chipset will always be ready, though this
150 * will impact throughput and latencies slightly.
151 */
152#define WL1271_BUSY_WORD_CNT 3
153#define WL1271_BUSY_WORD_LEN (WL1271_BUSY_WORD_CNT * sizeof(u32)) 152#define WL1271_BUSY_WORD_LEN (WL1271_BUSY_WORD_CNT * sizeof(u32))
154 153
155#define WL1271_ELP_HW_STATE_ASLEEP 0 154#define WL1271_ELP_HW_STATE_ASLEEP 0
@@ -334,11 +333,27 @@ struct wl1271_scan {
334 u8 probe_requests; 333 u8 probe_requests;
335}; 334};
336 335
336struct wl1271_if_operations {
337 void (*read)(struct wl1271 *wl, int addr, void *buf, size_t len,
338 bool fixed);
339 void (*write)(struct wl1271 *wl, int addr, void *buf, size_t len,
340 bool fixed);
341 void (*reset)(struct wl1271 *wl);
342 void (*init)(struct wl1271 *wl);
343 void (*power)(struct wl1271 *wl, bool enable);
344 struct device* (*dev)(struct wl1271 *wl);
345 void (*enable_irq)(struct wl1271 *wl);
346 void (*disable_irq)(struct wl1271 *wl);
347};
348
337struct wl1271 { 349struct wl1271 {
350 struct platform_device *plat_dev;
338 struct ieee80211_hw *hw; 351 struct ieee80211_hw *hw;
339 bool mac80211_registered; 352 bool mac80211_registered;
340 353
341 struct spi_device *spi; 354 void *if_priv;
355
356 struct wl1271_if_operations *if_ops;
342 357
343 void (*set_power)(bool enable); 358 void (*set_power)(bool enable);
344 int irq; 359 int irq;
@@ -357,6 +372,9 @@ struct wl1271 {
357#define WL1271_FLAG_IN_ELP (6) 372#define WL1271_FLAG_IN_ELP (6)
358#define WL1271_FLAG_PSM (7) 373#define WL1271_FLAG_PSM (7)
359#define WL1271_FLAG_PSM_REQUESTED (8) 374#define WL1271_FLAG_PSM_REQUESTED (8)
375#define WL1271_FLAG_IRQ_PENDING (9)
376#define WL1271_FLAG_IRQ_RUNNING (10)
377#define WL1271_FLAG_IDLE (11)
360 unsigned long flags; 378 unsigned long flags;
361 379
362 struct wl1271_partition_set part; 380 struct wl1271_partition_set part;
@@ -370,9 +388,12 @@ struct wl1271 {
370 size_t fw_len; 388 size_t fw_len;
371 struct wl1271_nvs_file *nvs; 389 struct wl1271_nvs_file *nvs;
372 390
391 s8 hw_pg_ver;
392
373 u8 bssid[ETH_ALEN]; 393 u8 bssid[ETH_ALEN];
374 u8 mac_addr[ETH_ALEN]; 394 u8 mac_addr[ETH_ALEN];
375 u8 bss_type; 395 u8 bss_type;
396 u8 set_bss_type;
376 u8 ssid[IW_ESSID_MAX_SIZE + 1]; 397 u8 ssid[IW_ESSID_MAX_SIZE + 1];
377 u8 ssid_len; 398 u8 ssid_len;
378 int channel; 399 int channel;
@@ -382,13 +403,13 @@ struct wl1271 {
382 /* Accounting for allocated / available TX blocks on HW */ 403 /* Accounting for allocated / available TX blocks on HW */
383 u32 tx_blocks_freed[NUM_TX_QUEUES]; 404 u32 tx_blocks_freed[NUM_TX_QUEUES];
384 u32 tx_blocks_available; 405 u32 tx_blocks_available;
385 u8 tx_results_count; 406 u32 tx_results_count;
386 407
387 /* Transmitted TX packets counter for chipset interface */ 408 /* Transmitted TX packets counter for chipset interface */
388 int tx_packets_count; 409 u32 tx_packets_count;
389 410
390 /* Time-offset between host and chipset clocks */ 411 /* Time-offset between host and chipset clocks */
391 int time_offset; 412 s64 time_offset;
392 413
393 /* Session counter for the chipset */ 414 /* Session counter for the chipset */
394 int session_counter; 415 int session_counter;
@@ -403,8 +424,7 @@ struct wl1271 {
403 424
404 /* Security sequence number counters */ 425 /* Security sequence number counters */
405 u8 tx_security_last_seq; 426 u8 tx_security_last_seq;
406 u16 tx_security_seq_16; 427 s64 tx_security_seq;
407 u32 tx_security_seq_32;
408 428
409 /* FW Rx counter */ 429 /* FW Rx counter */
410 u32 rx_counter; 430 u32 rx_counter;
@@ -430,14 +450,19 @@ struct wl1271 {
430 /* currently configured rate set */ 450 /* currently configured rate set */
431 u32 sta_rate_set; 451 u32 sta_rate_set;
432 u32 basic_rate_set; 452 u32 basic_rate_set;
453 u32 basic_rate;
433 u32 rate_set; 454 u32 rate_set;
434 455
435 /* The current band */ 456 /* The current band */
436 enum ieee80211_band band; 457 enum ieee80211_band band;
437 458
459 /* Beaconing interval (needed for ad-hoc) */
460 u32 beacon_int;
461
438 /* Default key (for WEP) */ 462 /* Default key (for WEP) */
439 u32 default_key; 463 u32 default_key;
440 464
465 unsigned int filters;
441 unsigned int rx_config; 466 unsigned int rx_config;
442 unsigned int rx_filter; 467 unsigned int rx_filter;
443 468
@@ -450,10 +475,13 @@ struct wl1271 {
450 /* in dBm */ 475 /* in dBm */
451 int power_level; 476 int power_level;
452 477
478 int rssi_thold;
479 int last_rssi_event;
480
453 struct wl1271_stats stats; 481 struct wl1271_stats stats;
454 struct wl1271_debugfs debugfs; 482 struct wl1271_debugfs debugfs;
455 483
456 u32 buffer_32; 484 __le32 buffer_32;
457 u32 buffer_cmd; 485 u32 buffer_cmd;
458 u32 buffer_busyword[WL1271_BUSY_WORD_CNT]; 486 u32 buffer_busyword[WL1271_BUSY_WORD_CNT];
459 487
@@ -465,6 +493,8 @@ struct wl1271 {
465 /* Current chipset configuration */ 493 /* Current chipset configuration */
466 struct conf_drv_settings conf; 494 struct conf_drv_settings conf;
467 495
496 bool sg_enabled;
497
468 struct list_head list; 498 struct list_head list;
469}; 499};
470 500
@@ -477,7 +507,8 @@ int wl1271_plt_stop(struct wl1271 *wl);
477 507
478#define WL1271_DEFAULT_POWER_LEVEL 0 508#define WL1271_DEFAULT_POWER_LEVEL 0
479 509
480#define WL1271_TX_QUEUE_MAX_LENGTH 20 510#define WL1271_TX_QUEUE_LOW_WATERMARK 10
511#define WL1271_TX_QUEUE_HIGH_WATERMARK 25
481 512
482/* WL1271 needs a 200ms sleep after power on, and a 20ms sleep before power 513/* WL1271 needs a 200ms sleep after power on, and a 20ms sleep before power
483 on in case is has been shut down shortly before */ 514 on in case is has been shut down shortly before */