aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-agn.c
diff options
context:
space:
mode:
authorWey-Yi Guy <wey-yi.w.guy@intel.com>2010-10-06 11:10:00 -0400
committerWey-Yi Guy <wey-yi.w.guy@intel.com>2010-10-06 11:10:00 -0400
commit7cb1b0887fcc61918e3d64827fbef968bb67a57a (patch)
treefa9103423af207c68be604523b3a362e1a6c3e14 /drivers/net/wireless/iwlwifi/iwl-agn.c
parent72645eff4b2ad6cf2b016b54f9d6817cca0a621d (diff)
iwlagn: reduce redundant parameter definitions
move paramater definitions to a device paramater structure only leaving the device name, which antennas are used and what firmware file to use in the iwl_cfg structure. this will not completely remove the redundancies but greatly reduce them for devices that only vary by name or antennas. the parameters that are more likely to change within a given device family are left in iwl_cfg. also separate bt param structure added to help reduce more. Signed-off-by: Jay Sternberg <jay.e.sternberg@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.c43
1 files changed, 27 insertions, 16 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index e7dc8b92db66..080121d3a3ae 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -2256,13 +2256,15 @@ static void iwl_ucode_callback(const struct firmware *ucode_raw, void *context)
2256 if (pieces.init_evtlog_size) 2256 if (pieces.init_evtlog_size)
2257 priv->_agn.init_evtlog_size = (pieces.init_evtlog_size - 16)/12; 2257 priv->_agn.init_evtlog_size = (pieces.init_evtlog_size - 16)/12;
2258 else 2258 else
2259 priv->_agn.init_evtlog_size = priv->cfg->max_event_log_size; 2259 priv->_agn.init_evtlog_size =
2260 priv->cfg->base_params->max_event_log_size;
2260 priv->_agn.init_errlog_ptr = pieces.init_errlog_ptr; 2261 priv->_agn.init_errlog_ptr = pieces.init_errlog_ptr;
2261 priv->_agn.inst_evtlog_ptr = pieces.inst_evtlog_ptr; 2262 priv->_agn.inst_evtlog_ptr = pieces.inst_evtlog_ptr;
2262 if (pieces.inst_evtlog_size) 2263 if (pieces.inst_evtlog_size)
2263 priv->_agn.inst_evtlog_size = (pieces.inst_evtlog_size - 16)/12; 2264 priv->_agn.inst_evtlog_size = (pieces.inst_evtlog_size - 16)/12;
2264 else 2265 else
2265 priv->_agn.inst_evtlog_size = priv->cfg->max_event_log_size; 2266 priv->_agn.inst_evtlog_size =
2267 priv->cfg->base_params->max_event_log_size;
2266 priv->_agn.inst_errlog_ptr = pieces.inst_errlog_ptr; 2268 priv->_agn.inst_errlog_ptr = pieces.inst_errlog_ptr;
2267 2269
2268 if (ucode_capa.pan) { 2270 if (ucode_capa.pan) {
@@ -2732,7 +2734,7 @@ static void iwl_rf_kill_ct_config(struct iwl_priv *priv)
2732 spin_unlock_irqrestore(&priv->lock, flags); 2734 spin_unlock_irqrestore(&priv->lock, flags);
2733 priv->thermal_throttle.ct_kill_toggle = false; 2735 priv->thermal_throttle.ct_kill_toggle = false;
2734 2736
2735 if (priv->cfg->support_ct_kill_exit) { 2737 if (priv->cfg->base_params->support_ct_kill_exit) {
2736 adv_cmd.critical_temperature_enter = 2738 adv_cmd.critical_temperature_enter =
2737 cpu_to_le32(priv->hw_params.ct_kill_threshold); 2739 cpu_to_le32(priv->hw_params.ct_kill_threshold);
2738 adv_cmd.critical_temperature_exit = 2740 adv_cmd.critical_temperature_exit =
@@ -2776,9 +2778,7 @@ static int iwlagn_send_calib_cfg_rt(struct iwl_priv *priv, u32 cfg)
2776 2778
2777 memset(&calib_cfg_cmd, 0, sizeof(calib_cfg_cmd)); 2779 memset(&calib_cfg_cmd, 0, sizeof(calib_cfg_cmd));
2778 calib_cfg_cmd.ucd_calib_cfg.once.is_enable = IWL_CALIB_INIT_CFG_ALL; 2780 calib_cfg_cmd.ucd_calib_cfg.once.is_enable = IWL_CALIB_INIT_CFG_ALL;
2779 calib_cfg_cmd.ucd_calib_cfg.once.start = cfg; 2781 calib_cfg_cmd.ucd_calib_cfg.once.start = cpu_to_le32(cfg);
2780 calib_cfg_cmd.ucd_calib_cfg.once.send_res = 0;
2781 calib_cfg_cmd.ucd_calib_cfg.flags = 0;
2782 2782
2783 return iwl_send_cmd(priv, &cmd); 2783 return iwl_send_cmd(priv, &cmd);
2784} 2784}
@@ -2831,13 +2831,15 @@ static void iwl_alive_start(struct iwl_priv *priv)
2831 /* Enable timer to monitor the driver queues */ 2831 /* Enable timer to monitor the driver queues */
2832 mod_timer(&priv->monitor_recover, 2832 mod_timer(&priv->monitor_recover,
2833 jiffies + 2833 jiffies +
2834 msecs_to_jiffies(priv->cfg->monitor_recover_period)); 2834 msecs_to_jiffies(
2835 priv->cfg->base_params->monitor_recover_period));
2835 } 2836 }
2836 2837
2837 if (iwl_is_rfkill(priv)) 2838 if (iwl_is_rfkill(priv))
2838 return; 2839 return;
2839 2840
2840 if (priv->cfg->advanced_bt_coexist) { 2841 if (priv->cfg->bt_params &&
2842 priv->cfg->bt_params->advanced_bt_coexist) {
2841 /* Configure Bluetooth device coexistence support */ 2843 /* Configure Bluetooth device coexistence support */
2842 priv->bt_valid = IWLAGN_BT_ALL_VALID_MSK; 2844 priv->bt_valid = IWLAGN_BT_ALL_VALID_MSK;
2843 priv->kill_ack_mask = IWLAGN_BT_KILL_ACK_MASK_DEFAULT; 2845 priv->kill_ack_mask = IWLAGN_BT_KILL_ACK_MASK_DEFAULT;
@@ -2877,7 +2879,8 @@ static void iwl_alive_start(struct iwl_priv *priv)
2877 priv->cfg->ops->hcmd->set_rxon_chain(priv, ctx); 2879 priv->cfg->ops->hcmd->set_rxon_chain(priv, ctx);
2878 } 2880 }
2879 2881
2880 if (!priv->cfg->advanced_bt_coexist) { 2882 if (priv->cfg->bt_params &&
2883 !priv->cfg->bt_params->advanced_bt_coexist) {
2881 /* Configure Bluetooth device coexistence support */ 2884 /* Configure Bluetooth device coexistence support */
2882 priv->cfg->ops->hcmd->send_bt_config(priv); 2885 priv->cfg->ops->hcmd->send_bt_config(priv);
2883 } 2886 }
@@ -2930,7 +2933,11 @@ static void __iwl_down(struct iwl_priv *priv)
2930 2933
2931 /* reset BT coex data */ 2934 /* reset BT coex data */
2932 priv->bt_status = 0; 2935 priv->bt_status = 0;
2933 priv->bt_traffic_load = priv->cfg->bt_init_traffic_load; 2936 if (priv->cfg->bt_params)
2937 priv->bt_traffic_load =
2938 priv->cfg->bt_params->bt_init_traffic_load;
2939 else
2940 priv->bt_traffic_load = 0;
2934 priv->bt_sco_active = false; 2941 priv->bt_sco_active = false;
2935 priv->bt_full_concurrent = false; 2942 priv->bt_full_concurrent = false;
2936 priv->bt_ci_compliance = 0; 2943 priv->bt_ci_compliance = 0;
@@ -3224,7 +3231,8 @@ static void iwl_bg_run_time_calib_work(struct work_struct *work)
3224 } 3231 }
3225 3232
3226 if (priv->start_calib) { 3233 if (priv->start_calib) {
3227 if (priv->cfg->bt_statistics) { 3234 if (priv->cfg->bt_params &&
3235 priv->cfg->bt_params->bt_statistics) {
3228 iwl_chain_noise_calibration(priv, 3236 iwl_chain_noise_calibration(priv,
3229 (void *)&priv->_agn.statistics_bt); 3237 (void *)&priv->_agn.statistics_bt);
3230 iwl_sensitivity_calibration(priv, 3238 iwl_sensitivity_calibration(priv,
@@ -3423,7 +3431,7 @@ static int iwl_mac_setup_register(struct iwl_priv *priv,
3423 IEEE80211_HW_NEED_DTIM_PERIOD | 3431 IEEE80211_HW_NEED_DTIM_PERIOD |
3424 IEEE80211_HW_SPECTRUM_MGMT; 3432 IEEE80211_HW_SPECTRUM_MGMT;
3425 3433
3426 if (!priv->cfg->broken_powersave) 3434 if (!priv->cfg->base_params->broken_powersave)
3427 hw->flags |= IEEE80211_HW_SUPPORTS_PS | 3435 hw->flags |= IEEE80211_HW_SUPPORTS_PS |
3428 IEEE80211_HW_SUPPORTS_DYNAMIC_PS; 3436 IEEE80211_HW_SUPPORTS_DYNAMIC_PS;
3429 3437
@@ -3748,7 +3756,8 @@ static int iwl_mac_ampdu_action(struct ieee80211_hw *hw,
3748 } 3756 }
3749 if (test_bit(STATUS_EXIT_PENDING, &priv->status)) 3757 if (test_bit(STATUS_EXIT_PENDING, &priv->status))
3750 ret = 0; 3758 ret = 0;
3751 if (priv->cfg->use_rts_for_aggregation) { 3759 if (priv->cfg->ht_params &&
3760 priv->cfg->ht_params->use_rts_for_aggregation) {
3752 struct iwl_station_priv *sta_priv = 3761 struct iwl_station_priv *sta_priv =
3753 (void *) sta->drv_priv; 3762 (void *) sta->drv_priv;
3754 /* 3763 /*
@@ -3762,7 +3771,8 @@ static int iwl_mac_ampdu_action(struct ieee80211_hw *hw,
3762 } 3771 }
3763 break; 3772 break;
3764 case IEEE80211_AMPDU_TX_OPERATIONAL: 3773 case IEEE80211_AMPDU_TX_OPERATIONAL:
3765 if (priv->cfg->use_rts_for_aggregation) { 3774 if (priv->cfg->ht_params &&
3775 priv->cfg->ht_params->use_rts_for_aggregation) {
3766 struct iwl_station_priv *sta_priv = 3776 struct iwl_station_priv *sta_priv =
3767 (void *) sta->drv_priv; 3777 (void *) sta->drv_priv;
3768 3778
@@ -4080,7 +4090,7 @@ static void iwl_setup_deferred_work(struct iwl_priv *priv)
4080 priv->cfg->ops->lib->recover_from_tx_stall; 4090 priv->cfg->ops->lib->recover_from_tx_stall;
4081 } 4091 }
4082 4092
4083 if (!priv->cfg->use_isr_legacy) 4093 if (!priv->cfg->base_params->use_isr_legacy)
4084 tasklet_init(&priv->irq_tasklet, (void (*)(unsigned long)) 4094 tasklet_init(&priv->irq_tasklet, (void (*)(unsigned long))
4085 iwl_irq_tasklet, (unsigned long)priv); 4095 iwl_irq_tasklet, (unsigned long)priv);
4086 else 4096 else
@@ -4165,7 +4175,8 @@ static int iwl_init_drv(struct iwl_priv *priv)
4165 iwl_init_scan_params(priv); 4175 iwl_init_scan_params(priv);
4166 4176
4167 /* init bt coex */ 4177 /* init bt coex */
4168 if (priv->cfg->advanced_bt_coexist) { 4178 if (priv->cfg->bt_params &&
4179 priv->cfg->bt_params->advanced_bt_coexist) {
4169 priv->kill_ack_mask = IWLAGN_BT_KILL_ACK_MASK_DEFAULT; 4180 priv->kill_ack_mask = IWLAGN_BT_KILL_ACK_MASK_DEFAULT;
4170 priv->kill_cts_mask = IWLAGN_BT_KILL_CTS_MASK_DEFAULT; 4181 priv->kill_cts_mask = IWLAGN_BT_KILL_CTS_MASK_DEFAULT;
4171 priv->bt_valid = IWLAGN_BT_ALL_VALID_MSK; 4182 priv->bt_valid = IWLAGN_BT_ALL_VALID_MSK;