diff options
Diffstat (limited to 'drivers/net/wireless/wl12xx/wl1271.h')
-rw-r--r-- | drivers/net/wireless/wl12xx/wl1271.h | 95 |
1 files changed, 79 insertions, 16 deletions
diff --git a/drivers/net/wireless/wl12xx/wl1271.h b/drivers/net/wireless/wl12xx/wl1271.h index 55818f94017b..94359b1a861f 100644 --- a/drivers/net/wireless/wl12xx/wl1271.h +++ b/drivers/net/wireless/wl12xx/wl1271.h | |||
@@ -32,6 +32,8 @@ | |||
32 | #include <linux/bitops.h> | 32 | #include <linux/bitops.h> |
33 | #include <net/mac80211.h> | 33 | #include <net/mac80211.h> |
34 | 34 | ||
35 | #include "wl1271_conf.h" | ||
36 | |||
35 | #define DRIVER_NAME "wl1271" | 37 | #define DRIVER_NAME "wl1271" |
36 | #define DRIVER_PREFIX DRIVER_NAME ": " | 38 | #define DRIVER_PREFIX DRIVER_NAME ": " |
37 | 39 | ||
@@ -97,21 +99,42 @@ enum { | |||
97 | } while (0) | 99 | } while (0) |
98 | 100 | ||
99 | #define WL1271_DEFAULT_RX_CONFIG (CFG_UNI_FILTER_EN | \ | 101 | #define WL1271_DEFAULT_RX_CONFIG (CFG_UNI_FILTER_EN | \ |
100 | CFG_BSSID_FILTER_EN) | 102 | CFG_BSSID_FILTER_EN | \ |
103 | CFG_MC_FILTER_EN) | ||
101 | 104 | ||
102 | #define WL1271_DEFAULT_RX_FILTER (CFG_RX_RCTS_ACK | CFG_RX_PRSP_EN | \ | 105 | #define WL1271_DEFAULT_RX_FILTER (CFG_RX_RCTS_ACK | CFG_RX_PRSP_EN | \ |
103 | CFG_RX_MGMT_EN | CFG_RX_DATA_EN | \ | 106 | CFG_RX_MGMT_EN | CFG_RX_DATA_EN | \ |
104 | CFG_RX_CTL_EN | CFG_RX_BCN_EN | \ | 107 | CFG_RX_CTL_EN | CFG_RX_BCN_EN | \ |
105 | CFG_RX_AUTH_EN | CFG_RX_ASSOC_EN) | 108 | CFG_RX_AUTH_EN | CFG_RX_ASSOC_EN) |
106 | 109 | ||
110 | #define WL1271_DEFAULT_BASIC_RATE_SET (CONF_TX_RATE_MASK_ALL) | ||
111 | |||
107 | #define WL1271_FW_NAME "wl1271-fw.bin" | 112 | #define WL1271_FW_NAME "wl1271-fw.bin" |
108 | #define WL1271_NVS_NAME "wl1271-nvs.bin" | 113 | #define WL1271_NVS_NAME "wl1271-nvs.bin" |
109 | 114 | ||
110 | #define WL1271_BUSY_WORD_LEN 8 | 115 | /* |
116 | * Enable/disable 802.11a support for WL1273 | ||
117 | */ | ||
118 | #undef WL1271_80211A_ENABLED | ||
119 | |||
120 | /* | ||
121 | * FIXME: for the wl1271, a busy word count of 1 here will result in a more | ||
122 | * optimal SPI interface. There is some SPI bug however, causing RXS time outs | ||
123 | * with this mode occasionally on boot, so lets have three for now. A value of | ||
124 | * three should make sure, that the chipset will always be ready, though this | ||
125 | * will impact throughput and latencies slightly. | ||
126 | */ | ||
127 | #define WL1271_BUSY_WORD_CNT 3 | ||
128 | #define WL1271_BUSY_WORD_LEN (WL1271_BUSY_WORD_CNT * sizeof(u32)) | ||
111 | 129 | ||
112 | #define WL1271_ELP_HW_STATE_ASLEEP 0 | 130 | #define WL1271_ELP_HW_STATE_ASLEEP 0 |
113 | #define WL1271_ELP_HW_STATE_IRQ 1 | 131 | #define WL1271_ELP_HW_STATE_IRQ 1 |
114 | 132 | ||
133 | #define WL1271_DEFAULT_BEACON_INT 100 | ||
134 | #define WL1271_DEFAULT_DTIM_PERIOD 1 | ||
135 | |||
136 | #define ACX_TX_DESCRIPTORS 32 | ||
137 | |||
115 | enum wl1271_state { | 138 | enum wl1271_state { |
116 | WL1271_STATE_OFF, | 139 | WL1271_STATE_OFF, |
117 | WL1271_STATE_ON, | 140 | WL1271_STATE_ON, |
@@ -134,6 +157,8 @@ struct wl1271_partition { | |||
134 | struct wl1271_partition_set { | 157 | struct wl1271_partition_set { |
135 | struct wl1271_partition mem; | 158 | struct wl1271_partition mem; |
136 | struct wl1271_partition reg; | 159 | struct wl1271_partition reg; |
160 | struct wl1271_partition mem2; | ||
161 | struct wl1271_partition mem3; | ||
137 | }; | 162 | }; |
138 | 163 | ||
139 | struct wl1271; | 164 | struct wl1271; |
@@ -258,15 +283,15 @@ struct wl1271_debugfs { | |||
258 | 283 | ||
259 | /* FW status registers */ | 284 | /* FW status registers */ |
260 | struct wl1271_fw_status { | 285 | struct wl1271_fw_status { |
261 | u32 intr; | 286 | __le32 intr; |
262 | u8 fw_rx_counter; | 287 | u8 fw_rx_counter; |
263 | u8 drv_rx_counter; | 288 | u8 drv_rx_counter; |
264 | u8 reserved; | 289 | u8 reserved; |
265 | u8 tx_results_counter; | 290 | u8 tx_results_counter; |
266 | u32 rx_pkt_descs[NUM_RX_PKT_DESC]; | 291 | __le32 rx_pkt_descs[NUM_RX_PKT_DESC]; |
267 | u32 tx_released_blks[NUM_TX_QUEUES]; | 292 | __le32 tx_released_blks[NUM_TX_QUEUES]; |
268 | u32 fw_localtime; | 293 | __le32 fw_localtime; |
269 | u32 padding[2]; | 294 | __le32 padding[2]; |
270 | } __attribute__ ((packed)); | 295 | } __attribute__ ((packed)); |
271 | 296 | ||
272 | struct wl1271_rx_mem_pool_addr { | 297 | struct wl1271_rx_mem_pool_addr { |
@@ -274,6 +299,15 @@ struct wl1271_rx_mem_pool_addr { | |||
274 | u32 addr_extra; | 299 | u32 addr_extra; |
275 | }; | 300 | }; |
276 | 301 | ||
302 | struct wl1271_scan { | ||
303 | u8 state; | ||
304 | u8 ssid[IW_ESSID_MAX_SIZE+1]; | ||
305 | size_t ssid_len; | ||
306 | u8 active; | ||
307 | u8 high_prio; | ||
308 | u8 probe_requests; | ||
309 | }; | ||
310 | |||
277 | struct wl1271 { | 311 | struct wl1271 { |
278 | struct ieee80211_hw *hw; | 312 | struct ieee80211_hw *hw; |
279 | bool mac80211_registered; | 313 | bool mac80211_registered; |
@@ -288,10 +322,7 @@ struct wl1271 { | |||
288 | enum wl1271_state state; | 322 | enum wl1271_state state; |
289 | struct mutex mutex; | 323 | struct mutex mutex; |
290 | 324 | ||
291 | int physical_mem_addr; | 325 | struct wl1271_partition_set part; |
292 | int physical_reg_addr; | ||
293 | int virtual_mem_addr; | ||
294 | int virtual_reg_addr; | ||
295 | 326 | ||
296 | struct wl1271_chip chip; | 327 | struct wl1271_chip chip; |
297 | 328 | ||
@@ -308,7 +339,6 @@ struct wl1271 { | |||
308 | u8 bss_type; | 339 | u8 bss_type; |
309 | u8 ssid[IW_ESSID_MAX_SIZE + 1]; | 340 | u8 ssid[IW_ESSID_MAX_SIZE + 1]; |
310 | u8 ssid_len; | 341 | u8 ssid_len; |
311 | u8 listen_int; | ||
312 | int channel; | 342 | int channel; |
313 | 343 | ||
314 | struct wl1271_acx_mem_map *target_mem_map; | 344 | struct wl1271_acx_mem_map *target_mem_map; |
@@ -332,10 +362,14 @@ struct wl1271 { | |||
332 | bool tx_queue_stopped; | 362 | bool tx_queue_stopped; |
333 | 363 | ||
334 | struct work_struct tx_work; | 364 | struct work_struct tx_work; |
335 | struct work_struct filter_work; | ||
336 | 365 | ||
337 | /* Pending TX frames */ | 366 | /* Pending TX frames */ |
338 | struct sk_buff *tx_frames[16]; | 367 | struct sk_buff *tx_frames[ACX_TX_DESCRIPTORS]; |
368 | |||
369 | /* Security sequence number counters */ | ||
370 | u8 tx_security_last_seq; | ||
371 | u16 tx_security_seq_16; | ||
372 | u32 tx_security_seq_32; | ||
339 | 373 | ||
340 | /* FW Rx counter */ | 374 | /* FW Rx counter */ |
341 | u32 rx_counter; | 375 | u32 rx_counter; |
@@ -354,10 +388,17 @@ struct wl1271 { | |||
354 | 388 | ||
355 | /* Are we currently scanning */ | 389 | /* Are we currently scanning */ |
356 | bool scanning; | 390 | bool scanning; |
391 | struct wl1271_scan scan; | ||
357 | 392 | ||
358 | /* Our association ID */ | 393 | /* Our association ID */ |
359 | u16 aid; | 394 | u16 aid; |
360 | 395 | ||
396 | /* currently configured rate set */ | ||
397 | u32 basic_rate_set; | ||
398 | |||
399 | /* The current band */ | ||
400 | enum ieee80211_band band; | ||
401 | |||
361 | /* Default key (for WEP) */ | 402 | /* Default key (for WEP) */ |
362 | u32 default_key; | 403 | u32 default_key; |
363 | 404 | ||
@@ -368,6 +409,7 @@ struct wl1271 { | |||
368 | bool elp; | 409 | bool elp; |
369 | 410 | ||
370 | struct completion *elp_compl; | 411 | struct completion *elp_compl; |
412 | struct delayed_work elp_work; | ||
371 | 413 | ||
372 | /* we can be in psm, but not in elp, we have to differentiate */ | 414 | /* we can be in psm, but not in elp, we have to differentiate */ |
373 | bool psm; | 415 | bool psm; |
@@ -375,6 +417,9 @@ struct wl1271 { | |||
375 | /* PSM mode requested */ | 417 | /* PSM mode requested */ |
376 | bool psm_requested; | 418 | bool psm_requested; |
377 | 419 | ||
420 | /* retry counter for PSM entries */ | ||
421 | u8 psm_entry_retry; | ||
422 | |||
378 | /* in dBm */ | 423 | /* in dBm */ |
379 | int power_level; | 424 | int power_level; |
380 | 425 | ||
@@ -383,11 +428,20 @@ struct wl1271 { | |||
383 | 428 | ||
384 | u32 buffer_32; | 429 | u32 buffer_32; |
385 | u32 buffer_cmd; | 430 | u32 buffer_cmd; |
386 | u8 buffer_busyword[WL1271_BUSY_WORD_LEN]; | 431 | u32 buffer_busyword[WL1271_BUSY_WORD_CNT]; |
387 | struct wl1271_rx_descriptor *rx_descriptor; | ||
388 | 432 | ||
389 | struct wl1271_fw_status *fw_status; | 433 | struct wl1271_fw_status *fw_status; |
390 | struct wl1271_tx_hw_res_if *tx_res_if; | 434 | struct wl1271_tx_hw_res_if *tx_res_if; |
435 | |||
436 | struct ieee80211_vif *vif; | ||
437 | |||
438 | /* Used for a workaround to send disconnect before rejoining */ | ||
439 | bool joined; | ||
440 | |||
441 | /* Current chipset configuration */ | ||
442 | struct conf_drv_settings conf; | ||
443 | |||
444 | struct list_head list; | ||
391 | }; | 445 | }; |
392 | 446 | ||
393 | int wl1271_plt_start(struct wl1271 *wl); | 447 | int wl1271_plt_start(struct wl1271 *wl); |
@@ -404,4 +458,13 @@ int wl1271_plt_stop(struct wl1271 *wl); | |||
404 | /* WL1271 needs a 200ms sleep after power on */ | 458 | /* WL1271 needs a 200ms sleep after power on */ |
405 | #define WL1271_POWER_ON_SLEEP 200 /* in miliseconds */ | 459 | #define WL1271_POWER_ON_SLEEP 200 /* in miliseconds */ |
406 | 460 | ||
461 | static inline bool wl1271_11a_enabled(void) | ||
462 | { | ||
463 | #ifdef WL1271_80211A_ENABLED | ||
464 | return true; | ||
465 | #else | ||
466 | return false; | ||
467 | #endif | ||
468 | } | ||
469 | |||
407 | #endif | 470 | #endif |