diff options
author | Tomas Winkler <tomas.winkler@intel.com> | 2008-12-18 21:37:05 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-01-29 15:58:53 -0500 |
commit | 4c897253cc9ae1c6a2798b27b5fe8e6d94ab6185 (patch) | |
tree | fa9538d37c07da9134e35ce96e6e8a00fa956696 /drivers/net/wireless | |
parent | 600c0e11ea6161e00e8cb4b4dda39a64ce988c60 (diff) |
iwlwifi: 3945 remove duplicated code from iwl-3945-commands.h
This patch remove trivial (renames) commands and defines
from iwl-3945-commands.h
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Acked-by: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-3945-commands.h | 525 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-3945-led.c | 13 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-3945.h | 10 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-commands.h | 11 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl3945-base.c | 27 |
5 files changed, 39 insertions, 547 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 | */ | ||
100 | struct 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 | */ | ||
369 | struct 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 | */ | ||
397 | struct 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 | */ | ||
419 | struct 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 | |||
470 | struct 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 | */ | ||
539 | struct 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 | ||
590 | struct iwl3945_rx_frame_end { | 359 | struct 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 | */ | ||
829 | struct 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 | |||
855 | struct 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 | |||
869 | struct 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 | */ | ||
922 | struct 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 | */ | ||
1038 | struct 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 | */ | ||
1045 | struct 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 | */ | ||
1062 | struct 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 | */ | ||
1074 | struct 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 */ | ||
1198 | struct 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) | ||
1219 | struct iwl3945_notif_statistics { | 763 | struct 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 | |||
1234 | struct 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 | |||
1250 | struct iwl3945_sensitivity_cmd { | ||
1251 | __le16 control; | ||
1252 | __le16 table[HD_TABLE_SIZE]; | ||
1253 | } __attribute__ ((packed)); | ||
1254 | |||
1255 | struct 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 | */ | ||
1278 | struct 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 | ||
1294 | struct iwl3945_rx_packet { | 777 | struct 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; |
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945-led.c b/drivers/net/wireless/iwlwifi/iwl-3945-led.c index 525e90bdc47f..b34bef4891b8 100644 --- a/drivers/net/wireless/iwlwifi/iwl-3945-led.c +++ b/drivers/net/wireless/iwlwifi/iwl-3945-led.c | |||
@@ -82,11 +82,11 @@ static inline int iwl3945_brightness_to_idx(enum led_brightness brightness) | |||
82 | 82 | ||
83 | /* Send led command */ | 83 | /* Send led command */ |
84 | static int iwl_send_led_cmd(struct iwl3945_priv *priv, | 84 | static int iwl_send_led_cmd(struct iwl3945_priv *priv, |
85 | struct iwl3945_led_cmd *led_cmd) | 85 | struct iwl_led_cmd *led_cmd) |
86 | { | 86 | { |
87 | struct iwl3945_host_cmd cmd = { | 87 | struct iwl3945_host_cmd cmd = { |
88 | .id = REPLY_LEDS_CMD, | 88 | .id = REPLY_LEDS_CMD, |
89 | .len = sizeof(struct iwl3945_led_cmd), | 89 | .len = sizeof(struct iwl_led_cmd), |
90 | .data = led_cmd, | 90 | .data = led_cmd, |
91 | .meta.flags = CMD_ASYNC, | 91 | .meta.flags = CMD_ASYNC, |
92 | .meta.u.callback = iwl3945_led_cmd_callback, | 92 | .meta.u.callback = iwl3945_led_cmd_callback, |
@@ -101,7 +101,7 @@ static int iwl_send_led_cmd(struct iwl3945_priv *priv, | |||
101 | static int iwl3945_led_pattern(struct iwl3945_priv *priv, int led_id, | 101 | static int iwl3945_led_pattern(struct iwl3945_priv *priv, int led_id, |
102 | unsigned int idx) | 102 | unsigned int idx) |
103 | { | 103 | { |
104 | struct iwl3945_led_cmd led_cmd = { | 104 | struct iwl_led_cmd led_cmd = { |
105 | .id = led_id, | 105 | .id = led_id, |
106 | .interval = IWL_DEF_LED_INTRVL | 106 | .interval = IWL_DEF_LED_INTRVL |
107 | }; | 107 | }; |
@@ -115,11 +115,10 @@ static int iwl3945_led_pattern(struct iwl3945_priv *priv, int led_id, | |||
115 | } | 115 | } |
116 | 116 | ||
117 | 117 | ||
118 | #if 1 | ||
119 | /* Set led on command */ | 118 | /* Set led on command */ |
120 | static int iwl3945_led_on(struct iwl3945_priv *priv, int led_id) | 119 | static int iwl3945_led_on(struct iwl3945_priv *priv, int led_id) |
121 | { | 120 | { |
122 | struct iwl3945_led_cmd led_cmd = { | 121 | struct iwl_led_cmd led_cmd = { |
123 | .id = led_id, | 122 | .id = led_id, |
124 | .on = IWL_LED_SOLID, | 123 | .on = IWL_LED_SOLID, |
125 | .off = 0, | 124 | .off = 0, |
@@ -131,7 +130,7 @@ static int iwl3945_led_on(struct iwl3945_priv *priv, int led_id) | |||
131 | /* Set led off command */ | 130 | /* Set led off command */ |
132 | static int iwl3945_led_off(struct iwl3945_priv *priv, int led_id) | 131 | static int iwl3945_led_off(struct iwl3945_priv *priv, int led_id) |
133 | { | 132 | { |
134 | struct iwl3945_led_cmd led_cmd = { | 133 | struct iwl_led_cmd led_cmd = { |
135 | .id = led_id, | 134 | .id = led_id, |
136 | .on = 0, | 135 | .on = 0, |
137 | .off = 0, | 136 | .off = 0, |
@@ -140,8 +139,6 @@ static int iwl3945_led_off(struct iwl3945_priv *priv, int led_id) | |||
140 | IWL_DEBUG_LED("led off %d\n", led_id); | 139 | IWL_DEBUG_LED("led off %d\n", led_id); |
141 | return iwl_send_led_cmd(priv, &led_cmd); | 140 | return iwl_send_led_cmd(priv, &led_cmd); |
142 | } | 141 | } |
143 | #endif | ||
144 | |||
145 | 142 | ||
146 | /* | 143 | /* |
147 | * brightness call back function for Tx/Rx LED | 144 | * brightness call back function for Tx/Rx LED |
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945.h b/drivers/net/wireless/iwlwifi/iwl-3945.h index 00109324b33c..1c9e126dd23e 100644 --- a/drivers/net/wireless/iwlwifi/iwl-3945.h +++ b/drivers/net/wireless/iwlwifi/iwl-3945.h | |||
@@ -328,18 +328,18 @@ struct iwl3945_cmd_meta { | |||
328 | */ | 328 | */ |
329 | struct iwl3945_cmd { | 329 | struct iwl3945_cmd { |
330 | struct iwl3945_cmd_meta meta; | 330 | struct iwl3945_cmd_meta meta; |
331 | struct iwl3945_cmd_header hdr; | 331 | struct iwl_cmd_header hdr; |
332 | union { | 332 | union { |
333 | struct iwl3945_addsta_cmd addsta; | 333 | struct iwl3945_addsta_cmd addsta; |
334 | struct iwl3945_led_cmd led; | 334 | struct iwl_led_cmd led; |
335 | u32 flags; | 335 | u32 flags; |
336 | u8 val8; | 336 | u8 val8; |
337 | u16 val16; | 337 | u16 val16; |
338 | u32 val32; | 338 | u32 val32; |
339 | struct iwl3945_bt_cmd bt; | 339 | struct iwl_bt_cmd bt; |
340 | struct iwl3945_rxon_time_cmd rxon_time; | 340 | struct iwl3945_rxon_time_cmd rxon_time; |
341 | struct iwl_powertable_cmd powertable; | 341 | struct iwl_powertable_cmd powertable; |
342 | struct iwl3945_qosparam_cmd qosparam; | 342 | struct iwl_qosparam_cmd qosparam; |
343 | struct iwl3945_tx_cmd tx; | 343 | struct iwl3945_tx_cmd tx; |
344 | struct iwl3945_tx_beacon_cmd tx_beacon; | 344 | struct iwl3945_tx_beacon_cmd tx_beacon; |
345 | struct iwl3945_rxon_assoc_cmd rxon_assoc; | 345 | struct iwl3945_rxon_assoc_cmd rxon_assoc; |
@@ -466,7 +466,7 @@ union iwl3945_qos_capabity { | |||
466 | struct iwl3945_qos_info { | 466 | struct iwl3945_qos_info { |
467 | int qos_active; | 467 | int qos_active; |
468 | union iwl3945_qos_capabity qos_cap; | 468 | union iwl3945_qos_capabity qos_cap; |
469 | struct iwl3945_qosparam_cmd def_qos_parm; | 469 | struct iwl_qosparam_cmd def_qos_parm; |
470 | }; | 470 | }; |
471 | 471 | ||
472 | #define STA_PS_STATUS_WAKE 0 | 472 | #define STA_PS_STATUS_WAKE 0 |
diff --git a/drivers/net/wireless/iwlwifi/iwl-commands.h b/drivers/net/wireless/iwlwifi/iwl-commands.h index 20ab7fb75c3c..8b2d7012a2a0 100644 --- a/drivers/net/wireless/iwlwifi/iwl-commands.h +++ b/drivers/net/wireless/iwlwifi/iwl-commands.h | |||
@@ -75,6 +75,12 @@ | |||
75 | #define IWL_UCODE_API(ver) (((ver) & 0x0000FF00) >> 8) | 75 | #define IWL_UCODE_API(ver) (((ver) & 0x0000FF00) >> 8) |
76 | #define IWL_UCODE_SERIAL(ver) ((ver) & 0x000000FF) | 76 | #define IWL_UCODE_SERIAL(ver) ((ver) & 0x000000FF) |
77 | 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 | |||
78 | enum { | 84 | enum { |
79 | REPLY_ALIVE = 0x1, | 85 | REPLY_ALIVE = 0x1, |
80 | REPLY_ERROR = 0x2, | 86 | REPLY_ERROR = 0x2, |
@@ -784,6 +790,8 @@ struct iwl_qosparam_cmd { | |||
784 | #define IWL_AP_ID 0 | 790 | #define IWL_AP_ID 0 |
785 | #define IWL_MULTICAST_ID 1 | 791 | #define IWL_MULTICAST_ID 1 |
786 | #define IWL_STA_ID 2 | 792 | #define IWL_STA_ID 2 |
793 | #define IWL3945_BROADCAST_ID 24 | ||
794 | #define IWL3945_STATION_COUNT 25 | ||
787 | #define IWL4965_BROADCAST_ID 31 | 795 | #define IWL4965_BROADCAST_ID 31 |
788 | #define IWL4965_STATION_COUNT 32 | 796 | #define IWL4965_STATION_COUNT 32 |
789 | #define IWL5000_BROADCAST_ID 15 | 797 | #define IWL5000_BROADCAST_ID 15 |
@@ -792,6 +800,8 @@ struct iwl_qosparam_cmd { | |||
792 | #define IWL_STATION_COUNT 32 /* MAX(3945,4965)*/ | 800 | #define IWL_STATION_COUNT 32 /* MAX(3945,4965)*/ |
793 | #define IWL_INVALID_STATION 255 | 801 | #define IWL_INVALID_STATION 255 |
794 | 802 | ||
803 | #define STA_FLG_TX_RATE_MSK cpu_to_le32(1 << 2); | ||
804 | #define STA_FLG_PWR_SAVE_MSK cpu_to_le32(1 << 8); | ||
795 | #define STA_FLG_PWR_SAVE_MSK cpu_to_le32(1 << 8); | 805 | #define STA_FLG_PWR_SAVE_MSK cpu_to_le32(1 << 8); |
796 | #define STA_FLG_RTS_MIMO_PROT_MSK cpu_to_le32(1 << 17) | 806 | #define STA_FLG_RTS_MIMO_PROT_MSK cpu_to_le32(1 << 17) |
797 | #define STA_FLG_AGG_MPDU_8US_MSK cpu_to_le32(1 << 18) | 807 | #define STA_FLG_AGG_MPDU_8US_MSK cpu_to_le32(1 << 18) |
@@ -2181,6 +2191,7 @@ struct iwl_ssid_ie { | |||
2181 | u8 ssid[32]; | 2191 | u8 ssid[32]; |
2182 | } __attribute__ ((packed)); | 2192 | } __attribute__ ((packed)); |
2183 | 2193 | ||
2194 | #define PROBE_OPTION_MAX_API1 0x4 | ||
2184 | #define PROBE_OPTION_MAX 0x14 | 2195 | #define PROBE_OPTION_MAX 0x14 |
2185 | #define TX_CMD_LIFE_TIME_INFINITE cpu_to_le32(0xFFFFFFFF) | 2196 | #define TX_CMD_LIFE_TIME_INFINITE cpu_to_le32(0xFFFFFFFF) |
2186 | #define IWL_GOOD_CRC_TH cpu_to_le16(1) | 2197 | #define IWL_GOOD_CRC_TH cpu_to_le16(1) |
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c index 13a0b9a3ec7d..0be3e7d97149 100644 --- a/drivers/net/wireless/iwlwifi/iwl3945-base.c +++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c | |||
@@ -1139,7 +1139,7 @@ static int iwl3945_commit_rxon(struct iwl3945_priv *priv) | |||
1139 | 1139 | ||
1140 | static int iwl3945_send_bt_config(struct iwl3945_priv *priv) | 1140 | static int iwl3945_send_bt_config(struct iwl3945_priv *priv) |
1141 | { | 1141 | { |
1142 | struct iwl3945_bt_cmd bt_cmd = { | 1142 | struct iwl_bt_cmd bt_cmd = { |
1143 | .flags = 3, | 1143 | .flags = 3, |
1144 | .lead_time = 0xAA, | 1144 | .lead_time = 0xAA, |
1145 | .max_kill = 1, | 1145 | .max_kill = 1, |
@@ -1148,7 +1148,7 @@ static int iwl3945_send_bt_config(struct iwl3945_priv *priv) | |||
1148 | }; | 1148 | }; |
1149 | 1149 | ||
1150 | return iwl3945_send_cmd_pdu(priv, REPLY_BT_CONFIG, | 1150 | return iwl3945_send_cmd_pdu(priv, REPLY_BT_CONFIG, |
1151 | sizeof(struct iwl3945_bt_cmd), &bt_cmd); | 1151 | sizeof(bt_cmd), &bt_cmd); |
1152 | } | 1152 | } |
1153 | 1153 | ||
1154 | static int iwl3945_send_scan_abort(struct iwl3945_priv *priv) | 1154 | static int iwl3945_send_scan_abort(struct iwl3945_priv *priv) |
@@ -1343,7 +1343,8 @@ static int iwl3945_clear_sta_key_info(struct iwl3945_priv *priv, u8 sta_id) | |||
1343 | 1343 | ||
1344 | spin_lock_irqsave(&priv->sta_lock, flags); | 1344 | spin_lock_irqsave(&priv->sta_lock, flags); |
1345 | memset(&priv->stations[sta_id].keyinfo, 0, sizeof(struct iwl3945_hw_key)); | 1345 | memset(&priv->stations[sta_id].keyinfo, 0, sizeof(struct iwl3945_hw_key)); |
1346 | memset(&priv->stations[sta_id].sta.key, 0, sizeof(struct iwl3945_keyinfo)); | 1346 | memset(&priv->stations[sta_id].sta.key, 0, |
1347 | sizeof(struct iwl4965_keyinfo)); | ||
1347 | priv->stations[sta_id].sta.key.key_flags = STA_KEY_FLG_NO_ENC; | 1348 | priv->stations[sta_id].sta.key.key_flags = STA_KEY_FLG_NO_ENC; |
1348 | priv->stations[sta_id].sta.sta.modify_mask = STA_MODIFY_KEY_MASK; | 1349 | priv->stations[sta_id].sta.sta.modify_mask = STA_MODIFY_KEY_MASK; |
1349 | priv->stations[sta_id].sta.mode = STA_CONTROL_MODIFY_MSK; | 1350 | priv->stations[sta_id].sta.mode = STA_CONTROL_MODIFY_MSK; |
@@ -1672,11 +1673,11 @@ static u16 iwl3945_fill_probe_req(struct iwl3945_priv *priv, | |||
1672 | * QoS support | 1673 | * QoS support |
1673 | */ | 1674 | */ |
1674 | static int iwl3945_send_qos_params_command(struct iwl3945_priv *priv, | 1675 | static int iwl3945_send_qos_params_command(struct iwl3945_priv *priv, |
1675 | struct iwl3945_qosparam_cmd *qos) | 1676 | struct iwl_qosparam_cmd *qos) |
1676 | { | 1677 | { |
1677 | 1678 | ||
1678 | return iwl3945_send_cmd_pdu(priv, REPLY_QOS_PARAM, | 1679 | return iwl3945_send_cmd_pdu(priv, REPLY_QOS_PARAM, |
1679 | sizeof(struct iwl3945_qosparam_cmd), qos); | 1680 | sizeof(struct iwl_qosparam_cmd), qos); |
1680 | } | 1681 | } |
1681 | 1682 | ||
1682 | static void iwl3945_reset_qos(struct iwl3945_priv *priv) | 1683 | static void iwl3945_reset_qos(struct iwl3945_priv *priv) |
@@ -2581,7 +2582,7 @@ static int iwl3945_tx_skb(struct iwl3945_priv *priv, struct sk_buff *skb) | |||
2581 | * We'll tell device about this padding later. | 2582 | * We'll tell device about this padding later. |
2582 | */ | 2583 | */ |
2583 | len = priv->hw_setting.tx_cmd_len + | 2584 | len = priv->hw_setting.tx_cmd_len + |
2584 | sizeof(struct iwl3945_cmd_header) + hdr_len; | 2585 | sizeof(struct iwl_cmd_header) + hdr_len; |
2585 | 2586 | ||
2586 | len_org = len; | 2587 | len_org = len; |
2587 | len = (len + 3) & ~3; | 2588 | len = (len + 3) & ~3; |
@@ -3110,8 +3111,8 @@ static void iwl3945_rx_reply_scan(struct iwl3945_priv *priv, | |||
3110 | { | 3111 | { |
3111 | #ifdef CONFIG_IWL3945_DEBUG | 3112 | #ifdef CONFIG_IWL3945_DEBUG |
3112 | struct iwl3945_rx_packet *pkt = (void *)rxb->skb->data; | 3113 | struct iwl3945_rx_packet *pkt = (void *)rxb->skb->data; |
3113 | struct iwl3945_scanreq_notification *notif = | 3114 | struct iwl_scanreq_notification *notif = |
3114 | (struct iwl3945_scanreq_notification *)pkt->u.raw; | 3115 | (struct iwl_scanreq_notification *)pkt->u.raw; |
3115 | 3116 | ||
3116 | IWL_DEBUG_RX("Scan request status = 0x%x\n", notif->status); | 3117 | IWL_DEBUG_RX("Scan request status = 0x%x\n", notif->status); |
3117 | #endif | 3118 | #endif |
@@ -3122,8 +3123,8 @@ static void iwl3945_rx_scan_start_notif(struct iwl3945_priv *priv, | |||
3122 | struct iwl3945_rx_mem_buffer *rxb) | 3123 | struct iwl3945_rx_mem_buffer *rxb) |
3123 | { | 3124 | { |
3124 | struct iwl3945_rx_packet *pkt = (void *)rxb->skb->data; | 3125 | struct iwl3945_rx_packet *pkt = (void *)rxb->skb->data; |
3125 | struct iwl3945_scanstart_notification *notif = | 3126 | struct iwl_scanstart_notification *notif = |
3126 | (struct iwl3945_scanstart_notification *)pkt->u.raw; | 3127 | (struct iwl_scanstart_notification *)pkt->u.raw; |
3127 | priv->scan_start_tsf = le32_to_cpu(notif->tsf_low); | 3128 | priv->scan_start_tsf = le32_to_cpu(notif->tsf_low); |
3128 | IWL_DEBUG_SCAN("Scan start: " | 3129 | IWL_DEBUG_SCAN("Scan start: " |
3129 | "%d [802.11%s] " | 3130 | "%d [802.11%s] " |
@@ -3139,8 +3140,8 @@ static void iwl3945_rx_scan_results_notif(struct iwl3945_priv *priv, | |||
3139 | struct iwl3945_rx_mem_buffer *rxb) | 3140 | struct iwl3945_rx_mem_buffer *rxb) |
3140 | { | 3141 | { |
3141 | struct iwl3945_rx_packet *pkt = (void *)rxb->skb->data; | 3142 | struct iwl3945_rx_packet *pkt = (void *)rxb->skb->data; |
3142 | struct iwl3945_scanresults_notification *notif = | 3143 | struct iwl_scanresults_notification *notif = |
3143 | (struct iwl3945_scanresults_notification *)pkt->u.raw; | 3144 | (struct iwl_scanresults_notification *)pkt->u.raw; |
3144 | 3145 | ||
3145 | IWL_DEBUG_SCAN("Scan ch.res: " | 3146 | IWL_DEBUG_SCAN("Scan ch.res: " |
3146 | "%d [802.11%s] " | 3147 | "%d [802.11%s] " |
@@ -3164,7 +3165,7 @@ static void iwl3945_rx_scan_complete_notif(struct iwl3945_priv *priv, | |||
3164 | struct iwl3945_rx_mem_buffer *rxb) | 3165 | struct iwl3945_rx_mem_buffer *rxb) |
3165 | { | 3166 | { |
3166 | struct iwl3945_rx_packet *pkt = (void *)rxb->skb->data; | 3167 | struct iwl3945_rx_packet *pkt = (void *)rxb->skb->data; |
3167 | struct iwl3945_scancomplete_notification *scan_notif = (void *)pkt->u.raw; | 3168 | struct iwl_scancomplete_notification *scan_notif = (void *)pkt->u.raw; |
3168 | 3169 | ||
3169 | IWL_DEBUG_SCAN("Scan complete: %d channels (TSF 0x%08X:%08X) - %d\n", | 3170 | IWL_DEBUG_SCAN("Scan complete: %d channels (TSF 0x%08X:%08X) - %d\n", |
3170 | scan_notif->scanned_channels, | 3171 | scan_notif->scanned_channels, |