From: Tomas Winkler Date: Mon, 23 Aug 2010 21:00:54 +0000 (-0700) Subject: iwlwifi: fix default LQ table in 5.2 band X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=cf6da94acb1e158c8efe0d184ac757829fbf9632;p=linux-beck.git iwlwifi: fix default LQ table in 5.2 band The default LQ is filled decreasingly using iwl_get_prev_ieee_rate from a starting rate. Since the starting rate is already the lowest one for a specific band it should be actually filled evenly with the starting rate: 1M and 6M for 5.2GHZ and 2.4GH respectively. The bug is that for for A or G-only it decreases to CCK rates which are not supported. iwl_get_prev_ieee_rate function is just not band aware. This affects broadcast station which lq table is not updated by rs algorithm G-only scenario is not treated by this patch iwl_get_prev_ieee_rate is removed completely as it is not used in other contexts Signed-off-by: Tomas Winkler Signed-off-by: Wey-Yi Guy --- diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-rs.h b/drivers/net/wireless/iwlwifi/iwl-agn-rs.h index 3970ab1deaf9..357cdb26f16d 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn-rs.h +++ b/drivers/net/wireless/iwlwifi/iwl-agn-rs.h @@ -453,15 +453,6 @@ static inline u8 first_antenna(u8 mask) } -static inline u8 iwl_get_prev_ieee_rate(u8 rate_index) -{ - u8 rate = iwl_rates[rate_index].prev_ieee; - - if (rate == IWL_RATE_INVALID) - rate = rate_index; - return rate; -} - static inline u8 iwl3945_get_prev_ieee_rate(u8 rate_index) { u8 rate = iwl3945_rates[rate_index].prev_ieee; diff --git a/drivers/net/wireless/iwlwifi/iwl-sta.c b/drivers/net/wireless/iwlwifi/iwl-sta.c index ccd09027c7cd..6edd0341dfe2 100644 --- a/drivers/net/wireless/iwlwifi/iwl-sta.c +++ b/drivers/net/wireless/iwlwifi/iwl-sta.c @@ -386,7 +386,8 @@ static struct iwl_link_quality_cmd *iwl_sta_alloc_lq(struct iwl_priv *priv, { int i, r; struct iwl_link_quality_cmd *link_cmd; - u32 rate_flags; + u32 rate_flags = 0; + __le32 rate_n_flags; link_cmd = kzalloc(sizeof(struct iwl_link_quality_cmd), GFP_KERNEL); if (!link_cmd) { @@ -400,18 +401,14 @@ static struct iwl_link_quality_cmd *iwl_sta_alloc_lq(struct iwl_priv *priv, else r = IWL_RATE_1M_INDEX; - for (i = 0; i < LINK_QUAL_MAX_RETRY_NUM; i++) { - rate_flags = 0; - if (r >= IWL_FIRST_CCK_RATE && r <= IWL_LAST_CCK_RATE) - rate_flags |= RATE_MCS_CCK_MSK; + if (r >= IWL_FIRST_CCK_RATE && r <= IWL_LAST_CCK_RATE) + rate_flags |= RATE_MCS_CCK_MSK; - rate_flags |= first_antenna(priv->hw_params.valid_tx_ant) << + rate_flags |= first_antenna(priv->hw_params.valid_tx_ant) << RATE_MCS_ANT_POS; - - link_cmd->rs_table[i].rate_n_flags = - iwl_hw_set_rate_n_flags(iwl_rates[r].plcp, rate_flags); - r = iwl_get_prev_ieee_rate(r); - } + rate_n_flags = iwl_hw_set_rate_n_flags(iwl_rates[r].plcp, rate_flags); + for (i = 0; i < LINK_QUAL_MAX_RETRY_NUM; i++) + link_cmd->rs_table[i].rate_n_flags = rate_n_flags; link_cmd->general_params.single_stream_ant_msk = first_antenna(priv->hw_params.valid_tx_ant);