diff options
author | Tomas Winkler <tomas.winkler@intel.com> | 2008-10-07 21:37:29 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-10-31 19:00:03 -0400 |
commit | 5d664a41a0a8c612f66bcb3c2a6f395e9afa6beb (patch) | |
tree | fa256b0edb1a7d94dac56c639cce19adacf8c1c8 /drivers | |
parent | be5d56ed885a2897ec813eab4a8055d495816e9a (diff) |
iwlwifi: take a valid antenna upon rate scale init
This patch selects a valid antennae upon rate scale init. This solves a
SYSASSERT complaining that the driver is setting a non valid antenna in
the LQ CMD.
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-5000.c | 6 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-agn-rs.h | 10 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-sta.c | 9 |
3 files changed, 20 insertions, 5 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-5000.c b/drivers/net/wireless/iwlwifi/iwl-5000.c index c1300fb71615..56a3f0c84a1e 100644 --- a/drivers/net/wireless/iwlwifi/iwl-5000.c +++ b/drivers/net/wireless/iwlwifi/iwl-5000.c | |||
@@ -811,10 +811,14 @@ static int iwl5000_hw_set_hw_params(struct iwl_priv *priv) | |||
811 | 811 | ||
812 | switch (priv->hw_rev & CSR_HW_REV_TYPE_MSK) { | 812 | switch (priv->hw_rev & CSR_HW_REV_TYPE_MSK) { |
813 | case CSR_HW_REV_TYPE_5100: | 813 | case CSR_HW_REV_TYPE_5100: |
814 | priv->hw_params.tx_chains_num = 1; | ||
815 | priv->hw_params.rx_chains_num = 2; | ||
816 | priv->hw_params.valid_tx_ant = ANT_B; | ||
817 | priv->hw_params.valid_rx_ant = ANT_AB; | ||
818 | break; | ||
814 | case CSR_HW_REV_TYPE_5150: | 819 | case CSR_HW_REV_TYPE_5150: |
815 | priv->hw_params.tx_chains_num = 1; | 820 | priv->hw_params.tx_chains_num = 1; |
816 | priv->hw_params.rx_chains_num = 2; | 821 | priv->hw_params.rx_chains_num = 2; |
817 | /* FIXME: move to ANT_A, ANT_B, ANT_C enum */ | ||
818 | priv->hw_params.valid_tx_ant = ANT_A; | 822 | priv->hw_params.valid_tx_ant = ANT_A; |
819 | priv->hw_params.valid_rx_ant = ANT_AB; | 823 | priv->hw_params.valid_rx_ant = ANT_AB; |
820 | break; | 824 | break; |
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-rs.h b/drivers/net/wireless/iwlwifi/iwl-agn-rs.h index d148d73635eb..bac91f1d2aa8 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn-rs.h +++ b/drivers/net/wireless/iwlwifi/iwl-agn-rs.h | |||
@@ -284,6 +284,16 @@ static inline u8 num_of_ant(u8 mask) | |||
284 | !!((mask) & ANT_C); | 284 | !!((mask) & ANT_C); |
285 | } | 285 | } |
286 | 286 | ||
287 | static inline u8 first_antenna(u8 mask) | ||
288 | { | ||
289 | if (mask & ANT_A) | ||
290 | return ANT_A; | ||
291 | if (mask & ANT_B) | ||
292 | return ANT_B; | ||
293 | return ANT_C; | ||
294 | } | ||
295 | |||
296 | |||
287 | static inline u8 iwl4965_get_prev_ieee_rate(u8 rate_index) | 297 | static inline u8 iwl4965_get_prev_ieee_rate(u8 rate_index) |
288 | { | 298 | { |
289 | u8 rate = iwl_rates[rate_index].prev_ieee; | 299 | u8 rate = iwl_rates[rate_index].prev_ieee; |
diff --git a/drivers/net/wireless/iwlwifi/iwl-sta.c b/drivers/net/wireless/iwlwifi/iwl-sta.c index e02c4717c93c..a28a8decc79c 100644 --- a/drivers/net/wireless/iwlwifi/iwl-sta.c +++ b/drivers/net/wireless/iwlwifi/iwl-sta.c | |||
@@ -845,7 +845,7 @@ static void iwl_sta_init_lq(struct iwl_priv *priv, const u8 *addr, int is_ap) | |||
845 | struct iwl_link_quality_cmd link_cmd = { | 845 | struct iwl_link_quality_cmd link_cmd = { |
846 | .reserved1 = 0, | 846 | .reserved1 = 0, |
847 | }; | 847 | }; |
848 | u16 rate_flags; | 848 | u32 rate_flags; |
849 | 849 | ||
850 | /* Set up the rate scaling to start at selected rate, fall back | 850 | /* Set up the rate scaling to start at selected rate, fall back |
851 | * all the way down to 1M in IEEE order, and then spin on 1M */ | 851 | * all the way down to 1M in IEEE order, and then spin on 1M */ |
@@ -861,15 +861,16 @@ static void iwl_sta_init_lq(struct iwl_priv *priv, const u8 *addr, int is_ap) | |||
861 | if (r >= IWL_FIRST_CCK_RATE && r <= IWL_LAST_CCK_RATE) | 861 | if (r >= IWL_FIRST_CCK_RATE && r <= IWL_LAST_CCK_RATE) |
862 | rate_flags |= RATE_MCS_CCK_MSK; | 862 | rate_flags |= RATE_MCS_CCK_MSK; |
863 | 863 | ||
864 | /* Use Tx antenna B only */ | 864 | rate_flags |= first_antenna(priv->hw_params.valid_tx_ant) << |
865 | rate_flags |= RATE_MCS_ANT_B_MSK; /*FIXME:RS*/ | 865 | RATE_MCS_ANT_POS; |
866 | 866 | ||
867 | link_cmd.rs_table[i].rate_n_flags = | 867 | link_cmd.rs_table[i].rate_n_flags = |
868 | iwl_hw_set_rate_n_flags(iwl_rates[r].plcp, rate_flags); | 868 | iwl_hw_set_rate_n_flags(iwl_rates[r].plcp, rate_flags); |
869 | r = iwl4965_get_prev_ieee_rate(r); | 869 | r = iwl4965_get_prev_ieee_rate(r); |
870 | } | 870 | } |
871 | 871 | ||
872 | link_cmd.general_params.single_stream_ant_msk = 2; | 872 | link_cmd.general_params.single_stream_ant_msk = |
873 | first_antenna(priv->hw_params.valid_tx_ant); | ||
873 | link_cmd.general_params.dual_stream_ant_msk = 3; | 874 | link_cmd.general_params.dual_stream_ant_msk = 3; |
874 | link_cmd.agg_params.agg_dis_start_th = 3; | 875 | link_cmd.agg_params.agg_dis_start_th = 3; |
875 | link_cmd.agg_params.agg_time_limit = cpu_to_le16(4000); | 876 | link_cmd.agg_params.agg_time_limit = cpu_to_le16(4000); |