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,
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 /******************************************************************************
143 * Commonly used structures and definitions:
144 * Command header, txpower
146 *****************************************************************************/
148 /* iwl3945_cmd_header flags value */
149 #define IWL_CMD_FAILED_MSK 0x40
152 * struct iwl3945_cmd_header
154 * This header format appears in the beginning of each command sent from the
155 * driver, and each response/notification received from uCode.
157 struct iwl3945_cmd_header
{
158 u8 cmd
; /* Command ID: REPLY_RXON, etc. */
159 u8 flags
; /* IWL_CMD_* */
161 * The driver sets up the sequence number to values of its chosing.
162 * uCode does not use this value, but passes it back to the driver
163 * when sending the response to each driver-originated command, so
164 * the driver can match the response to the command. Since the values
165 * don't get used by uCode, the driver may set up an arbitrary format.
167 * There is one exception: uCode sets bit 15 when it originates
168 * the response/notification, i.e. when the response/notification
169 * is not a direct response to a command sent by the driver. For
170 * example, uCode issues REPLY_3945_RX when it sends a received frame
171 * to the driver; it is not a direct response to any driver command.
173 * The Linux driver uses the following format:
175 * 0:7 index/position within Tx queue
176 * 8:13 Tx queue selection
177 * 14:14 driver sets this to indicate command is in the 'huge'
178 * storage at the end of the command buffers, i.e. scan cmd
179 * 15:15 uCode sets this in uCode-originated response/notification
183 /* command or response/notification data follows immediately */
185 } __attribute__ ((packed
));
188 * struct iwl3945_tx_power
190 * Used in REPLY_TX_PWR_TABLE_CMD, REPLY_SCAN_CMD, REPLY_CHANNEL_SWITCH
192 * Each entry contains two values:
193 * 1) DSP gain (or sometimes called DSP attenuation). This is a fine-grained
194 * linear value that multiplies the output of the digital signal processor,
195 * before being sent to the analog radio.
196 * 2) Radio gain. This sets the analog gain of the radio Tx path.
197 * It is a coarser setting, and behaves in a logarithmic (dB) fashion.
199 * Driver obtains values from struct iwl3945_tx_power power_gain_table[][].
201 struct iwl3945_tx_power
{
202 u8 tx_gain
; /* gain for analog radio */
203 u8 dsp_atten
; /* gain for DSP */
204 } __attribute__ ((packed
));
207 * struct iwl3945_power_per_rate
209 * Used in REPLY_TX_PWR_TABLE_CMD, REPLY_CHANNEL_SWITCH
211 struct iwl3945_power_per_rate
{
213 struct iwl3945_tx_power tpc
;
215 } __attribute__ ((packed
));
217 /******************************************************************************
219 * Alive and Error Commands & Responses:
221 *****************************************************************************/
223 #define UCODE_VALID_OK __constant_cpu_to_le32(0x1)
224 #define INITIALIZE_SUBTYPE (9)
227 * ("Initialize") REPLY_ALIVE = 0x1 (response only, not a command)
229 * uCode issues this "initialize alive" notification once the initialization
230 * uCode image has completed its work, and is ready to load the runtime image.
231 * This is the *first* "alive" notification that the driver will receive after
232 * rebooting uCode; the "initialize" alive is indicated by subtype field == 9.
234 * See comments documenting "BSM" (bootstrap state machine).
236 struct iwl3945_init_alive_resp
{
242 u8 ver_subtype
; /* "9" for initialize alive */
244 __le32 log_event_table_ptr
;
245 __le32 error_event_table_ptr
;
248 } __attribute__ ((packed
));
252 * REPLY_ALIVE = 0x1 (response only, not a command)
254 * uCode issues this "alive" notification once the runtime image is ready
255 * to receive commands from the driver. This is the *second* "alive"
256 * notification that the driver will receive after rebooting uCode;
257 * this "alive" is indicated by subtype field != 9.
259 * See comments documenting "BSM" (bootstrap state machine).
261 * This response includes two pointers to structures within the device's
262 * data SRAM (access via HBUS_TARG_MEM_* regs) that are useful for debugging:
264 * 1) log_event_table_ptr indicates base of the event log. This traces
265 * a 256-entry history of uCode execution within a circular buffer.
267 * 2) error_event_table_ptr indicates base of the error log. This contains
268 * information about any uCode error that occurs.
270 * The Linux driver can print both logs to the system log when a uCode error
273 struct iwl3945_alive_resp
{
279 u8 ver_subtype
; /* not "9" for runtime alive */
281 __le32 log_event_table_ptr
; /* SRAM address for event log */
282 __le32 error_event_table_ptr
; /* SRAM address for error log */
285 } __attribute__ ((packed
));
294 * REPLY_ERROR = 0x2 (response only, not a command)
296 struct iwl3945_error_resp
{
300 __le16 bad_cmd_seq_num
;
304 } __attribute__ ((packed
));
306 /******************************************************************************
308 * RXON Commands & Responses:
310 *****************************************************************************/
313 * Rx config defines & structure
315 /* rx_config device types */
317 RXON_DEV_TYPE_AP
= 1,
318 RXON_DEV_TYPE_ESS
= 3,
319 RXON_DEV_TYPE_IBSS
= 4,
320 RXON_DEV_TYPE_SNIFFER
= 6,
323 /* rx_config flags */
324 /* band & modulation selection */
325 #define RXON_FLG_BAND_24G_MSK __constant_cpu_to_le32(1 << 0)
326 #define RXON_FLG_CCK_MSK __constant_cpu_to_le32(1 << 1)
327 /* auto detection enable */
328 #define RXON_FLG_AUTO_DETECT_MSK __constant_cpu_to_le32(1 << 2)
329 /* TGg protection when tx */
330 #define RXON_FLG_TGG_PROTECT_MSK __constant_cpu_to_le32(1 << 3)
331 /* cck short slot & preamble */
332 #define RXON_FLG_SHORT_SLOT_MSK __constant_cpu_to_le32(1 << 4)
333 #define RXON_FLG_SHORT_PREAMBLE_MSK __constant_cpu_to_le32(1 << 5)
334 /* antenna selection */
335 #define RXON_FLG_DIS_DIV_MSK __constant_cpu_to_le32(1 << 7)
336 #define RXON_FLG_ANT_SEL_MSK __constant_cpu_to_le32(0x0f00)
337 #define RXON_FLG_ANT_A_MSK __constant_cpu_to_le32(1 << 8)
338 #define RXON_FLG_ANT_B_MSK __constant_cpu_to_le32(1 << 9)
339 /* radar detection enable */
340 #define RXON_FLG_RADAR_DETECT_MSK __constant_cpu_to_le32(1 << 12)
341 #define RXON_FLG_TGJ_NARROW_BAND_MSK __constant_cpu_to_le32(1 << 13)
342 /* rx response to host with 8-byte TSF
343 * (according to ON_AIR deassertion) */
344 #define RXON_FLG_TSF2HOST_MSK __constant_cpu_to_le32(1 << 15)
346 /* rx_config filter flags */
347 /* accept all data frames */
348 #define RXON_FILTER_PROMISC_MSK __constant_cpu_to_le32(1 << 0)
349 /* pass control & management to host */
350 #define RXON_FILTER_CTL2HOST_MSK __constant_cpu_to_le32(1 << 1)
351 /* accept multi-cast */
352 #define RXON_FILTER_ACCEPT_GRP_MSK __constant_cpu_to_le32(1 << 2)
353 /* don't decrypt uni-cast frames */
354 #define RXON_FILTER_DIS_DECRYPT_MSK __constant_cpu_to_le32(1 << 3)
355 /* don't decrypt multi-cast frames */
356 #define RXON_FILTER_DIS_GRP_DECRYPT_MSK __constant_cpu_to_le32(1 << 4)
357 /* STA is associated */
358 #define RXON_FILTER_ASSOC_MSK __constant_cpu_to_le32(1 << 5)
359 /* transfer to host non bssid beacons in associated state */
360 #define RXON_FILTER_BCON_AWARE_MSK __constant_cpu_to_le32(1 << 6)
363 * REPLY_RXON = 0x10 (command, has simple generic response)
365 * RXON tunes the radio tuner to a service channel, and sets up a number
366 * of parameters that are used primarily for Rx, but also for Tx operations.
368 * NOTE: When tuning to a new channel, driver must set the
369 * RXON_FILTER_ASSOC_MSK to 0. This will clear station-dependent
370 * info within the device, including the station tables, tx retry
371 * rate tables, and txpower tables. Driver must build a new station
372 * table and txpower table before transmitting anything on the RXON
375 * NOTE: All RXONs wipe clean the internal txpower table. Driver must
376 * issue a new REPLY_TX_PWR_TABLE_CMD after each REPLY_RXON (0x10),
377 * regardless of whether RXON_FILTER_ASSOC_MSK is set.
379 struct iwl3945_rxon_cmd
{
384 u8 wlap_bssid_addr
[6];
396 } __attribute__ ((packed
));
399 * REPLY_RXON_ASSOC = 0x11 (command, has simple generic response)
401 struct iwl3945_rxon_assoc_cmd
{
407 } __attribute__ ((packed
));
410 * REPLY_RXON_TIMING = 0x14 (command, has simple generic response)
412 struct iwl3945_rxon_time_cmd
{
414 __le16 beacon_interval
;
416 __le32 beacon_init_val
;
417 __le16 listen_interval
;
419 } __attribute__ ((packed
));
422 * REPLY_CHANNEL_SWITCH = 0x72 (command, has simple generic response)
424 struct iwl3945_channel_switch_cmd
{
429 __le32 rxon_filter_flags
;
431 struct iwl3945_power_per_rate power
[IWL_MAX_RATES
];
432 } __attribute__ ((packed
));
435 * CHANNEL_SWITCH_NOTIFICATION = 0x73 (notification only, not a command)
437 struct iwl3945_csa_notification
{
440 __le32 status
; /* 0 - OK, 1 - fail */
441 } __attribute__ ((packed
));
443 /******************************************************************************
445 * Quality-of-Service (QOS) Commands & Responses:
447 *****************************************************************************/
448 struct iwl3945_ac_qos
{
454 } __attribute__ ((packed
));
456 /* QoS flags defines */
457 #define QOS_PARAM_FLG_UPDATE_EDCA_MSK __constant_cpu_to_le32(0x01)
458 #define QOS_PARAM_FLG_TGN_MSK __constant_cpu_to_le32(0x02)
459 #define QOS_PARAM_FLG_TXOP_TYPE_MSK __constant_cpu_to_le32(0x10)
462 * TXFIFO Queue number defines
464 /* number of Access categories (AC) (EDCA), queues 0..3 */
468 * REPLY_QOS_PARAM = 0x13 (command, has simple generic response)
470 struct iwl3945_qosparam_cmd
{
472 struct iwl3945_ac_qos ac
[AC_NUM
];
473 } __attribute__ ((packed
));
475 /******************************************************************************
477 * Add/Modify Stations Commands & Responses:
479 *****************************************************************************/
481 * Multi station support
484 #define IWL_MULTICAST_ID 1
487 #define IWL3945_BROADCAST_ID 24
488 #define IWL3945_STATION_COUNT 25
490 #define IWL4965_BROADCAST_ID 31
491 #define IWL4965_STATION_COUNT 32
493 #define IWL_STATION_COUNT 32 /* MAX(3945,4965)*/
494 #define IWL_INVALID_STATION 255
496 #define STA_FLG_TX_RATE_MSK __constant_cpu_to_le32(1<<2);
497 #define STA_FLG_PWR_SAVE_MSK __constant_cpu_to_le32(1<<8);
499 #define STA_CONTROL_MODIFY_MSK 0x01
501 /* key flags __le16*/
502 #define STA_KEY_FLG_ENCRYPT_MSK __constant_cpu_to_le16(0x7)
503 #define STA_KEY_FLG_NO_ENC __constant_cpu_to_le16(0x0)
504 #define STA_KEY_FLG_WEP __constant_cpu_to_le16(0x1)
505 #define STA_KEY_FLG_CCMP __constant_cpu_to_le16(0x2)
506 #define STA_KEY_FLG_TKIP __constant_cpu_to_le16(0x3)
508 #define STA_KEY_FLG_KEYID_POS 8
509 #define STA_KEY_FLG_INVALID __constant_cpu_to_le16(0x0800)
512 #define STA_MODIFY_KEY_MASK 0x01
513 #define STA_MODIFY_TID_DISABLE_TX 0x02
514 #define STA_MODIFY_TX_RATE_MSK 0x04
515 #define STA_MODIFY_ADDBA_TID_MSK 0x08
516 #define STA_MODIFY_DELBA_TID_MSK 0x10
517 #define BUILD_RAxTID(sta_id, tid) (((sta_id) << 4) + (tid))
521 * bit14:15 01 B inactive, A active
522 * 10 B active, A inactive
525 #define RATE_MCS_ANT_A_POS 14
526 #define RATE_MCS_ANT_B_POS 15
527 #define RATE_MCS_ANT_A_MSK 0x4000
528 #define RATE_MCS_ANT_B_MSK 0x8000
529 #define RATE_MCS_ANT_AB_MSK 0xc000
531 struct iwl3945_keyinfo
{
533 u8 tkip_rx_tsc_byte2
; /* TSC[2] for key mix ph1 detection */
535 __le16 tkip_rx_ttak
[5]; /* 10-byte unicast TKIP TTAK */
537 u8 key
[16]; /* 16-byte unicast decryption key */
538 } __attribute__ ((packed
));
540 struct sta_id_modify
{
546 } __attribute__ ((packed
));
549 * REPLY_ADD_STA = 0x18 (command)
551 struct iwl3945_addsta_cmd
{
554 struct sta_id_modify sta
;
555 struct iwl3945_keyinfo key
;
556 __le32 station_flags
;
557 __le32 station_flags_msk
;
558 __le16 tid_disable_tx
;
560 u8 add_immediate_ba_tid
;
561 u8 remove_immediate_ba_tid
;
562 __le16 add_immediate_ba_ssn
;
563 } __attribute__ ((packed
));
566 * REPLY_ADD_STA = 0x18 (response)
568 struct iwl3945_add_sta_resp
{
570 } __attribute__ ((packed
));
572 #define ADD_STA_SUCCESS_MSK 0x1
574 /******************************************************************************
578 *****************************************************************************/
580 struct iwl3945_rx_frame_stats
{
588 } __attribute__ ((packed
));
590 struct iwl3945_rx_frame_hdr
{
597 } __attribute__ ((packed
));
599 #define RX_RES_STATUS_NO_CRC32_ERROR __constant_cpu_to_le32(1 << 0)
600 #define RX_RES_STATUS_NO_RXE_OVERFLOW __constant_cpu_to_le32(1 << 1)
602 #define RX_RES_PHY_FLAGS_BAND_24_MSK __constant_cpu_to_le16(1 << 0)
603 #define RX_RES_PHY_FLAGS_MOD_CCK_MSK __constant_cpu_to_le16(1 << 1)
604 #define RX_RES_PHY_FLAGS_SHORT_PREAMBLE_MSK __constant_cpu_to_le16(1 << 2)
605 #define RX_RES_PHY_FLAGS_NARROW_BAND_MSK __constant_cpu_to_le16(1 << 3)
606 #define RX_RES_PHY_FLAGS_ANTENNA_MSK __constant_cpu_to_le16(0xf0)
608 #define RX_RES_STATUS_SEC_TYPE_MSK (0x7 << 8)
609 #define RX_RES_STATUS_SEC_TYPE_NONE (0x0 << 8)
610 #define RX_RES_STATUS_SEC_TYPE_WEP (0x1 << 8)
611 #define RX_RES_STATUS_SEC_TYPE_CCMP (0x2 << 8)
612 #define RX_RES_STATUS_SEC_TYPE_TKIP (0x3 << 8)
614 #define RX_RES_STATUS_DECRYPT_TYPE_MSK (0x3 << 11)
615 #define RX_RES_STATUS_NOT_DECRYPT (0x0 << 11)
616 #define RX_RES_STATUS_DECRYPT_OK (0x3 << 11)
617 #define RX_RES_STATUS_BAD_ICV_MIC (0x1 << 11)
618 #define RX_RES_STATUS_BAD_KEY_TTAK (0x2 << 11)
620 struct iwl3945_rx_frame_end
{
623 __le32 beacon_timestamp
;
624 } __attribute__ ((packed
));
627 * REPLY_3945_RX = 0x1b (response only, not a command)
629 * NOTE: DO NOT dereference from casts to this structure
630 * It is provided only for calculating minimum data set size.
631 * The actual offsets of the hdr and end are dynamic based on
634 struct iwl3945_rx_frame
{
635 struct iwl3945_rx_frame_stats stats
;
636 struct iwl3945_rx_frame_hdr hdr
;
637 struct iwl3945_rx_frame_end end
;
638 } __attribute__ ((packed
));
640 /* Fixed (non-configurable) rx data from phy */
641 #define RX_PHY_FLAGS_ANTENNAE_OFFSET (4)
642 #define RX_PHY_FLAGS_ANTENNAE_MASK (0x70)
643 #define IWL_AGC_DB_MASK (0x3f80) /* MASK(7,13) */
644 #define IWL_AGC_DB_POS (7)
645 struct iwl4965_rx_non_cfg_phy
{
646 __le16 ant_selection
; /* ant A bit 4, ant B bit 5, ant C bit 6 */
647 __le16 agc_info
; /* agc code 0:6, agc dB 7:13, reserved 14:15 */
648 u8 rssi_info
[6]; /* we use even entries, 0/2/4 for A/B/C rssi */
650 } __attribute__ ((packed
));
653 * REPLY_4965_RX = 0xc3 (response only, not a command)
654 * Used only for legacy (non 11n) frames.
656 #define RX_RES_PHY_CNT 14
657 struct iwl4965_rx_phy_res
{
658 u8 non_cfg_phy_cnt
; /* non configurable DSP phy data byte count */
659 u8 cfg_phy_cnt
; /* configurable DSP phy data byte count */
660 u8 stat_id
; /* configurable DSP phy data set ID */
662 __le64 timestamp
; /* TSF at on air rise */
663 __le32 beacon_time_stamp
; /* beacon at on-air rise */
664 __le16 phy_flags
; /* general phy flags: band, modulation, ... */
665 __le16 channel
; /* channel number */
666 __le16 non_cfg_phy
[RX_RES_PHY_CNT
]; /* upto 14 phy entries */
669 __le16 byte_count
; /* frame's byte-count */
671 } __attribute__ ((packed
));
673 struct iwl4965_rx_mpdu_res_start
{
676 } __attribute__ ((packed
));
679 /******************************************************************************
681 * Tx Commands & Responses:
683 *****************************************************************************/
686 #define TX_CMD_FLG_RTS_MSK __constant_cpu_to_le32(1 << 1)
687 #define TX_CMD_FLG_CTS_MSK __constant_cpu_to_le32(1 << 2)
688 #define TX_CMD_FLG_ACK_MSK __constant_cpu_to_le32(1 << 3)
689 #define TX_CMD_FLG_STA_RATE_MSK __constant_cpu_to_le32(1 << 4)
690 #define TX_CMD_FLG_IMM_BA_RSP_MASK __constant_cpu_to_le32(1 << 6)
691 #define TX_CMD_FLG_FULL_TXOP_PROT_MSK __constant_cpu_to_le32(1 << 7)
692 #define TX_CMD_FLG_ANT_SEL_MSK __constant_cpu_to_le32(0xf00)
693 #define TX_CMD_FLG_ANT_A_MSK __constant_cpu_to_le32(1 << 8)
694 #define TX_CMD_FLG_ANT_B_MSK __constant_cpu_to_le32(1 << 9)
696 /* ucode ignores BT priority for this frame */
697 #define TX_CMD_FLG_BT_DIS_MSK __constant_cpu_to_le32(1 << 12)
699 /* ucode overrides sequence control */
700 #define TX_CMD_FLG_SEQ_CTL_MSK __constant_cpu_to_le32(1 << 13)
702 /* signal that this frame is non-last MPDU */
703 #define TX_CMD_FLG_MORE_FRAG_MSK __constant_cpu_to_le32(1 << 14)
705 /* calculate TSF in outgoing frame */
706 #define TX_CMD_FLG_TSF_MSK __constant_cpu_to_le32(1 << 16)
708 /* activate TX calibration. */
709 #define TX_CMD_FLG_CALIB_MSK __constant_cpu_to_le32(1 << 17)
711 /* signals that 2 bytes pad was inserted
712 after the MAC header */
713 #define TX_CMD_FLG_MH_PAD_MSK __constant_cpu_to_le32(1 << 20)
715 /* HCCA-AP - disable duration overwriting. */
716 #define TX_CMD_FLG_DUR_MSK __constant_cpu_to_le32(1 << 25)
719 * TX command security control
721 #define TX_CMD_SEC_WEP 0x01
722 #define TX_CMD_SEC_CCM 0x02
723 #define TX_CMD_SEC_TKIP 0x03
724 #define TX_CMD_SEC_MSK 0x03
725 #define TX_CMD_SEC_SHIFT 6
726 #define TX_CMD_SEC_KEY128 0x08
729 * TX command Frame life time
732 struct iwl3945_dram_scratch
{
736 } __attribute__ ((packed
));
739 * REPLY_TX = 0x1c (command)
741 struct iwl3945_tx_cmd
{
743 __le16 next_frame_len
;
755 __le32 next_frame_info
;
761 u8 rts_retry_limit
; /*byte 50 */
762 u8 data_retry_limit
; /*byte 51 */
764 __le16 pm_frame_timeout
;
765 __le16 attempt_duration
;
769 struct ieee80211_hdr hdr
[0];
770 } __attribute__ ((packed
));
772 /* TX command response is sent after *all* transmission attempts.
776 * TX_STATUS_FAIL_NEXT_FRAG
778 * If the fragment flag in the MAC header for the frame being transmitted
779 * is set and there is insufficient time to transmit the next frame, the
780 * TX status will be returned with 'TX_STATUS_FAIL_NEXT_FRAG'.
782 * TX_STATUS_FIFO_UNDERRUN
784 * Indicates the host did not provide bytes to the FIFO fast enough while
785 * a TX was in progress.
787 * TX_STATUS_FAIL_MGMNT_ABORT
789 * This status is only possible if the ABORT ON MGMT RX parameter was
790 * set to true with the TX command.
792 * If the MSB of the status parameter is set then an abort sequence is
793 * required. This sequence consists of the host activating the TX Abort
794 * control line, and then waiting for the TX Abort command response. This
795 * indicates that a the device is no longer in a transmit state, and that the
796 * command FIFO has been cleared. The host must then deactivate the TX Abort
797 * control line. Receiving is still allowed in this case.
800 TX_STATUS_SUCCESS
= 0x01,
801 TX_STATUS_DIRECT_DONE
= 0x02,
802 TX_STATUS_FAIL_SHORT_LIMIT
= 0x82,
803 TX_STATUS_FAIL_LONG_LIMIT
= 0x83,
804 TX_STATUS_FAIL_FIFO_UNDERRUN
= 0x84,
805 TX_STATUS_FAIL_MGMNT_ABORT
= 0x85,
806 TX_STATUS_FAIL_NEXT_FRAG
= 0x86,
807 TX_STATUS_FAIL_LIFE_EXPIRE
= 0x87,
808 TX_STATUS_FAIL_DEST_PS
= 0x88,
809 TX_STATUS_FAIL_ABORTED
= 0x89,
810 TX_STATUS_FAIL_BT_RETRY
= 0x8a,
811 TX_STATUS_FAIL_STA_INVALID
= 0x8b,
812 TX_STATUS_FAIL_FRAG_DROPPED
= 0x8c,
813 TX_STATUS_FAIL_TID_DISABLE
= 0x8d,
814 TX_STATUS_FAIL_FRAME_FLUSHED
= 0x8e,
815 TX_STATUS_FAIL_INSUFFICIENT_CF_POLL
= 0x8f,
816 TX_STATUS_FAIL_TX_LOCKED
= 0x90,
817 TX_STATUS_FAIL_NO_BEACON_ON_RADAR
= 0x91,
820 #define TX_PACKET_MODE_REGULAR 0x0000
821 #define TX_PACKET_MODE_BURST_SEQ 0x0100
822 #define TX_PACKET_MODE_BURST_FIRST 0x0200
825 TX_POWER_PA_NOT_ACTIVE
= 0x0,
829 TX_STATUS_MSK
= 0x000000ff, /* bits 0:7 */
830 TX_STATUS_DELAY_MSK
= 0x00000040,
831 TX_STATUS_ABORT_MSK
= 0x00000080,
832 TX_PACKET_MODE_MSK
= 0x0000ff00, /* bits 8:15 */
833 TX_FIFO_NUMBER_MSK
= 0x00070000, /* bits 16:18 */
834 TX_RESERVED
= 0x00780000, /* bits 19:22 */
835 TX_POWER_PA_DETECT_MSK
= 0x7f800000, /* bits 23:30 */
836 TX_ABORT_REQUIRED_MSK
= 0x80000000, /* bits 31:31 */
839 /* *******************************
840 * TX aggregation state
841 ******************************* */
844 AGG_TX_STATE_TRANSMITTED
= 0x00,
845 AGG_TX_STATE_UNDERRUN_MSK
= 0x01,
846 AGG_TX_STATE_BT_PRIO_MSK
= 0x02,
847 AGG_TX_STATE_FEW_BYTES_MSK
= 0x04,
848 AGG_TX_STATE_ABORT_MSK
= 0x08,
849 AGG_TX_STATE_LAST_SENT_TTL_MSK
= 0x10,
850 AGG_TX_STATE_LAST_SENT_TRY_CNT_MSK
= 0x20,
851 AGG_TX_STATE_LAST_SENT_BT_KILL_MSK
= 0x40,
852 AGG_TX_STATE_SCD_QUERY_MSK
= 0x80,
853 AGG_TX_STATE_TEST_BAD_CRC32_MSK
= 0x100,
854 AGG_TX_STATE_RESPONSE_MSK
= 0x1ff,
855 AGG_TX_STATE_DUMP_TX_MSK
= 0x200,
856 AGG_TX_STATE_DELAY_TX_MSK
= 0x400
859 #define AGG_TX_STATE_LAST_SENT_MSK \
860 (AGG_TX_STATE_LAST_SENT_TTL_MSK | \
861 AGG_TX_STATE_LAST_SENT_TRY_CNT_MSK | \
862 AGG_TX_STATE_LAST_SENT_BT_KILL_MSK)
864 #define AGG_TX_STATE_TRY_CNT_POS 12
865 #define AGG_TX_STATE_TRY_CNT_MSK 0xf000
867 #define AGG_TX_STATE_SEQ_NUM_POS 16
868 #define AGG_TX_STATE_SEQ_NUM_MSK 0xffff0000
871 * REPLY_TX = 0x1c (response)
873 struct iwl3945_tx_resp
{
878 __le32 wireless_media_time
;
879 __le32 status
; /* TX status (for aggregation status of 1st frame) */
880 } __attribute__ ((packed
));
883 * REPLY_COMPRESSED_BA = 0xc5 (response only, not a command)
885 struct iwl3945_compressed_ba_resp
{
886 __le32 sta_addr_lo32
;
887 __le16 sta_addr_hi16
;
896 } __attribute__ ((packed
));
899 * REPLY_TX_PWR_TABLE_CMD = 0x97 (command, has simple generic response)
901 struct iwl3945_txpowertable_cmd
{
902 u8 band
; /* 0: 5 GHz, 1: 2.4 GHz */
905 struct iwl3945_power_per_rate power
[IWL_MAX_RATES
];
906 } __attribute__ ((packed
));
908 struct iwl3945_rate_scaling_info
{
912 } __attribute__ ((packed
));
915 * struct iwl3945_rate_scaling_cmd - Rate Scaling Command & Response
917 * REPLY_RATE_SCALE = 0x47 (command, has simple generic response)
919 * NOTE: The table of rates passed to the uCode via the
920 * RATE_SCALE command sets up the corresponding order of
921 * rates used for all related commands, including rate
924 * For example, if you set 9MB (PLCP 0x0f) as the first
925 * rate in the rate table, the bit mask for that rate
926 * when passed through ofdm_basic_rates on the REPLY_RXON
927 * command would be bit 0 (1<<0)
929 struct iwl3945_rate_scaling_cmd
{
932 struct iwl3945_rate_scaling_info table
[IWL_MAX_RATES
];
933 } __attribute__ ((packed
));
936 * REPLY_BT_CONFIG = 0x9b (command, has simple generic response)
938 struct iwl3945_bt_cmd
{
943 __le32 kill_ack_mask
;
944 __le32 kill_cts_mask
;
945 } __attribute__ ((packed
));
947 /******************************************************************************
949 * Spectrum Management (802.11h) Commands, Responses, Notifications:
951 *****************************************************************************/
954 * Spectrum Management
956 #define MEASUREMENT_FILTER_FLAG (RXON_FILTER_PROMISC_MSK | \
957 RXON_FILTER_CTL2HOST_MSK | \
958 RXON_FILTER_ACCEPT_GRP_MSK | \
959 RXON_FILTER_DIS_DECRYPT_MSK | \
960 RXON_FILTER_DIS_GRP_DECRYPT_MSK | \
961 RXON_FILTER_ASSOC_MSK | \
962 RXON_FILTER_BCON_AWARE_MSK)
964 struct iwl3945_measure_channel
{
965 __le32 duration
; /* measurement duration in extended beacon
967 u8 channel
; /* channel to measure */
968 u8 type
; /* see enum iwl3945_measure_type */
970 } __attribute__ ((packed
));
973 * REPLY_SPECTRUM_MEASUREMENT_CMD = 0x74 (command)
975 struct iwl3945_spectrum_cmd
{
976 __le16 len
; /* number of bytes starting from token */
977 u8 token
; /* token id */
978 u8 id
; /* measurement id -- 0 or 1 */
979 u8 origin
; /* 0 = TGh, 1 = other, 2 = TGk */
980 u8 periodic
; /* 1 = periodic */
981 __le16 path_loss_timeout
;
982 __le32 start_time
; /* start time in extended beacon format */
984 __le32 flags
; /* rxon flags */
985 __le32 filter_flags
; /* rxon filter flags */
986 __le16 channel_count
; /* minimum 1, maximum 10 */
988 struct iwl3945_measure_channel channels
[10];
989 } __attribute__ ((packed
));
992 * REPLY_SPECTRUM_MEASUREMENT_CMD = 0x74 (response)
994 struct iwl3945_spectrum_resp
{
996 u8 id
; /* id of the prior command replaced, or 0xff */
997 __le16 status
; /* 0 - command will be handled
998 * 1 - cannot handle (conflicts with another
1000 } __attribute__ ((packed
));
1002 enum iwl3945_measurement_state
{
1003 IWL_MEASUREMENT_START
= 0,
1004 IWL_MEASUREMENT_STOP
= 1,
1007 enum iwl3945_measurement_status
{
1008 IWL_MEASUREMENT_OK
= 0,
1009 IWL_MEASUREMENT_CONCURRENT
= 1,
1010 IWL_MEASUREMENT_CSA_CONFLICT
= 2,
1011 IWL_MEASUREMENT_TGH_CONFLICT
= 3,
1013 IWL_MEASUREMENT_STOPPED
= 6,
1014 IWL_MEASUREMENT_TIMEOUT
= 7,
1015 IWL_MEASUREMENT_PERIODIC_FAILED
= 8,
1018 #define NUM_ELEMENTS_IN_HISTOGRAM 8
1020 struct iwl3945_measurement_histogram
{
1021 __le32 ofdm
[NUM_ELEMENTS_IN_HISTOGRAM
]; /* in 0.8usec counts */
1022 __le32 cck
[NUM_ELEMENTS_IN_HISTOGRAM
]; /* in 1usec counts */
1023 } __attribute__ ((packed
));
1025 /* clear channel availability counters */
1026 struct iwl3945_measurement_cca_counters
{
1029 } __attribute__ ((packed
));
1031 enum iwl3945_measure_type
{
1032 IWL_MEASURE_BASIC
= (1 << 0),
1033 IWL_MEASURE_CHANNEL_LOAD
= (1 << 1),
1034 IWL_MEASURE_HISTOGRAM_RPI
= (1 << 2),
1035 IWL_MEASURE_HISTOGRAM_NOISE
= (1 << 3),
1036 IWL_MEASURE_FRAME
= (1 << 4),
1037 /* bits 5:6 are reserved */
1038 IWL_MEASURE_IDLE
= (1 << 7),
1042 * SPECTRUM_MEASURE_NOTIFICATION = 0x75 (notification only, not a command)
1044 struct iwl3945_spectrum_notification
{
1045 u8 id
; /* measurement id -- 0 or 1 */
1047 u8 channel_index
; /* index in measurement channel list */
1048 u8 state
; /* 0 - start, 1 - stop */
1049 __le32 start_time
; /* lower 32-bits of TSF */
1050 u8 band
; /* 0 - 5.2GHz, 1 - 2.4GHz */
1052 u8 type
; /* see enum iwl3945_measurement_type */
1054 /* NOTE: cca_ofdm, cca_cck, basic_type, and histogram are only only
1055 * valid if applicable for measurement type requested. */
1056 __le32 cca_ofdm
; /* cca fraction time in 40Mhz clock periods */
1057 __le32 cca_cck
; /* cca fraction time in 44Mhz clock periods */
1058 __le32 cca_time
; /* channel load time in usecs */
1059 u8 basic_type
; /* 0 - bss, 1 - ofdm preamble, 2 -
1062 struct iwl3945_measurement_histogram histogram
;
1063 __le32 stop_time
; /* lower 32-bits of TSF */
1064 __le32 status
; /* see iwl3945_measurement_status */
1065 } __attribute__ ((packed
));
1067 /******************************************************************************
1069 * Power Management Commands, Responses, Notifications:
1071 *****************************************************************************/
1074 * struct iwl3945_powertable_cmd - Power Table Command
1075 * @flags: See below:
1077 * POWER_TABLE_CMD = 0x77 (command, has simple generic response)
1080 * bit 0 - '0' Driver not allow power management
1081 * '1' Driver allow PM (use rest of parameters)
1082 * uCode send sleep notifications:
1083 * bit 1 - '0' Don't send sleep notification
1084 * '1' send sleep notification (SEND_PM_NOTIFICATION)
1086 * bit 2 - '0' PM have to walk up every DTIM
1087 * '1' PM could sleep over DTIM till listen Interval.
1089 * bit 3 - '0' (PCI_LINK_CTRL & 0x1)
1090 * '1' !(PCI_LINK_CTRL & 0x1)
1092 * bit 31/30- '00' use both mac/xtal sleeps
1093 * '01' force Mac sleep
1094 * '10' force xtal sleep
1097 * NOTE: if sleep_interval[SLEEP_INTRVL_TABLE_SIZE-1] > DTIM period then
1098 * ucode assume sleep over DTIM is allowed and we don't need to wakeup
1101 #define IWL_POWER_VEC_SIZE 5
1103 #define IWL_POWER_DRIVER_ALLOW_SLEEP_MSK __constant_cpu_to_le32(1<<0)
1104 #define IWL_POWER_SLEEP_OVER_DTIM_MSK __constant_cpu_to_le32(1<<2)
1105 #define IWL_POWER_PCI_PM_MSK __constant_cpu_to_le32(1<<3)
1106 struct iwl3945_powertable_cmd
{
1108 __le32 rx_data_timeout
;
1109 __le32 tx_data_timeout
;
1110 __le32 sleep_interval
[IWL_POWER_VEC_SIZE
];
1111 } __attribute__((packed
));
1114 * PM_SLEEP_NOTIFICATION = 0x7A (notification only, not a command)
1115 * 3945 and 4965 identical.
1117 struct iwl3945_sleep_notification
{
1124 } __attribute__ ((packed
));
1126 /* Sleep states. 3945 and 4965 identical. */
1128 IWL_PM_NO_SLEEP
= 0,
1130 IWL_PM_SLP_FULL_MAC_UNASSOCIATE
= 2,
1131 IWL_PM_SLP_FULL_MAC_CARD_STATE
= 3,
1133 IWL_PM_SLP_REPENT
= 5,
1134 IWL_PM_WAKEUP_BY_TIMER
= 6,
1135 IWL_PM_WAKEUP_BY_DRIVER
= 7,
1136 IWL_PM_WAKEUP_BY_RFKILL
= 8,
1138 IWL_PM_NUM_OF_MODES
= 12,
1142 * REPLY_CARD_STATE_CMD = 0xa0 (command, has simple generic response)
1144 #define CARD_STATE_CMD_DISABLE 0x00 /* Put card to sleep */
1145 #define CARD_STATE_CMD_ENABLE 0x01 /* Wake up card */
1146 #define CARD_STATE_CMD_HALT 0x02 /* Power down permanently */
1147 struct iwl3945_card_state_cmd
{
1148 __le32 status
; /* CARD_STATE_CMD_* request new power state */
1149 } __attribute__ ((packed
));
1152 * CARD_STATE_NOTIFICATION = 0xa1 (notification only, not a command)
1154 struct iwl3945_card_state_notif
{
1156 } __attribute__ ((packed
));
1158 #define HW_CARD_DISABLED 0x01
1159 #define SW_CARD_DISABLED 0x02
1160 #define RF_CARD_DISABLED 0x04
1161 #define RXON_CARD_DISABLED 0x10
1163 struct iwl3945_ct_kill_config
{
1165 __le32 critical_temperature_M
;
1166 __le32 critical_temperature_R
;
1167 } __attribute__ ((packed
));
1169 /******************************************************************************
1171 * Scan Commands, Responses, Notifications:
1173 *****************************************************************************/
1175 struct iwl3945_scan_channel
{
1176 /* type is defined as:
1177 * 0:0 active (0 - passive)
1179 * If 1 is set then corresponding SSID IE is transmitted in probe
1184 struct iwl3945_tx_power tpc
;
1185 __le16 active_dwell
;
1186 __le16 passive_dwell
;
1187 } __attribute__ ((packed
));
1189 struct iwl3945_ssid_ie
{
1193 } __attribute__ ((packed
));
1195 #define PROBE_OPTION_MAX 0x4
1196 #define TX_CMD_LIFE_TIME_INFINITE __constant_cpu_to_le32(0xFFFFFFFF)
1197 #define IWL_GOOD_CRC_TH __constant_cpu_to_le16(1)
1198 #define IWL_MAX_SCAN_SIZE 1024
1201 * REPLY_SCAN_CMD = 0x80 (command)
1203 struct iwl3945_scan_cmd
{
1207 __le16 quiet_time
; /* dwell only this long on quiet chnl
1209 __le16 quiet_plcp_th
; /* quiet chnl is < this # pkts (typ. 1) */
1210 __le16 good_CRC_th
; /* passive -> active promotion threshold */
1212 __le32 max_out_time
; /* max usec to be out of associated (service)
1214 __le32 suspend_time
; /* pause scan this long when returning to svc
1216 * 3945 -- 31:24 # beacons, 19:0 additional usec,
1217 * 4965 -- 31:22 # beacons, 21:0 additional usec.
1220 __le32 filter_flags
;
1222 struct iwl3945_tx_cmd tx_cmd
;
1223 struct iwl3945_ssid_ie direct_scan
[PROBE_OPTION_MAX
];
1227 * The channels start after the probe request payload and are of type:
1229 * struct iwl3945_scan_channel channels[0];
1231 * NOTE: Only one band of channels can be scanned per pass. You
1232 * can not mix 2.4GHz channels and 5.2GHz channels and must
1233 * request a scan multiple times (not concurrently)
1236 } __attribute__ ((packed
));
1238 /* Can abort will notify by complete notification with abort status. */
1239 #define CAN_ABORT_STATUS __constant_cpu_to_le32(0x1)
1240 /* complete notification statuses */
1241 #define ABORT_STATUS 0x2
1244 * REPLY_SCAN_CMD = 0x80 (response)
1246 struct iwl3945_scanreq_notification
{
1247 __le32 status
; /* 1: okay, 2: cannot fulfill request */
1248 } __attribute__ ((packed
));
1251 * SCAN_START_NOTIFICATION = 0x82 (notification only, not a command)
1253 struct iwl3945_scanstart_notification
{
1256 __le32 beacon_timer
;
1261 } __attribute__ ((packed
));
1263 #define SCAN_OWNER_STATUS 0x1;
1264 #define MEASURE_OWNER_STATUS 0x2;
1266 #define NUMBER_OF_STATISTICS 1 /* first __le32 is good CRC */
1268 * SCAN_RESULTS_NOTIFICATION = 0x83 (notification only, not a command)
1270 struct iwl3945_scanresults_notification
{
1276 __le32 statistics
[NUMBER_OF_STATISTICS
];
1277 } __attribute__ ((packed
));
1280 * SCAN_COMPLETE_NOTIFICATION = 0x84 (notification only, not a command)
1282 struct iwl3945_scancomplete_notification
{
1283 u8 scanned_channels
;
1289 } __attribute__ ((packed
));
1292 /******************************************************************************
1294 * IBSS/AP Commands and Notifications:
1296 *****************************************************************************/
1299 * BEACON_NOTIFICATION = 0x90 (notification only, not a command)
1301 struct iwl3945_beacon_notif
{
1302 struct iwl3945_tx_resp beacon_notify_hdr
;
1305 __le32 ibss_mgr_status
;
1306 } __attribute__ ((packed
));
1309 * REPLY_TX_BEACON = 0x91 (command, has simple generic response)
1311 struct iwl3945_tx_beacon_cmd
{
1312 struct iwl3945_tx_cmd tx
;
1316 struct ieee80211_hdr frame
[0]; /* beacon frame */
1317 } __attribute__ ((packed
));
1319 /******************************************************************************
1321 * Statistics Commands and Notifications:
1323 *****************************************************************************/
1325 #define IWL_TEMP_CONVERT 260
1327 #define SUP_RATE_11A_MAX_NUM_CHANNELS 8
1328 #define SUP_RATE_11B_MAX_NUM_CHANNELS 4
1329 #define SUP_RATE_11G_MAX_NUM_CHANNELS 12
1331 /* Used for passing to driver number of successes and failures per rate */
1332 struct rate_histogram
{
1334 __le32 a
[SUP_RATE_11A_MAX_NUM_CHANNELS
];
1335 __le32 b
[SUP_RATE_11B_MAX_NUM_CHANNELS
];
1336 __le32 g
[SUP_RATE_11G_MAX_NUM_CHANNELS
];
1339 __le32 a
[SUP_RATE_11A_MAX_NUM_CHANNELS
];
1340 __le32 b
[SUP_RATE_11B_MAX_NUM_CHANNELS
];
1341 __le32 g
[SUP_RATE_11G_MAX_NUM_CHANNELS
];
1343 } __attribute__ ((packed
));
1345 /* statistics command response */
1347 struct statistics_rx_phy
{
1353 __le32 early_overrun_err
;
1355 __le32 false_alarm_cnt
;
1356 __le32 fina_sync_err_cnt
;
1358 __le32 fina_timeout
;
1359 __le32 unresponded_rts
;
1360 __le32 rxe_frame_limit_overrun
;
1361 __le32 sent_ack_cnt
;
1362 __le32 sent_cts_cnt
;
1363 } __attribute__ ((packed
));
1365 struct statistics_rx_non_phy
{
1366 __le32 bogus_cts
; /* CTS received when not expecting CTS */
1367 __le32 bogus_ack
; /* ACK received when not expecting ACK */
1368 __le32 non_bssid_frames
; /* number of frames with BSSID that
1369 * doesn't belong to the STA BSSID */
1370 __le32 filtered_frames
; /* count frames that were dumped in the
1371 * filtering process */
1372 __le32 non_channel_beacons
; /* beacons with our bss id but not on
1373 * our serving channel */
1374 } __attribute__ ((packed
));
1376 struct statistics_rx
{
1377 struct statistics_rx_phy ofdm
;
1378 struct statistics_rx_phy cck
;
1379 struct statistics_rx_non_phy general
;
1380 } __attribute__ ((packed
));
1382 struct statistics_tx
{
1383 __le32 preamble_cnt
;
1384 __le32 rx_detected_cnt
;
1385 __le32 bt_prio_defer_cnt
;
1386 __le32 bt_prio_kill_cnt
;
1387 __le32 few_bytes_cnt
;
1390 __le32 expected_ack_cnt
;
1391 __le32 actual_ack_cnt
;
1392 } __attribute__ ((packed
));
1394 struct statistics_dbg
{
1398 } __attribute__ ((packed
));
1400 struct statistics_div
{
1405 } __attribute__ ((packed
));
1407 struct statistics_general
{
1409 struct statistics_dbg dbg
;
1413 __le32 ttl_timestamp
;
1414 struct statistics_div div
;
1415 } __attribute__ ((packed
));
1418 * REPLY_STATISTICS_CMD = 0x9c,
1419 * 3945 and 4965 identical.
1421 * This command triggers an immediate response containing uCode statistics.
1422 * The response is in the same format as STATISTICS_NOTIFICATION 0x9d, below.
1424 * If the CLEAR_STATS configuration flag is set, uCode will clear its
1425 * internal copy of the statistics (counters) after issuing the response.
1426 * This flag does not affect STATISTICS_NOTIFICATIONs after beacons (see below).
1428 * If the DISABLE_NOTIF configuration flag is set, uCode will not issue
1429 * STATISTICS_NOTIFICATIONs after received beacons (see below). This flag
1430 * does not affect the response to the REPLY_STATISTICS_CMD 0x9c itself.
1432 #define IWL_STATS_CONF_CLEAR_STATS __constant_cpu_to_le32(0x1) /* see above */
1433 #define IWL_STATS_CONF_DISABLE_NOTIF __constant_cpu_to_le32(0x2)/* see above */
1434 struct iwl3945_statistics_cmd
{
1435 __le32 configuration_flags
; /* IWL_STATS_CONF_* */
1436 } __attribute__ ((packed
));
1439 * STATISTICS_NOTIFICATION = 0x9d (notification only, not a command)
1441 * By default, uCode issues this notification after receiving a beacon
1442 * while associated. To disable this behavior, set DISABLE_NOTIF flag in the
1443 * REPLY_STATISTICS_CMD 0x9c, above.
1445 * Statistics counters continue to increment beacon after beacon, but are
1446 * cleared when changing channels or when driver issues REPLY_STATISTICS_CMD
1447 * 0x9c with CLEAR_STATS bit set (see above).
1449 * uCode also issues this notification during scans. uCode clears statistics
1450 * appropriately so that each notification contains statistics for only the
1451 * one channel that has just been scanned.
1453 #define STATISTICS_REPLY_FLG_BAND_24G_MSK __constant_cpu_to_le32(0x2)
1454 #define STATISTICS_REPLY_FLG_FAT_MODE_MSK __constant_cpu_to_le32(0x8)
1455 struct iwl3945_notif_statistics
{
1457 struct statistics_rx rx
;
1458 struct statistics_tx tx
;
1459 struct statistics_general general
;
1460 } __attribute__ ((packed
));
1464 * MISSED_BEACONS_NOTIFICATION = 0xa2 (notification only, not a command)
1466 /* if ucode missed CONSECUTIVE_MISSED_BCONS_TH beacons in a row,
1467 * then this notification will be sent. */
1468 #define CONSECUTIVE_MISSED_BCONS_TH 20
1470 struct iwl3945_missed_beacon_notif
{
1471 __le32 consequtive_missed_beacons
;
1472 __le32 total_missed_becons
;
1473 __le32 num_expected_beacons
;
1474 __le32 num_recvd_beacons
;
1475 } __attribute__ ((packed
));
1477 /******************************************************************************
1479 * Rx Calibration Commands:
1481 *****************************************************************************/
1483 #define PHY_CALIBRATE_DIFF_GAIN_CMD (7)
1484 #define HD_TABLE_SIZE (11)
1486 struct iwl3945_sensitivity_cmd
{
1488 __le16 table
[HD_TABLE_SIZE
];
1489 } __attribute__ ((packed
));
1491 struct iwl3945_calibration_cmd
{
1499 } __attribute__ ((packed
));
1501 /******************************************************************************
1503 * Miscellaneous Commands:
1505 *****************************************************************************/
1508 * LEDs Command & Response
1509 * REPLY_LEDS_CMD = 0x48 (command, has simple generic response)
1511 * For each of 3 possible LEDs (Activity/Link/Tech, selected by "id" field),
1512 * this command turns it on or off, or sets up a periodic blinking cycle.
1514 struct iwl3945_led_cmd
{
1515 __le32 interval
; /* "interval" in uSec */
1516 u8 id
; /* 1: Activity, 2: Link, 3: Tech */
1517 u8 off
; /* # intervals off while blinking;
1518 * "0", with >0 "on" value, turns LED on */
1519 u8 on
; /* # intervals on while blinking;
1520 * "0", regardless of "off", turns LED off */
1522 } __attribute__ ((packed
));
1524 /******************************************************************************
1526 * Union of all expected notifications/responses:
1528 *****************************************************************************/
1530 struct iwl3945_rx_packet
{
1532 struct iwl3945_cmd_header hdr
;
1534 struct iwl3945_alive_resp alive_frame
;
1535 struct iwl3945_rx_frame rx_frame
;
1536 struct iwl3945_tx_resp tx_resp
;
1537 struct iwl3945_spectrum_notification spectrum_notif
;
1538 struct iwl3945_csa_notification csa_notif
;
1539 struct iwl3945_error_resp err_resp
;
1540 struct iwl3945_card_state_notif card_state_notif
;
1541 struct iwl3945_beacon_notif beacon_status
;
1542 struct iwl3945_add_sta_resp add_sta
;
1543 struct iwl3945_sleep_notification sleep_notif
;
1544 struct iwl3945_spectrum_resp spectrum
;
1545 struct iwl3945_notif_statistics stats
;
1549 } __attribute__ ((packed
));
1551 #define IWL_RX_FRAME_SIZE (4 + sizeof(struct iwl3945_rx_frame))
1553 #endif /* __iwl3945_3945_commands_h__ */