blob: 7397999deb190c676e39677f5aab9dd4d076b679 [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"
36
Luciano Coelhof5fc0f82009-08-06 16:25:28 +030037#define DRIVER_NAME "wl1271"
38#define DRIVER_PREFIX DRIVER_NAME ": "
39
40enum {
41 DEBUG_NONE = 0,
42 DEBUG_IRQ = BIT(0),
43 DEBUG_SPI = BIT(1),
44 DEBUG_BOOT = BIT(2),
45 DEBUG_MAILBOX = BIT(3),
Kalle Valoc8c90872010-02-18 13:25:53 +020046 DEBUG_TESTMODE = BIT(4),
Luciano Coelhof5fc0f82009-08-06 16:25:28 +030047 DEBUG_EVENT = BIT(5),
48 DEBUG_TX = BIT(6),
49 DEBUG_RX = BIT(7),
50 DEBUG_SCAN = BIT(8),
51 DEBUG_CRYPT = BIT(9),
52 DEBUG_PSM = BIT(10),
53 DEBUG_MAC80211 = BIT(11),
54 DEBUG_CMD = BIT(12),
55 DEBUG_ACX = BIT(13),
56 DEBUG_ALL = ~0,
57};
58
59#define DEBUG_LEVEL (DEBUG_NONE)
60
61#define DEBUG_DUMP_LIMIT 1024
62
63#define wl1271_error(fmt, arg...) \
64 printk(KERN_ERR DRIVER_PREFIX "ERROR " fmt "\n", ##arg)
65
66#define wl1271_warning(fmt, arg...) \
67 printk(KERN_WARNING DRIVER_PREFIX "WARNING " fmt "\n", ##arg)
68
69#define wl1271_notice(fmt, arg...) \
70 printk(KERN_INFO DRIVER_PREFIX fmt "\n", ##arg)
71
72#define wl1271_info(fmt, arg...) \
73 printk(KERN_DEBUG DRIVER_PREFIX fmt "\n", ##arg)
74
75#define wl1271_debug(level, fmt, arg...) \
76 do { \
77 if (level & DEBUG_LEVEL) \
78 printk(KERN_DEBUG DRIVER_PREFIX fmt "\n", ##arg); \
79 } while (0)
80
81#define wl1271_dump(level, prefix, buf, len) \
82 do { \
83 if (level & DEBUG_LEVEL) \
84 print_hex_dump(KERN_DEBUG, DRIVER_PREFIX prefix, \
85 DUMP_PREFIX_OFFSET, 16, 1, \
86 buf, \
87 min_t(size_t, len, DEBUG_DUMP_LIMIT), \
88 0); \
89 } while (0)
90
91#define wl1271_dump_ascii(level, prefix, buf, len) \
92 do { \
93 if (level & DEBUG_LEVEL) \
94 print_hex_dump(KERN_DEBUG, DRIVER_PREFIX prefix, \
95 DUMP_PREFIX_OFFSET, 16, 1, \
96 buf, \
97 min_t(size_t, len, DEBUG_DUMP_LIMIT), \
98 true); \
99 } while (0)
100
101#define WL1271_DEFAULT_RX_CONFIG (CFG_UNI_FILTER_EN | \
Juuso Oikarinenc87dec92009-10-08 21:56:31 +0300102 CFG_BSSID_FILTER_EN | \
103 CFG_MC_FILTER_EN)
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300104
105#define WL1271_DEFAULT_RX_FILTER (CFG_RX_RCTS_ACK | CFG_RX_PRSP_EN | \
106 CFG_RX_MGMT_EN | CFG_RX_DATA_EN | \
107 CFG_RX_CTL_EN | CFG_RX_BCN_EN | \
108 CFG_RX_AUTH_EN | CFG_RX_ASSOC_EN)
109
110#define WL1271_FW_NAME "wl1271-fw.bin"
111#define WL1271_NVS_NAME "wl1271-nvs.bin"
Juuso Oikarinen152ee6e2010-02-18 13:25:42 +0200112
Juuso Oikarinen04e36fc2010-02-22 08:38:40 +0200113#define WL1271_TX_SECURITY_LO16(s) ((u16)((s) & 0xffff))
114#define WL1271_TX_SECURITY_HI32(s) ((u32)(((s) >> 16) & 0xffffffff))
115
Juuso Oikarinen152ee6e2010-02-18 13:25:42 +0200116/* NVS data structure */
117#define WL1271_NVS_SECTION_SIZE 468
118
119#define WL1271_NVS_GENERAL_PARAMS_SIZE 57
120#define WL1271_NVS_GENERAL_PARAMS_SIZE_PADDED \
121 (WL1271_NVS_GENERAL_PARAMS_SIZE + 1)
122#define WL1271_NVS_STAT_RADIO_PARAMS_SIZE 17
123#define WL1271_NVS_STAT_RADIO_PARAMS_SIZE_PADDED \
124 (WL1271_NVS_STAT_RADIO_PARAMS_SIZE + 1)
125#define WL1271_NVS_DYN_RADIO_PARAMS_SIZE 65
126#define WL1271_NVS_DYN_RADIO_PARAMS_SIZE_PADDED \
127 (WL1271_NVS_DYN_RADIO_PARAMS_SIZE + 1)
128#define WL1271_NVS_FEM_COUNT 2
129#define WL1271_NVS_INI_SPARE_SIZE 124
130
131struct wl1271_nvs_file {
132 /* NVS section */
133 u8 nvs[WL1271_NVS_SECTION_SIZE];
134
135 /* INI section */
136 u8 general_params[WL1271_NVS_GENERAL_PARAMS_SIZE_PADDED];
137 u8 stat_radio_params[WL1271_NVS_STAT_RADIO_PARAMS_SIZE_PADDED];
138 u8 dyn_radio_params[WL1271_NVS_FEM_COUNT]
139 [WL1271_NVS_DYN_RADIO_PARAMS_SIZE_PADDED];
140 u8 ini_spare[WL1271_NVS_INI_SPARE_SIZE];
141} __attribute__ ((packed));
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300142
Juuso Oikarinen545f1da2009-10-08 21:56:23 +0300143/*
Teemu Paasikivi1ebec3d2009-10-13 12:47:48 +0300144 * Enable/disable 802.11a support for WL1273
145 */
146#undef WL1271_80211A_ENABLED
147
148/*
Juuso Oikarinen545f1da2009-10-08 21:56:23 +0300149 * FIXME: for the wl1271, a busy word count of 1 here will result in a more
150 * optimal SPI interface. There is some SPI bug however, causing RXS time outs
Juuso Oikarinenc6d5d062009-10-13 12:47:47 +0300151 * with this mode occasionally on boot, so lets have three for now. A value of
152 * three should make sure, that the chipset will always be ready, though this
153 * will impact throughput and latencies slightly.
Juuso Oikarinen545f1da2009-10-08 21:56:23 +0300154 */
Juuso Oikarinenc6d5d062009-10-13 12:47:47 +0300155#define WL1271_BUSY_WORD_CNT 3
Juuso Oikarinen545f1da2009-10-08 21:56:23 +0300156#define WL1271_BUSY_WORD_LEN (WL1271_BUSY_WORD_CNT * sizeof(u32))
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300157
158#define WL1271_ELP_HW_STATE_ASLEEP 0
159#define WL1271_ELP_HW_STATE_IRQ 1
160
Juuso Oikarinend94cd292009-10-08 21:56:25 +0300161#define WL1271_DEFAULT_BEACON_INT 100
162#define WL1271_DEFAULT_DTIM_PERIOD 1
163
Juuso Oikarinenc87dec92009-10-08 21:56:31 +0300164#define ACX_TX_DESCRIPTORS 32
Juuso Oikarinenbe7078c2009-10-08 21:56:26 +0300165
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300166enum wl1271_state {
167 WL1271_STATE_OFF,
168 WL1271_STATE_ON,
169 WL1271_STATE_PLT,
170};
171
172enum wl1271_partition_type {
173 PART_DOWN,
174 PART_WORK,
175 PART_DRPW,
176
177 PART_TABLE_LEN
178};
179
180struct wl1271_partition {
181 u32 size;
182 u32 start;
183};
184
185struct wl1271_partition_set {
186 struct wl1271_partition mem;
187 struct wl1271_partition reg;
Juuso Oikarinen451de972009-10-12 15:08:46 +0300188 struct wl1271_partition mem2;
189 struct wl1271_partition mem3;
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300190};
191
192struct wl1271;
193
194/* FIXME: I'm not sure about this structure name */
195struct wl1271_chip {
196 u32 id;
197 char fw_ver[21];
198};
199
200struct wl1271_stats {
201 struct acx_statistics *fw_stats;
202 unsigned long fw_stats_update;
203
204 unsigned int retry_count;
205 unsigned int excessive_retries;
206};
207
208struct wl1271_debugfs {
209 struct dentry *rootdir;
210 struct dentry *fw_statistics;
211
212 struct dentry *tx_internal_desc_overflow;
213
214 struct dentry *rx_out_of_mem;
215 struct dentry *rx_hdr_overflow;
216 struct dentry *rx_hw_stuck;
217 struct dentry *rx_dropped;
218 struct dentry *rx_fcs_err;
219 struct dentry *rx_xfr_hint_trig;
220 struct dentry *rx_path_reset;
221 struct dentry *rx_reset_counter;
222
223 struct dentry *dma_rx_requested;
224 struct dentry *dma_rx_errors;
225 struct dentry *dma_tx_requested;
226 struct dentry *dma_tx_errors;
227
228 struct dentry *isr_cmd_cmplt;
229 struct dentry *isr_fiqs;
230 struct dentry *isr_rx_headers;
231 struct dentry *isr_rx_mem_overflow;
232 struct dentry *isr_rx_rdys;
233 struct dentry *isr_irqs;
234 struct dentry *isr_tx_procs;
235 struct dentry *isr_decrypt_done;
236 struct dentry *isr_dma0_done;
237 struct dentry *isr_dma1_done;
238 struct dentry *isr_tx_exch_complete;
239 struct dentry *isr_commands;
240 struct dentry *isr_rx_procs;
241 struct dentry *isr_hw_pm_mode_changes;
242 struct dentry *isr_host_acknowledges;
243 struct dentry *isr_pci_pm;
244 struct dentry *isr_wakeups;
245 struct dentry *isr_low_rssi;
246
247 struct dentry *wep_addr_key_count;
248 struct dentry *wep_default_key_count;
249 /* skipping wep.reserved */
250 struct dentry *wep_key_not_found;
251 struct dentry *wep_decrypt_fail;
252 struct dentry *wep_packets;
253 struct dentry *wep_interrupt;
254
255 struct dentry *pwr_ps_enter;
256 struct dentry *pwr_elp_enter;
257 struct dentry *pwr_missing_bcns;
258 struct dentry *pwr_wake_on_host;
259 struct dentry *pwr_wake_on_timer_exp;
260 struct dentry *pwr_tx_with_ps;
261 struct dentry *pwr_tx_without_ps;
262 struct dentry *pwr_rcvd_beacons;
263 struct dentry *pwr_power_save_off;
264 struct dentry *pwr_enable_ps;
265 struct dentry *pwr_disable_ps;
266 struct dentry *pwr_fix_tsf_ps;
267 /* skipping cont_miss_bcns_spread for now */
268 struct dentry *pwr_rcvd_awake_beacons;
269
270 struct dentry *mic_rx_pkts;
271 struct dentry *mic_calc_failure;
272
273 struct dentry *aes_encrypt_fail;
274 struct dentry *aes_decrypt_fail;
275 struct dentry *aes_encrypt_packets;
276 struct dentry *aes_decrypt_packets;
277 struct dentry *aes_encrypt_interrupt;
278 struct dentry *aes_decrypt_interrupt;
279
280 struct dentry *event_heart_beat;
281 struct dentry *event_calibration;
282 struct dentry *event_rx_mismatch;
283 struct dentry *event_rx_mem_empty;
284 struct dentry *event_rx_pool;
285 struct dentry *event_oom_late;
286 struct dentry *event_phy_transmit_error;
287 struct dentry *event_tx_stuck;
288
289 struct dentry *ps_pspoll_timeouts;
290 struct dentry *ps_upsd_timeouts;
291 struct dentry *ps_upsd_max_sptime;
292 struct dentry *ps_upsd_max_apturn;
293 struct dentry *ps_pspoll_max_apturn;
294 struct dentry *ps_pspoll_utilization;
295 struct dentry *ps_upsd_utilization;
296
297 struct dentry *rxpipe_rx_prep_beacon_drop;
298 struct dentry *rxpipe_descr_host_int_trig_rx_data;
299 struct dentry *rxpipe_beacon_buffer_thres_host_int_trig_rx_data;
300 struct dentry *rxpipe_missed_beacon_host_int_trig_rx_data;
301 struct dentry *rxpipe_tx_xfr_host_int_trig_rx_data;
302
303 struct dentry *tx_queue_len;
304
305 struct dentry *retry_count;
306 struct dentry *excessive_retries;
Luciano Coelho98b2a682009-12-11 15:40:52 +0200307 struct dentry *gpio_power;
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300308};
309
310#define NUM_TX_QUEUES 4
311#define NUM_RX_PKT_DESC 8
312
313/* FW status registers */
314struct wl1271_fw_status {
Luciano Coelhod0f63b22009-10-15 10:33:29 +0300315 __le32 intr;
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300316 u8 fw_rx_counter;
317 u8 drv_rx_counter;
318 u8 reserved;
319 u8 tx_results_counter;
Luciano Coelhod0f63b22009-10-15 10:33:29 +0300320 __le32 rx_pkt_descs[NUM_RX_PKT_DESC];
321 __le32 tx_released_blks[NUM_TX_QUEUES];
322 __le32 fw_localtime;
323 __le32 padding[2];
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300324} __attribute__ ((packed));
325
326struct wl1271_rx_mem_pool_addr {
327 u32 addr;
328 u32 addr_extra;
329};
330
Teemu Paasikiviabb0b3b2009-10-13 12:47:50 +0300331struct wl1271_scan {
332 u8 state;
333 u8 ssid[IW_ESSID_MAX_SIZE+1];
334 size_t ssid_len;
335 u8 active;
336 u8 high_prio;
337 u8 probe_requests;
338};
339
Teemu Paasikivi8197b712010-02-22 08:38:23 +0200340struct wl1271_if_operations {
341 void (*read)(struct wl1271 *wl, int addr, void *buf, size_t len,
342 bool fixed);
343 void (*write)(struct wl1271 *wl, int addr, void *buf, size_t len,
344 bool fixed);
345 void (*reset)(struct wl1271 *wl);
346 void (*init)(struct wl1271 *wl);
Teemu Paasikivibecd5512010-03-18 12:26:27 +0200347 void (*power)(struct wl1271 *wl, bool enable);
Teemu Paasikivi8197b712010-02-22 08:38:23 +0200348 struct device* (*dev)(struct wl1271 *wl);
349 void (*enable_irq)(struct wl1271 *wl);
350 void (*disable_irq)(struct wl1271 *wl);
351};
352
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300353struct wl1271 {
354 struct ieee80211_hw *hw;
355 bool mac80211_registered;
356
Teemu Paasikivi8197b712010-02-22 08:38:23 +0200357 void *if_priv;
358
359 struct wl1271_if_operations *if_ops;
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300360
361 void (*set_power)(bool enable);
362 int irq;
363
364 spinlock_t wl_lock;
365
366 enum wl1271_state state;
367 struct mutex mutex;
368
Juuso Oikarinen830fb672009-12-11 15:41:06 +0200369#define WL1271_FLAG_STA_RATES_CHANGED (0)
370#define WL1271_FLAG_STA_ASSOCIATED (1)
Juuso Oikarinen71449f82009-12-11 15:41:07 +0200371#define WL1271_FLAG_JOINED (2)
372#define WL1271_FLAG_GPIO_POWER (3)
373#define WL1271_FLAG_TX_QUEUE_STOPPED (4)
374#define WL1271_FLAG_SCANNING (5)
375#define WL1271_FLAG_IN_ELP (6)
376#define WL1271_FLAG_PSM (7)
377#define WL1271_FLAG_PSM_REQUESTED (8)
Juuso Oikarinen1e73eb62010-02-22 08:38:37 +0200378#define WL1271_FLAG_IRQ_PENDING (9)
379#define WL1271_FLAG_IRQ_RUNNING (10)
Juuso Oikarinen830fb672009-12-11 15:41:06 +0200380 unsigned long flags;
381
Juuso Oikarinen451de972009-10-12 15:08:46 +0300382 struct wl1271_partition_set part;
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300383
384 struct wl1271_chip chip;
385
386 int cmd_box_addr;
387 int event_box_addr;
388
389 u8 *fw;
390 size_t fw_len;
Juuso Oikarinen152ee6e2010-02-18 13:25:42 +0200391 struct wl1271_nvs_file *nvs;
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300392
393 u8 bssid[ETH_ALEN];
394 u8 mac_addr[ETH_ALEN];
395 u8 bss_type;
396 u8 ssid[IW_ESSID_MAX_SIZE + 1];
397 u8 ssid_len;
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300398 int channel;
399
400 struct wl1271_acx_mem_map *target_mem_map;
401
402 /* Accounting for allocated / available TX blocks on HW */
403 u32 tx_blocks_freed[NUM_TX_QUEUES];
404 u32 tx_blocks_available;
Juuso Oikarinenffb591c2010-02-22 08:38:31 +0200405 u32 tx_results_count;
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300406
407 /* Transmitted TX packets counter for chipset interface */
Juuso Oikarinenffb591c2010-02-22 08:38:31 +0200408 u32 tx_packets_count;
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300409
410 /* Time-offset between host and chipset clocks */
Juuso Oikarinenac5e1e32010-02-22 08:38:38 +0200411 s64 time_offset;
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300412
413 /* Session counter for the chipset */
414 int session_counter;
415
416 /* Frames scheduled for transmission, not handled yet */
417 struct sk_buff_head tx_queue;
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300418
419 struct work_struct tx_work;
Juuso Oikarinenc87dec92009-10-08 21:56:31 +0300420
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300421 /* Pending TX frames */
Juuso Oikarinenbe7078c2009-10-08 21:56:26 +0300422 struct sk_buff *tx_frames[ACX_TX_DESCRIPTORS];
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300423
Juuso Oikarinenac4e4ce2009-10-08 21:56:19 +0300424 /* Security sequence number counters */
425 u8 tx_security_last_seq;
Juuso Oikarinen04e36fc2010-02-22 08:38:40 +0200426 s64 tx_security_seq;
Juuso Oikarinenac4e4ce2009-10-08 21:56:19 +0300427
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300428 /* FW Rx counter */
429 u32 rx_counter;
430
431 /* Rx memory pool address */
432 struct wl1271_rx_mem_pool_addr rx_mem_pool_addr;
433
434 /* The target interrupt mask */
435 struct work_struct irq_work;
436
437 /* The mbox event mask */
438 u32 event_mask;
439
440 /* Mailbox pointers */
441 u32 mbox_ptr[2];
442
443 /* Are we currently scanning */
Teemu Paasikiviabb0b3b2009-10-13 12:47:50 +0300444 struct wl1271_scan scan;
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300445
446 /* Our association ID */
447 u16 aid;
448
Juuso Oikarinend94cd292009-10-08 21:56:25 +0300449 /* currently configured rate set */
Juuso Oikarinen830fb672009-12-11 15:41:06 +0200450 u32 sta_rate_set;
Juuso Oikarinend94cd292009-10-08 21:56:25 +0300451 u32 basic_rate_set;
Juuso Oikarinen830fb672009-12-11 15:41:06 +0200452 u32 rate_set;
Juuso Oikarinend94cd292009-10-08 21:56:25 +0300453
Juuso Oikarinen8a5a37a2009-10-08 21:56:24 +0300454 /* The current band */
455 enum ieee80211_band band;
456
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300457 /* Default key (for WEP) */
458 u32 default_key;
459
460 unsigned int rx_config;
461 unsigned int rx_filter;
462
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300463 struct completion *elp_compl;
Juuso Oikarinen37b70a82009-10-08 21:56:21 +0300464 struct delayed_work elp_work;
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300465
Juuso Oikarinen19ad0712009-11-02 20:22:11 +0200466 /* retry counter for PSM entries */
467 u8 psm_entry_retry;
468
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300469 /* in dBm */
470 int power_level;
471
472 struct wl1271_stats stats;
473 struct wl1271_debugfs debugfs;
474
475 u32 buffer_32;
476 u32 buffer_cmd;
Juuso Oikarinen545f1da2009-10-08 21:56:23 +0300477 u32 buffer_busyword[WL1271_BUSY_WORD_CNT];
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300478
479 struct wl1271_fw_status *fw_status;
480 struct wl1271_tx_hw_res_if *tx_res_if;
Juuso Oikarinenb771eee2009-10-08 21:56:34 +0300481
482 struct ieee80211_vif *vif;
Luciano Coelhod6e19d132009-10-12 15:08:43 +0300483
Juuso Oikarinen2b60100b2009-10-13 12:47:39 +0300484 /* Current chipset configuration */
485 struct conf_drv_settings conf;
Juuso Oikarinen01c09162009-10-13 12:47:55 +0300486
487 struct list_head list;
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
Teemu Paasikivi1ebec3d2009-10-13 12:47:48 +0300507static inline bool wl1271_11a_enabled(void)
508{
Juuso Oikarinen152ee6e2010-02-18 13:25:42 +0200509 /* FIXME: this could be determined based on the NVS-INI file */
Teemu Paasikivi1ebec3d2009-10-13 12:47:48 +0300510#ifdef WL1271_80211A_ENABLED
511 return true;
512#else
513 return false;
514#endif
515}
516
Luciano Coelhof5fc0f82009-08-06 16:25:28 +0300517#endif