Commit 54708d8d authored by Johannes Berg's avatar Johannes Berg Committed by John W. Linville

iwlwifi: remove SKU from config

There's no SKU override, we always just use
it from EEPROM. As such, we can remove it
from the config and use it in hw_param only.
Since iwl_eeprom_check_sku() really needs
to fill it in also rename that to
iwl_eeprom_init_hw_params().
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
Signed-off-by: default avatarWey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent a8bceb39
...@@ -235,7 +235,7 @@ int iwlagn_txfifo_flush(struct iwl_priv *priv, u16 flush_control) ...@@ -235,7 +235,7 @@ int iwlagn_txfifo_flush(struct iwl_priv *priv, u16 flush_control)
IWL_PAN_SCD_BK_MSK | IWL_PAN_SCD_MGMT_MSK | IWL_PAN_SCD_BK_MSK | IWL_PAN_SCD_MGMT_MSK |
IWL_PAN_SCD_MULTICAST_MSK; IWL_PAN_SCD_MULTICAST_MSK;
if (cfg(priv)->sku & EEPROM_SKU_CAP_11N_ENABLE) if (hw_params(priv).sku & EEPROM_SKU_CAP_11N_ENABLE)
flush_cmd.fifo_control |= IWL_AGG_TX_QUEUE_MSK; flush_cmd.fifo_control |= IWL_AGG_TX_QUEUE_MSK;
IWL_DEBUG_INFO(priv, "fifo queue control: 0X%x\n", IWL_DEBUG_INFO(priv, "fifo queue control: 0X%x\n",
......
...@@ -1124,13 +1124,12 @@ static void iwl_set_hw_params(struct iwl_priv *priv) ...@@ -1124,13 +1124,12 @@ static void iwl_set_hw_params(struct iwl_priv *priv)
get_order(IWL_RX_BUF_SIZE_4K); get_order(IWL_RX_BUF_SIZE_4K);
if (iwlagn_mod_params.disable_11n & IWL_DISABLE_HT_ALL) if (iwlagn_mod_params.disable_11n & IWL_DISABLE_HT_ALL)
cfg(priv)->sku &= ~EEPROM_SKU_CAP_11N_ENABLE; hw_params(priv).sku &= ~EEPROM_SKU_CAP_11N_ENABLE;
hw_params(priv).num_ampdu_queues = hw_params(priv).num_ampdu_queues =
cfg(priv)->base_params->num_of_ampdu_queues; cfg(priv)->base_params->num_of_ampdu_queues;
hw_params(priv).shadow_reg_enable = hw_params(priv).shadow_reg_enable =
cfg(priv)->base_params->shadow_reg_enable; cfg(priv)->base_params->shadow_reg_enable;
hw_params(priv).sku = cfg(priv)->sku;
hw_params(priv).wd_timeout = cfg(priv)->base_params->wd_timeout; hw_params(priv).wd_timeout = cfg(priv)->base_params->wd_timeout;
/* Device-specific setup */ /* Device-specific setup */
...@@ -1257,7 +1256,7 @@ static struct iwl_op_mode *iwl_op_mode_dvm_start(struct iwl_trans *trans) ...@@ -1257,7 +1256,7 @@ static struct iwl_op_mode *iwl_op_mode_dvm_start(struct iwl_trans *trans)
if (err) if (err)
goto out_free_eeprom; goto out_free_eeprom;
err = iwl_eeprom_check_sku(priv); err = iwl_eeprom_init_hw_params(priv);
if (err) if (err)
goto out_free_eeprom; goto out_free_eeprom;
......
...@@ -137,7 +137,7 @@ int iwl_init_geos(struct iwl_priv *priv) ...@@ -137,7 +137,7 @@ int iwl_init_geos(struct iwl_priv *priv)
sband->bitrates = &rates[IWL_FIRST_OFDM_RATE]; sband->bitrates = &rates[IWL_FIRST_OFDM_RATE];
sband->n_bitrates = IWL_RATE_COUNT_LEGACY - IWL_FIRST_OFDM_RATE; sband->n_bitrates = IWL_RATE_COUNT_LEGACY - IWL_FIRST_OFDM_RATE;
if (cfg(priv)->sku & EEPROM_SKU_CAP_11N_ENABLE) if (hw_params(priv).sku & EEPROM_SKU_CAP_11N_ENABLE)
iwl_init_ht_hw_capab(priv, &sband->ht_cap, iwl_init_ht_hw_capab(priv, &sband->ht_cap,
IEEE80211_BAND_5GHZ); IEEE80211_BAND_5GHZ);
...@@ -147,7 +147,7 @@ int iwl_init_geos(struct iwl_priv *priv) ...@@ -147,7 +147,7 @@ int iwl_init_geos(struct iwl_priv *priv)
sband->bitrates = rates; sband->bitrates = rates;
sband->n_bitrates = IWL_RATE_COUNT_LEGACY; sband->n_bitrates = IWL_RATE_COUNT_LEGACY;
if (cfg(priv)->sku & EEPROM_SKU_CAP_11N_ENABLE) if (hw_params(priv).sku & EEPROM_SKU_CAP_11N_ENABLE)
iwl_init_ht_hw_capab(priv, &sband->ht_cap, iwl_init_ht_hw_capab(priv, &sband->ht_cap,
IEEE80211_BAND_2GHZ); IEEE80211_BAND_2GHZ);
...@@ -202,11 +202,11 @@ int iwl_init_geos(struct iwl_priv *priv) ...@@ -202,11 +202,11 @@ int iwl_init_geos(struct iwl_priv *priv)
priv->tx_power_next = max_tx_power; priv->tx_power_next = max_tx_power;
if ((priv->bands[IEEE80211_BAND_5GHZ].n_channels == 0) && if ((priv->bands[IEEE80211_BAND_5GHZ].n_channels == 0) &&
cfg(priv)->sku & EEPROM_SKU_CAP_BAND_52GHZ) { hw_params(priv).sku & EEPROM_SKU_CAP_BAND_52GHZ) {
IWL_INFO(priv, "Incorrectly detected BG card as ABG. " IWL_INFO(priv, "Incorrectly detected BG card as ABG. "
"Please send your %s to maintainer.\n", "Please send your %s to maintainer.\n",
trans(priv)->hw_id_str); trans(priv)->hw_id_str);
cfg(priv)->sku &= ~EEPROM_SKU_CAP_BAND_52GHZ; hw_params(priv).sku &= ~EEPROM_SKU_CAP_BAND_52GHZ;
} }
IWL_INFO(priv, "Tunable channels: %d 802.11bg, %d 802.11a channels\n", IWL_INFO(priv, "Tunable channels: %d 802.11bg, %d 802.11a channels\n",
......
...@@ -252,26 +252,24 @@ int iwl_eeprom_check_version(struct iwl_priv *priv) ...@@ -252,26 +252,24 @@ int iwl_eeprom_check_version(struct iwl_priv *priv)
} }
int iwl_eeprom_check_sku(struct iwl_priv *priv) int iwl_eeprom_init_hw_params(struct iwl_priv *priv)
{ {
struct iwl_shared *shrd = priv->shrd; struct iwl_shared *shrd = priv->shrd;
u16 radio_cfg; u16 radio_cfg;
if (!cfg(priv)->sku) { hw_params(priv).sku = iwl_eeprom_query16(shrd, EEPROM_SKU_CAP);
/* not using sku overwrite */ if (hw_params(priv).sku & EEPROM_SKU_CAP_11N_ENABLE &&
cfg(priv)->sku = iwl_eeprom_query16(shrd, EEPROM_SKU_CAP);
if (cfg(priv)->sku & EEPROM_SKU_CAP_11N_ENABLE &&
!cfg(priv)->ht_params) { !cfg(priv)->ht_params) {
IWL_ERR(priv, "Invalid 11n configuration\n"); IWL_ERR(priv, "Invalid 11n configuration\n");
return -EINVAL; return -EINVAL;
} }
}
if (!cfg(priv)->sku) { if (!hw_params(priv).sku) {
IWL_ERR(priv, "Invalid device sku\n"); IWL_ERR(priv, "Invalid device sku\n");
return -EINVAL; return -EINVAL;
} }
IWL_INFO(priv, "Device SKU: 0x%X\n", cfg(priv)->sku); IWL_INFO(priv, "Device SKU: 0x%X\n", hw_params(priv).sku);
if (!cfg(priv)->valid_tx_ant && !cfg(priv)->valid_rx_ant) { if (!cfg(priv)->valid_tx_ant && !cfg(priv)->valid_rx_ant) {
/* not using .cfg overwrite */ /* not using .cfg overwrite */
......
...@@ -309,7 +309,7 @@ struct iwl_eeprom_ops { ...@@ -309,7 +309,7 @@ struct iwl_eeprom_ops {
int iwl_eeprom_init(struct iwl_trans *trans, u32 hw_rev); int iwl_eeprom_init(struct iwl_trans *trans, u32 hw_rev);
void iwl_eeprom_free(struct iwl_shared *shrd); void iwl_eeprom_free(struct iwl_shared *shrd);
int iwl_eeprom_check_version(struct iwl_priv *priv); int iwl_eeprom_check_version(struct iwl_priv *priv);
int iwl_eeprom_check_sku(struct iwl_priv *priv); int iwl_eeprom_init_hw_params(struct iwl_priv *priv);
const u8 *iwl_eeprom_query_addr(const struct iwl_shared *shrd, size_t offset); const u8 *iwl_eeprom_query_addr(const struct iwl_shared *shrd, size_t offset);
u16 iwl_eeprom_query16(const struct iwl_shared *shrd, size_t offset); u16 iwl_eeprom_query16(const struct iwl_shared *shrd, size_t offset);
int iwl_init_channel_map(struct iwl_priv *priv); int iwl_init_channel_map(struct iwl_priv *priv);
......
...@@ -161,7 +161,7 @@ int iwlagn_mac_setup_register(struct iwl_priv *priv, ...@@ -161,7 +161,7 @@ int iwlagn_mac_setup_register(struct iwl_priv *priv,
hw->flags |= IEEE80211_HW_SUPPORTS_PS | hw->flags |= IEEE80211_HW_SUPPORTS_PS |
IEEE80211_HW_SUPPORTS_DYNAMIC_PS; IEEE80211_HW_SUPPORTS_DYNAMIC_PS;
if (cfg(priv)->sku & EEPROM_SKU_CAP_11N_ENABLE) if (hw_params(priv).sku & EEPROM_SKU_CAP_11N_ENABLE)
hw->flags |= IEEE80211_HW_SUPPORTS_DYNAMIC_SMPS | hw->flags |= IEEE80211_HW_SUPPORTS_DYNAMIC_SMPS |
IEEE80211_HW_SUPPORTS_STATIC_SMPS; IEEE80211_HW_SUPPORTS_STATIC_SMPS;
...@@ -633,7 +633,7 @@ static int iwlagn_mac_ampdu_action(struct ieee80211_hw *hw, ...@@ -633,7 +633,7 @@ static int iwlagn_mac_ampdu_action(struct ieee80211_hw *hw,
IWL_DEBUG_HT(priv, "A-MPDU action on addr %pM tid %d\n", IWL_DEBUG_HT(priv, "A-MPDU action on addr %pM tid %d\n",
sta->addr, tid); sta->addr, tid);
if (!(cfg(priv)->sku & EEPROM_SKU_CAP_11N_ENABLE)) if (!(hw_params(priv).sku & EEPROM_SKU_CAP_11N_ENABLE))
return -EACCES; return -EACCES;
IWL_DEBUG_MAC80211(priv, "enter\n"); IWL_DEBUG_MAC80211(priv, "enter\n");
......
...@@ -282,7 +282,6 @@ enum iwl_led_mode { ...@@ -282,7 +282,6 @@ enum iwl_led_mode {
* @max_data_size: The maximal length of the fw data section * @max_data_size: The maximal length of the fw data section
* @valid_tx_ant: valid transmit antenna * @valid_tx_ant: valid transmit antenna
* @valid_rx_ant: valid receive antenna * @valid_rx_ant: valid receive antenna
* @sku: sku information from EEPROM
* @eeprom_ver: EEPROM version * @eeprom_ver: EEPROM version
* @eeprom_calib_ver: EEPROM calibration version * @eeprom_calib_ver: EEPROM calibration version
* @lib: pointer to the lib ops * @lib: pointer to the lib ops
...@@ -321,7 +320,6 @@ struct iwl_cfg { ...@@ -321,7 +320,6 @@ struct iwl_cfg {
const u32 max_inst_size; const u32 max_inst_size;
u8 valid_tx_ant; u8 valid_tx_ant;
u8 valid_rx_ant; u8 valid_rx_ant;
u16 sku;
u16 eeprom_ver; u16 eeprom_ver;
u16 eeprom_calib_ver; u16 eeprom_calib_ver;
const struct iwl_lib_ops *lib; const struct iwl_lib_ops *lib;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment