aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-1000.c18
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-2000.c18
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-5000.c28
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-6000.c18
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-calib.c22
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-lib.c4
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-rs.c56
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-rxon.c2
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-sta.c12
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-tx.c6
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn.c36
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-debugfs.c12
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-dev.h33
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-eeprom.c24
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-mac80211.c6
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-scan.c8
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-shared.h34
17 files changed, 168 insertions, 169 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-1000.c b/drivers/net/wireless/iwlwifi/iwl-1000.c
index 3787f845cbd6..b131f9d35efe 100644
--- a/drivers/net/wireless/iwlwifi/iwl-1000.c
+++ b/drivers/net/wireless/iwlwifi/iwl-1000.c
@@ -77,8 +77,8 @@
77static void iwl1000_set_ct_threshold(struct iwl_priv *priv) 77static void iwl1000_set_ct_threshold(struct iwl_priv *priv)
78{ 78{
79 /* want Celsius */ 79 /* want Celsius */
80 hw_params(priv).ct_kill_threshold = CT_KILL_THRESHOLD_LEGACY; 80 priv->hw_params.ct_kill_threshold = CT_KILL_THRESHOLD_LEGACY;
81 hw_params(priv).ct_kill_exit_threshold = CT_KILL_EXIT_THRESHOLD; 81 priv->hw_params.ct_kill_exit_threshold = CT_KILL_EXIT_THRESHOLD;
82} 82}
83 83
84/* NIC configuration for 1000 series */ 84/* NIC configuration for 1000 series */
@@ -122,20 +122,20 @@ static const struct iwl_sensitivity_ranges iwl1000_sensitivity = {
122 122
123static void iwl1000_hw_set_hw_params(struct iwl_priv *priv) 123static void iwl1000_hw_set_hw_params(struct iwl_priv *priv)
124{ 124{
125 hw_params(priv).ht40_channel = BIT(IEEE80211_BAND_2GHZ); 125 priv->hw_params.ht40_channel = BIT(IEEE80211_BAND_2GHZ);
126 126
127 hw_params(priv).tx_chains_num = 127 priv->hw_params.tx_chains_num =
128 num_of_ant(hw_params(priv).valid_tx_ant); 128 num_of_ant(priv->hw_params.valid_tx_ant);
129 if (cfg(priv)->rx_with_siso_diversity) 129 if (cfg(priv)->rx_with_siso_diversity)
130 hw_params(priv).rx_chains_num = 1; 130 priv->hw_params.rx_chains_num = 1;
131 else 131 else
132 hw_params(priv).rx_chains_num = 132 priv->hw_params.rx_chains_num =
133 num_of_ant(hw_params(priv).valid_rx_ant); 133 num_of_ant(priv->hw_params.valid_rx_ant);
134 134
135 iwl1000_set_ct_threshold(priv); 135 iwl1000_set_ct_threshold(priv);
136 136
137 /* Set initial sensitivity parameters */ 137 /* Set initial sensitivity parameters */
138 hw_params(priv).sens = &iwl1000_sensitivity; 138 priv->hw_params.sens = &iwl1000_sensitivity;
139} 139}
140 140
141static struct iwl_lib_ops iwl1000_lib = { 141static struct iwl_lib_ops iwl1000_lib = {
diff --git a/drivers/net/wireless/iwlwifi/iwl-2000.c b/drivers/net/wireless/iwlwifi/iwl-2000.c
index e1329a13f0fd..d4c495e7bf2d 100644
--- a/drivers/net/wireless/iwlwifi/iwl-2000.c
+++ b/drivers/net/wireless/iwlwifi/iwl-2000.c
@@ -77,8 +77,8 @@
77static void iwl2000_set_ct_threshold(struct iwl_priv *priv) 77static void iwl2000_set_ct_threshold(struct iwl_priv *priv)
78{ 78{
79 /* want Celsius */ 79 /* want Celsius */
80 hw_params(priv).ct_kill_threshold = CT_KILL_THRESHOLD; 80 priv->hw_params.ct_kill_threshold = CT_KILL_THRESHOLD;
81 hw_params(priv).ct_kill_exit_threshold = CT_KILL_EXIT_THRESHOLD; 81 priv->hw_params.ct_kill_exit_threshold = CT_KILL_EXIT_THRESHOLD;
82} 82}
83 83
84/* NIC configuration for 2000 series */ 84/* NIC configuration for 2000 series */
@@ -116,20 +116,20 @@ static const struct iwl_sensitivity_ranges iwl2000_sensitivity = {
116 116
117static void iwl2000_hw_set_hw_params(struct iwl_priv *priv) 117static void iwl2000_hw_set_hw_params(struct iwl_priv *priv)
118{ 118{
119 hw_params(priv).ht40_channel = BIT(IEEE80211_BAND_2GHZ); 119 priv->hw_params.ht40_channel = BIT(IEEE80211_BAND_2GHZ);
120 120
121 hw_params(priv).tx_chains_num = 121 priv->hw_params.tx_chains_num =
122 num_of_ant(hw_params(priv).valid_tx_ant); 122 num_of_ant(priv->hw_params.valid_tx_ant);
123 if (cfg(priv)->rx_with_siso_diversity) 123 if (cfg(priv)->rx_with_siso_diversity)
124 hw_params(priv).rx_chains_num = 1; 124 priv->hw_params.rx_chains_num = 1;
125 else 125 else
126 hw_params(priv).rx_chains_num = 126 priv->hw_params.rx_chains_num =
127 num_of_ant(hw_params(priv).valid_rx_ant); 127 num_of_ant(priv->hw_params.valid_rx_ant);
128 128
129 iwl2000_set_ct_threshold(priv); 129 iwl2000_set_ct_threshold(priv);
130 130
131 /* Set initial sensitivity parameters */ 131 /* Set initial sensitivity parameters */
132 hw_params(priv).sens = &iwl2000_sensitivity; 132 priv->hw_params.sens = &iwl2000_sensitivity;
133} 133}
134 134
135static struct iwl_lib_ops iwl2000_lib = { 135static struct iwl_lib_ops iwl2000_lib = {
diff --git a/drivers/net/wireless/iwlwifi/iwl-5000.c b/drivers/net/wireless/iwlwifi/iwl-5000.c
index 9f379d3dad18..8870370e0da3 100644
--- a/drivers/net/wireless/iwlwifi/iwl-5000.c
+++ b/drivers/net/wireless/iwlwifi/iwl-5000.c
@@ -145,45 +145,45 @@ static void iwl5150_set_ct_threshold(struct iwl_priv *priv)
145 s32 threshold = (s32)CELSIUS_TO_KELVIN(CT_KILL_THRESHOLD_LEGACY) - 145 s32 threshold = (s32)CELSIUS_TO_KELVIN(CT_KILL_THRESHOLD_LEGACY) -
146 iwl_temp_calib_to_offset(priv->shrd); 146 iwl_temp_calib_to_offset(priv->shrd);
147 147
148 hw_params(priv).ct_kill_threshold = threshold * volt2temp_coef; 148 priv->hw_params.ct_kill_threshold = threshold * volt2temp_coef;
149} 149}
150 150
151static void iwl5000_set_ct_threshold(struct iwl_priv *priv) 151static void iwl5000_set_ct_threshold(struct iwl_priv *priv)
152{ 152{
153 /* want Celsius */ 153 /* want Celsius */
154 hw_params(priv).ct_kill_threshold = CT_KILL_THRESHOLD_LEGACY; 154 priv->hw_params.ct_kill_threshold = CT_KILL_THRESHOLD_LEGACY;
155} 155}
156 156
157static void iwl5000_hw_set_hw_params(struct iwl_priv *priv) 157static void iwl5000_hw_set_hw_params(struct iwl_priv *priv)
158{ 158{
159 hw_params(priv).ht40_channel = BIT(IEEE80211_BAND_2GHZ) | 159 priv->hw_params.ht40_channel = BIT(IEEE80211_BAND_2GHZ) |
160 BIT(IEEE80211_BAND_5GHZ); 160 BIT(IEEE80211_BAND_5GHZ);
161 161
162 hw_params(priv).tx_chains_num = 162 priv->hw_params.tx_chains_num =
163 num_of_ant(hw_params(priv).valid_tx_ant); 163 num_of_ant(priv->hw_params.valid_tx_ant);
164 hw_params(priv).rx_chains_num = 164 priv->hw_params.rx_chains_num =
165 num_of_ant(hw_params(priv).valid_rx_ant); 165 num_of_ant(priv->hw_params.valid_rx_ant);
166 166
167 iwl5000_set_ct_threshold(priv); 167 iwl5000_set_ct_threshold(priv);
168 168
169 /* Set initial sensitivity parameters */ 169 /* Set initial sensitivity parameters */
170 hw_params(priv).sens = &iwl5000_sensitivity; 170 priv->hw_params.sens = &iwl5000_sensitivity;
171} 171}
172 172
173static void iwl5150_hw_set_hw_params(struct iwl_priv *priv) 173static void iwl5150_hw_set_hw_params(struct iwl_priv *priv)
174{ 174{
175 hw_params(priv).ht40_channel = BIT(IEEE80211_BAND_2GHZ) | 175 priv->hw_params.ht40_channel = BIT(IEEE80211_BAND_2GHZ) |
176 BIT(IEEE80211_BAND_5GHZ); 176 BIT(IEEE80211_BAND_5GHZ);
177 177
178 hw_params(priv).tx_chains_num = 178 priv->hw_params.tx_chains_num =
179 num_of_ant(hw_params(priv).valid_tx_ant); 179 num_of_ant(priv->hw_params.valid_tx_ant);
180 hw_params(priv).rx_chains_num = 180 priv->hw_params.rx_chains_num =
181 num_of_ant(hw_params(priv).valid_rx_ant); 181 num_of_ant(priv->hw_params.valid_rx_ant);
182 182
183 iwl5150_set_ct_threshold(priv); 183 iwl5150_set_ct_threshold(priv);
184 184
185 /* Set initial sensitivity parameters */ 185 /* Set initial sensitivity parameters */
186 hw_params(priv).sens = &iwl5150_sensitivity; 186 priv->hw_params.sens = &iwl5150_sensitivity;
187} 187}
188 188
189static void iwl5150_temperature(struct iwl_priv *priv) 189static void iwl5150_temperature(struct iwl_priv *priv)
diff --git a/drivers/net/wireless/iwlwifi/iwl-6000.c b/drivers/net/wireless/iwlwifi/iwl-6000.c
index 7075570a0f2c..dc07560f6920 100644
--- a/drivers/net/wireless/iwlwifi/iwl-6000.c
+++ b/drivers/net/wireless/iwlwifi/iwl-6000.c
@@ -74,8 +74,8 @@
74static void iwl6000_set_ct_threshold(struct iwl_priv *priv) 74static void iwl6000_set_ct_threshold(struct iwl_priv *priv)
75{ 75{
76 /* want Celsius */ 76 /* want Celsius */
77 hw_params(priv).ct_kill_threshold = CT_KILL_THRESHOLD; 77 priv->hw_params.ct_kill_threshold = CT_KILL_THRESHOLD;
78 hw_params(priv).ct_kill_exit_threshold = CT_KILL_EXIT_THRESHOLD; 78 priv->hw_params.ct_kill_exit_threshold = CT_KILL_EXIT_THRESHOLD;
79} 79}
80 80
81static void iwl6050_additional_nic_config(struct iwl_priv *priv) 81static void iwl6050_additional_nic_config(struct iwl_priv *priv)
@@ -139,21 +139,21 @@ static const struct iwl_sensitivity_ranges iwl6000_sensitivity = {
139 139
140static void iwl6000_hw_set_hw_params(struct iwl_priv *priv) 140static void iwl6000_hw_set_hw_params(struct iwl_priv *priv)
141{ 141{
142 hw_params(priv).ht40_channel = BIT(IEEE80211_BAND_2GHZ) | 142 priv->hw_params.ht40_channel = BIT(IEEE80211_BAND_2GHZ) |
143 BIT(IEEE80211_BAND_5GHZ); 143 BIT(IEEE80211_BAND_5GHZ);
144 144
145 hw_params(priv).tx_chains_num = 145 priv->hw_params.tx_chains_num =
146 num_of_ant(hw_params(priv).valid_tx_ant); 146 num_of_ant(priv->hw_params.valid_tx_ant);
147 if (cfg(priv)->rx_with_siso_diversity) 147 if (cfg(priv)->rx_with_siso_diversity)
148 hw_params(priv).rx_chains_num = 1; 148 priv->hw_params.rx_chains_num = 1;
149 else 149 else
150 hw_params(priv).rx_chains_num = 150 priv->hw_params.rx_chains_num =
151 num_of_ant(hw_params(priv).valid_rx_ant); 151 num_of_ant(priv->hw_params.valid_rx_ant);
152 152
153 iwl6000_set_ct_threshold(priv); 153 iwl6000_set_ct_threshold(priv);
154 154
155 /* Set initial sensitivity parameters */ 155 /* Set initial sensitivity parameters */
156 hw_params(priv).sens = &iwl6000_sensitivity; 156 priv->hw_params.sens = &iwl6000_sensitivity;
157 157
158} 158}
159 159
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-calib.c b/drivers/net/wireless/iwlwifi/iwl-agn-calib.c
index 84cbe7bb504c..2f7310987553 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-calib.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-calib.c
@@ -190,7 +190,7 @@ static int iwl_sens_energy_cck(struct iwl_priv *priv,
190 u32 max_false_alarms = MAX_FA_CCK * rx_enable_time; 190 u32 max_false_alarms = MAX_FA_CCK * rx_enable_time;
191 u32 min_false_alarms = MIN_FA_CCK * rx_enable_time; 191 u32 min_false_alarms = MIN_FA_CCK * rx_enable_time;
192 struct iwl_sensitivity_data *data = NULL; 192 struct iwl_sensitivity_data *data = NULL;
193 const struct iwl_sensitivity_ranges *ranges = hw_params(priv).sens; 193 const struct iwl_sensitivity_ranges *ranges = priv->hw_params.sens;
194 194
195 data = &(priv->sensitivity_data); 195 data = &(priv->sensitivity_data);
196 196
@@ -373,7 +373,7 @@ static int iwl_sens_auto_corr_ofdm(struct iwl_priv *priv,
373 u32 max_false_alarms = MAX_FA_OFDM * rx_enable_time; 373 u32 max_false_alarms = MAX_FA_OFDM * rx_enable_time;
374 u32 min_false_alarms = MIN_FA_OFDM * rx_enable_time; 374 u32 min_false_alarms = MIN_FA_OFDM * rx_enable_time;
375 struct iwl_sensitivity_data *data = NULL; 375 struct iwl_sensitivity_data *data = NULL;
376 const struct iwl_sensitivity_ranges *ranges = hw_params(priv).sens; 376 const struct iwl_sensitivity_ranges *ranges = priv->hw_params.sens;
377 377
378 data = &(priv->sensitivity_data); 378 data = &(priv->sensitivity_data);
379 379
@@ -597,7 +597,7 @@ void iwl_init_sensitivity(struct iwl_priv *priv)
597 int ret = 0; 597 int ret = 0;
598 int i; 598 int i;
599 struct iwl_sensitivity_data *data = NULL; 599 struct iwl_sensitivity_data *data = NULL;
600 const struct iwl_sensitivity_ranges *ranges = hw_params(priv).sens; 600 const struct iwl_sensitivity_ranges *ranges = priv->hw_params.sens;
601 601
602 if (priv->disable_sens_cal) 602 if (priv->disable_sens_cal)
603 return; 603 return;
@@ -833,28 +833,28 @@ static void iwl_find_disconn_antenna(struct iwl_priv *priv, u32* average_sig,
833 * To be safe, simply mask out any chains that we know 833 * To be safe, simply mask out any chains that we know
834 * are not on the device. 834 * are not on the device.
835 */ 835 */
836 active_chains &= hw_params(priv).valid_rx_ant; 836 active_chains &= priv->hw_params.valid_rx_ant;
837 837
838 num_tx_chains = 0; 838 num_tx_chains = 0;
839 for (i = 0; i < NUM_RX_CHAINS; i++) { 839 for (i = 0; i < NUM_RX_CHAINS; i++) {
840 /* loops on all the bits of 840 /* loops on all the bits of
841 * priv->hw_setting.valid_tx_ant */ 841 * priv->hw_setting.valid_tx_ant */
842 u8 ant_msk = (1 << i); 842 u8 ant_msk = (1 << i);
843 if (!(hw_params(priv).valid_tx_ant & ant_msk)) 843 if (!(priv->hw_params.valid_tx_ant & ant_msk))
844 continue; 844 continue;
845 845
846 num_tx_chains++; 846 num_tx_chains++;
847 if (data->disconn_array[i] == 0) 847 if (data->disconn_array[i] == 0)
848 /* there is a Tx antenna connected */ 848 /* there is a Tx antenna connected */
849 break; 849 break;
850 if (num_tx_chains == hw_params(priv).tx_chains_num && 850 if (num_tx_chains == priv->hw_params.tx_chains_num &&
851 data->disconn_array[i]) { 851 data->disconn_array[i]) {
852 /* 852 /*
853 * If all chains are disconnected 853 * If all chains are disconnected
854 * connect the first valid tx chain 854 * connect the first valid tx chain
855 */ 855 */
856 first_chain = 856 first_chain =
857 find_first_chain(hw_params(priv).valid_tx_ant); 857 find_first_chain(priv->hw_params.valid_tx_ant);
858 data->disconn_array[first_chain] = 0; 858 data->disconn_array[first_chain] = 0;
859 active_chains |= BIT(first_chain); 859 active_chains |= BIT(first_chain);
860 IWL_DEBUG_CALIB(priv, 860 IWL_DEBUG_CALIB(priv,
@@ -864,13 +864,13 @@ static void iwl_find_disconn_antenna(struct iwl_priv *priv, u32* average_sig,
864 } 864 }
865 } 865 }
866 866
867 if (active_chains != hw_params(priv).valid_rx_ant && 867 if (active_chains != priv->hw_params.valid_rx_ant &&
868 active_chains != priv->chain_noise_data.active_chains) 868 active_chains != priv->chain_noise_data.active_chains)
869 IWL_DEBUG_CALIB(priv, 869 IWL_DEBUG_CALIB(priv,
870 "Detected that not all antennas are connected! " 870 "Detected that not all antennas are connected! "
871 "Connected: %#x, valid: %#x.\n", 871 "Connected: %#x, valid: %#x.\n",
872 active_chains, 872 active_chains,
873 hw_params(priv).valid_rx_ant); 873 priv->hw_params.valid_rx_ant);
874 874
875 /* Save for use within RXON, TX, SCAN commands, etc. */ 875 /* Save for use within RXON, TX, SCAN commands, etc. */
876 data->active_chains = active_chains; 876 data->active_chains = active_chains;
@@ -1055,7 +1055,7 @@ void iwl_chain_noise_calibration(struct iwl_priv *priv)
1055 cfg(priv)->bt_params->advanced_bt_coexist) { 1055 cfg(priv)->bt_params->advanced_bt_coexist) {
1056 /* Disable disconnected antenna algorithm for advanced 1056 /* Disable disconnected antenna algorithm for advanced
1057 bt coex, assuming valid antennas are connected */ 1057 bt coex, assuming valid antennas are connected */
1058 data->active_chains = hw_params(priv).valid_rx_ant; 1058 data->active_chains = priv->hw_params.valid_rx_ant;
1059 for (i = 0; i < NUM_RX_CHAINS; i++) 1059 for (i = 0; i < NUM_RX_CHAINS; i++)
1060 if (!(data->active_chains & (1<<i))) 1060 if (!(data->active_chains & (1<<i)))
1061 data->disconn_array[i] = 1; 1061 data->disconn_array[i] = 1;
@@ -1085,7 +1085,7 @@ void iwl_chain_noise_calibration(struct iwl_priv *priv)
1085 min_average_noise, min_average_noise_antenna_i); 1085 min_average_noise, min_average_noise_antenna_i);
1086 1086
1087 iwlagn_gain_computation(priv, average_noise, 1087 iwlagn_gain_computation(priv, average_noise,
1088 find_first_chain(hw_params(priv).valid_rx_ant)); 1088 find_first_chain(priv->hw_params.valid_rx_ant));
1089 1089
1090 /* Some power changes may have been made during the calibration. 1090 /* Some power changes may have been made during the calibration.
1091 * Update and commit the RXON 1091 * Update and commit the RXON
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
index 4da4ab23cce7..da67f908bab2 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
@@ -234,7 +234,7 @@ int iwlagn_txfifo_flush(struct iwl_priv *priv, u16 flush_control)
234 IWL_PAN_SCD_BK_MSK | IWL_PAN_SCD_MGMT_MSK | 234 IWL_PAN_SCD_BK_MSK | IWL_PAN_SCD_MGMT_MSK |
235 IWL_PAN_SCD_MULTICAST_MSK; 235 IWL_PAN_SCD_MULTICAST_MSK;
236 236
237 if (hw_params(priv).sku & EEPROM_SKU_CAP_11N_ENABLE) 237 if (priv->hw_params.sku & EEPROM_SKU_CAP_11N_ENABLE)
238 flush_cmd.fifo_control |= IWL_AGG_TX_QUEUE_MSK; 238 flush_cmd.fifo_control |= IWL_AGG_TX_QUEUE_MSK;
239 239
240 IWL_DEBUG_INFO(priv, "fifo queue control: 0X%x\n", 240 IWL_DEBUG_INFO(priv, "fifo queue control: 0X%x\n",
@@ -868,7 +868,7 @@ void iwlagn_set_rxon_chain(struct iwl_priv *priv, struct iwl_rxon_context *ctx)
868 if (priv->chain_noise_data.active_chains) 868 if (priv->chain_noise_data.active_chains)
869 active_chains = priv->chain_noise_data.active_chains; 869 active_chains = priv->chain_noise_data.active_chains;
870 else 870 else
871 active_chains = hw_params(priv).valid_rx_ant; 871 active_chains = priv->hw_params.valid_rx_ant;
872 872
873 if (cfg(priv)->bt_params && 873 if (cfg(priv)->bt_params &&
874 cfg(priv)->bt_params->advanced_bt_coexist && 874 cfg(priv)->bt_params->advanced_bt_coexist &&
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
index b936ae7e00a3..08419e833c4d 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
@@ -819,7 +819,7 @@ static u32 rs_get_lower_rate(struct iwl_lq_sta *lq_sta,
819 819
820 if (num_of_ant(tbl->ant_type) > 1) 820 if (num_of_ant(tbl->ant_type) > 1)
821 tbl->ant_type = 821 tbl->ant_type =
822 first_antenna(hw_params(priv).valid_tx_ant); 822 first_antenna(priv->hw_params.valid_tx_ant);
823 823
824 tbl->is_ht40 = 0; 824 tbl->is_ht40 = 0;
825 tbl->is_SGI = 0; 825 tbl->is_SGI = 0;
@@ -1291,7 +1291,7 @@ static int rs_switch_to_mimo2(struct iwl_priv *priv,
1291 return -1; 1291 return -1;
1292 1292
1293 /* Need both Tx chains/antennas to support MIMO */ 1293 /* Need both Tx chains/antennas to support MIMO */
1294 if (hw_params(priv).tx_chains_num < 2) 1294 if (priv->hw_params.tx_chains_num < 2)
1295 return -1; 1295 return -1;
1296 1296
1297 IWL_DEBUG_RATE(priv, "LQ: try to switch to MIMO2\n"); 1297 IWL_DEBUG_RATE(priv, "LQ: try to switch to MIMO2\n");
@@ -1347,7 +1347,7 @@ static int rs_switch_to_mimo3(struct iwl_priv *priv,
1347 return -1; 1347 return -1;
1348 1348
1349 /* Need both Tx chains/antennas to support MIMO */ 1349 /* Need both Tx chains/antennas to support MIMO */
1350 if (hw_params(priv).tx_chains_num < 3) 1350 if (priv->hw_params.tx_chains_num < 3)
1351 return -1; 1351 return -1;
1352 1352
1353 IWL_DEBUG_RATE(priv, "LQ: try to switch to MIMO3\n"); 1353 IWL_DEBUG_RATE(priv, "LQ: try to switch to MIMO3\n");
@@ -1446,8 +1446,8 @@ static int rs_move_legacy_other(struct iwl_priv *priv,
1446 u32 sz = (sizeof(struct iwl_scale_tbl_info) - 1446 u32 sz = (sizeof(struct iwl_scale_tbl_info) -
1447 (sizeof(struct iwl_rate_scale_data) * IWL_RATE_COUNT)); 1447 (sizeof(struct iwl_rate_scale_data) * IWL_RATE_COUNT));
1448 u8 start_action; 1448 u8 start_action;
1449 u8 valid_tx_ant = hw_params(priv).valid_tx_ant; 1449 u8 valid_tx_ant = priv->hw_params.valid_tx_ant;
1450 u8 tx_chains_num = hw_params(priv).tx_chains_num; 1450 u8 tx_chains_num = priv->hw_params.tx_chains_num;
1451 int ret = 0; 1451 int ret = 0;
1452 u8 update_search_tbl_counter = 0; 1452 u8 update_search_tbl_counter = 0;
1453 1453
@@ -1464,7 +1464,7 @@ static int rs_move_legacy_other(struct iwl_priv *priv,
1464 case IWL_BT_COEX_TRAFFIC_LOAD_CONTINUOUS: 1464 case IWL_BT_COEX_TRAFFIC_LOAD_CONTINUOUS:
1465 /* avoid antenna B and MIMO */ 1465 /* avoid antenna B and MIMO */
1466 valid_tx_ant = 1466 valid_tx_ant =
1467 first_antenna(hw_params(priv).valid_tx_ant); 1467 first_antenna(priv->hw_params.valid_tx_ant);
1468 if (tbl->action >= IWL_LEGACY_SWITCH_ANTENNA2 && 1468 if (tbl->action >= IWL_LEGACY_SWITCH_ANTENNA2 &&
1469 tbl->action != IWL_LEGACY_SWITCH_SISO) 1469 tbl->action != IWL_LEGACY_SWITCH_SISO)
1470 tbl->action = IWL_LEGACY_SWITCH_SISO; 1470 tbl->action = IWL_LEGACY_SWITCH_SISO;
@@ -1488,7 +1488,7 @@ static int rs_move_legacy_other(struct iwl_priv *priv,
1488 else if (tbl->action >= IWL_LEGACY_SWITCH_ANTENNA2) 1488 else if (tbl->action >= IWL_LEGACY_SWITCH_ANTENNA2)
1489 tbl->action = IWL_LEGACY_SWITCH_SISO; 1489 tbl->action = IWL_LEGACY_SWITCH_SISO;
1490 valid_tx_ant = 1490 valid_tx_ant =
1491 first_antenna(hw_params(priv).valid_tx_ant); 1491 first_antenna(priv->hw_params.valid_tx_ant);
1492 } 1492 }
1493 1493
1494 start_action = tbl->action; 1494 start_action = tbl->action;
@@ -1622,8 +1622,8 @@ static int rs_move_siso_to_other(struct iwl_priv *priv,
1622 u32 sz = (sizeof(struct iwl_scale_tbl_info) - 1622 u32 sz = (sizeof(struct iwl_scale_tbl_info) -
1623 (sizeof(struct iwl_rate_scale_data) * IWL_RATE_COUNT)); 1623 (sizeof(struct iwl_rate_scale_data) * IWL_RATE_COUNT));
1624 u8 start_action; 1624 u8 start_action;
1625 u8 valid_tx_ant = hw_params(priv).valid_tx_ant; 1625 u8 valid_tx_ant = priv->hw_params.valid_tx_ant;
1626 u8 tx_chains_num = hw_params(priv).tx_chains_num; 1626 u8 tx_chains_num = priv->hw_params.tx_chains_num;
1627 u8 update_search_tbl_counter = 0; 1627 u8 update_search_tbl_counter = 0;
1628 int ret; 1628 int ret;
1629 1629
@@ -1640,7 +1640,7 @@ static int rs_move_siso_to_other(struct iwl_priv *priv,
1640 case IWL_BT_COEX_TRAFFIC_LOAD_CONTINUOUS: 1640 case IWL_BT_COEX_TRAFFIC_LOAD_CONTINUOUS:
1641 /* avoid antenna B and MIMO */ 1641 /* avoid antenna B and MIMO */
1642 valid_tx_ant = 1642 valid_tx_ant =
1643 first_antenna(hw_params(priv).valid_tx_ant); 1643 first_antenna(priv->hw_params.valid_tx_ant);
1644 if (tbl->action != IWL_SISO_SWITCH_ANTENNA1) 1644 if (tbl->action != IWL_SISO_SWITCH_ANTENNA1)
1645 tbl->action = IWL_SISO_SWITCH_ANTENNA1; 1645 tbl->action = IWL_SISO_SWITCH_ANTENNA1;
1646 break; 1646 break;
@@ -1658,7 +1658,7 @@ static int rs_move_siso_to_other(struct iwl_priv *priv,
1658 /* configure as 1x1 if bt full concurrency */ 1658 /* configure as 1x1 if bt full concurrency */
1659 if (priv->bt_full_concurrent) { 1659 if (priv->bt_full_concurrent) {
1660 valid_tx_ant = 1660 valid_tx_ant =
1661 first_antenna(hw_params(priv).valid_tx_ant); 1661 first_antenna(priv->hw_params.valid_tx_ant);
1662 if (tbl->action >= IWL_LEGACY_SWITCH_ANTENNA2) 1662 if (tbl->action >= IWL_LEGACY_SWITCH_ANTENNA2)
1663 tbl->action = IWL_SISO_SWITCH_ANTENNA1; 1663 tbl->action = IWL_SISO_SWITCH_ANTENNA1;
1664 } 1664 }
@@ -1794,8 +1794,8 @@ static int rs_move_mimo2_to_other(struct iwl_priv *priv,
1794 u32 sz = (sizeof(struct iwl_scale_tbl_info) - 1794 u32 sz = (sizeof(struct iwl_scale_tbl_info) -
1795 (sizeof(struct iwl_rate_scale_data) * IWL_RATE_COUNT)); 1795 (sizeof(struct iwl_rate_scale_data) * IWL_RATE_COUNT));
1796 u8 start_action; 1796 u8 start_action;
1797 u8 valid_tx_ant = hw_params(priv).valid_tx_ant; 1797 u8 valid_tx_ant = priv->hw_params.valid_tx_ant;
1798 u8 tx_chains_num = hw_params(priv).tx_chains_num; 1798 u8 tx_chains_num = priv->hw_params.tx_chains_num;
1799 u8 update_search_tbl_counter = 0; 1799 u8 update_search_tbl_counter = 0;
1800 int ret; 1800 int ret;
1801 1801
@@ -1964,8 +1964,8 @@ static int rs_move_mimo3_to_other(struct iwl_priv *priv,
1964 u32 sz = (sizeof(struct iwl_scale_tbl_info) - 1964 u32 sz = (sizeof(struct iwl_scale_tbl_info) -
1965 (sizeof(struct iwl_rate_scale_data) * IWL_RATE_COUNT)); 1965 (sizeof(struct iwl_rate_scale_data) * IWL_RATE_COUNT));
1966 u8 start_action; 1966 u8 start_action;
1967 u8 valid_tx_ant = hw_params(priv).valid_tx_ant; 1967 u8 valid_tx_ant = priv->hw_params.valid_tx_ant;
1968 u8 tx_chains_num = hw_params(priv).tx_chains_num; 1968 u8 tx_chains_num = priv->hw_params.tx_chains_num;
1969 int ret; 1969 int ret;
1970 u8 update_search_tbl_counter = 0; 1970 u8 update_search_tbl_counter = 0;
1971 1971
@@ -2698,7 +2698,7 @@ static void rs_initialize_lq(struct iwl_priv *priv,
2698 2698
2699 i = lq_sta->last_txrate_idx; 2699 i = lq_sta->last_txrate_idx;
2700 2700
2701 valid_tx_ant = hw_params(priv).valid_tx_ant; 2701 valid_tx_ant = priv->hw_params.valid_tx_ant;
2702 2702
2703 if (!lq_sta->search_better_tbl) 2703 if (!lq_sta->search_better_tbl)
2704 active_tbl = lq_sta->active_tbl; 2704 active_tbl = lq_sta->active_tbl;
@@ -2884,15 +2884,15 @@ void iwl_rs_rate_init(struct iwl_priv *priv, struct ieee80211_sta *sta, u8 sta_i
2884 2884
2885 /* These values will be overridden later */ 2885 /* These values will be overridden later */
2886 lq_sta->lq.general_params.single_stream_ant_msk = 2886 lq_sta->lq.general_params.single_stream_ant_msk =
2887 first_antenna(hw_params(priv).valid_tx_ant); 2887 first_antenna(priv->hw_params.valid_tx_ant);
2888 lq_sta->lq.general_params.dual_stream_ant_msk = 2888 lq_sta->lq.general_params.dual_stream_ant_msk =
2889 hw_params(priv).valid_tx_ant & 2889 priv->hw_params.valid_tx_ant &
2890 ~first_antenna(hw_params(priv).valid_tx_ant); 2890 ~first_antenna(priv->hw_params.valid_tx_ant);
2891 if (!lq_sta->lq.general_params.dual_stream_ant_msk) { 2891 if (!lq_sta->lq.general_params.dual_stream_ant_msk) {
2892 lq_sta->lq.general_params.dual_stream_ant_msk = ANT_AB; 2892 lq_sta->lq.general_params.dual_stream_ant_msk = ANT_AB;
2893 } else if (num_of_ant(hw_params(priv).valid_tx_ant) == 2) { 2893 } else if (num_of_ant(priv->hw_params.valid_tx_ant) == 2) {
2894 lq_sta->lq.general_params.dual_stream_ant_msk = 2894 lq_sta->lq.general_params.dual_stream_ant_msk =
2895 hw_params(priv).valid_tx_ant; 2895 priv->hw_params.valid_tx_ant;
2896 } 2896 }
2897 2897
2898 /* as default allow aggregation for all tids */ 2898 /* as default allow aggregation for all tids */
@@ -2938,7 +2938,7 @@ static void rs_fill_link_cmd(struct iwl_priv *priv,
2938 if (priv && priv->bt_full_concurrent) { 2938 if (priv && priv->bt_full_concurrent) {
2939 /* 1x1 only */ 2939 /* 1x1 only */
2940 tbl_type.ant_type = 2940 tbl_type.ant_type =
2941 first_antenna(hw_params(priv).valid_tx_ant); 2941 first_antenna(priv->hw_params.valid_tx_ant);
2942 } 2942 }
2943 2943
2944 /* How many times should we repeat the initial rate? */ 2944 /* How many times should we repeat the initial rate? */
@@ -2970,7 +2970,7 @@ static void rs_fill_link_cmd(struct iwl_priv *priv,
2970 if (priv->bt_full_concurrent) 2970 if (priv->bt_full_concurrent)
2971 valid_tx_ant = ANT_A; 2971 valid_tx_ant = ANT_A;
2972 else 2972 else
2973 valid_tx_ant = hw_params(priv).valid_tx_ant; 2973 valid_tx_ant = priv->hw_params.valid_tx_ant;
2974 } 2974 }
2975 2975
2976 /* Fill rest of rate table */ 2976 /* Fill rest of rate table */
@@ -3004,7 +3004,7 @@ static void rs_fill_link_cmd(struct iwl_priv *priv,
3004 if (priv && priv->bt_full_concurrent) { 3004 if (priv && priv->bt_full_concurrent) {
3005 /* 1x1 only */ 3005 /* 1x1 only */
3006 tbl_type.ant_type = 3006 tbl_type.ant_type =
3007 first_antenna(hw_params(priv).valid_tx_ant); 3007 first_antenna(priv->hw_params.valid_tx_ant);
3008 } 3008 }
3009 3009
3010 /* Indicate to uCode which entries might be MIMO. 3010 /* Indicate to uCode which entries might be MIMO.
@@ -3091,7 +3091,7 @@ static void rs_dbgfs_set_mcs(struct iwl_lq_sta *lq_sta,
3091 u8 ant_sel_tx; 3091 u8 ant_sel_tx;
3092 3092
3093 priv = lq_sta->drv; 3093 priv = lq_sta->drv;
3094 valid_tx_ant = hw_params(priv).valid_tx_ant; 3094 valid_tx_ant = priv->hw_params.valid_tx_ant;
3095 if (lq_sta->dbg_fixed_rate) { 3095 if (lq_sta->dbg_fixed_rate) {
3096 ant_sel_tx = 3096 ant_sel_tx =
3097 ((lq_sta->dbg_fixed_rate & RATE_MCS_ANT_ABC_MSK) 3097 ((lq_sta->dbg_fixed_rate & RATE_MCS_ANT_ABC_MSK)
@@ -3162,9 +3162,9 @@ static ssize_t rs_sta_dbgfs_scale_table_read(struct file *file,
3162 desc += sprintf(buff+desc, "fixed rate 0x%X\n", 3162 desc += sprintf(buff+desc, "fixed rate 0x%X\n",
3163 lq_sta->dbg_fixed_rate); 3163 lq_sta->dbg_fixed_rate);
3164 desc += sprintf(buff+desc, "valid_tx_ant %s%s%s\n", 3164 desc += sprintf(buff+desc, "valid_tx_ant %s%s%s\n",
3165 (hw_params(priv).valid_tx_ant & ANT_A) ? "ANT_A," : "", 3165 (priv->hw_params.valid_tx_ant & ANT_A) ? "ANT_A," : "",
3166 (hw_params(priv).valid_tx_ant & ANT_B) ? "ANT_B," : "", 3166 (priv->hw_params.valid_tx_ant & ANT_B) ? "ANT_B," : "",
3167 (hw_params(priv).valid_tx_ant & ANT_C) ? "ANT_C" : ""); 3167 (priv->hw_params.valid_tx_ant & ANT_C) ? "ANT_C" : "");
3168 desc += sprintf(buff+desc, "lq type %s\n", 3168 desc += sprintf(buff+desc, "lq type %s\n",
3169 (is_legacy(tbl->lq_type)) ? "legacy" : "HT"); 3169 (is_legacy(tbl->lq_type)) ? "legacy" : "HT");
3170 if (is_Ht(tbl->lq_type)) { 3170 if (is_Ht(tbl->lq_type)) {
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c b/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c
index 79d857d81b41..369cd8b2ad0d 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c
@@ -692,7 +692,7 @@ int iwlagn_commit_rxon(struct iwl_priv *priv, struct iwl_rxon_context *ctx)
692 * force CTS-to-self frames protection if RTS-CTS is not preferred 692 * force CTS-to-self frames protection if RTS-CTS is not preferred
693 * one aggregation protection method 693 * one aggregation protection method
694 */ 694 */
695 if (!hw_params(priv).use_rts_for_aggregation) 695 if (!priv->hw_params.use_rts_for_aggregation)
696 ctx->staging.flags |= RXON_FLG_SELF_CTS_EN; 696 ctx->staging.flags |= RXON_FLG_SELF_CTS_EN;
697 697
698 if ((ctx->vif && ctx->vif->bss_conf.use_short_slot) || 698 if ((ctx->vif && ctx->vif->bss_conf.use_short_slot) ||
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-sta.c b/drivers/net/wireless/iwlwifi/iwl-agn-sta.c
index c4175603864b..b74bb6854b61 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-sta.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-sta.c
@@ -864,23 +864,23 @@ void iwl_sta_fill_lq(struct iwl_priv *priv, struct iwl_rxon_context *ctx,
864 if (r >= IWL_FIRST_CCK_RATE && r <= IWL_LAST_CCK_RATE) 864 if (r >= IWL_FIRST_CCK_RATE && r <= IWL_LAST_CCK_RATE)
865 rate_flags |= RATE_MCS_CCK_MSK; 865 rate_flags |= RATE_MCS_CCK_MSK;
866 866
867 rate_flags |= first_antenna(hw_params(priv).valid_tx_ant) << 867 rate_flags |= first_antenna(priv->hw_params.valid_tx_ant) <<
868 RATE_MCS_ANT_POS; 868 RATE_MCS_ANT_POS;
869 rate_n_flags = iwl_hw_set_rate_n_flags(iwl_rates[r].plcp, rate_flags); 869 rate_n_flags = iwl_hw_set_rate_n_flags(iwl_rates[r].plcp, rate_flags);
870 for (i = 0; i < LINK_QUAL_MAX_RETRY_NUM; i++) 870 for (i = 0; i < LINK_QUAL_MAX_RETRY_NUM; i++)
871 link_cmd->rs_table[i].rate_n_flags = rate_n_flags; 871 link_cmd->rs_table[i].rate_n_flags = rate_n_flags;
872 872
873 link_cmd->general_params.single_stream_ant_msk = 873 link_cmd->general_params.single_stream_ant_msk =
874 first_antenna(hw_params(priv).valid_tx_ant); 874 first_antenna(priv->hw_params.valid_tx_ant);
875 875
876 link_cmd->general_params.dual_stream_ant_msk = 876 link_cmd->general_params.dual_stream_ant_msk =
877 hw_params(priv).valid_tx_ant & 877 priv->hw_params.valid_tx_ant &
878 ~first_antenna(hw_params(priv).valid_tx_ant); 878 ~first_antenna(priv->hw_params.valid_tx_ant);
879 if (!link_cmd->general_params.dual_stream_ant_msk) { 879 if (!link_cmd->general_params.dual_stream_ant_msk) {
880 link_cmd->general_params.dual_stream_ant_msk = ANT_AB; 880 link_cmd->general_params.dual_stream_ant_msk = ANT_AB;
881 } else if (num_of_ant(hw_params(priv).valid_tx_ant) == 2) { 881 } else if (num_of_ant(priv->hw_params.valid_tx_ant) == 2) {
882 link_cmd->general_params.dual_stream_ant_msk = 882 link_cmd->general_params.dual_stream_ant_msk =
883 hw_params(priv).valid_tx_ant; 883 priv->hw_params.valid_tx_ant;
884 } 884 }
885 885
886 link_cmd->agg_params.agg_dis_start_th = 886 link_cmd->agg_params.agg_dis_start_th =
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-tx.c b/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
index 697f2032bfd6..ad21b5ddf59d 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
@@ -208,10 +208,10 @@ static void iwlagn_tx_cmd_build_rate(struct iwl_priv *priv,
208 priv->bt_full_concurrent) { 208 priv->bt_full_concurrent) {
209 /* operated as 1x1 in full concurrency mode */ 209 /* operated as 1x1 in full concurrency mode */
210 priv->mgmt_tx_ant = iwl_toggle_tx_ant(priv, priv->mgmt_tx_ant, 210 priv->mgmt_tx_ant = iwl_toggle_tx_ant(priv, priv->mgmt_tx_ant,
211 first_antenna(hw_params(priv).valid_tx_ant)); 211 first_antenna(priv->hw_params.valid_tx_ant));
212 } else 212 } else
213 priv->mgmt_tx_ant = iwl_toggle_tx_ant(priv, priv->mgmt_tx_ant, 213 priv->mgmt_tx_ant = iwl_toggle_tx_ant(priv, priv->mgmt_tx_ant,
214 hw_params(priv).valid_tx_ant); 214 priv->hw_params.valid_tx_ant);
215 rate_flags |= iwl_ant_idx_to_flags(priv->mgmt_tx_ant); 215 rate_flags |= iwl_ant_idx_to_flags(priv->mgmt_tx_ant);
216 216
217 /* Set the rate in the TX cmd */ 217 /* Set the rate in the TX cmd */
@@ -689,7 +689,7 @@ int iwlagn_tx_agg_oper(struct iwl_priv *priv, struct ieee80211_vif *vif,
689 sta_priv->max_agg_bufsize = 689 sta_priv->max_agg_bufsize =
690 min(sta_priv->max_agg_bufsize, buf_size); 690 min(sta_priv->max_agg_bufsize, buf_size);
691 691
692 if (hw_params(priv).use_rts_for_aggregation) { 692 if (priv->hw_params.use_rts_for_aggregation) {
693 /* 693 /*
694 * switch to RTS/CTS if it is the prefer protection 694 * switch to RTS/CTS if it is the prefer protection
695 * method for HT traffic 695 * method for HT traffic
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index 514719957919..9e320c1e79f8 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -180,7 +180,7 @@ int iwlagn_send_beacon_cmd(struct iwl_priv *priv)
180 rate = info->control.rates[0].idx; 180 rate = info->control.rates[0].idx;
181 181
182 priv->mgmt_tx_ant = iwl_toggle_tx_ant(priv, priv->mgmt_tx_ant, 182 priv->mgmt_tx_ant = iwl_toggle_tx_ant(priv, priv->mgmt_tx_ant,
183 hw_params(priv).valid_tx_ant); 183 priv->hw_params.valid_tx_ant);
184 rate_flags = iwl_ant_idx_to_flags(priv->mgmt_tx_ant); 184 rate_flags = iwl_ant_idx_to_flags(priv->mgmt_tx_ant);
185 185
186 /* In mac80211, rates for 5 GHz start at 0 */ 186 /* In mac80211, rates for 5 GHz start at 0 */
@@ -658,9 +658,9 @@ static void iwl_rf_kill_ct_config(struct iwl_priv *priv)
658 658
659 if (cfg(priv)->base_params->support_ct_kill_exit) { 659 if (cfg(priv)->base_params->support_ct_kill_exit) {
660 adv_cmd.critical_temperature_enter = 660 adv_cmd.critical_temperature_enter =
661 cpu_to_le32(hw_params(priv).ct_kill_threshold); 661 cpu_to_le32(priv->hw_params.ct_kill_threshold);
662 adv_cmd.critical_temperature_exit = 662 adv_cmd.critical_temperature_exit =
663 cpu_to_le32(hw_params(priv).ct_kill_exit_threshold); 663 cpu_to_le32(priv->hw_params.ct_kill_exit_threshold);
664 664
665 ret = iwl_dvm_send_cmd_pdu(priv, 665 ret = iwl_dvm_send_cmd_pdu(priv,
666 REPLY_CT_KILL_CONFIG_CMD, 666 REPLY_CT_KILL_CONFIG_CMD,
@@ -671,11 +671,11 @@ static void iwl_rf_kill_ct_config(struct iwl_priv *priv)
671 IWL_DEBUG_INFO(priv, "REPLY_CT_KILL_CONFIG_CMD " 671 IWL_DEBUG_INFO(priv, "REPLY_CT_KILL_CONFIG_CMD "
672 "succeeded, critical temperature enter is %d," 672 "succeeded, critical temperature enter is %d,"
673 "exit is %d\n", 673 "exit is %d\n",
674 hw_params(priv).ct_kill_threshold, 674 priv->hw_params.ct_kill_threshold,
675 hw_params(priv).ct_kill_exit_threshold); 675 priv->hw_params.ct_kill_exit_threshold);
676 } else { 676 } else {
677 cmd.critical_temperature_R = 677 cmd.critical_temperature_R =
678 cpu_to_le32(hw_params(priv).ct_kill_threshold); 678 cpu_to_le32(priv->hw_params.ct_kill_threshold);
679 679
680 ret = iwl_dvm_send_cmd_pdu(priv, 680 ret = iwl_dvm_send_cmd_pdu(priv,
681 REPLY_CT_KILL_CONFIG_CMD, 681 REPLY_CT_KILL_CONFIG_CMD,
@@ -686,7 +686,7 @@ static void iwl_rf_kill_ct_config(struct iwl_priv *priv)
686 IWL_DEBUG_INFO(priv, "REPLY_CT_KILL_CONFIG_CMD " 686 IWL_DEBUG_INFO(priv, "REPLY_CT_KILL_CONFIG_CMD "
687 "succeeded, " 687 "succeeded, "
688 "critical temperature is %d\n", 688 "critical temperature is %d\n",
689 hw_params(priv).ct_kill_threshold); 689 priv->hw_params.ct_kill_threshold);
690 } 690 }
691} 691}
692 692
@@ -793,7 +793,7 @@ int iwl_alive_start(struct iwl_priv *priv)
793 priv->active_rate = IWL_RATES_MASK; 793 priv->active_rate = IWL_RATES_MASK;
794 794
795 /* Configure Tx antenna selection based on H/W config */ 795 /* Configure Tx antenna selection based on H/W config */
796 iwlagn_send_tx_ant_config(priv, hw_params(priv).valid_tx_ant); 796 iwlagn_send_tx_ant_config(priv, priv->hw_params.valid_tx_ant);
797 797
798 if (iwl_is_associated_ctx(ctx) && !priv->wowlan) { 798 if (iwl_is_associated_ctx(ctx) && !priv->wowlan) {
799 struct iwl_rxon_cmd *active_rxon = 799 struct iwl_rxon_cmd *active_rxon =
@@ -1132,8 +1132,8 @@ static void iwl_init_ht_hw_capab(const struct iwl_priv *priv,
1132 enum ieee80211_band band) 1132 enum ieee80211_band band)
1133{ 1133{
1134 u16 max_bit_rate = 0; 1134 u16 max_bit_rate = 0;
1135 u8 rx_chains_num = hw_params(priv).rx_chains_num; 1135 u8 rx_chains_num = priv->hw_params.rx_chains_num;
1136 u8 tx_chains_num = hw_params(priv).tx_chains_num; 1136 u8 tx_chains_num = priv->hw_params.tx_chains_num;
1137 1137
1138 ht_info->cap = 0; 1138 ht_info->cap = 0;
1139 memset(&ht_info->mcs, 0, sizeof(ht_info->mcs)); 1139 memset(&ht_info->mcs, 0, sizeof(ht_info->mcs));
@@ -1145,7 +1145,7 @@ static void iwl_init_ht_hw_capab(const struct iwl_priv *priv,
1145 ht_info->cap |= IEEE80211_HT_CAP_GRN_FLD; 1145 ht_info->cap |= IEEE80211_HT_CAP_GRN_FLD;
1146 ht_info->cap |= IEEE80211_HT_CAP_SGI_20; 1146 ht_info->cap |= IEEE80211_HT_CAP_SGI_20;
1147 max_bit_rate = MAX_BIT_RATE_20_MHZ; 1147 max_bit_rate = MAX_BIT_RATE_20_MHZ;
1148 if (hw_params(priv).ht40_channel & BIT(band)) { 1148 if (priv->hw_params.ht40_channel & BIT(band)) {
1149 ht_info->cap |= IEEE80211_HT_CAP_SUP_WIDTH_20_40; 1149 ht_info->cap |= IEEE80211_HT_CAP_SUP_WIDTH_20_40;
1150 ht_info->cap |= IEEE80211_HT_CAP_SGI_40; 1150 ht_info->cap |= IEEE80211_HT_CAP_SGI_40;
1151 ht_info->mcs.rx_mask[4] = 0x01; 1151 ht_info->mcs.rx_mask[4] = 0x01;
@@ -1217,7 +1217,7 @@ static int iwl_init_geos(struct iwl_priv *priv)
1217 sband->bitrates = &rates[IWL_FIRST_OFDM_RATE]; 1217 sband->bitrates = &rates[IWL_FIRST_OFDM_RATE];
1218 sband->n_bitrates = IWL_RATE_COUNT_LEGACY - IWL_FIRST_OFDM_RATE; 1218 sband->n_bitrates = IWL_RATE_COUNT_LEGACY - IWL_FIRST_OFDM_RATE;
1219 1219
1220 if (hw_params(priv).sku & EEPROM_SKU_CAP_11N_ENABLE) 1220 if (priv->hw_params.sku & EEPROM_SKU_CAP_11N_ENABLE)
1221 iwl_init_ht_hw_capab(priv, &sband->ht_cap, 1221 iwl_init_ht_hw_capab(priv, &sband->ht_cap,
1222 IEEE80211_BAND_5GHZ); 1222 IEEE80211_BAND_5GHZ);
1223 1223
@@ -1227,7 +1227,7 @@ static int iwl_init_geos(struct iwl_priv *priv)
1227 sband->bitrates = rates; 1227 sband->bitrates = rates;
1228 sband->n_bitrates = IWL_RATE_COUNT_LEGACY; 1228 sband->n_bitrates = IWL_RATE_COUNT_LEGACY;
1229 1229
1230 if (hw_params(priv).sku & EEPROM_SKU_CAP_11N_ENABLE) 1230 if (priv->hw_params.sku & EEPROM_SKU_CAP_11N_ENABLE)
1231 iwl_init_ht_hw_capab(priv, &sband->ht_cap, 1231 iwl_init_ht_hw_capab(priv, &sband->ht_cap,
1232 IEEE80211_BAND_2GHZ); 1232 IEEE80211_BAND_2GHZ);
1233 1233
@@ -1282,11 +1282,11 @@ static int iwl_init_geos(struct iwl_priv *priv)
1282 priv->tx_power_next = max_tx_power; 1282 priv->tx_power_next = max_tx_power;
1283 1283
1284 if ((priv->bands[IEEE80211_BAND_5GHZ].n_channels == 0) && 1284 if ((priv->bands[IEEE80211_BAND_5GHZ].n_channels == 0) &&
1285 hw_params(priv).sku & EEPROM_SKU_CAP_BAND_52GHZ) { 1285 priv->hw_params.sku & EEPROM_SKU_CAP_BAND_52GHZ) {
1286 IWL_INFO(priv, "Incorrectly detected BG card as ABG. " 1286 IWL_INFO(priv, "Incorrectly detected BG card as ABG. "
1287 "Please send your %s to maintainer.\n", 1287 "Please send your %s to maintainer.\n",
1288 trans(priv)->hw_id_str); 1288 trans(priv)->hw_id_str);
1289 hw_params(priv).sku &= ~EEPROM_SKU_CAP_BAND_52GHZ; 1289 priv->hw_params.sku &= ~EEPROM_SKU_CAP_BAND_52GHZ;
1290 } 1290 }
1291 1291
1292 IWL_INFO(priv, "Tunable channels: %d 802.11bg, %d 802.11a channels\n", 1292 IWL_INFO(priv, "Tunable channels: %d 802.11bg, %d 802.11a channels\n",
@@ -1393,11 +1393,11 @@ static void iwl_uninit_drv(struct iwl_priv *priv)
1393static void iwl_set_hw_params(struct iwl_priv *priv) 1393static void iwl_set_hw_params(struct iwl_priv *priv)
1394{ 1394{
1395 if (cfg(priv)->ht_params) 1395 if (cfg(priv)->ht_params)
1396 hw_params(priv).use_rts_for_aggregation = 1396 priv->hw_params.use_rts_for_aggregation =
1397 cfg(priv)->ht_params->use_rts_for_aggregation; 1397 cfg(priv)->ht_params->use_rts_for_aggregation;
1398 1398
1399 if (iwlagn_mod_params.disable_11n & IWL_DISABLE_HT_ALL) 1399 if (iwlagn_mod_params.disable_11n & IWL_DISABLE_HT_ALL)
1400 hw_params(priv).sku &= ~EEPROM_SKU_CAP_11N_ENABLE; 1400 priv->hw_params.sku &= ~EEPROM_SKU_CAP_11N_ENABLE;
1401 1401
1402 /* Device-specific setup */ 1402 /* Device-specific setup */
1403 cfg(priv)->lib->set_hw_params(priv); 1403 cfg(priv)->lib->set_hw_params(priv);
@@ -1591,7 +1591,7 @@ static struct iwl_op_mode *iwl_op_mode_dvm_start(struct iwl_trans *trans,
1591 ************************/ 1591 ************************/
1592 iwl_set_hw_params(priv); 1592 iwl_set_hw_params(priv);
1593 1593
1594 if (!(hw_params(priv).sku & EEPROM_SKU_CAP_IPAN_ENABLE)) { 1594 if (!(priv->hw_params.sku & EEPROM_SKU_CAP_IPAN_ENABLE)) {
1595 IWL_DEBUG_INFO(priv, "Your EEPROM disabled PAN"); 1595 IWL_DEBUG_INFO(priv, "Your EEPROM disabled PAN");
1596 ucode_flags &= ~IWL_UCODE_TLV_FLAGS_PAN; 1596 ucode_flags &= ~IWL_UCODE_TLV_FLAGS_PAN;
1597 /* 1597 /*
diff --git a/drivers/net/wireless/iwlwifi/iwl-debugfs.c b/drivers/net/wireless/iwlwifi/iwl-debugfs.c
index c674009b799c..eaf5e66e603c 100644
--- a/drivers/net/wireless/iwlwifi/iwl-debugfs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-debugfs.c
@@ -1541,17 +1541,17 @@ static ssize_t iwl_dbgfs_ucode_tx_stats_read(struct file *file,
1541 if (tx->tx_power.ant_a || tx->tx_power.ant_b || tx->tx_power.ant_c) { 1541 if (tx->tx_power.ant_a || tx->tx_power.ant_b || tx->tx_power.ant_c) {
1542 pos += scnprintf(buf + pos, bufsz - pos, 1542 pos += scnprintf(buf + pos, bufsz - pos,
1543 "tx power: (1/2 dB step)\n"); 1543 "tx power: (1/2 dB step)\n");
1544 if ((hw_params(priv).valid_tx_ant & ANT_A) && 1544 if ((priv->hw_params.valid_tx_ant & ANT_A) &&
1545 tx->tx_power.ant_a) 1545 tx->tx_power.ant_a)
1546 pos += scnprintf(buf + pos, bufsz - pos, 1546 pos += scnprintf(buf + pos, bufsz - pos,
1547 fmt_hex, "antenna A:", 1547 fmt_hex, "antenna A:",
1548 tx->tx_power.ant_a); 1548 tx->tx_power.ant_a);
1549 if ((hw_params(priv).valid_tx_ant & ANT_B) && 1549 if ((priv->hw_params.valid_tx_ant & ANT_B) &&
1550 tx->tx_power.ant_b) 1550 tx->tx_power.ant_b)
1551 pos += scnprintf(buf + pos, bufsz - pos, 1551 pos += scnprintf(buf + pos, bufsz - pos,
1552 fmt_hex, "antenna B:", 1552 fmt_hex, "antenna B:",
1553 tx->tx_power.ant_b); 1553 tx->tx_power.ant_b);
1554 if ((hw_params(priv).valid_tx_ant & ANT_C) && 1554 if ((priv->hw_params.valid_tx_ant & ANT_C) &&
1555 tx->tx_power.ant_c) 1555 tx->tx_power.ant_c)
1556 pos += scnprintf(buf + pos, bufsz - pos, 1556 pos += scnprintf(buf + pos, bufsz - pos,
1557 fmt_hex, "antenna C:", 1557 fmt_hex, "antenna C:",
@@ -2405,7 +2405,7 @@ static ssize_t iwl_dbgfs_protection_mode_read(struct file *file,
2405 if (cfg(priv)->ht_params) 2405 if (cfg(priv)->ht_params)
2406 pos += scnprintf(buf + pos, bufsz - pos, 2406 pos += scnprintf(buf + pos, bufsz - pos,
2407 "use %s for aggregation\n", 2407 "use %s for aggregation\n",
2408 (hw_params(priv).use_rts_for_aggregation) ? 2408 (priv->hw_params.use_rts_for_aggregation) ?
2409 "rts/cts" : "cts-to-self"); 2409 "rts/cts" : "cts-to-self");
2410 else 2410 else
2411 pos += scnprintf(buf + pos, bufsz - pos, "N/A"); 2411 pos += scnprintf(buf + pos, bufsz - pos, "N/A");
@@ -2432,9 +2432,9 @@ static ssize_t iwl_dbgfs_protection_mode_write(struct file *file,
2432 if (sscanf(buf, "%d", &rts) != 1) 2432 if (sscanf(buf, "%d", &rts) != 1)
2433 return -EINVAL; 2433 return -EINVAL;
2434 if (rts) 2434 if (rts)
2435 hw_params(priv).use_rts_for_aggregation = true; 2435 priv->hw_params.use_rts_for_aggregation = true;
2436 else 2436 else
2437 hw_params(priv).use_rts_for_aggregation = false; 2437 priv->hw_params.use_rts_for_aggregation = false;
2438 return count; 2438 return count;
2439} 2439}
2440 2440
diff --git a/drivers/net/wireless/iwlwifi/iwl-dev.h b/drivers/net/wireless/iwlwifi/iwl-dev.h
index 780bcf3f6ff1..caaf14c3de1b 100644
--- a/drivers/net/wireless/iwlwifi/iwl-dev.h
+++ b/drivers/net/wireless/iwlwifi/iwl-dev.h
@@ -681,6 +681,37 @@ enum iwl_scan_type {
681 IWL_SCAN_ROC, 681 IWL_SCAN_ROC,
682}; 682};
683 683
684/**
685 * struct iwl_hw_params
686 *
687 * Holds the module parameters
688 *
689 * @tx_chains_num: Number of TX chains
690 * @rx_chains_num: Number of RX chains
691 * @valid_tx_ant: usable antennas for TX
692 * @valid_rx_ant: usable antennas for RX
693 * @ht40_channel: is 40MHz width possible: BIT(IEEE80211_BAND_XXX)
694 * @sku: sku read from EEPROM
695 * @ct_kill_threshold: temperature threshold - in hw dependent unit
696 * @ct_kill_exit_threshold: when to reeable the device - in hw dependent unit
697 * relevant for 1000, 6000 and up
698 * @struct iwl_sensitivity_ranges: range of sensitivity values
699 * @use_rts_for_aggregation: use rts/cts protection for HT traffic
700 */
701struct iwl_hw_params {
702 u8 tx_chains_num;
703 u8 rx_chains_num;
704 u8 valid_tx_ant;
705 u8 valid_rx_ant;
706 u8 ht40_channel;
707 bool use_rts_for_aggregation;
708 u16 sku;
709 u32 ct_kill_threshold;
710 u32 ct_kill_exit_threshold;
711
712 const struct iwl_sensitivity_ranges *sens;
713};
714
684#ifdef CONFIG_IWLWIFI_DEVICE_TESTMODE 715#ifdef CONFIG_IWLWIFI_DEVICE_TESTMODE
685struct iwl_testmode_trace { 716struct iwl_testmode_trace {
686 u32 buff_size; 717 u32 buff_size;
@@ -739,6 +770,8 @@ struct iwl_priv {
739 770
740 struct workqueue_struct *workqueue; 771 struct workqueue_struct *workqueue;
741 772
773 struct iwl_hw_params hw_params;
774
742 enum ieee80211_band band; 775 enum ieee80211_band band;
743 u8 valid_contexts; 776 u8 valid_contexts;
744 777
diff --git a/drivers/net/wireless/iwlwifi/iwl-eeprom.c b/drivers/net/wireless/iwlwifi/iwl-eeprom.c
index 23cea42b9495..12744b053bc5 100644
--- a/drivers/net/wireless/iwlwifi/iwl-eeprom.c
+++ b/drivers/net/wireless/iwlwifi/iwl-eeprom.c
@@ -258,40 +258,40 @@ int iwl_eeprom_init_hw_params(struct iwl_priv *priv)
258 struct iwl_shared *shrd = priv->shrd; 258 struct iwl_shared *shrd = priv->shrd;
259 u16 radio_cfg; 259 u16 radio_cfg;
260 260
261 hw_params(priv).sku = iwl_eeprom_query16(shrd, EEPROM_SKU_CAP); 261 priv->hw_params.sku = iwl_eeprom_query16(shrd, EEPROM_SKU_CAP);
262 if (hw_params(priv).sku & EEPROM_SKU_CAP_11N_ENABLE && 262 if (priv->hw_params.sku & EEPROM_SKU_CAP_11N_ENABLE &&
263 !cfg(priv)->ht_params) { 263 !cfg(priv)->ht_params) {
264 IWL_ERR(priv, "Invalid 11n configuration\n"); 264 IWL_ERR(priv, "Invalid 11n configuration\n");
265 return -EINVAL; 265 return -EINVAL;
266 } 266 }
267 267
268 if (!hw_params(priv).sku) { 268 if (!priv->hw_params.sku) {
269 IWL_ERR(priv, "Invalid device sku\n"); 269 IWL_ERR(priv, "Invalid device sku\n");
270 return -EINVAL; 270 return -EINVAL;
271 } 271 }
272 272
273 IWL_INFO(priv, "Device SKU: 0x%X\n", hw_params(priv).sku); 273 IWL_INFO(priv, "Device SKU: 0x%X\n", priv->hw_params.sku);
274 274
275 radio_cfg = iwl_eeprom_query16(shrd, EEPROM_RADIO_CONFIG); 275 radio_cfg = iwl_eeprom_query16(shrd, EEPROM_RADIO_CONFIG);
276 276
277 hw_params(priv).valid_tx_ant = EEPROM_RF_CFG_TX_ANT_MSK(radio_cfg); 277 priv->hw_params.valid_tx_ant = EEPROM_RF_CFG_TX_ANT_MSK(radio_cfg);
278 hw_params(priv).valid_rx_ant = EEPROM_RF_CFG_RX_ANT_MSK(radio_cfg); 278 priv->hw_params.valid_rx_ant = EEPROM_RF_CFG_RX_ANT_MSK(radio_cfg);
279 279
280 /* check overrides (some devices have wrong EEPROM) */ 280 /* check overrides (some devices have wrong EEPROM) */
281 if (cfg(priv)->valid_tx_ant) 281 if (cfg(priv)->valid_tx_ant)
282 hw_params(priv).valid_tx_ant = cfg(priv)->valid_tx_ant; 282 priv->hw_params.valid_tx_ant = cfg(priv)->valid_tx_ant;
283 if (cfg(priv)->valid_rx_ant) 283 if (cfg(priv)->valid_rx_ant)
284 hw_params(priv).valid_rx_ant = cfg(priv)->valid_rx_ant; 284 priv->hw_params.valid_rx_ant = cfg(priv)->valid_rx_ant;
285 285
286 if (!hw_params(priv).valid_tx_ant || !hw_params(priv).valid_rx_ant) { 286 if (!priv->hw_params.valid_tx_ant || !priv->hw_params.valid_rx_ant) {
287 IWL_ERR(priv, "Invalid chain (0x%X, 0x%X)\n", 287 IWL_ERR(priv, "Invalid chain (0x%X, 0x%X)\n",
288 hw_params(priv).valid_tx_ant, 288 priv->hw_params.valid_tx_ant,
289 hw_params(priv).valid_rx_ant); 289 priv->hw_params.valid_rx_ant);
290 return -EINVAL; 290 return -EINVAL;
291 } 291 }
292 292
293 IWL_INFO(priv, "Valid Tx ant: 0x%X, Valid Rx ant: 0x%X\n", 293 IWL_INFO(priv, "Valid Tx ant: 0x%X, Valid Rx ant: 0x%X\n",
294 hw_params(priv).valid_tx_ant, hw_params(priv).valid_rx_ant); 294 priv->hw_params.valid_tx_ant, priv->hw_params.valid_rx_ant);
295 295
296 return 0; 296 return 0;
297} 297}
diff --git a/drivers/net/wireless/iwlwifi/iwl-mac80211.c b/drivers/net/wireless/iwlwifi/iwl-mac80211.c
index f1c675a2a6f3..75cb4cc1e994 100644
--- a/drivers/net/wireless/iwlwifi/iwl-mac80211.c
+++ b/drivers/net/wireless/iwlwifi/iwl-mac80211.c
@@ -160,7 +160,7 @@ int iwlagn_mac_setup_register(struct iwl_priv *priv,
160 IEEE80211_HW_SUPPORTS_DYNAMIC_PS | 160 IEEE80211_HW_SUPPORTS_DYNAMIC_PS |
161 IEEE80211_HW_SCAN_WHILE_IDLE; 161 IEEE80211_HW_SCAN_WHILE_IDLE;
162 162
163 if (hw_params(priv).sku & EEPROM_SKU_CAP_11N_ENABLE) 163 if (priv->hw_params.sku & EEPROM_SKU_CAP_11N_ENABLE)
164 hw->flags |= IEEE80211_HW_SUPPORTS_DYNAMIC_SMPS | 164 hw->flags |= IEEE80211_HW_SUPPORTS_DYNAMIC_SMPS |
165 IEEE80211_HW_SUPPORTS_STATIC_SMPS; 165 IEEE80211_HW_SUPPORTS_STATIC_SMPS;
166 166
@@ -637,7 +637,7 @@ static int iwlagn_mac_ampdu_action(struct ieee80211_hw *hw,
637 IWL_DEBUG_HT(priv, "A-MPDU action on addr %pM tid %d\n", 637 IWL_DEBUG_HT(priv, "A-MPDU action on addr %pM tid %d\n",
638 sta->addr, tid); 638 sta->addr, tid);
639 639
640 if (!(hw_params(priv).sku & EEPROM_SKU_CAP_11N_ENABLE)) 640 if (!(priv->hw_params.sku & EEPROM_SKU_CAP_11N_ENABLE))
641 return -EACCES; 641 return -EACCES;
642 642
643 IWL_DEBUG_MAC80211(priv, "enter\n"); 643 IWL_DEBUG_MAC80211(priv, "enter\n");
@@ -671,7 +671,7 @@ static int iwlagn_mac_ampdu_action(struct ieee80211_hw *hw,
671 priv->agg_tids_count); 671 priv->agg_tids_count);
672 } 672 }
673 if (!priv->agg_tids_count && 673 if (!priv->agg_tids_count &&
674 hw_params(priv).use_rts_for_aggregation) { 674 priv->hw_params.use_rts_for_aggregation) {
675 /* 675 /*
676 * switch off RTS/CTS if it was previously enabled 676 * switch off RTS/CTS if it was previously enabled
677 */ 677 */
diff --git a/drivers/net/wireless/iwlwifi/iwl-scan.c b/drivers/net/wireless/iwlwifi/iwl-scan.c
index dcf5b12071b4..490a60d8ad7d 100644
--- a/drivers/net/wireless/iwlwifi/iwl-scan.c
+++ b/drivers/net/wireless/iwlwifi/iwl-scan.c
@@ -673,12 +673,12 @@ static int iwlagn_request_scan(struct iwl_priv *priv, struct ieee80211_vif *vif)
673 u16 rx_chain = 0; 673 u16 rx_chain = 0;
674 enum ieee80211_band band; 674 enum ieee80211_band band;
675 u8 n_probes = 0; 675 u8 n_probes = 0;
676 u8 rx_ant = hw_params(priv).valid_rx_ant; 676 u8 rx_ant = priv->hw_params.valid_rx_ant;
677 u8 rate; 677 u8 rate;
678 bool is_active = false; 678 bool is_active = false;
679 int chan_mod; 679 int chan_mod;
680 u8 active_chains; 680 u8 active_chains;
681 u8 scan_tx_antennas = hw_params(priv).valid_tx_ant; 681 u8 scan_tx_antennas = priv->hw_params.valid_tx_ant;
682 int ret; 682 int ret;
683 683
684 lockdep_assert_held(&priv->mutex); 684 lockdep_assert_held(&priv->mutex);
@@ -872,7 +872,7 @@ static int iwlagn_request_scan(struct iwl_priv *priv, struct ieee80211_vif *vif)
872 872
873 /* MIMO is not used here, but value is required */ 873 /* MIMO is not used here, but value is required */
874 rx_chain |= 874 rx_chain |=
875 hw_params(priv).valid_rx_ant << RXON_RX_CHAIN_VALID_POS; 875 priv->hw_params.valid_rx_ant << RXON_RX_CHAIN_VALID_POS;
876 rx_chain |= rx_ant << RXON_RX_CHAIN_FORCE_MIMO_SEL_POS; 876 rx_chain |= rx_ant << RXON_RX_CHAIN_FORCE_MIMO_SEL_POS;
877 rx_chain |= rx_ant << RXON_RX_CHAIN_FORCE_SEL_POS; 877 rx_chain |= rx_ant << RXON_RX_CHAIN_FORCE_SEL_POS;
878 rx_chain |= 0x1 << RXON_RX_CHAIN_DRIVER_FORCE_POS; 878 rx_chain |= 0x1 << RXON_RX_CHAIN_DRIVER_FORCE_POS;
@@ -985,7 +985,7 @@ static int iwlagn_request_scan(struct iwl_priv *priv, struct ieee80211_vif *vif)
985 985
986void iwl_init_scan_params(struct iwl_priv *priv) 986void iwl_init_scan_params(struct iwl_priv *priv)
987{ 987{
988 u8 ant_idx = fls(hw_params(priv).valid_tx_ant) - 1; 988 u8 ant_idx = fls(priv->hw_params.valid_tx_ant) - 1;
989 if (!priv->scan_tx_ant[IEEE80211_BAND_5GHZ]) 989 if (!priv->scan_tx_ant[IEEE80211_BAND_5GHZ])
990 priv->scan_tx_ant[IEEE80211_BAND_5GHZ] = ant_idx; 990 priv->scan_tx_ant[IEEE80211_BAND_5GHZ] = ant_idx;
991 if (!priv->scan_tx_ant[IEEE80211_BAND_2GHZ]) 991 if (!priv->scan_tx_ant[IEEE80211_BAND_2GHZ])
diff --git a/drivers/net/wireless/iwlwifi/iwl-shared.h b/drivers/net/wireless/iwlwifi/iwl-shared.h
index c6049cfb653d..c6de93096582 100644
--- a/drivers/net/wireless/iwlwifi/iwl-shared.h
+++ b/drivers/net/wireless/iwlwifi/iwl-shared.h
@@ -155,37 +155,6 @@ struct iwl_mod_params {
155 bool auto_agg; 155 bool auto_agg;
156}; 156};
157 157
158/**
159 * struct iwl_hw_params
160 *
161 * Holds the module parameters
162 *
163 * @tx_chains_num: Number of TX chains
164 * @rx_chains_num: Number of RX chains
165 * @valid_tx_ant: usable antennas for TX
166 * @valid_rx_ant: usable antennas for RX
167 * @ht40_channel: is 40MHz width possible: BIT(IEEE80211_BAND_XXX)
168 * @sku: sku read from EEPROM
169 * @ct_kill_threshold: temperature threshold - in hw dependent unit
170 * @ct_kill_exit_threshold: when to reeable the device - in hw dependent unit
171 * relevant for 1000, 6000 and up
172 * @struct iwl_sensitivity_ranges: range of sensitivity values
173 * @use_rts_for_aggregation: use rts/cts protection for HT traffic
174 */
175struct iwl_hw_params {
176 u8 tx_chains_num;
177 u8 rx_chains_num;
178 u8 valid_tx_ant;
179 u8 valid_rx_ant;
180 u8 ht40_channel;
181 bool use_rts_for_aggregation;
182 u16 sku;
183 u32 ct_kill_threshold;
184 u32 ct_kill_exit_threshold;
185
186 const struct iwl_sensitivity_ranges *sens;
187};
188
189/* 158/*
190 * LED mode 159 * LED mode
191 * IWL_LED_DEFAULT: use device default 160 * IWL_LED_DEFAULT: use device default
@@ -337,7 +306,6 @@ struct iwl_cfg {
337 * @priv: pointer to the upper layer data 306 * @priv: pointer to the upper layer data
338 * @trans: pointer to the transport layer data 307 * @trans: pointer to the transport layer data
339 * @nic: pointer to the nic data 308 * @nic: pointer to the nic data
340 * @hw_params: see struct iwl_hw_params
341 * @lock: protect general shared data 309 * @lock: protect general shared data
342 * @eeprom: pointer to the eeprom/OTP image 310 * @eeprom: pointer to the eeprom/OTP image
343 */ 311 */
@@ -347,7 +315,6 @@ struct iwl_shared {
347 const struct iwl_cfg *cfg; 315 const struct iwl_cfg *cfg;
348 struct iwl_trans *trans; 316 struct iwl_trans *trans;
349 void *drv; 317 void *drv;
350 struct iwl_hw_params hw_params;
351 318
352 /* eeprom -- this is in the card's little endian byte order */ 319 /* eeprom -- this is in the card's little endian byte order */
353 u8 *eeprom; 320 u8 *eeprom;
@@ -357,7 +324,6 @@ struct iwl_shared {
357/*Whatever _m is (iwl_trans, iwl_priv, these macros will work */ 324/*Whatever _m is (iwl_trans, iwl_priv, these macros will work */
358#define cfg(_m) ((_m)->shrd->cfg) 325#define cfg(_m) ((_m)->shrd->cfg)
359#define trans(_m) ((_m)->shrd->trans) 326#define trans(_m) ((_m)->shrd->trans)
360#define hw_params(_m) ((_m)->shrd->hw_params)
361 327
362static inline bool iwl_have_debug_level(u32 level) 328static inline bool iwl_have_debug_level(u32 level)
363{ 329{