aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-agn.c
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/iwl-agn.c
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/iwl-agn.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn.c60
1 files changed, 30 insertions, 30 deletions
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)