aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi
diff options
context:
space:
mode:
authorEmmanuel Grumbach <emmanuel.grumbach@intel.com>2012-03-22 11:51:44 -0400
committerWey-Yi Guy <wey-yi.w.guy@intel.com>2012-04-18 10:29:59 -0400
commit2152268ff9119c16447f6bf6e61b02df796960fd (patch)
tree60c90431506a2dd20060fc8a1473ccc7839d65f2 /drivers/net/wireless/iwlwifi
parent68e8dfdadb424fd76ca81eeb399c3228adc5cea2 (diff)
iwlwifi: op_mode holds its pointer to the config
Instead of using the shared area that we be killed. Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@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-agn-calib.c8
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-devices.c8
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-lib.c18
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-rs.c8
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-rx.c2
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-rxon.c4
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-tt.c2
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-tx.c16
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn.c41
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn.h4
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-debugfs.c8
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-dev.h1
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-drv.c2
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-eeprom.c26
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-led.c8
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-mac80211.c6
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-op-mode.h1
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-power.c8
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-scan.c12
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-testmode.c8
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-ucode.c10
21 files changed, 102 insertions, 99 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-calib.c b/drivers/net/wireless/iwlwifi/iwl-agn-calib.c
index 61c243f7395f..b088f9b7434a 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-calib.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-calib.c
@@ -521,7 +521,7 @@ static int iwl_enhance_sensitivity_write(struct iwl_priv *priv)
521 521
522 iwl_prepare_legacy_sensitivity_tbl(priv, data, &cmd.enhance_table[0]); 522 iwl_prepare_legacy_sensitivity_tbl(priv, data, &cmd.enhance_table[0]);
523 523
524 if (cfg(priv)->base_params->hd_v2) { 524 if (priv->cfg->base_params->hd_v2) {
525 cmd.enhance_table[HD_INA_NON_SQUARE_DET_OFDM_INDEX] = 525 cmd.enhance_table[HD_INA_NON_SQUARE_DET_OFDM_INDEX] =
526 HD_INA_NON_SQUARE_DET_OFDM_DATA_V2; 526 HD_INA_NON_SQUARE_DET_OFDM_DATA_V2;
527 cmd.enhance_table[HD_INA_NON_SQUARE_DET_CCK_INDEX] = 527 cmd.enhance_table[HD_INA_NON_SQUARE_DET_CCK_INDEX] =
@@ -895,7 +895,7 @@ static void iwlagn_gain_computation(struct iwl_priv *priv,
895 continue; 895 continue;
896 } 896 }
897 897
898 delta_g = (cfg(priv)->base_params->chain_noise_scale * 898 delta_g = (priv->cfg->base_params->chain_noise_scale *
899 ((s32)average_noise[default_chain] - 899 ((s32)average_noise[default_chain] -
900 (s32)average_noise[i])) / 1500; 900 (s32)average_noise[i])) / 1500;
901 901
@@ -1051,8 +1051,8 @@ void iwl_chain_noise_calibration(struct iwl_priv *priv)
1051 return; 1051 return;
1052 1052
1053 /* Analyze signal for disconnected antenna */ 1053 /* Analyze signal for disconnected antenna */
1054 if (cfg(priv)->bt_params && 1054 if (priv->cfg->bt_params &&
1055 cfg(priv)->bt_params->advanced_bt_coexist) { 1055 priv->cfg->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 = priv->hw_params.valid_rx_ant; 1058 data->active_chains = priv->hw_params.valid_rx_ant;
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-devices.c b/drivers/net/wireless/iwlwifi/iwl-agn-devices.c
index ae4a21620c4f..d0700e02b6ed 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-devices.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-devices.c
@@ -175,7 +175,7 @@ static void iwl1000_hw_set_hw_params(struct iwl_priv *priv)
175 175
176 priv->hw_params.tx_chains_num = 176 priv->hw_params.tx_chains_num =
177 num_of_ant(priv->hw_params.valid_tx_ant); 177 num_of_ant(priv->hw_params.valid_tx_ant);
178 if (cfg(priv)->rx_with_siso_diversity) 178 if (priv->cfg->rx_with_siso_diversity)
179 priv->hw_params.rx_chains_num = 1; 179 priv->hw_params.rx_chains_num = 1;
180 else 180 else
181 priv->hw_params.rx_chains_num = 181 priv->hw_params.rx_chains_num =
@@ -256,7 +256,7 @@ static void iwl2000_hw_set_hw_params(struct iwl_priv *priv)
256 256
257 priv->hw_params.tx_chains_num = 257 priv->hw_params.tx_chains_num =
258 num_of_ant(priv->hw_params.valid_tx_ant); 258 num_of_ant(priv->hw_params.valid_tx_ant);
259 if (cfg(priv)->rx_with_siso_diversity) 259 if (priv->cfg->rx_with_siso_diversity)
260 priv->hw_params.rx_chains_num = 1; 260 priv->hw_params.rx_chains_num = 1;
261 else 261 else
262 priv->hw_params.rx_chains_num = 262 priv->hw_params.rx_chains_num =
@@ -573,7 +573,7 @@ static void iwl6000_nic_config(struct iwl_priv *priv)
573{ 573{
574 iwl_rf_config(priv); 574 iwl_rf_config(priv);
575 575
576 switch (cfg(priv)->device_family) { 576 switch (priv->cfg->device_family) {
577 case IWL_DEVICE_FAMILY_6005: 577 case IWL_DEVICE_FAMILY_6005:
578 case IWL_DEVICE_FAMILY_6030: 578 case IWL_DEVICE_FAMILY_6030:
579 case IWL_DEVICE_FAMILY_6000: 579 case IWL_DEVICE_FAMILY_6000:
@@ -633,7 +633,7 @@ static void iwl6000_hw_set_hw_params(struct iwl_priv *priv)
633 633
634 priv->hw_params.tx_chains_num = 634 priv->hw_params.tx_chains_num =
635 num_of_ant(priv->hw_params.valid_tx_ant); 635 num_of_ant(priv->hw_params.valid_tx_ant);
636 if (cfg(priv)->rx_with_siso_diversity) 636 if (priv->cfg->rx_with_siso_diversity)
637 priv->hw_params.rx_chains_num = 1; 637 priv->hw_params.rx_chains_num = 1;
638 else 638 else
639 priv->hw_params.rx_chains_num = 639 priv->hw_params.rx_chains_num =
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
index ab36344ee7c0..86a673306a58 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
@@ -312,21 +312,21 @@ void iwlagn_send_advance_bt_config(struct iwl_priv *priv)
312 BUILD_BUG_ON(sizeof(iwlagn_def_3w_lookup) != 312 BUILD_BUG_ON(sizeof(iwlagn_def_3w_lookup) !=
313 sizeof(basic.bt3_lookup_table)); 313 sizeof(basic.bt3_lookup_table));
314 314
315 if (cfg(priv)->bt_params) { 315 if (priv->cfg->bt_params) {
316 /* 316 /*
317 * newer generation of devices (2000 series and newer) 317 * newer generation of devices (2000 series and newer)
318 * use the version 2 of the bt command 318 * use the version 2 of the bt command
319 * we need to make sure sending the host command 319 * we need to make sure sending the host command
320 * with correct data structure to avoid uCode assert 320 * with correct data structure to avoid uCode assert
321 */ 321 */
322 if (cfg(priv)->bt_params->bt_session_2) { 322 if (priv->cfg->bt_params->bt_session_2) {
323 bt_cmd_v2.prio_boost = cpu_to_le32( 323 bt_cmd_v2.prio_boost = cpu_to_le32(
324 cfg(priv)->bt_params->bt_prio_boost); 324 priv->cfg->bt_params->bt_prio_boost);
325 bt_cmd_v2.tx_prio_boost = 0; 325 bt_cmd_v2.tx_prio_boost = 0;
326 bt_cmd_v2.rx_prio_boost = 0; 326 bt_cmd_v2.rx_prio_boost = 0;
327 } else { 327 } else {
328 bt_cmd_v1.prio_boost = 328 bt_cmd_v1.prio_boost =
329 cfg(priv)->bt_params->bt_prio_boost; 329 priv->cfg->bt_params->bt_prio_boost;
330 bt_cmd_v1.tx_prio_boost = 0; 330 bt_cmd_v1.tx_prio_boost = 0;
331 bt_cmd_v1.rx_prio_boost = 0; 331 bt_cmd_v1.rx_prio_boost = 0;
332 } 332 }
@@ -374,7 +374,7 @@ void iwlagn_send_advance_bt_config(struct iwl_priv *priv)
374 priv->bt_full_concurrent ? 374 priv->bt_full_concurrent ?
375 "full concurrency" : "3-wire"); 375 "full concurrency" : "3-wire");
376 376
377 if (cfg(priv)->bt_params->bt_session_2) { 377 if (priv->cfg->bt_params->bt_session_2) {
378 memcpy(&bt_cmd_v2.basic, &basic, 378 memcpy(&bt_cmd_v2.basic, &basic,
379 sizeof(basic)); 379 sizeof(basic));
380 ret = iwl_dvm_send_cmd_pdu(priv, REPLY_BT_CONFIG, 380 ret = iwl_dvm_send_cmd_pdu(priv, REPLY_BT_CONFIG,
@@ -740,8 +740,8 @@ static bool is_single_rx_stream(struct iwl_priv *priv)
740 */ 740 */
741static int iwl_get_active_rx_chain_count(struct iwl_priv *priv) 741static int iwl_get_active_rx_chain_count(struct iwl_priv *priv)
742{ 742{
743 if (cfg(priv)->bt_params && 743 if (priv->cfg->bt_params &&
744 cfg(priv)->bt_params->advanced_bt_coexist && 744 priv->cfg->bt_params->advanced_bt_coexist &&
745 (priv->bt_full_concurrent || 745 (priv->bt_full_concurrent ||
746 priv->bt_traffic_load >= IWL_BT_COEX_TRAFFIC_LOAD_HIGH)) { 746 priv->bt_traffic_load >= IWL_BT_COEX_TRAFFIC_LOAD_HIGH)) {
747 /* 747 /*
@@ -812,8 +812,8 @@ void iwlagn_set_rxon_chain(struct iwl_priv *priv, struct iwl_rxon_context *ctx)
812 else 812 else
813 active_chains = priv->hw_params.valid_rx_ant; 813 active_chains = priv->hw_params.valid_rx_ant;
814 814
815 if (cfg(priv)->bt_params && 815 if (priv->cfg->bt_params &&
816 cfg(priv)->bt_params->advanced_bt_coexist && 816 priv->cfg->bt_params->advanced_bt_coexist &&
817 (priv->bt_full_concurrent || 817 (priv->bt_full_concurrent ||
818 priv->bt_traffic_load >= IWL_BT_COEX_TRAFFIC_LOAD_HIGH)) { 818 priv->bt_traffic_load >= IWL_BT_COEX_TRAFFIC_LOAD_HIGH)) {
819 /* 819 /*
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
index 8b13b6cf940a..024a0dd8d892 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
@@ -1085,7 +1085,7 @@ done:
1085 (priv->tm_fixed_rate != lq_sta->dbg_fixed_rate)) 1085 (priv->tm_fixed_rate != lq_sta->dbg_fixed_rate))
1086 rs_program_fix_rate(priv, lq_sta); 1086 rs_program_fix_rate(priv, lq_sta);
1087#endif 1087#endif
1088 if (cfg(priv)->bt_params && cfg(priv)->bt_params->advanced_bt_coexist) 1088 if (priv->cfg->bt_params && priv->cfg->bt_params->advanced_bt_coexist)
1089 rs_bt_update_lq(priv, ctx, lq_sta); 1089 rs_bt_update_lq(priv, ctx, lq_sta);
1090} 1090}
1091 1091
@@ -3063,11 +3063,11 @@ static void rs_fill_link_cmd(struct iwl_priv *priv,
3063 * overwrite if needed, pass aggregation time limit 3063 * overwrite if needed, pass aggregation time limit
3064 * to uCode in uSec 3064 * to uCode in uSec
3065 */ 3065 */
3066 if (priv && cfg(priv)->bt_params && 3066 if (priv && priv->cfg->bt_params &&
3067 cfg(priv)->bt_params->agg_time_limit && 3067 priv->cfg->bt_params->agg_time_limit &&
3068 priv->bt_traffic_load >= IWL_BT_COEX_TRAFFIC_LOAD_HIGH) 3068 priv->bt_traffic_load >= IWL_BT_COEX_TRAFFIC_LOAD_HIGH)
3069 lq_cmd->agg_params.agg_time_limit = 3069 lq_cmd->agg_params.agg_time_limit =
3070 cpu_to_le16(cfg(priv)->bt_params->agg_time_limit); 3070 cpu_to_le16(priv->cfg->bt_params->agg_time_limit);
3071} 3071}
3072 3072
3073static void *rs_alloc(struct ieee80211_hw *hw, struct dentry *debugfsdir) 3073static 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 e321a294abde..9f647bdc608e 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-rx.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-rx.c
@@ -1105,7 +1105,7 @@ void iwl_setup_rx_handlers(struct iwl_priv *priv)
1105 iwl_notification_wait_init(&priv->notif_wait); 1105 iwl_notification_wait_init(&priv->notif_wait);
1106 1106
1107 /* Set up BT Rx handlers */ 1107 /* Set up BT Rx handlers */
1108 if (cfg(priv)->bt_params) 1108 if (priv->cfg->bt_params)
1109 iwlagn_bt_rx_handler_setup(priv); 1109 iwlagn_bt_rx_handler_setup(priv);
1110} 1110}
1111 1111
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c b/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c
index 5c7bddd5cfef..00055a0cc0ec 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c
@@ -531,9 +531,9 @@ static int iwlagn_rxon_connect(struct iwl_priv *priv,
531 } 531 }
532 532
533 if (ctx->vif && ctx->vif->type == NL80211_IFTYPE_STATION && 533 if (ctx->vif && ctx->vif->type == NL80211_IFTYPE_STATION &&
534 cfg(priv)->ht_params && cfg(priv)->ht_params->smps_mode) 534 priv->cfg->ht_params && priv->cfg->ht_params->smps_mode)
535 ieee80211_request_smps(ctx->vif, 535 ieee80211_request_smps(ctx->vif,
536 cfg(priv)->ht_params->smps_mode); 536 priv->cfg->ht_params->smps_mode);
537 537
538 return 0; 538 return 0;
539} 539}
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-tt.c b/drivers/net/wireless/iwlwifi/iwl-agn-tt.c
index 18276db5b72d..f6bf874656fa 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-tt.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-tt.c
@@ -632,7 +632,7 @@ void iwl_tt_initialize(struct iwl_priv *priv)
632 INIT_WORK(&priv->ct_enter, iwl_bg_ct_enter); 632 INIT_WORK(&priv->ct_enter, iwl_bg_ct_enter);
633 INIT_WORK(&priv->ct_exit, iwl_bg_ct_exit); 633 INIT_WORK(&priv->ct_exit, iwl_bg_ct_exit);
634 634
635 if (cfg(priv)->base_params->adv_thermal_throttle) { 635 if (priv->cfg->base_params->adv_thermal_throttle) {
636 IWL_DEBUG_TEMP(priv, "Advanced Thermal Throttling\n"); 636 IWL_DEBUG_TEMP(priv, "Advanced Thermal Throttling\n");
637 tt->restriction = kcalloc(IWL_TI_STATE_MAX, 637 tt->restriction = kcalloc(IWL_TI_STATE_MAX,
638 sizeof(struct iwl_tt_restriction), 638 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 f6041ca63af8..76fea8f5f9c9 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
@@ -85,8 +85,8 @@ static void iwlagn_tx_cmd_build_basic(struct iwl_priv *priv,
85 else if (ieee80211_is_back_req(fc)) 85 else if (ieee80211_is_back_req(fc))
86 tx_flags |= TX_CMD_FLG_ACK_MSK | TX_CMD_FLG_IMM_BA_RSP_MASK; 86 tx_flags |= TX_CMD_FLG_ACK_MSK | TX_CMD_FLG_IMM_BA_RSP_MASK;
87 else if (info->band == IEEE80211_BAND_2GHZ && 87 else if (info->band == IEEE80211_BAND_2GHZ &&
88 cfg(priv)->bt_params && 88 priv->cfg->bt_params &&
89 cfg(priv)->bt_params->advanced_bt_coexist && 89 priv->cfg->bt_params->advanced_bt_coexist &&
90 (ieee80211_is_auth(fc) || ieee80211_is_assoc_req(fc) || 90 (ieee80211_is_auth(fc) || ieee80211_is_assoc_req(fc) ||
91 ieee80211_is_reassoc_req(fc) || 91 ieee80211_is_reassoc_req(fc) ||
92 skb->protocol == cpu_to_be16(ETH_P_PAE))) 92 skb->protocol == cpu_to_be16(ETH_P_PAE)))
@@ -203,8 +203,8 @@ static void iwlagn_tx_cmd_build_rate(struct iwl_priv *priv,
203 rate_flags |= RATE_MCS_CCK_MSK; 203 rate_flags |= RATE_MCS_CCK_MSK;
204 204
205 /* Set up antennas */ 205 /* Set up antennas */
206 if (cfg(priv)->bt_params && 206 if (priv->cfg->bt_params &&
207 cfg(priv)->bt_params->advanced_bt_coexist && 207 priv->cfg->bt_params->advanced_bt_coexist &&
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,
@@ -501,7 +501,7 @@ static int iwlagn_alloc_agg_txq(struct iwl_priv *priv, int ac)
501 int q; 501 int q;
502 502
503 for (q = IWLAGN_FIRST_AMPDU_QUEUE; 503 for (q = IWLAGN_FIRST_AMPDU_QUEUE;
504 q < cfg(priv)->base_params->num_of_queues; q++) { 504 q < priv->cfg->base_params->num_of_queues; q++) {
505 if (!test_and_set_bit(q, priv->agg_q_alloc)) { 505 if (!test_and_set_bit(q, priv->agg_q_alloc)) {
506 priv->queue_to_ac[q] = ac; 506 priv->queue_to_ac[q] = ac;
507 return q; 507 return q;
@@ -909,8 +909,8 @@ static void iwl_rx_reply_tx_agg(struct iwl_priv *priv,
909 * notification again. 909 * notification again.
910 */ 910 */
911 if (tx_resp->bt_kill_count && tx_resp->frame_count == 1 && 911 if (tx_resp->bt_kill_count && tx_resp->frame_count == 1 &&
912 cfg(priv)->bt_params && 912 priv->cfg->bt_params &&
913 cfg(priv)->bt_params->advanced_bt_coexist) { 913 priv->cfg->bt_params->advanced_bt_coexist) {
914 IWL_DEBUG_COEX(priv, "receive reply tx w/ bt_kill\n"); 914 IWL_DEBUG_COEX(priv, "receive reply tx w/ bt_kill\n");
915 } 915 }
916 916
@@ -1249,7 +1249,7 @@ int iwlagn_rx_reply_compressed_ba(struct iwl_priv *priv,
1249 * (in Tx queue's circular buffer) of first TFD/frame in window */ 1249 * (in Tx queue's circular buffer) of first TFD/frame in window */
1250 u16 ba_resp_scd_ssn = le16_to_cpu(ba_resp->scd_ssn); 1250 u16 ba_resp_scd_ssn = le16_to_cpu(ba_resp->scd_ssn);
1251 1251
1252 if (scd_flow >= cfg(priv)->base_params->num_of_queues) { 1252 if (scd_flow >= priv->cfg->base_params->num_of_queues) {
1253 IWL_ERR(priv, 1253 IWL_ERR(priv,
1254 "BUG_ON scd_flow is bigger than number of queues\n"); 1254 "BUG_ON scd_flow is bigger than number of queues\n");
1255 return 0; 1255 return 0;
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index 81c1cd7fdc9e..6771b6dd250b 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -674,7 +674,7 @@ void iwl_rf_kill_ct_config(struct iwl_priv *priv)
674 674
675 priv->thermal_throttle.ct_kill_toggle = false; 675 priv->thermal_throttle.ct_kill_toggle = false;
676 676
677 if (cfg(priv)->base_params->support_ct_kill_exit) { 677 if (priv->cfg->base_params->support_ct_kill_exit) {
678 adv_cmd.critical_temperature_enter = 678 adv_cmd.critical_temperature_enter =
679 cpu_to_le32(priv->hw_params.ct_kill_threshold); 679 cpu_to_le32(priv->hw_params.ct_kill_threshold);
680 adv_cmd.critical_temperature_exit = 680 adv_cmd.critical_temperature_exit =
@@ -791,10 +791,10 @@ int iwl_alive_start(struct iwl_priv *priv)
791 } 791 }
792 792
793 /* download priority table before any calibration request */ 793 /* download priority table before any calibration request */
794 if (cfg(priv)->bt_params && 794 if (priv->cfg->bt_params &&
795 cfg(priv)->bt_params->advanced_bt_coexist) { 795 priv->cfg->bt_params->advanced_bt_coexist) {
796 /* Configure Bluetooth device coexistence support */ 796 /* Configure Bluetooth device coexistence support */
797 if (cfg(priv)->bt_params->bt_sco_disable) 797 if (priv->cfg->bt_params->bt_sco_disable)
798 priv->bt_enable_pspoll = false; 798 priv->bt_enable_pspoll = false;
799 else 799 else
800 priv->bt_enable_pspoll = true; 800 priv->bt_enable_pspoll = true;
@@ -931,9 +931,9 @@ void iwl_down(struct iwl_priv *priv)
931 priv->bt_status = 0; 931 priv->bt_status = 0;
932 priv->cur_rssi_ctx = NULL; 932 priv->cur_rssi_ctx = NULL;
933 priv->bt_is_sco = 0; 933 priv->bt_is_sco = 0;
934 if (cfg(priv)->bt_params) 934 if (priv->cfg->bt_params)
935 priv->bt_traffic_load = 935 priv->bt_traffic_load =
936 cfg(priv)->bt_params->bt_init_traffic_load; 936 priv->cfg->bt_params->bt_init_traffic_load;
937 else 937 else
938 priv->bt_traffic_load = 0; 938 priv->bt_traffic_load = 0;
939 priv->bt_full_concurrent = false; 939 priv->bt_full_concurrent = false;
@@ -1114,7 +1114,7 @@ void iwl_setup_deferred_work(struct iwl_priv *priv)
1114 1114
1115 iwl_setup_scan_deferred_work(priv); 1115 iwl_setup_scan_deferred_work(priv);
1116 1116
1117 if (cfg(priv)->bt_params) 1117 if (priv->cfg->bt_params)
1118 iwlagn_bt_setup_deferred_work(priv); 1118 iwlagn_bt_setup_deferred_work(priv);
1119 1119
1120 init_timer(&priv->statistics_periodic); 1120 init_timer(&priv->statistics_periodic);
@@ -1128,7 +1128,7 @@ void iwl_setup_deferred_work(struct iwl_priv *priv)
1128 1128
1129void iwl_cancel_deferred_work(struct iwl_priv *priv) 1129void iwl_cancel_deferred_work(struct iwl_priv *priv)
1130{ 1130{
1131 if (cfg(priv)->bt_params) 1131 if (priv->cfg->bt_params)
1132 iwlagn_bt_cancel_deferred_work(priv); 1132 iwlagn_bt_cancel_deferred_work(priv);
1133 1133
1134 cancel_work_sync(&priv->run_time_calib_work); 1134 cancel_work_sync(&priv->run_time_calib_work);
@@ -1179,8 +1179,8 @@ static void iwl_init_ht_hw_capab(const struct iwl_priv *priv,
1179 1179
1180 ht_info->ht_supported = true; 1180 ht_info->ht_supported = true;
1181 1181
1182 if (cfg(priv)->ht_params && 1182 if (priv->cfg->ht_params &&
1183 cfg(priv)->ht_params->ht_greenfield_support) 1183 priv->cfg->ht_params->ht_greenfield_support)
1184 ht_info->cap |= IEEE80211_HT_CAP_GRN_FLD; 1184 ht_info->cap |= IEEE80211_HT_CAP_GRN_FLD;
1185 ht_info->cap |= IEEE80211_HT_CAP_SGI_20; 1185 ht_info->cap |= IEEE80211_HT_CAP_SGI_20;
1186 max_bit_rate = MAX_BIT_RATE_20_MHZ; 1186 max_bit_rate = MAX_BIT_RATE_20_MHZ;
@@ -1362,7 +1362,7 @@ int iwl_init_drv(struct iwl_priv *priv)
1362 priv->band = IEEE80211_BAND_2GHZ; 1362 priv->band = IEEE80211_BAND_2GHZ;
1363 1363
1364 priv->plcp_delta_threshold = 1364 priv->plcp_delta_threshold =
1365 cfg(priv)->base_params->plcp_delta_threshold; 1365 priv->cfg->base_params->plcp_delta_threshold;
1366 1366
1367 priv->iw_mode = NL80211_IFTYPE_STATION; 1367 priv->iw_mode = NL80211_IFTYPE_STATION;
1368 priv->current_ht_config.smps = IEEE80211_SMPS_STATIC; 1368 priv->current_ht_config.smps = IEEE80211_SMPS_STATIC;
@@ -1379,8 +1379,8 @@ int iwl_init_drv(struct iwl_priv *priv)
1379 iwl_init_scan_params(priv); 1379 iwl_init_scan_params(priv);
1380 1380
1381 /* init bt coex */ 1381 /* init bt coex */
1382 if (cfg(priv)->bt_params && 1382 if (priv->cfg->bt_params &&
1383 cfg(priv)->bt_params->advanced_bt_coexist) { 1383 priv->cfg->bt_params->advanced_bt_coexist) {
1384 priv->kill_ack_mask = IWLAGN_BT_KILL_ACK_MASK_DEFAULT; 1384 priv->kill_ack_mask = IWLAGN_BT_KILL_ACK_MASK_DEFAULT;
1385 priv->kill_cts_mask = IWLAGN_BT_KILL_CTS_MASK_DEFAULT; 1385 priv->kill_cts_mask = IWLAGN_BT_KILL_CTS_MASK_DEFAULT;
1386 priv->bt_valid = IWLAGN_BT_ALL_VALID_MSK; 1386 priv->bt_valid = IWLAGN_BT_ALL_VALID_MSK;
@@ -1425,9 +1425,9 @@ void iwl_uninit_drv(struct iwl_priv *priv)
1425 1425
1426void iwl_set_hw_params(struct iwl_priv *priv) 1426void iwl_set_hw_params(struct iwl_priv *priv)
1427{ 1427{
1428 if (cfg(priv)->ht_params) 1428 if (priv->cfg->ht_params)
1429 priv->hw_params.use_rts_for_aggregation = 1429 priv->hw_params.use_rts_for_aggregation =
1430 cfg(priv)->ht_params->use_rts_for_aggregation; 1430 priv->cfg->ht_params->use_rts_for_aggregation;
1431 1431
1432 if (iwlagn_mod_params.disable_11n & IWL_DISABLE_HT_ALL) 1432 if (iwlagn_mod_params.disable_11n & IWL_DISABLE_HT_ALL)
1433 priv->hw_params.sku &= ~EEPROM_SKU_CAP_11N_ENABLE; 1433 priv->hw_params.sku &= ~EEPROM_SKU_CAP_11N_ENABLE;
@@ -1474,6 +1474,7 @@ void iwl_debug_config(struct iwl_priv *priv)
1474} 1474}
1475 1475
1476static struct iwl_op_mode *iwl_op_mode_dvm_start(struct iwl_trans *trans, 1476static struct iwl_op_mode *iwl_op_mode_dvm_start(struct iwl_trans *trans,
1477 const struct iwl_cfg *cfg,
1477 const struct iwl_fw *fw) 1478 const struct iwl_fw *fw)
1478{ 1479{
1479 struct iwl_priv *priv; 1480 struct iwl_priv *priv;
@@ -1499,8 +1500,7 @@ static struct iwl_op_mode *iwl_op_mode_dvm_start(struct iwl_trans *trans,
1499 ************************/ 1500 ************************/
1500 hw = iwl_alloc_all(); 1501 hw = iwl_alloc_all();
1501 if (!hw) { 1502 if (!hw) {
1502 pr_err("%s: Cannot allocate network device\n", 1503 pr_err("%s: Cannot allocate network device\n", cfg->name);
1503 cfg(trans)->name);
1504 goto out; 1504 goto out;
1505 } 1505 }
1506 1506
@@ -1509,9 +1509,10 @@ static struct iwl_op_mode *iwl_op_mode_dvm_start(struct iwl_trans *trans,
1509 priv = IWL_OP_MODE_GET_DVM(op_mode); 1509 priv = IWL_OP_MODE_GET_DVM(op_mode);
1510 priv->shrd = trans->shrd; 1510 priv->shrd = trans->shrd;
1511 priv->trans = trans; 1511 priv->trans = trans;
1512 priv->cfg = cfg;
1512 priv->fw = fw; 1513 priv->fw = fw;
1513 1514
1514 switch (cfg(priv)->device_family) { 1515 switch (priv->cfg->device_family) {
1515 case IWL_DEVICE_FAMILY_1000: 1516 case IWL_DEVICE_FAMILY_1000:
1516 case IWL_DEVICE_FAMILY_100: 1517 case IWL_DEVICE_FAMILY_100:
1517 priv->lib = &iwl1000_lib; 1518 priv->lib = &iwl1000_lib;
@@ -1557,7 +1558,7 @@ static struct iwl_op_mode *iwl_op_mode_dvm_start(struct iwl_trans *trans,
1557 trans_cfg.rx_buf_size_8k = iwlagn_mod_params.amsdu_size_8K; 1558 trans_cfg.rx_buf_size_8k = iwlagn_mod_params.amsdu_size_8K;
1558 if (!iwlagn_mod_params.wd_disable) 1559 if (!iwlagn_mod_params.wd_disable)
1559 trans_cfg.queue_watchdog_timeout = 1560 trans_cfg.queue_watchdog_timeout =
1560 cfg(priv)->base_params->wd_timeout; 1561 priv->cfg->base_params->wd_timeout;
1561 else 1562 else
1562 trans_cfg.queue_watchdog_timeout = IWL_WATCHHDOG_DISABLED; 1563 trans_cfg.queue_watchdog_timeout = IWL_WATCHHDOG_DISABLED;
1563 trans_cfg.command_names = iwl_dvm_cmd_strings; 1564 trans_cfg.command_names = iwl_dvm_cmd_strings;
@@ -1622,7 +1623,7 @@ static struct iwl_op_mode *iwl_op_mode_dvm_start(struct iwl_trans *trans,
1622 * 2. Read REV register 1623 * 2. Read REV register
1623 ***********************/ 1624 ***********************/
1624 IWL_INFO(priv, "Detected %s, REV=0x%X\n", 1625 IWL_INFO(priv, "Detected %s, REV=0x%X\n",
1625 cfg(priv)->name, priv->trans->hw_rev); 1626 priv->cfg->name, priv->trans->hw_rev);
1626 1627
1627 if (iwl_trans_start_hw(priv->trans)) 1628 if (iwl_trans_start_hw(priv->trans))
1628 goto out_free_traffic_mem; 1629 goto out_free_traffic_mem;
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.h b/drivers/net/wireless/iwlwifi/iwl-agn.h
index e4c0a94e189e..8a09d0c219f4 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.h
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.h
@@ -279,8 +279,8 @@ void iwlagn_bt_adjust_rssi_monitor(struct iwl_priv *priv, bool rssi_ena);
279 279
280static inline bool iwl_advanced_bt_coexist(struct iwl_priv *priv) 280static inline bool iwl_advanced_bt_coexist(struct iwl_priv *priv)
281{ 281{
282 return cfg(priv)->bt_params && 282 return priv->cfg->bt_params &&
283 cfg(priv)->bt_params->advanced_bt_coexist; 283 priv->cfg->bt_params->advanced_bt_coexist;
284} 284}
285 285
286#ifdef CONFIG_IWLWIFI_DEBUG 286#ifdef CONFIG_IWLWIFI_DEBUG
diff --git a/drivers/net/wireless/iwlwifi/iwl-debugfs.c b/drivers/net/wireless/iwlwifi/iwl-debugfs.c
index a1d155a9d89a..70c24f5955c8 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 = cfg(priv)->base_params->eeprom_size; 411 size_t eeprom_len = priv->cfg->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) {
@@ -829,7 +829,7 @@ static ssize_t iwl_dbgfs_traffic_log_read(struct file *file,
829 829
830 char *buf; 830 char *buf;
831 int bufsz = ((IWL_TRAFFIC_ENTRIES * IWL_TRAFFIC_ENTRY_SIZE * 64) * 2) + 831 int bufsz = ((IWL_TRAFFIC_ENTRIES * IWL_TRAFFIC_ENTRY_SIZE * 64) * 2) +
832 (cfg(priv)->base_params->num_of_queues * 32 * 8) + 400; 832 (priv->cfg->base_params->num_of_queues * 32 * 8) + 400;
833 const u8 *ptr; 833 const u8 *ptr;
834 ssize_t ret; 834 ssize_t ret;
835 835
@@ -2380,7 +2380,7 @@ static ssize_t iwl_dbgfs_protection_mode_read(struct file *file,
2380 char buf[40]; 2380 char buf[40];
2381 const size_t bufsz = sizeof(buf); 2381 const size_t bufsz = sizeof(buf);
2382 2382
2383 if (cfg(priv)->ht_params) 2383 if (priv->cfg->ht_params)
2384 pos += scnprintf(buf + pos, bufsz - pos, 2384 pos += scnprintf(buf + pos, bufsz - pos,
2385 "use %s for aggregation\n", 2385 "use %s for aggregation\n",
2386 (priv->hw_params.use_rts_for_aggregation) ? 2386 (priv->hw_params.use_rts_for_aggregation) ?
@@ -2400,7 +2400,7 @@ static ssize_t iwl_dbgfs_protection_mode_write(struct file *file,
2400 int buf_size; 2400 int buf_size;
2401 int rts; 2401 int rts;
2402 2402
2403 if (!cfg(priv)->ht_params) 2403 if (!priv->cfg->ht_params)
2404 return -EINVAL; 2404 return -EINVAL;
2405 2405
2406 memset(buf, 0, sizeof(buf)); 2406 memset(buf, 0, sizeof(buf));
diff --git a/drivers/net/wireless/iwlwifi/iwl-dev.h b/drivers/net/wireless/iwlwifi/iwl-dev.h
index faf54c434506..33d5878314d8 100644
--- a/drivers/net/wireless/iwlwifi/iwl-dev.h
+++ b/drivers/net/wireless/iwlwifi/iwl-dev.h
@@ -761,6 +761,7 @@ struct iwl_priv {
761 /*data shared among all the driver's layers */ 761 /*data shared among all the driver's layers */
762 struct iwl_shared *shrd; 762 struct iwl_shared *shrd;
763 struct iwl_trans *trans; 763 struct iwl_trans *trans;
764 const struct iwl_cfg *cfg;
764 const struct iwl_fw *fw; 765 const struct iwl_fw *fw;
765 const struct iwl_lib_ops *lib; 766 const struct iwl_lib_ops *lib;
766 unsigned long status; 767 unsigned long status;
diff --git a/drivers/net/wireless/iwlwifi/iwl-drv.c b/drivers/net/wireless/iwlwifi/iwl-drv.c
index 8e296213938d..72d0818cfc98 100644
--- a/drivers/net/wireless/iwlwifi/iwl-drv.c
+++ b/drivers/net/wireless/iwlwifi/iwl-drv.c
@@ -859,7 +859,7 @@ static void iwl_ucode_callback(const struct firmware *ucode_raw, void *context)
859 release_firmware(ucode_raw); 859 release_firmware(ucode_raw);
860 complete(&drv->request_firmware_complete); 860 complete(&drv->request_firmware_complete);
861 861
862 drv->op_mode = iwl_dvm_ops.start(drv->trans, &drv->fw); 862 drv->op_mode = iwl_dvm_ops.start(drv->trans, cfg, &drv->fw);
863 863
864 if (!drv->op_mode) 864 if (!drv->op_mode)
865 goto out_unbind; 865 goto out_unbind;
diff --git a/drivers/net/wireless/iwlwifi/iwl-eeprom.c b/drivers/net/wireless/iwlwifi/iwl-eeprom.c
index 622a8f33d178..593485b4f3d8 100644
--- a/drivers/net/wireless/iwlwifi/iwl-eeprom.c
+++ b/drivers/net/wireless/iwlwifi/iwl-eeprom.c
@@ -236,8 +236,8 @@ int iwl_eeprom_check_version(struct iwl_priv *priv)
236 eeprom_ver = iwl_eeprom_query16(priv, EEPROM_VERSION); 236 eeprom_ver = iwl_eeprom_query16(priv, EEPROM_VERSION);
237 calib_ver = iwl_eeprom_calib_version(priv); 237 calib_ver = iwl_eeprom_calib_version(priv);
238 238
239 if (eeprom_ver < cfg(priv)->eeprom_ver || 239 if (eeprom_ver < priv->cfg->eeprom_ver ||
240 calib_ver < cfg(priv)->eeprom_calib_ver) 240 calib_ver < priv->cfg->eeprom_calib_ver)
241 goto err; 241 goto err;
242 242
243 IWL_INFO(priv, "device EEPROM VER=0x%x, CALIB=0x%x\n", 243 IWL_INFO(priv, "device EEPROM VER=0x%x, CALIB=0x%x\n",
@@ -247,8 +247,8 @@ int iwl_eeprom_check_version(struct iwl_priv *priv)
247err: 247err:
248 IWL_ERR(priv, "Unsupported (too old) EEPROM VER=0x%x < 0x%x " 248 IWL_ERR(priv, "Unsupported (too old) EEPROM VER=0x%x < 0x%x "
249 "CALIB=0x%x < 0x%x\n", 249 "CALIB=0x%x < 0x%x\n",
250 eeprom_ver, cfg(priv)->eeprom_ver, 250 eeprom_ver, priv->cfg->eeprom_ver,
251 calib_ver, cfg(priv)->eeprom_calib_ver); 251 calib_ver, priv->cfg->eeprom_calib_ver);
252 return -EINVAL; 252 return -EINVAL;
253 253
254} 254}
@@ -259,7 +259,7 @@ int iwl_eeprom_init_hw_params(struct iwl_priv *priv)
259 259
260 priv->hw_params.sku = iwl_eeprom_query16(priv, EEPROM_SKU_CAP); 260 priv->hw_params.sku = iwl_eeprom_query16(priv, EEPROM_SKU_CAP);
261 if (priv->hw_params.sku & EEPROM_SKU_CAP_11N_ENABLE && 261 if (priv->hw_params.sku & EEPROM_SKU_CAP_11N_ENABLE &&
262 !cfg(priv)->ht_params) { 262 !priv->cfg->ht_params) {
263 IWL_ERR(priv, "Invalid 11n configuration\n"); 263 IWL_ERR(priv, "Invalid 11n configuration\n");
264 return -EINVAL; 264 return -EINVAL;
265 } 265 }
@@ -277,10 +277,10 @@ int iwl_eeprom_init_hw_params(struct iwl_priv *priv)
277 priv->hw_params.valid_rx_ant = EEPROM_RF_CFG_RX_ANT_MSK(radio_cfg); 277 priv->hw_params.valid_rx_ant = EEPROM_RF_CFG_RX_ANT_MSK(radio_cfg);
278 278
279 /* check overrides (some devices have wrong EEPROM) */ 279 /* check overrides (some devices have wrong EEPROM) */
280 if (cfg(priv)->valid_tx_ant) 280 if (priv->cfg->valid_tx_ant)
281 priv->hw_params.valid_tx_ant = cfg(priv)->valid_tx_ant; 281 priv->hw_params.valid_tx_ant = priv->cfg->valid_tx_ant;
282 if (cfg(priv)->valid_rx_ant) 282 if (priv->cfg->valid_rx_ant)
283 priv->hw_params.valid_rx_ant = cfg(priv)->valid_rx_ant; 283 priv->hw_params.valid_rx_ant = priv->cfg->valid_rx_ant;
284 284
285 if (!priv->hw_params.valid_tx_ant || !priv->hw_params.valid_rx_ant) { 285 if (!priv->hw_params.valid_tx_ant || !priv->hw_params.valid_rx_ant) {
286 IWL_ERR(priv, "Invalid chain (0x%X, 0x%X)\n", 286 IWL_ERR(priv, "Invalid chain (0x%X, 0x%X)\n",
@@ -349,7 +349,7 @@ static u32 eeprom_indirect_address(struct iwl_priv *priv, u32 address)
349const u8 *iwl_eeprom_query_addr(struct iwl_priv *priv, size_t offset) 349const u8 *iwl_eeprom_query_addr(struct iwl_priv *priv, size_t offset)
350{ 350{
351 u32 address = eeprom_indirect_address(priv, offset); 351 u32 address = eeprom_indirect_address(priv, offset);
352 BUG_ON(address >= cfg(priv)->base_params->eeprom_size); 352 BUG_ON(address >= priv->cfg->base_params->eeprom_size);
353 return &priv->eeprom[address]; 353 return &priv->eeprom[address];
354} 354}
355 355
@@ -693,7 +693,7 @@ static void iwl_eeprom_enhanced_txpower(struct iwl_priv *priv)
693 ((txp->delta_20_in_40 & 0xf0) >> 4), 693 ((txp->delta_20_in_40 & 0xf0) >> 4),
694 (txp->delta_20_in_40 & 0x0f)); 694 (txp->delta_20_in_40 & 0x0f));
695 695
696 max_txp_avg = iwl_get_max_txpower_avg(cfg(priv), txp_array, idx, 696 max_txp_avg = iwl_get_max_txpower_avg(priv->cfg, txp_array, idx,
697 &max_txp_avg_halfdbm); 697 &max_txp_avg_halfdbm);
698 698
699 /* 699 /*
@@ -730,7 +730,7 @@ int iwl_eeprom_init(struct iwl_priv *priv, u32 hw_rev)
730 if (priv->nvm_device_type == -ENOENT) 730 if (priv->nvm_device_type == -ENOENT)
731 return -ENOENT; 731 return -ENOENT;
732 /* allocate eeprom */ 732 /* allocate eeprom */
733 sz = cfg(priv)->base_params->eeprom_size; 733 sz = priv->cfg->base_params->eeprom_size;
734 IWL_DEBUG_EEPROM(priv, "NVM size = %d\n", sz); 734 IWL_DEBUG_EEPROM(priv, "NVM size = %d\n", sz);
735 priv->eeprom = kzalloc(sz, GFP_KERNEL); 735 priv->eeprom = kzalloc(sz, GFP_KERNEL);
736 if (!priv->eeprom) { 736 if (!priv->eeprom) {
@@ -770,7 +770,7 @@ int iwl_eeprom_init(struct iwl_priv *priv, u32 hw_rev)
770 CSR_OTP_GP_REG_ECC_CORR_STATUS_MSK | 770 CSR_OTP_GP_REG_ECC_CORR_STATUS_MSK |
771 CSR_OTP_GP_REG_ECC_UNCORR_STATUS_MSK); 771 CSR_OTP_GP_REG_ECC_UNCORR_STATUS_MSK);
772 /* traversing the linked list if no shadow ram supported */ 772 /* traversing the linked list if no shadow ram supported */
773 if (!cfg(priv)->base_params->shadow_ram_support) { 773 if (!priv->cfg->base_params->shadow_ram_support) {
774 if (iwl_find_otp_image(priv->trans, &validblockaddr)) { 774 if (iwl_find_otp_image(priv->trans, &validblockaddr)) {
775 ret = -ENOENT; 775 ret = -ENOENT;
776 goto done; 776 goto done;
diff --git a/drivers/net/wireless/iwlwifi/iwl-led.c b/drivers/net/wireless/iwlwifi/iwl-led.c
index 18e6a36eff4f..d57063e4937e 100644
--- a/drivers/net/wireless/iwlwifi/iwl-led.c
+++ b/drivers/net/wireless/iwlwifi/iwl-led.c
@@ -138,11 +138,11 @@ static int iwl_led_cmd(struct iwl_priv *priv,
138 } 138 }
139 139
140 IWL_DEBUG_LED(priv, "Led blink time compensation=%u\n", 140 IWL_DEBUG_LED(priv, "Led blink time compensation=%u\n",
141 cfg(priv)->base_params->led_compensation); 141 priv->cfg->base_params->led_compensation);
142 led_cmd.on = iwl_blink_compensation(priv, on, 142 led_cmd.on = iwl_blink_compensation(priv, on,
143 cfg(priv)->base_params->led_compensation); 143 priv->cfg->base_params->led_compensation);
144 led_cmd.off = iwl_blink_compensation(priv, off, 144 led_cmd.off = iwl_blink_compensation(priv, off,
145 cfg(priv)->base_params->led_compensation); 145 priv->cfg->base_params->led_compensation);
146 146
147 ret = iwl_send_led_cmd(priv, &led_cmd); 147 ret = iwl_send_led_cmd(priv, &led_cmd);
148 if (!ret) { 148 if (!ret) {
@@ -183,7 +183,7 @@ void iwl_leds_init(struct iwl_priv *priv)
183 return; 183 return;
184 } 184 }
185 if (mode == IWL_LED_DEFAULT) 185 if (mode == IWL_LED_DEFAULT)
186 mode = cfg(priv)->led_mode; 186 mode = priv->cfg->led_mode;
187 187
188 priv->led.name = kasprintf(GFP_KERNEL, "%s-led", 188 priv->led.name = kasprintf(GFP_KERNEL, "%s-led",
189 wiphy_name(priv->hw->wiphy)); 189 wiphy_name(priv->hw->wiphy));
diff --git a/drivers/net/wireless/iwlwifi/iwl-mac80211.c b/drivers/net/wireless/iwlwifi/iwl-mac80211.c
index 20388ec8f9db..293110bf8bfe 100644
--- a/drivers/net/wireless/iwlwifi/iwl-mac80211.c
+++ b/drivers/net/wireless/iwlwifi/iwl-mac80211.c
@@ -1130,8 +1130,8 @@ void iwlagn_mac_rssi_callback(struct ieee80211_hw *hw,
1130 IWL_DEBUG_MAC80211(priv, "enter\n"); 1130 IWL_DEBUG_MAC80211(priv, "enter\n");
1131 mutex_lock(&priv->mutex); 1131 mutex_lock(&priv->mutex);
1132 1132
1133 if (cfg(priv)->bt_params && 1133 if (priv->cfg->bt_params &&
1134 cfg(priv)->bt_params->advanced_bt_coexist) { 1134 priv->cfg->bt_params->advanced_bt_coexist) {
1135 if (rssi_event == RSSI_EVENT_LOW) 1135 if (rssi_event == RSSI_EVENT_LOW)
1136 priv->bt_enable_pspoll = true; 1136 priv->bt_enable_pspoll = true;
1137 else if (rssi_event == RSSI_EVENT_HIGH) 1137 else if (rssi_event == RSSI_EVENT_HIGH)
@@ -1240,7 +1240,7 @@ int iwl_setup_interface(struct iwl_priv *priv, struct iwl_rxon_context *ctx)
1240 return err; 1240 return err;
1241 } 1241 }
1242 1242
1243 if (cfg(priv)->bt_params && cfg(priv)->bt_params->advanced_bt_coexist && 1243 if (priv->cfg->bt_params && priv->cfg->bt_params->advanced_bt_coexist &&
1244 vif->type == NL80211_IFTYPE_ADHOC) { 1244 vif->type == NL80211_IFTYPE_ADHOC) {
1245 /* 1245 /*
1246 * pretend to have high BT traffic as long as we 1246 * pretend to have high BT traffic as long as we
diff --git a/drivers/net/wireless/iwlwifi/iwl-op-mode.h b/drivers/net/wireless/iwlwifi/iwl-op-mode.h
index ca947aebb727..73e1a0e7be36 100644
--- a/drivers/net/wireless/iwlwifi/iwl-op-mode.h
+++ b/drivers/net/wireless/iwlwifi/iwl-op-mode.h
@@ -129,6 +129,7 @@ struct iwl_fw;
129 */ 129 */
130struct iwl_op_mode_ops { 130struct iwl_op_mode_ops {
131 struct iwl_op_mode *(*start)(struct iwl_trans *trans, 131 struct iwl_op_mode *(*start)(struct iwl_trans *trans,
132 const struct iwl_cfg *cfg,
132 const struct iwl_fw *fw); 133 const struct iwl_fw *fw);
133 void (*stop)(struct iwl_op_mode *op_mode); 134 void (*stop)(struct iwl_op_mode *op_mode);
134 int (*rx)(struct iwl_op_mode *op_mode, struct iwl_rx_cmd_buffer *rxb, 135 int (*rx)(struct iwl_op_mode *op_mode, struct iwl_rx_cmd_buffer *rxb,
diff --git a/drivers/net/wireless/iwlwifi/iwl-power.c b/drivers/net/wireless/iwlwifi/iwl-power.c
index 2c6f3b195d62..845633153033 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 (cfg(priv)->adv_pm) { 170 if (priv->cfg->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;
@@ -215,13 +215,13 @@ static void iwl_static_sleep_cmd(struct iwl_priv *priv,
215 else 215 else
216 cmd->flags &= ~IWL_POWER_SLEEP_OVER_DTIM_MSK; 216 cmd->flags &= ~IWL_POWER_SLEEP_OVER_DTIM_MSK;
217 217
218 if (cfg(priv)->base_params->shadow_reg_enable) 218 if (priv->cfg->base_params->shadow_reg_enable)
219 cmd->flags |= IWL_POWER_SHADOW_REG_ENA; 219 cmd->flags |= IWL_POWER_SHADOW_REG_ENA;
220 else 220 else
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 (!cfg(priv)->bt_params->bt_sco_disable) 224 if (!priv->cfg->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;
@@ -295,7 +295,7 @@ static void iwl_power_build_cmd(struct iwl_priv *priv,
295 295
296 if (priv->wowlan) 296 if (priv->wowlan)
297 iwl_static_sleep_cmd(priv, cmd, IWL_POWER_INDEX_5, dtimper); 297 iwl_static_sleep_cmd(priv, cmd, IWL_POWER_INDEX_5, dtimper);
298 else if (!cfg(priv)->base_params->no_idle_support && 298 else if (!priv->cfg->base_params->no_idle_support &&
299 priv->hw->conf.flags & IEEE80211_CONF_IDLE) 299 priv->hw->conf.flags & IEEE80211_CONF_IDLE)
300 iwl_static_sleep_cmd(priv, cmd, IWL_POWER_INDEX_5, 20); 300 iwl_static_sleep_cmd(priv, cmd, IWL_POWER_INDEX_5, 20);
301 else if (iwl_tt_is_low_power_state(priv)) { 301 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 490a60d8ad7d..9b88b909e546 100644
--- a/drivers/net/wireless/iwlwifi/iwl-scan.c
+++ b/drivers/net/wireless/iwlwifi/iwl-scan.c
@@ -791,8 +791,8 @@ static int iwlagn_request_scan(struct iwl_priv *priv, struct ieee80211_vif *vif)
791 * Internal scans are passive, so we can indiscriminately set 791 * Internal scans are passive, so we can indiscriminately set
792 * the BT ignore flag on 2.4 GHz since it applies to TX only. 792 * the BT ignore flag on 2.4 GHz since it applies to TX only.
793 */ 793 */
794 if (cfg(priv)->bt_params && 794 if (priv->cfg->bt_params &&
795 cfg(priv)->bt_params->advanced_bt_coexist) 795 priv->cfg->bt_params->advanced_bt_coexist)
796 scan->tx_cmd.tx_flags |= TX_CMD_FLG_IGNORE_BT; 796 scan->tx_cmd.tx_flags |= TX_CMD_FLG_IGNORE_BT;
797 break; 797 break;
798 case IEEE80211_BAND_5GHZ: 798 case IEEE80211_BAND_5GHZ:
@@ -834,8 +834,8 @@ static int iwlagn_request_scan(struct iwl_priv *priv, struct ieee80211_vif *vif)
834 band = priv->scan_band; 834 band = priv->scan_band;
835 835
836 if (band == IEEE80211_BAND_2GHZ && 836 if (band == IEEE80211_BAND_2GHZ &&
837 cfg(priv)->bt_params && 837 priv->cfg->bt_params &&
838 cfg(priv)->bt_params->advanced_bt_coexist) { 838 priv->cfg->bt_params->advanced_bt_coexist) {
839 /* transmit 2.4 GHz probes only on first antenna */ 839 /* transmit 2.4 GHz probes only on first antenna */
840 scan_tx_antennas = first_antenna(scan_tx_antennas); 840 scan_tx_antennas = first_antenna(scan_tx_antennas);
841 } 841 }
@@ -863,8 +863,8 @@ static int iwlagn_request_scan(struct iwl_priv *priv, struct ieee80211_vif *vif)
863 863
864 rx_ant = first_antenna(active_chains); 864 rx_ant = first_antenna(active_chains);
865 } 865 }
866 if (cfg(priv)->bt_params && 866 if (priv->cfg->bt_params &&
867 cfg(priv)->bt_params->advanced_bt_coexist && 867 priv->cfg->bt_params->advanced_bt_coexist &&
868 priv->bt_full_concurrent) { 868 priv->bt_full_concurrent) {
869 /* operated as 1x1 in full concurrency mode */ 869 /* operated as 1x1 in full concurrency mode */
870 rx_ant = first_antenna(rx_ant); 870 rx_ant = first_antenna(rx_ant);
diff --git a/drivers/net/wireless/iwlwifi/iwl-testmode.c b/drivers/net/wireless/iwlwifi/iwl-testmode.c
index 0c516d08121a..a6b16aa29c72 100644
--- a/drivers/net/wireless/iwlwifi/iwl-testmode.c
+++ b/drivers/net/wireless/iwlwifi/iwl-testmode.c
@@ -473,8 +473,8 @@ static int iwl_testmode_driver(struct ieee80211_hw *hw, struct nlattr **tb)
473 473
474 switch (nla_get_u32(tb[IWL_TM_ATTR_COMMAND])) { 474 switch (nla_get_u32(tb[IWL_TM_ATTR_COMMAND])) {
475 case IWL_TM_CMD_APP2DEV_GET_DEVICENAME: 475 case IWL_TM_CMD_APP2DEV_GET_DEVICENAME:
476 rsp_data_ptr = (unsigned char *)cfg(priv)->name; 476 rsp_data_ptr = (unsigned char *)priv->cfg->name;
477 rsp_data_len = strlen(cfg(priv)->name); 477 rsp_data_len = strlen(priv->cfg->name);
478 skb = cfg80211_testmode_alloc_reply_skb(hw->wiphy, 478 skb = cfg80211_testmode_alloc_reply_skb(hw->wiphy,
479 rsp_data_len + 20); 479 rsp_data_len + 20);
480 if (!skb) { 480 if (!skb) {
@@ -534,7 +534,7 @@ static int iwl_testmode_driver(struct ieee80211_hw *hw, struct nlattr **tb)
534 case IWL_TM_CMD_APP2DEV_GET_EEPROM: 534 case IWL_TM_CMD_APP2DEV_GET_EEPROM:
535 if (priv->eeprom) { 535 if (priv->eeprom) {
536 skb = cfg80211_testmode_alloc_reply_skb(hw->wiphy, 536 skb = cfg80211_testmode_alloc_reply_skb(hw->wiphy,
537 cfg(priv)->base_params->eeprom_size + 20); 537 priv->cfg->base_params->eeprom_size + 20);
538 if (!skb) { 538 if (!skb) {
539 IWL_ERR(priv, "Memory allocation fail\n"); 539 IWL_ERR(priv, "Memory allocation fail\n");
540 return -ENOMEM; 540 return -ENOMEM;
@@ -542,7 +542,7 @@ static int iwl_testmode_driver(struct ieee80211_hw *hw, struct nlattr **tb)
542 NLA_PUT_U32(skb, IWL_TM_ATTR_COMMAND, 542 NLA_PUT_U32(skb, IWL_TM_ATTR_COMMAND,
543 IWL_TM_CMD_DEV2APP_EEPROM_RSP); 543 IWL_TM_CMD_DEV2APP_EEPROM_RSP);
544 NLA_PUT(skb, IWL_TM_ATTR_EEPROM, 544 NLA_PUT(skb, IWL_TM_ATTR_EEPROM,
545 cfg(priv)->base_params->eeprom_size, 545 priv->cfg->base_params->eeprom_size,
546 priv->eeprom); 546 priv->eeprom);
547 status = cfg80211_testmode_reply(skb); 547 status = cfg80211_testmode_reply(skb);
548 if (status < 0) 548 if (status < 0)
diff --git a/drivers/net/wireless/iwlwifi/iwl-ucode.c b/drivers/net/wireless/iwlwifi/iwl-ucode.c
index 4056d1ff8437..19558035c6c6 100644
--- a/drivers/net/wireless/iwlwifi/iwl-ucode.c
+++ b/drivers/net/wireless/iwlwifi/iwl-ucode.c
@@ -145,8 +145,8 @@ int iwl_init_alive_start(struct iwl_priv *priv)
145{ 145{
146 int ret; 146 int ret;
147 147
148 if (cfg(priv)->bt_params && 148 if (priv->cfg->bt_params &&
149 cfg(priv)->bt_params->advanced_bt_coexist) { 149 priv->cfg->bt_params->advanced_bt_coexist) {
150 /* 150 /*
151 * Tell uCode we are ready to perform calibration 151 * Tell uCode we are ready to perform calibration
152 * need to perform this before any calibration 152 * need to perform this before any calibration
@@ -168,8 +168,8 @@ int iwl_init_alive_start(struct iwl_priv *priv)
168 * temperature offset calibration is only needed for runtime ucode, 168 * temperature offset calibration is only needed for runtime ucode,
169 * so prepare the value now. 169 * so prepare the value now.
170 */ 170 */
171 if (cfg(priv)->need_temp_offset_calib) { 171 if (priv->cfg->need_temp_offset_calib) {
172 if (cfg(priv)->temp_offset_v2) 172 if (priv->cfg->temp_offset_v2)
173 return iwl_set_temperature_offset_calib_v2(priv); 173 return iwl_set_temperature_offset_calib_v2(priv);
174 else 174 else
175 return iwl_set_temperature_offset_calib(priv); 175 return iwl_set_temperature_offset_calib(priv);
@@ -253,7 +253,7 @@ static int iwl_alive_notify(struct iwl_priv *priv)
253 if (ret) 253 if (ret)
254 return ret; 254 return ret;
255 255
256 if (!cfg(priv)->no_xtal_calib) { 256 if (!priv->cfg->no_xtal_calib) {
257 ret = iwl_set_Xtal_calib(priv); 257 ret = iwl_set_Xtal_calib(priv);
258 if (ret) 258 if (ret)
259 return ret; 259 return ret;