aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2011-04-05 12:41:49 -0400
committerJohn W. Linville <linville@tuxdriver.com>2011-04-07 15:49:41 -0400
commit3240cab3ddfb2637cfca3a078078cdeda44d0a99 (patch)
treec7947465a10490d184533e337b06c862574781d7 /drivers/net
parent68e022dfeb548b48635888d1392f983977293573 (diff)
iwlagn: clean up some 3945/4965 remnants
When the driver was split, a bunch of definitions for the 3945 and 4965 devices stayed around, but they're now useless so remove (some of) them. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-rs.h28
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-sta.c2
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn.h2
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-commands.h591
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-core.c1
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-dev.h235
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-eeprom.h185
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-hcmd.c2
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-prph.h11
9 files changed, 63 insertions, 994 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-rs.h b/drivers/net/wireless/iwlwifi/iwl-agn-rs.h
index 184828c72b31..b356a39a824f 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-rs.h
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-rs.h
@@ -41,20 +41,6 @@ struct iwl_rate_info {
41 u8 next_rs_tgg; /* next rate used in TGG rs algo */ 41 u8 next_rs_tgg; /* next rate used in TGG rs algo */
42}; 42};
43 43
44struct iwl3945_rate_info {
45 u8 plcp; /* uCode API: IWL_RATE_6M_PLCP, etc. */
46 u8 ieee; /* MAC header: IWL_RATE_6M_IEEE, etc. */
47 u8 prev_ieee; /* previous rate in IEEE speeds */
48 u8 next_ieee; /* next rate in IEEE speeds */
49 u8 prev_rs; /* previous rate used in rs algo */
50 u8 next_rs; /* next rate used in rs algo */
51 u8 prev_rs_tgg; /* previous rate used in TGG rs algo */
52 u8 next_rs_tgg; /* next rate used in TGG rs algo */
53 u8 table_rs_index; /* index in rate scale table cmd */
54 u8 prev_table_rs; /* prev in rate table cmd */
55};
56
57
58/* 44/*
59 * These serve as indexes into 45 * These serve as indexes into
60 * struct iwl_rate_info iwl_rates[IWL_RATE_COUNT]; 46 * struct iwl_rate_info iwl_rates[IWL_RATE_COUNT];
@@ -75,7 +61,6 @@ enum {
75 IWL_RATE_60M_INDEX, 61 IWL_RATE_60M_INDEX,
76 IWL_RATE_COUNT, /*FIXME:RS:change to IWL_RATE_INDEX_COUNT,*/ 62 IWL_RATE_COUNT, /*FIXME:RS:change to IWL_RATE_INDEX_COUNT,*/
77 IWL_RATE_COUNT_LEGACY = IWL_RATE_COUNT - 1, /* Excluding 60M */ 63 IWL_RATE_COUNT_LEGACY = IWL_RATE_COUNT - 1, /* Excluding 60M */
78 IWL_RATE_COUNT_3945 = IWL_RATE_COUNT - 1,
79 IWL_RATE_INVM_INDEX = IWL_RATE_COUNT, 64 IWL_RATE_INVM_INDEX = IWL_RATE_COUNT,
80 IWL_RATE_INVALID = IWL_RATE_COUNT, 65 IWL_RATE_INVALID = IWL_RATE_COUNT,
81}; 66};
@@ -213,7 +198,6 @@ enum {
213 IWL_CCK_BASIC_RATES_MASK) 198 IWL_CCK_BASIC_RATES_MASK)
214 199
215#define IWL_RATES_MASK ((1 << IWL_RATE_COUNT) - 1) 200#define IWL_RATES_MASK ((1 << IWL_RATE_COUNT) - 1)
216#define IWL_RATES_MASK_3945 ((1 << IWL_RATE_COUNT_3945) - 1)
217 201
218#define IWL_INVALID_VALUE -1 202#define IWL_INVALID_VALUE -1
219 203
@@ -453,19 +437,9 @@ static inline u8 first_antenna(u8 mask)
453} 437}
454 438
455 439
456/**
457 * iwl3945_rate_scale_init - Initialize the rate scale table based on assoc info
458 *
459 * The specific throughput table used is based on the type of network
460 * the associated with, including A, B, G, and G w/ TGG protection
461 */
462extern void iwl3945_rate_scale_init(struct ieee80211_hw *hw, s32 sta_id);
463
464/* Initialize station's rate scaling information after adding station */ 440/* Initialize station's rate scaling information after adding station */
465extern void iwl_rs_rate_init(struct iwl_priv *priv, 441extern void iwl_rs_rate_init(struct iwl_priv *priv,
466 struct ieee80211_sta *sta, u8 sta_id); 442 struct ieee80211_sta *sta, u8 sta_id);
467extern void iwl3945_rs_rate_init(struct iwl_priv *priv,
468 struct ieee80211_sta *sta, u8 sta_id);
469 443
470/** 444/**
471 * iwl_rate_control_register - Register the rate control algorithm callbacks 445 * iwl_rate_control_register - Register the rate control algorithm callbacks
@@ -478,7 +452,6 @@ extern void iwl3945_rs_rate_init(struct iwl_priv *priv,
478 * 452 *
479 */ 453 */
480extern int iwlagn_rate_control_register(void); 454extern int iwlagn_rate_control_register(void);
481extern int iwl3945_rate_control_register(void);
482 455
483/** 456/**
484 * iwl_rate_control_unregister - Unregister the rate control callbacks 457 * iwl_rate_control_unregister - Unregister the rate control callbacks
@@ -487,6 +460,5 @@ extern int iwl3945_rate_control_register(void);
487 * the driver is unloaded. 460 * the driver is unloaded.
488 */ 461 */
489extern void iwlagn_rate_control_unregister(void); 462extern void iwlagn_rate_control_unregister(void);
490extern void iwl3945_rate_control_unregister(void);
491 463
492#endif /* __iwl_agn__rs__ */ 464#endif /* __iwl_agn__rs__ */
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-sta.c b/drivers/net/wireless/iwlwifi/iwl-agn-sta.c
index 35f085ac336b..3782fe8194fd 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-sta.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-sta.c
@@ -474,7 +474,7 @@ int iwl_remove_dynamic_key(struct iwl_priv *priv,
474 memset(&priv->stations[sta_id].keyinfo, 0, 474 memset(&priv->stations[sta_id].keyinfo, 0,
475 sizeof(struct iwl_hw_key)); 475 sizeof(struct iwl_hw_key));
476 memset(&priv->stations[sta_id].sta.key, 0, 476 memset(&priv->stations[sta_id].sta.key, 0,
477 sizeof(struct iwl4965_keyinfo)); 477 sizeof(struct iwl_keyinfo));
478 priv->stations[sta_id].sta.key.key_flags = 478 priv->stations[sta_id].sta.key.key_flags =
479 STA_KEY_FLG_NO_ENC | STA_KEY_FLG_INVALID; 479 STA_KEY_FLG_NO_ENC | STA_KEY_FLG_INVALID;
480 priv->stations[sta_id].sta.key.key_offset = WEP_INVALID_OFFSET; 480 priv->stations[sta_id].sta.key.key_offset = WEP_INVALID_OFFSET;
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.h b/drivers/net/wireless/iwlwifi/iwl-agn.h
index 39313acb9cc7..80de8a1edacf 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.h
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.h
@@ -66,7 +66,6 @@
66#include "iwl-dev.h" 66#include "iwl-dev.h"
67 67
68/* configuration for the _agn devices */ 68/* configuration for the _agn devices */
69extern struct iwl_cfg iwl4965_agn_cfg;
70extern struct iwl_cfg iwl5300_agn_cfg; 69extern struct iwl_cfg iwl5300_agn_cfg;
71extern struct iwl_cfg iwl5100_agn_cfg; 70extern struct iwl_cfg iwl5100_agn_cfg;
72extern struct iwl_cfg iwl5350_agn_cfg; 71extern struct iwl_cfg iwl5350_agn_cfg;
@@ -114,7 +113,6 @@ extern struct iwl_hcmd_ops iwlagn_bt_hcmd;
114extern struct iwl_hcmd_utils_ops iwlagn_hcmd_utils; 113extern struct iwl_hcmd_utils_ops iwlagn_hcmd_utils;
115 114
116extern struct ieee80211_ops iwlagn_hw_ops; 115extern struct ieee80211_ops iwlagn_hw_ops;
117extern struct ieee80211_ops iwl4965_hw_ops;
118 116
119int iwl_reset_ict(struct iwl_priv *priv); 117int iwl_reset_ict(struct iwl_priv *priv);
120void iwl_disable_ict(struct iwl_priv *priv); 118void iwl_disable_ict(struct iwl_priv *priv);
diff --git a/drivers/net/wireless/iwlwifi/iwl-commands.h b/drivers/net/wireless/iwlwifi/iwl-commands.h
index cc2151482f31..e6058436aeb3 100644
--- a/drivers/net/wireless/iwlwifi/iwl-commands.h
+++ b/drivers/net/wireless/iwlwifi/iwl-commands.h
@@ -103,9 +103,7 @@ enum {
103 REPLY_WEPKEY = 0x20, 103 REPLY_WEPKEY = 0x20,
104 104
105 /* RX, TX, LEDs */ 105 /* RX, TX, LEDs */
106 REPLY_3945_RX = 0x1b, /* 3945 only */
107 REPLY_TX = 0x1c, 106 REPLY_TX = 0x1c,
108 REPLY_RATE_SCALE = 0x47, /* 3945 only */
109 REPLY_LEDS_CMD = 0x48, 107 REPLY_LEDS_CMD = 0x48,
110 REPLY_TX_LINK_QUALITY_CMD = 0x4e, /* for 4965 and up */ 108 REPLY_TX_LINK_QUALITY_CMD = 0x4e, /* for 4965 and up */
111 109
@@ -229,7 +227,7 @@ struct iwl_cmd_header {
229 * There is one exception: uCode sets bit 15 when it originates 227 * There is one exception: uCode sets bit 15 when it originates
230 * the response/notification, i.e. when the response/notification 228 * the response/notification, i.e. when the response/notification
231 * is not a direct response to a command sent by the driver. For 229 * is not a direct response to a command sent by the driver. For
232 * example, uCode issues REPLY_3945_RX when it sends a received frame 230 * example, uCode issues REPLY_RX when it sends a received frame
233 * to the driver; it is not a direct response to any driver command. 231 * to the driver; it is not a direct response to any driver command.
234 * 232 *
235 * The Linux driver uses the following format: 233 * The Linux driver uses the following format:
@@ -249,36 +247,6 @@ struct iwl_cmd_header {
249 247
250 248
251/** 249/**
252 * struct iwl3945_tx_power
253 *
254 * Used in REPLY_TX_PWR_TABLE_CMD, REPLY_SCAN_CMD, REPLY_CHANNEL_SWITCH
255 *
256 * Each entry contains two values:
257 * 1) DSP gain (or sometimes called DSP attenuation). This is a fine-grained
258 * linear value that multiplies the output of the digital signal processor,
259 * before being sent to the analog radio.
260 * 2) Radio gain. This sets the analog gain of the radio Tx path.
261 * It is a coarser setting, and behaves in a logarithmic (dB) fashion.
262 *
263 * Driver obtains values from struct iwl3945_tx_power power_gain_table[][].
264 */
265struct iwl3945_tx_power {
266 u8 tx_gain; /* gain for analog radio */
267 u8 dsp_atten; /* gain for DSP */
268} __packed;
269
270/**
271 * struct iwl3945_power_per_rate
272 *
273 * Used in REPLY_TX_PWR_TABLE_CMD, REPLY_CHANNEL_SWITCH
274 */
275struct iwl3945_power_per_rate {
276 u8 rate; /* plcp */
277 struct iwl3945_tx_power tpc;
278 u8 reserved;
279} __packed;
280
281/**
282 * iwlagn rate_n_flags bit fields 250 * iwlagn rate_n_flags bit fields
283 * 251 *
284 * rate_n_flags format is used in following iwlagn commands: 252 * rate_n_flags format is used in following iwlagn commands:
@@ -377,30 +345,6 @@ struct iwl3945_power_per_rate {
377#define IWL_PWR_CCK_ENTRIES 2 345#define IWL_PWR_CCK_ENTRIES 2
378 346
379/** 347/**
380 * union iwl4965_tx_power_dual_stream
381 *
382 * Host format used for REPLY_TX_PWR_TABLE_CMD, REPLY_CHANNEL_SWITCH
383 * Use __le32 version (struct tx_power_dual_stream) when building command.
384 *
385 * Driver provides radio gain and DSP attenuation settings to device in pairs,
386 * one value for each transmitter chain. The first value is for transmitter A,
387 * second for transmitter B.
388 *
389 * For SISO bit rates, both values in a pair should be identical.
390 * For MIMO rates, one value may be different from the other,
391 * in order to balance the Tx output between the two transmitters.
392 *
393 * See more details in doc for TXPOWER in iwl-4965-hw.h.
394 */
395union iwl4965_tx_power_dual_stream {
396 struct {
397 u8 radio_tx_gain[2];
398 u8 dsp_predis_atten[2];
399 } s;
400 u32 dw;
401};
402
403/**
404 * struct tx_power_dual_stream 348 * struct tx_power_dual_stream
405 * 349 *
406 * Table entries in REPLY_TX_PWR_TABLE_CMD, REPLY_CHANNEL_SWITCH 350 * Table entries in REPLY_TX_PWR_TABLE_CMD, REPLY_CHANNEL_SWITCH
@@ -412,15 +356,6 @@ struct tx_power_dual_stream {
412} __packed; 356} __packed;
413 357
414/** 358/**
415 * struct iwl4965_tx_power_db
416 *
417 * Entire table within REPLY_TX_PWR_TABLE_CMD, REPLY_CHANNEL_SWITCH
418 */
419struct iwl4965_tx_power_db {
420 struct tx_power_dual_stream power_tbl[POWER_TABLE_NUM_ENTRIES];
421} __packed;
422
423/**
424 * Command REPLY_TX_POWER_DBM_CMD = 0x98 359 * Command REPLY_TX_POWER_DBM_CMD = 0x98
425 * struct iwlagn_tx_power_dbm_cmd 360 * struct iwlagn_tx_power_dbm_cmd
426 */ 361 */
@@ -724,46 +659,6 @@ enum {
724 * regardless of whether RXON_FILTER_ASSOC_MSK is set. 659 * regardless of whether RXON_FILTER_ASSOC_MSK is set.
725 */ 660 */
726 661
727struct iwl3945_rxon_cmd {
728 u8 node_addr[6];
729 __le16 reserved1;
730 u8 bssid_addr[6];
731 __le16 reserved2;
732 u8 wlap_bssid_addr[6];
733 __le16 reserved3;
734 u8 dev_type;
735 u8 air_propagation;
736 __le16 reserved4;
737 u8 ofdm_basic_rates;
738 u8 cck_basic_rates;
739 __le16 assoc_id;
740 __le32 flags;
741 __le32 filter_flags;
742 __le16 channel;
743 __le16 reserved5;
744} __packed;
745
746struct iwl4965_rxon_cmd {
747 u8 node_addr[6];
748 __le16 reserved1;
749 u8 bssid_addr[6];
750 __le16 reserved2;
751 u8 wlap_bssid_addr[6];
752 __le16 reserved3;
753 u8 dev_type;
754 u8 air_propagation;
755 __le16 rx_chain;
756 u8 ofdm_basic_rates;
757 u8 cck_basic_rates;
758 __le16 assoc_id;
759 __le32 flags;
760 __le32 filter_flags;
761 __le16 channel;
762 u8 ofdm_ht_single_stream_basic_rates;
763 u8 ofdm_ht_dual_stream_basic_rates;
764} __packed;
765
766/* 5000 HW just extend this command */
767struct iwl_rxon_cmd { 662struct iwl_rxon_cmd {
768 u8 node_addr[6]; 663 u8 node_addr[6];
769 __le16 reserved1; 664 __le16 reserved1;
@@ -791,25 +686,6 @@ struct iwl_rxon_cmd {
791/* 686/*
792 * REPLY_RXON_ASSOC = 0x11 (command, has simple generic response) 687 * REPLY_RXON_ASSOC = 0x11 (command, has simple generic response)
793 */ 688 */
794struct iwl3945_rxon_assoc_cmd {
795 __le32 flags;
796 __le32 filter_flags;
797 u8 ofdm_basic_rates;
798 u8 cck_basic_rates;
799 __le16 reserved;
800} __packed;
801
802struct iwl4965_rxon_assoc_cmd {
803 __le32 flags;
804 __le32 filter_flags;
805 u8 ofdm_basic_rates;
806 u8 cck_basic_rates;
807 u8 ofdm_ht_single_stream_basic_rates;
808 u8 ofdm_ht_dual_stream_basic_rates;
809 __le16 rx_chain_select_flags;
810 __le16 reserved;
811} __packed;
812
813struct iwl5000_rxon_assoc_cmd { 689struct iwl5000_rxon_assoc_cmd {
814 __le32 flags; 690 __le32 flags;
815 __le32 filter_flags; 691 __le32 filter_flags;
@@ -845,26 +721,6 @@ struct iwl_rxon_time_cmd {
845/* 721/*
846 * REPLY_CHANNEL_SWITCH = 0x72 (command, has simple generic response) 722 * REPLY_CHANNEL_SWITCH = 0x72 (command, has simple generic response)
847 */ 723 */
848struct iwl3945_channel_switch_cmd {
849 u8 band;
850 u8 expect_beacon;
851 __le16 channel;
852 __le32 rxon_flags;
853 __le32 rxon_filter_flags;
854 __le32 switch_time;
855 struct iwl3945_power_per_rate power[IWL_MAX_RATES];
856} __packed;
857
858struct iwl4965_channel_switch_cmd {
859 u8 band;
860 u8 expect_beacon;
861 __le16 channel;
862 __le32 rxon_flags;
863 __le32 rxon_filter_flags;
864 __le32 switch_time;
865 struct iwl4965_tx_power_db tx_power;
866} __packed;
867
868/** 724/**
869 * struct iwl5000_channel_switch_cmd 725 * struct iwl5000_channel_switch_cmd
870 * @band: 0- 5.2GHz, 1- 2.4GHz 726 * @band: 0- 5.2GHz, 1- 2.4GHz
@@ -978,15 +834,10 @@ struct iwl_qosparam_cmd {
978#define IWL_AP_ID 0 834#define IWL_AP_ID 0
979#define IWL_AP_ID_PAN 1 835#define IWL_AP_ID_PAN 1
980#define IWL_STA_ID 2 836#define IWL_STA_ID 2
981#define IWL3945_BROADCAST_ID 24
982#define IWL3945_STATION_COUNT 25
983#define IWL4965_BROADCAST_ID 31
984#define IWL4965_STATION_COUNT 32
985#define IWLAGN_PAN_BCAST_ID 14 837#define IWLAGN_PAN_BCAST_ID 14
986#define IWLAGN_BROADCAST_ID 15 838#define IWLAGN_BROADCAST_ID 15
987#define IWLAGN_STATION_COUNT 16 839#define IWLAGN_STATION_COUNT 16
988 840
989#define IWL_STATION_COUNT 32 /* MAX(3945,4965)*/
990#define IWL_INVALID_STATION 255 841#define IWL_INVALID_STATION 255
991 842
992#define STA_FLG_TX_RATE_MSK cpu_to_le32(1 << 2) 843#define STA_FLG_TX_RATE_MSK cpu_to_le32(1 << 2)
@@ -1034,16 +885,6 @@ struct iwl_qosparam_cmd {
1034 * combined with Traffic ID (QOS priority), in format used by Tx Scheduler */ 885 * combined with Traffic ID (QOS priority), in format used by Tx Scheduler */
1035#define BUILD_RAxTID(sta_id, tid) (((sta_id) << 4) + (tid)) 886#define BUILD_RAxTID(sta_id, tid) (((sta_id) << 4) + (tid))
1036 887
1037struct iwl4965_keyinfo {
1038 __le16 key_flags;
1039 u8 tkip_rx_tsc_byte2; /* TSC[2] for key mix ph1 detection */
1040 u8 reserved1;
1041 __le16 tkip_rx_ttak[5]; /* 10-byte unicast TKIP TTAK */
1042 u8 key_offset;
1043 u8 reserved2;
1044 u8 key[16]; /* 16-byte unicast decryption key */
1045} __packed;
1046
1047/* agn */ 888/* agn */
1048struct iwl_keyinfo { 889struct iwl_keyinfo {
1049 __le16 key_flags; 890 __le16 key_flags;
@@ -1085,7 +926,6 @@ struct sta_id_modify {
1085 * with info on security keys, aggregation parameters, and Tx rates for 926 * with info on security keys, aggregation parameters, and Tx rates for
1086 * initial Tx attempt and any retries (agn devices uses 927 * initial Tx attempt and any retries (agn devices uses
1087 * REPLY_TX_LINK_QUALITY_CMD, 928 * REPLY_TX_LINK_QUALITY_CMD,
1088 * 3945 uses REPLY_RATE_SCALE to set up rate tables).
1089 * 929 *
1090 * REPLY_ADD_STA sets up the table entry for one station, either creating 930 * REPLY_ADD_STA sets up the table entry for one station, either creating
1091 * a new entry, or modifying a pre-existing one. 931 * a new entry, or modifying a pre-existing one.
@@ -1105,72 +945,6 @@ struct sta_id_modify {
1105 * entries for all STAs in network, starting with index IWL_STA_ID. 945 * entries for all STAs in network, starting with index IWL_STA_ID.
1106 */ 946 */
1107 947
1108struct iwl3945_addsta_cmd {
1109 u8 mode; /* 1: modify existing, 0: add new station */
1110 u8 reserved[3];
1111 struct sta_id_modify sta;
1112 struct iwl4965_keyinfo key;
1113 __le32 station_flags; /* STA_FLG_* */
1114 __le32 station_flags_msk; /* STA_FLG_* */
1115
1116 /* bit field to disable (1) or enable (0) Tx for Traffic ID (TID)
1117 * corresponding to bit (e.g. bit 5 controls TID 5).
1118 * Set modify_mask bit STA_MODIFY_TID_DISABLE_TX to use this field. */
1119 __le16 tid_disable_tx;
1120
1121 __le16 rate_n_flags;
1122
1123 /* TID for which to add block-ack support.
1124 * Set modify_mask bit STA_MODIFY_ADDBA_TID_MSK to use this field. */
1125 u8 add_immediate_ba_tid;
1126
1127 /* TID for which to remove block-ack support.
1128 * Set modify_mask bit STA_MODIFY_DELBA_TID_MSK to use this field. */
1129 u8 remove_immediate_ba_tid;
1130
1131 /* Starting Sequence Number for added block-ack support.
1132 * Set modify_mask bit STA_MODIFY_ADDBA_TID_MSK to use this field. */
1133 __le16 add_immediate_ba_ssn;
1134} __packed;
1135
1136struct iwl4965_addsta_cmd {
1137 u8 mode; /* 1: modify existing, 0: add new station */
1138 u8 reserved[3];
1139 struct sta_id_modify sta;
1140 struct iwl4965_keyinfo key;
1141 __le32 station_flags; /* STA_FLG_* */
1142 __le32 station_flags_msk; /* STA_FLG_* */
1143
1144 /* bit field to disable (1) or enable (0) Tx for Traffic ID (TID)
1145 * corresponding to bit (e.g. bit 5 controls TID 5).
1146 * Set modify_mask bit STA_MODIFY_TID_DISABLE_TX to use this field. */
1147 __le16 tid_disable_tx;
1148
1149 __le16 reserved1;
1150
1151 /* TID for which to add block-ack support.
1152 * Set modify_mask bit STA_MODIFY_ADDBA_TID_MSK to use this field. */
1153 u8 add_immediate_ba_tid;
1154
1155 /* TID for which to remove block-ack support.
1156 * Set modify_mask bit STA_MODIFY_DELBA_TID_MSK to use this field. */
1157 u8 remove_immediate_ba_tid;
1158
1159 /* Starting Sequence Number for added block-ack support.
1160 * Set modify_mask bit STA_MODIFY_ADDBA_TID_MSK to use this field. */
1161 __le16 add_immediate_ba_ssn;
1162
1163 /*
1164 * Number of packets OK to transmit to station even though
1165 * it is asleep -- used to synchronise PS-poll and u-APSD
1166 * responses while ucode keeps track of STA sleep state.
1167 */
1168 __le16 sleep_tx_count;
1169
1170 __le16 reserved2;
1171} __packed;
1172
1173/* agn */
1174struct iwl_addsta_cmd { 948struct iwl_addsta_cmd {
1175 u8 mode; /* 1: modify existing, 0: add new station */ 949 u8 mode; /* 1: modify existing, 0: add new station */
1176 u8 reserved[3]; 950 u8 reserved[3];
@@ -1339,62 +1113,6 @@ struct iwl_wep_cmd {
1339#define RX_MPDU_RES_STATUS_DEC_DONE_MSK (0x800) 1113#define RX_MPDU_RES_STATUS_DEC_DONE_MSK (0x800)
1340 1114
1341 1115
1342struct iwl3945_rx_frame_stats {
1343 u8 phy_count;
1344 u8 id;
1345 u8 rssi;
1346 u8 agc;
1347 __le16 sig_avg;
1348 __le16 noise_diff;
1349 u8 payload[0];
1350} __packed;
1351
1352struct iwl3945_rx_frame_hdr {
1353 __le16 channel;
1354 __le16 phy_flags;
1355 u8 reserved1;
1356 u8 rate;
1357 __le16 len;
1358 u8 payload[0];
1359} __packed;
1360
1361struct iwl3945_rx_frame_end {
1362 __le32 status;
1363 __le64 timestamp;
1364 __le32 beacon_timestamp;
1365} __packed;
1366
1367/*
1368 * REPLY_3945_RX = 0x1b (response only, not a command)
1369 *
1370 * NOTE: DO NOT dereference from casts to this structure
1371 * It is provided only for calculating minimum data set size.
1372 * The actual offsets of the hdr and end are dynamic based on
1373 * stats.phy_count
1374 */
1375struct iwl3945_rx_frame {
1376 struct iwl3945_rx_frame_stats stats;
1377 struct iwl3945_rx_frame_hdr hdr;
1378 struct iwl3945_rx_frame_end end;
1379} __packed;
1380
1381#define IWL39_RX_FRAME_SIZE (4 + sizeof(struct iwl3945_rx_frame))
1382
1383/* Fixed (non-configurable) rx data from phy */
1384
1385#define IWL49_RX_RES_PHY_CNT 14
1386#define IWL49_RX_PHY_FLAGS_ANTENNAE_OFFSET (4)
1387#define IWL49_RX_PHY_FLAGS_ANTENNAE_MASK (0x70)
1388#define IWL49_AGC_DB_MASK (0x3f80) /* MASK(7,13) */
1389#define IWL49_AGC_DB_POS (7)
1390struct iwl4965_rx_non_cfg_phy {
1391 __le16 ant_selection; /* ant A bit 4, ant B bit 5, ant C bit 6 */
1392 __le16 agc_info; /* agc code 0:6, agc dB 7:13, reserved 14:15 */
1393 u8 rssi_info[6]; /* we use even entries, 0/2/4 for A/B/C rssi */
1394 u8 pad[0];
1395} __packed;
1396
1397
1398#define IWLAGN_RX_RES_PHY_CNT 8 1116#define IWLAGN_RX_RES_PHY_CNT 8
1399#define IWLAGN_RX_RES_AGC_IDX 1 1117#define IWLAGN_RX_RES_AGC_IDX 1
1400#define IWLAGN_RX_RES_RSSI_AB_IDX 2 1118#define IWLAGN_RX_RES_RSSI_AB_IDX 2
@@ -1578,80 +1296,6 @@ struct iwl_rx_mpdu_res_start {
1578 * REPLY_TX = 0x1c (command) 1296 * REPLY_TX = 0x1c (command)
1579 */ 1297 */
1580 1298
1581struct iwl3945_tx_cmd {
1582 /*
1583 * MPDU byte count:
1584 * MAC header (24/26/30/32 bytes) + 2 bytes pad if 26/30 header size,
1585 * + 8 byte IV for CCM or TKIP (not used for WEP)
1586 * + Data payload
1587 * + 8-byte MIC (not used for CCM/WEP)
1588 * NOTE: Does not include Tx command bytes, post-MAC pad bytes,
1589 * MIC (CCM) 8 bytes, ICV (WEP/TKIP/CKIP) 4 bytes, CRC 4 bytes.i
1590 * Range: 14-2342 bytes.
1591 */
1592 __le16 len;
1593
1594 /*
1595 * MPDU or MSDU byte count for next frame.
1596 * Used for fragmentation and bursting, but not 11n aggregation.
1597 * Same as "len", but for next frame. Set to 0 if not applicable.
1598 */
1599 __le16 next_frame_len;
1600
1601 __le32 tx_flags; /* TX_CMD_FLG_* */
1602
1603 u8 rate;
1604
1605 /* Index of recipient station in uCode's station table */
1606 u8 sta_id;
1607 u8 tid_tspec;
1608 u8 sec_ctl;
1609 u8 key[16];
1610 union {
1611 u8 byte[8];
1612 __le16 word[4];
1613 __le32 dw[2];
1614 } tkip_mic;
1615 __le32 next_frame_info;
1616 union {
1617 __le32 life_time;
1618 __le32 attempt;
1619 } stop_time;
1620 u8 supp_rates[2];
1621 u8 rts_retry_limit; /*byte 50 */
1622 u8 data_retry_limit; /*byte 51 */
1623 union {
1624 __le16 pm_frame_timeout;
1625 __le16 attempt_duration;
1626 } timeout;
1627
1628 /*
1629 * Duration of EDCA burst Tx Opportunity, in 32-usec units.
1630 * Set this if txop time is not specified by HCCA protocol (e.g. by AP).
1631 */
1632 __le16 driver_txop;
1633
1634 /*
1635 * MAC header goes here, followed by 2 bytes padding if MAC header
1636 * length is 26 or 30 bytes, followed by payload data
1637 */
1638 u8 payload[0];
1639 struct ieee80211_hdr hdr[0];
1640} __packed;
1641
1642/*
1643 * REPLY_TX = 0x1c (response)
1644 */
1645struct iwl3945_tx_resp {
1646 u8 failure_rts;
1647 u8 failure_frame;
1648 u8 bt_kill_count;
1649 u8 rate;
1650 __le32 wireless_media_time;
1651 __le32 status; /* TX status */
1652} __packed;
1653
1654
1655/* 1299/*
1656 * 4965 uCode updates these Tx attempt count values in host DRAM. 1300 * 4965 uCode updates these Tx attempt count values in host DRAM.
1657 * Used for managing Tx retries when expecting block-acks. 1301 * Used for managing Tx retries when expecting block-acks.
@@ -1742,54 +1386,6 @@ struct iwl_tx_cmd {
1742 struct ieee80211_hdr hdr[0]; 1386 struct ieee80211_hdr hdr[0];
1743} __packed; 1387} __packed;
1744 1388
1745/* TX command response is sent after *3945* transmission attempts.
1746 *
1747 * NOTES:
1748 *
1749 * TX_STATUS_FAIL_NEXT_FRAG
1750 *
1751 * If the fragment flag in the MAC header for the frame being transmitted
1752 * is set and there is insufficient time to transmit the next frame, the
1753 * TX status will be returned with 'TX_STATUS_FAIL_NEXT_FRAG'.
1754 *
1755 * TX_STATUS_FIFO_UNDERRUN
1756 *
1757 * Indicates the host did not provide bytes to the FIFO fast enough while
1758 * a TX was in progress.
1759 *
1760 * TX_STATUS_FAIL_MGMNT_ABORT
1761 *
1762 * This status is only possible if the ABORT ON MGMT RX parameter was
1763 * set to true with the TX command.
1764 *
1765 * If the MSB of the status parameter is set then an abort sequence is
1766 * required. This sequence consists of the host activating the TX Abort
1767 * control line, and then waiting for the TX Abort command response. This
1768 * indicates that a the device is no longer in a transmit state, and that the
1769 * command FIFO has been cleared. The host must then deactivate the TX Abort
1770 * control line. Receiving is still allowed in this case.
1771 */
1772enum {
1773 TX_3945_STATUS_SUCCESS = 0x01,
1774 TX_3945_STATUS_DIRECT_DONE = 0x02,
1775 TX_3945_STATUS_FAIL_SHORT_LIMIT = 0x82,
1776 TX_3945_STATUS_FAIL_LONG_LIMIT = 0x83,
1777 TX_3945_STATUS_FAIL_FIFO_UNDERRUN = 0x84,
1778 TX_3945_STATUS_FAIL_MGMNT_ABORT = 0x85,
1779 TX_3945_STATUS_FAIL_NEXT_FRAG = 0x86,
1780 TX_3945_STATUS_FAIL_LIFE_EXPIRE = 0x87,
1781 TX_3945_STATUS_FAIL_DEST_PS = 0x88,
1782 TX_3945_STATUS_FAIL_ABORTED = 0x89,
1783 TX_3945_STATUS_FAIL_BT_RETRY = 0x8a,
1784 TX_3945_STATUS_FAIL_STA_INVALID = 0x8b,
1785 TX_3945_STATUS_FAIL_FRAG_DROPPED = 0x8c,
1786 TX_3945_STATUS_FAIL_TID_DISABLE = 0x8d,
1787 TX_3945_STATUS_FAIL_FRAME_FLUSHED = 0x8e,
1788 TX_3945_STATUS_FAIL_INSUFFICIENT_CF_POLL = 0x8f,
1789 TX_3945_STATUS_FAIL_TX_LOCKED = 0x90,
1790 TX_3945_STATUS_FAIL_NO_BEACON_ON_RADAR = 0x91,
1791};
1792
1793/* 1389/*
1794 * TX command response is sent after *agn* transmission attempts. 1390 * TX command response is sent after *agn* transmission attempts.
1795 * 1391 *
@@ -1907,43 +1503,6 @@ struct agg_tx_status {
1907 __le16 sequence; 1503 __le16 sequence;
1908} __packed; 1504} __packed;
1909 1505
1910struct iwl4965_tx_resp {
1911 u8 frame_count; /* 1 no aggregation, >1 aggregation */
1912 u8 bt_kill_count; /* # blocked by bluetooth (unused for agg) */
1913 u8 failure_rts; /* # failures due to unsuccessful RTS */
1914 u8 failure_frame; /* # failures due to no ACK (unused for agg) */
1915
1916 /* For non-agg: Rate at which frame was successful.
1917 * For agg: Rate at which all frames were transmitted. */
1918 __le32 rate_n_flags; /* RATE_MCS_* */
1919
1920 /* For non-agg: RTS + CTS + frame tx attempts time + ACK.
1921 * For agg: RTS + CTS + aggregation tx time + block-ack time. */
1922 __le16 wireless_media_time; /* uSecs */
1923
1924 __le16 reserved;
1925 __le32 pa_power1; /* RF power amplifier measurement (not used) */
1926 __le32 pa_power2;
1927
1928 /*
1929 * For non-agg: frame status TX_STATUS_*
1930 * For agg: status of 1st frame, AGG_TX_STATE_*; other frame status
1931 * fields follow this one, up to frame_count.
1932 * Bit fields:
1933 * 11- 0: AGG_TX_STATE_* status code
1934 * 15-12: Retry count for 1st frame in aggregation (retries
1935 * occur if tx failed for this frame when it was a
1936 * member of a previous aggregation block). If rate
1937 * scaling is used, retry count indicates the rate
1938 * table entry used for all frames in the new agg.
1939 * 31-16: Sequence # for this frame's Tx cmd (not SSN!)
1940 */
1941 union {
1942 __le32 status;
1943 struct agg_tx_status agg_status[0]; /* for each agg frame */
1944 } u;
1945} __packed;
1946
1947/* 1506/*
1948 * definitions for initial rate index field 1507 * definitions for initial rate index field
1949 * bits [3:0] initial rate index 1508 * bits [3:0] initial rate index
@@ -2032,52 +1591,8 @@ struct iwl_compressed_ba_resp {
2032/* 1591/*
2033 * REPLY_TX_PWR_TABLE_CMD = 0x97 (command, has simple generic response) 1592 * REPLY_TX_PWR_TABLE_CMD = 0x97 (command, has simple generic response)
2034 * 1593 *
2035 * See details under "TXPOWER" in iwl-4965-hw.h.
2036 */ 1594 */
2037 1595
2038struct iwl3945_txpowertable_cmd {
2039 u8 band; /* 0: 5 GHz, 1: 2.4 GHz */
2040 u8 reserved;
2041 __le16 channel;
2042 struct iwl3945_power_per_rate power[IWL_MAX_RATES];
2043} __packed;
2044
2045struct iwl4965_txpowertable_cmd {
2046 u8 band; /* 0: 5 GHz, 1: 2.4 GHz */
2047 u8 reserved;
2048 __le16 channel;
2049 struct iwl4965_tx_power_db tx_power;
2050} __packed;
2051
2052
2053/**
2054 * struct iwl3945_rate_scaling_cmd - Rate Scaling Command & Response
2055 *
2056 * REPLY_RATE_SCALE = 0x47 (command, has simple generic response)
2057 *
2058 * NOTE: The table of rates passed to the uCode via the
2059 * RATE_SCALE command sets up the corresponding order of
2060 * rates used for all related commands, including rate
2061 * masks, etc.
2062 *
2063 * For example, if you set 9MB (PLCP 0x0f) as the first
2064 * rate in the rate table, the bit mask for that rate
2065 * when passed through ofdm_basic_rates on the REPLY_RXON
2066 * command would be bit 0 (1 << 0)
2067 */
2068struct iwl3945_rate_scaling_info {
2069 __le16 rate_n_flags;
2070 u8 try_cnt;
2071 u8 next_rate_index;
2072} __packed;
2073
2074struct iwl3945_rate_scaling_cmd {
2075 u8 table_id;
2076 u8 reserved[3];
2077 struct iwl3945_rate_scaling_info table[IWL_MAX_RATES];
2078} __packed;
2079
2080
2081/*RS_NEW_API: only TLC_RTS remains and moved to bit 0 */ 1596/*RS_NEW_API: only TLC_RTS remains and moved to bit 0 */
2082#define LINK_QUAL_FLAGS_SET_STA_TLC_RTS_MSK (1 << 0) 1597#define LINK_QUAL_FLAGS_SET_STA_TLC_RTS_MSK (1 << 0)
2083 1598
@@ -2698,14 +2213,6 @@ struct iwl_spectrum_notification {
2698#define IWL_POWER_BT_SCO_ENA cpu_to_le16(BIT(8)) 2213#define IWL_POWER_BT_SCO_ENA cpu_to_le16(BIT(8))
2699#define IWL_POWER_ADVANCE_PM_ENA_MSK cpu_to_le16(BIT(9)) 2214#define IWL_POWER_ADVANCE_PM_ENA_MSK cpu_to_le16(BIT(9))
2700 2215
2701struct iwl3945_powertable_cmd {
2702 __le16 flags;
2703 u8 reserved[2];
2704 __le32 rx_data_timeout;
2705 __le32 tx_data_timeout;
2706 __le32 sleep_interval[IWL_POWER_VEC_SIZE];
2707} __packed;
2708
2709struct iwl_powertable_cmd { 2216struct iwl_powertable_cmd {
2710 __le16 flags; 2217 __le16 flags;
2711 u8 keep_alive_seconds; /* 3945 reserved */ 2218 u8 keep_alive_seconds; /* 3945 reserved */
@@ -2808,25 +2315,6 @@ struct iwl_ct_kill_throttling_config {
2808 * active_dwell < max_out_time 2315 * active_dwell < max_out_time
2809 */ 2316 */
2810 2317
2811/* FIXME: rename to AP1, remove tpc */
2812struct iwl3945_scan_channel {
2813 /*
2814 * type is defined as:
2815 * 0:0 1 = active, 0 = passive
2816 * 1:4 SSID direct bit map; if a bit is set, then corresponding
2817 * SSID IE is transmitted in probe request.
2818 * 5:7 reserved
2819 */
2820 u8 type;
2821 u8 channel; /* band is selected by iwl3945_scan_cmd "flags" field */
2822 struct iwl3945_tx_power tpc;
2823 __le16 active_dwell; /* in 1024-uSec TU (time units), typ 5-50 */
2824 __le16 passive_dwell; /* in 1024-uSec TU (time units), typ 20-500 */
2825} __packed;
2826
2827/* set number of direct probes u8 type */
2828#define IWL39_SCAN_PROBE_MASK(n) ((BIT(n) | (BIT(n) - BIT(1))))
2829
2830struct iwl_scan_channel { 2318struct iwl_scan_channel {
2831 /* 2319 /*
2832 * type is defined as: 2320 * type is defined as:
@@ -2922,50 +2410,6 @@ struct iwl_ssid_ie {
2922 * struct iwl_scan_channel. 2410 * struct iwl_scan_channel.
2923 */ 2411 */
2924 2412
2925struct iwl3945_scan_cmd {
2926 __le16 len;
2927 u8 reserved0;
2928 u8 channel_count; /* # channels in channel list */
2929 __le16 quiet_time; /* dwell only this # millisecs on quiet channel
2930 * (only for active scan) */
2931 __le16 quiet_plcp_th; /* quiet chnl is < this # pkts (typ. 1) */
2932 __le16 good_CRC_th; /* passive -> active promotion threshold */
2933 __le16 reserved1;
2934 __le32 max_out_time; /* max usec to be away from associated (service)
2935 * channel */
2936 __le32 suspend_time; /* pause scan this long (in "extended beacon
2937 * format") when returning to service channel:
2938 * 3945; 31:24 # beacons, 19:0 additional usec,
2939 * 4965; 31:22 # beacons, 21:0 additional usec.
2940 */
2941 __le32 flags; /* RXON_FLG_* */
2942 __le32 filter_flags; /* RXON_FILTER_* */
2943
2944 /* For active scans (set to all-0s for passive scans).
2945 * Does not include payload. Must specify Tx rate; no rate scaling. */
2946 struct iwl3945_tx_cmd tx_cmd;
2947
2948 /* For directed active scans (set to all-0s otherwise) */
2949 struct iwl_ssid_ie direct_scan[PROBE_OPTION_MAX_3945];
2950
2951 /*
2952 * Probe request frame, followed by channel list.
2953 *
2954 * Size of probe request frame is specified by byte count in tx_cmd.
2955 * Channel list follows immediately after probe request frame.
2956 * Number of channels in list is specified by channel_count.
2957 * Each channel in list is of type:
2958 *
2959 * struct iwl3945_scan_channel channels[0];
2960 *
2961 * NOTE: Only one band of channels can be scanned per pass. You
2962 * must not mix 2.4GHz channels and 5.2GHz channels, and you must wait
2963 * for one scan to complete (i.e. receive SCAN_COMPLETE_NOTIFICATION)
2964 * before requesting another scan.
2965 */
2966 u8 data[0];
2967} __packed;
2968
2969enum iwl_scan_flags { 2413enum iwl_scan_flags {
2970 /* BIT(0) currently unused */ 2414 /* BIT(0) currently unused */
2971 IWL_SCAN_FLAGS_ACTION_FRAME_TX = BIT(1), 2415 IWL_SCAN_FLAGS_ACTION_FRAME_TX = BIT(1),
@@ -3092,20 +2536,6 @@ enum iwl_ibss_manager {
3092 * BEACON_NOTIFICATION = 0x90 (notification only, not a command) 2536 * BEACON_NOTIFICATION = 0x90 (notification only, not a command)
3093 */ 2537 */
3094 2538
3095struct iwl3945_beacon_notif {
3096 struct iwl3945_tx_resp beacon_notify_hdr;
3097 __le32 low_tsf;
3098 __le32 high_tsf;
3099 __le32 ibss_mgr_status;
3100} __packed;
3101
3102struct iwl4965_beacon_notif {
3103 struct iwl4965_tx_resp beacon_notify_hdr;
3104 __le32 low_tsf;
3105 __le32 high_tsf;
3106 __le32 ibss_mgr_status;
3107} __packed;
3108
3109struct iwlagn_beacon_notif { 2539struct iwlagn_beacon_notif {
3110 struct iwlagn_tx_resp beacon_notify_hdr; 2540 struct iwlagn_tx_resp beacon_notify_hdr;
3111 __le32 low_tsf; 2541 __le32 low_tsf;
@@ -3117,14 +2547,6 @@ struct iwlagn_beacon_notif {
3117 * REPLY_TX_BEACON = 0x91 (command, has simple generic response) 2547 * REPLY_TX_BEACON = 0x91 (command, has simple generic response)
3118 */ 2548 */
3119 2549
3120struct iwl3945_tx_beacon_cmd {
3121 struct iwl3945_tx_cmd tx;
3122 __le16 tim_idx;
3123 u8 tim_size;
3124 u8 reserved1;
3125 struct ieee80211_hdr frame[0]; /* beacon frame */
3126} __packed;
3127
3128struct iwl_tx_beacon_cmd { 2550struct iwl_tx_beacon_cmd {
3129 struct iwl_tx_cmd tx; 2551 struct iwl_tx_cmd tx;
3130 __le16 tim_idx; 2552 __le16 tim_idx;
@@ -3473,13 +2895,6 @@ struct iwl_statistics_cmd {
3473#define STATISTICS_REPLY_FLG_BAND_24G_MSK cpu_to_le32(0x2) 2895#define STATISTICS_REPLY_FLG_BAND_24G_MSK cpu_to_le32(0x2)
3474#define STATISTICS_REPLY_FLG_HT40_MODE_MSK cpu_to_le32(0x8) 2896#define STATISTICS_REPLY_FLG_HT40_MODE_MSK cpu_to_le32(0x8)
3475 2897
3476struct iwl3945_notif_statistics {
3477 __le32 flag;
3478 struct iwl39_statistics_rx rx;
3479 struct iwl39_statistics_tx tx;
3480 struct iwl39_statistics_general general;
3481} __packed;
3482
3483struct iwl_notif_statistics { 2898struct iwl_notif_statistics {
3484 __le32 flag; 2899 __le32 flag;
3485 struct statistics_rx rx; 2900 struct statistics_rx rx;
@@ -4453,10 +3868,6 @@ struct iwl_rx_packet {
4453 __le32 len_n_flags; 3868 __le32 len_n_flags;
4454 struct iwl_cmd_header hdr; 3869 struct iwl_cmd_header hdr;
4455 union { 3870 union {
4456 struct iwl3945_rx_frame rx_frame;
4457 struct iwl3945_tx_resp tx_resp;
4458 struct iwl3945_beacon_notif beacon_status;
4459
4460 struct iwl_alive_resp alive_frame; 3871 struct iwl_alive_resp alive_frame;
4461 struct iwl_spectrum_notification spectrum_notif; 3872 struct iwl_spectrum_notification spectrum_notif;
4462 struct iwl_csa_notification csa_notif; 3873 struct iwl_csa_notification csa_notif;
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c
index 6c30fa652e27..d778f52132cb 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.c
+++ b/drivers/net/wireless/iwlwifi/iwl-core.c
@@ -1430,7 +1430,6 @@ void iwl_mac_remove_interface(struct ieee80211_hw *hw,
1430 1430
1431 iwl_teardown_interface(priv, vif, false); 1431 iwl_teardown_interface(priv, vif, false);
1432 1432
1433 memset(priv->bssid, 0, ETH_ALEN);
1434 mutex_unlock(&priv->mutex); 1433 mutex_unlock(&priv->mutex);
1435 1434
1436 IWL_DEBUG_MAC80211(priv, "leave\n"); 1435 IWL_DEBUG_MAC80211(priv, "leave\n");
diff --git a/drivers/net/wireless/iwlwifi/iwl-dev.h b/drivers/net/wireless/iwlwifi/iwl-dev.h
index 1c9d2dd37cca..8dc209a341aa 100644
--- a/drivers/net/wireless/iwlwifi/iwl-dev.h
+++ b/drivers/net/wireless/iwlwifi/iwl-dev.h
@@ -26,7 +26,6 @@
26/* 26/*
27 * Please use this file (iwl-dev.h) for driver implementation definitions. 27 * Please use this file (iwl-dev.h) for driver implementation definitions.
28 * Please use iwl-commands.h for uCode API definitions. 28 * Please use iwl-commands.h for uCode API definitions.
29 * Please use iwl-4965-hw.h for hardware-related definitions.
30 */ 29 */
31 30
32#ifndef __iwl_dev_h__ 31#ifndef __iwl_dev_h__
@@ -179,53 +178,12 @@ struct iwl_tx_queue {
179 178
180#define IWL_NUM_SCAN_RATES (2) 179#define IWL_NUM_SCAN_RATES (2)
181 180
182struct iwl4965_channel_tgd_info {
183 u8 type;
184 s8 max_power;
185};
186
187struct iwl4965_channel_tgh_info {
188 s64 last_radar_time;
189};
190
191#define IWL4965_MAX_RATE (33)
192
193struct iwl3945_clip_group {
194 /* maximum power level to prevent clipping for each rate, derived by
195 * us from this band's saturation power in EEPROM */
196 const s8 clip_powers[IWL_MAX_RATES];
197};
198
199/* current Tx power values to use, one for each rate for each channel.
200 * requested power is limited by:
201 * -- regulatory EEPROM limits for this channel
202 * -- hardware capabilities (clip-powers)
203 * -- spectrum management
204 * -- user preference (e.g. iwconfig)
205 * when requested power is set, base power index must also be set. */
206struct iwl3945_channel_power_info {
207 struct iwl3945_tx_power tpc; /* actual radio and DSP gain settings */
208 s8 power_table_index; /* actual (compenst'd) index into gain table */
209 s8 base_power_index; /* gain index for power at factory temp. */
210 s8 requested_power; /* power (dBm) requested for this chnl/rate */
211};
212
213/* current scan Tx power values to use, one for each scan rate for each
214 * channel. */
215struct iwl3945_scan_power_info {
216 struct iwl3945_tx_power tpc; /* actual radio and DSP gain settings */
217 s8 power_table_index; /* actual (compenst'd) index into gain table */
218 s8 requested_power; /* scan pwr (dBm) requested for chnl/rate */
219};
220
221/* 181/*
222 * One for each channel, holds all channel setup data 182 * One for each channel, holds all channel setup data
223 * Some of the fields (e.g. eeprom and flags/max_power_avg) are redundant 183 * Some of the fields (e.g. eeprom and flags/max_power_avg) are redundant
224 * with one another! 184 * with one another!
225 */ 185 */
226struct iwl_channel_info { 186struct iwl_channel_info {
227 struct iwl4965_channel_tgd_info tgd;
228 struct iwl4965_channel_tgh_info tgh;
229 struct iwl_eeprom_channel eeprom; /* EEPROM regulatory limit */ 187 struct iwl_eeprom_channel eeprom; /* EEPROM regulatory limit */
230 struct iwl_eeprom_channel ht40_eeprom; /* EEPROM regulatory limit for 188 struct iwl_eeprom_channel ht40_eeprom; /* EEPROM regulatory limit for
231 * HT40 channel */ 189 * HT40 channel */
@@ -245,14 +203,6 @@ struct iwl_channel_info {
245 s8 ht40_max_power_avg; /* (dBm) regul. eeprom, normal Tx, any rate */ 203 s8 ht40_max_power_avg; /* (dBm) regul. eeprom, normal Tx, any rate */
246 u8 ht40_flags; /* flags copied from EEPROM */ 204 u8 ht40_flags; /* flags copied from EEPROM */
247 u8 ht40_extension_channel; /* HT_IE_EXT_CHANNEL_* */ 205 u8 ht40_extension_channel; /* HT_IE_EXT_CHANNEL_* */
248
249 /* Radio/DSP gain settings for each "normal" data Tx rate.
250 * These include, in addition to RF and DSP gain, a few fields for
251 * remembering/modifying gain settings (indexes). */
252 struct iwl3945_channel_power_info power_info[IWL4965_MAX_RATE];
253
254 /* Radio/DSP gain settings for each scan rate, for directed scans. */
255 struct iwl3945_scan_power_info scan_pwr_info[IWL_NUM_SCAN_RATES];
256}; 206};
257 207
258#define IWL_TX_FIFO_BK 0 /* shared */ 208#define IWL_TX_FIFO_BK 0 /* shared */
@@ -501,9 +451,6 @@ struct iwl_station_priv_common {
501 * When mac80211 creates a station it reserves some space (hw->sta_data_size) 451 * When mac80211 creates a station it reserves some space (hw->sta_data_size)
502 * in the structure for use by driver. This structure is places in that 452 * in the structure for use by driver. This structure is places in that
503 * space. 453 * space.
504 *
505 * The common struct MUST be first because it is shared between
506 * 3945 and agn!
507 */ 454 */
508struct iwl_station_priv { 455struct iwl_station_priv {
509 struct iwl_station_priv_common common; 456 struct iwl_station_priv_common common;
@@ -621,14 +568,6 @@ struct iwl_tlv_ucode_header {
621 u8 data[0]; 568 u8 data[0];
622}; 569};
623 570
624struct iwl4965_ibss_seq {
625 u8 mac[ETH_ALEN];
626 u16 seq_num;
627 u16 frag_num;
628 unsigned long packet_time;
629 struct list_head list;
630};
631
632struct iwl_sensitivity_ranges { 571struct iwl_sensitivity_ranges {
633 u16 min_nrg_cck; 572 u16 min_nrg_cck;
634 u16 max_nrg_cck; 573 u16 max_nrg_cck;
@@ -724,8 +663,6 @@ struct iwl_hw_params {
724 * Naming convention -- 663 * Naming convention --
725 * iwl_ <-- Is part of iwlwifi 664 * iwl_ <-- Is part of iwlwifi
726 * iwlXXXX_ <-- Hardware specific (implemented in iwl-XXXX.c for XXXX) 665 * iwlXXXX_ <-- Hardware specific (implemented in iwl-XXXX.c for XXXX)
727 * iwl4965_bg_ <-- Called from work queue context
728 * iwl4965_mac_ <-- mac80211 callback
729 * 666 *
730 ****************************************************************************/ 667 ****************************************************************************/
731extern void iwl_update_chain_flags(struct iwl_priv *priv); 668extern void iwl_update_chain_flags(struct iwl_priv *priv);
@@ -774,7 +711,6 @@ struct iwl_dma_ptr {
774 711
775/* Sensitivity and chain noise calibration */ 712/* Sensitivity and chain noise calibration */
776#define INITIALIZATION_VALUE 0xFFFF 713#define INITIALIZATION_VALUE 0xFFFF
777#define IWL4965_CAL_NUM_BEACONS 20
778#define IWL_CAL_NUM_BEACONS 16 714#define IWL_CAL_NUM_BEACONS 16
779#define MAXIMUM_ALLOWED_PATHLOSS 15 715#define MAXIMUM_ALLOWED_PATHLOSS 15
780 716
@@ -808,24 +744,19 @@ struct iwl_dma_ptr {
808#define NRG_NUM_PREV_STAT_L 20 744#define NRG_NUM_PREV_STAT_L 20
809#define NUM_RX_CHAINS 3 745#define NUM_RX_CHAINS 3
810 746
811enum iwl4965_false_alarm_state { 747enum iwlagn_false_alarm_state {
812 IWL_FA_TOO_MANY = 0, 748 IWL_FA_TOO_MANY = 0,
813 IWL_FA_TOO_FEW = 1, 749 IWL_FA_TOO_FEW = 1,
814 IWL_FA_GOOD_RANGE = 2, 750 IWL_FA_GOOD_RANGE = 2,
815}; 751};
816 752
817enum iwl4965_chain_noise_state { 753enum iwlagn_chain_noise_state {
818 IWL_CHAIN_NOISE_ALIVE = 0, /* must be 0 */ 754 IWL_CHAIN_NOISE_ALIVE = 0, /* must be 0 */
819 IWL_CHAIN_NOISE_ACCUMULATE, 755 IWL_CHAIN_NOISE_ACCUMULATE,
820 IWL_CHAIN_NOISE_CALIBRATED, 756 IWL_CHAIN_NOISE_CALIBRATED,
821 IWL_CHAIN_NOISE_DONE, 757 IWL_CHAIN_NOISE_DONE,
822}; 758};
823 759
824enum iwl4965_calib_enabled_state {
825 IWL_CALIB_DISABLED = 0, /* must be 0 */
826 IWL_CALIB_ENABLED = 1,
827};
828
829 760
830/* 761/*
831 * enum iwl_calib 762 * enum iwl_calib
@@ -1133,12 +1064,6 @@ struct iwl_force_reset {
1133 1064
1134/* extend beacon time format bit shifting */ 1065/* extend beacon time format bit shifting */
1135/* 1066/*
1136 * for _3945 devices
1137 * bits 31:24 - extended
1138 * bits 23:0 - interval
1139 */
1140#define IWL3945_EXT_BEACON_TIME_POS 24
1141/*
1142 * for _agn devices 1067 * for _agn devices
1143 * bits 31:22 - extended 1068 * bits 31:22 - extended
1144 * bits 21:0 - interval 1069 * bits 21:0 - interval
@@ -1391,15 +1316,12 @@ struct iwl_priv {
1391 struct iwl_power_mgr power_data; 1316 struct iwl_power_mgr power_data;
1392 struct iwl_tt_mgmt thermal_throttle; 1317 struct iwl_tt_mgmt thermal_throttle;
1393 1318
1394 /* context information */
1395 u8 bssid[ETH_ALEN]; /* used only on 3945 but filled by core */
1396
1397 /* station table variables */ 1319 /* station table variables */
1398 1320
1399 /* Note: if lock and sta_lock are needed, lock must be acquired first */ 1321 /* Note: if lock and sta_lock are needed, lock must be acquired first */
1400 spinlock_t sta_lock; 1322 spinlock_t sta_lock;
1401 int num_stations; 1323 int num_stations;
1402 struct iwl_station_entry stations[IWL_STATION_COUNT]; 1324 struct iwl_station_entry stations[IWLAGN_STATION_COUNT];
1403 unsigned long ucode_key_table; 1325 unsigned long ucode_key_table;
1404 1326
1405 /* queue refcounts */ 1327 /* queue refcounts */
@@ -1423,101 +1345,66 @@ struct iwl_priv {
1423 /* Last Rx'd beacon timestamp */ 1345 /* Last Rx'd beacon timestamp */
1424 u64 timestamp; 1346 u64 timestamp;
1425 1347
1426 union { 1348 struct {
1427#if defined(CONFIG_IWL3945) || defined(CONFIG_IWL3945_MODULE) 1349 /* INT ICT Table */
1428 struct { 1350 __le32 *ict_tbl;
1429 void *shared_virt; 1351 void *ict_tbl_vir;
1430 dma_addr_t shared_phys; 1352 dma_addr_t ict_tbl_dma;
1431 1353 dma_addr_t aligned_ict_tbl_dma;
1432 struct delayed_work thermal_periodic; 1354 int ict_index;
1433 struct delayed_work rfkill_poll; 1355 u32 inta;
1434 1356 bool use_ict;
1435 struct iwl3945_notif_statistics statistics; 1357 /*
1436#ifdef CONFIG_IWLWIFI_DEBUGFS 1358 * reporting the number of tids has AGG on. 0 means
1437 struct iwl3945_notif_statistics accum_statistics; 1359 * no AGGREGATION
1438 struct iwl3945_notif_statistics delta_statistics; 1360 */
1439 struct iwl3945_notif_statistics max_delta; 1361 u8 agg_tids_count;
1440#endif 1362
1441 1363 struct iwl_rx_phy_res last_phy_res;
1442 u32 sta_supp_rates; 1364 bool last_phy_res_valid;
1443 int last_rx_rssi; /* From Rx packet statistics */ 1365
1444 1366 struct completion firmware_loading_complete;
1445 /* Rx'd packet timing information */ 1367
1446 u32 last_beacon_time; 1368 u32 init_evtlog_ptr, init_evtlog_size, init_errlog_ptr;
1447 u64 last_tsf; 1369 u32 inst_evtlog_ptr, inst_evtlog_size, inst_errlog_ptr;
1448 1370
1449 /* 1371 /*
1450 * each calibration channel group in the 1372 * chain noise reset and gain commands are the
1451 * EEPROM has a derived clip setting for 1373 * two extra calibration commands follows the standard
1452 * each rate. 1374 * phy calibration commands
1453 */ 1375 */
1454 const struct iwl3945_clip_group clip_groups[5]; 1376 u8 phy_calib_chain_noise_reset_cmd;
1455 1377 u8 phy_calib_chain_noise_gain_cmd;
1456 } _3945; 1378
1457#endif 1379 struct iwl_notif_statistics statistics;
1458#if defined(CONFIG_IWLAGN) || defined(CONFIG_IWLAGN_MODULE) 1380 struct iwl_bt_notif_statistics statistics_bt;
1459 struct { 1381 /* counts reply_tx error */
1460 /* INT ICT Table */ 1382 struct reply_tx_error_statistics reply_tx_stats;
1461 __le32 *ict_tbl; 1383 struct reply_agg_tx_error_statistics reply_agg_tx_stats;
1462 void *ict_tbl_vir;
1463 dma_addr_t ict_tbl_dma;
1464 dma_addr_t aligned_ict_tbl_dma;
1465 int ict_index;
1466 u32 inta;
1467 bool use_ict;
1468 /*
1469 * reporting the number of tids has AGG on. 0 means
1470 * no AGGREGATION
1471 */
1472 u8 agg_tids_count;
1473
1474 struct iwl_rx_phy_res last_phy_res;
1475 bool last_phy_res_valid;
1476
1477 struct completion firmware_loading_complete;
1478
1479 u32 init_evtlog_ptr, init_evtlog_size, init_errlog_ptr;
1480 u32 inst_evtlog_ptr, inst_evtlog_size, inst_errlog_ptr;
1481
1482 /*
1483 * chain noise reset and gain commands are the
1484 * two extra calibration commands follows the standard
1485 * phy calibration commands
1486 */
1487 u8 phy_calib_chain_noise_reset_cmd;
1488 u8 phy_calib_chain_noise_gain_cmd;
1489
1490 struct iwl_notif_statistics statistics;
1491 struct iwl_bt_notif_statistics statistics_bt;
1492 /* counts reply_tx error */
1493 struct reply_tx_error_statistics reply_tx_stats;
1494 struct reply_agg_tx_error_statistics reply_agg_tx_stats;
1495#ifdef CONFIG_IWLWIFI_DEBUGFS 1384#ifdef CONFIG_IWLWIFI_DEBUGFS
1496 struct iwl_notif_statistics accum_statistics; 1385 struct iwl_notif_statistics accum_statistics;
1497 struct iwl_notif_statistics delta_statistics; 1386 struct iwl_notif_statistics delta_statistics;
1498 struct iwl_notif_statistics max_delta; 1387 struct iwl_notif_statistics max_delta;
1499 struct iwl_bt_notif_statistics accum_statistics_bt; 1388 struct iwl_bt_notif_statistics accum_statistics_bt;
1500 struct iwl_bt_notif_statistics delta_statistics_bt; 1389 struct iwl_bt_notif_statistics delta_statistics_bt;
1501 struct iwl_bt_notif_statistics max_delta_bt; 1390 struct iwl_bt_notif_statistics max_delta_bt;
1502#endif
1503
1504 /* notification wait support */
1505 struct list_head notif_waits;
1506 spinlock_t notif_wait_lock;
1507 wait_queue_head_t notif_waitq;
1508
1509 /* remain-on-channel offload support */
1510 struct ieee80211_channel *hw_roc_channel;
1511 struct delayed_work hw_roc_work;
1512 enum nl80211_channel_type hw_roc_chantype;
1513 int hw_roc_duration;
1514
1515 struct sk_buff *offchan_tx_skb;
1516 int offchan_tx_timeout;
1517 struct ieee80211_channel *offchan_tx_chan;
1518 } _agn;
1519#endif 1391#endif
1520 }; 1392 /* notification wait support */
1393 struct list_head notif_waits;
1394 spinlock_t notif_wait_lock;
1395 wait_queue_head_t notif_waitq;
1396
1397 /* remain-on-channel offload support */
1398 struct ieee80211_channel *hw_roc_channel;
1399 struct delayed_work hw_roc_work;
1400 enum nl80211_channel_type hw_roc_chantype;
1401 int hw_roc_duration;
1402 bool hw_roc_setup;
1403
1404 struct sk_buff *offchan_tx_skb;
1405 int offchan_tx_timeout;
1406 struct ieee80211_channel *offchan_tx_chan;
1407 } _agn;
1521 1408
1522 /* bt coex */ 1409 /* bt coex */
1523 u8 bt_enable_flag; 1410 u8 bt_enable_flag;
diff --git a/drivers/net/wireless/iwlwifi/iwl-eeprom.h b/drivers/net/wireless/iwlwifi/iwl-eeprom.h
index 98aa8af01192..d0f858af30e8 100644
--- a/drivers/net/wireless/iwlwifi/iwl-eeprom.h
+++ b/drivers/net/wireless/iwlwifi/iwl-eeprom.h
@@ -110,10 +110,6 @@ enum {
110}; 110};
111 111
112/* SKU Capabilities */ 112/* SKU Capabilities */
113/* 3945 only */
114#define EEPROM_SKU_CAP_SW_RF_KILL_ENABLE (1 << 0)
115#define EEPROM_SKU_CAP_HW_RF_KILL_ENABLE (1 << 1)
116
117/* 5000 and up */ 113/* 5000 and up */
118#define EEPROM_SKU_CAP_BAND_POS (4) 114#define EEPROM_SKU_CAP_BAND_POS (4)
119#define EEPROM_SKU_CAP_BAND_SELECTION \ 115#define EEPROM_SKU_CAP_BAND_SELECTION \
@@ -168,28 +164,6 @@ struct iwl_eeprom_enhanced_txpwr {
168 s8 mimo3_max; 164 s8 mimo3_max;
169} __packed; 165} __packed;
170 166
171/* 3945 Specific */
172#define EEPROM_3945_EEPROM_VERSION (0x2f)
173
174/* 4965 has two radio transmitters (and 3 radio receivers) */
175#define EEPROM_TX_POWER_TX_CHAINS (2)
176
177/* 4965 has room for up to 8 sets of txpower calibration data */
178#define EEPROM_TX_POWER_BANDS (8)
179
180/* 4965 factory calibration measures txpower gain settings for
181 * each of 3 target output levels */
182#define EEPROM_TX_POWER_MEASUREMENTS (3)
183
184/* 4965 Specific */
185/* 4965 driver does not work with txpower calibration version < 5 */
186#define EEPROM_4965_TX_POWER_VERSION (5)
187#define EEPROM_4965_EEPROM_VERSION (0x2f)
188#define EEPROM_4965_CALIB_VERSION_OFFSET (2*0xB6) /* 2 bytes */
189#define EEPROM_4965_CALIB_TXPOWER_OFFSET (2*0xE8) /* 48 bytes */
190#define EEPROM_4965_BOARD_REVISION (2*0x4F) /* 2 bytes */
191#define EEPROM_4965_BOARD_PBA (2*0x56+1) /* 9 bytes */
192
193/* 5000 Specific */ 167/* 5000 Specific */
194#define EEPROM_5000_TX_POWER_VERSION (4) 168#define EEPROM_5000_TX_POWER_VERSION (4)
195#define EEPROM_5000_EEPROM_VERSION (0x11A) 169#define EEPROM_5000_EEPROM_VERSION (0x11A)
@@ -282,90 +256,6 @@ struct iwl_eeprom_enhanced_txpwr {
282/* 2.4 GHz */ 256/* 2.4 GHz */
283extern const u8 iwl_eeprom_band_1[14]; 257extern const u8 iwl_eeprom_band_1[14];
284 258
285/*
286 * factory calibration data for one txpower level, on one channel,
287 * measured on one of the 2 tx chains (radio transmitter and associated
288 * antenna). EEPROM contains:
289 *
290 * 1) Temperature (degrees Celsius) of device when measurement was made.
291 *
292 * 2) Gain table index used to achieve the target measurement power.
293 * This refers to the "well-known" gain tables (see iwl-4965-hw.h).
294 *
295 * 3) Actual measured output power, in half-dBm ("34" = 17 dBm).
296 *
297 * 4) RF power amplifier detector level measurement (not used).
298 */
299struct iwl_eeprom_calib_measure {
300 u8 temperature; /* Device temperature (Celsius) */
301 u8 gain_idx; /* Index into gain table */
302 u8 actual_pow; /* Measured RF output power, half-dBm */
303 s8 pa_det; /* Power amp detector level (not used) */
304} __packed;
305
306
307/*
308 * measurement set for one channel. EEPROM contains:
309 *
310 * 1) Channel number measured
311 *
312 * 2) Measurements for each of 3 power levels for each of 2 radio transmitters
313 * (a.k.a. "tx chains") (6 measurements altogether)
314 */
315struct iwl_eeprom_calib_ch_info {
316 u8 ch_num;
317 struct iwl_eeprom_calib_measure
318 measurements[EEPROM_TX_POWER_TX_CHAINS]
319 [EEPROM_TX_POWER_MEASUREMENTS];
320} __packed;
321
322/*
323 * txpower subband info.
324 *
325 * For each frequency subband, EEPROM contains the following:
326 *
327 * 1) First and last channels within range of the subband. "0" values
328 * indicate that this sample set is not being used.
329 *
330 * 2) Sample measurement sets for 2 channels close to the range endpoints.
331 */
332struct iwl_eeprom_calib_subband_info {
333 u8 ch_from; /* channel number of lowest channel in subband */
334 u8 ch_to; /* channel number of highest channel in subband */
335 struct iwl_eeprom_calib_ch_info ch1;
336 struct iwl_eeprom_calib_ch_info ch2;
337} __packed;
338
339
340/*
341 * txpower calibration info. EEPROM contains:
342 *
343 * 1) Factory-measured saturation power levels (maximum levels at which
344 * tx power amplifier can output a signal without too much distortion).
345 * There is one level for 2.4 GHz band and one for 5 GHz band. These
346 * values apply to all channels within each of the bands.
347 *
348 * 2) Factory-measured power supply voltage level. This is assumed to be
349 * constant (i.e. same value applies to all channels/bands) while the
350 * factory measurements are being made.
351 *
352 * 3) Up to 8 sets of factory-measured txpower calibration values.
353 * These are for different frequency ranges, since txpower gain
354 * characteristics of the analog radio circuitry vary with frequency.
355 *
356 * Not all sets need to be filled with data;
357 * struct iwl_eeprom_calib_subband_info contains range of channels
358 * (0 if unused) for each set of data.
359 */
360struct iwl_eeprom_calib_info {
361 u8 saturation_power24; /* half-dBm (e.g. "34" = 17 dBm) */
362 u8 saturation_power52; /* half-dBm */
363 __le16 voltage; /* signed */
364 struct iwl_eeprom_calib_subband_info
365 band_info[EEPROM_TX_POWER_BANDS];
366} __packed;
367
368
369#define ADDRESS_MSK 0x0000FFFF 259#define ADDRESS_MSK 0x0000FFFF
370#define INDIRECT_TYPE_MSK 0x000F0000 260#define INDIRECT_TYPE_MSK 0x000F0000
371#define INDIRECT_HOST 0x00010000 261#define INDIRECT_HOST 0x00010000
@@ -398,83 +288,8 @@ struct iwl_eeprom_calib_info {
398#define EEPROM_RF_CFG_TX_ANT_MSK(x) ((x >> 8) & 0xF) /* bits 8-11 */ 288#define EEPROM_RF_CFG_TX_ANT_MSK(x) ((x >> 8) & 0xF) /* bits 8-11 */
399#define EEPROM_RF_CFG_RX_ANT_MSK(x) ((x >> 12) & 0xF) /* bits 12-15 */ 289#define EEPROM_RF_CFG_RX_ANT_MSK(x) ((x >> 12) & 0xF) /* bits 12-15 */
400 290
401#define EEPROM_3945_RF_CFG_TYPE_MAX 0x0
402#define EEPROM_4965_RF_CFG_TYPE_MAX 0x1
403
404/* Radio Config for 5000 and up */
405#define EEPROM_RF_CONFIG_TYPE_R3x3 0x0
406#define EEPROM_RF_CONFIG_TYPE_R2x2 0x1
407#define EEPROM_RF_CONFIG_TYPE_R1x2 0x2
408#define EEPROM_RF_CONFIG_TYPE_MAX 0x3 291#define EEPROM_RF_CONFIG_TYPE_MAX 0x3
409 292
410/*
411 * Per-channel regulatory data.
412 *
413 * Each channel that *might* be supported by iwl has a fixed location
414 * in EEPROM containing EEPROM_CHANNEL_* usage flags (LSB) and max regulatory
415 * txpower (MSB).
416 *
417 * Entries immediately below are for 20 MHz channel width. HT40 (40 MHz)
418 * channels (only for 4965, not supported by 3945) appear later in the EEPROM.
419 *
420 * 2.4 GHz channels 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14
421 */
422#define EEPROM_REGULATORY_SKU_ID (2*0x60) /* 4 bytes */
423#define EEPROM_REGULATORY_BAND_1 (2*0x62) /* 2 bytes */
424#define EEPROM_REGULATORY_BAND_1_CHANNELS (2*0x63) /* 28 bytes */
425
426/*
427 * 4.9 GHz channels 183, 184, 185, 187, 188, 189, 192, 196,
428 * 5.0 GHz channels 7, 8, 11, 12, 16
429 * (4915-5080MHz) (none of these is ever supported)
430 */
431#define EEPROM_REGULATORY_BAND_2 (2*0x71) /* 2 bytes */
432#define EEPROM_REGULATORY_BAND_2_CHANNELS (2*0x72) /* 26 bytes */
433
434/*
435 * 5.2 GHz channels 34, 36, 38, 40, 42, 44, 46, 48, 52, 56, 60, 64
436 * (5170-5320MHz)
437 */
438#define EEPROM_REGULATORY_BAND_3 (2*0x7F) /* 2 bytes */
439#define EEPROM_REGULATORY_BAND_3_CHANNELS (2*0x80) /* 24 bytes */
440
441/*
442 * 5.5 GHz channels 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140
443 * (5500-5700MHz)
444 */
445#define EEPROM_REGULATORY_BAND_4 (2*0x8C) /* 2 bytes */
446#define EEPROM_REGULATORY_BAND_4_CHANNELS (2*0x8D) /* 22 bytes */
447
448/*
449 * 5.7 GHz channels 145, 149, 153, 157, 161, 165
450 * (5725-5825MHz)
451 */
452#define EEPROM_REGULATORY_BAND_5 (2*0x98) /* 2 bytes */
453#define EEPROM_REGULATORY_BAND_5_CHANNELS (2*0x99) /* 12 bytes */
454
455/*
456 * 2.4 GHz HT40 channels 1 (5), 2 (6), 3 (7), 4 (8), 5 (9), 6 (10), 7 (11)
457 *
458 * The channel listed is the center of the lower 20 MHz half of the channel.
459 * The overall center frequency is actually 2 channels (10 MHz) above that,
460 * and the upper half of each HT40 channel is centered 4 channels (20 MHz) away
461 * from the lower half; e.g. the upper half of HT40 channel 1 is channel 5,
462 * and the overall HT40 channel width centers on channel 3.
463 *
464 * NOTE: The RXON command uses 20 MHz channel numbers to specify the
465 * control channel to which to tune. RXON also specifies whether the
466 * control channel is the upper or lower half of a HT40 channel.
467 *
468 * NOTE: 4965 does not support HT40 channels on 2.4 GHz.
469 */
470#define EEPROM_4965_REGULATORY_BAND_24_HT40_CHANNELS (2*0xA0) /* 14 bytes */
471
472/*
473 * 5.2 GHz HT40 channels 36 (40), 44 (48), 52 (56), 60 (64),
474 * 100 (104), 108 (112), 116 (120), 124 (128), 132 (136), 149 (153), 157 (161)
475 */
476#define EEPROM_4965_REGULATORY_BAND_52_HT40_CHANNELS (2*0xA8) /* 22 bytes */
477
478#define EEPROM_REGULATORY_BAND_NO_HT40 (0) 293#define EEPROM_REGULATORY_BAND_NO_HT40 (0)
479 294
480struct iwl_eeprom_ops { 295struct iwl_eeprom_ops {
diff --git a/drivers/net/wireless/iwlwifi/iwl-hcmd.c b/drivers/net/wireless/iwlwifi/iwl-hcmd.c
index c71c0a45fa0b..165e7567d8ee 100644
--- a/drivers/net/wireless/iwlwifi/iwl-hcmd.c
+++ b/drivers/net/wireless/iwlwifi/iwl-hcmd.c
@@ -51,9 +51,7 @@ const char *get_cmd_string(u8 cmd)
51 IWL_CMD(REPLY_REMOVE_ALL_STA); 51 IWL_CMD(REPLY_REMOVE_ALL_STA);
52 IWL_CMD(REPLY_TXFIFO_FLUSH); 52 IWL_CMD(REPLY_TXFIFO_FLUSH);
53 IWL_CMD(REPLY_WEPKEY); 53 IWL_CMD(REPLY_WEPKEY);
54 IWL_CMD(REPLY_3945_RX);
55 IWL_CMD(REPLY_TX); 54 IWL_CMD(REPLY_TX);
56 IWL_CMD(REPLY_RATE_SCALE);
57 IWL_CMD(REPLY_LEDS_CMD); 55 IWL_CMD(REPLY_LEDS_CMD);
58 IWL_CMD(REPLY_TX_LINK_QUALITY_CMD); 56 IWL_CMD(REPLY_TX_LINK_QUALITY_CMD);
59 IWL_CMD(COEX_PRIORITY_TABLE_CMD); 57 IWL_CMD(COEX_PRIORITY_TABLE_CMD);
diff --git a/drivers/net/wireless/iwlwifi/iwl-prph.h b/drivers/net/wireless/iwlwifi/iwl-prph.h
index 86f5123bccda..81c464747f59 100644
--- a/drivers/net/wireless/iwlwifi/iwl-prph.h
+++ b/drivers/net/wireless/iwlwifi/iwl-prph.h
@@ -91,7 +91,6 @@
91#define APMG_PS_CTRL_VAL_RESET_REQ (0x04000000) 91#define APMG_PS_CTRL_VAL_RESET_REQ (0x04000000)
92#define APMG_PS_CTRL_MSK_PWR_SRC (0x03000000) 92#define APMG_PS_CTRL_MSK_PWR_SRC (0x03000000)
93#define APMG_PS_CTRL_VAL_PWR_SRC_VMAIN (0x00000000) 93#define APMG_PS_CTRL_VAL_PWR_SRC_VMAIN (0x00000000)
94#define APMG_PS_CTRL_VAL_PWR_SRC_MAX (0x01000000) /* 3945 only */
95#define APMG_PS_CTRL_VAL_PWR_SRC_VAUX (0x02000000) 94#define APMG_PS_CTRL_VAL_PWR_SRC_VAUX (0x02000000)
96#define APMG_SVR_VOLTAGE_CONFIG_BIT_MSK (0x000001E0) /* bit 8:5 */ 95#define APMG_SVR_VOLTAGE_CONFIG_BIT_MSK (0x000001E0) /* bit 8:5 */
97#define APMG_SVR_DIGITAL_VOLTAGE_1_32 (0x00000060) 96#define APMG_SVR_DIGITAL_VOLTAGE_1_32 (0x00000060)
@@ -234,16 +233,6 @@
234#define BSM_SRAM_SIZE (1024) /* bytes */ 233#define BSM_SRAM_SIZE (1024) /* bytes */
235 234
236 235
237/* 3945 Tx scheduler registers */
238#define ALM_SCD_BASE (PRPH_BASE + 0x2E00)
239#define ALM_SCD_MODE_REG (ALM_SCD_BASE + 0x000)
240#define ALM_SCD_ARASTAT_REG (ALM_SCD_BASE + 0x004)
241#define ALM_SCD_TXFACT_REG (ALM_SCD_BASE + 0x010)
242#define ALM_SCD_TXF4MF_REG (ALM_SCD_BASE + 0x014)
243#define ALM_SCD_TXF5MF_REG (ALM_SCD_BASE + 0x020)
244#define ALM_SCD_SBYP_MODE_1_REG (ALM_SCD_BASE + 0x02C)
245#define ALM_SCD_SBYP_MODE_2_REG (ALM_SCD_BASE + 0x030)
246
247/** 236/**
248 * Tx Scheduler 237 * Tx Scheduler
249 * 238 *