aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi
diff options
context:
space:
mode:
authorDon Fry <donald.h.fry@intel.com>2011-12-16 10:07:36 -0500
committerWey-Yi Guy <wey-yi.w.guy@intel.com>2011-12-16 10:22:16 -0500
commit3862241945026a8fa165ab73c57739df77b8e1fb (patch)
tree2a093cfd34c285e2510bc91e02a9fa4793fd9b6f /drivers/net/wireless/iwlwifi
parent5bd5e9a6ae5137a61d0b5c277eac61892d89fc4f (diff)
iwlwifi: move iwl_cfg from iwl_priv to iwl_shared
Move the configuration pointer from the upper level iwl_priv to the lower level iwl_shared structure, with associated code fixes. Signed-off-by: Don Fry <donald.h.fry@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-1000.c14
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-2000.c16
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-5000.c24
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-6000.c20
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-calib.c12
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-lib.c22
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-rs.c8
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-rx.c10
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-rxon.c8
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-tt.c2
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-tx.c12
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn.c60
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-core.c33
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-core.h75
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-debugfs.c26
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-dev.h11
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-eeprom.c58
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-led.c8
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-led.h14
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-mac80211.c22
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-power.c8
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-scan.c16
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-shared.h100
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-testmode.c8
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-trans-pcie-rx.c2
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-ucode.c12
26 files changed, 301 insertions, 300 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-1000.c b/drivers/net/wireless/iwlwifi/iwl-1000.c
index 8d3bad7ea5d3..1ef7bfc2ab25 100644
--- a/drivers/net/wireless/iwlwifi/iwl-1000.c
+++ b/drivers/net/wireless/iwlwifi/iwl-1000.c
@@ -124,10 +124,10 @@ static int iwl1000_hw_set_hw_params(struct iwl_priv *priv)
124{ 124{
125 if (iwlagn_mod_params.num_of_queues >= IWL_MIN_NUM_QUEUES && 125 if (iwlagn_mod_params.num_of_queues >= IWL_MIN_NUM_QUEUES &&
126 iwlagn_mod_params.num_of_queues <= IWLAGN_NUM_QUEUES) 126 iwlagn_mod_params.num_of_queues <= IWLAGN_NUM_QUEUES)
127 priv->cfg->base_params->num_of_queues = 127 cfg(priv)->base_params->num_of_queues =
128 iwlagn_mod_params.num_of_queues; 128 iwlagn_mod_params.num_of_queues;
129 129
130 hw_params(priv).max_txq_num = priv->cfg->base_params->num_of_queues; 130 hw_params(priv).max_txq_num = cfg(priv)->base_params->num_of_queues;
131 priv->contexts[IWL_RXON_CTX_BSS].bcast_sta_id = IWLAGN_BROADCAST_ID; 131 priv->contexts[IWL_RXON_CTX_BSS].bcast_sta_id = IWLAGN_BROADCAST_ID;
132 132
133 hw_params(priv).max_data_size = IWLAGN_RTC_DATA_SIZE; 133 hw_params(priv).max_data_size = IWLAGN_RTC_DATA_SIZE;
@@ -135,14 +135,14 @@ static int iwl1000_hw_set_hw_params(struct iwl_priv *priv)
135 135
136 hw_params(priv).ht40_channel = BIT(IEEE80211_BAND_2GHZ); 136 hw_params(priv).ht40_channel = BIT(IEEE80211_BAND_2GHZ);
137 137
138 hw_params(priv).tx_chains_num = num_of_ant(priv->cfg->valid_tx_ant); 138 hw_params(priv).tx_chains_num = num_of_ant(cfg(priv)->valid_tx_ant);
139 if (priv->cfg->rx_with_siso_diversity) 139 if (cfg(priv)->rx_with_siso_diversity)
140 hw_params(priv).rx_chains_num = 1; 140 hw_params(priv).rx_chains_num = 1;
141 else 141 else
142 hw_params(priv).rx_chains_num = 142 hw_params(priv).rx_chains_num =
143 num_of_ant(priv->cfg->valid_rx_ant); 143 num_of_ant(cfg(priv)->valid_rx_ant);
144 hw_params(priv).valid_tx_ant = priv->cfg->valid_tx_ant; 144 hw_params(priv).valid_tx_ant = cfg(priv)->valid_tx_ant;
145 hw_params(priv).valid_rx_ant = priv->cfg->valid_rx_ant; 145 hw_params(priv).valid_rx_ant = cfg(priv)->valid_rx_ant;
146 146
147 iwl1000_set_ct_threshold(priv); 147 iwl1000_set_ct_threshold(priv);
148 148
diff --git a/drivers/net/wireless/iwlwifi/iwl-2000.c b/drivers/net/wireless/iwlwifi/iwl-2000.c
index 0c4688d95b65..1d2cb4c637a4 100644
--- a/drivers/net/wireless/iwlwifi/iwl-2000.c
+++ b/drivers/net/wireless/iwlwifi/iwl-2000.c
@@ -86,7 +86,7 @@ static void iwl2000_nic_config(struct iwl_priv *priv)
86{ 86{
87 iwl_rf_config(priv); 87 iwl_rf_config(priv);
88 88
89 if (priv->cfg->iq_invert) 89 if (cfg(priv)->iq_invert)
90 iwl_set_bit(bus(priv), CSR_GP_DRIVER_REG, 90 iwl_set_bit(bus(priv), CSR_GP_DRIVER_REG,
91 CSR_GP_DRIVER_REG_BIT_RADIO_IQ_INVER); 91 CSR_GP_DRIVER_REG_BIT_RADIO_IQ_INVER);
92} 92}
@@ -120,10 +120,10 @@ static int iwl2000_hw_set_hw_params(struct iwl_priv *priv)
120{ 120{
121 if (iwlagn_mod_params.num_of_queues >= IWL_MIN_NUM_QUEUES && 121 if (iwlagn_mod_params.num_of_queues >= IWL_MIN_NUM_QUEUES &&
122 iwlagn_mod_params.num_of_queues <= IWLAGN_NUM_QUEUES) 122 iwlagn_mod_params.num_of_queues <= IWLAGN_NUM_QUEUES)
123 priv->cfg->base_params->num_of_queues = 123 cfg(priv)->base_params->num_of_queues =
124 iwlagn_mod_params.num_of_queues; 124 iwlagn_mod_params.num_of_queues;
125 125
126 hw_params(priv).max_txq_num = priv->cfg->base_params->num_of_queues; 126 hw_params(priv).max_txq_num = cfg(priv)->base_params->num_of_queues;
127 priv->contexts[IWL_RXON_CTX_BSS].bcast_sta_id = IWLAGN_BROADCAST_ID; 127 priv->contexts[IWL_RXON_CTX_BSS].bcast_sta_id = IWLAGN_BROADCAST_ID;
128 128
129 hw_params(priv).max_data_size = IWL60_RTC_DATA_SIZE; 129 hw_params(priv).max_data_size = IWL60_RTC_DATA_SIZE;
@@ -131,14 +131,14 @@ static int iwl2000_hw_set_hw_params(struct iwl_priv *priv)
131 131
132 hw_params(priv).ht40_channel = BIT(IEEE80211_BAND_2GHZ); 132 hw_params(priv).ht40_channel = BIT(IEEE80211_BAND_2GHZ);
133 133
134 hw_params(priv).tx_chains_num = num_of_ant(priv->cfg->valid_tx_ant); 134 hw_params(priv).tx_chains_num = num_of_ant(cfg(priv)->valid_tx_ant);
135 if (priv->cfg->rx_with_siso_diversity) 135 if (cfg(priv)->rx_with_siso_diversity)
136 hw_params(priv).rx_chains_num = 1; 136 hw_params(priv).rx_chains_num = 1;
137 else 137 else
138 hw_params(priv).rx_chains_num = 138 hw_params(priv).rx_chains_num =
139 num_of_ant(priv->cfg->valid_rx_ant); 139 num_of_ant(cfg(priv)->valid_rx_ant);
140 hw_params(priv).valid_tx_ant = priv->cfg->valid_tx_ant; 140 hw_params(priv).valid_tx_ant = cfg(priv)->valid_tx_ant;
141 hw_params(priv).valid_rx_ant = priv->cfg->valid_rx_ant; 141 hw_params(priv).valid_rx_ant = cfg(priv)->valid_rx_ant;
142 142
143 iwl2000_set_ct_threshold(priv); 143 iwl2000_set_ct_threshold(priv);
144 144
diff --git a/drivers/net/wireless/iwlwifi/iwl-5000.c b/drivers/net/wireless/iwlwifi/iwl-5000.c
index 6706d7c10bd8..b3a365fea7bb 100644
--- a/drivers/net/wireless/iwlwifi/iwl-5000.c
+++ b/drivers/net/wireless/iwlwifi/iwl-5000.c
@@ -166,10 +166,10 @@ static int iwl5000_hw_set_hw_params(struct iwl_priv *priv)
166{ 166{
167 if (iwlagn_mod_params.num_of_queues >= IWL_MIN_NUM_QUEUES && 167 if (iwlagn_mod_params.num_of_queues >= IWL_MIN_NUM_QUEUES &&
168 iwlagn_mod_params.num_of_queues <= IWLAGN_NUM_QUEUES) 168 iwlagn_mod_params.num_of_queues <= IWLAGN_NUM_QUEUES)
169 priv->cfg->base_params->num_of_queues = 169 cfg(priv)->base_params->num_of_queues =
170 iwlagn_mod_params.num_of_queues; 170 iwlagn_mod_params.num_of_queues;
171 171
172 hw_params(priv).max_txq_num = priv->cfg->base_params->num_of_queues; 172 hw_params(priv).max_txq_num = cfg(priv)->base_params->num_of_queues;
173 priv->contexts[IWL_RXON_CTX_BSS].bcast_sta_id = IWLAGN_BROADCAST_ID; 173 priv->contexts[IWL_RXON_CTX_BSS].bcast_sta_id = IWLAGN_BROADCAST_ID;
174 174
175 hw_params(priv).max_data_size = IWLAGN_RTC_DATA_SIZE; 175 hw_params(priv).max_data_size = IWLAGN_RTC_DATA_SIZE;
@@ -178,10 +178,10 @@ static int iwl5000_hw_set_hw_params(struct iwl_priv *priv)
178 hw_params(priv).ht40_channel = BIT(IEEE80211_BAND_2GHZ) | 178 hw_params(priv).ht40_channel = BIT(IEEE80211_BAND_2GHZ) |
179 BIT(IEEE80211_BAND_5GHZ); 179 BIT(IEEE80211_BAND_5GHZ);
180 180
181 hw_params(priv).tx_chains_num = num_of_ant(priv->cfg->valid_tx_ant); 181 hw_params(priv).tx_chains_num = num_of_ant(cfg(priv)->valid_tx_ant);
182 hw_params(priv).rx_chains_num = num_of_ant(priv->cfg->valid_rx_ant); 182 hw_params(priv).rx_chains_num = num_of_ant(cfg(priv)->valid_rx_ant);
183 hw_params(priv).valid_tx_ant = priv->cfg->valid_tx_ant; 183 hw_params(priv).valid_tx_ant = cfg(priv)->valid_tx_ant;
184 hw_params(priv).valid_rx_ant = priv->cfg->valid_rx_ant; 184 hw_params(priv).valid_rx_ant = cfg(priv)->valid_rx_ant;
185 185
186 iwl5000_set_ct_threshold(priv); 186 iwl5000_set_ct_threshold(priv);
187 187
@@ -195,10 +195,10 @@ static int iwl5150_hw_set_hw_params(struct iwl_priv *priv)
195{ 195{
196 if (iwlagn_mod_params.num_of_queues >= IWL_MIN_NUM_QUEUES && 196 if (iwlagn_mod_params.num_of_queues >= IWL_MIN_NUM_QUEUES &&
197 iwlagn_mod_params.num_of_queues <= IWLAGN_NUM_QUEUES) 197 iwlagn_mod_params.num_of_queues <= IWLAGN_NUM_QUEUES)
198 priv->cfg->base_params->num_of_queues = 198 cfg(priv)->base_params->num_of_queues =
199 iwlagn_mod_params.num_of_queues; 199 iwlagn_mod_params.num_of_queues;
200 200
201 hw_params(priv).max_txq_num = priv->cfg->base_params->num_of_queues; 201 hw_params(priv).max_txq_num = cfg(priv)->base_params->num_of_queues;
202 priv->contexts[IWL_RXON_CTX_BSS].bcast_sta_id = IWLAGN_BROADCAST_ID; 202 priv->contexts[IWL_RXON_CTX_BSS].bcast_sta_id = IWLAGN_BROADCAST_ID;
203 203
204 hw_params(priv).max_data_size = IWLAGN_RTC_DATA_SIZE; 204 hw_params(priv).max_data_size = IWLAGN_RTC_DATA_SIZE;
@@ -207,10 +207,10 @@ static int iwl5150_hw_set_hw_params(struct iwl_priv *priv)
207 hw_params(priv).ht40_channel = BIT(IEEE80211_BAND_2GHZ) | 207 hw_params(priv).ht40_channel = BIT(IEEE80211_BAND_2GHZ) |
208 BIT(IEEE80211_BAND_5GHZ); 208 BIT(IEEE80211_BAND_5GHZ);
209 209
210 hw_params(priv).tx_chains_num = num_of_ant(priv->cfg->valid_tx_ant); 210 hw_params(priv).tx_chains_num = num_of_ant(cfg(priv)->valid_tx_ant);
211 hw_params(priv).rx_chains_num = num_of_ant(priv->cfg->valid_rx_ant); 211 hw_params(priv).rx_chains_num = num_of_ant(cfg(priv)->valid_rx_ant);
212 hw_params(priv).valid_tx_ant = priv->cfg->valid_tx_ant; 212 hw_params(priv).valid_tx_ant = cfg(priv)->valid_tx_ant;
213 hw_params(priv).valid_rx_ant = priv->cfg->valid_rx_ant; 213 hw_params(priv).valid_rx_ant = cfg(priv)->valid_rx_ant;
214 214
215 iwl5150_set_ct_threshold(priv); 215 iwl5150_set_ct_threshold(priv);
216 216
diff --git a/drivers/net/wireless/iwlwifi/iwl-6000.c b/drivers/net/wireless/iwlwifi/iwl-6000.c
index 3e277b6774f1..a3be1179636f 100644
--- a/drivers/net/wireless/iwlwifi/iwl-6000.c
+++ b/drivers/net/wireless/iwlwifi/iwl-6000.c
@@ -102,14 +102,14 @@ static void iwl6000_nic_config(struct iwl_priv *priv)
102 iwl_rf_config(priv); 102 iwl_rf_config(priv);
103 103
104 /* no locking required for register write */ 104 /* no locking required for register write */
105 if (priv->cfg->pa_type == IWL_PA_INTERNAL) { 105 if (cfg(priv)->pa_type == IWL_PA_INTERNAL) {
106 /* 2x2 IPA phy type */ 106 /* 2x2 IPA phy type */
107 iwl_write32(bus(priv), CSR_GP_DRIVER_REG, 107 iwl_write32(bus(priv), CSR_GP_DRIVER_REG,
108 CSR_GP_DRIVER_REG_BIT_RADIO_SKU_2x2_IPA); 108 CSR_GP_DRIVER_REG_BIT_RADIO_SKU_2x2_IPA);
109 } 109 }
110 /* do additional nic configuration if needed */ 110 /* do additional nic configuration if needed */
111 if (priv->cfg->additional_nic_config) 111 if (cfg(priv)->additional_nic_config)
112 priv->cfg->additional_nic_config(priv); 112 cfg(priv)->additional_nic_config(priv);
113} 113}
114 114
115static struct iwl_sensitivity_ranges iwl6000_sensitivity = { 115static struct iwl_sensitivity_ranges iwl6000_sensitivity = {
@@ -141,10 +141,10 @@ static int iwl6000_hw_set_hw_params(struct iwl_priv *priv)
141{ 141{
142 if (iwlagn_mod_params.num_of_queues >= IWL_MIN_NUM_QUEUES && 142 if (iwlagn_mod_params.num_of_queues >= IWL_MIN_NUM_QUEUES &&
143 iwlagn_mod_params.num_of_queues <= IWLAGN_NUM_QUEUES) 143 iwlagn_mod_params.num_of_queues <= IWLAGN_NUM_QUEUES)
144 priv->cfg->base_params->num_of_queues = 144 cfg(priv)->base_params->num_of_queues =
145 iwlagn_mod_params.num_of_queues; 145 iwlagn_mod_params.num_of_queues;
146 146
147 hw_params(priv).max_txq_num = priv->cfg->base_params->num_of_queues; 147 hw_params(priv).max_txq_num = cfg(priv)->base_params->num_of_queues;
148 priv->contexts[IWL_RXON_CTX_BSS].bcast_sta_id = IWLAGN_BROADCAST_ID; 148 priv->contexts[IWL_RXON_CTX_BSS].bcast_sta_id = IWLAGN_BROADCAST_ID;
149 149
150 hw_params(priv).max_data_size = IWL60_RTC_DATA_SIZE; 150 hw_params(priv).max_data_size = IWL60_RTC_DATA_SIZE;
@@ -153,14 +153,14 @@ static int iwl6000_hw_set_hw_params(struct iwl_priv *priv)
153 hw_params(priv).ht40_channel = BIT(IEEE80211_BAND_2GHZ) | 153 hw_params(priv).ht40_channel = BIT(IEEE80211_BAND_2GHZ) |
154 BIT(IEEE80211_BAND_5GHZ); 154 BIT(IEEE80211_BAND_5GHZ);
155 155
156 hw_params(priv).tx_chains_num = num_of_ant(priv->cfg->valid_tx_ant); 156 hw_params(priv).tx_chains_num = num_of_ant(cfg(priv)->valid_tx_ant);
157 if (priv->cfg->rx_with_siso_diversity) 157 if (cfg(priv)->rx_with_siso_diversity)
158 hw_params(priv).rx_chains_num = 1; 158 hw_params(priv).rx_chains_num = 1;
159 else 159 else
160 hw_params(priv).rx_chains_num = 160 hw_params(priv).rx_chains_num =
161 num_of_ant(priv->cfg->valid_rx_ant); 161 num_of_ant(cfg(priv)->valid_rx_ant);
162 hw_params(priv).valid_tx_ant = priv->cfg->valid_tx_ant; 162 hw_params(priv).valid_tx_ant = cfg(priv)->valid_tx_ant;
163 hw_params(priv).valid_rx_ant = priv->cfg->valid_rx_ant; 163 hw_params(priv).valid_rx_ant = cfg(priv)->valid_rx_ant;
164 164
165 iwl6000_set_ct_threshold(priv); 165 iwl6000_set_ct_threshold(priv);
166 166
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-calib.c b/drivers/net/wireless/iwlwifi/iwl-agn-calib.c
index 16971a020297..50ff849c9f67 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-calib.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-calib.c
@@ -513,7 +513,7 @@ static int iwl_enhance_sensitivity_write(struct iwl_priv *priv)
513 513
514 iwl_prepare_legacy_sensitivity_tbl(priv, data, &cmd.enhance_table[0]); 514 iwl_prepare_legacy_sensitivity_tbl(priv, data, &cmd.enhance_table[0]);
515 515
516 if (priv->cfg->base_params->hd_v2) { 516 if (cfg(priv)->base_params->hd_v2) {
517 cmd.enhance_table[HD_INA_NON_SQUARE_DET_OFDM_INDEX] = 517 cmd.enhance_table[HD_INA_NON_SQUARE_DET_OFDM_INDEX] =
518 HD_INA_NON_SQUARE_DET_OFDM_DATA_V2; 518 HD_INA_NON_SQUARE_DET_OFDM_DATA_V2;
519 cmd.enhance_table[HD_INA_NON_SQUARE_DET_CCK_INDEX] = 519 cmd.enhance_table[HD_INA_NON_SQUARE_DET_CCK_INDEX] =
@@ -847,7 +847,7 @@ static void iwl_find_disconn_antenna(struct iwl_priv *priv, u32* average_sig,
847 * connect the first valid tx chain 847 * connect the first valid tx chain
848 */ 848 */
849 first_chain = 849 first_chain =
850 find_first_chain(priv->cfg->valid_tx_ant); 850 find_first_chain(cfg(priv)->valid_tx_ant);
851 data->disconn_array[first_chain] = 0; 851 data->disconn_array[first_chain] = 0;
852 active_chains |= BIT(first_chain); 852 active_chains |= BIT(first_chain);
853 IWL_DEBUG_CALIB(priv, 853 IWL_DEBUG_CALIB(priv,
@@ -890,7 +890,7 @@ static void iwlagn_gain_computation(struct iwl_priv *priv,
890 continue; 890 continue;
891 } 891 }
892 892
893 delta_g = (priv->cfg->base_params->chain_noise_scale * 893 delta_g = (cfg(priv)->base_params->chain_noise_scale *
894 ((s32)average_noise[default_chain] - 894 ((s32)average_noise[default_chain] -
895 (s32)average_noise[i])) / 1500; 895 (s32)average_noise[i])) / 1500;
896 896
@@ -1047,8 +1047,8 @@ void iwl_chain_noise_calibration(struct iwl_priv *priv)
1047 return; 1047 return;
1048 1048
1049 /* Analyze signal for disconnected antenna */ 1049 /* Analyze signal for disconnected antenna */
1050 if (priv->cfg->bt_params && 1050 if (cfg(priv)->bt_params &&
1051 priv->cfg->bt_params->advanced_bt_coexist) { 1051 cfg(priv)->bt_params->advanced_bt_coexist) {
1052 /* Disable disconnected antenna algorithm for advanced 1052 /* Disable disconnected antenna algorithm for advanced
1053 bt coex, assuming valid antennas are connected */ 1053 bt coex, assuming valid antennas are connected */
1054 data->active_chains = hw_params(priv).valid_rx_ant; 1054 data->active_chains = hw_params(priv).valid_rx_ant;
@@ -1082,7 +1082,7 @@ void iwl_chain_noise_calibration(struct iwl_priv *priv)
1082 1082
1083 iwlagn_gain_computation(priv, average_noise, 1083 iwlagn_gain_computation(priv, average_noise,
1084 min_average_noise_antenna_i, min_average_noise, 1084 min_average_noise_antenna_i, min_average_noise,
1085 find_first_chain(priv->cfg->valid_rx_ant)); 1085 find_first_chain(cfg(priv)->valid_rx_ant));
1086 1086
1087 /* Some power changes may have been made during the calibration. 1087 /* Some power changes may have been made during the calibration.
1088 * Update and commit the RXON 1088 * 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 057f95233567..1c945fbfe756 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
@@ -150,7 +150,7 @@ static u32 eeprom_indirect_address(const struct iwl_shared *shrd, u32 address)
150const u8 *iwl_eeprom_query_addr(const struct iwl_shared *shrd, size_t offset) 150const u8 *iwl_eeprom_query_addr(const struct iwl_shared *shrd, size_t offset)
151{ 151{
152 u32 address = eeprom_indirect_address(shrd, offset); 152 u32 address = eeprom_indirect_address(shrd, offset);
153 BUG_ON(address >= shrd->priv->cfg->base_params->eeprom_size); 153 BUG_ON(address >= shrd->cfg->base_params->eeprom_size);
154 return &shrd->eeprom[address]; 154 return &shrd->eeprom[address];
155} 155}
156 156
@@ -232,7 +232,7 @@ int iwlagn_txfifo_flush(struct iwl_priv *priv, u16 flush_control)
232 IWL_PAN_SCD_BK_MSK | IWL_PAN_SCD_MGMT_MSK | 232 IWL_PAN_SCD_BK_MSK | IWL_PAN_SCD_MGMT_MSK |
233 IWL_PAN_SCD_MULTICAST_MSK; 233 IWL_PAN_SCD_MULTICAST_MSK;
234 234
235 if (priv->cfg->sku & EEPROM_SKU_CAP_11N_ENABLE) 235 if (cfg(priv)->sku & EEPROM_SKU_CAP_11N_ENABLE)
236 flush_cmd.fifo_control |= IWL_AGG_TX_QUEUE_MSK; 236 flush_cmd.fifo_control |= IWL_AGG_TX_QUEUE_MSK;
237 237
238 IWL_DEBUG_INFO(priv, "fifo queue control: 0X%x\n", 238 IWL_DEBUG_INFO(priv, "fifo queue control: 0X%x\n",
@@ -374,15 +374,15 @@ void iwlagn_send_advance_bt_config(struct iwl_priv *priv)
374 BUILD_BUG_ON(sizeof(iwlagn_def_3w_lookup) != 374 BUILD_BUG_ON(sizeof(iwlagn_def_3w_lookup) !=
375 sizeof(basic.bt3_lookup_table)); 375 sizeof(basic.bt3_lookup_table));
376 376
377 if (priv->cfg->bt_params) { 377 if (cfg(priv)->bt_params) {
378 if (priv->cfg->bt_params->bt_session_2) { 378 if (cfg(priv)->bt_params->bt_session_2) {
379 bt_cmd_2000.prio_boost = cpu_to_le32( 379 bt_cmd_2000.prio_boost = cpu_to_le32(
380 priv->cfg->bt_params->bt_prio_boost); 380 cfg(priv)->bt_params->bt_prio_boost);
381 bt_cmd_2000.tx_prio_boost = 0; 381 bt_cmd_2000.tx_prio_boost = 0;
382 bt_cmd_2000.rx_prio_boost = 0; 382 bt_cmd_2000.rx_prio_boost = 0;
383 } else { 383 } else {
384 bt_cmd_6000.prio_boost = 384 bt_cmd_6000.prio_boost =
385 priv->cfg->bt_params->bt_prio_boost; 385 cfg(priv)->bt_params->bt_prio_boost;
386 bt_cmd_6000.tx_prio_boost = 0; 386 bt_cmd_6000.tx_prio_boost = 0;
387 bt_cmd_6000.rx_prio_boost = 0; 387 bt_cmd_6000.rx_prio_boost = 0;
388 } 388 }
@@ -430,7 +430,7 @@ void iwlagn_send_advance_bt_config(struct iwl_priv *priv)
430 priv->bt_full_concurrent ? 430 priv->bt_full_concurrent ?
431 "full concurrency" : "3-wire"); 431 "full concurrency" : "3-wire");
432 432
433 if (priv->cfg->bt_params->bt_session_2) { 433 if (cfg(priv)->bt_params->bt_session_2) {
434 memcpy(&bt_cmd_2000.basic, &basic, 434 memcpy(&bt_cmd_2000.basic, &basic,
435 sizeof(basic)); 435 sizeof(basic));
436 ret = iwl_trans_send_cmd_pdu(trans(priv), REPLY_BT_CONFIG, 436 ret = iwl_trans_send_cmd_pdu(trans(priv), REPLY_BT_CONFIG,
@@ -799,8 +799,8 @@ static bool is_single_rx_stream(struct iwl_priv *priv)
799 */ 799 */
800static int iwl_get_active_rx_chain_count(struct iwl_priv *priv) 800static int iwl_get_active_rx_chain_count(struct iwl_priv *priv)
801{ 801{
802 if (priv->cfg->bt_params && 802 if (cfg(priv)->bt_params &&
803 priv->cfg->bt_params->advanced_bt_coexist && 803 cfg(priv)->bt_params->advanced_bt_coexist &&
804 (priv->bt_full_concurrent || 804 (priv->bt_full_concurrent ||
805 priv->bt_traffic_load >= IWL_BT_COEX_TRAFFIC_LOAD_HIGH)) { 805 priv->bt_traffic_load >= IWL_BT_COEX_TRAFFIC_LOAD_HIGH)) {
806 /* 806 /*
@@ -871,8 +871,8 @@ void iwlagn_set_rxon_chain(struct iwl_priv *priv, struct iwl_rxon_context *ctx)
871 else 871 else
872 active_chains = hw_params(priv).valid_rx_ant; 872 active_chains = hw_params(priv).valid_rx_ant;
873 873
874 if (priv->cfg->bt_params && 874 if (cfg(priv)->bt_params &&
875 priv->cfg->bt_params->advanced_bt_coexist && 875 cfg(priv)->bt_params->advanced_bt_coexist &&
876 (priv->bt_full_concurrent || 876 (priv->bt_full_concurrent ||
877 priv->bt_traffic_load >= IWL_BT_COEX_TRAFFIC_LOAD_HIGH)) { 877 priv->bt_traffic_load >= IWL_BT_COEX_TRAFFIC_LOAD_HIGH)) {
878 /* 878 /*
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
index a23835a7797a..bc0c924d0c95 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
@@ -1086,7 +1086,7 @@ done:
1086 (priv->tm_fixed_rate != lq_sta->dbg_fixed_rate)) 1086 (priv->tm_fixed_rate != lq_sta->dbg_fixed_rate))
1087 rs_program_fix_rate(priv, lq_sta); 1087 rs_program_fix_rate(priv, lq_sta);
1088#endif 1088#endif
1089 if (priv->cfg->bt_params && priv->cfg->bt_params->advanced_bt_coexist) 1089 if (cfg(priv)->bt_params && cfg(priv)->bt_params->advanced_bt_coexist)
1090 rs_bt_update_lq(priv, ctx, lq_sta); 1090 rs_bt_update_lq(priv, ctx, lq_sta);
1091} 1091}
1092 1092
@@ -3055,11 +3055,11 @@ static void rs_fill_link_cmd(struct iwl_priv *priv,
3055 * overwrite if needed, pass aggregation time limit 3055 * overwrite if needed, pass aggregation time limit
3056 * to uCode in uSec 3056 * to uCode in uSec
3057 */ 3057 */
3058 if (priv && priv->cfg->bt_params && 3058 if (priv && cfg(priv)->bt_params &&
3059 priv->cfg->bt_params->agg_time_limit && 3059 cfg(priv)->bt_params->agg_time_limit &&
3060 priv->bt_traffic_load >= IWL_BT_COEX_TRAFFIC_LOAD_HIGH) 3060 priv->bt_traffic_load >= IWL_BT_COEX_TRAFFIC_LOAD_HIGH)
3061 lq_cmd->agg_params.agg_time_limit = 3061 lq_cmd->agg_params.agg_time_limit =
3062 cpu_to_le16(priv->cfg->bt_params->agg_time_limit); 3062 cpu_to_le16(cfg(priv)->bt_params->agg_time_limit);
3063} 3063}
3064 3064
3065static void *rs_alloc(struct ieee80211_hw *hw, struct dentry *debugfsdir) 3065static void *rs_alloc(struct ieee80211_hw *hw, struct dentry *debugfsdir)
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-rx.c b/drivers/net/wireless/iwlwifi/iwl-agn-rx.c
index 9001c23f27bb..b22b2976f899 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-rx.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-rx.c
@@ -318,7 +318,7 @@ static bool iwlagn_good_plcp_health(struct iwl_priv *priv,
318 unsigned int msecs) 318 unsigned int msecs)
319{ 319{
320 int delta; 320 int delta;
321 int threshold = priv->cfg->base_params->plcp_delta_threshold; 321 int threshold = cfg(priv)->base_params->plcp_delta_threshold;
322 322
323 if (threshold == IWL_MAX_PLCP_ERR_THRESHOLD_DISABLE) { 323 if (threshold == IWL_MAX_PLCP_ERR_THRESHOLD_DISABLE) {
324 IWL_DEBUG_RADIO(priv, "plcp_err check disabled\n"); 324 IWL_DEBUG_RADIO(priv, "plcp_err check disabled\n");
@@ -583,8 +583,8 @@ static int iwlagn_rx_statistics(struct iwl_priv *priv,
583 iwlagn_rx_calc_noise(priv); 583 iwlagn_rx_calc_noise(priv);
584 queue_work(priv->shrd->workqueue, &priv->run_time_calib_work); 584 queue_work(priv->shrd->workqueue, &priv->run_time_calib_work);
585 } 585 }
586 if (priv->cfg->lib->temperature && change) 586 if (cfg(priv)->lib->temperature && change)
587 priv->cfg->lib->temperature(priv); 587 cfg(priv)->lib->temperature(priv);
588 return 0; 588 return 0;
589} 589}
590 590
@@ -1136,8 +1136,8 @@ void iwl_setup_rx_handlers(struct iwl_priv *priv)
1136 init_waitqueue_head(&priv->shrd->notif_waitq); 1136 init_waitqueue_head(&priv->shrd->notif_waitq);
1137 1137
1138 /* Set up BT Rx handlers */ 1138 /* Set up BT Rx handlers */
1139 if (priv->cfg->lib->bt_rx_handler_setup) 1139 if (cfg(priv)->lib->bt_rx_handler_setup)
1140 priv->cfg->lib->bt_rx_handler_setup(priv); 1140 cfg(priv)->lib->bt_rx_handler_setup(priv);
1141 1141
1142} 1142}
1143 1143
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c b/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c
index d21f535a3b4f..1c6659416621 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c
@@ -296,9 +296,9 @@ static int iwlagn_rxon_connect(struct iwl_priv *priv,
296 } 296 }
297 297
298 if (ctx->vif && ctx->vif->type == NL80211_IFTYPE_STATION && 298 if (ctx->vif && ctx->vif->type == NL80211_IFTYPE_STATION &&
299 priv->cfg->ht_params && priv->cfg->ht_params->smps_mode) 299 cfg(priv)->ht_params && cfg(priv)->ht_params->smps_mode)
300 ieee80211_request_smps(ctx->vif, 300 ieee80211_request_smps(ctx->vif,
301 priv->cfg->ht_params->smps_mode); 301 cfg(priv)->ht_params->smps_mode);
302 302
303 return 0; 303 return 0;
304} 304}
@@ -445,8 +445,8 @@ int iwlagn_commit_rxon(struct iwl_priv *priv, struct iwl_rxon_context *ctx)
445 * force CTS-to-self frames protection if RTS-CTS is not preferred 445 * force CTS-to-self frames protection if RTS-CTS is not preferred
446 * one aggregation protection method 446 * one aggregation protection method
447 */ 447 */
448 if (!(priv->cfg->ht_params && 448 if (!(cfg(priv)->ht_params &&
449 priv->cfg->ht_params->use_rts_for_aggregation)) 449 cfg(priv)->ht_params->use_rts_for_aggregation))
450 ctx->staging.flags |= RXON_FLG_SELF_CTS_EN; 450 ctx->staging.flags |= RXON_FLG_SELF_CTS_EN;
451 451
452 if ((ctx->vif && ctx->vif->bss_conf.use_short_slot) || 452 if ((ctx->vif && ctx->vif->bss_conf.use_short_slot) ||
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-tt.c b/drivers/net/wireless/iwlwifi/iwl-agn-tt.c
index c27180a73351..b0dff7a753a5 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-tt.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-tt.c
@@ -633,7 +633,7 @@ void iwl_tt_initialize(struct iwl_priv *priv)
633 INIT_WORK(&priv->ct_enter, iwl_bg_ct_enter); 633 INIT_WORK(&priv->ct_enter, iwl_bg_ct_enter);
634 INIT_WORK(&priv->ct_exit, iwl_bg_ct_exit); 634 INIT_WORK(&priv->ct_exit, iwl_bg_ct_exit);
635 635
636 if (priv->cfg->base_params->adv_thermal_throttle) { 636 if (cfg(priv)->base_params->adv_thermal_throttle) {
637 IWL_DEBUG_TEMP(priv, "Advanced Thermal Throttling\n"); 637 IWL_DEBUG_TEMP(priv, "Advanced Thermal Throttling\n");
638 tt->restriction = kcalloc(IWL_TI_STATE_MAX, 638 tt->restriction = kcalloc(IWL_TI_STATE_MAX,
639 sizeof(struct iwl_tt_restriction), 639 sizeof(struct iwl_tt_restriction),
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-tx.c b/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
index 81754cddba73..b484578afa17 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
@@ -74,8 +74,8 @@ static void iwlagn_tx_cmd_build_basic(struct iwl_priv *priv,
74 else if (ieee80211_is_back_req(fc)) 74 else if (ieee80211_is_back_req(fc))
75 tx_flags |= TX_CMD_FLG_ACK_MSK | TX_CMD_FLG_IMM_BA_RSP_MASK; 75 tx_flags |= TX_CMD_FLG_ACK_MSK | TX_CMD_FLG_IMM_BA_RSP_MASK;
76 else if (info->band == IEEE80211_BAND_2GHZ && 76 else if (info->band == IEEE80211_BAND_2GHZ &&
77 priv->cfg->bt_params && 77 cfg(priv)->bt_params &&
78 priv->cfg->bt_params->advanced_bt_coexist && 78 cfg(priv)->bt_params->advanced_bt_coexist &&
79 (ieee80211_is_auth(fc) || ieee80211_is_assoc_req(fc) || 79 (ieee80211_is_auth(fc) || ieee80211_is_assoc_req(fc) ||
80 ieee80211_is_reassoc_req(fc) || 80 ieee80211_is_reassoc_req(fc) ||
81 skb->protocol == cpu_to_be16(ETH_P_PAE))) 81 skb->protocol == cpu_to_be16(ETH_P_PAE)))
@@ -191,8 +191,8 @@ static void iwlagn_tx_cmd_build_rate(struct iwl_priv *priv,
191 rate_flags |= RATE_MCS_CCK_MSK; 191 rate_flags |= RATE_MCS_CCK_MSK;
192 192
193 /* Set up antennas */ 193 /* Set up antennas */
194 if (priv->cfg->bt_params && 194 if (cfg(priv)->bt_params &&
195 priv->cfg->bt_params->advanced_bt_coexist && 195 cfg(priv)->bt_params->advanced_bt_coexist &&
196 priv->bt_full_concurrent) { 196 priv->bt_full_concurrent) {
197 /* operated as 1x1 in full concurrency mode */ 197 /* operated as 1x1 in full concurrency mode */
198 priv->mgmt_tx_ant = iwl_toggle_tx_ant(priv, priv->mgmt_tx_ant, 198 priv->mgmt_tx_ant = iwl_toggle_tx_ant(priv, priv->mgmt_tx_ant,
@@ -598,8 +598,8 @@ static void iwl_rx_reply_tx_agg(struct iwl_priv *priv,
598 * notification again. 598 * notification again.
599 */ 599 */
600 if (tx_resp->bt_kill_count && tx_resp->frame_count == 1 && 600 if (tx_resp->bt_kill_count && tx_resp->frame_count == 1 &&
601 priv->cfg->bt_params && 601 cfg(priv)->bt_params &&
602 priv->cfg->bt_params->advanced_bt_coexist) { 602 cfg(priv)->bt_params->advanced_bt_coexist) {
603 IWL_DEBUG_COEX(priv, "receive reply tx w/ bt_kill\n"); 603 IWL_DEBUG_COEX(priv, "receive reply tx w/ bt_kill\n");
604 } 604 }
605 605
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index f5fe42dbb3b0..5a9370d839ce 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -515,7 +515,7 @@ static void iwl_ucode_callback(const struct firmware *ucode_raw, void *context);
515 515
516static int __must_check iwl_request_firmware(struct iwl_priv *priv, bool first) 516static int __must_check iwl_request_firmware(struct iwl_priv *priv, bool first)
517{ 517{
518 const char *name_pre = priv->cfg->fw_name_pre; 518 const char *name_pre = cfg(priv)->fw_name_pre;
519 char tag[8]; 519 char tag[8];
520 520
521 if (first) { 521 if (first) {
@@ -524,14 +524,14 @@ static int __must_check iwl_request_firmware(struct iwl_priv *priv, bool first)
524 strcpy(tag, UCODE_EXPERIMENTAL_TAG); 524 strcpy(tag, UCODE_EXPERIMENTAL_TAG);
525 } else if (priv->fw_index == UCODE_EXPERIMENTAL_INDEX) { 525 } else if (priv->fw_index == UCODE_EXPERIMENTAL_INDEX) {
526#endif 526#endif
527 priv->fw_index = priv->cfg->ucode_api_max; 527 priv->fw_index = cfg(priv)->ucode_api_max;
528 sprintf(tag, "%d", priv->fw_index); 528 sprintf(tag, "%d", priv->fw_index);
529 } else { 529 } else {
530 priv->fw_index--; 530 priv->fw_index--;
531 sprintf(tag, "%d", priv->fw_index); 531 sprintf(tag, "%d", priv->fw_index);
532 } 532 }
533 533
534 if (priv->fw_index < priv->cfg->ucode_api_min) { 534 if (priv->fw_index < cfg(priv)->ucode_api_min) {
535 IWL_ERR(priv, "no suitable firmware found!\n"); 535 IWL_ERR(priv, "no suitable firmware found!\n");
536 return -ENOENT; 536 return -ENOENT;
537 } 537 }
@@ -836,9 +836,9 @@ static void iwl_ucode_callback(const struct firmware *ucode_raw, void *context)
836 struct iwl_ucode_header *ucode; 836 struct iwl_ucode_header *ucode;
837 int err; 837 int err;
838 struct iwlagn_firmware_pieces pieces; 838 struct iwlagn_firmware_pieces pieces;
839 const unsigned int api_max = priv->cfg->ucode_api_max; 839 const unsigned int api_max = cfg(priv)->ucode_api_max;
840 unsigned int api_ok = priv->cfg->ucode_api_ok; 840 unsigned int api_ok = cfg(priv)->ucode_api_ok;
841 const unsigned int api_min = priv->cfg->ucode_api_min; 841 const unsigned int api_min = cfg(priv)->ucode_api_min;
842 u32 api_ver; 842 u32 api_ver;
843 char buildstr[25]; 843 char buildstr[25];
844 u32 build; 844 u32 build;
@@ -1027,14 +1027,14 @@ static void iwl_ucode_callback(const struct firmware *ucode_raw, void *context)
1027 priv->init_evtlog_size = (pieces.init_evtlog_size - 16)/12; 1027 priv->init_evtlog_size = (pieces.init_evtlog_size - 16)/12;
1028 else 1028 else
1029 priv->init_evtlog_size = 1029 priv->init_evtlog_size =
1030 priv->cfg->base_params->max_event_log_size; 1030 cfg(priv)->base_params->max_event_log_size;
1031 priv->init_errlog_ptr = pieces.init_errlog_ptr; 1031 priv->init_errlog_ptr = pieces.init_errlog_ptr;
1032 priv->inst_evtlog_ptr = pieces.inst_evtlog_ptr; 1032 priv->inst_evtlog_ptr = pieces.inst_evtlog_ptr;
1033 if (pieces.inst_evtlog_size) 1033 if (pieces.inst_evtlog_size)
1034 priv->inst_evtlog_size = (pieces.inst_evtlog_size - 16)/12; 1034 priv->inst_evtlog_size = (pieces.inst_evtlog_size - 16)/12;
1035 else 1035 else
1036 priv->inst_evtlog_size = 1036 priv->inst_evtlog_size =
1037 priv->cfg->base_params->max_event_log_size; 1037 cfg(priv)->base_params->max_event_log_size;
1038 priv->inst_errlog_ptr = pieces.inst_errlog_ptr; 1038 priv->inst_errlog_ptr = pieces.inst_errlog_ptr;
1039#ifndef CONFIG_IWLWIFI_P2P 1039#ifndef CONFIG_IWLWIFI_P2P
1040 ucode_capa.flags &= ~IWL_UCODE_TLV_FLAGS_PAN; 1040 ucode_capa.flags &= ~IWL_UCODE_TLV_FLAGS_PAN;
@@ -1043,7 +1043,7 @@ static void iwl_ucode_callback(const struct firmware *ucode_raw, void *context)
1043 priv->new_scan_threshold_behaviour = 1043 priv->new_scan_threshold_behaviour =
1044 !!(ucode_capa.flags & IWL_UCODE_TLV_FLAGS_NEWSCAN); 1044 !!(ucode_capa.flags & IWL_UCODE_TLV_FLAGS_NEWSCAN);
1045 1045
1046 if (!(priv->cfg->sku & EEPROM_SKU_CAP_IPAN_ENABLE)) 1046 if (!(cfg(priv)->sku & EEPROM_SKU_CAP_IPAN_ENABLE))
1047 ucode_capa.flags &= ~IWL_UCODE_TLV_FLAGS_PAN; 1047 ucode_capa.flags &= ~IWL_UCODE_TLV_FLAGS_PAN;
1048 1048
1049 /* 1049 /*
@@ -1124,7 +1124,7 @@ static void iwl_rf_kill_ct_config(struct iwl_priv *priv)
1124 spin_unlock_irqrestore(&priv->shrd->lock, flags); 1124 spin_unlock_irqrestore(&priv->shrd->lock, flags);
1125 priv->thermal_throttle.ct_kill_toggle = false; 1125 priv->thermal_throttle.ct_kill_toggle = false;
1126 1126
1127 if (priv->cfg->base_params->support_ct_kill_exit) { 1127 if (cfg(priv)->base_params->support_ct_kill_exit) {
1128 adv_cmd.critical_temperature_enter = 1128 adv_cmd.critical_temperature_enter =
1129 cpu_to_le32(hw_params(priv).ct_kill_threshold); 1129 cpu_to_le32(hw_params(priv).ct_kill_threshold);
1130 adv_cmd.critical_temperature_exit = 1130 adv_cmd.critical_temperature_exit =
@@ -1219,10 +1219,10 @@ int iwl_alive_start(struct iwl_priv *priv)
1219 return -ERFKILL; 1219 return -ERFKILL;
1220 1220
1221 /* download priority table before any calibration request */ 1221 /* download priority table before any calibration request */
1222 if (priv->cfg->bt_params && 1222 if (cfg(priv)->bt_params &&
1223 priv->cfg->bt_params->advanced_bt_coexist) { 1223 cfg(priv)->bt_params->advanced_bt_coexist) {
1224 /* Configure Bluetooth device coexistence support */ 1224 /* Configure Bluetooth device coexistence support */
1225 if (priv->cfg->bt_params->bt_sco_disable) 1225 if (cfg(priv)->bt_params->bt_sco_disable)
1226 priv->bt_enable_pspoll = false; 1226 priv->bt_enable_pspoll = false;
1227 else 1227 else
1228 priv->bt_enable_pspoll = true; 1228 priv->bt_enable_pspoll = true;
@@ -1261,7 +1261,7 @@ int iwl_alive_start(struct iwl_priv *priv)
1261 priv->active_rate = IWL_RATES_MASK; 1261 priv->active_rate = IWL_RATES_MASK;
1262 1262
1263 /* Configure Tx antenna selection based on H/W config */ 1263 /* Configure Tx antenna selection based on H/W config */
1264 iwlagn_send_tx_ant_config(priv, priv->cfg->valid_tx_ant); 1264 iwlagn_send_tx_ant_config(priv, cfg(priv)->valid_tx_ant);
1265 1265
1266 if (iwl_is_associated_ctx(ctx) && !priv->shrd->wowlan) { 1266 if (iwl_is_associated_ctx(ctx) && !priv->shrd->wowlan) {
1267 struct iwl_rxon_cmd *active_rxon = 1267 struct iwl_rxon_cmd *active_rxon =
@@ -1330,9 +1330,9 @@ void __iwl_down(struct iwl_priv *priv)
1330 priv->bt_status = 0; 1330 priv->bt_status = 0;
1331 priv->cur_rssi_ctx = NULL; 1331 priv->cur_rssi_ctx = NULL;
1332 priv->bt_is_sco = 0; 1332 priv->bt_is_sco = 0;
1333 if (priv->cfg->bt_params) 1333 if (cfg(priv)->bt_params)
1334 priv->bt_traffic_load = 1334 priv->bt_traffic_load =
1335 priv->cfg->bt_params->bt_init_traffic_load; 1335 cfg(priv)->bt_params->bt_init_traffic_load;
1336 else 1336 else
1337 priv->bt_traffic_load = 0; 1337 priv->bt_traffic_load = 0;
1338 priv->bt_full_concurrent = false; 1338 priv->bt_full_concurrent = false;
@@ -1514,8 +1514,8 @@ static void iwl_setup_deferred_work(struct iwl_priv *priv)
1514 1514
1515 iwl_setup_scan_deferred_work(priv); 1515 iwl_setup_scan_deferred_work(priv);
1516 1516
1517 if (priv->cfg->lib->bt_setup_deferred_work) 1517 if (cfg(priv)->lib->bt_setup_deferred_work)
1518 priv->cfg->lib->bt_setup_deferred_work(priv); 1518 cfg(priv)->lib->bt_setup_deferred_work(priv);
1519 1519
1520 init_timer(&priv->statistics_periodic); 1520 init_timer(&priv->statistics_periodic);
1521 priv->statistics_periodic.data = (unsigned long)priv; 1521 priv->statistics_periodic.data = (unsigned long)priv;
@@ -1532,8 +1532,8 @@ static void iwl_setup_deferred_work(struct iwl_priv *priv)
1532 1532
1533static void iwl_cancel_deferred_work(struct iwl_priv *priv) 1533static void iwl_cancel_deferred_work(struct iwl_priv *priv)
1534{ 1534{
1535 if (priv->cfg->lib->cancel_deferred_work) 1535 if (cfg(priv)->lib->cancel_deferred_work)
1536 priv->cfg->lib->cancel_deferred_work(priv); 1536 cfg(priv)->lib->cancel_deferred_work(priv);
1537 1537
1538 cancel_work_sync(&priv->run_time_calib_work); 1538 cancel_work_sync(&priv->run_time_calib_work);
1539 cancel_work_sync(&priv->beacon_update); 1539 cancel_work_sync(&priv->beacon_update);
@@ -1602,8 +1602,8 @@ static int iwl_init_drv(struct iwl_priv *priv)
1602 iwl_init_scan_params(priv); 1602 iwl_init_scan_params(priv);
1603 1603
1604 /* init bt coex */ 1604 /* init bt coex */
1605 if (priv->cfg->bt_params && 1605 if (cfg(priv)->bt_params &&
1606 priv->cfg->bt_params->advanced_bt_coexist) { 1606 cfg(priv)->bt_params->advanced_bt_coexist) {
1607 priv->kill_ack_mask = IWLAGN_BT_KILL_ACK_MASK_DEFAULT; 1607 priv->kill_ack_mask = IWLAGN_BT_KILL_ACK_MASK_DEFAULT;
1608 priv->kill_cts_mask = IWLAGN_BT_KILL_CTS_MASK_DEFAULT; 1608 priv->kill_cts_mask = IWLAGN_BT_KILL_CTS_MASK_DEFAULT;
1609 priv->bt_valid = IWLAGN_BT_ALL_VALID_MSK; 1609 priv->bt_valid = IWLAGN_BT_ALL_VALID_MSK;
@@ -1668,17 +1668,17 @@ static int iwl_set_hw_params(struct iwl_priv *priv)
1668 get_order(IWL_RX_BUF_SIZE_4K); 1668 get_order(IWL_RX_BUF_SIZE_4K);
1669 1669
1670 if (iwlagn_mod_params.disable_11n) 1670 if (iwlagn_mod_params.disable_11n)
1671 priv->cfg->sku &= ~EEPROM_SKU_CAP_11N_ENABLE; 1671 cfg(priv)->sku &= ~EEPROM_SKU_CAP_11N_ENABLE;
1672 1672
1673 hw_params(priv).num_ampdu_queues = 1673 hw_params(priv).num_ampdu_queues =
1674 priv->cfg->base_params->num_of_ampdu_queues; 1674 cfg(priv)->base_params->num_of_ampdu_queues;
1675 hw_params(priv).shadow_reg_enable = 1675 hw_params(priv).shadow_reg_enable =
1676 priv->cfg->base_params->shadow_reg_enable; 1676 cfg(priv)->base_params->shadow_reg_enable;
1677 hw_params(priv).sku = priv->cfg->sku; 1677 hw_params(priv).sku = cfg(priv)->sku;
1678 hw_params(priv).wd_timeout = priv->cfg->base_params->wd_timeout; 1678 hw_params(priv).wd_timeout = cfg(priv)->base_params->wd_timeout;
1679 1679
1680 /* Device-specific setup */ 1680 /* Device-specific setup */
1681 return priv->cfg->lib->set_hw_params(priv); 1681 return cfg(priv)->lib->set_hw_params(priv);
1682} 1682}
1683 1683
1684 1684
@@ -1757,7 +1757,7 @@ int iwl_probe(struct iwl_bus *bus, const struct iwl_trans_ops *trans_ops,
1757 iwl_debug_config(priv); 1757 iwl_debug_config(priv);
1758 1758
1759 IWL_DEBUG_INFO(priv, "*** LOAD DRIVER ***\n"); 1759 IWL_DEBUG_INFO(priv, "*** LOAD DRIVER ***\n");
1760 priv->cfg = cfg; 1760 cfg(priv) = cfg;
1761 1761
1762 /* is antenna coupling more than 35dB ? */ 1762 /* is antenna coupling more than 35dB ? */
1763 priv->bt_ant_couple_ok = 1763 priv->bt_ant_couple_ok =
@@ -1791,7 +1791,7 @@ int iwl_probe(struct iwl_bus *bus, const struct iwl_trans_ops *trans_ops,
1791 ***********************/ 1791 ***********************/
1792 hw_rev = iwl_hw_detect(priv); 1792 hw_rev = iwl_hw_detect(priv);
1793 IWL_INFO(priv, "Detected %s, REV=0x%X\n", 1793 IWL_INFO(priv, "Detected %s, REV=0x%X\n",
1794 priv->cfg->name, hw_rev); 1794 cfg(priv)->name, hw_rev);
1795 1795
1796 err = iwl_trans_request_irq(trans(priv)); 1796 err = iwl_trans_request_irq(trans(priv));
1797 if (err) 1797 if (err)
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c
index 3b6f48bfe0e3..d037f69afdc1 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.c
+++ b/drivers/net/wireless/iwlwifi/iwl-core.c
@@ -60,8 +60,8 @@ static void iwl_init_ht_hw_capab(const struct iwl_priv *priv,
60 60
61 ht_info->ht_supported = true; 61 ht_info->ht_supported = true;
62 62
63 if (priv->cfg->ht_params && 63 if (cfg(priv)->ht_params &&
64 priv->cfg->ht_params->ht_greenfield_support) 64 cfg(priv)->ht_params->ht_greenfield_support)
65 ht_info->cap |= IEEE80211_HT_CAP_GRN_FLD; 65 ht_info->cap |= IEEE80211_HT_CAP_GRN_FLD;
66 ht_info->cap |= IEEE80211_HT_CAP_SGI_20; 66 ht_info->cap |= IEEE80211_HT_CAP_SGI_20;
67 max_bit_rate = MAX_BIT_RATE_20_MHZ; 67 max_bit_rate = MAX_BIT_RATE_20_MHZ;
@@ -76,11 +76,11 @@ static void iwl_init_ht_hw_capab(const struct iwl_priv *priv,
76 ht_info->cap |= IEEE80211_HT_CAP_MAX_AMSDU; 76 ht_info->cap |= IEEE80211_HT_CAP_MAX_AMSDU;
77 77
78 ht_info->ampdu_factor = CFG_HT_RX_AMPDU_FACTOR_DEF; 78 ht_info->ampdu_factor = CFG_HT_RX_AMPDU_FACTOR_DEF;
79 if (priv->cfg->bt_params && priv->cfg->bt_params->ampdu_factor) 79 if (cfg(priv)->bt_params && cfg(priv)->bt_params->ampdu_factor)
80 ht_info->ampdu_factor = priv->cfg->bt_params->ampdu_factor; 80 ht_info->ampdu_factor = cfg(priv)->bt_params->ampdu_factor;
81 ht_info->ampdu_density = CFG_HT_MPDU_DENSITY_DEF; 81 ht_info->ampdu_density = CFG_HT_MPDU_DENSITY_DEF;
82 if (priv->cfg->bt_params && priv->cfg->bt_params->ampdu_density) 82 if (cfg(priv)->bt_params && cfg(priv)->bt_params->ampdu_density)
83 ht_info->ampdu_density = priv->cfg->bt_params->ampdu_density; 83 ht_info->ampdu_density = cfg(priv)->bt_params->ampdu_density;
84 84
85 ht_info->mcs.rx_mask[0] = 0xFF; 85 ht_info->mcs.rx_mask[0] = 0xFF;
86 if (rx_chains_num >= 2) 86 if (rx_chains_num >= 2)
@@ -141,7 +141,7 @@ int iwl_init_geos(struct iwl_priv *priv)
141 sband->bitrates = &rates[IWL_FIRST_OFDM_RATE]; 141 sband->bitrates = &rates[IWL_FIRST_OFDM_RATE];
142 sband->n_bitrates = IWL_RATE_COUNT_LEGACY - IWL_FIRST_OFDM_RATE; 142 sband->n_bitrates = IWL_RATE_COUNT_LEGACY - IWL_FIRST_OFDM_RATE;
143 143
144 if (priv->cfg->sku & EEPROM_SKU_CAP_11N_ENABLE) 144 if (cfg(priv)->sku & EEPROM_SKU_CAP_11N_ENABLE)
145 iwl_init_ht_hw_capab(priv, &sband->ht_cap, 145 iwl_init_ht_hw_capab(priv, &sband->ht_cap,
146 IEEE80211_BAND_5GHZ); 146 IEEE80211_BAND_5GHZ);
147 147
@@ -151,7 +151,7 @@ int iwl_init_geos(struct iwl_priv *priv)
151 sband->bitrates = rates; 151 sband->bitrates = rates;
152 sband->n_bitrates = IWL_RATE_COUNT_LEGACY; 152 sband->n_bitrates = IWL_RATE_COUNT_LEGACY;
153 153
154 if (priv->cfg->sku & EEPROM_SKU_CAP_11N_ENABLE) 154 if (cfg(priv)->sku & EEPROM_SKU_CAP_11N_ENABLE)
155 iwl_init_ht_hw_capab(priv, &sband->ht_cap, 155 iwl_init_ht_hw_capab(priv, &sband->ht_cap,
156 IEEE80211_BAND_2GHZ); 156 IEEE80211_BAND_2GHZ);
157 157
@@ -206,12 +206,12 @@ int iwl_init_geos(struct iwl_priv *priv)
206 priv->tx_power_next = max_tx_power; 206 priv->tx_power_next = max_tx_power;
207 207
208 if ((priv->bands[IEEE80211_BAND_5GHZ].n_channels == 0) && 208 if ((priv->bands[IEEE80211_BAND_5GHZ].n_channels == 0) &&
209 priv->cfg->sku & EEPROM_SKU_CAP_BAND_52GHZ) { 209 cfg(priv)->sku & EEPROM_SKU_CAP_BAND_52GHZ) {
210 char buf[32]; 210 char buf[32];
211 bus_get_hw_id(bus(priv), buf, sizeof(buf)); 211 bus_get_hw_id(bus(priv), buf, sizeof(buf));
212 IWL_INFO(priv, "Incorrectly detected BG card as ABG. " 212 IWL_INFO(priv, "Incorrectly detected BG card as ABG. "
213 "Please send your %s to maintainer.\n", buf); 213 "Please send your %s to maintainer.\n", buf);
214 priv->cfg->sku &= ~EEPROM_SKU_CAP_BAND_52GHZ; 214 cfg(priv)->sku &= ~EEPROM_SKU_CAP_BAND_52GHZ;
215 } 215 }
216 216
217 IWL_INFO(priv, "Tunable channels: %d 802.11bg, %d 802.11a channels\n", 217 IWL_INFO(priv, "Tunable channels: %d 802.11bg, %d 802.11a channels\n",
@@ -966,9 +966,9 @@ int iwl_apm_init(struct iwl_priv *priv)
966 bus_apm_config(bus(priv)); 966 bus_apm_config(bus(priv));
967 967
968 /* Configure analog phase-lock-loop before activating to D0A */ 968 /* Configure analog phase-lock-loop before activating to D0A */
969 if (priv->cfg->base_params->pll_cfg_val) 969 if (cfg(priv)->base_params->pll_cfg_val)
970 iwl_set_bit(bus(priv), CSR_ANA_PLL_CFG, 970 iwl_set_bit(bus(priv), CSR_ANA_PLL_CFG,
971 priv->cfg->base_params->pll_cfg_val); 971 cfg(priv)->base_params->pll_cfg_val);
972 972
973 /* 973 /*
974 * Set "initialization complete" bit to move adapter from 974 * Set "initialization complete" bit to move adapter from
@@ -1465,7 +1465,7 @@ void iwl_bg_watchdog(unsigned long data)
1465 if (iwl_is_rfkill(priv->shrd)) 1465 if (iwl_is_rfkill(priv->shrd))
1466 return; 1466 return;
1467 1467
1468 timeout = priv->cfg->base_params->wd_timeout; 1468 timeout = cfg(priv)->base_params->wd_timeout;
1469 if (timeout == 0) 1469 if (timeout == 0)
1470 return; 1470 return;
1471 1471
@@ -1490,11 +1490,11 @@ void iwl_bg_watchdog(unsigned long data)
1490 1490
1491void iwl_setup_watchdog(struct iwl_priv *priv) 1491void iwl_setup_watchdog(struct iwl_priv *priv)
1492{ 1492{
1493 unsigned int timeout = priv->cfg->base_params->wd_timeout; 1493 unsigned int timeout = cfg(priv)->base_params->wd_timeout;
1494 1494
1495 if (!iwlagn_mod_params.wd_disable) { 1495 if (!iwlagn_mod_params.wd_disable) {
1496 /* use system default */ 1496 /* use system default */
1497 if (timeout && !priv->cfg->base_params->wd_disable) 1497 if (timeout && !cfg(priv)->base_params->wd_disable)
1498 mod_timer(&priv->watchdog, 1498 mod_timer(&priv->watchdog,
1499 jiffies + 1499 jiffies +
1500 msecs_to_jiffies(IWL_WD_TICK(timeout))); 1500 msecs_to_jiffies(IWL_WD_TICK(timeout)));
@@ -1619,8 +1619,7 @@ void iwl_set_hw_rfkill_state(struct iwl_priv *priv, bool state)
1619 1619
1620void iwl_nic_config(struct iwl_priv *priv) 1620void iwl_nic_config(struct iwl_priv *priv)
1621{ 1621{
1622 priv->cfg->lib->nic_config(priv); 1622 cfg(priv)->lib->nic_config(priv);
1623
1624} 1623}
1625 1624
1626void iwl_free_skb(struct iwl_priv *priv, struct sk_buff *skb) 1625void iwl_free_skb(struct iwl_priv *priv, struct sk_buff *skb)
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.h b/drivers/net/wireless/iwlwifi/iwl-core.h
index 6da53a36c1be..792e802739ec 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.h
+++ b/drivers/net/wireless/iwlwifi/iwl-core.h
@@ -165,77 +165,6 @@ struct iwl_ht_params {
165 enum ieee80211_smps_mode smps_mode; 165 enum ieee80211_smps_mode smps_mode;
166}; 166};
167 167
168/**
169 * struct iwl_cfg
170 * @name: Offical name of the device
171 * @fw_name_pre: Firmware filename prefix. The api version and extension
172 * (.ucode) will be added to filename before loading from disk. The
173 * filename is constructed as fw_name_pre<api>.ucode.
174 * @ucode_api_max: Highest version of uCode API supported by driver.
175 * @ucode_api_ok: oldest version of the uCode API that is OK to load
176 * without a warning, for use in transitions
177 * @ucode_api_min: Lowest version of uCode API supported by driver.
178 * @valid_tx_ant: valid transmit antenna
179 * @valid_rx_ant: valid receive antenna
180 * @sku: sku information from EEPROM
181 * @eeprom_ver: EEPROM version
182 * @eeprom_calib_ver: EEPROM calibration version
183 * @lib: pointer to the lib ops
184 * @additional_nic_config: additional nic configuration
185 * @base_params: pointer to basic parameters
186 * @ht_params: point to ht patameters
187 * @bt_params: pointer to bt parameters
188 * @pa_type: used by 6000 series only to identify the type of Power Amplifier
189 * @need_temp_offset_calib: need to perform temperature offset calibration
190 * @no_xtal_calib: some devices do not need crystal calibration data,
191 * don't send it to those
192 * @scan_antennas: available antenna for scan operation
193 * @led_mode: 0=blinking, 1=On(RF On)/Off(RF Off)
194 * @adv_pm: advance power management
195 * @rx_with_siso_diversity: 1x1 device with rx antenna diversity
196 * @internal_wimax_coex: internal wifi/wimax combo device
197 * @iq_invert: I/Q inversion
198 * @temp_offset_v2: support v2 of temperature offset calibration
199 *
200 * We enable the driver to be backward compatible wrt API version. The
201 * driver specifies which APIs it supports (with @ucode_api_max being the
202 * highest and @ucode_api_min the lowest). Firmware will only be loaded if
203 * it has a supported API version.
204 *
205 * The ideal usage of this infrastructure is to treat a new ucode API
206 * release as a new hardware revision.
207 */
208struct iwl_cfg {
209 /* params specific to an individual device within a device family */
210 const char *name;
211 const char *fw_name_pre;
212 const unsigned int ucode_api_max;
213 const unsigned int ucode_api_ok;
214 const unsigned int ucode_api_min;
215 u8 valid_tx_ant;
216 u8 valid_rx_ant;
217 u16 sku;
218 u16 eeprom_ver;
219 u16 eeprom_calib_ver;
220 const struct iwl_lib_ops *lib;
221 void (*additional_nic_config)(struct iwl_priv *priv);
222 /* params not likely to change within a device family */
223 struct iwl_base_params *base_params;
224 /* params likely to change within a device family */
225 struct iwl_ht_params *ht_params;
226 struct iwl_bt_params *bt_params;
227 enum iwl_pa_type pa_type; /* if used set to IWL_PA_SYSTEM */
228 const bool need_temp_offset_calib; /* if used set to true */
229 const bool no_xtal_calib;
230 u8 scan_rx_antennas[IEEE80211_NUM_BANDS];
231 enum iwl_led_mode led_mode;
232 const bool adv_pm;
233 const bool rx_with_siso_diversity;
234 const bool internal_wimax_coex;
235 const bool iq_invert;
236 const bool temp_offset_v2;
237};
238
239/*************************** 168/***************************
240 * L i b * 169 * L i b *
241 ***************************/ 170 ***************************/
@@ -368,8 +297,8 @@ static inline const struct ieee80211_supported_band *iwl_get_hw_mode(
368 297
369static inline bool iwl_advanced_bt_coexist(struct iwl_priv *priv) 298static inline bool iwl_advanced_bt_coexist(struct iwl_priv *priv)
370{ 299{
371 return priv->cfg->bt_params && 300 return cfg(priv)->bt_params &&
372 priv->cfg->bt_params->advanced_bt_coexist; 301 cfg(priv)->bt_params->advanced_bt_coexist;
373} 302}
374 303
375static inline void iwl_enable_rfkill_int(struct iwl_priv *priv) 304static inline void iwl_enable_rfkill_int(struct iwl_priv *priv)
diff --git a/drivers/net/wireless/iwlwifi/iwl-debugfs.c b/drivers/net/wireless/iwlwifi/iwl-debugfs.c
index 6bf6845e1a51..074068e78320 100644
--- a/drivers/net/wireless/iwlwifi/iwl-debugfs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-debugfs.c
@@ -408,7 +408,7 @@ static ssize_t iwl_dbgfs_nvm_read(struct file *file,
408 const u8 *ptr; 408 const u8 *ptr;
409 char *buf; 409 char *buf;
410 u16 eeprom_ver; 410 u16 eeprom_ver;
411 size_t eeprom_len = priv->cfg->base_params->eeprom_size; 411 size_t eeprom_len = cfg(priv)->base_params->eeprom_size;
412 buf_size = 4 * eeprom_len + 256; 412 buf_size = 4 * eeprom_len + 256;
413 413
414 if (eeprom_len % 16) { 414 if (eeprom_len % 16) {
@@ -1542,15 +1542,15 @@ static ssize_t iwl_dbgfs_ucode_tx_stats_read(struct file *file,
1542 if (tx->tx_power.ant_a || tx->tx_power.ant_b || tx->tx_power.ant_c) { 1542 if (tx->tx_power.ant_a || tx->tx_power.ant_b || tx->tx_power.ant_c) {
1543 pos += scnprintf(buf + pos, bufsz - pos, 1543 pos += scnprintf(buf + pos, bufsz - pos,
1544 "tx power: (1/2 dB step)\n"); 1544 "tx power: (1/2 dB step)\n");
1545 if ((priv->cfg->valid_tx_ant & ANT_A) && tx->tx_power.ant_a) 1545 if ((cfg(priv)->valid_tx_ant & ANT_A) && 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 ((priv->cfg->valid_tx_ant & ANT_B) && tx->tx_power.ant_b) 1549 if ((cfg(priv)->valid_tx_ant & ANT_B) && tx->tx_power.ant_b)
1550 pos += scnprintf(buf + pos, bufsz - pos, 1550 pos += scnprintf(buf + pos, bufsz - pos,
1551 fmt_hex, "antenna B:", 1551 fmt_hex, "antenna B:",
1552 tx->tx_power.ant_b); 1552 tx->tx_power.ant_b);
1553 if ((priv->cfg->valid_tx_ant & ANT_C) && tx->tx_power.ant_c) 1553 if ((cfg(priv)->valid_tx_ant & ANT_C) && tx->tx_power.ant_c)
1554 pos += scnprintf(buf + pos, bufsz - pos, 1554 pos += scnprintf(buf + pos, bufsz - pos,
1555 fmt_hex, "antenna C:", 1555 fmt_hex, "antenna C:",
1556 tx->tx_power.ant_c); 1556 tx->tx_power.ant_c);
@@ -2221,7 +2221,7 @@ static ssize_t iwl_dbgfs_plcp_delta_read(struct file *file,
2221 const size_t bufsz = sizeof(buf); 2221 const size_t bufsz = sizeof(buf);
2222 2222
2223 pos += scnprintf(buf + pos, bufsz - pos, "%u\n", 2223 pos += scnprintf(buf + pos, bufsz - pos, "%u\n",
2224 priv->cfg->base_params->plcp_delta_threshold); 2224 cfg(priv)->base_params->plcp_delta_threshold);
2225 2225
2226 return simple_read_from_buffer(user_buf, count, ppos, buf, pos); 2226 return simple_read_from_buffer(user_buf, count, ppos, buf, pos);
2227} 2227}
@@ -2243,10 +2243,10 @@ static ssize_t iwl_dbgfs_plcp_delta_write(struct file *file,
2243 return -EINVAL; 2243 return -EINVAL;
2244 if ((plcp < IWL_MAX_PLCP_ERR_THRESHOLD_MIN) || 2244 if ((plcp < IWL_MAX_PLCP_ERR_THRESHOLD_MIN) ||
2245 (plcp > IWL_MAX_PLCP_ERR_THRESHOLD_MAX)) 2245 (plcp > IWL_MAX_PLCP_ERR_THRESHOLD_MAX))
2246 priv->cfg->base_params->plcp_delta_threshold = 2246 cfg(priv)->base_params->plcp_delta_threshold =
2247 IWL_MAX_PLCP_ERR_THRESHOLD_DISABLE; 2247 IWL_MAX_PLCP_ERR_THRESHOLD_DISABLE;
2248 else 2248 else
2249 priv->cfg->base_params->plcp_delta_threshold = plcp; 2249 cfg(priv)->base_params->plcp_delta_threshold = plcp;
2250 return count; 2250 return count;
2251} 2251}
2252 2252
@@ -2348,7 +2348,7 @@ static ssize_t iwl_dbgfs_wd_timeout_write(struct file *file,
2348 if (timeout < 0 || timeout > IWL_MAX_WD_TIMEOUT) 2348 if (timeout < 0 || timeout > IWL_MAX_WD_TIMEOUT)
2349 timeout = IWL_DEF_WD_TIMEOUT; 2349 timeout = IWL_DEF_WD_TIMEOUT;
2350 2350
2351 priv->cfg->base_params->wd_timeout = timeout; 2351 cfg(priv)->base_params->wd_timeout = timeout;
2352 iwl_setup_watchdog(priv); 2352 iwl_setup_watchdog(priv);
2353 return count; 2353 return count;
2354} 2354}
@@ -2408,10 +2408,10 @@ static ssize_t iwl_dbgfs_protection_mode_read(struct file *file,
2408 char buf[40]; 2408 char buf[40];
2409 const size_t bufsz = sizeof(buf); 2409 const size_t bufsz = sizeof(buf);
2410 2410
2411 if (priv->cfg->ht_params) 2411 if (cfg(priv)->ht_params)
2412 pos += scnprintf(buf + pos, bufsz - pos, 2412 pos += scnprintf(buf + pos, bufsz - pos,
2413 "use %s for aggregation\n", 2413 "use %s for aggregation\n",
2414 (priv->cfg->ht_params->use_rts_for_aggregation) ? 2414 (cfg(priv)->ht_params->use_rts_for_aggregation) ?
2415 "rts/cts" : "cts-to-self"); 2415 "rts/cts" : "cts-to-self");
2416 else 2416 else
2417 pos += scnprintf(buf + pos, bufsz - pos, "N/A"); 2417 pos += scnprintf(buf + pos, bufsz - pos, "N/A");
@@ -2428,7 +2428,7 @@ static ssize_t iwl_dbgfs_protection_mode_write(struct file *file,
2428 int buf_size; 2428 int buf_size;
2429 int rts; 2429 int rts;
2430 2430
2431 if (!priv->cfg->ht_params) 2431 if (!cfg(priv)->ht_params)
2432 return -EINVAL; 2432 return -EINVAL;
2433 2433
2434 memset(buf, 0, sizeof(buf)); 2434 memset(buf, 0, sizeof(buf));
@@ -2438,9 +2438,9 @@ static ssize_t iwl_dbgfs_protection_mode_write(struct file *file,
2438 if (sscanf(buf, "%d", &rts) != 1) 2438 if (sscanf(buf, "%d", &rts) != 1)
2439 return -EINVAL; 2439 return -EINVAL;
2440 if (rts) 2440 if (rts)
2441 priv->cfg->ht_params->use_rts_for_aggregation = true; 2441 cfg(priv)->ht_params->use_rts_for_aggregation = true;
2442 else 2442 else
2443 priv->cfg->ht_params->use_rts_for_aggregation = false; 2443 cfg(priv)->ht_params->use_rts_for_aggregation = false;
2444 return count; 2444 return count;
2445} 2445}
2446 2446
diff --git a/drivers/net/wireless/iwlwifi/iwl-dev.h b/drivers/net/wireless/iwlwifi/iwl-dev.h
index 69ecf6e2e658..f1317a688b9a 100644
--- a/drivers/net/wireless/iwlwifi/iwl-dev.h
+++ b/drivers/net/wireless/iwlwifi/iwl-dev.h
@@ -512,16 +512,6 @@ enum iwl_access_mode {
512 IWL_OTP_ACCESS_RELATIVE, 512 IWL_OTP_ACCESS_RELATIVE,
513}; 513};
514 514
515/**
516 * enum iwl_pa_type - Power Amplifier type
517 * @IWL_PA_SYSTEM: based on uCode configuration
518 * @IWL_PA_INTERNAL: use Internal only
519 */
520enum iwl_pa_type {
521 IWL_PA_SYSTEM = 0,
522 IWL_PA_INTERNAL = 1,
523};
524
525/* reply_tx_statistics (for _agn devices) */ 515/* reply_tx_statistics (for _agn devices) */
526struct reply_tx_error_statistics { 516struct reply_tx_error_statistics {
527 u32 pp_delay; 517 u32 pp_delay;
@@ -776,7 +766,6 @@ struct iwl_priv {
776 struct ieee80211_channel *ieee_channels; 766 struct ieee80211_channel *ieee_channels;
777 struct ieee80211_rate *ieee_rates; 767 struct ieee80211_rate *ieee_rates;
778 struct kmem_cache *tx_cmd_pool; 768 struct kmem_cache *tx_cmd_pool;
779 struct iwl_cfg *cfg;
780 769
781 enum ieee80211_band band; 770 enum ieee80211_band band;
782 771
diff --git a/drivers/net/wireless/iwlwifi/iwl-eeprom.c b/drivers/net/wireless/iwlwifi/iwl-eeprom.c
index 6fcc7d586b24..c1eda9724f42 100644
--- a/drivers/net/wireless/iwlwifi/iwl-eeprom.c
+++ b/drivers/net/wireless/iwlwifi/iwl-eeprom.c
@@ -230,8 +230,8 @@ int iwl_eeprom_check_version(struct iwl_priv *priv)
230 eeprom_ver = iwl_eeprom_query16(priv->shrd, EEPROM_VERSION); 230 eeprom_ver = iwl_eeprom_query16(priv->shrd, EEPROM_VERSION);
231 calib_ver = iwl_eeprom_calib_version(priv->shrd); 231 calib_ver = iwl_eeprom_calib_version(priv->shrd);
232 232
233 if (eeprom_ver < priv->cfg->eeprom_ver || 233 if (eeprom_ver < cfg(priv)->eeprom_ver ||
234 calib_ver < priv->cfg->eeprom_calib_ver) 234 calib_ver < cfg(priv)->eeprom_calib_ver)
235 goto err; 235 goto err;
236 236
237 IWL_INFO(priv, "device EEPROM VER=0x%x, CALIB=0x%x\n", 237 IWL_INFO(priv, "device EEPROM VER=0x%x, CALIB=0x%x\n",
@@ -241,8 +241,8 @@ int iwl_eeprom_check_version(struct iwl_priv *priv)
241err: 241err:
242 IWL_ERR(priv, "Unsupported (too old) EEPROM VER=0x%x < 0x%x " 242 IWL_ERR(priv, "Unsupported (too old) EEPROM VER=0x%x < 0x%x "
243 "CALIB=0x%x < 0x%x\n", 243 "CALIB=0x%x < 0x%x\n",
244 eeprom_ver, priv->cfg->eeprom_ver, 244 eeprom_ver, cfg(priv)->eeprom_ver,
245 calib_ver, priv->cfg->eeprom_calib_ver); 245 calib_ver, cfg(priv)->eeprom_calib_ver);
246 return -EINVAL; 246 return -EINVAL;
247 247
248} 248}
@@ -252,35 +252,35 @@ int iwl_eeprom_check_sku(struct iwl_priv *priv)
252 struct iwl_shared *shrd = priv->shrd; 252 struct iwl_shared *shrd = priv->shrd;
253 u16 radio_cfg; 253 u16 radio_cfg;
254 254
255 if (!priv->cfg->sku) { 255 if (!cfg(priv)->sku) {
256 /* not using sku overwrite */ 256 /* not using sku overwrite */
257 priv->cfg->sku = iwl_eeprom_query16(shrd, EEPROM_SKU_CAP); 257 cfg(priv)->sku = iwl_eeprom_query16(shrd, EEPROM_SKU_CAP);
258 if (priv->cfg->sku & EEPROM_SKU_CAP_11N_ENABLE && 258 if (cfg(priv)->sku & EEPROM_SKU_CAP_11N_ENABLE &&
259 !priv->cfg->ht_params) { 259 !cfg(priv)->ht_params) {
260 IWL_ERR(priv, "Invalid 11n configuration\n"); 260 IWL_ERR(priv, "Invalid 11n configuration\n");
261 return -EINVAL; 261 return -EINVAL;
262 } 262 }
263 } 263 }
264 if (!priv->cfg->sku) { 264 if (!cfg(priv)->sku) {
265 IWL_ERR(priv, "Invalid device sku\n"); 265 IWL_ERR(priv, "Invalid device sku\n");
266 return -EINVAL; 266 return -EINVAL;
267 } 267 }
268 268
269 IWL_INFO(priv, "Device SKU: 0X%x\n", priv->cfg->sku); 269 IWL_INFO(priv, "Device SKU: 0x%X\n", cfg(priv)->sku);
270 270
271 if (!priv->cfg->valid_tx_ant && !priv->cfg->valid_rx_ant) { 271 if (!cfg(priv)->valid_tx_ant && !cfg(priv)->valid_rx_ant) {
272 /* not using .cfg overwrite */ 272 /* not using .cfg overwrite */
273 radio_cfg = iwl_eeprom_query16(shrd, EEPROM_RADIO_CONFIG); 273 radio_cfg = iwl_eeprom_query16(shrd, EEPROM_RADIO_CONFIG);
274 priv->cfg->valid_tx_ant = EEPROM_RF_CFG_TX_ANT_MSK(radio_cfg); 274 cfg(priv)->valid_tx_ant = EEPROM_RF_CFG_TX_ANT_MSK(radio_cfg);
275 priv->cfg->valid_rx_ant = EEPROM_RF_CFG_RX_ANT_MSK(radio_cfg); 275 cfg(priv)->valid_rx_ant = EEPROM_RF_CFG_RX_ANT_MSK(radio_cfg);
276 if (!priv->cfg->valid_tx_ant || !priv->cfg->valid_rx_ant) { 276 if (!cfg(priv)->valid_tx_ant || !cfg(priv)->valid_rx_ant) {
277 IWL_ERR(priv, "Invalid chain (0X%x, 0X%x)\n", 277 IWL_ERR(priv, "Invalid chain (0x%X, 0x%X)\n",
278 priv->cfg->valid_tx_ant, 278 cfg(priv)->valid_tx_ant,
279 priv->cfg->valid_rx_ant); 279 cfg(priv)->valid_rx_ant);
280 return -EINVAL; 280 return -EINVAL;
281 } 281 }
282 IWL_INFO(priv, "Valid Tx ant: 0X%x, Valid Rx ant: 0X%x\n", 282 IWL_INFO(priv, "Valid Tx ant: 0x%X, Valid Rx ant: 0x%X\n",
283 priv->cfg->valid_tx_ant, priv->cfg->valid_rx_ant); 283 cfg(priv)->valid_tx_ant, cfg(priv)->valid_rx_ant);
284 } 284 }
285 /* 285 /*
286 * for some special cases, 286 * for some special cases,
@@ -369,7 +369,7 @@ static int iwl_init_otp_access(struct iwl_bus *bus)
369 * CSR auto clock gate disable bit - 369 * CSR auto clock gate disable bit -
370 * this is only applicable for HW with OTP shadow RAM 370 * this is only applicable for HW with OTP shadow RAM
371 */ 371 */
372 if (priv(bus)->cfg->base_params->shadow_ram_support) 372 if (cfg(bus)->base_params->shadow_ram_support)
373 iwl_set_bit(bus, CSR_DBG_LINK_PWR_MGMT_REG, 373 iwl_set_bit(bus, CSR_DBG_LINK_PWR_MGMT_REG,
374 CSR_RESET_LINK_PWR_MGMT_DISABLED); 374 CSR_RESET_LINK_PWR_MGMT_DISABLED);
375 } 375 }
@@ -489,7 +489,7 @@ static int iwl_find_otp_image(struct iwl_bus *bus,
489 } 489 }
490 /* more in the link list, continue */ 490 /* more in the link list, continue */
491 usedblocks++; 491 usedblocks++;
492 } while (usedblocks <= priv(bus)->cfg->base_params->max_ll_items); 492 } while (usedblocks <= cfg(bus)->base_params->max_ll_items);
493 493
494 /* OTP has no valid blocks */ 494 /* OTP has no valid blocks */
495 IWL_DEBUG_EEPROM(bus, "OTP has no valid blocks\n"); 495 IWL_DEBUG_EEPROM(bus, "OTP has no valid blocks\n");
@@ -629,7 +629,7 @@ void iwl_eeprom_enhanced_txpower(struct iwl_priv *priv)
629 ((txp->delta_20_in_40 & 0xf0) >> 4), 629 ((txp->delta_20_in_40 & 0xf0) >> 4),
630 (txp->delta_20_in_40 & 0x0f)); 630 (txp->delta_20_in_40 & 0x0f));
631 631
632 max_txp_avg = iwl_get_max_txpower_avg(priv->cfg, txp_array, idx, 632 max_txp_avg = iwl_get_max_txpower_avg(cfg(priv), txp_array, idx,
633 &max_txp_avg_halfdbm); 633 &max_txp_avg_halfdbm);
634 634
635 /* 635 /*
@@ -667,7 +667,7 @@ int iwl_eeprom_init(struct iwl_priv *priv, u32 hw_rev)
667 if (trans(priv)->nvm_device_type == -ENOENT) 667 if (trans(priv)->nvm_device_type == -ENOENT)
668 return -ENOENT; 668 return -ENOENT;
669 /* allocate eeprom */ 669 /* allocate eeprom */
670 sz = priv->cfg->base_params->eeprom_size; 670 sz = cfg(priv)->base_params->eeprom_size;
671 IWL_DEBUG_EEPROM(priv, "NVM size = %d\n", sz); 671 IWL_DEBUG_EEPROM(priv, "NVM size = %d\n", sz);
672 shrd->eeprom = kzalloc(sz, GFP_KERNEL); 672 shrd->eeprom = kzalloc(sz, GFP_KERNEL);
673 if (!shrd->eeprom) { 673 if (!shrd->eeprom) {
@@ -709,7 +709,7 @@ int iwl_eeprom_init(struct iwl_priv *priv, u32 hw_rev)
709 CSR_OTP_GP_REG_ECC_CORR_STATUS_MSK | 709 CSR_OTP_GP_REG_ECC_CORR_STATUS_MSK |
710 CSR_OTP_GP_REG_ECC_UNCORR_STATUS_MSK); 710 CSR_OTP_GP_REG_ECC_UNCORR_STATUS_MSK);
711 /* traversing the linked list if no shadow ram supported */ 711 /* traversing the linked list if no shadow ram supported */
712 if (!priv->cfg->base_params->shadow_ram_support) { 712 if (!cfg(priv)->base_params->shadow_ram_support) {
713 if (iwl_find_otp_image(bus(priv), &validblockaddr)) { 713 if (iwl_find_otp_image(bus(priv), &validblockaddr)) {
714 ret = -ENOENT; 714 ret = -ENOENT;
715 goto done; 715 goto done;
@@ -776,7 +776,7 @@ static void iwl_init_band_reference(const struct iwl_priv *priv,
776 const u8 **eeprom_ch_index) 776 const u8 **eeprom_ch_index)
777{ 777{
778 struct iwl_shared *shrd = priv->shrd; 778 struct iwl_shared *shrd = priv->shrd;
779 u32 offset = priv->cfg->lib-> 779 u32 offset = cfg(priv)->lib->
780 eeprom_ops.regulatory_bands[eep_band - 1]; 780 eeprom_ops.regulatory_bands[eep_band - 1];
781 switch (eep_band) { 781 switch (eep_band) {
782 case 1: /* 2.4GHz band */ 782 case 1: /* 2.4GHz band */
@@ -983,9 +983,9 @@ int iwl_init_channel_map(struct iwl_priv *priv)
983 } 983 }
984 984
985 /* Check if we do have HT40 channels */ 985 /* Check if we do have HT40 channels */
986 if (priv->cfg->lib->eeprom_ops.regulatory_bands[5] == 986 if (cfg(priv)->lib->eeprom_ops.regulatory_bands[5] ==
987 EEPROM_REGULATORY_BAND_NO_HT40 && 987 EEPROM_REGULATORY_BAND_NO_HT40 &&
988 priv->cfg->lib->eeprom_ops.regulatory_bands[6] == 988 cfg(priv)->lib->eeprom_ops.regulatory_bands[6] ==
989 EEPROM_REGULATORY_BAND_NO_HT40) 989 EEPROM_REGULATORY_BAND_NO_HT40)
990 return 0; 990 return 0;
991 991
@@ -1021,8 +1021,8 @@ int iwl_init_channel_map(struct iwl_priv *priv)
1021 * driver need to process addition information 1021 * driver need to process addition information
1022 * to determine the max channel tx power limits 1022 * to determine the max channel tx power limits
1023 */ 1023 */
1024 if (priv->cfg->lib->eeprom_ops.update_enhanced_txpower) 1024 if (cfg(priv)->lib->eeprom_ops.update_enhanced_txpower)
1025 priv->cfg->lib->eeprom_ops.update_enhanced_txpower(priv); 1025 cfg(priv)->lib->eeprom_ops.update_enhanced_txpower(priv);
1026 1026
1027 return 0; 1027 return 0;
1028} 1028}
diff --git a/drivers/net/wireless/iwlwifi/iwl-led.c b/drivers/net/wireless/iwlwifi/iwl-led.c
index eb541735296c..14dcbfcdc0fd 100644
--- a/drivers/net/wireless/iwlwifi/iwl-led.c
+++ b/drivers/net/wireless/iwlwifi/iwl-led.c
@@ -137,11 +137,11 @@ static int iwl_led_cmd(struct iwl_priv *priv,
137 } 137 }
138 138
139 IWL_DEBUG_LED(priv, "Led blink time compensation=%u\n", 139 IWL_DEBUG_LED(priv, "Led blink time compensation=%u\n",
140 priv->cfg->base_params->led_compensation); 140 cfg(priv)->base_params->led_compensation);
141 led_cmd.on = iwl_blink_compensation(priv, on, 141 led_cmd.on = iwl_blink_compensation(priv, on,
142 priv->cfg->base_params->led_compensation); 142 cfg(priv)->base_params->led_compensation);
143 led_cmd.off = iwl_blink_compensation(priv, off, 143 led_cmd.off = iwl_blink_compensation(priv, off,
144 priv->cfg->base_params->led_compensation); 144 cfg(priv)->base_params->led_compensation);
145 145
146 ret = iwl_send_led_cmd(priv, &led_cmd); 146 ret = iwl_send_led_cmd(priv, &led_cmd);
147 if (!ret) { 147 if (!ret) {
@@ -178,7 +178,7 @@ void iwl_leds_init(struct iwl_priv *priv)
178 int ret; 178 int ret;
179 179
180 if (mode == IWL_LED_DEFAULT) 180 if (mode == IWL_LED_DEFAULT)
181 mode = priv->cfg->led_mode; 181 mode = cfg(priv)->led_mode;
182 182
183 priv->led.name = kasprintf(GFP_KERNEL, "%s-led", 183 priv->led.name = kasprintf(GFP_KERNEL, "%s-led",
184 wiphy_name(priv->hw->wiphy)); 184 wiphy_name(priv->hw->wiphy));
diff --git a/drivers/net/wireless/iwlwifi/iwl-led.h b/drivers/net/wireless/iwlwifi/iwl-led.h
index 1c93dfef6933..2550b3c7dcbf 100644
--- a/drivers/net/wireless/iwlwifi/iwl-led.h
+++ b/drivers/net/wireless/iwlwifi/iwl-led.h
@@ -36,20 +36,6 @@ struct iwl_priv;
36#define IWL_LED_ACTIVITY (0<<1) 36#define IWL_LED_ACTIVITY (0<<1)
37#define IWL_LED_LINK (1<<1) 37#define IWL_LED_LINK (1<<1)
38 38
39/*
40 * LED mode
41 * IWL_LED_DEFAULT: use device default
42 * IWL_LED_RF_STATE: turn LED on/off based on RF state
43 * LED ON = RF ON
44 * LED OFF = RF OFF
45 * IWL_LED_BLINK: adjust led blink rate based on blink table
46 */
47enum iwl_led_mode {
48 IWL_LED_DEFAULT,
49 IWL_LED_RF_STATE,
50 IWL_LED_BLINK,
51};
52
53void iwlagn_led_enable(struct iwl_priv *priv); 39void iwlagn_led_enable(struct iwl_priv *priv);
54void iwl_leds_init(struct iwl_priv *priv); 40void iwl_leds_init(struct iwl_priv *priv);
55void iwl_leds_exit(struct iwl_priv *priv); 41void iwl_leds_exit(struct iwl_priv *priv);
diff --git a/drivers/net/wireless/iwlwifi/iwl-mac80211.c b/drivers/net/wireless/iwlwifi/iwl-mac80211.c
index e3944f4e4fd6..4aedd728c55b 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 hw->flags |= IEEE80211_HW_SUPPORTS_PS | 160 hw->flags |= IEEE80211_HW_SUPPORTS_PS |
161 IEEE80211_HW_SUPPORTS_DYNAMIC_PS; 161 IEEE80211_HW_SUPPORTS_DYNAMIC_PS;
162 162
163 if (priv->cfg->sku & EEPROM_SKU_CAP_11N_ENABLE) 163 if (cfg(priv)->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
@@ -616,7 +616,7 @@ static int iwlagn_mac_ampdu_action(struct ieee80211_hw *hw,
616 IWL_DEBUG_HT(priv, "A-MPDU action on addr %pM tid %d\n", 616 IWL_DEBUG_HT(priv, "A-MPDU action on addr %pM tid %d\n",
617 sta->addr, tid); 617 sta->addr, tid);
618 618
619 if (!(priv->cfg->sku & EEPROM_SKU_CAP_11N_ENABLE)) 619 if (!(cfg(priv)->sku & EEPROM_SKU_CAP_11N_ENABLE))
620 return -EACCES; 620 return -EACCES;
621 621
622 IWL_DEBUG_MAC80211(priv, "enter\n"); 622 IWL_DEBUG_MAC80211(priv, "enter\n");
@@ -647,8 +647,8 @@ static int iwlagn_mac_ampdu_action(struct ieee80211_hw *hw,
647 } 647 }
648 if (test_bit(STATUS_EXIT_PENDING, &priv->shrd->status)) 648 if (test_bit(STATUS_EXIT_PENDING, &priv->shrd->status))
649 ret = 0; 649 ret = 0;
650 if (!priv->agg_tids_count && priv->cfg->ht_params && 650 if (!priv->agg_tids_count && cfg(priv)->ht_params &&
651 priv->cfg->ht_params->use_rts_for_aggregation) { 651 cfg(priv)->ht_params->use_rts_for_aggregation) {
652 /* 652 /*
653 * switch off RTS/CTS if it was previously enabled 653 * switch off RTS/CTS if it was previously enabled
654 */ 654 */
@@ -684,8 +684,8 @@ static int iwlagn_mac_ampdu_action(struct ieee80211_hw *hw,
684 sta_priv->max_agg_bufsize = 684 sta_priv->max_agg_bufsize =
685 min(sta_priv->max_agg_bufsize, buf_size); 685 min(sta_priv->max_agg_bufsize, buf_size);
686 686
687 if (priv->cfg->ht_params && 687 if (cfg(priv)->ht_params &&
688 priv->cfg->ht_params->use_rts_for_aggregation) { 688 cfg(priv)->ht_params->use_rts_for_aggregation) {
689 /* 689 /*
690 * switch to RTS/CTS if it is the prefer protection 690 * switch to RTS/CTS if it is the prefer protection
691 * method for HT traffic 691 * method for HT traffic
@@ -792,7 +792,7 @@ static void iwlagn_mac_channel_switch(struct ieee80211_hw *hw,
792 if (!iwl_is_associated_ctx(ctx)) 792 if (!iwl_is_associated_ctx(ctx))
793 goto out; 793 goto out;
794 794
795 if (!priv->cfg->lib->set_channel_switch) 795 if (!cfg(priv)->lib->set_channel_switch)
796 goto out; 796 goto out;
797 797
798 ch = channel->hw_value; 798 ch = channel->hw_value;
@@ -832,7 +832,7 @@ static void iwlagn_mac_channel_switch(struct ieee80211_hw *hw,
832 */ 832 */
833 set_bit(STATUS_CHANNEL_SWITCH_PENDING, &priv->shrd->status); 833 set_bit(STATUS_CHANNEL_SWITCH_PENDING, &priv->shrd->status);
834 priv->switch_channel = cpu_to_le16(ch); 834 priv->switch_channel = cpu_to_le16(ch);
835 if (priv->cfg->lib->set_channel_switch(priv, ch_switch)) { 835 if (cfg(priv)->lib->set_channel_switch(priv, ch_switch)) {
836 clear_bit(STATUS_CHANNEL_SWITCH_PENDING, &priv->shrd->status); 836 clear_bit(STATUS_CHANNEL_SWITCH_PENDING, &priv->shrd->status);
837 priv->switch_channel = 0; 837 priv->switch_channel = 0;
838 ieee80211_chswitch_done(ctx->vif, false); 838 ieee80211_chswitch_done(ctx->vif, false);
@@ -1125,8 +1125,8 @@ static void iwlagn_mac_rssi_callback(struct ieee80211_hw *hw,
1125 IWL_DEBUG_MAC80211(priv, "enter\n"); 1125 IWL_DEBUG_MAC80211(priv, "enter\n");
1126 mutex_lock(&priv->shrd->mutex); 1126 mutex_lock(&priv->shrd->mutex);
1127 1127
1128 if (priv->cfg->bt_params && 1128 if (cfg(priv)->bt_params &&
1129 priv->cfg->bt_params->advanced_bt_coexist) { 1129 cfg(priv)->bt_params->advanced_bt_coexist) {
1130 if (rssi_event == RSSI_EVENT_LOW) 1130 if (rssi_event == RSSI_EVENT_LOW)
1131 priv->bt_enable_pspoll = true; 1131 priv->bt_enable_pspoll = true;
1132 else if (rssi_event == RSSI_EVENT_HIGH) 1132 else if (rssi_event == RSSI_EVENT_HIGH)
@@ -1237,7 +1237,7 @@ static int iwl_setup_interface(struct iwl_priv *priv,
1237 return err; 1237 return err;
1238 } 1238 }
1239 1239
1240 if (priv->cfg->bt_params && priv->cfg->bt_params->advanced_bt_coexist && 1240 if (cfg(priv)->bt_params && cfg(priv)->bt_params->advanced_bt_coexist &&
1241 vif->type == NL80211_IFTYPE_ADHOC) { 1241 vif->type == NL80211_IFTYPE_ADHOC) {
1242 /* 1242 /*
1243 * pretend to have high BT traffic as long as we 1243 * pretend to have high BT traffic as long as we
diff --git a/drivers/net/wireless/iwlwifi/iwl-power.c b/drivers/net/wireless/iwlwifi/iwl-power.c
index 4eaab204322d..2b188a6025b3 100644
--- a/drivers/net/wireless/iwlwifi/iwl-power.c
+++ b/drivers/net/wireless/iwlwifi/iwl-power.c
@@ -167,7 +167,7 @@ static void iwl_static_sleep_cmd(struct iwl_priv *priv,
167 u8 skip; 167 u8 skip;
168 u32 slp_itrvl; 168 u32 slp_itrvl;
169 169
170 if (priv->cfg->adv_pm) { 170 if (cfg(priv)->adv_pm) {
171 table = apm_range_2; 171 table = apm_range_2;
172 if (period <= IWL_DTIM_RANGE_1_MAX) 172 if (period <= IWL_DTIM_RANGE_1_MAX)
173 table = apm_range_1; 173 table = apm_range_1;
@@ -221,7 +221,7 @@ static void iwl_static_sleep_cmd(struct iwl_priv *priv,
221 cmd->flags &= ~IWL_POWER_SHADOW_REG_ENA; 221 cmd->flags &= ~IWL_POWER_SHADOW_REG_ENA;
222 222
223 if (iwl_advanced_bt_coexist(priv)) { 223 if (iwl_advanced_bt_coexist(priv)) {
224 if (!priv->cfg->bt_params->bt_sco_disable) 224 if (!cfg(priv)->bt_params->bt_sco_disable)
225 cmd->flags |= IWL_POWER_BT_SCO_ENA; 225 cmd->flags |= IWL_POWER_BT_SCO_ENA;
226 else 226 else
227 cmd->flags &= ~IWL_POWER_BT_SCO_ENA; 227 cmd->flags &= ~IWL_POWER_BT_SCO_ENA;
@@ -307,7 +307,7 @@ static void iwl_power_fill_sleep_cmd(struct iwl_priv *priv,
307 cmd->flags &= ~IWL_POWER_SHADOW_REG_ENA; 307 cmd->flags &= ~IWL_POWER_SHADOW_REG_ENA;
308 308
309 if (iwl_advanced_bt_coexist(priv)) { 309 if (iwl_advanced_bt_coexist(priv)) {
310 if (!priv->cfg->bt_params->bt_sco_disable) 310 if (!cfg(priv)->bt_params->bt_sco_disable)
311 cmd->flags |= IWL_POWER_BT_SCO_ENA; 311 cmd->flags |= IWL_POWER_BT_SCO_ENA;
312 else 312 else
313 cmd->flags &= ~IWL_POWER_BT_SCO_ENA; 313 cmd->flags &= ~IWL_POWER_BT_SCO_ENA;
@@ -350,7 +350,7 @@ static void iwl_power_build_cmd(struct iwl_priv *priv,
350 350
351 if (priv->shrd->wowlan) 351 if (priv->shrd->wowlan)
352 iwl_static_sleep_cmd(priv, cmd, IWL_POWER_INDEX_5, dtimper); 352 iwl_static_sleep_cmd(priv, cmd, IWL_POWER_INDEX_5, dtimper);
353 else if (!priv->cfg->base_params->no_idle_support && 353 else if (!cfg(priv)->base_params->no_idle_support &&
354 priv->hw->conf.flags & IEEE80211_CONF_IDLE) 354 priv->hw->conf.flags & IEEE80211_CONF_IDLE)
355 iwl_static_sleep_cmd(priv, cmd, IWL_POWER_INDEX_5, 20); 355 iwl_static_sleep_cmd(priv, cmd, IWL_POWER_INDEX_5, 20);
356 else if (iwl_tt_is_low_power_state(priv)) { 356 else if (iwl_tt_is_low_power_state(priv)) {
diff --git a/drivers/net/wireless/iwlwifi/iwl-scan.c b/drivers/net/wireless/iwlwifi/iwl-scan.c
index 359d2182757b..084aa2c4ccfb 100644
--- a/drivers/net/wireless/iwlwifi/iwl-scan.c
+++ b/drivers/net/wireless/iwlwifi/iwl-scan.c
@@ -691,8 +691,8 @@ static int iwlagn_request_scan(struct iwl_priv *priv, struct ieee80211_vif *vif)
691 * Internal scans are passive, so we can indiscriminately set 691 * Internal scans are passive, so we can indiscriminately set
692 * the BT ignore flag on 2.4 GHz since it applies to TX only. 692 * the BT ignore flag on 2.4 GHz since it applies to TX only.
693 */ 693 */
694 if (priv->cfg->bt_params && 694 if (cfg(priv)->bt_params &&
695 priv->cfg->bt_params->advanced_bt_coexist) 695 cfg(priv)->bt_params->advanced_bt_coexist)
696 scan->tx_cmd.tx_flags |= TX_CMD_FLG_IGNORE_BT; 696 scan->tx_cmd.tx_flags |= TX_CMD_FLG_IGNORE_BT;
697 break; 697 break;
698 case IEEE80211_BAND_5GHZ: 698 case IEEE80211_BAND_5GHZ:
@@ -733,12 +733,12 @@ static int iwlagn_request_scan(struct iwl_priv *priv, struct ieee80211_vif *vif)
733 733
734 band = priv->scan_band; 734 band = priv->scan_band;
735 735
736 if (priv->cfg->scan_rx_antennas[band]) 736 if (cfg(priv)->scan_rx_antennas[band])
737 rx_ant = priv->cfg->scan_rx_antennas[band]; 737 rx_ant = cfg(priv)->scan_rx_antennas[band];
738 738
739 if (band == IEEE80211_BAND_2GHZ && 739 if (band == IEEE80211_BAND_2GHZ &&
740 priv->cfg->bt_params && 740 cfg(priv)->bt_params &&
741 priv->cfg->bt_params->advanced_bt_coexist) { 741 cfg(priv)->bt_params->advanced_bt_coexist) {
742 /* transmit 2.4 GHz probes only on first antenna */ 742 /* transmit 2.4 GHz probes only on first antenna */
743 scan_tx_antennas = first_antenna(scan_tx_antennas); 743 scan_tx_antennas = first_antenna(scan_tx_antennas);
744 } 744 }
@@ -762,8 +762,8 @@ static int iwlagn_request_scan(struct iwl_priv *priv, struct ieee80211_vif *vif)
762 762
763 rx_ant = first_antenna(active_chains); 763 rx_ant = first_antenna(active_chains);
764 } 764 }
765 if (priv->cfg->bt_params && 765 if (cfg(priv)->bt_params &&
766 priv->cfg->bt_params->advanced_bt_coexist && 766 cfg(priv)->bt_params->advanced_bt_coexist &&
767 priv->bt_full_concurrent) { 767 priv->bt_full_concurrent) {
768 /* operated as 1x1 in full concurrency mode */ 768 /* operated as 1x1 in full concurrency mode */
769 rx_ant = first_antenna(rx_ant); 769 rx_ant = first_antenna(rx_ant);
diff --git a/drivers/net/wireless/iwlwifi/iwl-shared.h b/drivers/net/wireless/iwlwifi/iwl-shared.h
index 29a7284aa3ef..df6d2123fe4f 100644
--- a/drivers/net/wireless/iwlwifi/iwl-shared.h
+++ b/drivers/net/wireless/iwlwifi/iwl-shared.h
@@ -94,7 +94,6 @@
94 * This implementation is iwl-pci.c 94 * This implementation is iwl-pci.c
95 */ 95 */
96 96
97struct iwl_cfg;
98struct iwl_bus; 97struct iwl_bus;
99struct iwl_priv; 98struct iwl_priv;
100struct iwl_trans; 99struct iwl_trans;
@@ -304,6 +303,101 @@ struct iwl_notification_wait {
304}; 303};
305 304
306/** 305/**
306 * enum iwl_pa_type - Power Amplifier type
307 * @IWL_PA_SYSTEM: based on uCode configuration
308 * @IWL_PA_INTERNAL: use Internal only
309 */
310enum iwl_pa_type {
311 IWL_PA_SYSTEM = 0,
312 IWL_PA_INTERNAL = 1,
313};
314
315/*
316 * LED mode
317 * IWL_LED_DEFAULT: use device default
318 * IWL_LED_RF_STATE: turn LED on/off based on RF state
319 * LED ON = RF ON
320 * LED OFF = RF OFF
321 * IWL_LED_BLINK: adjust led blink rate based on blink table
322 */
323enum iwl_led_mode {
324 IWL_LED_DEFAULT,
325 IWL_LED_RF_STATE,
326 IWL_LED_BLINK,
327};
328
329/**
330 * struct iwl_cfg
331 * @name: Offical name of the device
332 * @fw_name_pre: Firmware filename prefix. The api version and extension
333 * (.ucode) will be added to filename before loading from disk. The
334 * filename is constructed as fw_name_pre<api>.ucode.
335 * @ucode_api_max: Highest version of uCode API supported by driver.
336 * @ucode_api_ok: oldest version of the uCode API that is OK to load
337 * without a warning, for use in transitions
338 * @ucode_api_min: Lowest version of uCode API supported by driver.
339 * @valid_tx_ant: valid transmit antenna
340 * @valid_rx_ant: valid receive antenna
341 * @sku: sku information from EEPROM
342 * @eeprom_ver: EEPROM version
343 * @eeprom_calib_ver: EEPROM calibration version
344 * @lib: pointer to the lib ops
345 * @additional_nic_config: additional nic configuration
346 * @base_params: pointer to basic parameters
347 * @ht_params: point to ht patameters
348 * @bt_params: pointer to bt parameters
349 * @pa_type: used by 6000 series only to identify the type of Power Amplifier
350 * @need_temp_offset_calib: need to perform temperature offset calibration
351 * @no_xtal_calib: some devices do not need crystal calibration data,
352 * don't send it to those
353 * @scan_rx_antennas: available antenna for scan operation
354 * @led_mode: 0=blinking, 1=On(RF On)/Off(RF Off)
355 * @adv_pm: advance power management
356 * @rx_with_siso_diversity: 1x1 device with rx antenna diversity
357 * @internal_wimax_coex: internal wifi/wimax combo device
358 * @iq_invert: I/Q inversion
359 * @temp_offset_v2: support v2 of temperature offset calibration
360 *
361 * We enable the driver to be backward compatible wrt API version. The
362 * driver specifies which APIs it supports (with @ucode_api_max being the
363 * highest and @ucode_api_min the lowest). Firmware will only be loaded if
364 * it has a supported API version.
365 *
366 * The ideal usage of this infrastructure is to treat a new ucode API
367 * release as a new hardware revision.
368 */
369struct iwl_cfg {
370 /* params specific to an individual device within a device family */
371 const char *name;
372 const char *fw_name_pre;
373 const unsigned int ucode_api_max;
374 const unsigned int ucode_api_ok;
375 const unsigned int ucode_api_min;
376 u8 valid_tx_ant;
377 u8 valid_rx_ant;
378 u16 sku;
379 u16 eeprom_ver;
380 u16 eeprom_calib_ver;
381 const struct iwl_lib_ops *lib;
382 void (*additional_nic_config)(struct iwl_priv *priv);
383 /* params not likely to change within a device family */
384 struct iwl_base_params *base_params;
385 /* params likely to change within a device family */
386 struct iwl_ht_params *ht_params;
387 struct iwl_bt_params *bt_params;
388 enum iwl_pa_type pa_type; /* if used set to IWL_PA_SYSTEM */
389 const bool need_temp_offset_calib; /* if used set to true */
390 const bool no_xtal_calib;
391 u8 scan_rx_antennas[IEEE80211_NUM_BANDS];
392 enum iwl_led_mode led_mode;
393 const bool adv_pm;
394 const bool rx_with_siso_diversity;
395 const bool internal_wimax_coex;
396 const bool iq_invert;
397 const bool temp_offset_v2;
398};
399
400/**
307 * struct iwl_shared - shared fields for all the layers of the driver 401 * struct iwl_shared - shared fields for all the layers of the driver
308 * 402 *
309 * @dbg_level_dev: dbg level set per device. Prevails on 403 * @dbg_level_dev: dbg level set per device. Prevails on
@@ -313,6 +407,7 @@ struct iwl_notification_wait {
313 * @status: STATUS_* 407 * @status: STATUS_*
314 * @valid_contexts: microcode/device supports multiple contexts 408 * @valid_contexts: microcode/device supports multiple contexts
315 * @bus: pointer to the bus layer data 409 * @bus: pointer to the bus layer data
410 * @cfg: see struct iwl_cfg
316 * @priv: pointer to the upper layer data 411 * @priv: pointer to the upper layer data
317 * @hw_params: see struct iwl_hw_params 412 * @hw_params: see struct iwl_hw_params
318 * @workqueue: the workqueue used by all the layers of the driver 413 * @workqueue: the workqueue used by all the layers of the driver
@@ -320,6 +415,7 @@ struct iwl_notification_wait {
320 * @sta_lock: protects the station table. 415 * @sta_lock: protects the station table.
321 * If lock and sta_lock are needed, lock must be acquired first. 416 * If lock and sta_lock are needed, lock must be acquired first.
322 * @mutex: 417 * @mutex:
418 * @eeprom: pointer to the eeprom/OTP image
323 * @ucode_type: indicator of loaded ucode image 419 * @ucode_type: indicator of loaded ucode image
324 * @notif_waits: things waiting for notification 420 * @notif_waits: things waiting for notification
325 * @notif_wait_lock: lock protecting notification 421 * @notif_wait_lock: lock protecting notification
@@ -340,6 +436,7 @@ struct iwl_shared {
340 u8 valid_contexts; 436 u8 valid_contexts;
341 437
342 struct iwl_bus *bus; 438 struct iwl_bus *bus;
439 struct iwl_cfg *cfg;
343 struct iwl_priv *priv; 440 struct iwl_priv *priv;
344 struct iwl_trans *trans; 441 struct iwl_trans *trans;
345 struct iwl_hw_params hw_params; 442 struct iwl_hw_params hw_params;
@@ -373,6 +470,7 @@ struct iwl_shared {
373 470
374/*Whatever _m is (iwl_trans, iwl_priv, iwl_bus, these macros will work */ 471/*Whatever _m is (iwl_trans, iwl_priv, iwl_bus, these macros will work */
375#define priv(_m) ((_m)->shrd->priv) 472#define priv(_m) ((_m)->shrd->priv)
473#define cfg(_m) ((_m)->shrd->cfg)
376#define bus(_m) ((_m)->shrd->bus) 474#define bus(_m) ((_m)->shrd->bus)
377#define trans(_m) ((_m)->shrd->trans) 475#define trans(_m) ((_m)->shrd->trans)
378#define hw_params(_m) ((_m)->shrd->hw_params) 476#define hw_params(_m) ((_m)->shrd->hw_params)
diff --git a/drivers/net/wireless/iwlwifi/iwl-testmode.c b/drivers/net/wireless/iwlwifi/iwl-testmode.c
index a874eb7b5f8e..0fb962e0b461 100644
--- a/drivers/net/wireless/iwlwifi/iwl-testmode.c
+++ b/drivers/net/wireless/iwlwifi/iwl-testmode.c
@@ -425,8 +425,8 @@ static int iwl_testmode_driver(struct ieee80211_hw *hw, struct nlattr **tb)
425 425
426 switch (nla_get_u32(tb[IWL_TM_ATTR_COMMAND])) { 426 switch (nla_get_u32(tb[IWL_TM_ATTR_COMMAND])) {
427 case IWL_TM_CMD_APP2DEV_GET_DEVICENAME: 427 case IWL_TM_CMD_APP2DEV_GET_DEVICENAME:
428 rsp_data_ptr = (unsigned char *)priv->cfg->name; 428 rsp_data_ptr = (unsigned char *)cfg(priv)->name;
429 rsp_data_len = strlen(priv->cfg->name); 429 rsp_data_len = strlen(cfg(priv)->name);
430 skb = cfg80211_testmode_alloc_reply_skb(hw->wiphy, 430 skb = cfg80211_testmode_alloc_reply_skb(hw->wiphy,
431 rsp_data_len + 20); 431 rsp_data_len + 20);
432 if (!skb) { 432 if (!skb) {
@@ -487,7 +487,7 @@ static int iwl_testmode_driver(struct ieee80211_hw *hw, struct nlattr **tb)
487 case IWL_TM_CMD_APP2DEV_GET_EEPROM: 487 case IWL_TM_CMD_APP2DEV_GET_EEPROM:
488 if (priv->shrd->eeprom) { 488 if (priv->shrd->eeprom) {
489 skb = cfg80211_testmode_alloc_reply_skb(hw->wiphy, 489 skb = cfg80211_testmode_alloc_reply_skb(hw->wiphy,
490 priv->cfg->base_params->eeprom_size + 20); 490 cfg(priv)->base_params->eeprom_size + 20);
491 if (!skb) { 491 if (!skb) {
492 IWL_DEBUG_INFO(priv, 492 IWL_DEBUG_INFO(priv,
493 "Error allocating memory\n"); 493 "Error allocating memory\n");
@@ -496,7 +496,7 @@ static int iwl_testmode_driver(struct ieee80211_hw *hw, struct nlattr **tb)
496 NLA_PUT_U32(skb, IWL_TM_ATTR_COMMAND, 496 NLA_PUT_U32(skb, IWL_TM_ATTR_COMMAND,
497 IWL_TM_CMD_DEV2APP_EEPROM_RSP); 497 IWL_TM_CMD_DEV2APP_EEPROM_RSP);
498 NLA_PUT(skb, IWL_TM_ATTR_EEPROM, 498 NLA_PUT(skb, IWL_TM_ATTR_EEPROM,
499 priv->cfg->base_params->eeprom_size, 499 cfg(priv)->base_params->eeprom_size,
500 priv->shrd->eeprom); 500 priv->shrd->eeprom);
501 status = cfg80211_testmode_reply(skb); 501 status = cfg80211_testmode_reply(skb);
502 if (status < 0) 502 if (status < 0)
diff --git a/drivers/net/wireless/iwlwifi/iwl-trans-pcie-rx.c b/drivers/net/wireless/iwlwifi/iwl-trans-pcie-rx.c
index 2ee00e0f39d3..791005d47836 100644
--- a/drivers/net/wireless/iwlwifi/iwl-trans-pcie-rx.c
+++ b/drivers/net/wireless/iwlwifi/iwl-trans-pcie-rx.c
@@ -672,7 +672,7 @@ static void iwl_irq_handle_error(struct iwl_trans *trans)
672{ 672{
673 struct iwl_priv *priv = priv(trans); 673 struct iwl_priv *priv = priv(trans);
674 /* W/A for WiFi/WiMAX coex and WiMAX own the RF */ 674 /* W/A for WiFi/WiMAX coex and WiMAX own the RF */
675 if (priv->cfg->internal_wimax_coex && 675 if (cfg(priv)->internal_wimax_coex &&
676 (!(iwl_read_prph(bus(trans), APMG_CLK_CTRL_REG) & 676 (!(iwl_read_prph(bus(trans), APMG_CLK_CTRL_REG) &
677 APMS_CLK_VAL_MRB_FUNC_MODE) || 677 APMS_CLK_VAL_MRB_FUNC_MODE) ||
678 (iwl_read_prph(bus(trans), APMG_PS_CTRL_REG) & 678 (iwl_read_prph(bus(trans), APMG_PS_CTRL_REG) &
diff --git a/drivers/net/wireless/iwlwifi/iwl-ucode.c b/drivers/net/wireless/iwlwifi/iwl-ucode.c
index 0577212ad3f3..5ed8217d2d96 100644
--- a/drivers/net/wireless/iwlwifi/iwl-ucode.c
+++ b/drivers/net/wireless/iwlwifi/iwl-ucode.c
@@ -320,8 +320,8 @@ int iwlagn_init_alive_start(struct iwl_priv *priv)
320{ 320{
321 int ret; 321 int ret;
322 322
323 if (priv->cfg->bt_params && 323 if (cfg(priv)->bt_params &&
324 priv->cfg->bt_params->advanced_bt_coexist) { 324 cfg(priv)->bt_params->advanced_bt_coexist) {
325 /* 325 /*
326 * Tell uCode we are ready to perform calibration 326 * Tell uCode we are ready to perform calibration
327 * need to perform this before any calibration 327 * need to perform this before any calibration
@@ -343,8 +343,8 @@ int iwlagn_init_alive_start(struct iwl_priv *priv)
343 * temperature offset calibration is only needed for runtime ucode, 343 * temperature offset calibration is only needed for runtime ucode,
344 * so prepare the value now. 344 * so prepare the value now.
345 */ 345 */
346 if (priv->cfg->need_temp_offset_calib) { 346 if (cfg(priv)->need_temp_offset_calib) {
347 if (priv->cfg->temp_offset_v2) 347 if (cfg(priv)->temp_offset_v2)
348 return iwl_set_temperature_offset_calib_v2(priv); 348 return iwl_set_temperature_offset_calib_v2(priv);
349 else 349 else
350 return iwl_set_temperature_offset_calib(priv); 350 return iwl_set_temperature_offset_calib(priv);
@@ -357,7 +357,7 @@ static int iwl_send_wimax_coex(struct iwl_priv *priv)
357{ 357{
358 struct iwl_wimax_coex_cmd coex_cmd; 358 struct iwl_wimax_coex_cmd coex_cmd;
359 359
360 if (priv->cfg->base_params->support_wimax_coexist) { 360 if (cfg(priv)->base_params->support_wimax_coexist) {
361 /* UnMask wake up src at associated sleep */ 361 /* UnMask wake up src at associated sleep */
362 coex_cmd.flags = COEX_FLAGS_ASSOC_WA_UNMASK_MSK; 362 coex_cmd.flags = COEX_FLAGS_ASSOC_WA_UNMASK_MSK;
363 363
@@ -453,7 +453,7 @@ static int iwl_alive_notify(struct iwl_priv *priv)
453 if (ret) 453 if (ret)
454 return ret; 454 return ret;
455 455
456 if (!priv->cfg->no_xtal_calib) { 456 if (!cfg(priv)->no_xtal_calib) {
457 ret = iwl_set_Xtal_calib(priv); 457 ret = iwl_set_Xtal_calib(priv);
458 if (ret) 458 if (ret)
459 return ret; 459 return ret;