aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-agn.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2012-04-09 20:46:55 -0400
committerJohn W. Linville <linville@tuxdriver.com>2012-04-12 15:06:09 -0400
commit9e295116bb1f7300e5cdb87a41ce85b1efe79ec2 (patch)
treed6890b3d08df3371329e443ed8c23f1b8128de66 /drivers/net/wireless/iwlwifi/iwl-agn.c
parent7c5ba4a830cbb730770129b0004e2a06e47dbac5 (diff)
iwlwifi: move hw_params into priv
The hw_params are mostly values that are derived from the actual hardware config. As such, while it is possible that MVM will require similar ones, it makes more sense -- at least for now -- to put them into the DVM struct. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-agn.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index 514719957919..9e320c1e79f8 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -180,7 +180,7 @@ int iwlagn_send_beacon_cmd(struct iwl_priv *priv)
180 rate = info->control.rates[0].idx; 180 rate = info->control.rates[0].idx;
181 181
182 priv->mgmt_tx_ant = iwl_toggle_tx_ant(priv, priv->mgmt_tx_ant, 182 priv->mgmt_tx_ant = iwl_toggle_tx_ant(priv, priv->mgmt_tx_ant,
183 hw_params(priv).valid_tx_ant); 183 priv->hw_params.valid_tx_ant);
184 rate_flags = iwl_ant_idx_to_flags(priv->mgmt_tx_ant); 184 rate_flags = iwl_ant_idx_to_flags(priv->mgmt_tx_ant);
185 185
186 /* In mac80211, rates for 5 GHz start at 0 */ 186 /* In mac80211, rates for 5 GHz start at 0 */
@@ -658,9 +658,9 @@ static void iwl_rf_kill_ct_config(struct iwl_priv *priv)
658 658
659 if (cfg(priv)->base_params->support_ct_kill_exit) { 659 if (cfg(priv)->base_params->support_ct_kill_exit) {
660 adv_cmd.critical_temperature_enter = 660 adv_cmd.critical_temperature_enter =
661 cpu_to_le32(hw_params(priv).ct_kill_threshold); 661 cpu_to_le32(priv->hw_params.ct_kill_threshold);
662 adv_cmd.critical_temperature_exit = 662 adv_cmd.critical_temperature_exit =
663 cpu_to_le32(hw_params(priv).ct_kill_exit_threshold); 663 cpu_to_le32(priv->hw_params.ct_kill_exit_threshold);
664 664
665 ret = iwl_dvm_send_cmd_pdu(priv, 665 ret = iwl_dvm_send_cmd_pdu(priv,
666 REPLY_CT_KILL_CONFIG_CMD, 666 REPLY_CT_KILL_CONFIG_CMD,
@@ -671,11 +671,11 @@ static void iwl_rf_kill_ct_config(struct iwl_priv *priv)
671 IWL_DEBUG_INFO(priv, "REPLY_CT_KILL_CONFIG_CMD " 671 IWL_DEBUG_INFO(priv, "REPLY_CT_KILL_CONFIG_CMD "
672 "succeeded, critical temperature enter is %d," 672 "succeeded, critical temperature enter is %d,"
673 "exit is %d\n", 673 "exit is %d\n",
674 hw_params(priv).ct_kill_threshold, 674 priv->hw_params.ct_kill_threshold,
675 hw_params(priv).ct_kill_exit_threshold); 675 priv->hw_params.ct_kill_exit_threshold);
676 } else { 676 } else {
677 cmd.critical_temperature_R = 677 cmd.critical_temperature_R =
678 cpu_to_le32(hw_params(priv).ct_kill_threshold); 678 cpu_to_le32(priv->hw_params.ct_kill_threshold);
679 679
680 ret = iwl_dvm_send_cmd_pdu(priv, 680 ret = iwl_dvm_send_cmd_pdu(priv,
681 REPLY_CT_KILL_CONFIG_CMD, 681 REPLY_CT_KILL_CONFIG_CMD,
@@ -686,7 +686,7 @@ static void iwl_rf_kill_ct_config(struct iwl_priv *priv)
686 IWL_DEBUG_INFO(priv, "REPLY_CT_KILL_CONFIG_CMD " 686 IWL_DEBUG_INFO(priv, "REPLY_CT_KILL_CONFIG_CMD "
687 "succeeded, " 687 "succeeded, "
688 "critical temperature is %d\n", 688 "critical temperature is %d\n",
689 hw_params(priv).ct_kill_threshold); 689 priv->hw_params.ct_kill_threshold);
690 } 690 }
691} 691}
692 692
@@ -793,7 +793,7 @@ int iwl_alive_start(struct iwl_priv *priv)
793 priv->active_rate = IWL_RATES_MASK; 793 priv->active_rate = IWL_RATES_MASK;
794 794
795 /* Configure Tx antenna selection based on H/W config */ 795 /* Configure Tx antenna selection based on H/W config */
796 iwlagn_send_tx_ant_config(priv, hw_params(priv).valid_tx_ant); 796 iwlagn_send_tx_ant_config(priv, priv->hw_params.valid_tx_ant);
797 797
798 if (iwl_is_associated_ctx(ctx) && !priv->wowlan) { 798 if (iwl_is_associated_ctx(ctx) && !priv->wowlan) {
799 struct iwl_rxon_cmd *active_rxon = 799 struct iwl_rxon_cmd *active_rxon =
@@ -1132,8 +1132,8 @@ static void iwl_init_ht_hw_capab(const struct iwl_priv *priv,
1132 enum ieee80211_band band) 1132 enum ieee80211_band band)
1133{ 1133{
1134 u16 max_bit_rate = 0; 1134 u16 max_bit_rate = 0;
1135 u8 rx_chains_num = hw_params(priv).rx_chains_num; 1135 u8 rx_chains_num = priv->hw_params.rx_chains_num;
1136 u8 tx_chains_num = hw_params(priv).tx_chains_num; 1136 u8 tx_chains_num = priv->hw_params.tx_chains_num;
1137 1137
1138 ht_info->cap = 0; 1138 ht_info->cap = 0;
1139 memset(&ht_info->mcs, 0, sizeof(ht_info->mcs)); 1139 memset(&ht_info->mcs, 0, sizeof(ht_info->mcs));
@@ -1145,7 +1145,7 @@ static void iwl_init_ht_hw_capab(const struct iwl_priv *priv,
1145 ht_info->cap |= IEEE80211_HT_CAP_GRN_FLD; 1145 ht_info->cap |= IEEE80211_HT_CAP_GRN_FLD;
1146 ht_info->cap |= IEEE80211_HT_CAP_SGI_20; 1146 ht_info->cap |= IEEE80211_HT_CAP_SGI_20;
1147 max_bit_rate = MAX_BIT_RATE_20_MHZ; 1147 max_bit_rate = MAX_BIT_RATE_20_MHZ;
1148 if (hw_params(priv).ht40_channel & BIT(band)) { 1148 if (priv->hw_params.ht40_channel & BIT(band)) {
1149 ht_info->cap |= IEEE80211_HT_CAP_SUP_WIDTH_20_40; 1149 ht_info->cap |= IEEE80211_HT_CAP_SUP_WIDTH_20_40;
1150 ht_info->cap |= IEEE80211_HT_CAP_SGI_40; 1150 ht_info->cap |= IEEE80211_HT_CAP_SGI_40;
1151 ht_info->mcs.rx_mask[4] = 0x01; 1151 ht_info->mcs.rx_mask[4] = 0x01;
@@ -1217,7 +1217,7 @@ static int iwl_init_geos(struct iwl_priv *priv)
1217 sband->bitrates = &rates[IWL_FIRST_OFDM_RATE]; 1217 sband->bitrates = &rates[IWL_FIRST_OFDM_RATE];
1218 sband->n_bitrates = IWL_RATE_COUNT_LEGACY - IWL_FIRST_OFDM_RATE; 1218 sband->n_bitrates = IWL_RATE_COUNT_LEGACY - IWL_FIRST_OFDM_RATE;
1219 1219
1220 if (hw_params(priv).sku & EEPROM_SKU_CAP_11N_ENABLE) 1220 if (priv->hw_params.sku & EEPROM_SKU_CAP_11N_ENABLE)
1221 iwl_init_ht_hw_capab(priv, &sband->ht_cap, 1221 iwl_init_ht_hw_capab(priv, &sband->ht_cap,
1222 IEEE80211_BAND_5GHZ); 1222 IEEE80211_BAND_5GHZ);
1223 1223
@@ -1227,7 +1227,7 @@ static int iwl_init_geos(struct iwl_priv *priv)
1227 sband->bitrates = rates; 1227 sband->bitrates = rates;
1228 sband->n_bitrates = IWL_RATE_COUNT_LEGACY; 1228 sband->n_bitrates = IWL_RATE_COUNT_LEGACY;
1229 1229
1230 if (hw_params(priv).sku & EEPROM_SKU_CAP_11N_ENABLE) 1230 if (priv->hw_params.sku & EEPROM_SKU_CAP_11N_ENABLE)
1231 iwl_init_ht_hw_capab(priv, &sband->ht_cap, 1231 iwl_init_ht_hw_capab(priv, &sband->ht_cap,
1232 IEEE80211_BAND_2GHZ); 1232 IEEE80211_BAND_2GHZ);
1233 1233
@@ -1282,11 +1282,11 @@ static int iwl_init_geos(struct iwl_priv *priv)
1282 priv->tx_power_next = max_tx_power; 1282 priv->tx_power_next = max_tx_power;
1283 1283
1284 if ((priv->bands[IEEE80211_BAND_5GHZ].n_channels == 0) && 1284 if ((priv->bands[IEEE80211_BAND_5GHZ].n_channels == 0) &&
1285 hw_params(priv).sku & EEPROM_SKU_CAP_BAND_52GHZ) { 1285 priv->hw_params.sku & EEPROM_SKU_CAP_BAND_52GHZ) {
1286 IWL_INFO(priv, "Incorrectly detected BG card as ABG. " 1286 IWL_INFO(priv, "Incorrectly detected BG card as ABG. "
1287 "Please send your %s to maintainer.\n", 1287 "Please send your %s to maintainer.\n",
1288 trans(priv)->hw_id_str); 1288 trans(priv)->hw_id_str);
1289 hw_params(priv).sku &= ~EEPROM_SKU_CAP_BAND_52GHZ; 1289 priv->hw_params.sku &= ~EEPROM_SKU_CAP_BAND_52GHZ;
1290 } 1290 }
1291 1291
1292 IWL_INFO(priv, "Tunable channels: %d 802.11bg, %d 802.11a channels\n", 1292 IWL_INFO(priv, "Tunable channels: %d 802.11bg, %d 802.11a channels\n",
@@ -1393,11 +1393,11 @@ static void iwl_uninit_drv(struct iwl_priv *priv)
1393static void iwl_set_hw_params(struct iwl_priv *priv) 1393static void iwl_set_hw_params(struct iwl_priv *priv)
1394{ 1394{
1395 if (cfg(priv)->ht_params) 1395 if (cfg(priv)->ht_params)
1396 hw_params(priv).use_rts_for_aggregation = 1396 priv->hw_params.use_rts_for_aggregation =
1397 cfg(priv)->ht_params->use_rts_for_aggregation; 1397 cfg(priv)->ht_params->use_rts_for_aggregation;
1398 1398
1399 if (iwlagn_mod_params.disable_11n & IWL_DISABLE_HT_ALL) 1399 if (iwlagn_mod_params.disable_11n & IWL_DISABLE_HT_ALL)
1400 hw_params(priv).sku &= ~EEPROM_SKU_CAP_11N_ENABLE; 1400 priv->hw_params.sku &= ~EEPROM_SKU_CAP_11N_ENABLE;
1401 1401
1402 /* Device-specific setup */ 1402 /* Device-specific setup */
1403 cfg(priv)->lib->set_hw_params(priv); 1403 cfg(priv)->lib->set_hw_params(priv);
@@ -1591,7 +1591,7 @@ static struct iwl_op_mode *iwl_op_mode_dvm_start(struct iwl_trans *trans,
1591 ************************/ 1591 ************************/
1592 iwl_set_hw_params(priv); 1592 iwl_set_hw_params(priv);
1593 1593
1594 if (!(hw_params(priv).sku & EEPROM_SKU_CAP_IPAN_ENABLE)) { 1594 if (!(priv->hw_params.sku & EEPROM_SKU_CAP_IPAN_ENABLE)) {
1595 IWL_DEBUG_INFO(priv, "Your EEPROM disabled PAN"); 1595 IWL_DEBUG_INFO(priv, "Your EEPROM disabled PAN");
1596 ucode_flags &= ~IWL_UCODE_TLV_FLAGS_PAN; 1596 ucode_flags &= ~IWL_UCODE_TLV_FLAGS_PAN;
1597 /* 1597 /*