1 /******************************************************************************
3 * This file is provided under a dual BSD/GPLv2 license. When using or
4 * redistributing this file, you may do so under either license.
8 * Copyright(c) 2005 - 2007 Intel Corporation. All rights reserved.
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of version 2 of the GNU Geeral Public License as
12 * published by the Free Software Foundation.
14 * This program is distributed in the hope that it will be useful, but
15 * WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110,
24 * The full GNU General Public License is included in this distribution
25 * in the file called LICENSE.GPL.
27 * Contact Information:
28 * James P. Ketrenos <ipw2100-admin@linux.intel.com>
29 * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
33 * Copyright(c) 2005 - 2007 Intel Corporation. All rights reserved.
34 * All rights reserved.
36 * Redistribution and use in source and binary forms, with or without
37 * modification, are permitted provided that the following conditions
40 * * Redistributions of source code must retain the above copyright
41 * notice, this list of conditions and the following disclaimer.
42 * * Redistributions in binary form must reproduce the above copyright
43 * notice, this list of conditions and the following disclaimer in
44 * the documentation and/or other materials provided with the
46 * * Neither the name Intel Corporation nor the names of its
47 * contributors may be used to endorse or promote products derived
48 * from this software without specific prior written permission.
50 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
51 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
52 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
53 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
54 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
55 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
56 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
57 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
58 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
59 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
60 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
62 *****************************************************************************/
64 #ifndef __iwl_commands_h__
65 #define __iwl_commands_h__
71 /* RXON and QOS commands */
73 REPLY_RXON_ASSOC
= 0x11,
74 REPLY_QOS_PARAM
= 0x13,
75 REPLY_RXON_TIMING
= 0x14,
77 /* Multi-Station support */
79 REPLY_REMOVE_STA
= 0x19, /* not used */
80 REPLY_REMOVE_ALL_STA
= 0x1a, /* not used */
84 REPLY_3945_RX
= 0x1b, /* 3945 only */
87 REPLY_RATE_SCALE
= 0x47, /* 3945 only */
88 REPLY_LEDS_CMD
= 0x48,
89 REPLY_TX_LINK_QUALITY_CMD
= 0x4e, /* 4965 only */
92 RADAR_NOTIFICATION
= 0x70, /* not used */
93 REPLY_QUIET_CMD
= 0x71, /* not used */
94 REPLY_CHANNEL_SWITCH
= 0x72,
95 CHANNEL_SWITCH_NOTIFICATION
= 0x73,
96 REPLY_SPECTRUM_MEASUREMENT_CMD
= 0x74,
97 SPECTRUM_MEASURE_NOTIFICATION
= 0x75,
99 /* Power Management */
100 POWER_TABLE_CMD
= 0x77,
101 PM_SLEEP_NOTIFICATION
= 0x7A,
102 PM_DEBUG_STATISTIC_NOTIFIC
= 0x7B,
104 /* Scan commands and notifications */
105 REPLY_SCAN_CMD
= 0x80,
106 REPLY_SCAN_ABORT_CMD
= 0x81,
107 SCAN_START_NOTIFICATION
= 0x82,
108 SCAN_RESULTS_NOTIFICATION
= 0x83,
109 SCAN_COMPLETE_NOTIFICATION
= 0x84,
111 /* IBSS/AP commands */
112 BEACON_NOTIFICATION
= 0x90,
113 REPLY_TX_BEACON
= 0x91,
114 WHO_IS_AWAKE_NOTIFICATION
= 0x94, /* not used */
116 /* Miscellaneous commands */
117 QUIET_NOTIFICATION
= 0x96, /* not used */
118 REPLY_TX_PWR_TABLE_CMD
= 0x97,
119 MEASURE_ABORT_NOTIFICATION
= 0x99, /* not used */
121 /* BT config command */
122 REPLY_BT_CONFIG
= 0x9b,
124 /* 4965 Statistics */
125 REPLY_STATISTICS_CMD
= 0x9c,
126 STATISTICS_NOTIFICATION
= 0x9d,
128 /* RF-KILL commands and notifications */
129 REPLY_CARD_STATE_CMD
= 0xa0,
130 CARD_STATE_NOTIFICATION
= 0xa1,
132 /* Missed beacons notification */
133 MISSED_BEACONS_NOTIFICATION
= 0xa2,
136 REPLY_CT_KILL_CONFIG_CMD
= 0xa4,
137 SENSITIVITY_CMD
= 0xa8,
138 REPLY_PHY_CALIBRATION_CMD
= 0xb0,
139 REPLY_RX_PHY_CMD
= 0xc0,
140 REPLY_RX_MPDU_CMD
= 0xc1,
141 REPLY_4965_RX
= 0xc3,
142 REPLY_COMPRESSED_BA
= 0xc5,
147 /******************************************************************************
151 *****************************************************************************/
153 #define IWL_CMD_FAILED_MSK 0x40
155 struct iwl_cmd_header
{
158 /* We have 15 LSB to use as we please (MSB indicates
159 * a frame Rx'd from the HW). We encode the following
160 * information into the sequence field:
163 * 8:13 fifo selection
164 * 14:14 bit indicating if this packet references the 'extra'
165 * storage at the end of the memory queue
166 * 15:15 (Rx indication)
171 /* command data follows immediately */
173 } __attribute__ ((packed
));
175 /******************************************************************************
177 * Alive and Error Commands & Responses:
179 *****************************************************************************/
181 #define UCODE_VALID_OK __constant_cpu_to_le32(0x1)
182 #define INITIALIZE_SUBTYPE (9)
185 * REPLY_ALIVE = 0x1 (response only, not a command)
187 struct iwl_alive_resp
{
195 __le32 log_event_table_ptr
;
196 __le32 error_event_table_ptr
;
199 } __attribute__ ((packed
));
201 struct iwl_init_alive_resp
{
209 __le32 log_event_table_ptr
;
210 __le32 error_event_table_ptr
;
215 /* calibration values from "initialize" uCode */
216 __le32 voltage
; /* signed */
217 __le32 therm_r1
[2]; /* signed 1st for normal, 2nd for FAT channel */
218 __le32 therm_r2
[2]; /* signed */
219 __le32 therm_r3
[2]; /* signed */
220 __le32 therm_r4
[2]; /* signed */
221 __le32 tx_atten
[5][2]; /* signed MIMO gain comp, 5 freq groups,
224 } __attribute__ ((packed
));
233 * REPLY_ERROR = 0x2 (response only, not a command)
235 struct iwl_error_resp
{
239 __le16 bad_cmd_seq_num
;
245 } __attribute__ ((packed
));
247 /******************************************************************************
249 * RXON Commands & Responses:
251 *****************************************************************************/
254 * Rx config defines & structure
256 /* rx_config device types */
258 RXON_DEV_TYPE_AP
= 1,
259 RXON_DEV_TYPE_ESS
= 3,
260 RXON_DEV_TYPE_IBSS
= 4,
261 RXON_DEV_TYPE_SNIFFER
= 6,
264 /* rx_config flags */
265 /* band & modulation selection */
266 #define RXON_FLG_BAND_24G_MSK __constant_cpu_to_le32(1 << 0)
267 #define RXON_FLG_CCK_MSK __constant_cpu_to_le32(1 << 1)
268 /* auto detection enable */
269 #define RXON_FLG_AUTO_DETECT_MSK __constant_cpu_to_le32(1 << 2)
270 /* TGg protection when tx */
271 #define RXON_FLG_TGG_PROTECT_MSK __constant_cpu_to_le32(1 << 3)
272 /* cck short slot & preamble */
273 #define RXON_FLG_SHORT_SLOT_MSK __constant_cpu_to_le32(1 << 4)
274 #define RXON_FLG_SHORT_PREAMBLE_MSK __constant_cpu_to_le32(1 << 5)
275 /* antenna selection */
276 #define RXON_FLG_DIS_DIV_MSK __constant_cpu_to_le32(1 << 7)
277 #define RXON_FLG_ANT_SEL_MSK __constant_cpu_to_le32(0x0f00)
278 #define RXON_FLG_ANT_A_MSK __constant_cpu_to_le32(1 << 8)
279 #define RXON_FLG_ANT_B_MSK __constant_cpu_to_le32(1 << 9)
280 /* radar detection enable */
281 #define RXON_FLG_RADAR_DETECT_MSK __constant_cpu_to_le32(1 << 12)
282 #define RXON_FLG_TGJ_NARROW_BAND_MSK __constant_cpu_to_le32(1 << 13)
283 /* rx response to host with 8-byte TSF
284 * (according to ON_AIR deassertion) */
285 #define RXON_FLG_TSF2HOST_MSK __constant_cpu_to_le32(1 << 15)
287 /* rx_config filter flags */
288 /* accept all data frames */
289 #define RXON_FILTER_PROMISC_MSK __constant_cpu_to_le32(1 << 0)
290 /* pass control & management to host */
291 #define RXON_FILTER_CTL2HOST_MSK __constant_cpu_to_le32(1 << 1)
292 /* accept multi-cast */
293 #define RXON_FILTER_ACCEPT_GRP_MSK __constant_cpu_to_le32(1 << 2)
294 /* don't decrypt uni-cast frames */
295 #define RXON_FILTER_DIS_DECRYPT_MSK __constant_cpu_to_le32(1 << 3)
296 /* don't decrypt multi-cast frames */
297 #define RXON_FILTER_DIS_GRP_DECRYPT_MSK __constant_cpu_to_le32(1 << 4)
298 /* STA is associated */
299 #define RXON_FILTER_ASSOC_MSK __constant_cpu_to_le32(1 << 5)
300 /* transfer to host non bssid beacons in associated state */
301 #define RXON_FILTER_BCON_AWARE_MSK __constant_cpu_to_le32(1 << 6)
304 * REPLY_RXON = 0x10 (command, has simple generic response)
306 struct iwl_rxon_cmd
{
311 u8 wlap_bssid_addr
[6];
329 u8 ofdm_ht_single_stream_basic_rates
;
330 u8 ofdm_ht_dual_stream_basic_rates
;
332 } __attribute__ ((packed
));
335 * REPLY_RXON_ASSOC = 0x11 (command, has simple generic response)
337 struct iwl_rxon_assoc_cmd
{
343 u8 ofdm_ht_single_stream_basic_rates
;
344 u8 ofdm_ht_dual_stream_basic_rates
;
345 __le16 rx_chain_select_flags
;
348 } __attribute__ ((packed
));
351 * REPLY_RXON_TIMING = 0x14 (command, has simple generic response)
353 struct iwl_rxon_time_cmd
{
355 __le16 beacon_interval
;
357 __le32 beacon_init_val
;
358 __le16 listen_interval
;
360 } __attribute__ ((packed
));
362 struct iwl_tx_power
{
363 u8 tx_gain
; /* gain for analog radio */
364 u8 dsp_atten
; /* gain for DSP */
365 } __attribute__ ((packed
));
368 struct iwl_power_per_rate
{
370 struct iwl_tx_power tpc
;
372 } __attribute__ ((packed
));
375 #define POWER_TABLE_NUM_ENTRIES 33
376 #define POWER_TABLE_NUM_HT_OFDM_ENTRIES 32
377 #define POWER_TABLE_CCK_ENTRY 32
378 struct tx_power_dual_stream
{
380 } __attribute__ ((packed
));
382 struct iwl_tx_power_db
{
383 struct tx_power_dual_stream power_tbl
[POWER_TABLE_NUM_ENTRIES
];
384 } __attribute__ ((packed
));
388 * REPLY_CHANNEL_SWITCH = 0x72 (command, has simple generic response)
390 struct iwl_channel_switch_cmd
{
395 __le32 rxon_filter_flags
;
398 struct iwl_power_per_rate power
[IWL_MAX_RATES
];
400 struct iwl_tx_power_db tx_power
;
402 } __attribute__ ((packed
));
405 * CHANNEL_SWITCH_NOTIFICATION = 0x73 (notification only, not a command)
407 struct iwl_csa_notification
{
410 __le32 status
; /* 0 - OK, 1 - fail */
411 } __attribute__ ((packed
));
413 /******************************************************************************
415 * Quality-of-Service (QOS) Commands & Responses:
417 *****************************************************************************/
424 } __attribute__ ((packed
));
426 /* QoS flags defines */
427 #define QOS_PARAM_FLG_UPDATE_EDCA_MSK __constant_cpu_to_le32(0x01)
428 #define QOS_PARAM_FLG_TGN_MSK __constant_cpu_to_le32(0x02)
429 #define QOS_PARAM_FLG_TXOP_TYPE_MSK __constant_cpu_to_le32(0x10)
432 * TXFIFO Queue number defines
434 /* number of Access categories (AC) (EDCA), queues 0..3 */
438 * REPLY_QOS_PARAM = 0x13 (command, has simple generic response)
440 struct iwl_qosparam_cmd
{
442 struct iwl_ac_qos ac
[AC_NUM
];
443 } __attribute__ ((packed
));
445 /******************************************************************************
447 * Add/Modify Stations Commands & Responses:
449 *****************************************************************************/
451 * Multi station support
454 #define IWL_MULTICAST_ID 1
457 #define IWL3945_BROADCAST_ID 24
458 #define IWL3945_STATION_COUNT 25
460 #define IWL4965_BROADCAST_ID 31
461 #define IWL4965_STATION_COUNT 32
463 #define IWL_STATION_COUNT 32 /* MAX(3945,4965)*/
464 #define IWL_INVALID_STATION 255
467 #define STA_FLG_TX_RATE_MSK __constant_cpu_to_le32(1<<2);
469 #define STA_FLG_PWR_SAVE_MSK __constant_cpu_to_le32(1<<8);
471 #define STA_CONTROL_MODIFY_MSK 0x01
473 /* key flags __le16*/
474 #define STA_KEY_FLG_ENCRYPT_MSK __constant_cpu_to_le16(0x7)
475 #define STA_KEY_FLG_NO_ENC __constant_cpu_to_le16(0x0)
476 #define STA_KEY_FLG_WEP __constant_cpu_to_le16(0x1)
477 #define STA_KEY_FLG_CCMP __constant_cpu_to_le16(0x2)
478 #define STA_KEY_FLG_TKIP __constant_cpu_to_le16(0x3)
480 #define STA_KEY_FLG_KEYID_POS 8
481 #define STA_KEY_FLG_INVALID __constant_cpu_to_le16(0x0800)
484 #define STA_MODIFY_KEY_MASK 0x01
485 #define STA_MODIFY_TID_DISABLE_TX 0x02
486 #define STA_MODIFY_TX_RATE_MSK 0x04
487 #define STA_MODIFY_ADDBA_TID_MSK 0x08
488 #define STA_MODIFY_DELBA_TID_MSK 0x10
489 #define BUILD_RAxTID(sta_id, tid) (((sta_id) << 4) + (tid))
493 * bit14:15 01 B inactive, A active
494 * 10 B active, A inactive
497 #define RATE_MCS_ANT_A_POS 14
498 #define RATE_MCS_ANT_B_POS 15
499 #define RATE_MCS_ANT_A_MSK 0x4000
500 #define RATE_MCS_ANT_B_MSK 0x8000
501 #define RATE_MCS_ANT_AB_MSK 0xc000
505 u8 tkip_rx_tsc_byte2
; /* TSC[2] for key mix ph1 detection */
507 __le16 tkip_rx_ttak
[5]; /* 10-byte unicast TKIP TTAK */
509 u8 key
[16]; /* 16-byte unicast decryption key */
510 } __attribute__ ((packed
));
512 struct sta_id_modify
{
518 } __attribute__ ((packed
));
521 * REPLY_ADD_STA = 0x18 (command)
523 struct iwl_addsta_cmd
{
526 struct sta_id_modify sta
;
527 struct iwl_keyinfo key
;
528 __le32 station_flags
;
529 __le32 station_flags_msk
;
530 __le16 tid_disable_tx
;
536 u8 add_immediate_ba_tid
;
537 u8 remove_immediate_ba_tid
;
538 __le16 add_immediate_ba_ssn
;
542 } __attribute__ ((packed
));
545 * REPLY_ADD_STA = 0x18 (response)
547 struct iwl_add_sta_resp
{
549 } __attribute__ ((packed
));
551 #define ADD_STA_SUCCESS_MSK 0x1
553 /******************************************************************************
557 *****************************************************************************/
559 struct iwl_rx_frame_stats
{
567 } __attribute__ ((packed
));
569 struct iwl_rx_frame_hdr
{
576 } __attribute__ ((packed
));
578 #define RX_RES_STATUS_NO_CRC32_ERROR __constant_cpu_to_le32(1 << 0)
579 #define RX_RES_STATUS_NO_RXE_OVERFLOW __constant_cpu_to_le32(1 << 1)
581 #define RX_RES_PHY_FLAGS_BAND_24_MSK __constant_cpu_to_le16(1 << 0)
582 #define RX_RES_PHY_FLAGS_MOD_CCK_MSK __constant_cpu_to_le16(1 << 1)
583 #define RX_RES_PHY_FLAGS_SHORT_PREAMBLE_MSK __constant_cpu_to_le16(1 << 2)
584 #define RX_RES_PHY_FLAGS_NARROW_BAND_MSK __constant_cpu_to_le16(1 << 3)
585 #define RX_RES_PHY_FLAGS_ANTENNA_MSK __constant_cpu_to_le16(0xf0)
587 #define RX_RES_STATUS_SEC_TYPE_MSK (0x7 << 8)
588 #define RX_RES_STATUS_SEC_TYPE_NONE (0x0 << 8)
589 #define RX_RES_STATUS_SEC_TYPE_WEP (0x1 << 8)
590 #define RX_RES_STATUS_SEC_TYPE_CCMP (0x2 << 8)
591 #define RX_RES_STATUS_SEC_TYPE_TKIP (0x3 << 8)
593 #define RX_RES_STATUS_DECRYPT_TYPE_MSK (0x3 << 11)
594 #define RX_RES_STATUS_NOT_DECRYPT (0x0 << 11)
595 #define RX_RES_STATUS_DECRYPT_OK (0x3 << 11)
596 #define RX_RES_STATUS_BAD_ICV_MIC (0x1 << 11)
597 #define RX_RES_STATUS_BAD_KEY_TTAK (0x2 << 11)
599 struct iwl_rx_frame_end
{
602 __le32 beacon_timestamp
;
603 } __attribute__ ((packed
));
606 * REPLY_3945_RX = 0x1b (response only, not a command)
608 * NOTE: DO NOT dereference from casts to this structure
609 * It is provided only for calculating minimum data set size.
610 * The actual offsets of the hdr and end are dynamic based on
613 struct iwl_rx_frame
{
614 struct iwl_rx_frame_stats stats
;
615 struct iwl_rx_frame_hdr hdr
;
616 struct iwl_rx_frame_end end
;
617 } __attribute__ ((packed
));
619 /* Fixed (non-configurable) rx data from phy */
620 #define RX_PHY_FLAGS_ANTENNAE_OFFSET (4)
621 #define RX_PHY_FLAGS_ANTENNAE_MASK (0x70)
622 #define IWL_AGC_DB_MASK (0x3f80) /* MASK(7,13) */
623 #define IWL_AGC_DB_POS (7)
624 struct iwl4965_rx_non_cfg_phy
{
625 __le16 ant_selection
; /* ant A bit 4, ant B bit 5, ant C bit 6 */
626 __le16 agc_info
; /* agc code 0:6, agc dB 7:13, reserved 14:15 */
627 u8 rssi_info
[6]; /* we use even entries, 0/2/4 for A/B/C rssi */
629 } __attribute__ ((packed
));
632 * REPLY_4965_RX = 0xc3 (response only, not a command)
633 * Used only for legacy (non 11n) frames.
635 #define RX_RES_PHY_CNT 14
636 struct iwl4965_rx_phy_res
{
637 u8 non_cfg_phy_cnt
; /* non configurable DSP phy data byte count */
638 u8 cfg_phy_cnt
; /* configurable DSP phy data byte count */
639 u8 stat_id
; /* configurable DSP phy data set ID */
641 __le64 timestamp
; /* TSF at on air rise */
642 __le32 beacon_time_stamp
; /* beacon at on-air rise */
643 __le16 phy_flags
; /* general phy flags: band, modulation, ... */
644 __le16 channel
; /* channel number */
645 __le16 non_cfg_phy
[RX_RES_PHY_CNT
]; /* upto 14 phy entries */
648 __le16 byte_count
; /* frame's byte-count */
650 } __attribute__ ((packed
));
652 struct iwl4965_rx_mpdu_res_start
{
655 } __attribute__ ((packed
));
658 /******************************************************************************
660 * Tx Commands & Responses:
662 *****************************************************************************/
665 #define TX_CMD_FLG_RTS_MSK __constant_cpu_to_le32(1 << 1)
666 #define TX_CMD_FLG_CTS_MSK __constant_cpu_to_le32(1 << 2)
667 #define TX_CMD_FLG_ACK_MSK __constant_cpu_to_le32(1 << 3)
668 #define TX_CMD_FLG_STA_RATE_MSK __constant_cpu_to_le32(1 << 4)
669 #define TX_CMD_FLG_IMM_BA_RSP_MASK __constant_cpu_to_le32(1 << 6)
670 #define TX_CMD_FLG_FULL_TXOP_PROT_MSK __constant_cpu_to_le32(1 << 7)
671 #define TX_CMD_FLG_ANT_SEL_MSK __constant_cpu_to_le32(0xf00)
672 #define TX_CMD_FLG_ANT_A_MSK __constant_cpu_to_le32(1 << 8)
673 #define TX_CMD_FLG_ANT_B_MSK __constant_cpu_to_le32(1 << 9)
675 /* ucode ignores BT priority for this frame */
676 #define TX_CMD_FLG_BT_DIS_MSK __constant_cpu_to_le32(1 << 12)
678 /* ucode overrides sequence control */
679 #define TX_CMD_FLG_SEQ_CTL_MSK __constant_cpu_to_le32(1 << 13)
681 /* signal that this frame is non-last MPDU */
682 #define TX_CMD_FLG_MORE_FRAG_MSK __constant_cpu_to_le32(1 << 14)
684 /* calculate TSF in outgoing frame */
685 #define TX_CMD_FLG_TSF_MSK __constant_cpu_to_le32(1 << 16)
687 /* activate TX calibration. */
688 #define TX_CMD_FLG_CALIB_MSK __constant_cpu_to_le32(1 << 17)
690 /* signals that 2 bytes pad was inserted
691 after the MAC header */
692 #define TX_CMD_FLG_MH_PAD_MSK __constant_cpu_to_le32(1 << 20)
694 /* HCCA-AP - disable duration overwriting. */
695 #define TX_CMD_FLG_DUR_MSK __constant_cpu_to_le32(1 << 25)
698 * TX command security control
700 #define TX_CMD_SEC_WEP 0x01
701 #define TX_CMD_SEC_CCM 0x02
702 #define TX_CMD_SEC_TKIP 0x03
703 #define TX_CMD_SEC_MSK 0x03
704 #define TX_CMD_SEC_SHIFT 6
705 #define TX_CMD_SEC_KEY128 0x08
708 * TX command Frame life time
711 struct iwl_dram_scratch
{
715 } __attribute__ ((packed
));
718 * REPLY_TX = 0x1c (command)
722 __le16 next_frame_len
;
729 struct iwl_dram_scratch scratch
;
735 u8 initial_rate_index
;
745 __le32 next_frame_info
;
747 __le16 next_frame_flags
;
760 u8 rts_retry_limit
; /*byte 50 */
761 u8 data_retry_limit
; /*byte 51 */
766 __le16 pm_frame_timeout
;
767 __le16 attempt_duration
;
771 struct ieee80211_hdr hdr
[0];
772 } __attribute__ ((packed
));
774 /* TX command response is sent after *all* transmission attempts.
778 * TX_STATUS_FAIL_NEXT_FRAG
780 * If the fragment flag in the MAC header for the frame being transmitted
781 * is set and there is insufficient time to transmit the next frame, the
782 * TX status will be returned with 'TX_STATUS_FAIL_NEXT_FRAG'.
784 * TX_STATUS_FIFO_UNDERRUN
786 * Indicates the host did not provide bytes to the FIFO fast enough while
787 * a TX was in progress.
789 * TX_STATUS_FAIL_MGMNT_ABORT
791 * This status is only possible if the ABORT ON MGMT RX parameter was
792 * set to true with the TX command.
794 * If the MSB of the status parameter is set then an abort sequence is
795 * required. This sequence consists of the host activating the TX Abort
796 * control line, and then waiting for the TX Abort command response. This
797 * indicates that a the device is no longer in a transmit state, and that the
798 * command FIFO has been cleared. The host must then deactivate the TX Abort
799 * control line. Receiving is still allowed in this case.
802 TX_STATUS_SUCCESS
= 0x01,
803 TX_STATUS_DIRECT_DONE
= 0x02,
804 TX_STATUS_FAIL_SHORT_LIMIT
= 0x82,
805 TX_STATUS_FAIL_LONG_LIMIT
= 0x83,
806 TX_STATUS_FAIL_FIFO_UNDERRUN
= 0x84,
807 TX_STATUS_FAIL_MGMNT_ABORT
= 0x85,
808 TX_STATUS_FAIL_NEXT_FRAG
= 0x86,
809 TX_STATUS_FAIL_LIFE_EXPIRE
= 0x87,
810 TX_STATUS_FAIL_DEST_PS
= 0x88,
811 TX_STATUS_FAIL_ABORTED
= 0x89,
812 TX_STATUS_FAIL_BT_RETRY
= 0x8a,
813 TX_STATUS_FAIL_STA_INVALID
= 0x8b,
814 TX_STATUS_FAIL_FRAG_DROPPED
= 0x8c,
815 TX_STATUS_FAIL_TID_DISABLE
= 0x8d,
816 TX_STATUS_FAIL_FRAME_FLUSHED
= 0x8e,
817 TX_STATUS_FAIL_INSUFFICIENT_CF_POLL
= 0x8f,
818 TX_STATUS_FAIL_TX_LOCKED
= 0x90,
819 TX_STATUS_FAIL_NO_BEACON_ON_RADAR
= 0x91,
822 #define TX_PACKET_MODE_REGULAR 0x0000
823 #define TX_PACKET_MODE_BURST_SEQ 0x0100
824 #define TX_PACKET_MODE_BURST_FIRST 0x0200
827 TX_POWER_PA_NOT_ACTIVE
= 0x0,
831 TX_STATUS_MSK
= 0x000000ff, /* bits 0:7 */
832 TX_STATUS_DELAY_MSK
= 0x00000040,
833 TX_STATUS_ABORT_MSK
= 0x00000080,
834 TX_PACKET_MODE_MSK
= 0x0000ff00, /* bits 8:15 */
835 TX_FIFO_NUMBER_MSK
= 0x00070000, /* bits 16:18 */
836 TX_RESERVED
= 0x00780000, /* bits 19:22 */
837 TX_POWER_PA_DETECT_MSK
= 0x7f800000, /* bits 23:30 */
838 TX_ABORT_REQUIRED_MSK
= 0x80000000, /* bits 31:31 */
841 /* *******************************
842 * TX aggregation state
843 ******************************* */
846 AGG_TX_STATE_TRANSMITTED
= 0x00,
847 AGG_TX_STATE_UNDERRUN_MSK
= 0x01,
848 AGG_TX_STATE_BT_PRIO_MSK
= 0x02,
849 AGG_TX_STATE_FEW_BYTES_MSK
= 0x04,
850 AGG_TX_STATE_ABORT_MSK
= 0x08,
851 AGG_TX_STATE_LAST_SENT_TTL_MSK
= 0x10,
852 AGG_TX_STATE_LAST_SENT_TRY_CNT_MSK
= 0x20,
853 AGG_TX_STATE_LAST_SENT_BT_KILL_MSK
= 0x40,
854 AGG_TX_STATE_SCD_QUERY_MSK
= 0x80,
855 AGG_TX_STATE_TEST_BAD_CRC32_MSK
= 0x100,
856 AGG_TX_STATE_RESPONSE_MSK
= 0x1ff,
857 AGG_TX_STATE_DUMP_TX_MSK
= 0x200,
858 AGG_TX_STATE_DELAY_TX_MSK
= 0x400
861 #define AGG_TX_STATE_LAST_SENT_MSK \
862 (AGG_TX_STATE_LAST_SENT_TTL_MSK | \
863 AGG_TX_STATE_LAST_SENT_TRY_CNT_MSK | \
864 AGG_TX_STATE_LAST_SENT_BT_KILL_MSK)
866 #define AGG_TX_STATE_TRY_CNT_POS 12
867 #define AGG_TX_STATE_TRY_CNT_MSK 0xf000
869 #define AGG_TX_STATE_SEQ_NUM_POS 16
870 #define AGG_TX_STATE_SEQ_NUM_MSK 0xffff0000
873 * REPLY_TX = 0x1c (response)
877 u8 frame_count
; /* 1 no aggregation, >1 aggregation */
882 __le16 wireless_media_time
;
886 __le32 status
; /* TX status (for aggregation status of 1st frame) */
887 } __attribute__ ((packed
));
895 __le32 wireless_media_time
;
896 __le32 status
; /* TX status (for aggregation status of 1st frame) */
897 } __attribute__ ((packed
));
901 * REPLY_COMPRESSED_BA = 0xc5 (response only, not a command)
903 struct iwl_compressed_ba_resp
{
904 __le32 sta_addr_lo32
;
905 __le16 sta_addr_hi16
;
914 } __attribute__ ((packed
));
917 * REPLY_TX_PWR_TABLE_CMD = 0x97 (command, has simple generic response)
919 struct iwl_txpowertable_cmd
{
920 u8 band
; /* 0: 5 GHz, 1: 2.4 GHz */
924 struct iwl_power_per_rate power
[IWL_MAX_RATES
];
926 struct iwl_tx_power_db tx_power
;
928 } __attribute__ ((packed
));
931 struct iwl_rate_scaling_info
{
935 } __attribute__ ((packed
));
938 * struct iwl_rate_scaling_cmd - Rate Scaling Command & Response
940 * REPLY_RATE_SCALE = 0x47 (command, has simple generic response)
942 * NOTE: The table of rates passed to the uCode via the
943 * RATE_SCALE command sets up the corresponding order of
944 * rates used for all related commands, including rate
947 * For example, if you set 9MB (PLCP 0x0f) as the first
948 * rate in the rate table, the bit mask for that rate
949 * when passed through ofdm_basic_rates on the REPLY_RXON
950 * command would be bit 0 (1<<0)
952 struct iwl_rate_scaling_cmd
{
955 struct iwl_rate_scaling_info table
[IWL_MAX_RATES
];
956 } __attribute__ ((packed
));
960 /*RS_NEW_API: only TLC_RTS remains and moved to bit 0 */
961 #define LINK_QUAL_FLAGS_SET_STA_TLC_RTS_MSK (1<<0)
963 #define LINK_QUAL_AC_NUM AC_NUM
964 #define LINK_QUAL_MAX_RETRY_NUM 16
966 #define LINK_QUAL_ANT_A_MSK (1<<0)
967 #define LINK_QUAL_ANT_B_MSK (1<<1)
968 #define LINK_QUAL_ANT_MSK (LINK_QUAL_ANT_A_MSK|LINK_QUAL_ANT_B_MSK)
970 struct iwl_link_qual_general_params
{
973 u8 single_stream_ant_msk
;
974 u8 dual_stream_ant_msk
;
975 u8 start_rate_index
[LINK_QUAL_AC_NUM
];
976 } __attribute__ ((packed
));
978 struct iwl_link_qual_agg_params
{
979 __le16 agg_time_limit
;
981 u8 agg_frame_cnt_limit
;
983 } __attribute__ ((packed
));
986 * REPLY_TX_LINK_QUALITY_CMD = 0x4e (command, has simple generic response)
988 struct iwl_link_quality_cmd
{
992 struct iwl_link_qual_general_params general_params
;
993 struct iwl_link_qual_agg_params agg_params
;
996 } rs_table
[LINK_QUAL_MAX_RETRY_NUM
];
998 } __attribute__ ((packed
));
1002 * REPLY_BT_CONFIG = 0x9b (command, has simple generic response)
1009 __le32 kill_ack_mask
;
1010 __le32 kill_cts_mask
;
1011 } __attribute__ ((packed
));
1013 /******************************************************************************
1015 * Spectrum Management (802.11h) Commands, Responses, Notifications:
1017 *****************************************************************************/
1020 * Spectrum Management
1022 #define MEASUREMENT_FILTER_FLAG (RXON_FILTER_PROMISC_MSK | \
1023 RXON_FILTER_CTL2HOST_MSK | \
1024 RXON_FILTER_ACCEPT_GRP_MSK | \
1025 RXON_FILTER_DIS_DECRYPT_MSK | \
1026 RXON_FILTER_DIS_GRP_DECRYPT_MSK | \
1027 RXON_FILTER_ASSOC_MSK | \
1028 RXON_FILTER_BCON_AWARE_MSK)
1030 struct iwl_measure_channel
{
1031 __le32 duration
; /* measurement duration in extended beacon
1033 u8 channel
; /* channel to measure */
1034 u8 type
; /* see enum iwl_measure_type */
1036 } __attribute__ ((packed
));
1039 * REPLY_SPECTRUM_MEASUREMENT_CMD = 0x74 (command)
1041 struct iwl_spectrum_cmd
{
1042 __le16 len
; /* number of bytes starting from token */
1043 u8 token
; /* token id */
1044 u8 id
; /* measurement id -- 0 or 1 */
1045 u8 origin
; /* 0 = TGh, 1 = other, 2 = TGk */
1046 u8 periodic
; /* 1 = periodic */
1047 __le16 path_loss_timeout
;
1048 __le32 start_time
; /* start time in extended beacon format */
1050 __le32 flags
; /* rxon flags */
1051 __le32 filter_flags
; /* rxon filter flags */
1052 __le16 channel_count
; /* minimum 1, maximum 10 */
1054 struct iwl_measure_channel channels
[10];
1055 } __attribute__ ((packed
));
1058 * REPLY_SPECTRUM_MEASUREMENT_CMD = 0x74 (response)
1060 struct iwl_spectrum_resp
{
1062 u8 id
; /* id of the prior command replaced, or 0xff */
1063 __le16 status
; /* 0 - command will be handled
1064 * 1 - cannot handle (conflicts with another
1066 } __attribute__ ((packed
));
1068 enum iwl_measurement_state
{
1069 IWL_MEASUREMENT_START
= 0,
1070 IWL_MEASUREMENT_STOP
= 1,
1073 enum iwl_measurement_status
{
1074 IWL_MEASUREMENT_OK
= 0,
1075 IWL_MEASUREMENT_CONCURRENT
= 1,
1076 IWL_MEASUREMENT_CSA_CONFLICT
= 2,
1077 IWL_MEASUREMENT_TGH_CONFLICT
= 3,
1079 IWL_MEASUREMENT_STOPPED
= 6,
1080 IWL_MEASUREMENT_TIMEOUT
= 7,
1081 IWL_MEASUREMENT_PERIODIC_FAILED
= 8,
1084 #define NUM_ELEMENTS_IN_HISTOGRAM 8
1086 struct iwl_measurement_histogram
{
1087 __le32 ofdm
[NUM_ELEMENTS_IN_HISTOGRAM
]; /* in 0.8usec counts */
1088 __le32 cck
[NUM_ELEMENTS_IN_HISTOGRAM
]; /* in 1usec counts */
1089 } __attribute__ ((packed
));
1091 /* clear channel availability counters */
1092 struct iwl_measurement_cca_counters
{
1095 } __attribute__ ((packed
));
1097 enum iwl_measure_type
{
1098 IWL_MEASURE_BASIC
= (1 << 0),
1099 IWL_MEASURE_CHANNEL_LOAD
= (1 << 1),
1100 IWL_MEASURE_HISTOGRAM_RPI
= (1 << 2),
1101 IWL_MEASURE_HISTOGRAM_NOISE
= (1 << 3),
1102 IWL_MEASURE_FRAME
= (1 << 4),
1103 /* bits 5:6 are reserved */
1104 IWL_MEASURE_IDLE
= (1 << 7),
1108 * SPECTRUM_MEASURE_NOTIFICATION = 0x75 (notification only, not a command)
1110 struct iwl_spectrum_notification
{
1111 u8 id
; /* measurement id -- 0 or 1 */
1113 u8 channel_index
; /* index in measurement channel list */
1114 u8 state
; /* 0 - start, 1 - stop */
1115 __le32 start_time
; /* lower 32-bits of TSF */
1116 u8 band
; /* 0 - 5.2GHz, 1 - 2.4GHz */
1118 u8 type
; /* see enum iwl_measurement_type */
1120 /* NOTE: cca_ofdm, cca_cck, basic_type, and histogram are only only
1121 * valid if applicable for measurement type requested. */
1122 __le32 cca_ofdm
; /* cca fraction time in 40Mhz clock periods */
1123 __le32 cca_cck
; /* cca fraction time in 44Mhz clock periods */
1124 __le32 cca_time
; /* channel load time in usecs */
1125 u8 basic_type
; /* 0 - bss, 1 - ofdm preamble, 2 -
1128 struct iwl_measurement_histogram histogram
;
1129 __le32 stop_time
; /* lower 32-bits of TSF */
1130 __le32 status
; /* see iwl_measurement_status */
1131 } __attribute__ ((packed
));
1133 /******************************************************************************
1135 * Power Management Commands, Responses, Notifications:
1137 *****************************************************************************/
1140 * struct iwl_powertable_cmd - Power Table Command
1141 * @flags: See below:
1143 * POWER_TABLE_CMD = 0x77 (command, has simple generic response)
1146 * bit 0 - '0' Driver not allow power management
1147 * '1' Driver allow PM (use rest of parameters)
1148 * uCode send sleep notifications:
1149 * bit 1 - '0' Don't send sleep notification
1150 * '1' send sleep notification (SEND_PM_NOTIFICATION)
1152 * bit 2 - '0' PM have to walk up every DTIM
1153 * '1' PM could sleep over DTIM till listen Interval.
1155 * bit 3 - '0' (PCI_LINK_CTRL & 0x1)
1156 * '1' !(PCI_LINK_CTRL & 0x1)
1158 * bit 31/30- '00' use both mac/xtal sleeps
1159 * '01' force Mac sleep
1160 * '10' force xtal sleep
1163 * NOTE: if sleep_interval[SLEEP_INTRVL_TABLE_SIZE-1] > DTIM period then
1164 * ucode assume sleep over DTIM is allowed and we don't need to wakeup
1167 #define IWL_POWER_VEC_SIZE 5
1172 #define IWL_POWER_DRIVER_ALLOW_SLEEP_MSK __constant_cpu_to_le32(1<<0)
1173 #define IWL_POWER_SLEEP_OVER_DTIM_MSK __constant_cpu_to_le32(1<<2)
1174 #define IWL_POWER_PCI_PM_MSK __constant_cpu_to_le32(1<<3)
1175 struct iwl_powertable_cmd
{
1177 __le32 rx_data_timeout
;
1178 __le32 tx_data_timeout
;
1179 __le32 sleep_interval
[IWL_POWER_VEC_SIZE
];
1180 } __attribute__((packed
));
1184 #define IWL_POWER_DRIVER_ALLOW_SLEEP_MSK __constant_cpu_to_le16(1<<0)
1185 #define IWL_POWER_SLEEP_OVER_DTIM_MSK __constant_cpu_to_le16(1<<2)
1186 #define IWL_POWER_PCI_PM_MSK __constant_cpu_to_le16(1<<3)
1188 struct iwl_powertable_cmd
{
1190 u8 keep_alive_seconds
;
1192 __le32 rx_data_timeout
;
1193 __le32 tx_data_timeout
;
1194 __le32 sleep_interval
[IWL_POWER_VEC_SIZE
];
1195 __le32 keep_alive_beacons
;
1196 } __attribute__ ((packed
));
1200 * PM_SLEEP_NOTIFICATION = 0x7A (notification only, not a command)
1201 * 3945 and 4965 identical.
1203 struct iwl_sleep_notification
{
1210 } __attribute__ ((packed
));
1212 /* Sleep states. 3945 and 4965 identical. */
1214 IWL_PM_NO_SLEEP
= 0,
1216 IWL_PM_SLP_FULL_MAC_UNASSOCIATE
= 2,
1217 IWL_PM_SLP_FULL_MAC_CARD_STATE
= 3,
1219 IWL_PM_SLP_REPENT
= 5,
1220 IWL_PM_WAKEUP_BY_TIMER
= 6,
1221 IWL_PM_WAKEUP_BY_DRIVER
= 7,
1222 IWL_PM_WAKEUP_BY_RFKILL
= 8,
1224 IWL_PM_NUM_OF_MODES
= 12,
1228 * REPLY_CARD_STATE_CMD = 0xa0 (command, has simple generic response)
1230 #define CARD_STATE_CMD_DISABLE 0x00 /* Put card to sleep */
1231 #define CARD_STATE_CMD_ENABLE 0x01 /* Wake up card */
1232 #define CARD_STATE_CMD_HALT 0x02 /* Power down permanently */
1233 struct iwl_card_state_cmd
{
1234 __le32 status
; /* CARD_STATE_CMD_* request new power state */
1235 } __attribute__ ((packed
));
1238 * CARD_STATE_NOTIFICATION = 0xa1 (notification only, not a command)
1240 struct iwl_card_state_notif
{
1242 } __attribute__ ((packed
));
1244 #define HW_CARD_DISABLED 0x01
1245 #define SW_CARD_DISABLED 0x02
1246 #define RF_CARD_DISABLED 0x04
1247 #define RXON_CARD_DISABLED 0x10
1249 struct iwl_ct_kill_config
{
1251 __le32 critical_temperature_M
;
1252 __le32 critical_temperature_R
;
1253 } __attribute__ ((packed
));
1255 /******************************************************************************
1257 * Scan Commands, Responses, Notifications:
1259 *****************************************************************************/
1261 struct iwl_scan_channel
{
1262 /* type is defined as:
1263 * 0:0 active (0 - passive)
1265 * If 1 is set then corresponding SSID IE is transmitted in probe
1270 struct iwl_tx_power tpc
;
1271 __le16 active_dwell
;
1272 __le16 passive_dwell
;
1273 } __attribute__ ((packed
));
1275 struct iwl_ssid_ie
{
1279 } __attribute__ ((packed
));
1281 #define PROBE_OPTION_MAX 0x4
1282 #define TX_CMD_LIFE_TIME_INFINITE __constant_cpu_to_le32(0xFFFFFFFF)
1283 #define IWL_GOOD_CRC_TH __constant_cpu_to_le16(1)
1284 #define IWL_MAX_SCAN_SIZE 1024
1287 * REPLY_SCAN_CMD = 0x80 (command)
1289 struct iwl_scan_cmd
{
1293 __le16 quiet_time
; /* dwell only this long on quiet chnl
1295 __le16 quiet_plcp_th
; /* quiet chnl is < this # pkts (typ. 1) */
1296 __le16 good_CRC_th
; /* passive -> active promotion threshold */
1302 __le32 max_out_time
; /* max usec to be out of associated (service)
1304 __le32 suspend_time
; /* pause scan this long when returning to svc
1306 * 3945 -- 31:24 # beacons, 19:0 additional usec,
1307 * 4965 -- 31:22 # beacons, 21:0 additional usec.
1310 __le32 filter_flags
;
1312 struct iwl_tx_cmd tx_cmd
;
1313 struct iwl_ssid_ie direct_scan
[PROBE_OPTION_MAX
];
1317 * The channels start after the probe request payload and are of type:
1319 * struct iwl_scan_channel channels[0];
1321 * NOTE: Only one band of channels can be scanned per pass. You
1322 * can not mix 2.4GHz channels and 5.2GHz channels and must
1323 * request a scan multiple times (not concurrently)
1326 } __attribute__ ((packed
));
1328 /* Can abort will notify by complete notification with abort status. */
1329 #define CAN_ABORT_STATUS __constant_cpu_to_le32(0x1)
1330 /* complete notification statuses */
1331 #define ABORT_STATUS 0x2
1334 * REPLY_SCAN_CMD = 0x80 (response)
1336 struct iwl_scanreq_notification
{
1337 __le32 status
; /* 1: okay, 2: cannot fulfill request */
1338 } __attribute__ ((packed
));
1341 * SCAN_START_NOTIFICATION = 0x82 (notification only, not a command)
1343 struct iwl_scanstart_notification
{
1346 __le32 beacon_timer
;
1351 } __attribute__ ((packed
));
1353 #define SCAN_OWNER_STATUS 0x1;
1354 #define MEASURE_OWNER_STATUS 0x2;
1356 #define NUMBER_OF_STATISTICS 1 /* first __le32 is good CRC */
1358 * SCAN_RESULTS_NOTIFICATION = 0x83 (notification only, not a command)
1360 struct iwl_scanresults_notification
{
1366 __le32 statistics
[NUMBER_OF_STATISTICS
];
1367 } __attribute__ ((packed
));
1370 * SCAN_COMPLETE_NOTIFICATION = 0x84 (notification only, not a command)
1372 struct iwl_scancomplete_notification
{
1373 u8 scanned_channels
;
1379 } __attribute__ ((packed
));
1382 /******************************************************************************
1384 * IBSS/AP Commands and Notifications:
1386 *****************************************************************************/
1389 * BEACON_NOTIFICATION = 0x90 (notification only, not a command)
1391 struct iwl_beacon_notif
{
1392 struct iwl_tx_resp beacon_notify_hdr
;
1395 __le32 ibss_mgr_status
;
1396 } __attribute__ ((packed
));
1399 * REPLY_TX_BEACON = 0x91 (command, has simple generic response)
1401 struct iwl_tx_beacon_cmd
{
1402 struct iwl_tx_cmd tx
;
1406 struct ieee80211_hdr frame
[0]; /* beacon frame */
1407 } __attribute__ ((packed
));
1409 /******************************************************************************
1411 * Statistics Commands and Notifications:
1413 *****************************************************************************/
1415 #define IWL_TEMP_CONVERT 260
1417 #define SUP_RATE_11A_MAX_NUM_CHANNELS 8
1418 #define SUP_RATE_11B_MAX_NUM_CHANNELS 4
1419 #define SUP_RATE_11G_MAX_NUM_CHANNELS 12
1421 /* Used for passing to driver number of successes and failures per rate */
1422 struct rate_histogram
{
1424 __le32 a
[SUP_RATE_11A_MAX_NUM_CHANNELS
];
1425 __le32 b
[SUP_RATE_11B_MAX_NUM_CHANNELS
];
1426 __le32 g
[SUP_RATE_11G_MAX_NUM_CHANNELS
];
1429 __le32 a
[SUP_RATE_11A_MAX_NUM_CHANNELS
];
1430 __le32 b
[SUP_RATE_11B_MAX_NUM_CHANNELS
];
1431 __le32 g
[SUP_RATE_11G_MAX_NUM_CHANNELS
];
1433 } __attribute__ ((packed
));
1435 /* statistics command response */
1437 struct statistics_rx_phy
{
1443 __le32 early_overrun_err
;
1445 __le32 false_alarm_cnt
;
1446 __le32 fina_sync_err_cnt
;
1448 __le32 fina_timeout
;
1449 __le32 unresponded_rts
;
1450 __le32 rxe_frame_limit_overrun
;
1451 __le32 sent_ack_cnt
;
1452 __le32 sent_cts_cnt
;
1454 __le32 sent_ba_rsp_cnt
;
1455 __le32 dsp_self_kill
;
1456 __le32 mh_format_err
;
1457 __le32 re_acq_main_rssi_sum
;
1460 } __attribute__ ((packed
));
1463 struct statistics_rx_ht_phy
{
1466 __le32 early_overrun_err
;
1469 __le32 mh_format_err
;
1470 __le32 agg_crc32_good
;
1471 __le32 agg_mpdu_cnt
;
1474 } __attribute__ ((packed
));
1477 struct statistics_rx_non_phy
{
1478 __le32 bogus_cts
; /* CTS received when not expecting CTS */
1479 __le32 bogus_ack
; /* ACK received when not expecting ACK */
1480 __le32 non_bssid_frames
; /* number of frames with BSSID that
1481 * doesn't belong to the STA BSSID */
1482 __le32 filtered_frames
; /* count frames that were dumped in the
1483 * filtering process */
1484 __le32 non_channel_beacons
; /* beacons with our bss id but not on
1485 * our serving channel */
1487 __le32 channel_beacons
; /* beacons with our bss id and in our
1488 * serving channel */
1489 __le32 num_missed_bcon
; /* number of missed beacons */
1490 __le32 adc_rx_saturation_time
; /* count in 0.8us units the time the
1491 * ADC was in saturation */
1492 __le32 ina_detection_search_time
;/* total time (in 0.8us) searched
1494 __le32 beacon_silence_rssi_a
; /* RSSI silence after beacon frame */
1495 __le32 beacon_silence_rssi_b
; /* RSSI silence after beacon frame */
1496 __le32 beacon_silence_rssi_c
; /* RSSI silence after beacon frame */
1497 __le32 interference_data_flag
; /* flag for interference data
1498 * availability. 1 when data is
1500 __le32 channel_load
; /* counts RX Enable time */
1501 __le32 dsp_false_alarms
; /* DSP false alarm (both OFDM
1502 * and CCK) counter */
1503 __le32 beacon_rssi_a
;
1504 __le32 beacon_rssi_b
;
1505 __le32 beacon_rssi_c
;
1506 __le32 beacon_energy_a
;
1507 __le32 beacon_energy_b
;
1508 __le32 beacon_energy_c
;
1510 } __attribute__ ((packed
));
1512 struct statistics_rx
{
1513 struct statistics_rx_phy ofdm
;
1514 struct statistics_rx_phy cck
;
1515 struct statistics_rx_non_phy general
;
1517 struct statistics_rx_ht_phy ofdm_ht
;
1519 } __attribute__ ((packed
));
1522 struct statistics_tx_non_phy_agg
{
1524 __le32 ba_reschedule_frames
;
1525 __le32 scd_query_agg_frame_cnt
;
1526 __le32 scd_query_no_agg
;
1527 __le32 scd_query_agg
;
1528 __le32 scd_query_mismatch
;
1529 __le32 frame_not_ready
;
1531 __le32 bt_prio_kill
;
1532 __le32 rx_ba_rsp_cnt
;
1535 } __attribute__ ((packed
));
1538 struct statistics_tx
{
1539 __le32 preamble_cnt
;
1540 __le32 rx_detected_cnt
;
1541 __le32 bt_prio_defer_cnt
;
1542 __le32 bt_prio_kill_cnt
;
1543 __le32 few_bytes_cnt
;
1546 __le32 expected_ack_cnt
;
1547 __le32 actual_ack_cnt
;
1549 __le32 dump_msdu_cnt
;
1550 __le32 burst_abort_next_frame_mismatch_cnt
;
1551 __le32 burst_abort_missing_next_frame_cnt
;
1552 __le32 cts_timeout_collision
;
1553 __le32 ack_or_ba_timeout_collision
;
1554 struct statistics_tx_non_phy_agg agg
;
1556 } __attribute__ ((packed
));
1558 struct statistics_dbg
{
1562 } __attribute__ ((packed
));
1564 struct statistics_div
{
1573 } __attribute__ ((packed
));
1575 struct statistics_general
{
1578 __le32 temperature_m
;
1580 struct statistics_dbg dbg
;
1584 __le32 ttl_timestamp
;
1585 struct statistics_div div
;
1587 __le32 rx_enable_counter
;
1592 } __attribute__ ((packed
));
1595 * REPLY_STATISTICS_CMD = 0x9c,
1596 * 3945 and 4965 identical.
1598 * This command triggers an immediate response containing uCode statistics.
1599 * The response is in the same format as STATISTICS_NOTIFICATION 0x9d, below.
1601 * If the CLEAR_STATS configuration flag is set, uCode will clear its
1602 * internal copy of the statistics (counters) after issuing the response.
1603 * This flag does not affect STATISTICS_NOTIFICATIONs after beacons (see below).
1605 * If the DISABLE_NOTIF configuration flag is set, uCode will not issue
1606 * STATISTICS_NOTIFICATIONs after received beacons (see below). This flag
1607 * does not affect the response to the REPLY_STATISTICS_CMD 0x9c itself.
1609 #define IWL_STATS_CONF_CLEAR_STATS __constant_cpu_to_le32(0x1) /* see above */
1610 #define IWL_STATS_CONF_DISABLE_NOTIF __constant_cpu_to_le32(0x2)/* see above */
1611 struct iwl_statistics_cmd
{
1612 __le32 configuration_flags
; /* IWL_STATS_CONF_* */
1613 } __attribute__ ((packed
));
1616 * STATISTICS_NOTIFICATION = 0x9d (notification only, not a command)
1618 * By default, uCode issues this notification after receiving a beacon
1619 * while associated. To disable this behavior, set DISABLE_NOTIF flag in the
1620 * REPLY_STATISTICS_CMD 0x9c, above.
1622 * Statistics counters continue to increment beacon after beacon, but are
1623 * cleared when changing channels or when driver issues REPLY_STATISTICS_CMD
1624 * 0x9c with CLEAR_STATS bit set (see above).
1626 * uCode also issues this notification during scans. uCode clears statistics
1627 * appropriately so that each notification contains statistics for only the
1628 * one channel that has just been scanned.
1630 #define STATISTICS_REPLY_FLG_BAND_24G_MSK __constant_cpu_to_le32(0x2)
1631 #define STATISTICS_REPLY_FLG_FAT_MODE_MSK __constant_cpu_to_le32(0x8)
1632 struct iwl_notif_statistics
{
1634 struct statistics_rx rx
;
1635 struct statistics_tx tx
;
1636 struct statistics_general general
;
1637 } __attribute__ ((packed
));
1641 * MISSED_BEACONS_NOTIFICATION = 0xa2 (notification only, not a command)
1643 /* if ucode missed CONSECUTIVE_MISSED_BCONS_TH beacons in a row,
1644 * then this notification will be sent. */
1645 #define CONSECUTIVE_MISSED_BCONS_TH 20
1647 struct iwl_missed_beacon_notif
{
1648 __le32 consequtive_missed_beacons
;
1649 __le32 total_missed_becons
;
1650 __le32 num_expected_beacons
;
1651 __le32 num_recvd_beacons
;
1652 } __attribute__ ((packed
));
1654 /******************************************************************************
1656 * Rx Calibration Commands:
1658 *****************************************************************************/
1660 #define PHY_CALIBRATE_DIFF_GAIN_CMD (7)
1661 #define HD_TABLE_SIZE (11)
1663 struct iwl_sensitivity_cmd
{
1665 __le16 table
[HD_TABLE_SIZE
];
1666 } __attribute__ ((packed
));
1668 struct iwl_calibration_cmd
{
1676 } __attribute__ ((packed
));
1678 /******************************************************************************
1680 * Miscellaneous Commands:
1682 *****************************************************************************/
1685 * LEDs Command & Response
1686 * REPLY_LEDS_CMD = 0x48 (command, has simple generic response)
1688 * For each of 3 possible LEDs (Activity/Link/Tech, selected by "id" field),
1689 * this command turns it on or off, or sets up a periodic blinking cycle.
1691 struct iwl_led_cmd
{
1692 __le32 interval
; /* "interval" in uSec */
1693 u8 id
; /* 1: Activity, 2: Link, 3: Tech */
1694 u8 off
; /* # intervals off while blinking;
1695 * "0", with >0 "on" value, turns LED on */
1696 u8 on
; /* # intervals on while blinking;
1697 * "0", regardless of "off", turns LED off */
1699 } __attribute__ ((packed
));
1701 /******************************************************************************
1703 * Union of all expected notifications/responses:
1705 *****************************************************************************/
1707 struct iwl_rx_packet
{
1709 struct iwl_cmd_header hdr
;
1711 struct iwl_alive_resp alive_frame
;
1712 struct iwl_rx_frame rx_frame
;
1713 struct iwl_tx_resp tx_resp
;
1714 struct iwl_spectrum_notification spectrum_notif
;
1715 struct iwl_csa_notification csa_notif
;
1716 struct iwl_error_resp err_resp
;
1717 struct iwl_card_state_notif card_state_notif
;
1718 struct iwl_beacon_notif beacon_status
;
1719 struct iwl_add_sta_resp add_sta
;
1720 struct iwl_sleep_notification sleep_notif
;
1721 struct iwl_spectrum_resp spectrum
;
1722 struct iwl_notif_statistics stats
;
1724 struct iwl_compressed_ba_resp compressed_ba
;
1725 struct iwl_missed_beacon_notif missed_beacon
;
1730 } __attribute__ ((packed
));
1732 #define IWL_RX_FRAME_SIZE (4 + sizeof(struct iwl_rx_frame))
1734 #endif /* __iwl_commands_h__ */