diff options
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-commands.h')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-commands.h | 1520 |
1 files changed, 707 insertions, 813 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-commands.h b/drivers/net/wireless/iwlwifi/iwl-commands.h index 60725a5c1b69..6ee5f1aa555c 100644 --- a/drivers/net/wireless/iwlwifi/iwl-commands.h +++ b/drivers/net/wireless/iwlwifi/iwl-commands.h | |||
@@ -5,7 +5,7 @@ | |||
5 | * | 5 | * |
6 | * GPL LICENSE SUMMARY | 6 | * GPL LICENSE SUMMARY |
7 | * | 7 | * |
8 | * Copyright(c) 2005 - 2010 Intel Corporation. All rights reserved. | 8 | * Copyright(c) 2005 - 2011 Intel Corporation. All rights reserved. |
9 | * | 9 | * |
10 | * This program is free software; you can redistribute it and/or modify | 10 | * This program is free software; you can redistribute it and/or modify |
11 | * it under the terms of version 2 of the GNU General Public License as | 11 | * it under the terms of version 2 of the GNU General Public License as |
@@ -30,7 +30,7 @@ | |||
30 | * | 30 | * |
31 | * BSD LICENSE | 31 | * BSD LICENSE |
32 | * | 32 | * |
33 | * Copyright(c) 2005 - 2010 Intel Corporation. All rights reserved. | 33 | * Copyright(c) 2005 - 2011 Intel Corporation. All rights reserved. |
34 | * All rights reserved. | 34 | * All rights reserved. |
35 | * | 35 | * |
36 | * Redistribution and use in source and binary forms, with or without | 36 | * Redistribution and use in source and binary forms, with or without |
@@ -62,7 +62,7 @@ | |||
62 | *****************************************************************************/ | 62 | *****************************************************************************/ |
63 | /* | 63 | /* |
64 | * Please use this file (iwl-commands.h) only for uCode API definitions. | 64 | * Please use this file (iwl-commands.h) only for uCode API definitions. |
65 | * Please use iwl-4965-hw.h for hardware-related definitions. | 65 | * Please use iwl-xxxx-hw.h for hardware-related definitions. |
66 | * Please use iwl-dev.h for driver implementation definitions. | 66 | * Please use iwl-dev.h for driver implementation definitions. |
67 | */ | 67 | */ |
68 | 68 | ||
@@ -103,9 +103,7 @@ enum { | |||
103 | REPLY_WEPKEY = 0x20, | 103 | REPLY_WEPKEY = 0x20, |
104 | 104 | ||
105 | /* RX, TX, LEDs */ | 105 | /* RX, TX, LEDs */ |
106 | REPLY_3945_RX = 0x1b, /* 3945 only */ | ||
107 | REPLY_TX = 0x1c, | 106 | REPLY_TX = 0x1c, |
108 | REPLY_RATE_SCALE = 0x47, /* 3945 only */ | ||
109 | REPLY_LEDS_CMD = 0x48, | 107 | REPLY_LEDS_CMD = 0x48, |
110 | REPLY_TX_LINK_QUALITY_CMD = 0x4e, /* for 4965 and up */ | 108 | REPLY_TX_LINK_QUALITY_CMD = 0x4e, /* for 4965 and up */ |
111 | 109 | ||
@@ -173,6 +171,23 @@ enum { | |||
173 | REPLY_RX_MPDU_CMD = 0xc1, | 171 | REPLY_RX_MPDU_CMD = 0xc1, |
174 | REPLY_RX = 0xc3, | 172 | REPLY_RX = 0xc3, |
175 | REPLY_COMPRESSED_BA = 0xc5, | 173 | REPLY_COMPRESSED_BA = 0xc5, |
174 | |||
175 | /* BT Coex */ | ||
176 | REPLY_BT_COEX_PRIO_TABLE = 0xcc, | ||
177 | REPLY_BT_COEX_PROT_ENV = 0xcd, | ||
178 | REPLY_BT_COEX_PROFILE_NOTIF = 0xce, | ||
179 | |||
180 | /* PAN commands */ | ||
181 | REPLY_WIPAN_PARAMS = 0xb2, | ||
182 | REPLY_WIPAN_RXON = 0xb3, /* use REPLY_RXON structure */ | ||
183 | REPLY_WIPAN_RXON_TIMING = 0xb4, /* use REPLY_RXON_TIMING structure */ | ||
184 | REPLY_WIPAN_RXON_ASSOC = 0xb6, /* use REPLY_RXON_ASSOC structure */ | ||
185 | REPLY_WIPAN_QOS_PARAM = 0xb7, /* use REPLY_QOS_PARAM structure */ | ||
186 | REPLY_WIPAN_WEPKEY = 0xb8, /* use REPLY_WEPKEY structure */ | ||
187 | REPLY_WIPAN_P2P_CHANNEL_SWITCH = 0xb9, | ||
188 | REPLY_WIPAN_NOA_NOTIFICATION = 0xbc, | ||
189 | REPLY_WIPAN_DEACTIVATION_COMPLETE = 0xbd, | ||
190 | |||
176 | REPLY_MAX = 0xff | 191 | REPLY_MAX = 0xff |
177 | }; | 192 | }; |
178 | 193 | ||
@@ -190,7 +205,6 @@ enum { | |||
190 | #define QUEUE_TO_SEQ(q) (((q) & 0x1f) << 8) | 205 | #define QUEUE_TO_SEQ(q) (((q) & 0x1f) << 8) |
191 | #define SEQ_TO_INDEX(s) ((s) & 0xff) | 206 | #define SEQ_TO_INDEX(s) ((s) & 0xff) |
192 | #define INDEX_TO_SEQ(i) ((i) & 0xff) | 207 | #define INDEX_TO_SEQ(i) ((i) & 0xff) |
193 | #define SEQ_HUGE_FRAME cpu_to_le16(0x4000) | ||
194 | #define SEQ_RX_FRAME cpu_to_le16(0x8000) | 208 | #define SEQ_RX_FRAME cpu_to_le16(0x8000) |
195 | 209 | ||
196 | /** | 210 | /** |
@@ -212,16 +226,14 @@ struct iwl_cmd_header { | |||
212 | * There is one exception: uCode sets bit 15 when it originates | 226 | * There is one exception: uCode sets bit 15 when it originates |
213 | * the response/notification, i.e. when the response/notification | 227 | * the response/notification, i.e. when the response/notification |
214 | * is not a direct response to a command sent by the driver. For | 228 | * is not a direct response to a command sent by the driver. For |
215 | * example, uCode issues REPLY_3945_RX when it sends a received frame | 229 | * example, uCode issues REPLY_RX when it sends a received frame |
216 | * to the driver; it is not a direct response to any driver command. | 230 | * to the driver; it is not a direct response to any driver command. |
217 | * | 231 | * |
218 | * The Linux driver uses the following format: | 232 | * The Linux driver uses the following format: |
219 | * | 233 | * |
220 | * 0:7 tfd index - position within TX queue | 234 | * 0:7 tfd index - position within TX queue |
221 | * 8:12 TX queue id | 235 | * 8:12 TX queue id |
222 | * 13 reserved | 236 | * 13:14 reserved |
223 | * 14 huge - driver sets this to indicate command is in the | ||
224 | * 'huge' storage at the end of the command buffers | ||
225 | * 15 unsolicited RX or uCode-originated notification | 237 | * 15 unsolicited RX or uCode-originated notification |
226 | */ | 238 | */ |
227 | __le16 sequence; | 239 | __le16 sequence; |
@@ -232,36 +244,6 @@ struct iwl_cmd_header { | |||
232 | 244 | ||
233 | 245 | ||
234 | /** | 246 | /** |
235 | * struct iwl3945_tx_power | ||
236 | * | ||
237 | * Used in REPLY_TX_PWR_TABLE_CMD, REPLY_SCAN_CMD, REPLY_CHANNEL_SWITCH | ||
238 | * | ||
239 | * Each entry contains two values: | ||
240 | * 1) DSP gain (or sometimes called DSP attenuation). This is a fine-grained | ||
241 | * linear value that multiplies the output of the digital signal processor, | ||
242 | * before being sent to the analog radio. | ||
243 | * 2) Radio gain. This sets the analog gain of the radio Tx path. | ||
244 | * It is a coarser setting, and behaves in a logarithmic (dB) fashion. | ||
245 | * | ||
246 | * Driver obtains values from struct iwl3945_tx_power power_gain_table[][]. | ||
247 | */ | ||
248 | struct iwl3945_tx_power { | ||
249 | u8 tx_gain; /* gain for analog radio */ | ||
250 | u8 dsp_atten; /* gain for DSP */ | ||
251 | } __packed; | ||
252 | |||
253 | /** | ||
254 | * struct iwl3945_power_per_rate | ||
255 | * | ||
256 | * Used in REPLY_TX_PWR_TABLE_CMD, REPLY_CHANNEL_SWITCH | ||
257 | */ | ||
258 | struct iwl3945_power_per_rate { | ||
259 | u8 rate; /* plcp */ | ||
260 | struct iwl3945_tx_power tpc; | ||
261 | u8 reserved; | ||
262 | } __packed; | ||
263 | |||
264 | /** | ||
265 | * iwlagn rate_n_flags bit fields | 247 | * iwlagn rate_n_flags bit fields |
266 | * | 248 | * |
267 | * rate_n_flags format is used in following iwlagn commands: | 249 | * rate_n_flags format is used in following iwlagn commands: |
@@ -307,6 +289,8 @@ struct iwl3945_power_per_rate { | |||
307 | #define RATE_MCS_SPATIAL_MSK 0x18 | 289 | #define RATE_MCS_SPATIAL_MSK 0x18 |
308 | #define RATE_MCS_HT_DUP_POS 5 | 290 | #define RATE_MCS_HT_DUP_POS 5 |
309 | #define RATE_MCS_HT_DUP_MSK 0x20 | 291 | #define RATE_MCS_HT_DUP_MSK 0x20 |
292 | /* Both legacy and HT use bits 7:0 as the CCK/OFDM rate or HT MCS */ | ||
293 | #define RATE_MCS_RATE_MSK 0xff | ||
310 | 294 | ||
311 | /* Bit 8: (1) HT format, (0) legacy format in bits 7:0 */ | 295 | /* Bit 8: (1) HT format, (0) legacy format in bits 7:0 */ |
312 | #define RATE_MCS_FLAGS_POS 8 | 296 | #define RATE_MCS_FLAGS_POS 8 |
@@ -358,30 +342,6 @@ struct iwl3945_power_per_rate { | |||
358 | #define IWL_PWR_CCK_ENTRIES 2 | 342 | #define IWL_PWR_CCK_ENTRIES 2 |
359 | 343 | ||
360 | /** | 344 | /** |
361 | * union iwl4965_tx_power_dual_stream | ||
362 | * | ||
363 | * Host format used for REPLY_TX_PWR_TABLE_CMD, REPLY_CHANNEL_SWITCH | ||
364 | * Use __le32 version (struct tx_power_dual_stream) when building command. | ||
365 | * | ||
366 | * Driver provides radio gain and DSP attenuation settings to device in pairs, | ||
367 | * one value for each transmitter chain. The first value is for transmitter A, | ||
368 | * second for transmitter B. | ||
369 | * | ||
370 | * For SISO bit rates, both values in a pair should be identical. | ||
371 | * For MIMO rates, one value may be different from the other, | ||
372 | * in order to balance the Tx output between the two transmitters. | ||
373 | * | ||
374 | * See more details in doc for TXPOWER in iwl-4965-hw.h. | ||
375 | */ | ||
376 | union iwl4965_tx_power_dual_stream { | ||
377 | struct { | ||
378 | u8 radio_tx_gain[2]; | ||
379 | u8 dsp_predis_atten[2]; | ||
380 | } s; | ||
381 | u32 dw; | ||
382 | }; | ||
383 | |||
384 | /** | ||
385 | * struct tx_power_dual_stream | 345 | * struct tx_power_dual_stream |
386 | * | 346 | * |
387 | * Table entries in REPLY_TX_PWR_TABLE_CMD, REPLY_CHANNEL_SWITCH | 347 | * Table entries in REPLY_TX_PWR_TABLE_CMD, REPLY_CHANNEL_SWITCH |
@@ -393,22 +353,13 @@ struct tx_power_dual_stream { | |||
393 | } __packed; | 353 | } __packed; |
394 | 354 | ||
395 | /** | 355 | /** |
396 | * struct iwl4965_tx_power_db | ||
397 | * | ||
398 | * Entire table within REPLY_TX_PWR_TABLE_CMD, REPLY_CHANNEL_SWITCH | ||
399 | */ | ||
400 | struct iwl4965_tx_power_db { | ||
401 | struct tx_power_dual_stream power_tbl[POWER_TABLE_NUM_ENTRIES]; | ||
402 | } __packed; | ||
403 | |||
404 | /** | ||
405 | * Command REPLY_TX_POWER_DBM_CMD = 0x98 | 356 | * Command REPLY_TX_POWER_DBM_CMD = 0x98 |
406 | * struct iwl5000_tx_power_dbm_cmd | 357 | * struct iwlagn_tx_power_dbm_cmd |
407 | */ | 358 | */ |
408 | #define IWL50_TX_POWER_AUTO 0x7f | 359 | #define IWLAGN_TX_POWER_AUTO 0x7f |
409 | #define IWL50_TX_POWER_NO_CLOSED (0x1 << 6) | 360 | #define IWLAGN_TX_POWER_NO_CLOSED (0x1 << 6) |
410 | 361 | ||
411 | struct iwl5000_tx_power_dbm_cmd { | 362 | struct iwlagn_tx_power_dbm_cmd { |
412 | s8 global_lmt; /*in half-dBm (e.g. 30 = 15 dBm) */ | 363 | s8 global_lmt; /*in half-dBm (e.g. 30 = 15 dBm) */ |
413 | u8 flags; | 364 | u8 flags; |
414 | s8 srv_chan_lmt; /*in half-dBm (e.g. 30 = 15 dBm) */ | 365 | s8 srv_chan_lmt; /*in half-dBm (e.g. 30 = 15 dBm) */ |
@@ -432,55 +383,18 @@ struct iwl_tx_ant_config_cmd { | |||
432 | *****************************************************************************/ | 383 | *****************************************************************************/ |
433 | 384 | ||
434 | #define UCODE_VALID_OK cpu_to_le32(0x1) | 385 | #define UCODE_VALID_OK cpu_to_le32(0x1) |
435 | #define INITIALIZE_SUBTYPE (9) | ||
436 | |||
437 | /* | ||
438 | * ("Initialize") REPLY_ALIVE = 0x1 (response only, not a command) | ||
439 | * | ||
440 | * uCode issues this "initialize alive" notification once the initialization | ||
441 | * uCode image has completed its work, and is ready to load the runtime image. | ||
442 | * This is the *first* "alive" notification that the driver will receive after | ||
443 | * rebooting uCode; the "initialize" alive is indicated by subtype field == 9. | ||
444 | * | ||
445 | * See comments documenting "BSM" (bootstrap state machine). | ||
446 | * | ||
447 | * For 4965, this notification contains important calibration data for | ||
448 | * calculating txpower settings: | ||
449 | * | ||
450 | * 1) Power supply voltage indication. The voltage sensor outputs higher | ||
451 | * values for lower voltage, and vice verse. | ||
452 | * | ||
453 | * 2) Temperature measurement parameters, for each of two channel widths | ||
454 | * (20 MHz and 40 MHz) supported by the radios. Temperature sensing | ||
455 | * is done via one of the receiver chains, and channel width influences | ||
456 | * the results. | ||
457 | * | ||
458 | * 3) Tx gain compensation to balance 4965's 2 Tx chains for MIMO operation, | ||
459 | * for each of 5 frequency ranges. | ||
460 | */ | ||
461 | struct iwl_init_alive_resp { | ||
462 | u8 ucode_minor; | ||
463 | u8 ucode_major; | ||
464 | __le16 reserved1; | ||
465 | u8 sw_rev[8]; | ||
466 | u8 ver_type; | ||
467 | u8 ver_subtype; /* "9" for initialize alive */ | ||
468 | __le16 reserved2; | ||
469 | __le32 log_event_table_ptr; | ||
470 | __le32 error_event_table_ptr; | ||
471 | __le32 timestamp; | ||
472 | __le32 is_valid; | ||
473 | 386 | ||
474 | /* calibration values from "initialize" uCode */ | 387 | enum iwlagn_ucode_subtype { |
475 | __le32 voltage; /* signed, higher value is lower voltage */ | 388 | UCODE_SUBTYPE_REGULAR = 0, |
476 | __le32 therm_r1[2]; /* signed, 1st for normal, 2nd for HT40 */ | 389 | UCODE_SUBTYPE_REGULAR_NEW = 1, |
477 | __le32 therm_r2[2]; /* signed */ | 390 | UCODE_SUBTYPE_INIT = 9, |
478 | __le32 therm_r3[2]; /* signed */ | ||
479 | __le32 therm_r4[2]; /* signed */ | ||
480 | __le32 tx_atten[5][2]; /* signed MIMO gain comp, 5 freq groups, | ||
481 | * 2 Tx chains */ | ||
482 | } __packed; | ||
483 | 391 | ||
392 | /* | ||
393 | * Not a valid subtype, the ucode has just a u8, so | ||
394 | * we can use something > 0xff for this value. | ||
395 | */ | ||
396 | UCODE_SUBTYPE_NONE_LOADED = 0x100, | ||
397 | }; | ||
484 | 398 | ||
485 | /** | 399 | /** |
486 | * REPLY_ALIVE = 0x1 (response only, not a command) | 400 | * REPLY_ALIVE = 0x1 (response only, not a command) |
@@ -516,49 +430,61 @@ struct iwl_init_alive_resp { | |||
516 | * | 430 | * |
517 | * 2) error_event_table_ptr indicates base of the error log. This contains | 431 | * 2) error_event_table_ptr indicates base of the error log. This contains |
518 | * information about any uCode error that occurs. For agn, the format | 432 | * information about any uCode error that occurs. For agn, the format |
519 | * of the error log is: | 433 | * of the error log is defined by struct iwl_error_event_table. |
520 | * | ||
521 | * __le32 valid; (nonzero) valid, (0) log is empty | ||
522 | * __le32 error_id; type of error | ||
523 | * __le32 pc; program counter | ||
524 | * __le32 blink1; branch link | ||
525 | * __le32 blink2; branch link | ||
526 | * __le32 ilink1; interrupt link | ||
527 | * __le32 ilink2; interrupt link | ||
528 | * __le32 data1; error-specific data | ||
529 | * __le32 data2; error-specific data | ||
530 | * __le32 line; source code line of error | ||
531 | * __le32 bcon_time; beacon timer | ||
532 | * __le32 tsf_low; network timestamp function timer | ||
533 | * __le32 tsf_hi; network timestamp function timer | ||
534 | * __le32 gp1; GP1 timer register | ||
535 | * __le32 gp2; GP2 timer register | ||
536 | * __le32 gp3; GP3 timer register | ||
537 | * __le32 ucode_ver; uCode version | ||
538 | * __le32 hw_ver; HW Silicon version | ||
539 | * __le32 brd_ver; HW board version | ||
540 | * __le32 log_pc; log program counter | ||
541 | * __le32 frame_ptr; frame pointer | ||
542 | * __le32 stack_ptr; stack pointer | ||
543 | * __le32 hcmd; last host command | ||
544 | * __le32 isr0; isr status register LMPM_NIC_ISR0: rxtx_flag | ||
545 | * __le32 isr1; isr status register LMPM_NIC_ISR1: host_flag | ||
546 | * __le32 isr2; isr status register LMPM_NIC_ISR2: enc_flag | ||
547 | * __le32 isr3; isr status register LMPM_NIC_ISR3: time_flag | ||
548 | * __le32 isr4; isr status register LMPM_NIC_ISR4: wico interrupt | ||
549 | * __le32 isr_pref; isr status register LMPM_NIC_PREF_STAT | ||
550 | * __le32 wait_event; wait event() caller address | ||
551 | * __le32 l2p_control; L2pControlField | ||
552 | * __le32 l2p_duration; L2pDurationField | ||
553 | * __le32 l2p_mhvalid; L2pMhValidBits | ||
554 | * __le32 l2p_addr_match; L2pAddrMatchStat | ||
555 | * __le32 lmpm_pmg_sel; indicate which clocks are turned on (LMPM_PMG_SEL) | ||
556 | * __le32 u_timestamp; indicate when the date and time of the compilation | ||
557 | * __le32 reserved; | ||
558 | * | 434 | * |
559 | * The Linux driver can print both logs to the system log when a uCode error | 435 | * The Linux driver can print both logs to the system log when a uCode error |
560 | * occurs. | 436 | * occurs. |
561 | */ | 437 | */ |
438 | |||
439 | /* | ||
440 | * Note: This structure is read from the device with IO accesses, | ||
441 | * and the reading already does the endian conversion. As it is | ||
442 | * read with u32-sized accesses, any members with a different size | ||
443 | * need to be ordered correctly though! | ||
444 | */ | ||
445 | struct iwl_error_event_table { | ||
446 | u32 valid; /* (nonzero) valid, (0) log is empty */ | ||
447 | u32 error_id; /* type of error */ | ||
448 | u32 pc; /* program counter */ | ||
449 | u32 blink1; /* branch link */ | ||
450 | u32 blink2; /* branch link */ | ||
451 | u32 ilink1; /* interrupt link */ | ||
452 | u32 ilink2; /* interrupt link */ | ||
453 | u32 data1; /* error-specific data */ | ||
454 | u32 data2; /* error-specific data */ | ||
455 | u32 line; /* source code line of error */ | ||
456 | u32 bcon_time; /* beacon timer */ | ||
457 | u32 tsf_low; /* network timestamp function timer */ | ||
458 | u32 tsf_hi; /* network timestamp function timer */ | ||
459 | u32 gp1; /* GP1 timer register */ | ||
460 | u32 gp2; /* GP2 timer register */ | ||
461 | u32 gp3; /* GP3 timer register */ | ||
462 | u32 ucode_ver; /* uCode version */ | ||
463 | u32 hw_ver; /* HW Silicon version */ | ||
464 | u32 brd_ver; /* HW board version */ | ||
465 | u32 log_pc; /* log program counter */ | ||
466 | u32 frame_ptr; /* frame pointer */ | ||
467 | u32 stack_ptr; /* stack pointer */ | ||
468 | u32 hcmd; /* last host command header */ | ||
469 | #if 0 | ||
470 | /* no need to read the remainder, we don't use the values */ | ||
471 | u32 isr0; /* isr status register LMPM_NIC_ISR0: rxtx_flag */ | ||
472 | u32 isr1; /* isr status register LMPM_NIC_ISR1: host_flag */ | ||
473 | u32 isr2; /* isr status register LMPM_NIC_ISR2: enc_flag */ | ||
474 | u32 isr3; /* isr status register LMPM_NIC_ISR3: time_flag */ | ||
475 | u32 isr4; /* isr status register LMPM_NIC_ISR4: wico interrupt */ | ||
476 | u32 isr_pref; /* isr status register LMPM_NIC_PREF_STAT */ | ||
477 | u32 wait_event; /* wait event() caller address */ | ||
478 | u32 l2p_control; /* L2pControlField */ | ||
479 | u32 l2p_duration; /* L2pDurationField */ | ||
480 | u32 l2p_mhvalid; /* L2pMhValidBits */ | ||
481 | u32 l2p_addr_match; /* L2pAddrMatchStat */ | ||
482 | u32 lmpm_pmg_sel; /* indicate which clocks are turned on (LMPM_PMG_SEL) */ | ||
483 | u32 u_timestamp; /* indicate when the date and time of the compilation */ | ||
484 | u32 flow_handler; /* FH read/write pointers, RX credit */ | ||
485 | #endif | ||
486 | } __packed; | ||
487 | |||
562 | struct iwl_alive_resp { | 488 | struct iwl_alive_resp { |
563 | u8 ucode_minor; | 489 | u8 ucode_minor; |
564 | u8 ucode_major; | 490 | u8 ucode_major; |
@@ -600,6 +526,9 @@ enum { | |||
600 | RXON_DEV_TYPE_ESS = 3, | 526 | RXON_DEV_TYPE_ESS = 3, |
601 | RXON_DEV_TYPE_IBSS = 4, | 527 | RXON_DEV_TYPE_IBSS = 4, |
602 | RXON_DEV_TYPE_SNIFFER = 6, | 528 | RXON_DEV_TYPE_SNIFFER = 6, |
529 | RXON_DEV_TYPE_CP = 7, | ||
530 | RXON_DEV_TYPE_2STA = 8, | ||
531 | RXON_DEV_TYPE_P2P = 9, | ||
603 | }; | 532 | }; |
604 | 533 | ||
605 | 534 | ||
@@ -702,46 +631,6 @@ enum { | |||
702 | * regardless of whether RXON_FILTER_ASSOC_MSK is set. | 631 | * regardless of whether RXON_FILTER_ASSOC_MSK is set. |
703 | */ | 632 | */ |
704 | 633 | ||
705 | struct iwl3945_rxon_cmd { | ||
706 | u8 node_addr[6]; | ||
707 | __le16 reserved1; | ||
708 | u8 bssid_addr[6]; | ||
709 | __le16 reserved2; | ||
710 | u8 wlap_bssid_addr[6]; | ||
711 | __le16 reserved3; | ||
712 | u8 dev_type; | ||
713 | u8 air_propagation; | ||
714 | __le16 reserved4; | ||
715 | u8 ofdm_basic_rates; | ||
716 | u8 cck_basic_rates; | ||
717 | __le16 assoc_id; | ||
718 | __le32 flags; | ||
719 | __le32 filter_flags; | ||
720 | __le16 channel; | ||
721 | __le16 reserved5; | ||
722 | } __packed; | ||
723 | |||
724 | struct iwl4965_rxon_cmd { | ||
725 | u8 node_addr[6]; | ||
726 | __le16 reserved1; | ||
727 | u8 bssid_addr[6]; | ||
728 | __le16 reserved2; | ||
729 | u8 wlap_bssid_addr[6]; | ||
730 | __le16 reserved3; | ||
731 | u8 dev_type; | ||
732 | u8 air_propagation; | ||
733 | __le16 rx_chain; | ||
734 | u8 ofdm_basic_rates; | ||
735 | u8 cck_basic_rates; | ||
736 | __le16 assoc_id; | ||
737 | __le32 flags; | ||
738 | __le32 filter_flags; | ||
739 | __le16 channel; | ||
740 | u8 ofdm_ht_single_stream_basic_rates; | ||
741 | u8 ofdm_ht_dual_stream_basic_rates; | ||
742 | } __packed; | ||
743 | |||
744 | /* 5000 HW just extend this command */ | ||
745 | struct iwl_rxon_cmd { | 634 | struct iwl_rxon_cmd { |
746 | u8 node_addr[6]; | 635 | u8 node_addr[6]; |
747 | __le16 reserved1; | 636 | __le16 reserved1; |
@@ -769,26 +658,7 @@ struct iwl_rxon_cmd { | |||
769 | /* | 658 | /* |
770 | * REPLY_RXON_ASSOC = 0x11 (command, has simple generic response) | 659 | * REPLY_RXON_ASSOC = 0x11 (command, has simple generic response) |
771 | */ | 660 | */ |
772 | struct iwl3945_rxon_assoc_cmd { | 661 | struct iwl_rxon_assoc_cmd { |
773 | __le32 flags; | ||
774 | __le32 filter_flags; | ||
775 | u8 ofdm_basic_rates; | ||
776 | u8 cck_basic_rates; | ||
777 | __le16 reserved; | ||
778 | } __packed; | ||
779 | |||
780 | struct iwl4965_rxon_assoc_cmd { | ||
781 | __le32 flags; | ||
782 | __le32 filter_flags; | ||
783 | u8 ofdm_basic_rates; | ||
784 | u8 cck_basic_rates; | ||
785 | u8 ofdm_ht_single_stream_basic_rates; | ||
786 | u8 ofdm_ht_dual_stream_basic_rates; | ||
787 | __le16 rx_chain_select_flags; | ||
788 | __le16 reserved; | ||
789 | } __packed; | ||
790 | |||
791 | struct iwl5000_rxon_assoc_cmd { | ||
792 | __le32 flags; | 662 | __le32 flags; |
793 | __le32 filter_flags; | 663 | __le32 filter_flags; |
794 | u8 ofdm_basic_rates; | 664 | u8 ofdm_basic_rates; |
@@ -816,32 +686,13 @@ struct iwl_rxon_time_cmd { | |||
816 | __le16 atim_window; | 686 | __le16 atim_window; |
817 | __le32 beacon_init_val; | 687 | __le32 beacon_init_val; |
818 | __le16 listen_interval; | 688 | __le16 listen_interval; |
819 | __le16 reserved; | 689 | u8 dtim_period; |
690 | u8 delta_cp_bss_tbtts; | ||
820 | } __packed; | 691 | } __packed; |
821 | 692 | ||
822 | /* | 693 | /* |
823 | * REPLY_CHANNEL_SWITCH = 0x72 (command, has simple generic response) | 694 | * REPLY_CHANNEL_SWITCH = 0x72 (command, has simple generic response) |
824 | */ | 695 | */ |
825 | struct iwl3945_channel_switch_cmd { | ||
826 | u8 band; | ||
827 | u8 expect_beacon; | ||
828 | __le16 channel; | ||
829 | __le32 rxon_flags; | ||
830 | __le32 rxon_filter_flags; | ||
831 | __le32 switch_time; | ||
832 | struct iwl3945_power_per_rate power[IWL_MAX_RATES]; | ||
833 | } __packed; | ||
834 | |||
835 | struct iwl4965_channel_switch_cmd { | ||
836 | u8 band; | ||
837 | u8 expect_beacon; | ||
838 | __le16 channel; | ||
839 | __le32 rxon_flags; | ||
840 | __le32 rxon_filter_flags; | ||
841 | __le32 switch_time; | ||
842 | struct iwl4965_tx_power_db tx_power; | ||
843 | } __packed; | ||
844 | |||
845 | /** | 696 | /** |
846 | * struct iwl5000_channel_switch_cmd | 697 | * struct iwl5000_channel_switch_cmd |
847 | * @band: 0- 5.2GHz, 1- 2.4GHz | 698 | * @band: 0- 5.2GHz, 1- 2.4GHz |
@@ -953,19 +804,17 @@ struct iwl_qosparam_cmd { | |||
953 | 804 | ||
954 | /* Special, dedicated locations within device's station table */ | 805 | /* Special, dedicated locations within device's station table */ |
955 | #define IWL_AP_ID 0 | 806 | #define IWL_AP_ID 0 |
807 | #define IWL_AP_ID_PAN 1 | ||
956 | #define IWL_STA_ID 2 | 808 | #define IWL_STA_ID 2 |
957 | #define IWL3945_BROADCAST_ID 24 | 809 | #define IWLAGN_PAN_BCAST_ID 14 |
958 | #define IWL3945_STATION_COUNT 25 | ||
959 | #define IWL4965_BROADCAST_ID 31 | ||
960 | #define IWL4965_STATION_COUNT 32 | ||
961 | #define IWLAGN_BROADCAST_ID 15 | 810 | #define IWLAGN_BROADCAST_ID 15 |
962 | #define IWLAGN_STATION_COUNT 16 | 811 | #define IWLAGN_STATION_COUNT 16 |
963 | 812 | ||
964 | #define IWL_STATION_COUNT 32 /* MAX(3945,4965)*/ | ||
965 | #define IWL_INVALID_STATION 255 | 813 | #define IWL_INVALID_STATION 255 |
966 | 814 | ||
967 | #define STA_FLG_TX_RATE_MSK cpu_to_le32(1 << 2) | 815 | #define STA_FLG_TX_RATE_MSK cpu_to_le32(1 << 2) |
968 | #define STA_FLG_PWR_SAVE_MSK cpu_to_le32(1 << 8) | 816 | #define STA_FLG_PWR_SAVE_MSK cpu_to_le32(1 << 8) |
817 | #define STA_FLG_PAN_STATION cpu_to_le32(1 << 13) | ||
969 | #define STA_FLG_RTS_MIMO_PROT_MSK cpu_to_le32(1 << 17) | 818 | #define STA_FLG_RTS_MIMO_PROT_MSK cpu_to_le32(1 << 17) |
970 | #define STA_FLG_AGG_MPDU_8US_MSK cpu_to_le32(1 << 18) | 819 | #define STA_FLG_AGG_MPDU_8US_MSK cpu_to_le32(1 << 18) |
971 | #define STA_FLG_MAX_AGG_SIZE_POS (19) | 820 | #define STA_FLG_MAX_AGG_SIZE_POS (19) |
@@ -994,6 +843,7 @@ struct iwl_qosparam_cmd { | |||
994 | #define STA_KEY_FLG_KEY_SIZE_MSK cpu_to_le16(0x1000) | 843 | #define STA_KEY_FLG_KEY_SIZE_MSK cpu_to_le16(0x1000) |
995 | #define STA_KEY_MULTICAST_MSK cpu_to_le16(0x4000) | 844 | #define STA_KEY_MULTICAST_MSK cpu_to_le16(0x4000) |
996 | #define STA_KEY_MAX_NUM 8 | 845 | #define STA_KEY_MAX_NUM 8 |
846 | #define STA_KEY_MAX_NUM_PAN 16 | ||
997 | 847 | ||
998 | /* Flags indicate whether to modify vs. don't change various station params */ | 848 | /* Flags indicate whether to modify vs. don't change various station params */ |
999 | #define STA_MODIFY_KEY_MASK 0x01 | 849 | #define STA_MODIFY_KEY_MASK 0x01 |
@@ -1007,17 +857,7 @@ struct iwl_qosparam_cmd { | |||
1007 | * combined with Traffic ID (QOS priority), in format used by Tx Scheduler */ | 857 | * combined with Traffic ID (QOS priority), in format used by Tx Scheduler */ |
1008 | #define BUILD_RAxTID(sta_id, tid) (((sta_id) << 4) + (tid)) | 858 | #define BUILD_RAxTID(sta_id, tid) (((sta_id) << 4) + (tid)) |
1009 | 859 | ||
1010 | struct iwl4965_keyinfo { | 860 | /* agn */ |
1011 | __le16 key_flags; | ||
1012 | u8 tkip_rx_tsc_byte2; /* TSC[2] for key mix ph1 detection */ | ||
1013 | u8 reserved1; | ||
1014 | __le16 tkip_rx_ttak[5]; /* 10-byte unicast TKIP TTAK */ | ||
1015 | u8 key_offset; | ||
1016 | u8 reserved2; | ||
1017 | u8 key[16]; /* 16-byte unicast decryption key */ | ||
1018 | } __packed; | ||
1019 | |||
1020 | /* 5000 */ | ||
1021 | struct iwl_keyinfo { | 861 | struct iwl_keyinfo { |
1022 | __le16 key_flags; | 862 | __le16 key_flags; |
1023 | u8 tkip_rx_tsc_byte2; /* TSC[2] for key mix ph1 detection */ | 863 | u8 tkip_rx_tsc_byte2; /* TSC[2] for key mix ph1 detection */ |
@@ -1056,8 +896,8 @@ struct sta_id_modify { | |||
1056 | * | 896 | * |
1057 | * The device contains an internal table of per-station information, | 897 | * The device contains an internal table of per-station information, |
1058 | * with info on security keys, aggregation parameters, and Tx rates for | 898 | * with info on security keys, aggregation parameters, and Tx rates for |
1059 | * initial Tx attempt and any retries (4965 uses REPLY_TX_LINK_QUALITY_CMD, | 899 | * initial Tx attempt and any retries (agn devices uses |
1060 | * 3945 uses REPLY_RATE_SCALE to set up rate tables). | 900 | * REPLY_TX_LINK_QUALITY_CMD, |
1061 | * | 901 | * |
1062 | * REPLY_ADD_STA sets up the table entry for one station, either creating | 902 | * REPLY_ADD_STA sets up the table entry for one station, either creating |
1063 | * a new entry, or modifying a pre-existing one. | 903 | * a new entry, or modifying a pre-existing one. |
@@ -1077,72 +917,6 @@ struct sta_id_modify { | |||
1077 | * entries for all STAs in network, starting with index IWL_STA_ID. | 917 | * entries for all STAs in network, starting with index IWL_STA_ID. |
1078 | */ | 918 | */ |
1079 | 919 | ||
1080 | struct iwl3945_addsta_cmd { | ||
1081 | u8 mode; /* 1: modify existing, 0: add new station */ | ||
1082 | u8 reserved[3]; | ||
1083 | struct sta_id_modify sta; | ||
1084 | struct iwl4965_keyinfo key; | ||
1085 | __le32 station_flags; /* STA_FLG_* */ | ||
1086 | __le32 station_flags_msk; /* STA_FLG_* */ | ||
1087 | |||
1088 | /* bit field to disable (1) or enable (0) Tx for Traffic ID (TID) | ||
1089 | * corresponding to bit (e.g. bit 5 controls TID 5). | ||
1090 | * Set modify_mask bit STA_MODIFY_TID_DISABLE_TX to use this field. */ | ||
1091 | __le16 tid_disable_tx; | ||
1092 | |||
1093 | __le16 rate_n_flags; | ||
1094 | |||
1095 | /* TID for which to add block-ack support. | ||
1096 | * Set modify_mask bit STA_MODIFY_ADDBA_TID_MSK to use this field. */ | ||
1097 | u8 add_immediate_ba_tid; | ||
1098 | |||
1099 | /* TID for which to remove block-ack support. | ||
1100 | * Set modify_mask bit STA_MODIFY_DELBA_TID_MSK to use this field. */ | ||
1101 | u8 remove_immediate_ba_tid; | ||
1102 | |||
1103 | /* Starting Sequence Number for added block-ack support. | ||
1104 | * Set modify_mask bit STA_MODIFY_ADDBA_TID_MSK to use this field. */ | ||
1105 | __le16 add_immediate_ba_ssn; | ||
1106 | } __packed; | ||
1107 | |||
1108 | struct iwl4965_addsta_cmd { | ||
1109 | u8 mode; /* 1: modify existing, 0: add new station */ | ||
1110 | u8 reserved[3]; | ||
1111 | struct sta_id_modify sta; | ||
1112 | struct iwl4965_keyinfo key; | ||
1113 | __le32 station_flags; /* STA_FLG_* */ | ||
1114 | __le32 station_flags_msk; /* STA_FLG_* */ | ||
1115 | |||
1116 | /* bit field to disable (1) or enable (0) Tx for Traffic ID (TID) | ||
1117 | * corresponding to bit (e.g. bit 5 controls TID 5). | ||
1118 | * Set modify_mask bit STA_MODIFY_TID_DISABLE_TX to use this field. */ | ||
1119 | __le16 tid_disable_tx; | ||
1120 | |||
1121 | __le16 reserved1; | ||
1122 | |||
1123 | /* TID for which to add block-ack support. | ||
1124 | * Set modify_mask bit STA_MODIFY_ADDBA_TID_MSK to use this field. */ | ||
1125 | u8 add_immediate_ba_tid; | ||
1126 | |||
1127 | /* TID for which to remove block-ack support. | ||
1128 | * Set modify_mask bit STA_MODIFY_DELBA_TID_MSK to use this field. */ | ||
1129 | u8 remove_immediate_ba_tid; | ||
1130 | |||
1131 | /* Starting Sequence Number for added block-ack support. | ||
1132 | * Set modify_mask bit STA_MODIFY_ADDBA_TID_MSK to use this field. */ | ||
1133 | __le16 add_immediate_ba_ssn; | ||
1134 | |||
1135 | /* | ||
1136 | * Number of packets OK to transmit to station even though | ||
1137 | * it is asleep -- used to synchronise PS-poll and u-APSD | ||
1138 | * responses while ucode keeps track of STA sleep state. | ||
1139 | */ | ||
1140 | __le16 sleep_tx_count; | ||
1141 | |||
1142 | __le16 reserved2; | ||
1143 | } __packed; | ||
1144 | |||
1145 | /* 5000 */ | ||
1146 | struct iwl_addsta_cmd { | 920 | struct iwl_addsta_cmd { |
1147 | u8 mode; /* 1: modify existing, 0: add new station */ | 921 | u8 mode; /* 1: modify existing, 0: add new station */ |
1148 | u8 reserved[3]; | 922 | u8 reserved[3]; |
@@ -1311,77 +1085,24 @@ struct iwl_wep_cmd { | |||
1311 | #define RX_MPDU_RES_STATUS_DEC_DONE_MSK (0x800) | 1085 | #define RX_MPDU_RES_STATUS_DEC_DONE_MSK (0x800) |
1312 | 1086 | ||
1313 | 1087 | ||
1314 | struct iwl3945_rx_frame_stats { | 1088 | #define IWLAGN_RX_RES_PHY_CNT 8 |
1315 | u8 phy_count; | 1089 | #define IWLAGN_RX_RES_AGC_IDX 1 |
1316 | u8 id; | 1090 | #define IWLAGN_RX_RES_RSSI_AB_IDX 2 |
1317 | u8 rssi; | 1091 | #define IWLAGN_RX_RES_RSSI_C_IDX 3 |
1318 | u8 agc; | 1092 | #define IWLAGN_OFDM_AGC_MSK 0xfe00 |
1319 | __le16 sig_avg; | 1093 | #define IWLAGN_OFDM_AGC_BIT_POS 9 |
1320 | __le16 noise_diff; | 1094 | #define IWLAGN_OFDM_RSSI_INBAND_A_BITMSK 0x00ff |
1321 | u8 payload[0]; | 1095 | #define IWLAGN_OFDM_RSSI_ALLBAND_A_BITMSK 0xff00 |
1322 | } __packed; | 1096 | #define IWLAGN_OFDM_RSSI_A_BIT_POS 0 |
1097 | #define IWLAGN_OFDM_RSSI_INBAND_B_BITMSK 0xff0000 | ||
1098 | #define IWLAGN_OFDM_RSSI_ALLBAND_B_BITMSK 0xff000000 | ||
1099 | #define IWLAGN_OFDM_RSSI_B_BIT_POS 16 | ||
1100 | #define IWLAGN_OFDM_RSSI_INBAND_C_BITMSK 0x00ff | ||
1101 | #define IWLAGN_OFDM_RSSI_ALLBAND_C_BITMSK 0xff00 | ||
1102 | #define IWLAGN_OFDM_RSSI_C_BIT_POS 0 | ||
1323 | 1103 | ||
1324 | struct iwl3945_rx_frame_hdr { | 1104 | struct iwlagn_non_cfg_phy { |
1325 | __le16 channel; | 1105 | __le32 non_cfg_phy[IWLAGN_RX_RES_PHY_CNT]; /* up to 8 phy entries */ |
1326 | __le16 phy_flags; | ||
1327 | u8 reserved1; | ||
1328 | u8 rate; | ||
1329 | __le16 len; | ||
1330 | u8 payload[0]; | ||
1331 | } __packed; | ||
1332 | |||
1333 | struct iwl3945_rx_frame_end { | ||
1334 | __le32 status; | ||
1335 | __le64 timestamp; | ||
1336 | __le32 beacon_timestamp; | ||
1337 | } __packed; | ||
1338 | |||
1339 | /* | ||
1340 | * REPLY_3945_RX = 0x1b (response only, not a command) | ||
1341 | * | ||
1342 | * NOTE: DO NOT dereference from casts to this structure | ||
1343 | * It is provided only for calculating minimum data set size. | ||
1344 | * The actual offsets of the hdr and end are dynamic based on | ||
1345 | * stats.phy_count | ||
1346 | */ | ||
1347 | struct iwl3945_rx_frame { | ||
1348 | struct iwl3945_rx_frame_stats stats; | ||
1349 | struct iwl3945_rx_frame_hdr hdr; | ||
1350 | struct iwl3945_rx_frame_end end; | ||
1351 | } __packed; | ||
1352 | |||
1353 | #define IWL39_RX_FRAME_SIZE (4 + sizeof(struct iwl3945_rx_frame)) | ||
1354 | |||
1355 | /* Fixed (non-configurable) rx data from phy */ | ||
1356 | |||
1357 | #define IWL49_RX_RES_PHY_CNT 14 | ||
1358 | #define IWL49_RX_PHY_FLAGS_ANTENNAE_OFFSET (4) | ||
1359 | #define IWL49_RX_PHY_FLAGS_ANTENNAE_MASK (0x70) | ||
1360 | #define IWL49_AGC_DB_MASK (0x3f80) /* MASK(7,13) */ | ||
1361 | #define IWL49_AGC_DB_POS (7) | ||
1362 | struct iwl4965_rx_non_cfg_phy { | ||
1363 | __le16 ant_selection; /* ant A bit 4, ant B bit 5, ant C bit 6 */ | ||
1364 | __le16 agc_info; /* agc code 0:6, agc dB 7:13, reserved 14:15 */ | ||
1365 | u8 rssi_info[6]; /* we use even entries, 0/2/4 for A/B/C rssi */ | ||
1366 | u8 pad[0]; | ||
1367 | } __packed; | ||
1368 | |||
1369 | |||
1370 | #define IWL50_RX_RES_PHY_CNT 8 | ||
1371 | #define IWL50_RX_RES_AGC_IDX 1 | ||
1372 | #define IWL50_RX_RES_RSSI_AB_IDX 2 | ||
1373 | #define IWL50_RX_RES_RSSI_C_IDX 3 | ||
1374 | #define IWL50_OFDM_AGC_MSK 0xfe00 | ||
1375 | #define IWL50_OFDM_AGC_BIT_POS 9 | ||
1376 | #define IWL50_OFDM_RSSI_A_MSK 0x00ff | ||
1377 | #define IWL50_OFDM_RSSI_A_BIT_POS 0 | ||
1378 | #define IWL50_OFDM_RSSI_B_MSK 0xff0000 | ||
1379 | #define IWL50_OFDM_RSSI_B_BIT_POS 16 | ||
1380 | #define IWL50_OFDM_RSSI_C_MSK 0x00ff | ||
1381 | #define IWL50_OFDM_RSSI_C_BIT_POS 0 | ||
1382 | |||
1383 | struct iwl5000_non_cfg_phy { | ||
1384 | __le32 non_cfg_phy[IWL50_RX_RES_PHY_CNT]; /* up to 8 phy entries */ | ||
1385 | } __packed; | 1106 | } __packed; |
1386 | 1107 | ||
1387 | 1108 | ||
@@ -1401,7 +1122,7 @@ struct iwl_rx_phy_res { | |||
1401 | u8 non_cfg_phy_buf[32]; /* for various implementations of non_cfg_phy */ | 1122 | u8 non_cfg_phy_buf[32]; /* for various implementations of non_cfg_phy */ |
1402 | __le32 rate_n_flags; /* RATE_MCS_* */ | 1123 | __le32 rate_n_flags; /* RATE_MCS_* */ |
1403 | __le16 byte_count; /* frame's byte-count */ | 1124 | __le16 byte_count; /* frame's byte-count */ |
1404 | __le16 reserved3; | 1125 | __le16 frame_time; /* frame's time on the air */ |
1405 | } __packed; | 1126 | } __packed; |
1406 | 1127 | ||
1407 | struct iwl_rx_mpdu_res_start { | 1128 | struct iwl_rx_mpdu_res_start { |
@@ -1424,12 +1145,12 @@ struct iwl_rx_mpdu_res_start { | |||
1424 | * uCode handles all timing and protocol related to control frames | 1145 | * uCode handles all timing and protocol related to control frames |
1425 | * (RTS/CTS/ACK), based on flags in the Tx command. uCode and Tx scheduler | 1146 | * (RTS/CTS/ACK), based on flags in the Tx command. uCode and Tx scheduler |
1426 | * handle reception of block-acks; uCode updates the host driver via | 1147 | * handle reception of block-acks; uCode updates the host driver via |
1427 | * REPLY_COMPRESSED_BA (4965). | 1148 | * REPLY_COMPRESSED_BA. |
1428 | * | 1149 | * |
1429 | * uCode handles retrying Tx when an ACK is expected but not received. | 1150 | * uCode handles retrying Tx when an ACK is expected but not received. |
1430 | * This includes trying lower data rates than the one requested in the Tx | 1151 | * This includes trying lower data rates than the one requested in the Tx |
1431 | * command, as set up by the REPLY_RATE_SCALE (for 3945) or | 1152 | * command, as set up by the REPLY_RATE_SCALE (for 3945) or |
1432 | * REPLY_TX_LINK_QUALITY_CMD (4965). | 1153 | * REPLY_TX_LINK_QUALITY_CMD (agn). |
1433 | * | 1154 | * |
1434 | * Driver sets up transmit power for various rates via REPLY_TX_PWR_TABLE_CMD. | 1155 | * Driver sets up transmit power for various rates via REPLY_TX_PWR_TABLE_CMD. |
1435 | * This command must be executed after every RXON command, before Tx can occur. | 1156 | * This command must be executed after every RXON command, before Tx can occur. |
@@ -1465,7 +1186,7 @@ struct iwl_rx_mpdu_res_start { | |||
1465 | * Set this for unicast frames, but not broadcast/multicast. */ | 1186 | * Set this for unicast frames, but not broadcast/multicast. */ |
1466 | #define TX_CMD_FLG_ACK_MSK cpu_to_le32(1 << 3) | 1187 | #define TX_CMD_FLG_ACK_MSK cpu_to_le32(1 << 3) |
1467 | 1188 | ||
1468 | /* For 4965: | 1189 | /* For agn devices: |
1469 | * 1: Use rate scale table (see REPLY_TX_LINK_QUALITY_CMD). | 1190 | * 1: Use rate scale table (see REPLY_TX_LINK_QUALITY_CMD). |
1470 | * Tx command's initial_rate_index indicates first rate to try; | 1191 | * Tx command's initial_rate_index indicates first rate to try; |
1471 | * uCode walks through table for additional Tx attempts. | 1192 | * uCode walks through table for additional Tx attempts. |
@@ -1484,7 +1205,7 @@ struct iwl_rx_mpdu_res_start { | |||
1484 | */ | 1205 | */ |
1485 | #define TX_CMD_FLG_FULL_TXOP_PROT_MSK cpu_to_le32(1 << 7) | 1206 | #define TX_CMD_FLG_FULL_TXOP_PROT_MSK cpu_to_le32(1 << 7) |
1486 | 1207 | ||
1487 | /* Tx antenna selection field; used only for 3945, reserved (0) for 4965. | 1208 | /* Tx antenna selection field; used only for 3945, reserved (0) for agn devices. |
1488 | * Set field to "0" to allow 3945 uCode to select antenna (normal usage). */ | 1209 | * Set field to "0" to allow 3945 uCode to select antenna (normal usage). */ |
1489 | #define TX_CMD_FLG_ANT_SEL_MSK cpu_to_le32(0xf00) | 1210 | #define TX_CMD_FLG_ANT_SEL_MSK cpu_to_le32(0xf00) |
1490 | #define TX_CMD_FLG_ANT_A_MSK cpu_to_le32(1 << 8) | 1211 | #define TX_CMD_FLG_ANT_A_MSK cpu_to_le32(1 << 8) |
@@ -1547,80 +1268,6 @@ struct iwl_rx_mpdu_res_start { | |||
1547 | * REPLY_TX = 0x1c (command) | 1268 | * REPLY_TX = 0x1c (command) |
1548 | */ | 1269 | */ |
1549 | 1270 | ||
1550 | struct iwl3945_tx_cmd { | ||
1551 | /* | ||
1552 | * MPDU byte count: | ||
1553 | * MAC header (24/26/30/32 bytes) + 2 bytes pad if 26/30 header size, | ||
1554 | * + 8 byte IV for CCM or TKIP (not used for WEP) | ||
1555 | * + Data payload | ||
1556 | * + 8-byte MIC (not used for CCM/WEP) | ||
1557 | * NOTE: Does not include Tx command bytes, post-MAC pad bytes, | ||
1558 | * MIC (CCM) 8 bytes, ICV (WEP/TKIP/CKIP) 4 bytes, CRC 4 bytes.i | ||
1559 | * Range: 14-2342 bytes. | ||
1560 | */ | ||
1561 | __le16 len; | ||
1562 | |||
1563 | /* | ||
1564 | * MPDU or MSDU byte count for next frame. | ||
1565 | * Used for fragmentation and bursting, but not 11n aggregation. | ||
1566 | * Same as "len", but for next frame. Set to 0 if not applicable. | ||
1567 | */ | ||
1568 | __le16 next_frame_len; | ||
1569 | |||
1570 | __le32 tx_flags; /* TX_CMD_FLG_* */ | ||
1571 | |||
1572 | u8 rate; | ||
1573 | |||
1574 | /* Index of recipient station in uCode's station table */ | ||
1575 | u8 sta_id; | ||
1576 | u8 tid_tspec; | ||
1577 | u8 sec_ctl; | ||
1578 | u8 key[16]; | ||
1579 | union { | ||
1580 | u8 byte[8]; | ||
1581 | __le16 word[4]; | ||
1582 | __le32 dw[2]; | ||
1583 | } tkip_mic; | ||
1584 | __le32 next_frame_info; | ||
1585 | union { | ||
1586 | __le32 life_time; | ||
1587 | __le32 attempt; | ||
1588 | } stop_time; | ||
1589 | u8 supp_rates[2]; | ||
1590 | u8 rts_retry_limit; /*byte 50 */ | ||
1591 | u8 data_retry_limit; /*byte 51 */ | ||
1592 | union { | ||
1593 | __le16 pm_frame_timeout; | ||
1594 | __le16 attempt_duration; | ||
1595 | } timeout; | ||
1596 | |||
1597 | /* | ||
1598 | * Duration of EDCA burst Tx Opportunity, in 32-usec units. | ||
1599 | * Set this if txop time is not specified by HCCA protocol (e.g. by AP). | ||
1600 | */ | ||
1601 | __le16 driver_txop; | ||
1602 | |||
1603 | /* | ||
1604 | * MAC header goes here, followed by 2 bytes padding if MAC header | ||
1605 | * length is 26 or 30 bytes, followed by payload data | ||
1606 | */ | ||
1607 | u8 payload[0]; | ||
1608 | struct ieee80211_hdr hdr[0]; | ||
1609 | } __packed; | ||
1610 | |||
1611 | /* | ||
1612 | * REPLY_TX = 0x1c (response) | ||
1613 | */ | ||
1614 | struct iwl3945_tx_resp { | ||
1615 | u8 failure_rts; | ||
1616 | u8 failure_frame; | ||
1617 | u8 bt_kill_count; | ||
1618 | u8 rate; | ||
1619 | __le32 wireless_media_time; | ||
1620 | __le32 status; /* TX status */ | ||
1621 | } __packed; | ||
1622 | |||
1623 | |||
1624 | /* | 1271 | /* |
1625 | * 4965 uCode updates these Tx attempt count values in host DRAM. | 1272 | * 4965 uCode updates these Tx attempt count values in host DRAM. |
1626 | * Used for managing Tx retries when expecting block-acks. | 1273 | * Used for managing Tx retries when expecting block-acks. |
@@ -1711,54 +1358,6 @@ struct iwl_tx_cmd { | |||
1711 | struct ieee80211_hdr hdr[0]; | 1358 | struct ieee80211_hdr hdr[0]; |
1712 | } __packed; | 1359 | } __packed; |
1713 | 1360 | ||
1714 | /* TX command response is sent after *3945* transmission attempts. | ||
1715 | * | ||
1716 | * NOTES: | ||
1717 | * | ||
1718 | * TX_STATUS_FAIL_NEXT_FRAG | ||
1719 | * | ||
1720 | * If the fragment flag in the MAC header for the frame being transmitted | ||
1721 | * is set and there is insufficient time to transmit the next frame, the | ||
1722 | * TX status will be returned with 'TX_STATUS_FAIL_NEXT_FRAG'. | ||
1723 | * | ||
1724 | * TX_STATUS_FIFO_UNDERRUN | ||
1725 | * | ||
1726 | * Indicates the host did not provide bytes to the FIFO fast enough while | ||
1727 | * a TX was in progress. | ||
1728 | * | ||
1729 | * TX_STATUS_FAIL_MGMNT_ABORT | ||
1730 | * | ||
1731 | * This status is only possible if the ABORT ON MGMT RX parameter was | ||
1732 | * set to true with the TX command. | ||
1733 | * | ||
1734 | * If the MSB of the status parameter is set then an abort sequence is | ||
1735 | * required. This sequence consists of the host activating the TX Abort | ||
1736 | * control line, and then waiting for the TX Abort command response. This | ||
1737 | * indicates that a the device is no longer in a transmit state, and that the | ||
1738 | * command FIFO has been cleared. The host must then deactivate the TX Abort | ||
1739 | * control line. Receiving is still allowed in this case. | ||
1740 | */ | ||
1741 | enum { | ||
1742 | TX_3945_STATUS_SUCCESS = 0x01, | ||
1743 | TX_3945_STATUS_DIRECT_DONE = 0x02, | ||
1744 | TX_3945_STATUS_FAIL_SHORT_LIMIT = 0x82, | ||
1745 | TX_3945_STATUS_FAIL_LONG_LIMIT = 0x83, | ||
1746 | TX_3945_STATUS_FAIL_FIFO_UNDERRUN = 0x84, | ||
1747 | TX_3945_STATUS_FAIL_MGMNT_ABORT = 0x85, | ||
1748 | TX_3945_STATUS_FAIL_NEXT_FRAG = 0x86, | ||
1749 | TX_3945_STATUS_FAIL_LIFE_EXPIRE = 0x87, | ||
1750 | TX_3945_STATUS_FAIL_DEST_PS = 0x88, | ||
1751 | TX_3945_STATUS_FAIL_ABORTED = 0x89, | ||
1752 | TX_3945_STATUS_FAIL_BT_RETRY = 0x8a, | ||
1753 | TX_3945_STATUS_FAIL_STA_INVALID = 0x8b, | ||
1754 | TX_3945_STATUS_FAIL_FRAG_DROPPED = 0x8c, | ||
1755 | TX_3945_STATUS_FAIL_TID_DISABLE = 0x8d, | ||
1756 | TX_3945_STATUS_FAIL_FRAME_FLUSHED = 0x8e, | ||
1757 | TX_3945_STATUS_FAIL_INSUFFICIENT_CF_POLL = 0x8f, | ||
1758 | TX_3945_STATUS_FAIL_TX_LOCKED = 0x90, | ||
1759 | TX_3945_STATUS_FAIL_NO_BEACON_ON_RADAR = 0x91, | ||
1760 | }; | ||
1761 | |||
1762 | /* | 1361 | /* |
1763 | * TX command response is sent after *agn* transmission attempts. | 1362 | * TX command response is sent after *agn* transmission attempts. |
1764 | * | 1363 | * |
@@ -1791,13 +1390,8 @@ enum { | |||
1791 | TX_STATUS_FAIL_TID_DISABLE = 0x8d, | 1390 | TX_STATUS_FAIL_TID_DISABLE = 0x8d, |
1792 | TX_STATUS_FAIL_FIFO_FLUSHED = 0x8e, | 1391 | TX_STATUS_FAIL_FIFO_FLUSHED = 0x8e, |
1793 | TX_STATUS_FAIL_INSUFFICIENT_CF_POLL = 0x8f, | 1392 | TX_STATUS_FAIL_INSUFFICIENT_CF_POLL = 0x8f, |
1794 | /* uCode drop due to FW drop request */ | 1393 | TX_STATUS_FAIL_PASSIVE_NO_RX = 0x90, |
1795 | TX_STATUS_FAIL_FW_DROP = 0x90, | 1394 | TX_STATUS_FAIL_NO_BEACON_ON_RADAR = 0x91, |
1796 | /* | ||
1797 | * uCode drop due to station color mismatch | ||
1798 | * between tx command and station table | ||
1799 | */ | ||
1800 | TX_STATUS_FAIL_STA_COLOR_MISMATCH_DROP = 0x91, | ||
1801 | }; | 1395 | }; |
1802 | 1396 | ||
1803 | #define TX_PACKET_MODE_REGULAR 0x0000 | 1397 | #define TX_PACKET_MODE_REGULAR 0x0000 |
@@ -1839,6 +1433,9 @@ enum { | |||
1839 | AGG_TX_STATE_DELAY_TX_MSK = 0x400 | 1433 | AGG_TX_STATE_DELAY_TX_MSK = 0x400 |
1840 | }; | 1434 | }; |
1841 | 1435 | ||
1436 | #define AGG_TX_STATUS_MSK 0x00000fff /* bits 0:11 */ | ||
1437 | #define AGG_TX_TRY_MSK 0x0000f000 /* bits 12:15 */ | ||
1438 | |||
1842 | #define AGG_TX_STATE_LAST_SENT_MSK (AGG_TX_STATE_LAST_SENT_TTL_MSK | \ | 1439 | #define AGG_TX_STATE_LAST_SENT_MSK (AGG_TX_STATE_LAST_SENT_TTL_MSK | \ |
1843 | AGG_TX_STATE_LAST_SENT_TRY_CNT_MSK | \ | 1440 | AGG_TX_STATE_LAST_SENT_TRY_CNT_MSK | \ |
1844 | AGG_TX_STATE_LAST_SENT_BT_KILL_MSK) | 1441 | AGG_TX_STATE_LAST_SENT_BT_KILL_MSK) |
@@ -1867,9 +1464,10 @@ enum { | |||
1867 | * frame in this new agg block failed in previous agg block(s). | 1464 | * frame in this new agg block failed in previous agg block(s). |
1868 | * | 1465 | * |
1869 | * Note that, for aggregation, ACK (block-ack) status is not delivered here; | 1466 | * Note that, for aggregation, ACK (block-ack) status is not delivered here; |
1870 | * block-ack has not been received by the time the 4965 records this status. | 1467 | * block-ack has not been received by the time the agn device records |
1468 | * this status. | ||
1871 | * This status relates to reasons the tx might have been blocked or aborted | 1469 | * This status relates to reasons the tx might have been blocked or aborted |
1872 | * within the sending station (this 4965), rather than whether it was | 1470 | * within the sending station (this agn device), rather than whether it was |
1873 | * received successfully by the destination station. | 1471 | * received successfully by the destination station. |
1874 | */ | 1472 | */ |
1875 | struct agg_tx_status { | 1473 | struct agg_tx_status { |
@@ -1877,43 +1475,6 @@ struct agg_tx_status { | |||
1877 | __le16 sequence; | 1475 | __le16 sequence; |
1878 | } __packed; | 1476 | } __packed; |
1879 | 1477 | ||
1880 | struct iwl4965_tx_resp { | ||
1881 | u8 frame_count; /* 1 no aggregation, >1 aggregation */ | ||
1882 | u8 bt_kill_count; /* # blocked by bluetooth (unused for agg) */ | ||
1883 | u8 failure_rts; /* # failures due to unsuccessful RTS */ | ||
1884 | u8 failure_frame; /* # failures due to no ACK (unused for agg) */ | ||
1885 | |||
1886 | /* For non-agg: Rate at which frame was successful. | ||
1887 | * For agg: Rate at which all frames were transmitted. */ | ||
1888 | __le32 rate_n_flags; /* RATE_MCS_* */ | ||
1889 | |||
1890 | /* For non-agg: RTS + CTS + frame tx attempts time + ACK. | ||
1891 | * For agg: RTS + CTS + aggregation tx time + block-ack time. */ | ||
1892 | __le16 wireless_media_time; /* uSecs */ | ||
1893 | |||
1894 | __le16 reserved; | ||
1895 | __le32 pa_power1; /* RF power amplifier measurement (not used) */ | ||
1896 | __le32 pa_power2; | ||
1897 | |||
1898 | /* | ||
1899 | * For non-agg: frame status TX_STATUS_* | ||
1900 | * For agg: status of 1st frame, AGG_TX_STATE_*; other frame status | ||
1901 | * fields follow this one, up to frame_count. | ||
1902 | * Bit fields: | ||
1903 | * 11- 0: AGG_TX_STATE_* status code | ||
1904 | * 15-12: Retry count for 1st frame in aggregation (retries | ||
1905 | * occur if tx failed for this frame when it was a | ||
1906 | * member of a previous aggregation block). If rate | ||
1907 | * scaling is used, retry count indicates the rate | ||
1908 | * table entry used for all frames in the new agg. | ||
1909 | * 31-16: Sequence # for this frame's Tx cmd (not SSN!) | ||
1910 | */ | ||
1911 | union { | ||
1912 | __le32 status; | ||
1913 | struct agg_tx_status agg_status[0]; /* for each agg frame */ | ||
1914 | } u; | ||
1915 | } __packed; | ||
1916 | |||
1917 | /* | 1478 | /* |
1918 | * definitions for initial rate index field | 1479 | * definitions for initial rate index field |
1919 | * bits [3:0] initial rate index | 1480 | * bits [3:0] initial rate index |
@@ -1931,12 +1492,12 @@ struct iwl4965_tx_resp { | |||
1931 | #define IWL50_TX_RES_INV_RATE_INDEX_MSK 0x80 | 1492 | #define IWL50_TX_RES_INV_RATE_INDEX_MSK 0x80 |
1932 | 1493 | ||
1933 | /* refer to ra_tid */ | 1494 | /* refer to ra_tid */ |
1934 | #define IWL50_TX_RES_TID_POS 0 | 1495 | #define IWLAGN_TX_RES_TID_POS 0 |
1935 | #define IWL50_TX_RES_TID_MSK 0x0f | 1496 | #define IWLAGN_TX_RES_TID_MSK 0x0f |
1936 | #define IWL50_TX_RES_RA_POS 4 | 1497 | #define IWLAGN_TX_RES_RA_POS 4 |
1937 | #define IWL50_TX_RES_RA_MSK 0xf0 | 1498 | #define IWLAGN_TX_RES_RA_MSK 0xf0 |
1938 | 1499 | ||
1939 | struct iwl5000_tx_resp { | 1500 | struct iwlagn_tx_resp { |
1940 | u8 frame_count; /* 1 no aggregation, >1 aggregation */ | 1501 | u8 frame_count; /* 1 no aggregation, >1 aggregation */ |
1941 | u8 bt_kill_count; /* # blocked by bluetooth (unused for agg) */ | 1502 | u8 bt_kill_count; /* # blocked by bluetooth (unused for agg) */ |
1942 | u8 failure_rts; /* # failures due to unsuccessful RTS */ | 1503 | u8 failure_rts; /* # failures due to unsuccessful RTS */ |
@@ -1994,56 +1555,15 @@ struct iwl_compressed_ba_resp { | |||
1994 | __le64 bitmap; | 1555 | __le64 bitmap; |
1995 | __le16 scd_flow; | 1556 | __le16 scd_flow; |
1996 | __le16 scd_ssn; | 1557 | __le16 scd_ssn; |
1558 | /* following only for 5000 series and up */ | ||
1559 | u8 txed; /* number of frames sent */ | ||
1560 | u8 txed_2_done; /* number of frames acked */ | ||
1997 | } __packed; | 1561 | } __packed; |
1998 | 1562 | ||
1999 | /* | 1563 | /* |
2000 | * REPLY_TX_PWR_TABLE_CMD = 0x97 (command, has simple generic response) | 1564 | * REPLY_TX_PWR_TABLE_CMD = 0x97 (command, has simple generic response) |
2001 | * | 1565 | * |
2002 | * See details under "TXPOWER" in iwl-4965-hw.h. | ||
2003 | */ | ||
2004 | |||
2005 | struct iwl3945_txpowertable_cmd { | ||
2006 | u8 band; /* 0: 5 GHz, 1: 2.4 GHz */ | ||
2007 | u8 reserved; | ||
2008 | __le16 channel; | ||
2009 | struct iwl3945_power_per_rate power[IWL_MAX_RATES]; | ||
2010 | } __packed; | ||
2011 | |||
2012 | struct iwl4965_txpowertable_cmd { | ||
2013 | u8 band; /* 0: 5 GHz, 1: 2.4 GHz */ | ||
2014 | u8 reserved; | ||
2015 | __le16 channel; | ||
2016 | struct iwl4965_tx_power_db tx_power; | ||
2017 | } __packed; | ||
2018 | |||
2019 | |||
2020 | /** | ||
2021 | * struct iwl3945_rate_scaling_cmd - Rate Scaling Command & Response | ||
2022 | * | ||
2023 | * REPLY_RATE_SCALE = 0x47 (command, has simple generic response) | ||
2024 | * | ||
2025 | * NOTE: The table of rates passed to the uCode via the | ||
2026 | * RATE_SCALE command sets up the corresponding order of | ||
2027 | * rates used for all related commands, including rate | ||
2028 | * masks, etc. | ||
2029 | * | ||
2030 | * For example, if you set 9MB (PLCP 0x0f) as the first | ||
2031 | * rate in the rate table, the bit mask for that rate | ||
2032 | * when passed through ofdm_basic_rates on the REPLY_RXON | ||
2033 | * command would be bit 0 (1 << 0) | ||
2034 | */ | 1566 | */ |
2035 | struct iwl3945_rate_scaling_info { | ||
2036 | __le16 rate_n_flags; | ||
2037 | u8 try_cnt; | ||
2038 | u8 next_rate_index; | ||
2039 | } __packed; | ||
2040 | |||
2041 | struct iwl3945_rate_scaling_cmd { | ||
2042 | u8 table_id; | ||
2043 | u8 reserved[3]; | ||
2044 | struct iwl3945_rate_scaling_info table[IWL_MAX_RATES]; | ||
2045 | } __packed; | ||
2046 | |||
2047 | 1567 | ||
2048 | /*RS_NEW_API: only TLC_RTS remains and moved to bit 0 */ | 1568 | /*RS_NEW_API: only TLC_RTS remains and moved to bit 0 */ |
2049 | #define LINK_QUAL_FLAGS_SET_STA_TLC_RTS_MSK (1 << 0) | 1569 | #define LINK_QUAL_FLAGS_SET_STA_TLC_RTS_MSK (1 << 0) |
@@ -2092,14 +1612,14 @@ struct iwl_link_qual_general_params { | |||
2092 | } __packed; | 1612 | } __packed; |
2093 | 1613 | ||
2094 | #define LINK_QUAL_AGG_TIME_LIMIT_DEF (4000) /* 4 milliseconds */ | 1614 | #define LINK_QUAL_AGG_TIME_LIMIT_DEF (4000) /* 4 milliseconds */ |
2095 | #define LINK_QUAL_AGG_TIME_LIMIT_MAX (65535) | 1615 | #define LINK_QUAL_AGG_TIME_LIMIT_MAX (8000) |
2096 | #define LINK_QUAL_AGG_TIME_LIMIT_MIN (0) | 1616 | #define LINK_QUAL_AGG_TIME_LIMIT_MIN (100) |
2097 | 1617 | ||
2098 | #define LINK_QUAL_AGG_DISABLE_START_DEF (3) | 1618 | #define LINK_QUAL_AGG_DISABLE_START_DEF (3) |
2099 | #define LINK_QUAL_AGG_DISABLE_START_MAX (255) | 1619 | #define LINK_QUAL_AGG_DISABLE_START_MAX (255) |
2100 | #define LINK_QUAL_AGG_DISABLE_START_MIN (0) | 1620 | #define LINK_QUAL_AGG_DISABLE_START_MIN (0) |
2101 | 1621 | ||
2102 | #define LINK_QUAL_AGG_FRAME_LIMIT_DEF (31) | 1622 | #define LINK_QUAL_AGG_FRAME_LIMIT_DEF (63) |
2103 | #define LINK_QUAL_AGG_FRAME_LIMIT_MAX (63) | 1623 | #define LINK_QUAL_AGG_FRAME_LIMIT_MAX (63) |
2104 | #define LINK_QUAL_AGG_FRAME_LIMIT_MIN (0) | 1624 | #define LINK_QUAL_AGG_FRAME_LIMIT_MIN (0) |
2105 | 1625 | ||
@@ -2110,8 +1630,10 @@ struct iwl_link_qual_general_params { | |||
2110 | */ | 1630 | */ |
2111 | struct iwl_link_qual_agg_params { | 1631 | struct iwl_link_qual_agg_params { |
2112 | 1632 | ||
2113 | /* Maximum number of uSec in aggregation. | 1633 | /* |
2114 | * Driver should set this to 4000 (4 milliseconds). */ | 1634 | *Maximum number of uSec in aggregation. |
1635 | * default set to 4000 (4 milliseconds) if not configured in .cfg | ||
1636 | */ | ||
2115 | __le16 agg_time_limit; | 1637 | __le16 agg_time_limit; |
2116 | 1638 | ||
2117 | /* | 1639 | /* |
@@ -2135,14 +1657,16 @@ struct iwl_link_qual_agg_params { | |||
2135 | /* | 1657 | /* |
2136 | * REPLY_TX_LINK_QUALITY_CMD = 0x4e (command, has simple generic response) | 1658 | * REPLY_TX_LINK_QUALITY_CMD = 0x4e (command, has simple generic response) |
2137 | * | 1659 | * |
2138 | * For 4965 only; 3945 uses REPLY_RATE_SCALE. | 1660 | * For agn devices only; 3945 uses REPLY_RATE_SCALE. |
2139 | * | 1661 | * |
2140 | * Each station in the 4965's internal station table has its own table of 16 | 1662 | * Each station in the agn device's internal station table has its own table |
1663 | * of 16 | ||
2141 | * Tx rates and modulation modes (e.g. legacy/SISO/MIMO) for retrying Tx when | 1664 | * Tx rates and modulation modes (e.g. legacy/SISO/MIMO) for retrying Tx when |
2142 | * an ACK is not received. This command replaces the entire table for | 1665 | * an ACK is not received. This command replaces the entire table for |
2143 | * one station. | 1666 | * one station. |
2144 | * | 1667 | * |
2145 | * NOTE: Station must already be in 4965's station table. Use REPLY_ADD_STA. | 1668 | * NOTE: Station must already be in agn device's station table. |
1669 | * Use REPLY_ADD_STA. | ||
2146 | * | 1670 | * |
2147 | * The rate scaling procedures described below work well. Of course, other | 1671 | * The rate scaling procedures described below work well. Of course, other |
2148 | * procedures are possible, and may work better for particular environments. | 1672 | * procedures are possible, and may work better for particular environments. |
@@ -2179,12 +1703,12 @@ struct iwl_link_qual_agg_params { | |||
2179 | * | 1703 | * |
2180 | * ACCUMULATING HISTORY | 1704 | * ACCUMULATING HISTORY |
2181 | * | 1705 | * |
2182 | * The rate scaling algorithm for 4965, as implemented in Linux driver, uses | 1706 | * The rate scaling algorithm for agn devices, as implemented in Linux driver, |
2183 | * two sets of frame Tx success history: One for the current/active modulation | 1707 | * uses two sets of frame Tx success history: One for the current/active |
2184 | * mode, and one for a speculative/search mode that is being attempted. If the | 1708 | * modulation mode, and one for a speculative/search mode that is being |
2185 | * speculative mode turns out to be more effective (i.e. actual transfer | 1709 | * attempted. If the speculative mode turns out to be more effective (i.e. |
2186 | * rate is better), then the driver continues to use the speculative mode | 1710 | * actual transfer rate is better), then the driver continues to use the |
2187 | * as the new current active mode. | 1711 | * speculative mode as the new current active mode. |
2188 | * | 1712 | * |
2189 | * Each history set contains, separately for each possible rate, data for a | 1713 | * Each history set contains, separately for each possible rate, data for a |
2190 | * sliding window of the 62 most recent tx attempts at that rate. The data | 1714 | * sliding window of the 62 most recent tx attempts at that rate. The data |
@@ -2195,12 +1719,12 @@ struct iwl_link_qual_agg_params { | |||
2195 | * The driver uses the bit map to remove successes from the success sum, as | 1719 | * The driver uses the bit map to remove successes from the success sum, as |
2196 | * the oldest tx attempts fall out of the window. | 1720 | * the oldest tx attempts fall out of the window. |
2197 | * | 1721 | * |
2198 | * When the 4965 makes multiple tx attempts for a given frame, each attempt | 1722 | * When the agn device makes multiple tx attempts for a given frame, each |
2199 | * might be at a different rate, and have different modulation characteristics | 1723 | * attempt might be at a different rate, and have different modulation |
2200 | * (e.g. antenna, fat channel, short guard interval), as set up in the rate | 1724 | * characteristics (e.g. antenna, fat channel, short guard interval), as set |
2201 | * scaling table in the Link Quality command. The driver must determine | 1725 | * up in the rate scaling table in the Link Quality command. The driver must |
2202 | * which rate table entry was used for each tx attempt, to determine which | 1726 | * determine which rate table entry was used for each tx attempt, to determine |
2203 | * rate-specific history to update, and record only those attempts that | 1727 | * which rate-specific history to update, and record only those attempts that |
2204 | * match the modulation characteristics of the history set. | 1728 | * match the modulation characteristics of the history set. |
2205 | * | 1729 | * |
2206 | * When using block-ack (aggregation), all frames are transmitted at the same | 1730 | * When using block-ack (aggregation), all frames are transmitted at the same |
@@ -2330,7 +1854,7 @@ struct iwl_link_quality_cmd { | |||
2330 | /* | 1854 | /* |
2331 | * Rate info; when using rate-scaling, Tx command's initial_rate_index | 1855 | * Rate info; when using rate-scaling, Tx command's initial_rate_index |
2332 | * specifies 1st Tx rate attempted, via index into this table. | 1856 | * specifies 1st Tx rate attempted, via index into this table. |
2333 | * 4965 works its way through table when retrying Tx. | 1857 | * agn devices works its way through table when retrying Tx. |
2334 | */ | 1858 | */ |
2335 | struct { | 1859 | struct { |
2336 | __le32 rate_n_flags; /* RATE_MCS_*, IWL_RATE_* */ | 1860 | __le32 rate_n_flags; /* RATE_MCS_*, IWL_RATE_* */ |
@@ -2363,10 +1887,26 @@ struct iwl_link_quality_cmd { | |||
2363 | #define BT_MAX_KILL_DEF (0x5) | 1887 | #define BT_MAX_KILL_DEF (0x5) |
2364 | #define BT_MAX_KILL_MAX (0xFF) | 1888 | #define BT_MAX_KILL_MAX (0xFF) |
2365 | 1889 | ||
1890 | #define BT_DURATION_LIMIT_DEF 625 | ||
1891 | #define BT_DURATION_LIMIT_MAX 1250 | ||
1892 | #define BT_DURATION_LIMIT_MIN 625 | ||
1893 | |||
1894 | #define BT_ON_THRESHOLD_DEF 4 | ||
1895 | #define BT_ON_THRESHOLD_MAX 1000 | ||
1896 | #define BT_ON_THRESHOLD_MIN 1 | ||
1897 | |||
1898 | #define BT_FRAG_THRESHOLD_DEF 0 | ||
1899 | #define BT_FRAG_THRESHOLD_MAX 0 | ||
1900 | #define BT_FRAG_THRESHOLD_MIN 0 | ||
1901 | |||
1902 | #define BT_AGG_THRESHOLD_DEF 1200 | ||
1903 | #define BT_AGG_THRESHOLD_MAX 8000 | ||
1904 | #define BT_AGG_THRESHOLD_MIN 400 | ||
1905 | |||
2366 | /* | 1906 | /* |
2367 | * REPLY_BT_CONFIG = 0x9b (command, has simple generic response) | 1907 | * REPLY_BT_CONFIG = 0x9b (command, has simple generic response) |
2368 | * | 1908 | * |
2369 | * 3945 and 4965 support hardware handshake with Bluetooth device on | 1909 | * 3945 and agn devices support hardware handshake with Bluetooth device on |
2370 | * same platform. Bluetooth device alerts wireless device when it will Tx; | 1910 | * same platform. Bluetooth device alerts wireless device when it will Tx; |
2371 | * wireless device can delay or kill its own Tx to accommodate. | 1911 | * wireless device can delay or kill its own Tx to accommodate. |
2372 | */ | 1912 | */ |
@@ -2379,6 +1919,97 @@ struct iwl_bt_cmd { | |||
2379 | __le32 kill_cts_mask; | 1919 | __le32 kill_cts_mask; |
2380 | } __packed; | 1920 | } __packed; |
2381 | 1921 | ||
1922 | #define IWLAGN_BT_FLAG_CHANNEL_INHIBITION BIT(0) | ||
1923 | |||
1924 | #define IWLAGN_BT_FLAG_COEX_MODE_MASK (BIT(3)|BIT(4)|BIT(5)) | ||
1925 | #define IWLAGN_BT_FLAG_COEX_MODE_SHIFT 3 | ||
1926 | #define IWLAGN_BT_FLAG_COEX_MODE_DISABLED 0 | ||
1927 | #define IWLAGN_BT_FLAG_COEX_MODE_LEGACY_2W 1 | ||
1928 | #define IWLAGN_BT_FLAG_COEX_MODE_3W 2 | ||
1929 | #define IWLAGN_BT_FLAG_COEX_MODE_4W 3 | ||
1930 | |||
1931 | #define IWLAGN_BT_FLAG_UCODE_DEFAULT BIT(6) | ||
1932 | /* Disable Sync PSPoll on SCO/eSCO */ | ||
1933 | #define IWLAGN_BT_FLAG_SYNC_2_BT_DISABLE BIT(7) | ||
1934 | |||
1935 | #define IWLAGN_BT_PRIO_BOOST_MAX 0xFF | ||
1936 | #define IWLAGN_BT_PRIO_BOOST_MIN 0x00 | ||
1937 | #define IWLAGN_BT_PRIO_BOOST_DEFAULT 0xF0 | ||
1938 | |||
1939 | #define IWLAGN_BT_MAX_KILL_DEFAULT 5 | ||
1940 | |||
1941 | #define IWLAGN_BT3_T7_DEFAULT 1 | ||
1942 | |||
1943 | #define IWLAGN_BT_KILL_ACK_MASK_DEFAULT cpu_to_le32(0xffff0000) | ||
1944 | #define IWLAGN_BT_KILL_CTS_MASK_DEFAULT cpu_to_le32(0xffff0000) | ||
1945 | #define IWLAGN_BT_KILL_ACK_CTS_MASK_SCO cpu_to_le32(0xffffffff) | ||
1946 | |||
1947 | #define IWLAGN_BT3_PRIO_SAMPLE_DEFAULT 2 | ||
1948 | |||
1949 | #define IWLAGN_BT3_T2_DEFAULT 0xc | ||
1950 | |||
1951 | #define IWLAGN_BT_VALID_ENABLE_FLAGS cpu_to_le16(BIT(0)) | ||
1952 | #define IWLAGN_BT_VALID_BOOST cpu_to_le16(BIT(1)) | ||
1953 | #define IWLAGN_BT_VALID_MAX_KILL cpu_to_le16(BIT(2)) | ||
1954 | #define IWLAGN_BT_VALID_3W_TIMERS cpu_to_le16(BIT(3)) | ||
1955 | #define IWLAGN_BT_VALID_KILL_ACK_MASK cpu_to_le16(BIT(4)) | ||
1956 | #define IWLAGN_BT_VALID_KILL_CTS_MASK cpu_to_le16(BIT(5)) | ||
1957 | #define IWLAGN_BT_VALID_BT4_TIMES cpu_to_le16(BIT(6)) | ||
1958 | #define IWLAGN_BT_VALID_3W_LUT cpu_to_le16(BIT(7)) | ||
1959 | |||
1960 | #define IWLAGN_BT_ALL_VALID_MSK (IWLAGN_BT_VALID_ENABLE_FLAGS | \ | ||
1961 | IWLAGN_BT_VALID_BOOST | \ | ||
1962 | IWLAGN_BT_VALID_MAX_KILL | \ | ||
1963 | IWLAGN_BT_VALID_3W_TIMERS | \ | ||
1964 | IWLAGN_BT_VALID_KILL_ACK_MASK | \ | ||
1965 | IWLAGN_BT_VALID_KILL_CTS_MASK | \ | ||
1966 | IWLAGN_BT_VALID_BT4_TIMES | \ | ||
1967 | IWLAGN_BT_VALID_3W_LUT) | ||
1968 | |||
1969 | struct iwl_basic_bt_cmd { | ||
1970 | u8 flags; | ||
1971 | u8 ledtime; /* unused */ | ||
1972 | u8 max_kill; | ||
1973 | u8 bt3_timer_t7_value; | ||
1974 | __le32 kill_ack_mask; | ||
1975 | __le32 kill_cts_mask; | ||
1976 | u8 bt3_prio_sample_time; | ||
1977 | u8 bt3_timer_t2_value; | ||
1978 | __le16 bt4_reaction_time; /* unused */ | ||
1979 | __le32 bt3_lookup_table[12]; | ||
1980 | __le16 bt4_decision_time; /* unused */ | ||
1981 | __le16 valid; | ||
1982 | }; | ||
1983 | |||
1984 | struct iwl6000_bt_cmd { | ||
1985 | struct iwl_basic_bt_cmd basic; | ||
1986 | u8 prio_boost; | ||
1987 | /* | ||
1988 | * set IWLAGN_BT_VALID_BOOST to "1" in "valid" bitmask | ||
1989 | * if configure the following patterns | ||
1990 | */ | ||
1991 | u8 tx_prio_boost; /* SW boost of WiFi tx priority */ | ||
1992 | __le16 rx_prio_boost; /* SW boost of WiFi rx priority */ | ||
1993 | }; | ||
1994 | |||
1995 | struct iwl2000_bt_cmd { | ||
1996 | struct iwl_basic_bt_cmd basic; | ||
1997 | __le32 prio_boost; | ||
1998 | /* | ||
1999 | * set IWLAGN_BT_VALID_BOOST to "1" in "valid" bitmask | ||
2000 | * if configure the following patterns | ||
2001 | */ | ||
2002 | u8 reserved; | ||
2003 | u8 tx_prio_boost; /* SW boost of WiFi tx priority */ | ||
2004 | __le16 rx_prio_boost; /* SW boost of WiFi rx priority */ | ||
2005 | }; | ||
2006 | |||
2007 | #define IWLAGN_BT_SCO_ACTIVE cpu_to_le32(BIT(0)) | ||
2008 | |||
2009 | struct iwlagn_bt_sco_cmd { | ||
2010 | __le32 flags; | ||
2011 | }; | ||
2012 | |||
2382 | /****************************************************************************** | 2013 | /****************************************************************************** |
2383 | * (6) | 2014 | * (6) |
2384 | * Spectrum Management (802.11h) Commands, Responses, Notifications: | 2015 | * Spectrum Management (802.11h) Commands, Responses, Notifications: |
@@ -2543,17 +2174,16 @@ struct iwl_spectrum_notification { | |||
2543 | #define IWL_POWER_VEC_SIZE 5 | 2174 | #define IWL_POWER_VEC_SIZE 5 |
2544 | 2175 | ||
2545 | #define IWL_POWER_DRIVER_ALLOW_SLEEP_MSK cpu_to_le16(BIT(0)) | 2176 | #define IWL_POWER_DRIVER_ALLOW_SLEEP_MSK cpu_to_le16(BIT(0)) |
2177 | #define IWL_POWER_POWER_SAVE_ENA_MSK cpu_to_le16(BIT(0)) | ||
2178 | #define IWL_POWER_POWER_MANAGEMENT_ENA_MSK cpu_to_le16(BIT(1)) | ||
2546 | #define IWL_POWER_SLEEP_OVER_DTIM_MSK cpu_to_le16(BIT(2)) | 2179 | #define IWL_POWER_SLEEP_OVER_DTIM_MSK cpu_to_le16(BIT(2)) |
2547 | #define IWL_POWER_PCI_PM_MSK cpu_to_le16(BIT(3)) | 2180 | #define IWL_POWER_PCI_PM_MSK cpu_to_le16(BIT(3)) |
2548 | #define IWL_POWER_FAST_PD cpu_to_le16(BIT(4)) | 2181 | #define IWL_POWER_FAST_PD cpu_to_le16(BIT(4)) |
2549 | 2182 | #define IWL_POWER_BEACON_FILTERING cpu_to_le16(BIT(5)) | |
2550 | struct iwl3945_powertable_cmd { | 2183 | #define IWL_POWER_SHADOW_REG_ENA cpu_to_le16(BIT(6)) |
2551 | __le16 flags; | 2184 | #define IWL_POWER_CT_KILL_SET cpu_to_le16(BIT(7)) |
2552 | u8 reserved[2]; | 2185 | #define IWL_POWER_BT_SCO_ENA cpu_to_le16(BIT(8)) |
2553 | __le32 rx_data_timeout; | 2186 | #define IWL_POWER_ADVANCE_PM_ENA_MSK cpu_to_le16(BIT(9)) |
2554 | __le32 tx_data_timeout; | ||
2555 | __le32 sleep_interval[IWL_POWER_VEC_SIZE]; | ||
2556 | } __packed; | ||
2557 | 2187 | ||
2558 | struct iwl_powertable_cmd { | 2188 | struct iwl_powertable_cmd { |
2559 | __le16 flags; | 2189 | __le16 flags; |
@@ -2567,7 +2197,7 @@ struct iwl_powertable_cmd { | |||
2567 | 2197 | ||
2568 | /* | 2198 | /* |
2569 | * PM_SLEEP_NOTIFICATION = 0x7A (notification only, not a command) | 2199 | * PM_SLEEP_NOTIFICATION = 0x7A (notification only, not a command) |
2570 | * 3945 and 4965 identical. | 2200 | * all devices identical. |
2571 | */ | 2201 | */ |
2572 | struct iwl_sleep_notification { | 2202 | struct iwl_sleep_notification { |
2573 | u8 pm_sleep_mode; | 2203 | u8 pm_sleep_mode; |
@@ -2578,7 +2208,7 @@ struct iwl_sleep_notification { | |||
2578 | __le32 bcon_timer; | 2208 | __le32 bcon_timer; |
2579 | } __packed; | 2209 | } __packed; |
2580 | 2210 | ||
2581 | /* Sleep states. 3945 and 4965 identical. */ | 2211 | /* Sleep states. all devices identical. */ |
2582 | enum { | 2212 | enum { |
2583 | IWL_PM_NO_SLEEP = 0, | 2213 | IWL_PM_NO_SLEEP = 0, |
2584 | IWL_PM_SLP_MAC = 1, | 2214 | IWL_PM_SLP_MAC = 1, |
@@ -2657,25 +2287,6 @@ struct iwl_ct_kill_throttling_config { | |||
2657 | * active_dwell < max_out_time | 2287 | * active_dwell < max_out_time |
2658 | */ | 2288 | */ |
2659 | 2289 | ||
2660 | /* FIXME: rename to AP1, remove tpc */ | ||
2661 | struct iwl3945_scan_channel { | ||
2662 | /* | ||
2663 | * type is defined as: | ||
2664 | * 0:0 1 = active, 0 = passive | ||
2665 | * 1:4 SSID direct bit map; if a bit is set, then corresponding | ||
2666 | * SSID IE is transmitted in probe request. | ||
2667 | * 5:7 reserved | ||
2668 | */ | ||
2669 | u8 type; | ||
2670 | u8 channel; /* band is selected by iwl3945_scan_cmd "flags" field */ | ||
2671 | struct iwl3945_tx_power tpc; | ||
2672 | __le16 active_dwell; /* in 1024-uSec TU (time units), typ 5-50 */ | ||
2673 | __le16 passive_dwell; /* in 1024-uSec TU (time units), typ 20-500 */ | ||
2674 | } __packed; | ||
2675 | |||
2676 | /* set number of direct probes u8 type */ | ||
2677 | #define IWL39_SCAN_PROBE_MASK(n) ((BIT(n) | (BIT(n) - BIT(1)))) | ||
2678 | |||
2679 | struct iwl_scan_channel { | 2290 | struct iwl_scan_channel { |
2680 | /* | 2291 | /* |
2681 | * type is defined as: | 2292 | * type is defined as: |
@@ -2771,53 +2382,15 @@ struct iwl_ssid_ie { | |||
2771 | * struct iwl_scan_channel. | 2382 | * struct iwl_scan_channel. |
2772 | */ | 2383 | */ |
2773 | 2384 | ||
2774 | struct iwl3945_scan_cmd { | 2385 | enum iwl_scan_flags { |
2775 | __le16 len; | 2386 | /* BIT(0) currently unused */ |
2776 | u8 reserved0; | 2387 | IWL_SCAN_FLAGS_ACTION_FRAME_TX = BIT(1), |
2777 | u8 channel_count; /* # channels in channel list */ | 2388 | /* bits 2-7 reserved */ |
2778 | __le16 quiet_time; /* dwell only this # millisecs on quiet channel | 2389 | }; |
2779 | * (only for active scan) */ | ||
2780 | __le16 quiet_plcp_th; /* quiet chnl is < this # pkts (typ. 1) */ | ||
2781 | __le16 good_CRC_th; /* passive -> active promotion threshold */ | ||
2782 | __le16 reserved1; | ||
2783 | __le32 max_out_time; /* max usec to be away from associated (service) | ||
2784 | * channel */ | ||
2785 | __le32 suspend_time; /* pause scan this long (in "extended beacon | ||
2786 | * format") when returning to service channel: | ||
2787 | * 3945; 31:24 # beacons, 19:0 additional usec, | ||
2788 | * 4965; 31:22 # beacons, 21:0 additional usec. | ||
2789 | */ | ||
2790 | __le32 flags; /* RXON_FLG_* */ | ||
2791 | __le32 filter_flags; /* RXON_FILTER_* */ | ||
2792 | |||
2793 | /* For active scans (set to all-0s for passive scans). | ||
2794 | * Does not include payload. Must specify Tx rate; no rate scaling. */ | ||
2795 | struct iwl3945_tx_cmd tx_cmd; | ||
2796 | |||
2797 | /* For directed active scans (set to all-0s otherwise) */ | ||
2798 | struct iwl_ssid_ie direct_scan[PROBE_OPTION_MAX_3945]; | ||
2799 | |||
2800 | /* | ||
2801 | * Probe request frame, followed by channel list. | ||
2802 | * | ||
2803 | * Size of probe request frame is specified by byte count in tx_cmd. | ||
2804 | * Channel list follows immediately after probe request frame. | ||
2805 | * Number of channels in list is specified by channel_count. | ||
2806 | * Each channel in list is of type: | ||
2807 | * | ||
2808 | * struct iwl3945_scan_channel channels[0]; | ||
2809 | * | ||
2810 | * NOTE: Only one band of channels can be scanned per pass. You | ||
2811 | * must not mix 2.4GHz channels and 5.2GHz channels, and you must wait | ||
2812 | * for one scan to complete (i.e. receive SCAN_COMPLETE_NOTIFICATION) | ||
2813 | * before requesting another scan. | ||
2814 | */ | ||
2815 | u8 data[0]; | ||
2816 | } __packed; | ||
2817 | 2390 | ||
2818 | struct iwl_scan_cmd { | 2391 | struct iwl_scan_cmd { |
2819 | __le16 len; | 2392 | __le16 len; |
2820 | u8 reserved0; | 2393 | u8 scan_flags; /* scan flags: see enum iwl_scan_flags */ |
2821 | u8 channel_count; /* # channels in channel list */ | 2394 | u8 channel_count; /* # channels in channel list */ |
2822 | __le16 quiet_time; /* dwell only this # millisecs on quiet channel | 2395 | __le16 quiet_time; /* dwell only this # millisecs on quiet channel |
2823 | * (only for active scan) */ | 2396 | * (only for active scan) */ |
@@ -2887,6 +2460,12 @@ struct iwl_scanstart_notification { | |||
2887 | #define SCAN_OWNER_STATUS 0x1; | 2460 | #define SCAN_OWNER_STATUS 0x1; |
2888 | #define MEASURE_OWNER_STATUS 0x2; | 2461 | #define MEASURE_OWNER_STATUS 0x2; |
2889 | 2462 | ||
2463 | #define IWL_PROBE_STATUS_OK 0 | ||
2464 | #define IWL_PROBE_STATUS_TX_FAILED BIT(0) | ||
2465 | /* error statuses combined with TX_FAILED */ | ||
2466 | #define IWL_PROBE_STATUS_FAIL_TTL BIT(1) | ||
2467 | #define IWL_PROBE_STATUS_FAIL_BT BIT(2) | ||
2468 | |||
2890 | #define NUMBER_OF_STATISTICS 1 /* first __le32 is good CRC */ | 2469 | #define NUMBER_OF_STATISTICS 1 /* first __le32 is good CRC */ |
2891 | /* | 2470 | /* |
2892 | * SCAN_RESULTS_NOTIFICATION = 0x83 (notification only, not a command) | 2471 | * SCAN_RESULTS_NOTIFICATION = 0x83 (notification only, not a command) |
@@ -2894,7 +2473,8 @@ struct iwl_scanstart_notification { | |||
2894 | struct iwl_scanresults_notification { | 2473 | struct iwl_scanresults_notification { |
2895 | u8 channel; | 2474 | u8 channel; |
2896 | u8 band; | 2475 | u8 band; |
2897 | u8 reserved[2]; | 2476 | u8 probe_status; |
2477 | u8 num_probe_not_sent; /* not enough time to send */ | ||
2898 | __le32 tsf_low; | 2478 | __le32 tsf_low; |
2899 | __le32 tsf_high; | 2479 | __le32 tsf_high; |
2900 | __le32 statistics[NUMBER_OF_STATISTICS]; | 2480 | __le32 statistics[NUMBER_OF_STATISTICS]; |
@@ -2906,7 +2486,7 @@ struct iwl_scanresults_notification { | |||
2906 | struct iwl_scancomplete_notification { | 2486 | struct iwl_scancomplete_notification { |
2907 | u8 scanned_channels; | 2487 | u8 scanned_channels; |
2908 | u8 status; | 2488 | u8 status; |
2909 | u8 reserved; | 2489 | u8 bt_status; /* BT On/Off status */ |
2910 | u8 last_channel; | 2490 | u8 last_channel; |
2911 | __le32 tsf_low; | 2491 | __le32 tsf_low; |
2912 | __le32 tsf_high; | 2492 | __le32 tsf_high; |
@@ -2919,19 +2499,17 @@ struct iwl_scancomplete_notification { | |||
2919 | * | 2499 | * |
2920 | *****************************************************************************/ | 2500 | *****************************************************************************/ |
2921 | 2501 | ||
2502 | enum iwl_ibss_manager { | ||
2503 | IWL_NOT_IBSS_MANAGER = 0, | ||
2504 | IWL_IBSS_MANAGER = 1, | ||
2505 | }; | ||
2506 | |||
2922 | /* | 2507 | /* |
2923 | * BEACON_NOTIFICATION = 0x90 (notification only, not a command) | 2508 | * BEACON_NOTIFICATION = 0x90 (notification only, not a command) |
2924 | */ | 2509 | */ |
2925 | 2510 | ||
2926 | struct iwl3945_beacon_notif { | 2511 | struct iwlagn_beacon_notif { |
2927 | struct iwl3945_tx_resp beacon_notify_hdr; | 2512 | struct iwlagn_tx_resp beacon_notify_hdr; |
2928 | __le32 low_tsf; | ||
2929 | __le32 high_tsf; | ||
2930 | __le32 ibss_mgr_status; | ||
2931 | } __packed; | ||
2932 | |||
2933 | struct iwl4965_beacon_notif { | ||
2934 | struct iwl4965_tx_resp beacon_notify_hdr; | ||
2935 | __le32 low_tsf; | 2513 | __le32 low_tsf; |
2936 | __le32 high_tsf; | 2514 | __le32 high_tsf; |
2937 | __le32 ibss_mgr_status; | 2515 | __le32 ibss_mgr_status; |
@@ -2941,14 +2519,6 @@ struct iwl4965_beacon_notif { | |||
2941 | * REPLY_TX_BEACON = 0x91 (command, has simple generic response) | 2519 | * REPLY_TX_BEACON = 0x91 (command, has simple generic response) |
2942 | */ | 2520 | */ |
2943 | 2521 | ||
2944 | struct iwl3945_tx_beacon_cmd { | ||
2945 | struct iwl3945_tx_cmd tx; | ||
2946 | __le16 tim_idx; | ||
2947 | u8 tim_size; | ||
2948 | u8 reserved1; | ||
2949 | struct ieee80211_hdr frame[0]; /* beacon frame */ | ||
2950 | } __packed; | ||
2951 | |||
2952 | struct iwl_tx_beacon_cmd { | 2522 | struct iwl_tx_beacon_cmd { |
2953 | struct iwl_tx_cmd tx; | 2523 | struct iwl_tx_cmd tx; |
2954 | __le16 tim_idx; | 2524 | __le16 tim_idx; |
@@ -2985,53 +2555,6 @@ struct rate_histogram { | |||
2985 | 2555 | ||
2986 | /* statistics command response */ | 2556 | /* statistics command response */ |
2987 | 2557 | ||
2988 | struct iwl39_statistics_rx_phy { | ||
2989 | __le32 ina_cnt; | ||
2990 | __le32 fina_cnt; | ||
2991 | __le32 plcp_err; | ||
2992 | __le32 crc32_err; | ||
2993 | __le32 overrun_err; | ||
2994 | __le32 early_overrun_err; | ||
2995 | __le32 crc32_good; | ||
2996 | __le32 false_alarm_cnt; | ||
2997 | __le32 fina_sync_err_cnt; | ||
2998 | __le32 sfd_timeout; | ||
2999 | __le32 fina_timeout; | ||
3000 | __le32 unresponded_rts; | ||
3001 | __le32 rxe_frame_limit_overrun; | ||
3002 | __le32 sent_ack_cnt; | ||
3003 | __le32 sent_cts_cnt; | ||
3004 | } __packed; | ||
3005 | |||
3006 | struct iwl39_statistics_rx_non_phy { | ||
3007 | __le32 bogus_cts; /* CTS received when not expecting CTS */ | ||
3008 | __le32 bogus_ack; /* ACK received when not expecting ACK */ | ||
3009 | __le32 non_bssid_frames; /* number of frames with BSSID that | ||
3010 | * doesn't belong to the STA BSSID */ | ||
3011 | __le32 filtered_frames; /* count frames that were dumped in the | ||
3012 | * filtering process */ | ||
3013 | __le32 non_channel_beacons; /* beacons with our bss id but not on | ||
3014 | * our serving channel */ | ||
3015 | } __packed; | ||
3016 | |||
3017 | struct iwl39_statistics_rx { | ||
3018 | struct iwl39_statistics_rx_phy ofdm; | ||
3019 | struct iwl39_statistics_rx_phy cck; | ||
3020 | struct iwl39_statistics_rx_non_phy general; | ||
3021 | } __packed; | ||
3022 | |||
3023 | struct iwl39_statistics_tx { | ||
3024 | __le32 preamble_cnt; | ||
3025 | __le32 rx_detected_cnt; | ||
3026 | __le32 bt_prio_defer_cnt; | ||
3027 | __le32 bt_prio_kill_cnt; | ||
3028 | __le32 few_bytes_cnt; | ||
3029 | __le32 cts_timeout; | ||
3030 | __le32 ack_timeout; | ||
3031 | __le32 expected_ack_cnt; | ||
3032 | __le32 actual_ack_cnt; | ||
3033 | } __packed; | ||
3034 | |||
3035 | struct statistics_dbg { | 2558 | struct statistics_dbg { |
3036 | __le32 burst_check; | 2559 | __le32 burst_check; |
3037 | __le32 burst_count; | 2560 | __le32 burst_count; |
@@ -3039,23 +2562,6 @@ struct statistics_dbg { | |||
3039 | __le32 reserved[3]; | 2562 | __le32 reserved[3]; |
3040 | } __packed; | 2563 | } __packed; |
3041 | 2564 | ||
3042 | struct iwl39_statistics_div { | ||
3043 | __le32 tx_on_a; | ||
3044 | __le32 tx_on_b; | ||
3045 | __le32 exec_time; | ||
3046 | __le32 probe_time; | ||
3047 | } __packed; | ||
3048 | |||
3049 | struct iwl39_statistics_general { | ||
3050 | __le32 temperature; | ||
3051 | struct statistics_dbg dbg; | ||
3052 | __le32 sleep_time; | ||
3053 | __le32 slots_out; | ||
3054 | __le32 slots_idle; | ||
3055 | __le32 ttl_timestamp; | ||
3056 | struct iwl39_statistics_div div; | ||
3057 | } __packed; | ||
3058 | |||
3059 | struct statistics_rx_phy { | 2565 | struct statistics_rx_phy { |
3060 | __le32 ina_cnt; | 2566 | __le32 ina_cnt; |
3061 | __le32 fina_cnt; | 2567 | __le32 fina_cnt; |
@@ -3260,7 +2766,7 @@ struct statistics_general_bt { | |||
3260 | 2766 | ||
3261 | /* | 2767 | /* |
3262 | * REPLY_STATISTICS_CMD = 0x9c, | 2768 | * REPLY_STATISTICS_CMD = 0x9c, |
3263 | * 3945 and 4965 identical. | 2769 | * all devices identical. |
3264 | * | 2770 | * |
3265 | * This command triggers an immediate response containing uCode statistics. | 2771 | * This command triggers an immediate response containing uCode statistics. |
3266 | * The response is in the same format as STATISTICS_NOTIFICATION 0x9d, below. | 2772 | * The response is in the same format as STATISTICS_NOTIFICATION 0x9d, below. |
@@ -3297,13 +2803,6 @@ struct iwl_statistics_cmd { | |||
3297 | #define STATISTICS_REPLY_FLG_BAND_24G_MSK cpu_to_le32(0x2) | 2803 | #define STATISTICS_REPLY_FLG_BAND_24G_MSK cpu_to_le32(0x2) |
3298 | #define STATISTICS_REPLY_FLG_HT40_MODE_MSK cpu_to_le32(0x8) | 2804 | #define STATISTICS_REPLY_FLG_HT40_MODE_MSK cpu_to_le32(0x8) |
3299 | 2805 | ||
3300 | struct iwl3945_notif_statistics { | ||
3301 | __le32 flag; | ||
3302 | struct iwl39_statistics_rx rx; | ||
3303 | struct iwl39_statistics_tx tx; | ||
3304 | struct iwl39_statistics_general general; | ||
3305 | } __packed; | ||
3306 | |||
3307 | struct iwl_notif_statistics { | 2806 | struct iwl_notif_statistics { |
3308 | __le32 flag; | 2807 | __le32 flag; |
3309 | struct statistics_rx rx; | 2808 | struct statistics_rx rx; |
@@ -3598,7 +3097,7 @@ struct iwl_enhance_sensitivity_cmd { | |||
3598 | /** | 3097 | /** |
3599 | * REPLY_PHY_CALIBRATION_CMD = 0xb0 (command, has simple generic response) | 3098 | * REPLY_PHY_CALIBRATION_CMD = 0xb0 (command, has simple generic response) |
3600 | * | 3099 | * |
3601 | * This command sets the relative gains of 4965's 3 radio receiver chains. | 3100 | * This command sets the relative gains of agn device's 3 radio receiver chains. |
3602 | * | 3101 | * |
3603 | * After the first association, driver should accumulate signal and noise | 3102 | * After the first association, driver should accumulate signal and noise |
3604 | * statistics from the STATISTICS_NOTIFICATIONs that follow the first 20 | 3103 | * statistics from the STATISTICS_NOTIFICATIONs that follow the first 20 |
@@ -3651,7 +3150,8 @@ struct iwl_enhance_sensitivity_cmd { | |||
3651 | */ | 3150 | */ |
3652 | 3151 | ||
3653 | /* Phy calibration command for series */ | 3152 | /* Phy calibration command for series */ |
3654 | 3153 | /* The default calibrate table size if not specified by firmware */ | |
3154 | #define IWL_DEFAULT_STANDARD_PHY_CALIBRATE_TBL_SIZE 18 | ||
3655 | enum { | 3155 | enum { |
3656 | IWL_PHY_CALIBRATE_DIFF_GAIN_CMD = 7, | 3156 | IWL_PHY_CALIBRATE_DIFF_GAIN_CMD = 7, |
3657 | IWL_PHY_CALIBRATE_DC_CMD = 8, | 3157 | IWL_PHY_CALIBRATE_DC_CMD = 8, |
@@ -3660,13 +3160,29 @@ enum { | |||
3660 | IWL_PHY_CALIBRATE_CRYSTAL_FRQ_CMD = 15, | 3160 | IWL_PHY_CALIBRATE_CRYSTAL_FRQ_CMD = 15, |
3661 | IWL_PHY_CALIBRATE_BASE_BAND_CMD = 16, | 3161 | IWL_PHY_CALIBRATE_BASE_BAND_CMD = 16, |
3662 | IWL_PHY_CALIBRATE_TX_IQ_PERD_CMD = 17, | 3162 | IWL_PHY_CALIBRATE_TX_IQ_PERD_CMD = 17, |
3663 | IWL_MAX_STANDARD_PHY_CALIBRATE_TBL_SIZE = 18, | 3163 | IWL_PHY_CALIBRATE_TEMP_OFFSET_CMD = 18, |
3164 | IWL_MAX_STANDARD_PHY_CALIBRATE_TBL_SIZE = 19, | ||
3664 | }; | 3165 | }; |
3665 | 3166 | ||
3666 | #define IWL_MAX_PHY_CALIBRATE_TBL_SIZE (253) | 3167 | #define IWL_MAX_PHY_CALIBRATE_TBL_SIZE (253) |
3667 | 3168 | ||
3668 | #define IWL_CALIB_INIT_CFG_ALL cpu_to_le32(0xffffffff) | 3169 | #define IWL_CALIB_INIT_CFG_ALL cpu_to_le32(0xffffffff) |
3669 | 3170 | ||
3171 | /* This enum defines the bitmap of various calibrations to enable in both | ||
3172 | * init ucode and runtime ucode through CALIBRATION_CFG_CMD. | ||
3173 | */ | ||
3174 | enum iwl_ucode_calib_cfg { | ||
3175 | IWL_CALIB_CFG_RX_BB_IDX, | ||
3176 | IWL_CALIB_CFG_DC_IDX, | ||
3177 | IWL_CALIB_CFG_TX_IQ_IDX, | ||
3178 | IWL_CALIB_CFG_RX_IQ_IDX, | ||
3179 | IWL_CALIB_CFG_NOISE_IDX, | ||
3180 | IWL_CALIB_CFG_CRYSTAL_IDX, | ||
3181 | IWL_CALIB_CFG_TEMPERATURE_IDX, | ||
3182 | IWL_CALIB_CFG_PAPD_IDX, | ||
3183 | }; | ||
3184 | |||
3185 | |||
3670 | struct iwl_calib_cfg_elmnt_s { | 3186 | struct iwl_calib_cfg_elmnt_s { |
3671 | __le32 is_enable; | 3187 | __le32 is_enable; |
3672 | __le32 start; | 3188 | __le32 start; |
@@ -3715,6 +3231,13 @@ struct iwl_calib_xtal_freq_cmd { | |||
3715 | u8 pad[2]; | 3231 | u8 pad[2]; |
3716 | } __packed; | 3232 | } __packed; |
3717 | 3233 | ||
3234 | #define DEFAULT_RADIO_SENSOR_OFFSET 2700 | ||
3235 | struct iwl_calib_temperature_offset_cmd { | ||
3236 | struct iwl_calib_hdr hdr; | ||
3237 | s16 radio_sensor_offset; | ||
3238 | s16 reserved; | ||
3239 | } __packed; | ||
3240 | |||
3718 | /* IWL_PHY_CALIBRATE_CHAIN_NOISE_RESET_CMD */ | 3241 | /* IWL_PHY_CALIBRATE_CHAIN_NOISE_RESET_CMD */ |
3719 | struct iwl_calib_chain_noise_reset_cmd { | 3242 | struct iwl_calib_chain_noise_reset_cmd { |
3720 | struct iwl_calib_hdr hdr; | 3243 | struct iwl_calib_hdr hdr; |
@@ -3955,6 +3478,285 @@ struct iwl_coex_event_resp { | |||
3955 | 3478 | ||
3956 | 3479 | ||
3957 | /****************************************************************************** | 3480 | /****************************************************************************** |
3481 | * Bluetooth Coexistence commands | ||
3482 | * | ||
3483 | *****************************************************************************/ | ||
3484 | |||
3485 | /* | ||
3486 | * BT Status notification | ||
3487 | * REPLY_BT_COEX_PROFILE_NOTIF = 0xce | ||
3488 | */ | ||
3489 | enum iwl_bt_coex_profile_traffic_load { | ||
3490 | IWL_BT_COEX_TRAFFIC_LOAD_NONE = 0, | ||
3491 | IWL_BT_COEX_TRAFFIC_LOAD_LOW = 1, | ||
3492 | IWL_BT_COEX_TRAFFIC_LOAD_HIGH = 2, | ||
3493 | IWL_BT_COEX_TRAFFIC_LOAD_CONTINUOUS = 3, | ||
3494 | /* | ||
3495 | * There are no more even though below is a u8, the | ||
3496 | * indication from the BT device only has two bits. | ||
3497 | */ | ||
3498 | }; | ||
3499 | |||
3500 | #define BT_SESSION_ACTIVITY_1_UART_MSG 0x1 | ||
3501 | #define BT_SESSION_ACTIVITY_2_UART_MSG 0x2 | ||
3502 | |||
3503 | /* BT UART message - Share Part (BT -> WiFi) */ | ||
3504 | #define BT_UART_MSG_FRAME1MSGTYPE_POS (0) | ||
3505 | #define BT_UART_MSG_FRAME1MSGTYPE_MSK \ | ||
3506 | (0x7 << BT_UART_MSG_FRAME1MSGTYPE_POS) | ||
3507 | #define BT_UART_MSG_FRAME1SSN_POS (3) | ||
3508 | #define BT_UART_MSG_FRAME1SSN_MSK \ | ||
3509 | (0x3 << BT_UART_MSG_FRAME1SSN_POS) | ||
3510 | #define BT_UART_MSG_FRAME1UPDATEREQ_POS (5) | ||
3511 | #define BT_UART_MSG_FRAME1UPDATEREQ_MSK \ | ||
3512 | (0x1 << BT_UART_MSG_FRAME1UPDATEREQ_POS) | ||
3513 | #define BT_UART_MSG_FRAME1RESERVED_POS (6) | ||
3514 | #define BT_UART_MSG_FRAME1RESERVED_MSK \ | ||
3515 | (0x3 << BT_UART_MSG_FRAME1RESERVED_POS) | ||
3516 | |||
3517 | #define BT_UART_MSG_FRAME2OPENCONNECTIONS_POS (0) | ||
3518 | #define BT_UART_MSG_FRAME2OPENCONNECTIONS_MSK \ | ||
3519 | (0x3 << BT_UART_MSG_FRAME2OPENCONNECTIONS_POS) | ||
3520 | #define BT_UART_MSG_FRAME2TRAFFICLOAD_POS (2) | ||
3521 | #define BT_UART_MSG_FRAME2TRAFFICLOAD_MSK \ | ||
3522 | (0x3 << BT_UART_MSG_FRAME2TRAFFICLOAD_POS) | ||
3523 | #define BT_UART_MSG_FRAME2CHLSEQN_POS (4) | ||
3524 | #define BT_UART_MSG_FRAME2CHLSEQN_MSK \ | ||
3525 | (0x1 << BT_UART_MSG_FRAME2CHLSEQN_POS) | ||
3526 | #define BT_UART_MSG_FRAME2INBAND_POS (5) | ||
3527 | #define BT_UART_MSG_FRAME2INBAND_MSK \ | ||
3528 | (0x1 << BT_UART_MSG_FRAME2INBAND_POS) | ||
3529 | #define BT_UART_MSG_FRAME2RESERVED_POS (6) | ||
3530 | #define BT_UART_MSG_FRAME2RESERVED_MSK \ | ||
3531 | (0x3 << BT_UART_MSG_FRAME2RESERVED_POS) | ||
3532 | |||
3533 | #define BT_UART_MSG_FRAME3SCOESCO_POS (0) | ||
3534 | #define BT_UART_MSG_FRAME3SCOESCO_MSK \ | ||
3535 | (0x1 << BT_UART_MSG_FRAME3SCOESCO_POS) | ||
3536 | #define BT_UART_MSG_FRAME3SNIFF_POS (1) | ||
3537 | #define BT_UART_MSG_FRAME3SNIFF_MSK \ | ||
3538 | (0x1 << BT_UART_MSG_FRAME3SNIFF_POS) | ||
3539 | #define BT_UART_MSG_FRAME3A2DP_POS (2) | ||
3540 | #define BT_UART_MSG_FRAME3A2DP_MSK \ | ||
3541 | (0x1 << BT_UART_MSG_FRAME3A2DP_POS) | ||
3542 | #define BT_UART_MSG_FRAME3ACL_POS (3) | ||
3543 | #define BT_UART_MSG_FRAME3ACL_MSK \ | ||
3544 | (0x1 << BT_UART_MSG_FRAME3ACL_POS) | ||
3545 | #define BT_UART_MSG_FRAME3MASTER_POS (4) | ||
3546 | #define BT_UART_MSG_FRAME3MASTER_MSK \ | ||
3547 | (0x1 << BT_UART_MSG_FRAME3MASTER_POS) | ||
3548 | #define BT_UART_MSG_FRAME3OBEX_POS (5) | ||
3549 | #define BT_UART_MSG_FRAME3OBEX_MSK \ | ||
3550 | (0x1 << BT_UART_MSG_FRAME3OBEX_POS) | ||
3551 | #define BT_UART_MSG_FRAME3RESERVED_POS (6) | ||
3552 | #define BT_UART_MSG_FRAME3RESERVED_MSK \ | ||
3553 | (0x3 << BT_UART_MSG_FRAME3RESERVED_POS) | ||
3554 | |||
3555 | #define BT_UART_MSG_FRAME4IDLEDURATION_POS (0) | ||
3556 | #define BT_UART_MSG_FRAME4IDLEDURATION_MSK \ | ||
3557 | (0x3F << BT_UART_MSG_FRAME4IDLEDURATION_POS) | ||
3558 | #define BT_UART_MSG_FRAME4RESERVED_POS (6) | ||
3559 | #define BT_UART_MSG_FRAME4RESERVED_MSK \ | ||
3560 | (0x3 << BT_UART_MSG_FRAME4RESERVED_POS) | ||
3561 | |||
3562 | #define BT_UART_MSG_FRAME5TXACTIVITY_POS (0) | ||
3563 | #define BT_UART_MSG_FRAME5TXACTIVITY_MSK \ | ||
3564 | (0x3 << BT_UART_MSG_FRAME5TXACTIVITY_POS) | ||
3565 | #define BT_UART_MSG_FRAME5RXACTIVITY_POS (2) | ||
3566 | #define BT_UART_MSG_FRAME5RXACTIVITY_MSK \ | ||
3567 | (0x3 << BT_UART_MSG_FRAME5RXACTIVITY_POS) | ||
3568 | #define BT_UART_MSG_FRAME5ESCORETRANSMIT_POS (4) | ||
3569 | #define BT_UART_MSG_FRAME5ESCORETRANSMIT_MSK \ | ||
3570 | (0x3 << BT_UART_MSG_FRAME5ESCORETRANSMIT_POS) | ||
3571 | #define BT_UART_MSG_FRAME5RESERVED_POS (6) | ||
3572 | #define BT_UART_MSG_FRAME5RESERVED_MSK \ | ||
3573 | (0x3 << BT_UART_MSG_FRAME5RESERVED_POS) | ||
3574 | |||
3575 | #define BT_UART_MSG_FRAME6SNIFFINTERVAL_POS (0) | ||
3576 | #define BT_UART_MSG_FRAME6SNIFFINTERVAL_MSK \ | ||
3577 | (0x1F << BT_UART_MSG_FRAME6SNIFFINTERVAL_POS) | ||
3578 | #define BT_UART_MSG_FRAME6DISCOVERABLE_POS (5) | ||
3579 | #define BT_UART_MSG_FRAME6DISCOVERABLE_MSK \ | ||
3580 | (0x1 << BT_UART_MSG_FRAME6DISCOVERABLE_POS) | ||
3581 | #define BT_UART_MSG_FRAME6RESERVED_POS (6) | ||
3582 | #define BT_UART_MSG_FRAME6RESERVED_MSK \ | ||
3583 | (0x3 << BT_UART_MSG_FRAME6RESERVED_POS) | ||
3584 | |||
3585 | #define BT_UART_MSG_FRAME7SNIFFACTIVITY_POS (0) | ||
3586 | #define BT_UART_MSG_FRAME7SNIFFACTIVITY_MSK \ | ||
3587 | (0x7 << BT_UART_MSG_FRAME7SNIFFACTIVITY_POS) | ||
3588 | #define BT_UART_MSG_FRAME7PAGE_POS (3) | ||
3589 | #define BT_UART_MSG_FRAME7PAGE_MSK \ | ||
3590 | (0x1 << BT_UART_MSG_FRAME7PAGE_POS) | ||
3591 | #define BT_UART_MSG_FRAME7INQUIRY_POS (4) | ||
3592 | #define BT_UART_MSG_FRAME7INQUIRY_MSK \ | ||
3593 | (0x1 << BT_UART_MSG_FRAME7INQUIRY_POS) | ||
3594 | #define BT_UART_MSG_FRAME7CONNECTABLE_POS (5) | ||
3595 | #define BT_UART_MSG_FRAME7CONNECTABLE_MSK \ | ||
3596 | (0x1 << BT_UART_MSG_FRAME7CONNECTABLE_POS) | ||
3597 | #define BT_UART_MSG_FRAME7RESERVED_POS (6) | ||
3598 | #define BT_UART_MSG_FRAME7RESERVED_MSK \ | ||
3599 | (0x3 << BT_UART_MSG_FRAME7RESERVED_POS) | ||
3600 | |||
3601 | /* BT Session Activity 2 UART message (BT -> WiFi) */ | ||
3602 | #define BT_UART_MSG_2_FRAME1RESERVED1_POS (5) | ||
3603 | #define BT_UART_MSG_2_FRAME1RESERVED1_MSK \ | ||
3604 | (0x1<<BT_UART_MSG_2_FRAME1RESERVED1_POS) | ||
3605 | #define BT_UART_MSG_2_FRAME1RESERVED2_POS (6) | ||
3606 | #define BT_UART_MSG_2_FRAME1RESERVED2_MSK \ | ||
3607 | (0x3<<BT_UART_MSG_2_FRAME1RESERVED2_POS) | ||
3608 | |||
3609 | #define BT_UART_MSG_2_FRAME2AGGTRAFFICLOAD_POS (0) | ||
3610 | #define BT_UART_MSG_2_FRAME2AGGTRAFFICLOAD_MSK \ | ||
3611 | (0x3F<<BT_UART_MSG_2_FRAME2AGGTRAFFICLOAD_POS) | ||
3612 | #define BT_UART_MSG_2_FRAME2RESERVED_POS (6) | ||
3613 | #define BT_UART_MSG_2_FRAME2RESERVED_MSK \ | ||
3614 | (0x3<<BT_UART_MSG_2_FRAME2RESERVED_POS) | ||
3615 | |||
3616 | #define BT_UART_MSG_2_FRAME3BRLASTTXPOWER_POS (0) | ||
3617 | #define BT_UART_MSG_2_FRAME3BRLASTTXPOWER_MSK \ | ||
3618 | (0xF<<BT_UART_MSG_2_FRAME3BRLASTTXPOWER_POS) | ||
3619 | #define BT_UART_MSG_2_FRAME3INQPAGESRMODE_POS (4) | ||
3620 | #define BT_UART_MSG_2_FRAME3INQPAGESRMODE_MSK \ | ||
3621 | (0x1<<BT_UART_MSG_2_FRAME3INQPAGESRMODE_POS) | ||
3622 | #define BT_UART_MSG_2_FRAME3LEMASTER_POS (5) | ||
3623 | #define BT_UART_MSG_2_FRAME3LEMASTER_MSK \ | ||
3624 | (0x1<<BT_UART_MSG_2_FRAME3LEMASTER_POS) | ||
3625 | #define BT_UART_MSG_2_FRAME3RESERVED_POS (6) | ||
3626 | #define BT_UART_MSG_2_FRAME3RESERVED_MSK \ | ||
3627 | (0x3<<BT_UART_MSG_2_FRAME3RESERVED_POS) | ||
3628 | |||
3629 | #define BT_UART_MSG_2_FRAME4LELASTTXPOWER_POS (0) | ||
3630 | #define BT_UART_MSG_2_FRAME4LELASTTXPOWER_MSK \ | ||
3631 | (0xF<<BT_UART_MSG_2_FRAME4LELASTTXPOWER_POS) | ||
3632 | #define BT_UART_MSG_2_FRAME4NUMLECONN_POS (4) | ||
3633 | #define BT_UART_MSG_2_FRAME4NUMLECONN_MSK \ | ||
3634 | (0x3<<BT_UART_MSG_2_FRAME4NUMLECONN_POS) | ||
3635 | #define BT_UART_MSG_2_FRAME4RESERVED_POS (6) | ||
3636 | #define BT_UART_MSG_2_FRAME4RESERVED_MSK \ | ||
3637 | (0x3<<BT_UART_MSG_2_FRAME4RESERVED_POS) | ||
3638 | |||
3639 | #define BT_UART_MSG_2_FRAME5BTMINRSSI_POS (0) | ||
3640 | #define BT_UART_MSG_2_FRAME5BTMINRSSI_MSK \ | ||
3641 | (0xF<<BT_UART_MSG_2_FRAME5BTMINRSSI_POS) | ||
3642 | #define BT_UART_MSG_2_FRAME5LESCANINITMODE_POS (4) | ||
3643 | #define BT_UART_MSG_2_FRAME5LESCANINITMODE_MSK \ | ||
3644 | (0x1<<BT_UART_MSG_2_FRAME5LESCANINITMODE_POS) | ||
3645 | #define BT_UART_MSG_2_FRAME5LEADVERMODE_POS (5) | ||
3646 | #define BT_UART_MSG_2_FRAME5LEADVERMODE_MSK \ | ||
3647 | (0x1<<BT_UART_MSG_2_FRAME5LEADVERMODE_POS) | ||
3648 | #define BT_UART_MSG_2_FRAME5RESERVED_POS (6) | ||
3649 | #define BT_UART_MSG_2_FRAME5RESERVED_MSK \ | ||
3650 | (0x3<<BT_UART_MSG_2_FRAME5RESERVED_POS) | ||
3651 | |||
3652 | #define BT_UART_MSG_2_FRAME6LECONNINTERVAL_POS (0) | ||
3653 | #define BT_UART_MSG_2_FRAME6LECONNINTERVAL_MSK \ | ||
3654 | (0x1F<<BT_UART_MSG_2_FRAME6LECONNINTERVAL_POS) | ||
3655 | #define BT_UART_MSG_2_FRAME6RFU_POS (5) | ||
3656 | #define BT_UART_MSG_2_FRAME6RFU_MSK \ | ||
3657 | (0x1<<BT_UART_MSG_2_FRAME6RFU_POS) | ||
3658 | #define BT_UART_MSG_2_FRAME6RESERVED_POS (6) | ||
3659 | #define BT_UART_MSG_2_FRAME6RESERVED_MSK \ | ||
3660 | (0x3<<BT_UART_MSG_2_FRAME6RESERVED_POS) | ||
3661 | |||
3662 | #define BT_UART_MSG_2_FRAME7LECONNSLAVELAT_POS (0) | ||
3663 | #define BT_UART_MSG_2_FRAME7LECONNSLAVELAT_MSK \ | ||
3664 | (0x7<<BT_UART_MSG_2_FRAME7LECONNSLAVELAT_POS) | ||
3665 | #define BT_UART_MSG_2_FRAME7LEPROFILE1_POS (3) | ||
3666 | #define BT_UART_MSG_2_FRAME7LEPROFILE1_MSK \ | ||
3667 | (0x1<<BT_UART_MSG_2_FRAME7LEPROFILE1_POS) | ||
3668 | #define BT_UART_MSG_2_FRAME7LEPROFILE2_POS (4) | ||
3669 | #define BT_UART_MSG_2_FRAME7LEPROFILE2_MSK \ | ||
3670 | (0x1<<BT_UART_MSG_2_FRAME7LEPROFILE2_POS) | ||
3671 | #define BT_UART_MSG_2_FRAME7LEPROFILEOTHER_POS (5) | ||
3672 | #define BT_UART_MSG_2_FRAME7LEPROFILEOTHER_MSK \ | ||
3673 | (0x1<<BT_UART_MSG_2_FRAME7LEPROFILEOTHER_POS) | ||
3674 | #define BT_UART_MSG_2_FRAME7RESERVED_POS (6) | ||
3675 | #define BT_UART_MSG_2_FRAME7RESERVED_MSK \ | ||
3676 | (0x3<<BT_UART_MSG_2_FRAME7RESERVED_POS) | ||
3677 | |||
3678 | |||
3679 | struct iwl_bt_uart_msg { | ||
3680 | u8 header; | ||
3681 | u8 frame1; | ||
3682 | u8 frame2; | ||
3683 | u8 frame3; | ||
3684 | u8 frame4; | ||
3685 | u8 frame5; | ||
3686 | u8 frame6; | ||
3687 | u8 frame7; | ||
3688 | } __attribute__((packed)); | ||
3689 | |||
3690 | struct iwl_bt_coex_profile_notif { | ||
3691 | struct iwl_bt_uart_msg last_bt_uart_msg; | ||
3692 | u8 bt_status; /* 0 - off, 1 - on */ | ||
3693 | u8 bt_traffic_load; /* 0 .. 3? */ | ||
3694 | u8 bt_ci_compliance; /* 0 - not complied, 1 - complied */ | ||
3695 | u8 reserved; | ||
3696 | } __attribute__((packed)); | ||
3697 | |||
3698 | #define IWL_BT_COEX_PRIO_TBL_SHARED_ANTENNA_POS 0 | ||
3699 | #define IWL_BT_COEX_PRIO_TBL_SHARED_ANTENNA_MSK 0x1 | ||
3700 | #define IWL_BT_COEX_PRIO_TBL_PRIO_POS 1 | ||
3701 | #define IWL_BT_COEX_PRIO_TBL_PRIO_MASK 0x0e | ||
3702 | #define IWL_BT_COEX_PRIO_TBL_RESERVED_POS 4 | ||
3703 | #define IWL_BT_COEX_PRIO_TBL_RESERVED_MASK 0xf0 | ||
3704 | #define IWL_BT_COEX_PRIO_TBL_PRIO_SHIFT 1 | ||
3705 | |||
3706 | /* | ||
3707 | * BT Coexistence Priority table | ||
3708 | * REPLY_BT_COEX_PRIO_TABLE = 0xcc | ||
3709 | */ | ||
3710 | enum bt_coex_prio_table_events { | ||
3711 | BT_COEX_PRIO_TBL_EVT_INIT_CALIB1 = 0, | ||
3712 | BT_COEX_PRIO_TBL_EVT_INIT_CALIB2 = 1, | ||
3713 | BT_COEX_PRIO_TBL_EVT_PERIODIC_CALIB_LOW1 = 2, | ||
3714 | BT_COEX_PRIO_TBL_EVT_PERIODIC_CALIB_LOW2 = 3, /* DC calib */ | ||
3715 | BT_COEX_PRIO_TBL_EVT_PERIODIC_CALIB_HIGH1 = 4, | ||
3716 | BT_COEX_PRIO_TBL_EVT_PERIODIC_CALIB_HIGH2 = 5, | ||
3717 | BT_COEX_PRIO_TBL_EVT_DTIM = 6, | ||
3718 | BT_COEX_PRIO_TBL_EVT_SCAN52 = 7, | ||
3719 | BT_COEX_PRIO_TBL_EVT_SCAN24 = 8, | ||
3720 | BT_COEX_PRIO_TBL_EVT_RESERVED0 = 9, | ||
3721 | BT_COEX_PRIO_TBL_EVT_RESERVED1 = 10, | ||
3722 | BT_COEX_PRIO_TBL_EVT_RESERVED2 = 11, | ||
3723 | BT_COEX_PRIO_TBL_EVT_RESERVED3 = 12, | ||
3724 | BT_COEX_PRIO_TBL_EVT_RESERVED4 = 13, | ||
3725 | BT_COEX_PRIO_TBL_EVT_RESERVED5 = 14, | ||
3726 | BT_COEX_PRIO_TBL_EVT_RESERVED6 = 15, | ||
3727 | /* BT_COEX_PRIO_TBL_EVT_MAX should always be last */ | ||
3728 | BT_COEX_PRIO_TBL_EVT_MAX, | ||
3729 | }; | ||
3730 | |||
3731 | enum bt_coex_prio_table_priorities { | ||
3732 | BT_COEX_PRIO_TBL_DISABLED = 0, | ||
3733 | BT_COEX_PRIO_TBL_PRIO_LOW = 1, | ||
3734 | BT_COEX_PRIO_TBL_PRIO_HIGH = 2, | ||
3735 | BT_COEX_PRIO_TBL_PRIO_BYPASS = 3, | ||
3736 | BT_COEX_PRIO_TBL_PRIO_COEX_OFF = 4, | ||
3737 | BT_COEX_PRIO_TBL_PRIO_COEX_ON = 5, | ||
3738 | BT_COEX_PRIO_TBL_PRIO_RSRVD1 = 6, | ||
3739 | BT_COEX_PRIO_TBL_PRIO_RSRVD2 = 7, | ||
3740 | BT_COEX_PRIO_TBL_MAX, | ||
3741 | }; | ||
3742 | |||
3743 | struct iwl_bt_coex_prio_table_cmd { | ||
3744 | u8 prio_tbl[BT_COEX_PRIO_TBL_EVT_MAX]; | ||
3745 | } __attribute__((packed)); | ||
3746 | |||
3747 | #define IWL_BT_COEX_ENV_CLOSE 0 | ||
3748 | #define IWL_BT_COEX_ENV_OPEN 1 | ||
3749 | /* | ||
3750 | * BT Protection Envelope | ||
3751 | * REPLY_BT_COEX_PROT_ENV = 0xcd | ||
3752 | */ | ||
3753 | struct iwl_bt_coex_prot_env_cmd { | ||
3754 | u8 action; /* 0 = closed, 1 = open */ | ||
3755 | u8 type; /* 0 .. 15 */ | ||
3756 | u8 reserved[2]; | ||
3757 | } __attribute__((packed)); | ||
3758 | |||
3759 | /****************************************************************************** | ||
3958 | * (13) | 3760 | * (13) |
3959 | * Union of all expected notifications/responses: | 3761 | * Union of all expected notifications/responses: |
3960 | * | 3762 | * |
@@ -3974,10 +3776,6 @@ struct iwl_rx_packet { | |||
3974 | __le32 len_n_flags; | 3776 | __le32 len_n_flags; |
3975 | struct iwl_cmd_header hdr; | 3777 | struct iwl_cmd_header hdr; |
3976 | union { | 3778 | union { |
3977 | struct iwl3945_rx_frame rx_frame; | ||
3978 | struct iwl3945_tx_resp tx_resp; | ||
3979 | struct iwl3945_beacon_notif beacon_status; | ||
3980 | |||
3981 | struct iwl_alive_resp alive_frame; | 3779 | struct iwl_alive_resp alive_frame; |
3982 | struct iwl_spectrum_notification spectrum_notif; | 3780 | struct iwl_spectrum_notification spectrum_notif; |
3983 | struct iwl_csa_notification csa_notif; | 3781 | struct iwl_csa_notification csa_notif; |
@@ -3993,6 +3791,7 @@ struct iwl_rx_packet { | |||
3993 | struct iwl_missed_beacon_notif missed_beacon; | 3791 | struct iwl_missed_beacon_notif missed_beacon; |
3994 | struct iwl_coex_medium_notification coex_medium_notif; | 3792 | struct iwl_coex_medium_notification coex_medium_notif; |
3995 | struct iwl_coex_event_resp coex_event; | 3793 | struct iwl_coex_event_resp coex_event; |
3794 | struct iwl_bt_coex_profile_notif bt_coex_profile_notif; | ||
3996 | __le32 status; | 3795 | __le32 status; |
3997 | u8 raw[0]; | 3796 | u8 raw[0]; |
3998 | } u; | 3797 | } u; |
@@ -4000,4 +3799,99 @@ struct iwl_rx_packet { | |||
4000 | 3799 | ||
4001 | int iwl_agn_check_rxon_cmd(struct iwl_priv *priv); | 3800 | int iwl_agn_check_rxon_cmd(struct iwl_priv *priv); |
4002 | 3801 | ||
3802 | /* | ||
3803 | * REPLY_WIPAN_PARAMS = 0xb2 (Commands and Notification) | ||
3804 | */ | ||
3805 | |||
3806 | /* | ||
3807 | * Minimum slot time in TU | ||
3808 | */ | ||
3809 | #define IWL_MIN_SLOT_TIME 20 | ||
3810 | |||
3811 | /** | ||
3812 | * struct iwl_wipan_slot | ||
3813 | * @width: Time in TU | ||
3814 | * @type: | ||
3815 | * 0 - BSS | ||
3816 | * 1 - PAN | ||
3817 | */ | ||
3818 | struct iwl_wipan_slot { | ||
3819 | __le16 width; | ||
3820 | u8 type; | ||
3821 | u8 reserved; | ||
3822 | } __packed; | ||
3823 | |||
3824 | #define IWL_WIPAN_PARAMS_FLG_LEAVE_CHANNEL_CTS BIT(1) /* reserved */ | ||
3825 | #define IWL_WIPAN_PARAMS_FLG_LEAVE_CHANNEL_QUIET BIT(2) /* reserved */ | ||
3826 | #define IWL_WIPAN_PARAMS_FLG_SLOTTED_MODE BIT(3) /* reserved */ | ||
3827 | #define IWL_WIPAN_PARAMS_FLG_FILTER_BEACON_NOTIF BIT(4) | ||
3828 | #define IWL_WIPAN_PARAMS_FLG_FULL_SLOTTED_MODE BIT(5) | ||
3829 | |||
3830 | /** | ||
3831 | * struct iwl_wipan_params_cmd | ||
3832 | * @flags: | ||
3833 | * bit0: reserved | ||
3834 | * bit1: CP leave channel with CTS | ||
3835 | * bit2: CP leave channel qith Quiet | ||
3836 | * bit3: slotted mode | ||
3837 | * 1 - work in slotted mode | ||
3838 | * 0 - work in non slotted mode | ||
3839 | * bit4: filter beacon notification | ||
3840 | * bit5: full tx slotted mode. if this flag is set, | ||
3841 | * uCode will perform leaving channel methods in context switch | ||
3842 | * also when working in same channel mode | ||
3843 | * @num_slots: 1 - 10 | ||
3844 | */ | ||
3845 | struct iwl_wipan_params_cmd { | ||
3846 | __le16 flags; | ||
3847 | u8 reserved; | ||
3848 | u8 num_slots; | ||
3849 | struct iwl_wipan_slot slots[10]; | ||
3850 | } __packed; | ||
3851 | |||
3852 | /* | ||
3853 | * REPLY_WIPAN_P2P_CHANNEL_SWITCH = 0xb9 | ||
3854 | * | ||
3855 | * TODO: Figure out what this is used for, | ||
3856 | * it can only switch between 2.4 GHz | ||
3857 | * channels!! | ||
3858 | */ | ||
3859 | |||
3860 | struct iwl_wipan_p2p_channel_switch_cmd { | ||
3861 | __le16 channel; | ||
3862 | __le16 reserved; | ||
3863 | }; | ||
3864 | |||
3865 | /* | ||
3866 | * REPLY_WIPAN_NOA_NOTIFICATION = 0xbc | ||
3867 | * | ||
3868 | * This is used by the device to notify us of the | ||
3869 | * NoA schedule it determined so we can forward it | ||
3870 | * to userspace for inclusion in probe responses. | ||
3871 | * | ||
3872 | * In beacons, the NoA schedule is simply appended | ||
3873 | * to the frame we give the device. | ||
3874 | */ | ||
3875 | |||
3876 | struct iwl_wipan_noa_descriptor { | ||
3877 | u8 count; | ||
3878 | __le32 duration; | ||
3879 | __le32 interval; | ||
3880 | __le32 starttime; | ||
3881 | } __packed; | ||
3882 | |||
3883 | struct iwl_wipan_noa_attribute { | ||
3884 | u8 id; | ||
3885 | __le16 length; | ||
3886 | u8 index; | ||
3887 | u8 ct_window; | ||
3888 | struct iwl_wipan_noa_descriptor descr0, descr1; | ||
3889 | u8 reserved; | ||
3890 | } __packed; | ||
3891 | |||
3892 | struct iwl_wipan_noa_notification { | ||
3893 | u32 noa_active; | ||
3894 | struct iwl_wipan_noa_attribute noa_attribute; | ||
3895 | } __packed; | ||
3896 | |||
4003 | #endif /* __iwl_commands_h__ */ | 3897 | #endif /* __iwl_commands_h__ */ |