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 General 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 * Please use this file (iwl-3945-commands.h) only for uCode API definitions.
65 * Please use iwl-3945-hw.h for hardware-related definitions.
66 * Please use iwl-3945.h for driver implementation definitions.
69 #ifndef __iwl_3945_commands_h__
70 #define __iwl_3945_commands_h__
76 /* RXON and QOS commands */
78 REPLY_RXON_ASSOC
= 0x11,
79 REPLY_QOS_PARAM
= 0x13,
80 REPLY_RXON_TIMING
= 0x14,
82 /* Multi-Station support */
84 REPLY_REMOVE_STA
= 0x19, /* not used */
85 REPLY_REMOVE_ALL_STA
= 0x1a, /* not used */
88 REPLY_3945_RX
= 0x1b, /* 3945 only */
90 REPLY_RATE_SCALE
= 0x47, /* 3945 only */
91 REPLY_LEDS_CMD
= 0x48,
92 REPLY_TX_LINK_QUALITY_CMD
= 0x4e, /* 4965 only */
95 RADAR_NOTIFICATION
= 0x70, /* not used */
96 REPLY_QUIET_CMD
= 0x71, /* not used */
97 REPLY_CHANNEL_SWITCH
= 0x72,
98 CHANNEL_SWITCH_NOTIFICATION
= 0x73,
99 REPLY_SPECTRUM_MEASUREMENT_CMD
= 0x74,
100 SPECTRUM_MEASURE_NOTIFICATION
= 0x75,
102 /* Power Management */
103 POWER_TABLE_CMD
= 0x77,
104 PM_SLEEP_NOTIFICATION
= 0x7A,
105 PM_DEBUG_STATISTIC_NOTIFIC
= 0x7B,
107 /* Scan commands and notifications */
108 REPLY_SCAN_CMD
= 0x80,
109 REPLY_SCAN_ABORT_CMD
= 0x81,
110 SCAN_START_NOTIFICATION
= 0x82,
111 SCAN_RESULTS_NOTIFICATION
= 0x83,
112 SCAN_COMPLETE_NOTIFICATION
= 0x84,
114 /* IBSS/AP commands */
115 BEACON_NOTIFICATION
= 0x90,
116 REPLY_TX_BEACON
= 0x91,
117 WHO_IS_AWAKE_NOTIFICATION
= 0x94, /* not used */
119 /* Miscellaneous commands */
120 QUIET_NOTIFICATION
= 0x96, /* not used */
121 REPLY_TX_PWR_TABLE_CMD
= 0x97,
122 MEASURE_ABORT_NOTIFICATION
= 0x99, /* not used */
124 /* Bluetooth device coexistance config command */
125 REPLY_BT_CONFIG
= 0x9b,
127 /* 4965 Statistics */
128 REPLY_STATISTICS_CMD
= 0x9c,
129 STATISTICS_NOTIFICATION
= 0x9d,
131 /* RF-KILL commands and notifications */
132 REPLY_CARD_STATE_CMD
= 0xa0,
133 CARD_STATE_NOTIFICATION
= 0xa1,
135 /* Missed beacons notification */
136 MISSED_BEACONS_NOTIFICATION
= 0xa2,
141 /******************************************************************************
145 *****************************************************************************/
147 /* iwl3945_cmd_header flags value */
148 #define IWL_CMD_FAILED_MSK 0x40
151 * struct iwl3945_cmd_header
153 * This header format appears in the beginning of each command sent from the
154 * driver, and each response/notification received from uCode.
156 struct iwl3945_cmd_header
{
157 u8 cmd
; /* Command ID: REPLY_RXON, etc. */
158 u8 flags
; /* IWL_CMD_* */
160 * The driver sets up the sequence number to values of its chosing.
161 * uCode does not use this value, but passes it back to the driver
162 * when sending the response to each driver-originated command, so
163 * the driver can match the response to the command. Since the values
164 * don't get used by uCode, the driver may set up an arbitrary format.
166 * There is one exception: uCode sets bit 15 when it originates
167 * the response/notification, i.e. when the response/notification
168 * is not a direct response to a command sent by the driver. For
169 * example, uCode issues REPLY_3945_RX when it sends a received frame
170 * to the driver; it is not a direct response to any driver command.
172 * The Linux driver uses the following format:
174 * 0:7 index/position within Tx queue
175 * 8:13 Tx queue selection
176 * 14:14 driver sets this to indicate command is in the 'huge'
177 * storage at the end of the command buffers, i.e. scan cmd
178 * 15:15 uCode sets this in uCode-originated response/notification
182 /* command or response/notification data follows immediately */
184 } __attribute__ ((packed
));
186 /******************************************************************************
188 * Alive and Error Commands & Responses:
190 *****************************************************************************/
192 #define UCODE_VALID_OK __constant_cpu_to_le32(0x1)
193 #define INITIALIZE_SUBTYPE (9)
196 * ("Initialize") REPLY_ALIVE = 0x1 (response only, not a command)
198 * uCode issues this "initialize alive" notification once the initialization
199 * uCode image has completed its work, and is ready to load the runtime image.
200 * This is the *first* "alive" notification that the driver will receive after
201 * rebooting uCode; the "initialize" alive is indicated by subtype field == 9.
203 * See comments documenting "BSM" (bootstrap state machine).
205 struct iwl3945_init_alive_resp
{
211 u8 ver_subtype
; /* "9" for initialize alive */
213 __le32 log_event_table_ptr
;
214 __le32 error_event_table_ptr
;
217 } __attribute__ ((packed
));
221 * REPLY_ALIVE = 0x1 (response only, not a command)
223 * uCode issues this "alive" notification once the runtime image is ready
224 * to receive commands from the driver. This is the *second* "alive"
225 * notification that the driver will receive after rebooting uCode;
226 * this "alive" is indicated by subtype field != 9.
228 * See comments documenting "BSM" (bootstrap state machine).
230 * This response includes two pointers to structures within the device's
231 * data SRAM (access via HBUS_TARG_MEM_* regs) that are useful for debugging:
233 * 1) log_event_table_ptr indicates base of the event log. This traces
234 * a 256-entry history of uCode execution within a circular buffer.
236 * 2) error_event_table_ptr indicates base of the error log. This contains
237 * information about any uCode error that occurs.
239 * The Linux driver can print both logs to the system log when a uCode error
242 struct iwl3945_alive_resp
{
248 u8 ver_subtype
; /* not "9" for runtime alive */
250 __le32 log_event_table_ptr
; /* SRAM address for event log */
251 __le32 error_event_table_ptr
; /* SRAM address for error log */
254 } __attribute__ ((packed
));
263 * REPLY_ERROR = 0x2 (response only, not a command)
265 struct iwl3945_error_resp
{
269 __le16 bad_cmd_seq_num
;
273 } __attribute__ ((packed
));
275 /******************************************************************************
277 * RXON Commands & Responses:
279 *****************************************************************************/
282 * Rx config defines & structure
284 /* rx_config device types */
286 RXON_DEV_TYPE_AP
= 1,
287 RXON_DEV_TYPE_ESS
= 3,
288 RXON_DEV_TYPE_IBSS
= 4,
289 RXON_DEV_TYPE_SNIFFER
= 6,
292 /* rx_config flags */
293 /* band & modulation selection */
294 #define RXON_FLG_BAND_24G_MSK __constant_cpu_to_le32(1 << 0)
295 #define RXON_FLG_CCK_MSK __constant_cpu_to_le32(1 << 1)
296 /* auto detection enable */
297 #define RXON_FLG_AUTO_DETECT_MSK __constant_cpu_to_le32(1 << 2)
298 /* TGg protection when tx */
299 #define RXON_FLG_TGG_PROTECT_MSK __constant_cpu_to_le32(1 << 3)
300 /* cck short slot & preamble */
301 #define RXON_FLG_SHORT_SLOT_MSK __constant_cpu_to_le32(1 << 4)
302 #define RXON_FLG_SHORT_PREAMBLE_MSK __constant_cpu_to_le32(1 << 5)
303 /* antenna selection */
304 #define RXON_FLG_DIS_DIV_MSK __constant_cpu_to_le32(1 << 7)
305 #define RXON_FLG_ANT_SEL_MSK __constant_cpu_to_le32(0x0f00)
306 #define RXON_FLG_ANT_A_MSK __constant_cpu_to_le32(1 << 8)
307 #define RXON_FLG_ANT_B_MSK __constant_cpu_to_le32(1 << 9)
308 /* radar detection enable */
309 #define RXON_FLG_RADAR_DETECT_MSK __constant_cpu_to_le32(1 << 12)
310 #define RXON_FLG_TGJ_NARROW_BAND_MSK __constant_cpu_to_le32(1 << 13)
311 /* rx response to host with 8-byte TSF
312 * (according to ON_AIR deassertion) */
313 #define RXON_FLG_TSF2HOST_MSK __constant_cpu_to_le32(1 << 15)
315 /* rx_config filter flags */
316 /* accept all data frames */
317 #define RXON_FILTER_PROMISC_MSK __constant_cpu_to_le32(1 << 0)
318 /* pass control & management to host */
319 #define RXON_FILTER_CTL2HOST_MSK __constant_cpu_to_le32(1 << 1)
320 /* accept multi-cast */
321 #define RXON_FILTER_ACCEPT_GRP_MSK __constant_cpu_to_le32(1 << 2)
322 /* don't decrypt uni-cast frames */
323 #define RXON_FILTER_DIS_DECRYPT_MSK __constant_cpu_to_le32(1 << 3)
324 /* don't decrypt multi-cast frames */
325 #define RXON_FILTER_DIS_GRP_DECRYPT_MSK __constant_cpu_to_le32(1 << 4)
326 /* STA is associated */
327 #define RXON_FILTER_ASSOC_MSK __constant_cpu_to_le32(1 << 5)
328 /* transfer to host non bssid beacons in associated state */
329 #define RXON_FILTER_BCON_AWARE_MSK __constant_cpu_to_le32(1 << 6)
332 * REPLY_RXON = 0x10 (command, has simple generic response)
334 struct iwl3945_rxon_cmd
{
339 u8 wlap_bssid_addr
[6];
351 } __attribute__ ((packed
));
354 * REPLY_RXON_ASSOC = 0x11 (command, has simple generic response)
356 struct iwl3945_rxon_assoc_cmd
{
362 } __attribute__ ((packed
));
365 * REPLY_RXON_TIMING = 0x14 (command, has simple generic response)
367 struct iwl3945_rxon_time_cmd
{
369 __le16 beacon_interval
;
371 __le32 beacon_init_val
;
372 __le16 listen_interval
;
374 } __attribute__ ((packed
));
376 struct iwl3945_tx_power
{
377 u8 tx_gain
; /* gain for analog radio */
378 u8 dsp_atten
; /* gain for DSP */
379 } __attribute__ ((packed
));
381 struct iwl3945_power_per_rate
{
383 struct iwl3945_tx_power tpc
;
385 } __attribute__ ((packed
));
388 * REPLY_CHANNEL_SWITCH = 0x72 (command, has simple generic response)
390 struct iwl3945_channel_switch_cmd
{
395 __le32 rxon_filter_flags
;
397 struct iwl3945_power_per_rate power
[IWL_MAX_RATES
];
398 } __attribute__ ((packed
));
401 * CHANNEL_SWITCH_NOTIFICATION = 0x73 (notification only, not a command)
403 struct iwl3945_csa_notification
{
406 __le32 status
; /* 0 - OK, 1 - fail */
407 } __attribute__ ((packed
));
409 /******************************************************************************
411 * Quality-of-Service (QOS) Commands & Responses:
413 *****************************************************************************/
414 struct iwl3945_ac_qos
{
420 } __attribute__ ((packed
));
422 /* QoS flags defines */
423 #define QOS_PARAM_FLG_UPDATE_EDCA_MSK __constant_cpu_to_le32(0x01)
424 #define QOS_PARAM_FLG_TGN_MSK __constant_cpu_to_le32(0x02)
425 #define QOS_PARAM_FLG_TXOP_TYPE_MSK __constant_cpu_to_le32(0x10)
428 * TXFIFO Queue number defines
430 /* number of Access categories (AC) (EDCA), queues 0..3 */
434 * REPLY_QOS_PARAM = 0x13 (command, has simple generic response)
436 struct iwl3945_qosparam_cmd
{
438 struct iwl3945_ac_qos ac
[AC_NUM
];
439 } __attribute__ ((packed
));
441 /******************************************************************************
443 * Add/Modify Stations Commands & Responses:
445 *****************************************************************************/
447 * Multi station support
450 #define IWL_MULTICAST_ID 1
453 #define IWL3945_BROADCAST_ID 24
454 #define IWL3945_STATION_COUNT 25
456 #define IWL4965_BROADCAST_ID 31
457 #define IWL4965_STATION_COUNT 32
459 #define IWL_STATION_COUNT 32 /* MAX(3945,4965)*/
460 #define IWL_INVALID_STATION 255
462 #define STA_FLG_TX_RATE_MSK __constant_cpu_to_le32(1<<2);
463 #define STA_FLG_PWR_SAVE_MSK __constant_cpu_to_le32(1<<8);
465 #define STA_CONTROL_MODIFY_MSK 0x01
467 /* key flags __le16*/
468 #define STA_KEY_FLG_ENCRYPT_MSK __constant_cpu_to_le16(0x7)
469 #define STA_KEY_FLG_NO_ENC __constant_cpu_to_le16(0x0)
470 #define STA_KEY_FLG_WEP __constant_cpu_to_le16(0x1)
471 #define STA_KEY_FLG_CCMP __constant_cpu_to_le16(0x2)
472 #define STA_KEY_FLG_TKIP __constant_cpu_to_le16(0x3)
474 #define STA_KEY_FLG_KEYID_POS 8
475 #define STA_KEY_FLG_INVALID __constant_cpu_to_le16(0x0800)
478 #define STA_MODIFY_KEY_MASK 0x01
479 #define STA_MODIFY_TID_DISABLE_TX 0x02
480 #define STA_MODIFY_TX_RATE_MSK 0x04
481 #define STA_MODIFY_ADDBA_TID_MSK 0x08
482 #define STA_MODIFY_DELBA_TID_MSK 0x10
483 #define BUILD_RAxTID(sta_id, tid) (((sta_id) << 4) + (tid))
487 * bit14:15 01 B inactive, A active
488 * 10 B active, A inactive
491 #define RATE_MCS_ANT_A_POS 14
492 #define RATE_MCS_ANT_B_POS 15
493 #define RATE_MCS_ANT_A_MSK 0x4000
494 #define RATE_MCS_ANT_B_MSK 0x8000
495 #define RATE_MCS_ANT_AB_MSK 0xc000
497 struct iwl3945_keyinfo
{
499 u8 tkip_rx_tsc_byte2
; /* TSC[2] for key mix ph1 detection */
501 __le16 tkip_rx_ttak
[5]; /* 10-byte unicast TKIP TTAK */
503 u8 key
[16]; /* 16-byte unicast decryption key */
504 } __attribute__ ((packed
));
506 struct sta_id_modify
{
512 } __attribute__ ((packed
));
515 * REPLY_ADD_STA = 0x18 (command)
517 struct iwl3945_addsta_cmd
{
520 struct sta_id_modify sta
;
521 struct iwl3945_keyinfo key
;
522 __le32 station_flags
;
523 __le32 station_flags_msk
;
524 __le16 tid_disable_tx
;
526 u8 add_immediate_ba_tid
;
527 u8 remove_immediate_ba_tid
;
528 __le16 add_immediate_ba_ssn
;
529 } __attribute__ ((packed
));
532 * REPLY_ADD_STA = 0x18 (response)
534 struct iwl3945_add_sta_resp
{
536 } __attribute__ ((packed
));
538 #define ADD_STA_SUCCESS_MSK 0x1
540 /******************************************************************************
544 *****************************************************************************/
546 struct iwl3945_rx_frame_stats
{
554 } __attribute__ ((packed
));
556 struct iwl3945_rx_frame_hdr
{
563 } __attribute__ ((packed
));
565 #define RX_RES_STATUS_NO_CRC32_ERROR __constant_cpu_to_le32(1 << 0)
566 #define RX_RES_STATUS_NO_RXE_OVERFLOW __constant_cpu_to_le32(1 << 1)
568 #define RX_RES_PHY_FLAGS_BAND_24_MSK __constant_cpu_to_le16(1 << 0)
569 #define RX_RES_PHY_FLAGS_MOD_CCK_MSK __constant_cpu_to_le16(1 << 1)
570 #define RX_RES_PHY_FLAGS_SHORT_PREAMBLE_MSK __constant_cpu_to_le16(1 << 2)
571 #define RX_RES_PHY_FLAGS_NARROW_BAND_MSK __constant_cpu_to_le16(1 << 3)
572 #define RX_RES_PHY_FLAGS_ANTENNA_MSK __constant_cpu_to_le16(0xf0)
574 #define RX_RES_STATUS_SEC_TYPE_MSK (0x7 << 8)
575 #define RX_RES_STATUS_SEC_TYPE_NONE (0x0 << 8)
576 #define RX_RES_STATUS_SEC_TYPE_WEP (0x1 << 8)
577 #define RX_RES_STATUS_SEC_TYPE_CCMP (0x2 << 8)
578 #define RX_RES_STATUS_SEC_TYPE_TKIP (0x3 << 8)
580 #define RX_RES_STATUS_DECRYPT_TYPE_MSK (0x3 << 11)
581 #define RX_RES_STATUS_NOT_DECRYPT (0x0 << 11)
582 #define RX_RES_STATUS_DECRYPT_OK (0x3 << 11)
583 #define RX_RES_STATUS_BAD_ICV_MIC (0x1 << 11)
584 #define RX_RES_STATUS_BAD_KEY_TTAK (0x2 << 11)
586 struct iwl3945_rx_frame_end
{
589 __le32 beacon_timestamp
;
590 } __attribute__ ((packed
));
593 * REPLY_3945_RX = 0x1b (response only, not a command)
595 * NOTE: DO NOT dereference from casts to this structure
596 * It is provided only for calculating minimum data set size.
597 * The actual offsets of the hdr and end are dynamic based on
600 struct iwl3945_rx_frame
{
601 struct iwl3945_rx_frame_stats stats
;
602 struct iwl3945_rx_frame_hdr hdr
;
603 struct iwl3945_rx_frame_end end
;
604 } __attribute__ ((packed
));
606 /* Fixed (non-configurable) rx data from phy */
607 #define RX_PHY_FLAGS_ANTENNAE_OFFSET (4)
608 #define RX_PHY_FLAGS_ANTENNAE_MASK (0x70)
609 #define IWL_AGC_DB_MASK (0x3f80) /* MASK(7,13) */
610 #define IWL_AGC_DB_POS (7)
611 struct iwl4965_rx_non_cfg_phy
{
612 __le16 ant_selection
; /* ant A bit 4, ant B bit 5, ant C bit 6 */
613 __le16 agc_info
; /* agc code 0:6, agc dB 7:13, reserved 14:15 */
614 u8 rssi_info
[6]; /* we use even entries, 0/2/4 for A/B/C rssi */
616 } __attribute__ ((packed
));
619 * REPLY_4965_RX = 0xc3 (response only, not a command)
620 * Used only for legacy (non 11n) frames.
622 #define RX_RES_PHY_CNT 14
623 struct iwl4965_rx_phy_res
{
624 u8 non_cfg_phy_cnt
; /* non configurable DSP phy data byte count */
625 u8 cfg_phy_cnt
; /* configurable DSP phy data byte count */
626 u8 stat_id
; /* configurable DSP phy data set ID */
628 __le64 timestamp
; /* TSF at on air rise */
629 __le32 beacon_time_stamp
; /* beacon at on-air rise */
630 __le16 phy_flags
; /* general phy flags: band, modulation, ... */
631 __le16 channel
; /* channel number */
632 __le16 non_cfg_phy
[RX_RES_PHY_CNT
]; /* upto 14 phy entries */
635 __le16 byte_count
; /* frame's byte-count */
637 } __attribute__ ((packed
));
639 struct iwl4965_rx_mpdu_res_start
{
642 } __attribute__ ((packed
));
645 /******************************************************************************
647 * Tx Commands & Responses:
649 *****************************************************************************/
652 #define TX_CMD_FLG_RTS_MSK __constant_cpu_to_le32(1 << 1)
653 #define TX_CMD_FLG_CTS_MSK __constant_cpu_to_le32(1 << 2)
654 #define TX_CMD_FLG_ACK_MSK __constant_cpu_to_le32(1 << 3)
655 #define TX_CMD_FLG_STA_RATE_MSK __constant_cpu_to_le32(1 << 4)
656 #define TX_CMD_FLG_IMM_BA_RSP_MASK __constant_cpu_to_le32(1 << 6)
657 #define TX_CMD_FLG_FULL_TXOP_PROT_MSK __constant_cpu_to_le32(1 << 7)
658 #define TX_CMD_FLG_ANT_SEL_MSK __constant_cpu_to_le32(0xf00)
659 #define TX_CMD_FLG_ANT_A_MSK __constant_cpu_to_le32(1 << 8)
660 #define TX_CMD_FLG_ANT_B_MSK __constant_cpu_to_le32(1 << 9)
662 /* ucode ignores BT priority for this frame */
663 #define TX_CMD_FLG_BT_DIS_MSK __constant_cpu_to_le32(1 << 12)
665 /* ucode overrides sequence control */
666 #define TX_CMD_FLG_SEQ_CTL_MSK __constant_cpu_to_le32(1 << 13)
668 /* signal that this frame is non-last MPDU */
669 #define TX_CMD_FLG_MORE_FRAG_MSK __constant_cpu_to_le32(1 << 14)
671 /* calculate TSF in outgoing frame */
672 #define TX_CMD_FLG_TSF_MSK __constant_cpu_to_le32(1 << 16)
674 /* activate TX calibration. */
675 #define TX_CMD_FLG_CALIB_MSK __constant_cpu_to_le32(1 << 17)
677 /* signals that 2 bytes pad was inserted
678 after the MAC header */
679 #define TX_CMD_FLG_MH_PAD_MSK __constant_cpu_to_le32(1 << 20)
681 /* HCCA-AP - disable duration overwriting. */
682 #define TX_CMD_FLG_DUR_MSK __constant_cpu_to_le32(1 << 25)
685 * TX command security control
687 #define TX_CMD_SEC_WEP 0x01
688 #define TX_CMD_SEC_CCM 0x02
689 #define TX_CMD_SEC_TKIP 0x03
690 #define TX_CMD_SEC_MSK 0x03
691 #define TX_CMD_SEC_SHIFT 6
692 #define TX_CMD_SEC_KEY128 0x08
695 * TX command Frame life time
698 struct iwl3945_dram_scratch
{
702 } __attribute__ ((packed
));
705 * REPLY_TX = 0x1c (command)
707 struct iwl3945_tx_cmd
{
709 __le16 next_frame_len
;
721 __le32 next_frame_info
;
727 u8 rts_retry_limit
; /*byte 50 */
728 u8 data_retry_limit
; /*byte 51 */
730 __le16 pm_frame_timeout
;
731 __le16 attempt_duration
;
735 struct ieee80211_hdr hdr
[0];
736 } __attribute__ ((packed
));
738 /* TX command response is sent after *all* transmission attempts.
742 * TX_STATUS_FAIL_NEXT_FRAG
744 * If the fragment flag in the MAC header for the frame being transmitted
745 * is set and there is insufficient time to transmit the next frame, the
746 * TX status will be returned with 'TX_STATUS_FAIL_NEXT_FRAG'.
748 * TX_STATUS_FIFO_UNDERRUN
750 * Indicates the host did not provide bytes to the FIFO fast enough while
751 * a TX was in progress.
753 * TX_STATUS_FAIL_MGMNT_ABORT
755 * This status is only possible if the ABORT ON MGMT RX parameter was
756 * set to true with the TX command.
758 * If the MSB of the status parameter is set then an abort sequence is
759 * required. This sequence consists of the host activating the TX Abort
760 * control line, and then waiting for the TX Abort command response. This
761 * indicates that a the device is no longer in a transmit state, and that the
762 * command FIFO has been cleared. The host must then deactivate the TX Abort
763 * control line. Receiving is still allowed in this case.
766 TX_STATUS_SUCCESS
= 0x01,
767 TX_STATUS_DIRECT_DONE
= 0x02,
768 TX_STATUS_FAIL_SHORT_LIMIT
= 0x82,
769 TX_STATUS_FAIL_LONG_LIMIT
= 0x83,
770 TX_STATUS_FAIL_FIFO_UNDERRUN
= 0x84,
771 TX_STATUS_FAIL_MGMNT_ABORT
= 0x85,
772 TX_STATUS_FAIL_NEXT_FRAG
= 0x86,
773 TX_STATUS_FAIL_LIFE_EXPIRE
= 0x87,
774 TX_STATUS_FAIL_DEST_PS
= 0x88,
775 TX_STATUS_FAIL_ABORTED
= 0x89,
776 TX_STATUS_FAIL_BT_RETRY
= 0x8a,
777 TX_STATUS_FAIL_STA_INVALID
= 0x8b,
778 TX_STATUS_FAIL_FRAG_DROPPED
= 0x8c,
779 TX_STATUS_FAIL_TID_DISABLE
= 0x8d,
780 TX_STATUS_FAIL_FRAME_FLUSHED
= 0x8e,
781 TX_STATUS_FAIL_INSUFFICIENT_CF_POLL
= 0x8f,
782 TX_STATUS_FAIL_TX_LOCKED
= 0x90,
783 TX_STATUS_FAIL_NO_BEACON_ON_RADAR
= 0x91,
786 #define TX_PACKET_MODE_REGULAR 0x0000
787 #define TX_PACKET_MODE_BURST_SEQ 0x0100
788 #define TX_PACKET_MODE_BURST_FIRST 0x0200
791 TX_POWER_PA_NOT_ACTIVE
= 0x0,
795 TX_STATUS_MSK
= 0x000000ff, /* bits 0:7 */
796 TX_STATUS_DELAY_MSK
= 0x00000040,
797 TX_STATUS_ABORT_MSK
= 0x00000080,
798 TX_PACKET_MODE_MSK
= 0x0000ff00, /* bits 8:15 */
799 TX_FIFO_NUMBER_MSK
= 0x00070000, /* bits 16:18 */
800 TX_RESERVED
= 0x00780000, /* bits 19:22 */
801 TX_POWER_PA_DETECT_MSK
= 0x7f800000, /* bits 23:30 */
802 TX_ABORT_REQUIRED_MSK
= 0x80000000, /* bits 31:31 */
805 /* *******************************
806 * TX aggregation state
807 ******************************* */
810 AGG_TX_STATE_TRANSMITTED
= 0x00,
811 AGG_TX_STATE_UNDERRUN_MSK
= 0x01,
812 AGG_TX_STATE_BT_PRIO_MSK
= 0x02,
813 AGG_TX_STATE_FEW_BYTES_MSK
= 0x04,
814 AGG_TX_STATE_ABORT_MSK
= 0x08,
815 AGG_TX_STATE_LAST_SENT_TTL_MSK
= 0x10,
816 AGG_TX_STATE_LAST_SENT_TRY_CNT_MSK
= 0x20,
817 AGG_TX_STATE_LAST_SENT_BT_KILL_MSK
= 0x40,
818 AGG_TX_STATE_SCD_QUERY_MSK
= 0x80,
819 AGG_TX_STATE_TEST_BAD_CRC32_MSK
= 0x100,
820 AGG_TX_STATE_RESPONSE_MSK
= 0x1ff,
821 AGG_TX_STATE_DUMP_TX_MSK
= 0x200,
822 AGG_TX_STATE_DELAY_TX_MSK
= 0x400
825 #define AGG_TX_STATE_LAST_SENT_MSK \
826 (AGG_TX_STATE_LAST_SENT_TTL_MSK | \
827 AGG_TX_STATE_LAST_SENT_TRY_CNT_MSK | \
828 AGG_TX_STATE_LAST_SENT_BT_KILL_MSK)
830 #define AGG_TX_STATE_TRY_CNT_POS 12
831 #define AGG_TX_STATE_TRY_CNT_MSK 0xf000
833 #define AGG_TX_STATE_SEQ_NUM_POS 16
834 #define AGG_TX_STATE_SEQ_NUM_MSK 0xffff0000
837 * REPLY_TX = 0x1c (response)
839 struct iwl3945_tx_resp
{
844 __le32 wireless_media_time
;
845 __le32 status
; /* TX status (for aggregation status of 1st frame) */
846 } __attribute__ ((packed
));
849 * REPLY_COMPRESSED_BA = 0xc5 (response only, not a command)
851 struct iwl3945_compressed_ba_resp
{
852 __le32 sta_addr_lo32
;
853 __le16 sta_addr_hi16
;
862 } __attribute__ ((packed
));
865 * REPLY_TX_PWR_TABLE_CMD = 0x97 (command, has simple generic response)
867 struct iwl3945_txpowertable_cmd
{
868 u8 band
; /* 0: 5 GHz, 1: 2.4 GHz */
871 struct iwl3945_power_per_rate power
[IWL_MAX_RATES
];
872 } __attribute__ ((packed
));
874 struct iwl3945_rate_scaling_info
{
878 } __attribute__ ((packed
));
881 * struct iwl3945_rate_scaling_cmd - Rate Scaling Command & Response
883 * REPLY_RATE_SCALE = 0x47 (command, has simple generic response)
885 * NOTE: The table of rates passed to the uCode via the
886 * RATE_SCALE command sets up the corresponding order of
887 * rates used for all related commands, including rate
890 * For example, if you set 9MB (PLCP 0x0f) as the first
891 * rate in the rate table, the bit mask for that rate
892 * when passed through ofdm_basic_rates on the REPLY_RXON
893 * command would be bit 0 (1<<0)
895 struct iwl3945_rate_scaling_cmd
{
898 struct iwl3945_rate_scaling_info table
[IWL_MAX_RATES
];
899 } __attribute__ ((packed
));
902 * REPLY_BT_CONFIG = 0x9b (command, has simple generic response)
904 struct iwl3945_bt_cmd
{
909 __le32 kill_ack_mask
;
910 __le32 kill_cts_mask
;
911 } __attribute__ ((packed
));
913 /******************************************************************************
915 * Spectrum Management (802.11h) Commands, Responses, Notifications:
917 *****************************************************************************/
920 * Spectrum Management
922 #define MEASUREMENT_FILTER_FLAG (RXON_FILTER_PROMISC_MSK | \
923 RXON_FILTER_CTL2HOST_MSK | \
924 RXON_FILTER_ACCEPT_GRP_MSK | \
925 RXON_FILTER_DIS_DECRYPT_MSK | \
926 RXON_FILTER_DIS_GRP_DECRYPT_MSK | \
927 RXON_FILTER_ASSOC_MSK | \
928 RXON_FILTER_BCON_AWARE_MSK)
930 struct iwl3945_measure_channel
{
931 __le32 duration
; /* measurement duration in extended beacon
933 u8 channel
; /* channel to measure */
934 u8 type
; /* see enum iwl3945_measure_type */
936 } __attribute__ ((packed
));
939 * REPLY_SPECTRUM_MEASUREMENT_CMD = 0x74 (command)
941 struct iwl3945_spectrum_cmd
{
942 __le16 len
; /* number of bytes starting from token */
943 u8 token
; /* token id */
944 u8 id
; /* measurement id -- 0 or 1 */
945 u8 origin
; /* 0 = TGh, 1 = other, 2 = TGk */
946 u8 periodic
; /* 1 = periodic */
947 __le16 path_loss_timeout
;
948 __le32 start_time
; /* start time in extended beacon format */
950 __le32 flags
; /* rxon flags */
951 __le32 filter_flags
; /* rxon filter flags */
952 __le16 channel_count
; /* minimum 1, maximum 10 */
954 struct iwl3945_measure_channel channels
[10];
955 } __attribute__ ((packed
));
958 * REPLY_SPECTRUM_MEASUREMENT_CMD = 0x74 (response)
960 struct iwl3945_spectrum_resp
{
962 u8 id
; /* id of the prior command replaced, or 0xff */
963 __le16 status
; /* 0 - command will be handled
964 * 1 - cannot handle (conflicts with another
966 } __attribute__ ((packed
));
968 enum iwl3945_measurement_state
{
969 IWL_MEASUREMENT_START
= 0,
970 IWL_MEASUREMENT_STOP
= 1,
973 enum iwl3945_measurement_status
{
974 IWL_MEASUREMENT_OK
= 0,
975 IWL_MEASUREMENT_CONCURRENT
= 1,
976 IWL_MEASUREMENT_CSA_CONFLICT
= 2,
977 IWL_MEASUREMENT_TGH_CONFLICT
= 3,
979 IWL_MEASUREMENT_STOPPED
= 6,
980 IWL_MEASUREMENT_TIMEOUT
= 7,
981 IWL_MEASUREMENT_PERIODIC_FAILED
= 8,
984 #define NUM_ELEMENTS_IN_HISTOGRAM 8
986 struct iwl3945_measurement_histogram
{
987 __le32 ofdm
[NUM_ELEMENTS_IN_HISTOGRAM
]; /* in 0.8usec counts */
988 __le32 cck
[NUM_ELEMENTS_IN_HISTOGRAM
]; /* in 1usec counts */
989 } __attribute__ ((packed
));
991 /* clear channel availability counters */
992 struct iwl3945_measurement_cca_counters
{
995 } __attribute__ ((packed
));
997 enum iwl3945_measure_type
{
998 IWL_MEASURE_BASIC
= (1 << 0),
999 IWL_MEASURE_CHANNEL_LOAD
= (1 << 1),
1000 IWL_MEASURE_HISTOGRAM_RPI
= (1 << 2),
1001 IWL_MEASURE_HISTOGRAM_NOISE
= (1 << 3),
1002 IWL_MEASURE_FRAME
= (1 << 4),
1003 /* bits 5:6 are reserved */
1004 IWL_MEASURE_IDLE
= (1 << 7),
1008 * SPECTRUM_MEASURE_NOTIFICATION = 0x75 (notification only, not a command)
1010 struct iwl3945_spectrum_notification
{
1011 u8 id
; /* measurement id -- 0 or 1 */
1013 u8 channel_index
; /* index in measurement channel list */
1014 u8 state
; /* 0 - start, 1 - stop */
1015 __le32 start_time
; /* lower 32-bits of TSF */
1016 u8 band
; /* 0 - 5.2GHz, 1 - 2.4GHz */
1018 u8 type
; /* see enum iwl3945_measurement_type */
1020 /* NOTE: cca_ofdm, cca_cck, basic_type, and histogram are only only
1021 * valid if applicable for measurement type requested. */
1022 __le32 cca_ofdm
; /* cca fraction time in 40Mhz clock periods */
1023 __le32 cca_cck
; /* cca fraction time in 44Mhz clock periods */
1024 __le32 cca_time
; /* channel load time in usecs */
1025 u8 basic_type
; /* 0 - bss, 1 - ofdm preamble, 2 -
1028 struct iwl3945_measurement_histogram histogram
;
1029 __le32 stop_time
; /* lower 32-bits of TSF */
1030 __le32 status
; /* see iwl3945_measurement_status */
1031 } __attribute__ ((packed
));
1033 /******************************************************************************
1035 * Power Management Commands, Responses, Notifications:
1037 *****************************************************************************/
1040 * struct iwl3945_powertable_cmd - Power Table Command
1041 * @flags: See below:
1043 * POWER_TABLE_CMD = 0x77 (command, has simple generic response)
1046 * bit 0 - '0' Driver not allow power management
1047 * '1' Driver allow PM (use rest of parameters)
1048 * uCode send sleep notifications:
1049 * bit 1 - '0' Don't send sleep notification
1050 * '1' send sleep notification (SEND_PM_NOTIFICATION)
1052 * bit 2 - '0' PM have to walk up every DTIM
1053 * '1' PM could sleep over DTIM till listen Interval.
1055 * bit 3 - '0' (PCI_LINK_CTRL & 0x1)
1056 * '1' !(PCI_LINK_CTRL & 0x1)
1058 * bit 31/30- '00' use both mac/xtal sleeps
1059 * '01' force Mac sleep
1060 * '10' force xtal sleep
1063 * NOTE: if sleep_interval[SLEEP_INTRVL_TABLE_SIZE-1] > DTIM period then
1064 * ucode assume sleep over DTIM is allowed and we don't need to wakeup
1067 #define IWL_POWER_VEC_SIZE 5
1069 #define IWL_POWER_DRIVER_ALLOW_SLEEP_MSK __constant_cpu_to_le32(1<<0)
1070 #define IWL_POWER_SLEEP_OVER_DTIM_MSK __constant_cpu_to_le32(1<<2)
1071 #define IWL_POWER_PCI_PM_MSK __constant_cpu_to_le32(1<<3)
1072 struct iwl3945_powertable_cmd
{
1074 __le32 rx_data_timeout
;
1075 __le32 tx_data_timeout
;
1076 __le32 sleep_interval
[IWL_POWER_VEC_SIZE
];
1077 } __attribute__((packed
));
1080 * PM_SLEEP_NOTIFICATION = 0x7A (notification only, not a command)
1081 * 3945 and 4965 identical.
1083 struct iwl3945_sleep_notification
{
1090 } __attribute__ ((packed
));
1092 /* Sleep states. 3945 and 4965 identical. */
1094 IWL_PM_NO_SLEEP
= 0,
1096 IWL_PM_SLP_FULL_MAC_UNASSOCIATE
= 2,
1097 IWL_PM_SLP_FULL_MAC_CARD_STATE
= 3,
1099 IWL_PM_SLP_REPENT
= 5,
1100 IWL_PM_WAKEUP_BY_TIMER
= 6,
1101 IWL_PM_WAKEUP_BY_DRIVER
= 7,
1102 IWL_PM_WAKEUP_BY_RFKILL
= 8,
1104 IWL_PM_NUM_OF_MODES
= 12,
1108 * REPLY_CARD_STATE_CMD = 0xa0 (command, has simple generic response)
1110 #define CARD_STATE_CMD_DISABLE 0x00 /* Put card to sleep */
1111 #define CARD_STATE_CMD_ENABLE 0x01 /* Wake up card */
1112 #define CARD_STATE_CMD_HALT 0x02 /* Power down permanently */
1113 struct iwl3945_card_state_cmd
{
1114 __le32 status
; /* CARD_STATE_CMD_* request new power state */
1115 } __attribute__ ((packed
));
1118 * CARD_STATE_NOTIFICATION = 0xa1 (notification only, not a command)
1120 struct iwl3945_card_state_notif
{
1122 } __attribute__ ((packed
));
1124 #define HW_CARD_DISABLED 0x01
1125 #define SW_CARD_DISABLED 0x02
1126 #define RF_CARD_DISABLED 0x04
1127 #define RXON_CARD_DISABLED 0x10
1129 struct iwl3945_ct_kill_config
{
1131 __le32 critical_temperature_M
;
1132 __le32 critical_temperature_R
;
1133 } __attribute__ ((packed
));
1135 /******************************************************************************
1137 * Scan Commands, Responses, Notifications:
1139 *****************************************************************************/
1141 struct iwl3945_scan_channel
{
1142 /* type is defined as:
1143 * 0:0 active (0 - passive)
1145 * If 1 is set then corresponding SSID IE is transmitted in probe
1150 struct iwl3945_tx_power tpc
;
1151 __le16 active_dwell
;
1152 __le16 passive_dwell
;
1153 } __attribute__ ((packed
));
1155 struct iwl3945_ssid_ie
{
1159 } __attribute__ ((packed
));
1161 #define PROBE_OPTION_MAX 0x4
1162 #define TX_CMD_LIFE_TIME_INFINITE __constant_cpu_to_le32(0xFFFFFFFF)
1163 #define IWL_GOOD_CRC_TH __constant_cpu_to_le16(1)
1164 #define IWL_MAX_SCAN_SIZE 1024
1167 * REPLY_SCAN_CMD = 0x80 (command)
1169 struct iwl3945_scan_cmd
{
1173 __le16 quiet_time
; /* dwell only this long on quiet chnl
1175 __le16 quiet_plcp_th
; /* quiet chnl is < this # pkts (typ. 1) */
1176 __le16 good_CRC_th
; /* passive -> active promotion threshold */
1178 __le32 max_out_time
; /* max usec to be out of associated (service)
1180 __le32 suspend_time
; /* pause scan this long when returning to svc
1182 * 3945 -- 31:24 # beacons, 19:0 additional usec,
1183 * 4965 -- 31:22 # beacons, 21:0 additional usec.
1186 __le32 filter_flags
;
1188 struct iwl3945_tx_cmd tx_cmd
;
1189 struct iwl3945_ssid_ie direct_scan
[PROBE_OPTION_MAX
];
1193 * The channels start after the probe request payload and are of type:
1195 * struct iwl3945_scan_channel channels[0];
1197 * NOTE: Only one band of channels can be scanned per pass. You
1198 * can not mix 2.4GHz channels and 5.2GHz channels and must
1199 * request a scan multiple times (not concurrently)
1202 } __attribute__ ((packed
));
1204 /* Can abort will notify by complete notification with abort status. */
1205 #define CAN_ABORT_STATUS __constant_cpu_to_le32(0x1)
1206 /* complete notification statuses */
1207 #define ABORT_STATUS 0x2
1210 * REPLY_SCAN_CMD = 0x80 (response)
1212 struct iwl3945_scanreq_notification
{
1213 __le32 status
; /* 1: okay, 2: cannot fulfill request */
1214 } __attribute__ ((packed
));
1217 * SCAN_START_NOTIFICATION = 0x82 (notification only, not a command)
1219 struct iwl3945_scanstart_notification
{
1222 __le32 beacon_timer
;
1227 } __attribute__ ((packed
));
1229 #define SCAN_OWNER_STATUS 0x1;
1230 #define MEASURE_OWNER_STATUS 0x2;
1232 #define NUMBER_OF_STATISTICS 1 /* first __le32 is good CRC */
1234 * SCAN_RESULTS_NOTIFICATION = 0x83 (notification only, not a command)
1236 struct iwl3945_scanresults_notification
{
1242 __le32 statistics
[NUMBER_OF_STATISTICS
];
1243 } __attribute__ ((packed
));
1246 * SCAN_COMPLETE_NOTIFICATION = 0x84 (notification only, not a command)
1248 struct iwl3945_scancomplete_notification
{
1249 u8 scanned_channels
;
1255 } __attribute__ ((packed
));
1258 /******************************************************************************
1260 * IBSS/AP Commands and Notifications:
1262 *****************************************************************************/
1265 * BEACON_NOTIFICATION = 0x90 (notification only, not a command)
1267 struct iwl3945_beacon_notif
{
1268 struct iwl3945_tx_resp beacon_notify_hdr
;
1271 __le32 ibss_mgr_status
;
1272 } __attribute__ ((packed
));
1275 * REPLY_TX_BEACON = 0x91 (command, has simple generic response)
1277 struct iwl3945_tx_beacon_cmd
{
1278 struct iwl3945_tx_cmd tx
;
1282 struct ieee80211_hdr frame
[0]; /* beacon frame */
1283 } __attribute__ ((packed
));
1285 /******************************************************************************
1287 * Statistics Commands and Notifications:
1289 *****************************************************************************/
1291 #define IWL_TEMP_CONVERT 260
1293 #define SUP_RATE_11A_MAX_NUM_CHANNELS 8
1294 #define SUP_RATE_11B_MAX_NUM_CHANNELS 4
1295 #define SUP_RATE_11G_MAX_NUM_CHANNELS 12
1297 /* Used for passing to driver number of successes and failures per rate */
1298 struct rate_histogram
{
1300 __le32 a
[SUP_RATE_11A_MAX_NUM_CHANNELS
];
1301 __le32 b
[SUP_RATE_11B_MAX_NUM_CHANNELS
];
1302 __le32 g
[SUP_RATE_11G_MAX_NUM_CHANNELS
];
1305 __le32 a
[SUP_RATE_11A_MAX_NUM_CHANNELS
];
1306 __le32 b
[SUP_RATE_11B_MAX_NUM_CHANNELS
];
1307 __le32 g
[SUP_RATE_11G_MAX_NUM_CHANNELS
];
1309 } __attribute__ ((packed
));
1311 /* statistics command response */
1313 struct statistics_rx_phy
{
1319 __le32 early_overrun_err
;
1321 __le32 false_alarm_cnt
;
1322 __le32 fina_sync_err_cnt
;
1324 __le32 fina_timeout
;
1325 __le32 unresponded_rts
;
1326 __le32 rxe_frame_limit_overrun
;
1327 __le32 sent_ack_cnt
;
1328 __le32 sent_cts_cnt
;
1329 } __attribute__ ((packed
));
1331 struct statistics_rx_non_phy
{
1332 __le32 bogus_cts
; /* CTS received when not expecting CTS */
1333 __le32 bogus_ack
; /* ACK received when not expecting ACK */
1334 __le32 non_bssid_frames
; /* number of frames with BSSID that
1335 * doesn't belong to the STA BSSID */
1336 __le32 filtered_frames
; /* count frames that were dumped in the
1337 * filtering process */
1338 __le32 non_channel_beacons
; /* beacons with our bss id but not on
1339 * our serving channel */
1340 } __attribute__ ((packed
));
1342 struct statistics_rx
{
1343 struct statistics_rx_phy ofdm
;
1344 struct statistics_rx_phy cck
;
1345 struct statistics_rx_non_phy general
;
1346 } __attribute__ ((packed
));
1348 struct statistics_tx
{
1349 __le32 preamble_cnt
;
1350 __le32 rx_detected_cnt
;
1351 __le32 bt_prio_defer_cnt
;
1352 __le32 bt_prio_kill_cnt
;
1353 __le32 few_bytes_cnt
;
1356 __le32 expected_ack_cnt
;
1357 __le32 actual_ack_cnt
;
1358 } __attribute__ ((packed
));
1360 struct statistics_dbg
{
1364 } __attribute__ ((packed
));
1366 struct statistics_div
{
1371 } __attribute__ ((packed
));
1373 struct statistics_general
{
1375 struct statistics_dbg dbg
;
1379 __le32 ttl_timestamp
;
1380 struct statistics_div div
;
1381 } __attribute__ ((packed
));
1384 * REPLY_STATISTICS_CMD = 0x9c,
1385 * 3945 and 4965 identical.
1387 * This command triggers an immediate response containing uCode statistics.
1388 * The response is in the same format as STATISTICS_NOTIFICATION 0x9d, below.
1390 * If the CLEAR_STATS configuration flag is set, uCode will clear its
1391 * internal copy of the statistics (counters) after issuing the response.
1392 * This flag does not affect STATISTICS_NOTIFICATIONs after beacons (see below).
1394 * If the DISABLE_NOTIF configuration flag is set, uCode will not issue
1395 * STATISTICS_NOTIFICATIONs after received beacons (see below). This flag
1396 * does not affect the response to the REPLY_STATISTICS_CMD 0x9c itself.
1398 #define IWL_STATS_CONF_CLEAR_STATS __constant_cpu_to_le32(0x1) /* see above */
1399 #define IWL_STATS_CONF_DISABLE_NOTIF __constant_cpu_to_le32(0x2)/* see above */
1400 struct iwl3945_statistics_cmd
{
1401 __le32 configuration_flags
; /* IWL_STATS_CONF_* */
1402 } __attribute__ ((packed
));
1405 * STATISTICS_NOTIFICATION = 0x9d (notification only, not a command)
1407 * By default, uCode issues this notification after receiving a beacon
1408 * while associated. To disable this behavior, set DISABLE_NOTIF flag in the
1409 * REPLY_STATISTICS_CMD 0x9c, above.
1411 * Statistics counters continue to increment beacon after beacon, but are
1412 * cleared when changing channels or when driver issues REPLY_STATISTICS_CMD
1413 * 0x9c with CLEAR_STATS bit set (see above).
1415 * uCode also issues this notification during scans. uCode clears statistics
1416 * appropriately so that each notification contains statistics for only the
1417 * one channel that has just been scanned.
1419 #define STATISTICS_REPLY_FLG_BAND_24G_MSK __constant_cpu_to_le32(0x2)
1420 #define STATISTICS_REPLY_FLG_FAT_MODE_MSK __constant_cpu_to_le32(0x8)
1421 struct iwl3945_notif_statistics
{
1423 struct statistics_rx rx
;
1424 struct statistics_tx tx
;
1425 struct statistics_general general
;
1426 } __attribute__ ((packed
));
1430 * MISSED_BEACONS_NOTIFICATION = 0xa2 (notification only, not a command)
1432 /* if ucode missed CONSECUTIVE_MISSED_BCONS_TH beacons in a row,
1433 * then this notification will be sent. */
1434 #define CONSECUTIVE_MISSED_BCONS_TH 20
1436 struct iwl3945_missed_beacon_notif
{
1437 __le32 consequtive_missed_beacons
;
1438 __le32 total_missed_becons
;
1439 __le32 num_expected_beacons
;
1440 __le32 num_recvd_beacons
;
1441 } __attribute__ ((packed
));
1443 /******************************************************************************
1445 * Rx Calibration Commands:
1447 *****************************************************************************/
1449 #define PHY_CALIBRATE_DIFF_GAIN_CMD (7)
1450 #define HD_TABLE_SIZE (11)
1452 struct iwl3945_sensitivity_cmd
{
1454 __le16 table
[HD_TABLE_SIZE
];
1455 } __attribute__ ((packed
));
1457 struct iwl3945_calibration_cmd
{
1465 } __attribute__ ((packed
));
1467 /******************************************************************************
1469 * Miscellaneous Commands:
1471 *****************************************************************************/
1474 * LEDs Command & Response
1475 * REPLY_LEDS_CMD = 0x48 (command, has simple generic response)
1477 * For each of 3 possible LEDs (Activity/Link/Tech, selected by "id" field),
1478 * this command turns it on or off, or sets up a periodic blinking cycle.
1480 struct iwl3945_led_cmd
{
1481 __le32 interval
; /* "interval" in uSec */
1482 u8 id
; /* 1: Activity, 2: Link, 3: Tech */
1483 u8 off
; /* # intervals off while blinking;
1484 * "0", with >0 "on" value, turns LED on */
1485 u8 on
; /* # intervals on while blinking;
1486 * "0", regardless of "off", turns LED off */
1488 } __attribute__ ((packed
));
1490 /******************************************************************************
1492 * Union of all expected notifications/responses:
1494 *****************************************************************************/
1496 struct iwl3945_rx_packet
{
1498 struct iwl3945_cmd_header hdr
;
1500 struct iwl3945_alive_resp alive_frame
;
1501 struct iwl3945_rx_frame rx_frame
;
1502 struct iwl3945_tx_resp tx_resp
;
1503 struct iwl3945_spectrum_notification spectrum_notif
;
1504 struct iwl3945_csa_notification csa_notif
;
1505 struct iwl3945_error_resp err_resp
;
1506 struct iwl3945_card_state_notif card_state_notif
;
1507 struct iwl3945_beacon_notif beacon_status
;
1508 struct iwl3945_add_sta_resp add_sta
;
1509 struct iwl3945_sleep_notification sleep_notif
;
1510 struct iwl3945_spectrum_resp spectrum
;
1511 struct iwl3945_notif_statistics stats
;
1515 } __attribute__ ((packed
));
1517 #define IWL_RX_FRAME_SIZE (4 + sizeof(struct iwl3945_rx_frame))
1519 #endif /* __iwl3945_3945_commands_h__ */