blob: 779b130fdb3e5658fd9c70c16d0c376330e871c0 [file] [log] [blame]
Luciano Coelhof5fc0f82009-08-06 16:25:28 +03001/*
2 * This file is part of wl1271
3 *
4 * Copyright (C) 1998-2009 Texas Instruments. All rights reserved.
5 * Copyright (C) 2008-2009 Nokia Corporation
6 *
7 * Contact: Luciano Coelho <luciano.coelho@nokia.com>
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * version 2 as published by the Free Software Foundation.
12 *
13 * This program is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
21 * 02110-1301 USA
22 *
23 */
24
25#ifndef __WL1271_H__
26#define __WL1271_H__
27
28#include <linux/mutex.h>
29#include <linux/completion.h>
30#include <linux/spinlock.h>
31#include <linux/list.h>
32#include <linux/bitops.h>
33#include <net/mac80211.h>
34
Juuso Oikarinen2b60100b2009-10-13 12:47:39 +030035#include "wl1271_conf.h"
Juuso Oikarineneb70eb72010-05-14 10:46:22 +030036#include "wl1271_ini.h"
Juuso Oikarinen2b60100b2009-10-13 12:47:39 +030037
Luciano Coelhof5fc0f82009-08-06 16:25:28 +030038#define DRIVER_NAME "wl1271"
39#define DRIVER_PREFIX DRIVER_NAME ": "
40
41enum {
42 DEBUG_NONE = 0,
43 DEBUG_IRQ = BIT(0),
44 DEBUG_SPI = BIT(1),
45 DEBUG_BOOT = BIT(2),
46 DEBUG_MAILBOX = BIT(3),
Kalle Valoc8c90872010-02-18 13:25:53 +020047 DEBUG_TESTMODE = BIT(4),
Luciano Coelhof5fc0f82009-08-06 16:25:28 +030048 DEBUG_EVENT = BIT(5),
49 DEBUG_TX = BIT(6),
50 DEBUG_RX = BIT(7),
51 DEBUG_SCAN = BIT(8),
52 DEBUG_CRYPT = BIT(9),
53 DEBUG_PSM = BIT(10),
54 DEBUG_MAC80211 = BIT(11),
55 DEBUG_CMD = BIT(12),
56 DEBUG_ACX = BIT(13),
Teemu Paasikivia3b8ea72010-03-18 12:26:41 +020057 DEBUG_SDIO = BIT(14),
Juuso Oikarinen14b228a2010-03-18 12:26:43 +020058 DEBUG_FILTERS = BIT(15),
Juuso Oikarinen5da11dc2010-03-26 12:53:24 +020059 DEBUG_ADHOC = BIT(16),
Luciano Coelhof5fc0f82009-08-06 16:25:28 +030060 DEBUG_ALL = ~0,
61};
62
63#define DEBUG_LEVEL (DEBUG_NONE)
64
65#define DEBUG_DUMP_LIMIT 1024
66
67#define wl1271_error(fmt, arg...) \
68 printk(KERN_ERR DRIVER_PREFIX "ERROR " fmt "\n", ##arg)
69
70#define wl1271_warning(fmt, arg...) \
71 printk(KERN_WARNING DRIVER_PREFIX "WARNING " fmt "\n", ##arg)
72
73#define wl1271_notice(fmt, arg...) \
74 printk(KERN_INFO DRIVER_PREFIX fmt "\n", ##arg)
75
76#define wl1271_info(fmt, arg...) \
77 printk(KERN_DEBUG DRIVER_PREFIX fmt "\n", ##arg)
78
79#define wl1271_debug(level, fmt, arg...) \
80 do { \
81 if (level & DEBUG_LEVEL) \
82 printk(KERN_DEBUG DRIVER_PREFIX fmt "\n", ##arg); \
83 } while (0)
84
85#define wl1271_dump(level, prefix, buf, len) \
86 do { \
87 if (level & DEBUG_LEVEL) \
88 print_hex_dump(KERN_DEBUG, DRIVER_PREFIX prefix, \
89 DUMP_PREFIX_OFFSET, 16, 1, \
90 buf, \
91 min_t(size_t, len, DEBUG_DUMP_LIMIT), \
92 0); \
93 } while (0)
94
95#define wl1271_dump_ascii(level, prefix, buf, len) \
96 do { \
97 if (level & DEBUG_LEVEL) \
98 print_hex_dump(KERN_DEBUG, DRIVER_PREFIX prefix, \
99 DUMP_PREFIX_OFFSET, 16, 1, \
100 buf, \
101 min_t(size_t, len, DEBUG_DUMP_LIMIT), \
102 true); \
103 } while (0)
104
105#define WL1271_DEFAULT_RX_CONFIG (CFG_UNI_FILTER_EN | \
Juuso Oikarinenc87dec92009-10-08 21:56:31 +0300106 CFG_BSSID_FILTER_EN | \
107 CFG_MC_FILTER_EN)
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300108
109#define WL1271_DEFAULT_RX_FILTER (CFG_RX_RCTS_ACK | CFG_RX_PRSP_EN | \
110 CFG_RX_MGMT_EN | CFG_RX_DATA_EN | \
111 CFG_RX_CTL_EN | CFG_RX_BCN_EN | \
112 CFG_RX_AUTH_EN | CFG_RX_ASSOC_EN)
113
114#define WL1271_FW_NAME "wl1271-fw.bin"
115#define WL1271_NVS_NAME "wl1271-nvs.bin"
Juuso Oikarinen152ee6e2010-02-18 13:25:42 +0200116
Juuso Oikarinen04e36fc2010-02-22 08:38:40 +0200117#define WL1271_TX_SECURITY_LO16(s) ((u16)((s) & 0xffff))
118#define WL1271_TX_SECURITY_HI32(s) ((u32)(((s) >> 16) & 0xffffffff))
119
Juuso Oikarinen7a557242010-09-27 12:42:07 +0200120#define WL1271_CIPHER_SUITE_GEM 0x00147201
121
Juuso Oikarinen259da432010-03-26 12:53:18 +0200122#define WL1271_BUSY_WORD_CNT 1
Juuso Oikarinen545f1da2009-10-08 21:56:23 +0300123#define WL1271_BUSY_WORD_LEN (WL1271_BUSY_WORD_CNT * sizeof(u32))
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300124
125#define WL1271_ELP_HW_STATE_ASLEEP 0
126#define WL1271_ELP_HW_STATE_IRQ 1
127
Juuso Oikarinend94cd292009-10-08 21:56:25 +0300128#define WL1271_DEFAULT_BEACON_INT 100
129#define WL1271_DEFAULT_DTIM_PERIOD 1
130
Juuso Oikarinenc87dec92009-10-08 21:56:31 +0300131#define ACX_TX_DESCRIPTORS 32
Juuso Oikarinenbe7078c2009-10-08 21:56:26 +0300132
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300133enum wl1271_state {
134 WL1271_STATE_OFF,
135 WL1271_STATE_ON,
136 WL1271_STATE_PLT,
137};
138
139enum wl1271_partition_type {
140 PART_DOWN,
141 PART_WORK,
142 PART_DRPW,
143
144 PART_TABLE_LEN
145};
146
147struct wl1271_partition {
148 u32 size;
149 u32 start;
150};
151
152struct wl1271_partition_set {
153 struct wl1271_partition mem;
154 struct wl1271_partition reg;
Juuso Oikarinen451de972009-10-12 15:08:46 +0300155 struct wl1271_partition mem2;
156 struct wl1271_partition mem3;
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300157};
158
159struct wl1271;
160
161/* FIXME: I'm not sure about this structure name */
162struct wl1271_chip {
163 u32 id;
164 char fw_ver[21];
165};
166
167struct wl1271_stats {
168 struct acx_statistics *fw_stats;
169 unsigned long fw_stats_update;
170
171 unsigned int retry_count;
172 unsigned int excessive_retries;
173};
174
175struct wl1271_debugfs {
176 struct dentry *rootdir;
177 struct dentry *fw_statistics;
178
179 struct dentry *tx_internal_desc_overflow;
180
181 struct dentry *rx_out_of_mem;
182 struct dentry *rx_hdr_overflow;
183 struct dentry *rx_hw_stuck;
184 struct dentry *rx_dropped;
185 struct dentry *rx_fcs_err;
186 struct dentry *rx_xfr_hint_trig;
187 struct dentry *rx_path_reset;
188 struct dentry *rx_reset_counter;
189
190 struct dentry *dma_rx_requested;
191 struct dentry *dma_rx_errors;
192 struct dentry *dma_tx_requested;
193 struct dentry *dma_tx_errors;
194
195 struct dentry *isr_cmd_cmplt;
196 struct dentry *isr_fiqs;
197 struct dentry *isr_rx_headers;
198 struct dentry *isr_rx_mem_overflow;
199 struct dentry *isr_rx_rdys;
200 struct dentry *isr_irqs;
201 struct dentry *isr_tx_procs;
202 struct dentry *isr_decrypt_done;
203 struct dentry *isr_dma0_done;
204 struct dentry *isr_dma1_done;
205 struct dentry *isr_tx_exch_complete;
206 struct dentry *isr_commands;
207 struct dentry *isr_rx_procs;
208 struct dentry *isr_hw_pm_mode_changes;
209 struct dentry *isr_host_acknowledges;
210 struct dentry *isr_pci_pm;
211 struct dentry *isr_wakeups;
212 struct dentry *isr_low_rssi;
213
214 struct dentry *wep_addr_key_count;
215 struct dentry *wep_default_key_count;
216 /* skipping wep.reserved */
217 struct dentry *wep_key_not_found;
218 struct dentry *wep_decrypt_fail;
219 struct dentry *wep_packets;
220 struct dentry *wep_interrupt;
221
222 struct dentry *pwr_ps_enter;
223 struct dentry *pwr_elp_enter;
224 struct dentry *pwr_missing_bcns;
225 struct dentry *pwr_wake_on_host;
226 struct dentry *pwr_wake_on_timer_exp;
227 struct dentry *pwr_tx_with_ps;
228 struct dentry *pwr_tx_without_ps;
229 struct dentry *pwr_rcvd_beacons;
230 struct dentry *pwr_power_save_off;
231 struct dentry *pwr_enable_ps;
232 struct dentry *pwr_disable_ps;
233 struct dentry *pwr_fix_tsf_ps;
234 /* skipping cont_miss_bcns_spread for now */
235 struct dentry *pwr_rcvd_awake_beacons;
236
237 struct dentry *mic_rx_pkts;
238 struct dentry *mic_calc_failure;
239
240 struct dentry *aes_encrypt_fail;
241 struct dentry *aes_decrypt_fail;
242 struct dentry *aes_encrypt_packets;
243 struct dentry *aes_decrypt_packets;
244 struct dentry *aes_encrypt_interrupt;
245 struct dentry *aes_decrypt_interrupt;
246
247 struct dentry *event_heart_beat;
248 struct dentry *event_calibration;
249 struct dentry *event_rx_mismatch;
250 struct dentry *event_rx_mem_empty;
251 struct dentry *event_rx_pool;
252 struct dentry *event_oom_late;
253 struct dentry *event_phy_transmit_error;
254 struct dentry *event_tx_stuck;
255
256 struct dentry *ps_pspoll_timeouts;
257 struct dentry *ps_upsd_timeouts;
258 struct dentry *ps_upsd_max_sptime;
259 struct dentry *ps_upsd_max_apturn;
260 struct dentry *ps_pspoll_max_apturn;
261 struct dentry *ps_pspoll_utilization;
262 struct dentry *ps_upsd_utilization;
263
264 struct dentry *rxpipe_rx_prep_beacon_drop;
265 struct dentry *rxpipe_descr_host_int_trig_rx_data;
266 struct dentry *rxpipe_beacon_buffer_thres_host_int_trig_rx_data;
267 struct dentry *rxpipe_missed_beacon_host_int_trig_rx_data;
268 struct dentry *rxpipe_tx_xfr_host_int_trig_rx_data;
269
270 struct dentry *tx_queue_len;
271
272 struct dentry *retry_count;
273 struct dentry *excessive_retries;
Luciano Coelho98b2a682009-12-11 15:40:52 +0200274 struct dentry *gpio_power;
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300275};
276
277#define NUM_TX_QUEUES 4
278#define NUM_RX_PKT_DESC 8
279
280/* FW status registers */
281struct wl1271_fw_status {
Luciano Coelhod0f63b22009-10-15 10:33:29 +0300282 __le32 intr;
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300283 u8 fw_rx_counter;
284 u8 drv_rx_counter;
285 u8 reserved;
286 u8 tx_results_counter;
Luciano Coelhod0f63b22009-10-15 10:33:29 +0300287 __le32 rx_pkt_descs[NUM_RX_PKT_DESC];
288 __le32 tx_released_blks[NUM_TX_QUEUES];
289 __le32 fw_localtime;
290 __le32 padding[2];
Eric Dumazetba2d3582010-06-02 18:10:09 +0000291} __packed;
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300292
293struct wl1271_rx_mem_pool_addr {
294 u32 addr;
295 u32 addr_extra;
296};
297
Teemu Paasikiviabb0b3b2009-10-13 12:47:50 +0300298struct wl1271_scan {
Juuso Oikarinen4fb26fa2010-05-24 11:18:20 +0300299 struct cfg80211_scan_request *req;
Luciano Coelho08688d62010-07-08 17:50:07 +0300300 bool *scanned_ch;
Juuso Oikarinen78abd322010-09-21 06:23:32 +0200301 bool failed;
Teemu Paasikiviabb0b3b2009-10-13 12:47:50 +0300302 u8 state;
303 u8 ssid[IW_ESSID_MAX_SIZE+1];
304 size_t ssid_len;
Teemu Paasikiviabb0b3b2009-10-13 12:47:50 +0300305};
306
Teemu Paasikivi8197b712010-02-22 08:38:23 +0200307struct wl1271_if_operations {
308 void (*read)(struct wl1271 *wl, int addr, void *buf, size_t len,
309 bool fixed);
310 void (*write)(struct wl1271 *wl, int addr, void *buf, size_t len,
311 bool fixed);
312 void (*reset)(struct wl1271 *wl);
313 void (*init)(struct wl1271 *wl);
Ohad Ben-Cohen2cc78ff2010-09-16 01:22:04 +0200314 int (*power)(struct wl1271 *wl, bool enable);
Teemu Paasikivi8197b712010-02-22 08:38:23 +0200315 struct device* (*dev)(struct wl1271 *wl);
316 void (*enable_irq)(struct wl1271 *wl);
317 void (*disable_irq)(struct wl1271 *wl);
318};
319
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300320struct wl1271 {
Teemu Paasikivi3b56dd62010-03-18 12:26:46 +0200321 struct platform_device *plat_dev;
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300322 struct ieee80211_hw *hw;
323 bool mac80211_registered;
324
Teemu Paasikivi8197b712010-02-22 08:38:23 +0200325 void *if_priv;
326
327 struct wl1271_if_operations *if_ops;
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300328
329 void (*set_power)(bool enable);
330 int irq;
Ohad Ben-Cohen15cea992010-09-16 01:31:51 +0200331 int ref_clock;
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300332
333 spinlock_t wl_lock;
334
335 enum wl1271_state state;
336 struct mutex mutex;
337
Juuso Oikarinen830fb672009-12-11 15:41:06 +0200338#define WL1271_FLAG_STA_RATES_CHANGED (0)
339#define WL1271_FLAG_STA_ASSOCIATED (1)
Juuso Oikarinen71449f82009-12-11 15:41:07 +0200340#define WL1271_FLAG_JOINED (2)
341#define WL1271_FLAG_GPIO_POWER (3)
342#define WL1271_FLAG_TX_QUEUE_STOPPED (4)
Luciano Coelho08688d62010-07-08 17:50:07 +0300343#define WL1271_FLAG_IN_ELP (5)
344#define WL1271_FLAG_PSM (6)
345#define WL1271_FLAG_PSM_REQUESTED (7)
346#define WL1271_FLAG_IRQ_PENDING (8)
347#define WL1271_FLAG_IRQ_RUNNING (9)
348#define WL1271_FLAG_IDLE (10)
349#define WL1271_FLAG_IDLE_REQUESTED (11)
350#define WL1271_FLAG_PSPOLL_FAILURE (12)
Juuso Oikarinenc2c192a2010-07-27 03:30:09 +0300351#define WL1271_FLAG_STA_STATE_SENT (13)
Juuso Oikarinen830fb672009-12-11 15:41:06 +0200352 unsigned long flags;
353
Juuso Oikarinen451de972009-10-12 15:08:46 +0300354 struct wl1271_partition_set part;
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300355
356 struct wl1271_chip chip;
357
358 int cmd_box_addr;
359 int event_box_addr;
360
361 u8 *fw;
362 size_t fw_len;
Juuso Oikarinen152ee6e2010-02-18 13:25:42 +0200363 struct wl1271_nvs_file *nvs;
Juuso Oikarinen02fabb02010-08-19 04:41:15 +0200364 size_t nvs_len;
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300365
Juuso Oikarinend717fd62010-05-07 11:38:58 +0300366 s8 hw_pg_ver;
367
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300368 u8 bssid[ETH_ALEN];
369 u8 mac_addr[ETH_ALEN];
370 u8 bss_type;
Juuso Oikarinen5da11dc2010-03-26 12:53:24 +0200371 u8 set_bss_type;
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300372 u8 ssid[IW_ESSID_MAX_SIZE + 1];
373 u8 ssid_len;
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300374 int channel;
375
376 struct wl1271_acx_mem_map *target_mem_map;
377
378 /* Accounting for allocated / available TX blocks on HW */
379 u32 tx_blocks_freed[NUM_TX_QUEUES];
380 u32 tx_blocks_available;
Juuso Oikarinenffb591c2010-02-22 08:38:31 +0200381 u32 tx_results_count;
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300382
383 /* Transmitted TX packets counter for chipset interface */
Juuso Oikarinenffb591c2010-02-22 08:38:31 +0200384 u32 tx_packets_count;
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300385
386 /* Time-offset between host and chipset clocks */
Juuso Oikarinenac5e1e32010-02-22 08:38:38 +0200387 s64 time_offset;
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300388
389 /* Session counter for the chipset */
390 int session_counter;
391
392 /* Frames scheduled for transmission, not handled yet */
393 struct sk_buff_head tx_queue;
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300394
395 struct work_struct tx_work;
Juuso Oikarinenc87dec92009-10-08 21:56:31 +0300396
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300397 /* Pending TX frames */
Juuso Oikarinenbe7078c2009-10-08 21:56:26 +0300398 struct sk_buff *tx_frames[ACX_TX_DESCRIPTORS];
Juuso Oikarinen781608c2010-05-24 11:18:17 +0300399 int tx_frames_cnt;
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300400
Juuso Oikarinenac4e4ce2009-10-08 21:56:19 +0300401 /* Security sequence number counters */
402 u8 tx_security_last_seq;
Juuso Oikarinen04e36fc2010-02-22 08:38:40 +0200403 s64 tx_security_seq;
Juuso Oikarinenac4e4ce2009-10-08 21:56:19 +0300404
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300405 /* FW Rx counter */
406 u32 rx_counter;
407
408 /* Rx memory pool address */
409 struct wl1271_rx_mem_pool_addr rx_mem_pool_addr;
410
411 /* The target interrupt mask */
412 struct work_struct irq_work;
413
Juuso Oikarinen52b0e7a2010-09-21 06:23:31 +0200414 /* Hardware recovery work */
415 struct work_struct recovery_work;
416
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300417 /* The mbox event mask */
418 u32 event_mask;
419
420 /* Mailbox pointers */
421 u32 mbox_ptr[2];
422
423 /* Are we currently scanning */
Teemu Paasikiviabb0b3b2009-10-13 12:47:50 +0300424 struct wl1271_scan scan;
Juuso Oikarinen78abd322010-09-21 06:23:32 +0200425 struct delayed_work scan_complete_work;
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300426
427 /* Our association ID */
428 u16 aid;
429
Juuso Oikarinend94cd292009-10-08 21:56:25 +0300430 /* currently configured rate set */
Juuso Oikarinen830fb672009-12-11 15:41:06 +0200431 u32 sta_rate_set;
Juuso Oikarinend94cd292009-10-08 21:56:25 +0300432 u32 basic_rate_set;
Juuso Oikarinenebba60c2010-04-01 11:38:20 +0300433 u32 basic_rate;
Juuso Oikarinen830fb672009-12-11 15:41:06 +0200434 u32 rate_set;
Juuso Oikarinend94cd292009-10-08 21:56:25 +0300435
Juuso Oikarinen8a5a37a2009-10-08 21:56:24 +0300436 /* The current band */
437 enum ieee80211_band band;
438
Juuso Oikarinen60e84c22010-03-26 12:53:25 +0200439 /* Beaconing interval (needed for ad-hoc) */
440 u32 beacon_int;
441
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300442 /* Default key (for WEP) */
443 u32 default_key;
444
Juuso Oikarinen14b228a2010-03-18 12:26:43 +0200445 unsigned int filters;
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300446 unsigned int rx_config;
447 unsigned int rx_filter;
448
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300449 struct completion *elp_compl;
Juuso Oikarinen37b70a82009-10-08 21:56:21 +0300450 struct delayed_work elp_work;
Juuso Oikarinen90494a92010-07-08 17:50:00 +0300451 struct delayed_work pspoll_work;
452
453 /* counter for ps-poll delivery failures */
454 int ps_poll_failures;
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300455
Juuso Oikarinen19ad0712009-11-02 20:22:11 +0200456 /* retry counter for PSM entries */
457 u8 psm_entry_retry;
458
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300459 /* in dBm */
460 int power_level;
461
Juuso Oikarinen00236aed2010-04-09 11:07:30 +0300462 int rssi_thold;
463 int last_rssi_event;
464
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300465 struct wl1271_stats stats;
466 struct wl1271_debugfs debugfs;
467
Juuso Oikarinen554d7202010-05-07 11:38:59 +0300468 __le32 buffer_32;
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300469 u32 buffer_cmd;
Juuso Oikarinen545f1da2009-10-08 21:56:23 +0300470 u32 buffer_busyword[WL1271_BUSY_WORD_CNT];
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300471
472 struct wl1271_fw_status *fw_status;
473 struct wl1271_tx_hw_res_if *tx_res_if;
Juuso Oikarinenb771eee2009-10-08 21:56:34 +0300474
475 struct ieee80211_vif *vif;
Luciano Coelhod6e19d132009-10-12 15:08:43 +0300476
Juuso Oikarinen2b60100b2009-10-13 12:47:39 +0300477 /* Current chipset configuration */
478 struct conf_drv_settings conf;
Juuso Oikarinen01c09162009-10-13 12:47:55 +0300479
Juuso Oikarinen7fc3a862010-03-18 12:26:32 +0200480 bool sg_enabled;
481
Juuso Oikarinen02fabb02010-08-19 04:41:15 +0200482 bool enable_11a;
483
Juuso Oikarinen01c09162009-10-13 12:47:55 +0300484 struct list_head list;
John W. Linvilleece550d2010-07-28 16:41:06 -0400485
486 /* Most recently reported noise in dBm */
487 s8 noise;
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300488};
489
490int wl1271_plt_start(struct wl1271 *wl);
491int wl1271_plt_stop(struct wl1271 *wl);
492
493#define JOIN_TIMEOUT 5000 /* 5000 milliseconds to join */
494
495#define SESSION_COUNTER_MAX 7 /* maximum value for the session counter */
496
497#define WL1271_DEFAULT_POWER_LEVEL 0
498
Juuso Oikarinen06f7bc72010-02-22 08:38:33 +0200499#define WL1271_TX_QUEUE_LOW_WATERMARK 10
500#define WL1271_TX_QUEUE_HIGH_WATERMARK 25
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300501
Juuso Oikarinen01ac17e2009-12-11 15:41:02 +0200502/* WL1271 needs a 200ms sleep after power on, and a 20ms sleep before power
503 on in case is has been shut down shortly before */
504#define WL1271_PRE_POWER_ON_SLEEP 20 /* in miliseconds */
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300505#define WL1271_POWER_ON_SLEEP 200 /* in miliseconds */
506
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300507#endif