aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomas Winkler <tomas.winkler@intel.com>2010-08-23 17:00:54 -0400
committerWey-Yi Guy <wey-yi.w.guy@intel.com>2010-09-11 11:50:44 -0400
commitcf6da94acb1e158c8efe0d184ac757829fbf9632 (patch)
tree4293eb497cce91c0b691c4d55908c9e5b6da5fe6
parent950094cb06f3cfd75338d8c197d1d3924724b1a8 (diff)
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 <tomas.winkler@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-rs.h9
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-sta.c19
2 files changed, 8 insertions, 20 deletions
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)
453} 453}
454 454
455 455
456static inline u8 iwl_get_prev_ieee_rate(u8 rate_index)
457{
458 u8 rate = iwl_rates[rate_index].prev_ieee;
459
460 if (rate == IWL_RATE_INVALID)
461 rate = rate_index;
462 return rate;
463}
464
465static inline u8 iwl3945_get_prev_ieee_rate(u8 rate_index) 456static inline u8 iwl3945_get_prev_ieee_rate(u8 rate_index)
466{ 457{
467 u8 rate = iwl3945_rates[rate_index].prev_ieee; 458 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,
386{ 386{
387 int i, r; 387 int i, r;
388 struct iwl_link_quality_cmd *link_cmd; 388 struct iwl_link_quality_cmd *link_cmd;
389 u32 rate_flags; 389 u32 rate_flags = 0;
390 __le32 rate_n_flags;
390 391
391 link_cmd = kzalloc(sizeof(struct iwl_link_quality_cmd), GFP_KERNEL); 392 link_cmd = kzalloc(sizeof(struct iwl_link_quality_cmd), GFP_KERNEL);
392 if (!link_cmd) { 393 if (!link_cmd) {
@@ -400,18 +401,14 @@ static struct iwl_link_quality_cmd *iwl_sta_alloc_lq(struct iwl_priv *priv,
400 else 401 else
401 r = IWL_RATE_1M_INDEX; 402 r = IWL_RATE_1M_INDEX;
402 403
403 for (i = 0; i < LINK_QUAL_MAX_RETRY_NUM; i++) { 404 if (r >= IWL_FIRST_CCK_RATE && r <= IWL_LAST_CCK_RATE)
404 rate_flags = 0; 405 rate_flags |= RATE_MCS_CCK_MSK;
405 if (r >= IWL_FIRST_CCK_RATE && r <= IWL_LAST_CCK_RATE)
406 rate_flags |= RATE_MCS_CCK_MSK;
407 406
408 rate_flags |= first_antenna(priv->hw_params.valid_tx_ant) << 407 rate_flags |= first_antenna(priv->hw_params.valid_tx_ant) <<
409 RATE_MCS_ANT_POS; 408 RATE_MCS_ANT_POS;
410 409 rate_n_flags = iwl_hw_set_rate_n_flags(iwl_rates[r].plcp, rate_flags);
411 link_cmd->rs_table[i].rate_n_flags = 410 for (i = 0; i < LINK_QUAL_MAX_RETRY_NUM; i++)
412 iwl_hw_set_rate_n_flags(iwl_rates[r].plcp, rate_flags); 411 link_cmd->rs_table[i].rate_n_flags = rate_n_flags;
413 r = iwl_get_prev_ieee_rate(r);
414 }
415 412
416 link_cmd->general_params.single_stream_ant_msk = 413 link_cmd->general_params.single_stream_ant_msk =
417 first_antenna(priv->hw_params.valid_tx_ant); 414 first_antenna(priv->hw_params.valid_tx_ant);