Kalle Valo | 2f01a1f | 2009-04-29 23:33:31 +0300 | [diff] [blame] | 1 | /* |
Kalle Valo | 80301cd | 2009-06-12 14:17:39 +0300 | [diff] [blame] | 2 | * This file is part of wl1251 |
Kalle Valo | 2f01a1f | 2009-04-29 23:33:31 +0300 | [diff] [blame] | 3 | * |
| 4 | * Copyright (c) 1998-2007 Texas Instruments Incorporated |
| 5 | * Copyright (C) 2008-2009 Nokia Corporation |
| 6 | * |
| 7 | * Contact: Kalle Valo <kalle.valo@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 | |
Kalle Valo | 80301cd | 2009-06-12 14:17:39 +0300 | [diff] [blame] | 25 | #ifndef __WL1251_H__ |
| 26 | #define __WL1251_H__ |
Kalle Valo | 2f01a1f | 2009-04-29 23:33:31 +0300 | [diff] [blame] | 27 | |
| 28 | #include <linux/mutex.h> |
| 29 | #include <linux/list.h> |
| 30 | #include <linux/bitops.h> |
| 31 | #include <net/mac80211.h> |
| 32 | |
Kalle Valo | 80301cd | 2009-06-12 14:17:39 +0300 | [diff] [blame] | 33 | #define DRIVER_NAME "wl1251" |
Kalle Valo | 2f01a1f | 2009-04-29 23:33:31 +0300 | [diff] [blame] | 34 | #define DRIVER_PREFIX DRIVER_NAME ": " |
| 35 | |
| 36 | enum { |
| 37 | DEBUG_NONE = 0, |
| 38 | DEBUG_IRQ = BIT(0), |
| 39 | DEBUG_SPI = BIT(1), |
| 40 | DEBUG_BOOT = BIT(2), |
| 41 | DEBUG_MAILBOX = BIT(3), |
| 42 | DEBUG_NETLINK = BIT(4), |
| 43 | DEBUG_EVENT = BIT(5), |
| 44 | DEBUG_TX = BIT(6), |
| 45 | DEBUG_RX = BIT(7), |
| 46 | DEBUG_SCAN = BIT(8), |
| 47 | DEBUG_CRYPT = BIT(9), |
| 48 | DEBUG_PSM = BIT(10), |
| 49 | DEBUG_MAC80211 = BIT(11), |
| 50 | DEBUG_CMD = BIT(12), |
| 51 | DEBUG_ACX = BIT(13), |
| 52 | DEBUG_ALL = ~0, |
| 53 | }; |
| 54 | |
| 55 | #define DEBUG_LEVEL (DEBUG_NONE) |
| 56 | |
| 57 | #define DEBUG_DUMP_LIMIT 1024 |
| 58 | |
Kalle Valo | 80301cd | 2009-06-12 14:17:39 +0300 | [diff] [blame] | 59 | #define wl1251_error(fmt, arg...) \ |
Kalle Valo | 2f01a1f | 2009-04-29 23:33:31 +0300 | [diff] [blame] | 60 | printk(KERN_ERR DRIVER_PREFIX "ERROR " fmt "\n", ##arg) |
| 61 | |
Kalle Valo | 80301cd | 2009-06-12 14:17:39 +0300 | [diff] [blame] | 62 | #define wl1251_warning(fmt, arg...) \ |
Kalle Valo | 2f01a1f | 2009-04-29 23:33:31 +0300 | [diff] [blame] | 63 | printk(KERN_WARNING DRIVER_PREFIX "WARNING " fmt "\n", ##arg) |
| 64 | |
Kalle Valo | 80301cd | 2009-06-12 14:17:39 +0300 | [diff] [blame] | 65 | #define wl1251_notice(fmt, arg...) \ |
Kalle Valo | 2f01a1f | 2009-04-29 23:33:31 +0300 | [diff] [blame] | 66 | printk(KERN_INFO DRIVER_PREFIX fmt "\n", ##arg) |
| 67 | |
Kalle Valo | 80301cd | 2009-06-12 14:17:39 +0300 | [diff] [blame] | 68 | #define wl1251_info(fmt, arg...) \ |
Kalle Valo | 2f01a1f | 2009-04-29 23:33:31 +0300 | [diff] [blame] | 69 | printk(KERN_DEBUG DRIVER_PREFIX fmt "\n", ##arg) |
| 70 | |
Kalle Valo | 80301cd | 2009-06-12 14:17:39 +0300 | [diff] [blame] | 71 | #define wl1251_debug(level, fmt, arg...) \ |
Kalle Valo | 2f01a1f | 2009-04-29 23:33:31 +0300 | [diff] [blame] | 72 | do { \ |
| 73 | if (level & DEBUG_LEVEL) \ |
| 74 | printk(KERN_DEBUG DRIVER_PREFIX fmt "\n", ##arg); \ |
| 75 | } while (0) |
| 76 | |
Kalle Valo | 80301cd | 2009-06-12 14:17:39 +0300 | [diff] [blame] | 77 | #define wl1251_dump(level, prefix, buf, len) \ |
Kalle Valo | 2f01a1f | 2009-04-29 23:33:31 +0300 | [diff] [blame] | 78 | do { \ |
| 79 | if (level & DEBUG_LEVEL) \ |
| 80 | print_hex_dump(KERN_DEBUG, DRIVER_PREFIX prefix, \ |
| 81 | DUMP_PREFIX_OFFSET, 16, 1, \ |
| 82 | buf, \ |
| 83 | min_t(size_t, len, DEBUG_DUMP_LIMIT), \ |
| 84 | 0); \ |
| 85 | } while (0) |
| 86 | |
Kalle Valo | 80301cd | 2009-06-12 14:17:39 +0300 | [diff] [blame] | 87 | #define wl1251_dump_ascii(level, prefix, buf, len) \ |
Kalle Valo | 2f01a1f | 2009-04-29 23:33:31 +0300 | [diff] [blame] | 88 | do { \ |
| 89 | if (level & DEBUG_LEVEL) \ |
| 90 | print_hex_dump(KERN_DEBUG, DRIVER_PREFIX prefix, \ |
| 91 | DUMP_PREFIX_OFFSET, 16, 1, \ |
| 92 | buf, \ |
| 93 | min_t(size_t, len, DEBUG_DUMP_LIMIT), \ |
| 94 | true); \ |
| 95 | } while (0) |
| 96 | |
Kalle Valo | 80301cd | 2009-06-12 14:17:39 +0300 | [diff] [blame] | 97 | #define WL1251_DEFAULT_RX_CONFIG (CFG_UNI_FILTER_EN | \ |
Kalle Valo | 2f01a1f | 2009-04-29 23:33:31 +0300 | [diff] [blame] | 98 | CFG_BSSID_FILTER_EN) |
| 99 | |
Kalle Valo | 80301cd | 2009-06-12 14:17:39 +0300 | [diff] [blame] | 100 | #define WL1251_DEFAULT_RX_FILTER (CFG_RX_PRSP_EN | \ |
Kalle Valo | 2f01a1f | 2009-04-29 23:33:31 +0300 | [diff] [blame] | 101 | CFG_RX_MGMT_EN | \ |
| 102 | CFG_RX_DATA_EN | \ |
| 103 | CFG_RX_CTL_EN | \ |
| 104 | CFG_RX_BCN_EN | \ |
| 105 | CFG_RX_AUTH_EN | \ |
| 106 | CFG_RX_ASSOC_EN) |
| 107 | |
Kalle Valo | 80301cd | 2009-06-12 14:17:39 +0300 | [diff] [blame] | 108 | #define WL1251_BUSY_WORD_LEN 8 |
Kalle Valo | 2f01a1f | 2009-04-29 23:33:31 +0300 | [diff] [blame] | 109 | |
| 110 | struct boot_attr { |
| 111 | u32 radio_type; |
| 112 | u8 mac_clock; |
| 113 | u8 arm_clock; |
| 114 | int firmware_debug; |
| 115 | u32 minor; |
| 116 | u32 major; |
| 117 | u32 bugfix; |
| 118 | }; |
| 119 | |
Kalle Valo | 80301cd | 2009-06-12 14:17:39 +0300 | [diff] [blame] | 120 | enum wl1251_state { |
| 121 | WL1251_STATE_OFF, |
| 122 | WL1251_STATE_ON, |
| 123 | WL1251_STATE_PLT, |
Kalle Valo | 2f01a1f | 2009-04-29 23:33:31 +0300 | [diff] [blame] | 124 | }; |
| 125 | |
Kalle Valo | 80301cd | 2009-06-12 14:17:39 +0300 | [diff] [blame] | 126 | enum wl1251_partition_type { |
Kalle Valo | 2f01a1f | 2009-04-29 23:33:31 +0300 | [diff] [blame] | 127 | PART_DOWN, |
| 128 | PART_WORK, |
| 129 | PART_DRPW, |
| 130 | |
| 131 | PART_TABLE_LEN |
| 132 | }; |
| 133 | |
Kalle Valo | 80301cd | 2009-06-12 14:17:39 +0300 | [diff] [blame] | 134 | struct wl1251_partition { |
Kalle Valo | 2f01a1f | 2009-04-29 23:33:31 +0300 | [diff] [blame] | 135 | u32 size; |
| 136 | u32 start; |
| 137 | }; |
| 138 | |
Kalle Valo | 80301cd | 2009-06-12 14:17:39 +0300 | [diff] [blame] | 139 | struct wl1251_partition_set { |
| 140 | struct wl1251_partition mem; |
| 141 | struct wl1251_partition reg; |
Kalle Valo | 2f01a1f | 2009-04-29 23:33:31 +0300 | [diff] [blame] | 142 | }; |
| 143 | |
Kalle Valo | 80301cd | 2009-06-12 14:17:39 +0300 | [diff] [blame] | 144 | struct wl1251; |
Kalle Valo | 2f01a1f | 2009-04-29 23:33:31 +0300 | [diff] [blame] | 145 | |
| 146 | /* FIXME: I'm not sure about this structure name */ |
Kalle Valo | 80301cd | 2009-06-12 14:17:39 +0300 | [diff] [blame] | 147 | struct wl1251_chip { |
Kalle Valo | 2f01a1f | 2009-04-29 23:33:31 +0300 | [diff] [blame] | 148 | u32 id; |
| 149 | |
| 150 | const char *fw_filename; |
| 151 | const char *nvs_filename; |
| 152 | |
| 153 | char fw_ver[21]; |
| 154 | |
| 155 | unsigned int power_on_sleep; |
| 156 | int intr_cmd_complete; |
| 157 | int intr_init_complete; |
| 158 | |
Kalle Valo | 80301cd | 2009-06-12 14:17:39 +0300 | [diff] [blame] | 159 | int (*op_upload_fw)(struct wl1251 *wl); |
| 160 | int (*op_upload_nvs)(struct wl1251 *wl); |
| 161 | int (*op_boot)(struct wl1251 *wl); |
| 162 | void (*op_set_ecpu_ctrl)(struct wl1251 *wl, u32 flag); |
| 163 | void (*op_target_enable_interrupts)(struct wl1251 *wl); |
| 164 | int (*op_hw_init)(struct wl1251 *wl); |
| 165 | int (*op_plt_init)(struct wl1251 *wl); |
| 166 | void (*op_tx_flush)(struct wl1251 *wl); |
| 167 | void (*op_fw_version)(struct wl1251 *wl); |
| 168 | int (*op_cmd_join)(struct wl1251 *wl, u8 bss_type, u8 dtim_interval, |
Juuso Oikarinen | 77cc9e4 | 2009-06-12 14:16:52 +0300 | [diff] [blame] | 169 | u16 beacon_interval, u8 wait); |
Kalle Valo | 2f01a1f | 2009-04-29 23:33:31 +0300 | [diff] [blame] | 170 | |
Kalle Valo | 80301cd | 2009-06-12 14:17:39 +0300 | [diff] [blame] | 171 | struct wl1251_partition_set *p_table; |
Kalle Valo | 2f01a1f | 2009-04-29 23:33:31 +0300 | [diff] [blame] | 172 | enum wl12xx_acx_int_reg *acx_reg_table; |
| 173 | }; |
| 174 | |
Kalle Valo | 80301cd | 2009-06-12 14:17:39 +0300 | [diff] [blame] | 175 | struct wl1251_stats { |
Kalle Valo | 2f01a1f | 2009-04-29 23:33:31 +0300 | [diff] [blame] | 176 | struct acx_statistics *fw_stats; |
| 177 | unsigned long fw_stats_update; |
| 178 | |
| 179 | unsigned int retry_count; |
| 180 | unsigned int excessive_retries; |
| 181 | }; |
| 182 | |
Kalle Valo | 80301cd | 2009-06-12 14:17:39 +0300 | [diff] [blame] | 183 | struct wl1251_debugfs { |
Kalle Valo | 2f01a1f | 2009-04-29 23:33:31 +0300 | [diff] [blame] | 184 | struct dentry *rootdir; |
| 185 | struct dentry *fw_statistics; |
| 186 | |
| 187 | struct dentry *tx_internal_desc_overflow; |
| 188 | |
| 189 | struct dentry *rx_out_of_mem; |
| 190 | struct dentry *rx_hdr_overflow; |
| 191 | struct dentry *rx_hw_stuck; |
| 192 | struct dentry *rx_dropped; |
| 193 | struct dentry *rx_fcs_err; |
| 194 | struct dentry *rx_xfr_hint_trig; |
| 195 | struct dentry *rx_path_reset; |
| 196 | struct dentry *rx_reset_counter; |
| 197 | |
| 198 | struct dentry *dma_rx_requested; |
| 199 | struct dentry *dma_rx_errors; |
| 200 | struct dentry *dma_tx_requested; |
| 201 | struct dentry *dma_tx_errors; |
| 202 | |
| 203 | struct dentry *isr_cmd_cmplt; |
| 204 | struct dentry *isr_fiqs; |
| 205 | struct dentry *isr_rx_headers; |
| 206 | struct dentry *isr_rx_mem_overflow; |
| 207 | struct dentry *isr_rx_rdys; |
| 208 | struct dentry *isr_irqs; |
| 209 | struct dentry *isr_tx_procs; |
| 210 | struct dentry *isr_decrypt_done; |
| 211 | struct dentry *isr_dma0_done; |
| 212 | struct dentry *isr_dma1_done; |
| 213 | struct dentry *isr_tx_exch_complete; |
| 214 | struct dentry *isr_commands; |
| 215 | struct dentry *isr_rx_procs; |
| 216 | struct dentry *isr_hw_pm_mode_changes; |
| 217 | struct dentry *isr_host_acknowledges; |
| 218 | struct dentry *isr_pci_pm; |
| 219 | struct dentry *isr_wakeups; |
| 220 | struct dentry *isr_low_rssi; |
| 221 | |
| 222 | struct dentry *wep_addr_key_count; |
| 223 | struct dentry *wep_default_key_count; |
| 224 | /* skipping wep.reserved */ |
| 225 | struct dentry *wep_key_not_found; |
| 226 | struct dentry *wep_decrypt_fail; |
| 227 | struct dentry *wep_packets; |
| 228 | struct dentry *wep_interrupt; |
| 229 | |
| 230 | struct dentry *pwr_ps_enter; |
| 231 | struct dentry *pwr_elp_enter; |
| 232 | struct dentry *pwr_missing_bcns; |
| 233 | struct dentry *pwr_wake_on_host; |
| 234 | struct dentry *pwr_wake_on_timer_exp; |
| 235 | struct dentry *pwr_tx_with_ps; |
| 236 | struct dentry *pwr_tx_without_ps; |
| 237 | struct dentry *pwr_rcvd_beacons; |
| 238 | struct dentry *pwr_power_save_off; |
| 239 | struct dentry *pwr_enable_ps; |
| 240 | struct dentry *pwr_disable_ps; |
| 241 | struct dentry *pwr_fix_tsf_ps; |
| 242 | /* skipping cont_miss_bcns_spread for now */ |
| 243 | struct dentry *pwr_rcvd_awake_beacons; |
| 244 | |
| 245 | struct dentry *mic_rx_pkts; |
| 246 | struct dentry *mic_calc_failure; |
| 247 | |
| 248 | struct dentry *aes_encrypt_fail; |
| 249 | struct dentry *aes_decrypt_fail; |
| 250 | struct dentry *aes_encrypt_packets; |
| 251 | struct dentry *aes_decrypt_packets; |
| 252 | struct dentry *aes_encrypt_interrupt; |
| 253 | struct dentry *aes_decrypt_interrupt; |
| 254 | |
| 255 | struct dentry *event_heart_beat; |
| 256 | struct dentry *event_calibration; |
| 257 | struct dentry *event_rx_mismatch; |
| 258 | struct dentry *event_rx_mem_empty; |
| 259 | struct dentry *event_rx_pool; |
| 260 | struct dentry *event_oom_late; |
| 261 | struct dentry *event_phy_transmit_error; |
| 262 | struct dentry *event_tx_stuck; |
| 263 | |
| 264 | struct dentry *ps_pspoll_timeouts; |
| 265 | struct dentry *ps_upsd_timeouts; |
| 266 | struct dentry *ps_upsd_max_sptime; |
| 267 | struct dentry *ps_upsd_max_apturn; |
| 268 | struct dentry *ps_pspoll_max_apturn; |
| 269 | struct dentry *ps_pspoll_utilization; |
| 270 | struct dentry *ps_upsd_utilization; |
| 271 | |
| 272 | struct dentry *rxpipe_rx_prep_beacon_drop; |
| 273 | struct dentry *rxpipe_descr_host_int_trig_rx_data; |
| 274 | struct dentry *rxpipe_beacon_buffer_thres_host_int_trig_rx_data; |
| 275 | struct dentry *rxpipe_missed_beacon_host_int_trig_rx_data; |
| 276 | struct dentry *rxpipe_tx_xfr_host_int_trig_rx_data; |
| 277 | |
| 278 | struct dentry *tx_queue_len; |
| 279 | |
| 280 | struct dentry *retry_count; |
| 281 | struct dentry *excessive_retries; |
| 282 | }; |
| 283 | |
Kalle Valo | 80301cd | 2009-06-12 14:17:39 +0300 | [diff] [blame] | 284 | struct wl1251 { |
Kalle Valo | 2f01a1f | 2009-04-29 23:33:31 +0300 | [diff] [blame] | 285 | struct ieee80211_hw *hw; |
| 286 | bool mac80211_registered; |
| 287 | |
| 288 | struct spi_device *spi; |
| 289 | |
| 290 | void (*set_power)(bool enable); |
| 291 | int irq; |
| 292 | |
Kalle Valo | 80301cd | 2009-06-12 14:17:39 +0300 | [diff] [blame] | 293 | enum wl1251_state state; |
Kalle Valo | 2f01a1f | 2009-04-29 23:33:31 +0300 | [diff] [blame] | 294 | struct mutex mutex; |
| 295 | |
| 296 | int physical_mem_addr; |
| 297 | int physical_reg_addr; |
| 298 | int virtual_mem_addr; |
| 299 | int virtual_reg_addr; |
| 300 | |
Kalle Valo | 80301cd | 2009-06-12 14:17:39 +0300 | [diff] [blame] | 301 | struct wl1251_chip chip; |
Kalle Valo | 2f01a1f | 2009-04-29 23:33:31 +0300 | [diff] [blame] | 302 | |
| 303 | int cmd_box_addr; |
| 304 | int event_box_addr; |
| 305 | struct boot_attr boot_attr; |
| 306 | |
| 307 | u8 *fw; |
| 308 | size_t fw_len; |
| 309 | u8 *nvs; |
| 310 | size_t nvs_len; |
| 311 | |
| 312 | u8 bssid[ETH_ALEN]; |
| 313 | u8 mac_addr[ETH_ALEN]; |
| 314 | u8 bss_type; |
| 315 | u8 listen_int; |
| 316 | int channel; |
| 317 | |
| 318 | void *target_mem_map; |
| 319 | struct acx_data_path_params_resp *data_path; |
| 320 | |
| 321 | /* Number of TX packets transferred to the FW, modulo 16 */ |
| 322 | u32 data_in_count; |
| 323 | |
| 324 | /* Frames scheduled for transmission, not handled yet */ |
| 325 | struct sk_buff_head tx_queue; |
| 326 | bool tx_queue_stopped; |
| 327 | |
| 328 | struct work_struct tx_work; |
| 329 | struct work_struct filter_work; |
| 330 | |
| 331 | /* Pending TX frames */ |
| 332 | struct sk_buff *tx_frames[16]; |
| 333 | |
| 334 | /* |
| 335 | * Index pointing to the next TX complete entry |
| 336 | * in the cyclic XT complete array we get from |
| 337 | * the FW. |
| 338 | */ |
| 339 | u32 next_tx_complete; |
| 340 | |
| 341 | /* FW Rx counter */ |
| 342 | u32 rx_counter; |
| 343 | |
| 344 | /* Rx frames handled */ |
| 345 | u32 rx_handled; |
| 346 | |
| 347 | /* Current double buffer */ |
| 348 | u32 rx_current_buffer; |
| 349 | u32 rx_last_id; |
| 350 | |
| 351 | /* The target interrupt mask */ |
| 352 | u32 intr_mask; |
| 353 | struct work_struct irq_work; |
| 354 | |
| 355 | /* The mbox event mask */ |
| 356 | u32 event_mask; |
| 357 | |
| 358 | /* Mailbox pointers */ |
| 359 | u32 mbox_ptr[2]; |
| 360 | |
| 361 | /* Are we currently scanning */ |
| 362 | bool scanning; |
| 363 | |
| 364 | /* Our association ID */ |
| 365 | u16 aid; |
| 366 | |
| 367 | /* Default key (for WEP) */ |
| 368 | u32 default_key; |
| 369 | |
| 370 | unsigned int tx_mgmt_frm_rate; |
| 371 | unsigned int tx_mgmt_frm_mod; |
| 372 | |
| 373 | unsigned int rx_config; |
| 374 | unsigned int rx_filter; |
| 375 | |
| 376 | /* is firmware in elp mode */ |
| 377 | bool elp; |
| 378 | |
| 379 | /* we can be in psm, but not in elp, we have to differentiate */ |
| 380 | bool psm; |
| 381 | |
| 382 | /* PSM mode requested */ |
| 383 | bool psm_requested; |
| 384 | |
| 385 | /* in dBm */ |
| 386 | int power_level; |
| 387 | |
Kalle Valo | 80301cd | 2009-06-12 14:17:39 +0300 | [diff] [blame] | 388 | struct wl1251_stats stats; |
| 389 | struct wl1251_debugfs debugfs; |
Kalle Valo | 1d3b813 | 2009-06-12 14:14:28 +0300 | [diff] [blame] | 390 | |
| 391 | u32 buffer_32; |
Kalle Valo | 56343a3 | 2009-06-12 14:14:47 +0300 | [diff] [blame] | 392 | u32 buffer_cmd; |
Kalle Valo | 80301cd | 2009-06-12 14:17:39 +0300 | [diff] [blame] | 393 | u8 buffer_busyword[WL1251_BUSY_WORD_LEN]; |
| 394 | struct wl1251_rx_descriptor *rx_descriptor; |
Kalle Valo | 2f01a1f | 2009-04-29 23:33:31 +0300 | [diff] [blame] | 395 | }; |
| 396 | |
Kalle Valo | 80301cd | 2009-06-12 14:17:39 +0300 | [diff] [blame] | 397 | int wl1251_plt_start(struct wl1251 *wl); |
| 398 | int wl1251_plt_stop(struct wl1251 *wl); |
Kalle Valo | 2f01a1f | 2009-04-29 23:33:31 +0300 | [diff] [blame] | 399 | |
| 400 | #define DEFAULT_HW_GEN_MODULATION_TYPE CCK_LONG /* Long Preamble */ |
| 401 | #define DEFAULT_HW_GEN_TX_RATE RATE_2MBPS |
| 402 | #define JOIN_TIMEOUT 5000 /* 5000 milliseconds to join */ |
| 403 | |
Kalle Valo | 80301cd | 2009-06-12 14:17:39 +0300 | [diff] [blame] | 404 | #define WL1251_DEFAULT_POWER_LEVEL 20 |
Kalle Valo | 2f01a1f | 2009-04-29 23:33:31 +0300 | [diff] [blame] | 405 | |
Kalle Valo | 80301cd | 2009-06-12 14:17:39 +0300 | [diff] [blame] | 406 | #define WL1251_TX_QUEUE_MAX_LENGTH 20 |
Kalle Valo | 2f01a1f | 2009-04-29 23:33:31 +0300 | [diff] [blame] | 407 | |
| 408 | /* Different chips need different sleep times after power on. WL1271 needs |
| 409 | * 200ms, WL1251 needs only 10ms. By default we use 200ms, but as soon as we |
Kalle Valo | 80301cd | 2009-06-12 14:17:39 +0300 | [diff] [blame] | 410 | * know the chip ID, we change the sleep value in the wl1251 chip structure, |
Kalle Valo | 2f01a1f | 2009-04-29 23:33:31 +0300 | [diff] [blame] | 411 | * so in subsequent power ons, we don't waste more time then needed. */ |
Kalle Valo | 80301cd | 2009-06-12 14:17:39 +0300 | [diff] [blame] | 412 | #define WL1251_DEFAULT_POWER_ON_SLEEP 200 |
Kalle Valo | 2f01a1f | 2009-04-29 23:33:31 +0300 | [diff] [blame] | 413 | |
| 414 | #define CHIP_ID_1251_PG10 (0x7010101) |
| 415 | #define CHIP_ID_1251_PG11 (0x7020101) |
| 416 | #define CHIP_ID_1251_PG12 (0x7030101) |
| 417 | #define CHIP_ID_1271_PG10 (0x4030101) |
Luciano Coelho | 27797d6 | 2009-06-12 14:15:33 +0300 | [diff] [blame] | 418 | #define CHIP_ID_1271_PG20 (0x4030111) |
Kalle Valo | 2f01a1f | 2009-04-29 23:33:31 +0300 | [diff] [blame] | 419 | |
| 420 | #endif |