Commit 2587d36b authored by Johannes Berg's avatar Johannes Berg

iwlwifi: unify tx_chains_num setting

There's no need to copy the same code for all
devices since none of the 5000 series devices
(that don't have the RX SISO override) don't
set the rx_with_siso_diversity variable.
Reviewed-by: default avatarEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent 1023fdc4
...@@ -173,14 +173,6 @@ static void iwl1000_hw_set_hw_params(struct iwl_priv *priv) ...@@ -173,14 +173,6 @@ static void iwl1000_hw_set_hw_params(struct iwl_priv *priv)
{ {
priv->hw_params.ht40_channel = BIT(IEEE80211_BAND_2GHZ); priv->hw_params.ht40_channel = BIT(IEEE80211_BAND_2GHZ);
priv->hw_params.tx_chains_num =
num_of_ant(priv->hw_params.valid_tx_ant);
if (priv->cfg->rx_with_siso_diversity)
priv->hw_params.rx_chains_num = 1;
else
priv->hw_params.rx_chains_num =
num_of_ant(priv->hw_params.valid_rx_ant);
iwl1000_set_ct_threshold(priv); iwl1000_set_ct_threshold(priv);
/* Set initial sensitivity parameters */ /* Set initial sensitivity parameters */
...@@ -254,14 +246,6 @@ static void iwl2000_hw_set_hw_params(struct iwl_priv *priv) ...@@ -254,14 +246,6 @@ static void iwl2000_hw_set_hw_params(struct iwl_priv *priv)
{ {
priv->hw_params.ht40_channel = BIT(IEEE80211_BAND_2GHZ); priv->hw_params.ht40_channel = BIT(IEEE80211_BAND_2GHZ);
priv->hw_params.tx_chains_num =
num_of_ant(priv->hw_params.valid_tx_ant);
if (priv->cfg->rx_with_siso_diversity)
priv->hw_params.rx_chains_num = 1;
else
priv->hw_params.rx_chains_num =
num_of_ant(priv->hw_params.valid_rx_ant);
iwl2000_set_ct_threshold(priv); iwl2000_set_ct_threshold(priv);
/* Set initial sensitivity parameters */ /* Set initial sensitivity parameters */
...@@ -408,11 +392,6 @@ static void iwl5000_hw_set_hw_params(struct iwl_priv *priv) ...@@ -408,11 +392,6 @@ static void iwl5000_hw_set_hw_params(struct iwl_priv *priv)
priv->hw_params.ht40_channel = BIT(IEEE80211_BAND_2GHZ) | priv->hw_params.ht40_channel = BIT(IEEE80211_BAND_2GHZ) |
BIT(IEEE80211_BAND_5GHZ); BIT(IEEE80211_BAND_5GHZ);
priv->hw_params.tx_chains_num =
num_of_ant(priv->hw_params.valid_tx_ant);
priv->hw_params.rx_chains_num =
num_of_ant(priv->hw_params.valid_rx_ant);
iwl5000_set_ct_threshold(priv); iwl5000_set_ct_threshold(priv);
/* Set initial sensitivity parameters */ /* Set initial sensitivity parameters */
...@@ -424,11 +403,6 @@ static void iwl5150_hw_set_hw_params(struct iwl_priv *priv) ...@@ -424,11 +403,6 @@ static void iwl5150_hw_set_hw_params(struct iwl_priv *priv)
priv->hw_params.ht40_channel = BIT(IEEE80211_BAND_2GHZ) | priv->hw_params.ht40_channel = BIT(IEEE80211_BAND_2GHZ) |
BIT(IEEE80211_BAND_5GHZ); BIT(IEEE80211_BAND_5GHZ);
priv->hw_params.tx_chains_num =
num_of_ant(priv->hw_params.valid_tx_ant);
priv->hw_params.rx_chains_num =
num_of_ant(priv->hw_params.valid_rx_ant);
iwl5150_set_ct_threshold(priv); iwl5150_set_ct_threshold(priv);
/* Set initial sensitivity parameters */ /* Set initial sensitivity parameters */
...@@ -623,14 +597,6 @@ static void iwl6000_hw_set_hw_params(struct iwl_priv *priv) ...@@ -623,14 +597,6 @@ static void iwl6000_hw_set_hw_params(struct iwl_priv *priv)
priv->hw_params.ht40_channel = BIT(IEEE80211_BAND_2GHZ) | priv->hw_params.ht40_channel = BIT(IEEE80211_BAND_2GHZ) |
BIT(IEEE80211_BAND_5GHZ); BIT(IEEE80211_BAND_5GHZ);
priv->hw_params.tx_chains_num =
num_of_ant(priv->hw_params.valid_tx_ant);
if (priv->cfg->rx_with_siso_diversity)
priv->hw_params.rx_chains_num = 1;
else
priv->hw_params.rx_chains_num =
num_of_ant(priv->hw_params.valid_rx_ant);
iwl6000_set_ct_threshold(priv); iwl6000_set_ct_threshold(priv);
/* Set initial sensitivity parameters */ /* Set initial sensitivity parameters */
......
...@@ -285,6 +285,14 @@ int iwl_eeprom_init_hw_params(struct iwl_priv *priv) ...@@ -285,6 +285,14 @@ int iwl_eeprom_init_hw_params(struct iwl_priv *priv)
return -EINVAL; return -EINVAL;
} }
priv->hw_params.tx_chains_num =
num_of_ant(priv->hw_params.valid_tx_ant);
if (priv->cfg->rx_with_siso_diversity)
priv->hw_params.rx_chains_num = 1;
else
priv->hw_params.rx_chains_num =
num_of_ant(priv->hw_params.valid_rx_ant);
IWL_INFO(priv, "Valid Tx ant: 0x%X, Valid Rx ant: 0x%X\n", IWL_INFO(priv, "Valid Tx ant: 0x%X, Valid Rx ant: 0x%X\n",
priv->hw_params.valid_tx_ant, priv->hw_params.valid_rx_ant); priv->hw_params.valid_tx_ant, priv->hw_params.valid_rx_ant);
......
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