aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-3945-commands.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-3945-commands.h')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-3945-commands.h525
1 files changed, 4 insertions, 521 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945-commands.h b/drivers/net/wireless/iwlwifi/iwl-3945-commands.h
index acc584f4377b..fe71e0aa3715 100644
--- a/drivers/net/wireless/iwlwifi/iwl-3945-commands.h
+++ b/drivers/net/wireless/iwlwifi/iwl-3945-commands.h
@@ -69,64 +69,12 @@
69#ifndef __iwl_3945_commands_h__ 69#ifndef __iwl_3945_commands_h__
70#define __iwl_3945_commands_h__ 70#define __iwl_3945_commands_h__
71 71
72/* uCode version contains 4 values: Major/Minor/API/Serial */
73#define IWL_UCODE_MAJOR(ver) (((ver) & 0xFF000000) >> 24)
74#define IWL_UCODE_MINOR(ver) (((ver) & 0x00FF0000) >> 16)
75#define IWL_UCODE_API(ver) (((ver) & 0x0000FF00) >> 8)
76#define IWL_UCODE_SERIAL(ver) ((ver) & 0x000000FF)
77
78
79/* Tx rates */
80#define IWL_CCK_RATES 4
81#define IWL_OFDM_RATES 8
82#define IWL_MAX_RATES (IWL_CCK_RATES + IWL_OFDM_RATES)
83
84/****************************************************************************** 72/******************************************************************************
85 * (0) 73 * (0)
86 * Commonly used structures and definitions: 74 * Commonly used structures and definitions:
87 * Command header, txpower 75 * Command header, txpower
88 * 76 *
89 *****************************************************************************/ 77 *****************************************************************************/
90
91/* iwl3945_cmd_header flags value */
92#define IWL_CMD_FAILED_MSK 0x40
93
94/**
95 * struct iwl3945_cmd_header
96 *
97 * This header format appears in the beginning of each command sent from the
98 * driver, and each response/notification received from uCode.
99 */
100struct iwl3945_cmd_header {
101 u8 cmd; /* Command ID: REPLY_RXON, etc. */
102 u8 flags; /* IWL_CMD_* */
103 /*
104 * The driver sets up the sequence number to values of its choosing.
105 * uCode does not use this value, but passes it back to the driver
106 * when sending the response to each driver-originated command, so
107 * the driver can match the response to the command. Since the values
108 * don't get used by uCode, the driver may set up an arbitrary format.
109 *
110 * There is one exception: uCode sets bit 15 when it originates
111 * the response/notification, i.e. when the response/notification
112 * is not a direct response to a command sent by the driver. For
113 * example, uCode issues REPLY_3945_RX when it sends a received frame
114 * to the driver; it is not a direct response to any driver command.
115 *
116 * The Linux driver uses the following format:
117 *
118 * 0:7 index/position within Tx queue
119 * 8:13 Tx queue selection
120 * 14:14 driver sets this to indicate command is in the 'huge'
121 * storage at the end of the command buffers, i.e. scan cmd
122 * 15:15 uCode sets this in uCode-originated response/notification
123 */
124 __le16 sequence;
125
126 /* command or response/notification data follows immediately */
127 u8 data[0];
128} __attribute__ ((packed));
129
130/** 78/**
131 * struct iwl3945_tx_power 79 * struct iwl3945_tx_power
132 * 80 *
@@ -163,8 +111,6 @@ struct iwl3945_power_per_rate {
163 * 111 *
164 *****************************************************************************/ 112 *****************************************************************************/
165 113
166#define UCODE_VALID_OK cpu_to_le32(0x1)
167#define INITIALIZE_SUBTYPE (9)
168 114
169/* 115/*
170 * ("Initialize") REPLY_ALIVE = 0x1 (response only, not a command) 116 * ("Initialize") REPLY_ALIVE = 0x1 (response only, not a command)
@@ -252,45 +198,6 @@ struct iwl3945_error_resp {
252 * 198 *
253 *****************************************************************************/ 199 *****************************************************************************/
254 200
255/* rx_config flags */
256/* band & modulation selection */
257#define RXON_FLG_BAND_24G_MSK cpu_to_le32(1 << 0)
258#define RXON_FLG_CCK_MSK cpu_to_le32(1 << 1)
259/* auto detection enable */
260#define RXON_FLG_AUTO_DETECT_MSK cpu_to_le32(1 << 2)
261/* TGg protection when tx */
262#define RXON_FLG_TGG_PROTECT_MSK cpu_to_le32(1 << 3)
263/* cck short slot & preamble */
264#define RXON_FLG_SHORT_SLOT_MSK cpu_to_le32(1 << 4)
265#define RXON_FLG_SHORT_PREAMBLE_MSK cpu_to_le32(1 << 5)
266/* antenna selection */
267#define RXON_FLG_DIS_DIV_MSK cpu_to_le32(1 << 7)
268#define RXON_FLG_ANT_SEL_MSK cpu_to_le32(0x0f00)
269#define RXON_FLG_ANT_A_MSK cpu_to_le32(1 << 8)
270#define RXON_FLG_ANT_B_MSK cpu_to_le32(1 << 9)
271/* radar detection enable */
272#define RXON_FLG_RADAR_DETECT_MSK cpu_to_le32(1 << 12)
273#define RXON_FLG_TGJ_NARROW_BAND_MSK cpu_to_le32(1 << 13)
274/* rx response to host with 8-byte TSF
275* (according to ON_AIR deassertion) */
276#define RXON_FLG_TSF2HOST_MSK cpu_to_le32(1 << 15)
277
278/* rx_config filter flags */
279/* accept all data frames */
280#define RXON_FILTER_PROMISC_MSK cpu_to_le32(1 << 0)
281/* pass control & management to host */
282#define RXON_FILTER_CTL2HOST_MSK cpu_to_le32(1 << 1)
283/* accept multi-cast */
284#define RXON_FILTER_ACCEPT_GRP_MSK cpu_to_le32(1 << 2)
285/* don't decrypt uni-cast frames */
286#define RXON_FILTER_DIS_DECRYPT_MSK cpu_to_le32(1 << 3)
287/* don't decrypt multi-cast frames */
288#define RXON_FILTER_DIS_GRP_DECRYPT_MSK cpu_to_le32(1 << 4)
289/* STA is associated */
290#define RXON_FILTER_ASSOC_MSK cpu_to_le32(1 << 5)
291/* transfer to host non bssid beacons in associated state */
292#define RXON_FILTER_BCON_AWARE_MSK cpu_to_le32(1 << 6)
293
294/** 201/**
295 * REPLY_RXON = 0x10 (command, has simple generic response) 202 * REPLY_RXON = 0x10 (command, has simple generic response)
296 * 203 *
@@ -363,121 +270,12 @@ struct iwl3945_channel_switch_cmd {
363 struct iwl3945_power_per_rate power[IWL_MAX_RATES]; 270 struct iwl3945_power_per_rate power[IWL_MAX_RATES];
364} __attribute__ ((packed)); 271} __attribute__ ((packed));
365 272
366/*
367 * CHANNEL_SWITCH_NOTIFICATION = 0x73 (notification only, not a command)
368 */
369struct iwl3945_csa_notification {
370 __le16 band;
371 __le16 channel;
372 __le32 status; /* 0 - OK, 1 - fail */
373} __attribute__ ((packed));
374
375/******************************************************************************
376 * (2)
377 * Quality-of-Service (QOS) Commands & Responses:
378 *
379 *****************************************************************************/
380
381/**
382 * struct iwl_ac_qos -- QOS timing params for REPLY_QOS_PARAM
383 * One for each of 4 EDCA access categories in struct iwl_qosparam_cmd
384 *
385 * @cw_min: Contention window, start value in numbers of slots.
386 * Should be a power-of-2, minus 1. Device's default is 0x0f.
387 * @cw_max: Contention window, max value in numbers of slots.
388 * Should be a power-of-2, minus 1. Device's default is 0x3f.
389 * @aifsn: Number of slots in Arbitration Interframe Space (before
390 * performing random backoff timing prior to Tx). Device default 1.
391 * @edca_txop: Length of Tx opportunity, in uSecs. Device default is 0.
392 *
393 * Device will automatically increase contention window by (2*CW) + 1 for each
394 * transmission retry. Device uses cw_max as a bit mask, ANDed with new CW
395 * value, to cap the CW value.
396 */
397struct iwl3945_ac_qos {
398 __le16 cw_min;
399 __le16 cw_max;
400 u8 aifsn;
401 u8 reserved1;
402 __le16 edca_txop;
403} __attribute__ ((packed));
404
405/* QoS flags defines */
406#define QOS_PARAM_FLG_UPDATE_EDCA_MSK cpu_to_le32(0x01)
407#define QOS_PARAM_FLG_TGN_MSK cpu_to_le32(0x02)
408#define QOS_PARAM_FLG_TXOP_TYPE_MSK cpu_to_le32(0x10)
409
410/* Number of Access Categories (AC) (EDCA), queues 0..3 */
411#define AC_NUM 4
412
413/*
414 * REPLY_QOS_PARAM = 0x13 (command, has simple generic response)
415 *
416 * This command sets up timings for each of the 4 prioritized EDCA Tx FIFOs
417 * 0: Background, 1: Best Effort, 2: Video, 3: Voice.
418 */
419struct iwl3945_qosparam_cmd {
420 __le32 qos_flags;
421 struct iwl3945_ac_qos ac[AC_NUM];
422} __attribute__ ((packed));
423
424/****************************************************************************** 273/******************************************************************************
425 * (3) 274 * (3)
426 * Add/Modify Stations Commands & Responses: 275 * Add/Modify Stations Commands & Responses:
427 * 276 *
428 *****************************************************************************/ 277 *****************************************************************************/
429/* 278/*
430 * Multi station support
431 */
432
433/* Special, dedicated locations within device's station table */
434#define IWL_AP_ID 0
435#define IWL_MULTICAST_ID 1
436#define IWL_STA_ID 2
437#define IWL3945_BROADCAST_ID 24
438#define IWL3945_STATION_COUNT 25
439
440#define IWL_STATION_COUNT 32 /* MAX(3945,4965)*/
441#define IWL_INVALID_STATION 255
442
443#define STA_FLG_TX_RATE_MSK cpu_to_le32(1 << 2);
444#define STA_FLG_PWR_SAVE_MSK cpu_to_le32(1 << 8);
445
446/* Use in mode field. 1: modify existing entry, 0: add new station entry */
447#define STA_CONTROL_MODIFY_MSK 0x01
448
449/* key flags __le16*/
450#define STA_KEY_FLG_ENCRYPT_MSK cpu_to_le16(0x0007)
451#define STA_KEY_FLG_NO_ENC cpu_to_le16(0x0000)
452#define STA_KEY_FLG_WEP cpu_to_le16(0x0001)
453#define STA_KEY_FLG_CCMP cpu_to_le16(0x0002)
454#define STA_KEY_FLG_TKIP cpu_to_le16(0x0003)
455
456#define STA_KEY_FLG_KEYID_POS 8
457#define STA_KEY_FLG_INVALID cpu_to_le16(0x0800)
458/* wep key is either from global key (0) or from station info array (1) */
459#define STA_KEY_FLG_WEP_KEY_MAP_MSK cpu_to_le16(0x0008)
460
461/* wep key in STA: 5-bytes (0) or 13-bytes (1) */
462#define STA_KEY_FLG_KEY_SIZE_MSK cpu_to_le16(0x1000)
463#define STA_KEY_MULTICAST_MSK cpu_to_le16(0x4000)
464
465/* Flags indicate whether to modify vs. don't change various station params */
466#define STA_MODIFY_KEY_MASK 0x01
467#define STA_MODIFY_TID_DISABLE_TX 0x02
468#define STA_MODIFY_TX_RATE_MSK 0x04
469
470struct iwl3945_keyinfo {
471 __le16 key_flags;
472 u8 tkip_rx_tsc_byte2; /* TSC[2] for key mix ph1 detection */
473 u8 reserved1;
474 __le16 tkip_rx_ttak[5]; /* 10-byte unicast TKIP TTAK */
475 u8 key_offset;
476 u8 reserved2;
477 u8 key[16]; /* 16-byte unicast decryption key */
478} __attribute__ ((packed));
479
480/*
481 * REPLY_ADD_STA = 0x18 (command) 279 * REPLY_ADD_STA = 0x18 (command)
482 * 280 *
483 * The device contains an internal table of per-station information, 281 * The device contains an internal table of per-station information,
@@ -506,7 +304,7 @@ struct iwl3945_addsta_cmd {
506 u8 mode; /* 1: modify existing, 0: add new station */ 304 u8 mode; /* 1: modify existing, 0: add new station */
507 u8 reserved[3]; 305 u8 reserved[3];
508 struct sta_id_modify sta; 306 struct sta_id_modify sta;
509 struct iwl3945_keyinfo key; 307 struct iwl4965_keyinfo key;
510 __le32 station_flags; /* STA_FLG_* */ 308 __le32 station_flags; /* STA_FLG_* */
511 __le32 station_flags_msk; /* STA_FLG_* */ 309 __le32 station_flags_msk; /* STA_FLG_* */
512 310
@@ -530,16 +328,6 @@ struct iwl3945_addsta_cmd {
530 __le16 add_immediate_ba_ssn; 328 __le16 add_immediate_ba_ssn;
531} __attribute__ ((packed)); 329} __attribute__ ((packed));
532 330
533#define ADD_STA_SUCCESS_MSK 0x1
534#define ADD_STA_NO_ROOM_IN_TABLE 0x2
535#define ADD_STA_NO_BLOCK_ACK_RESOURCE 0x4
536/*
537 * REPLY_ADD_STA = 0x18 (response)
538 */
539struct iwl3945_add_sta_resp {
540 u8 status; /* ADD_STA_* */
541} __attribute__ ((packed));
542
543 331
544/****************************************************************************** 332/******************************************************************************
545 * (4) 333 * (4)
@@ -566,26 +354,7 @@ struct iwl3945_rx_frame_hdr {
566 u8 payload[0]; 354 u8 payload[0];
567} __attribute__ ((packed)); 355} __attribute__ ((packed));
568 356
569#define RX_RES_STATUS_NO_CRC32_ERROR cpu_to_le32(1 << 0)
570#define RX_RES_STATUS_NO_RXE_OVERFLOW cpu_to_le32(1 << 1)
571 357
572#define RX_RES_PHY_FLAGS_BAND_24_MSK cpu_to_le16(1 << 0)
573#define RX_RES_PHY_FLAGS_MOD_CCK_MSK cpu_to_le16(1 << 1)
574#define RX_RES_PHY_FLAGS_SHORT_PREAMBLE_MSK cpu_to_le16(1 << 2)
575#define RX_RES_PHY_FLAGS_NARROW_BAND_MSK cpu_to_le16(1 << 3)
576#define RX_RES_PHY_FLAGS_ANTENNA_MSK cpu_to_le16(0xf0)
577
578#define RX_RES_STATUS_SEC_TYPE_MSK (0x7 << 8)
579#define RX_RES_STATUS_SEC_TYPE_NONE (0x0 << 8)
580#define RX_RES_STATUS_SEC_TYPE_WEP (0x1 << 8)
581#define RX_RES_STATUS_SEC_TYPE_CCMP (0x2 << 8)
582#define RX_RES_STATUS_SEC_TYPE_TKIP (0x3 << 8)
583
584#define RX_RES_STATUS_DECRYPT_TYPE_MSK (0x3 << 11)
585#define RX_RES_STATUS_NOT_DECRYPT (0x0 << 11)
586#define RX_RES_STATUS_DECRYPT_OK (0x3 << 11)
587#define RX_RES_STATUS_BAD_ICV_MIC (0x1 << 11)
588#define RX_RES_STATUS_BAD_KEY_TTAK (0x2 << 11)
589 358
590struct iwl3945_rx_frame_end { 359struct iwl3945_rx_frame_end {
591 __le32 status; 360 __le32 status;
@@ -629,83 +398,6 @@ struct iwl3945_rx_frame {
629 * This command must be executed after every RXON command, before Tx can occur. 398 * This command must be executed after every RXON command, before Tx can occur.
630 *****************************************************************************/ 399 *****************************************************************************/
631 400
632/* REPLY_TX Tx flags field */
633
634/* 1: Use Request-To-Send protocol before this frame.
635 * Mutually exclusive vs. TX_CMD_FLG_CTS_MSK. */
636#define TX_CMD_FLG_RTS_MSK cpu_to_le32(1 << 1)
637
638/* 1: Transmit Clear-To-Send to self before this frame.
639 * Driver should set this for AUTH/DEAUTH/ASSOC-REQ/REASSOC mgmnt frames.
640 * Mutually exclusive vs. TX_CMD_FLG_RTS_MSK. */
641#define TX_CMD_FLG_CTS_MSK cpu_to_le32(1 << 2)
642
643/* 1: Expect ACK from receiving station
644 * 0: Don't expect ACK (MAC header's duration field s/b 0)
645 * Set this for unicast frames, but not broadcast/multicast. */
646#define TX_CMD_FLG_ACK_MSK cpu_to_le32(1 << 3)
647
648/* 1: Use rate scale table (see REPLY_TX_LINK_QUALITY_CMD).
649 * Tx command's initial_rate_index indicates first rate to try;
650 * uCode walks through table for additional Tx attempts.
651 * 0: Use Tx rate/MCS from Tx command's rate_n_flags field.
652 * This rate will be used for all Tx attempts; it will not be scaled. */
653#define TX_CMD_FLG_STA_RATE_MSK cpu_to_le32(1 << 4)
654
655/* 1: Expect immediate block-ack.
656 * Set when Txing a block-ack request frame. Also set TX_CMD_FLG_ACK_MSK. */
657#define TX_CMD_FLG_IMM_BA_RSP_MASK cpu_to_le32(1 << 6)
658
659/* 1: Frame requires full Tx-Op protection.
660 * Set this if either RTS or CTS Tx Flag gets set. */
661#define TX_CMD_FLG_FULL_TXOP_PROT_MSK cpu_to_le32(1 << 7)
662
663/* Tx antenna selection field; used only for 3945, reserved (0) for 4965.
664 * Set field to "0" to allow 3945 uCode to select antenna (normal usage). */
665#define TX_CMD_FLG_ANT_SEL_MSK cpu_to_le32(0xf00)
666#define TX_CMD_FLG_ANT_A_MSK cpu_to_le32(1 << 8)
667#define TX_CMD_FLG_ANT_B_MSK cpu_to_le32(1 << 9)
668
669/* 1: Ignore Bluetooth priority for this frame.
670 * 0: Delay Tx until Bluetooth device is done (normal usage). */
671#define TX_CMD_FLG_BT_DIS_MSK cpu_to_le32(1 << 12)
672
673/* 1: uCode overrides sequence control field in MAC header.
674 * 0: Driver provides sequence control field in MAC header.
675 * Set this for management frames, non-QOS data frames, non-unicast frames,
676 * and also in Tx command embedded in REPLY_SCAN_CMD for active scans. */
677#define TX_CMD_FLG_SEQ_CTL_MSK cpu_to_le32(1 << 13)
678
679/* 1: This frame is non-last MPDU; more fragments are coming.
680 * 0: Last fragment, or not using fragmentation. */
681#define TX_CMD_FLG_MORE_FRAG_MSK cpu_to_le32(1 << 14)
682
683/* 1: uCode calculates and inserts Timestamp Function (TSF) in outgoing frame.
684 * 0: No TSF required in outgoing frame.
685 * Set this for transmitting beacons and probe responses. */
686#define TX_CMD_FLG_TSF_MSK cpu_to_le32(1 << 16)
687
688/* 1: Driver inserted 2 bytes pad after the MAC header, for (required) dword
689 * alignment of frame's payload data field.
690 * 0: No pad
691 * Set this for MAC headers with 26 or 30 bytes, i.e. those with QOS or ADDR4
692 * field (but not both). Driver must align frame data (i.e. data following
693 * MAC header) to DWORD boundary. */
694#define TX_CMD_FLG_MH_PAD_MSK cpu_to_le32(1 << 20)
695
696/* HCCA-AP - disable duration overwriting. */
697#define TX_CMD_FLG_DUR_MSK cpu_to_le32(1 << 25)
698
699/*
700 * TX command security control
701 */
702#define TX_CMD_SEC_WEP 0x01
703#define TX_CMD_SEC_CCM 0x02
704#define TX_CMD_SEC_TKIP 0x03
705#define TX_CMD_SEC_MSK 0x03
706#define TX_CMD_SEC_SHIFT 6
707#define TX_CMD_SEC_KEY128 0x08
708
709/* 401/*
710 * REPLY_TX = 0x1c (command) 402 * REPLY_TX = 0x1c (command)
711 */ 403 */
@@ -819,59 +511,6 @@ struct iwl3945_rate_scaling_cmd {
819 struct iwl3945_rate_scaling_info table[IWL_MAX_RATES]; 511 struct iwl3945_rate_scaling_info table[IWL_MAX_RATES];
820} __attribute__ ((packed)); 512} __attribute__ ((packed));
821 513
822/*
823 * REPLY_BT_CONFIG = 0x9b (command, has simple generic response)
824 *
825 * 3945 and 4965 support hardware handshake with Bluetooth device on
826 * same platform. Bluetooth device alerts wireless device when it will Tx;
827 * wireless device can delay or kill its own Tx to accommodate.
828 */
829struct iwl3945_bt_cmd {
830 u8 flags;
831 u8 lead_time;
832 u8 max_kill;
833 u8 reserved;
834 __le32 kill_ack_mask;
835 __le32 kill_cts_mask;
836} __attribute__ ((packed));
837
838/******************************************************************************
839 * (6)
840 * Spectrum Management (802.11h) Commands, Responses, Notifications:
841 *
842 *****************************************************************************/
843
844/*
845 * Spectrum Management
846 */
847#define MEASUREMENT_FILTER_FLAG (RXON_FILTER_PROMISC_MSK | \
848 RXON_FILTER_CTL2HOST_MSK | \
849 RXON_FILTER_ACCEPT_GRP_MSK | \
850 RXON_FILTER_DIS_DECRYPT_MSK | \
851 RXON_FILTER_DIS_GRP_DECRYPT_MSK | \
852 RXON_FILTER_ASSOC_MSK | \
853 RXON_FILTER_BCON_AWARE_MSK)
854
855struct iwl3945_measure_channel {
856 __le32 duration; /* measurement duration in extended beacon
857 * format */
858 u8 channel; /* channel to measure */
859 u8 type; /* see enum iwl3945_measure_type */
860 __le16 reserved;
861} __attribute__ ((packed));
862
863
864#define HW_CARD_DISABLED 0x01
865#define SW_CARD_DISABLED 0x02
866#define RF_CARD_DISABLED 0x04
867#define RXON_CARD_DISABLED 0x10
868
869struct iwl3945_ct_kill_config {
870 __le32 reserved;
871 __le32 critical_temperature_M;
872 __le32 critical_temperature_R;
873} __attribute__ ((packed));
874
875/****************************************************************************** 514/******************************************************************************
876 * (8) 515 * (8)
877 * Scan Commands, Responses, Notifications: 516 * Scan Commands, Responses, Notifications:
@@ -912,24 +551,6 @@ struct iwl3945_scan_channel {
912 __le16 passive_dwell; /* in 1024-uSec TU (time units), typ 20-500 */ 551 __le16 passive_dwell; /* in 1024-uSec TU (time units), typ 20-500 */
913} __attribute__ ((packed)); 552} __attribute__ ((packed));
914 553
915/**
916 * struct iwl3945_ssid_ie - directed scan network information element
917 *
918 * Up to 4 of these may appear in REPLY_SCAN_CMD, selected by "type" field
919 * in struct iwl3945_scan_channel; each channel may select different ssids from
920 * among the 4 entries. SSID IEs get transmitted in reverse order of entry.
921 */
922struct iwl3945_ssid_ie {
923 u8 id;
924 u8 len;
925 u8 ssid[32];
926} __attribute__ ((packed));
927
928/* uCode API-1 take 4 probes */
929#define PROBE_OPTION_MAX_API1 0x4
930#define TX_CMD_LIFE_TIME_INFINITE cpu_to_le32(0xFFFFFFFF)
931#define IWL_GOOD_CRC_TH cpu_to_le16(1)
932#define IWL_MAX_SCAN_SIZE 1024
933 554
934/* 555/*
935 * REPLY_SCAN_CMD = 0x80 (command) 556 * REPLY_SCAN_CMD = 0x80 (command)
@@ -1007,7 +628,7 @@ struct iwl3945_scan_cmd {
1007 struct iwl3945_tx_cmd tx_cmd; 628 struct iwl3945_tx_cmd tx_cmd;
1008 629
1009 /* For directed active scans (set to all-0s otherwise) */ 630 /* For directed active scans (set to all-0s otherwise) */
1010 struct iwl3945_ssid_ie direct_scan[PROBE_OPTION_MAX_API1]; 631 struct iwl_ssid_ie direct_scan[PROBE_OPTION_MAX_API1];
1011 632
1012 /* 633 /*
1013 * Probe request frame, followed by channel list. 634 * Probe request frame, followed by channel list.
@@ -1027,60 +648,6 @@ struct iwl3945_scan_cmd {
1027 u8 data[0]; 648 u8 data[0];
1028} __attribute__ ((packed)); 649} __attribute__ ((packed));
1029 650
1030/* Can abort will notify by complete notification with abort status. */
1031#define CAN_ABORT_STATUS cpu_to_le32(0x1)
1032/* complete notification statuses */
1033#define ABORT_STATUS 0x2
1034
1035/*
1036 * REPLY_SCAN_CMD = 0x80 (response)
1037 */
1038struct iwl3945_scanreq_notification {
1039 __le32 status; /* 1: okay, 2: cannot fulfill request */
1040} __attribute__ ((packed));
1041
1042/*
1043 * SCAN_START_NOTIFICATION = 0x82 (notification only, not a command)
1044 */
1045struct iwl3945_scanstart_notification {
1046 __le32 tsf_low;
1047 __le32 tsf_high;
1048 __le32 beacon_timer;
1049 u8 channel;
1050 u8 band;
1051 u8 reserved[2];
1052 __le32 status;
1053} __attribute__ ((packed));
1054
1055#define SCAN_OWNER_STATUS 0x1;
1056#define MEASURE_OWNER_STATUS 0x2;
1057
1058#define NUMBER_OF_STATISTICS 1 /* first __le32 is good CRC */
1059/*
1060 * SCAN_RESULTS_NOTIFICATION = 0x83 (notification only, not a command)
1061 */
1062struct iwl3945_scanresults_notification {
1063 u8 channel;
1064 u8 band;
1065 u8 reserved[2];
1066 __le32 tsf_low;
1067 __le32 tsf_high;
1068 __le32 statistics[NUMBER_OF_STATISTICS];
1069} __attribute__ ((packed));
1070
1071/*
1072 * SCAN_COMPLETE_NOTIFICATION = 0x84 (notification only, not a command)
1073 */
1074struct iwl3945_scancomplete_notification {
1075 u8 scanned_channels;
1076 u8 status;
1077 u8 reserved;
1078 u8 last_channel;
1079 __le32 tsf_low;
1080 __le32 tsf_high;
1081} __attribute__ ((packed));
1082
1083
1084/****************************************************************************** 651/******************************************************************************
1085 * (9) 652 * (9)
1086 * IBSS/AP Commands and Notifications: 653 * IBSS/AP Commands and Notifications:
@@ -1179,27 +746,6 @@ struct iwl39_statistics_general {
1179} __attribute__ ((packed)); 746} __attribute__ ((packed));
1180 747
1181/* 748/*
1182 * REPLY_STATISTICS_CMD = 0x9c,
1183 * 3945 and 4965 identical.
1184 *
1185 * This command triggers an immediate response containing uCode statistics.
1186 * The response is in the same format as STATISTICS_NOTIFICATION 0x9d, below.
1187 *
1188 * If the CLEAR_STATS configuration flag is set, uCode will clear its
1189 * internal copy of the statistics (counters) after issuing the response.
1190 * This flag does not affect STATISTICS_NOTIFICATIONs after beacons (see below).
1191 *
1192 * If the DISABLE_NOTIF configuration flag is set, uCode will not issue
1193 * STATISTICS_NOTIFICATIONs after received beacons (see below). This flag
1194 * does not affect the response to the REPLY_STATISTICS_CMD 0x9c itself.
1195 */
1196#define IWL_STATS_CONF_CLEAR_STATS cpu_to_le32(0x1) /* see above */
1197#define IWL_STATS_CONF_DISABLE_NOTIF cpu_to_le32(0x2)/* see above */
1198struct iwl3945_statistics_cmd {
1199 __le32 configuration_flags; /* IWL_STATS_CONF_* */
1200} __attribute__ ((packed));
1201
1202/*
1203 * STATISTICS_NOTIFICATION = 0x9d (notification only, not a command) 749 * STATISTICS_NOTIFICATION = 0x9d (notification only, not a command)
1204 * 750 *
1205 * By default, uCode issues this notification after receiving a beacon 751 * By default, uCode issues this notification after receiving a beacon
@@ -1214,8 +760,6 @@ struct iwl3945_statistics_cmd {
1214 * appropriately so that each notification contains statistics for only the 760 * appropriately so that each notification contains statistics for only the
1215 * one channel that has just been scanned. 761 * one channel that has just been scanned.
1216 */ 762 */
1217#define STATISTICS_REPLY_FLG_BAND_24G_MSK cpu_to_le32(0x2)
1218#define STATISTICS_REPLY_FLG_FAT_MODE_MSK cpu_to_le32(0x8)
1219struct iwl3945_notif_statistics { 763struct iwl3945_notif_statistics {
1220 __le32 flag; 764 __le32 flag;
1221 struct statistics_rx rx; 765 struct statistics_rx rx;
@@ -1224,67 +768,6 @@ struct iwl3945_notif_statistics {
1224} __attribute__ ((packed)); 768} __attribute__ ((packed));
1225 769
1226 770
1227/*
1228 * MISSED_BEACONS_NOTIFICATION = 0xa2 (notification only, not a command)
1229 */
1230/* if ucode missed CONSECUTIVE_MISSED_BCONS_TH beacons in a row,
1231 * then this notification will be sent. */
1232#define CONSECUTIVE_MISSED_BCONS_TH 20
1233
1234struct iwl3945_missed_beacon_notif {
1235 __le32 consequtive_missed_beacons;
1236 __le32 total_missed_becons;
1237 __le32 num_expected_beacons;
1238 __le32 num_recvd_beacons;
1239} __attribute__ ((packed));
1240
1241/******************************************************************************
1242 * (11)
1243 * Rx Calibration Commands:
1244 *
1245 *****************************************************************************/
1246
1247#define PHY_CALIBRATE_DIFF_GAIN_CMD (7)
1248#define HD_TABLE_SIZE (11)
1249
1250struct iwl3945_sensitivity_cmd {
1251 __le16 control;
1252 __le16 table[HD_TABLE_SIZE];
1253} __attribute__ ((packed));
1254
1255struct iwl3945_calibration_cmd {
1256 u8 opCode;
1257 u8 flags;
1258 __le16 reserved;
1259 s8 diff_gain_a;
1260 s8 diff_gain_b;
1261 s8 diff_gain_c;
1262 u8 reserved1;
1263} __attribute__ ((packed));
1264
1265/******************************************************************************
1266 * (12)
1267 * Miscellaneous Commands:
1268 *
1269 *****************************************************************************/
1270
1271/*
1272 * LEDs Command & Response
1273 * REPLY_LEDS_CMD = 0x48 (command, has simple generic response)
1274 *
1275 * For each of 3 possible LEDs (Activity/Link/Tech, selected by "id" field),
1276 * this command turns it on or off, or sets up a periodic blinking cycle.
1277 */
1278struct iwl3945_led_cmd {
1279 __le32 interval; /* "interval" in uSec */
1280 u8 id; /* 1: Activity, 2: Link, 3: Tech */
1281 u8 off; /* # intervals off while blinking;
1282 * "0", with >0 "on" value, turns LED on */
1283 u8 on; /* # intervals on while blinking;
1284 * "0", regardless of "off", turns LED off */
1285 u8 reserved;
1286} __attribute__ ((packed));
1287
1288/****************************************************************************** 771/******************************************************************************
1289 * (13) 772 * (13)
1290 * Union of all expected notifications/responses: 773 * Union of all expected notifications/responses:
@@ -1293,7 +776,7 @@ struct iwl3945_led_cmd {
1293 776
1294struct iwl3945_rx_packet { 777struct iwl3945_rx_packet {
1295 __le32 len; 778 __le32 len;
1296 struct iwl3945_cmd_header hdr; 779 struct iwl_cmd_header hdr;
1297 union { 780 union {
1298 struct iwl3945_alive_resp alive_frame; 781 struct iwl3945_alive_resp alive_frame;
1299 struct iwl3945_rx_frame rx_frame; 782 struct iwl3945_rx_frame rx_frame;
@@ -1303,7 +786,7 @@ struct iwl3945_rx_packet {
1303 struct iwl3945_error_resp err_resp; 786 struct iwl3945_error_resp err_resp;
1304 struct iwl_card_state_notif card_state_notif; 787 struct iwl_card_state_notif card_state_notif;
1305 struct iwl3945_beacon_notif beacon_status; 788 struct iwl3945_beacon_notif beacon_status;
1306 struct iwl3945_add_sta_resp add_sta; 789 struct iwl_add_sta_resp add_sta;
1307 struct iwl_sleep_notification sleep_notif; 790 struct iwl_sleep_notification sleep_notif;
1308 struct iwl_spectrum_resp spectrum; 791 struct iwl_spectrum_resp spectrum;
1309 struct iwl3945_notif_statistics stats; 792 struct iwl3945_notif_statistics stats;