All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wey-Yi Guy <wey-yi.w.guy@intel.com>
To: linville@tuxdriver.com
Cc: linux-wireless@vger.kernel.org,
	ipw3945-devel@lists.sourceforge.net,
	Tomas Winkler <tomas.winkler@intel.com>,
	Wey-Yi Guy <wey-yi.w.guy@intel.com>
Subject: [PATCH 01/10] iwlwifi: fix default LQ table in 5.2 band
Date: Sat, 11 Sep 2010 09:08:29 -0700	[thread overview]
Message-ID: <1284221318-28281-2-git-send-email-wey-yi.w.guy@intel.com> (raw)
In-Reply-To: <1284221318-28281-1-git-send-email-wey-yi.w.guy@intel.com>

From: Tomas Winkler <tomas.winkler@intel.com>

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>
---
 drivers/net/wireless/iwlwifi/iwl-agn-rs.h |    9 ---------
 drivers/net/wireless/iwlwifi/iwl-sta.c    |   19 ++++++++-----------
 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 3970ab1..357cdb2 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 ccd0902..6edd034 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);
-- 
1.7.0.4


  reply	other threads:[~2010-09-11 16:06 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-11 16:08 [PATCH 00/10] iwlwifi update for 2.6.37 Wey-Yi Guy
2010-09-11 16:08 ` Wey-Yi Guy [this message]
2010-09-11 16:08 ` [PATCH 02/10] iwlwifi: remember the last uCode sysassert error code Wey-Yi Guy
2010-09-11 16:08 ` [PATCH 03/10] iwlwifi: fix PAN parameters while scanning Wey-Yi Guy
2010-09-11 16:08 ` [PATCH 04/10] iwlwifi: implement beacon interval change Wey-Yi Guy
2010-09-11 16:08 ` [PATCH 05/10] iwlwifi: allow configure protection mode Wey-Yi Guy
2010-09-11 16:08 ` [PATCH 06/10] iwlwifi: avoid sending too many commands Wey-Yi Guy
2010-09-11 16:08 ` [PATCH 07/10] iwlwifi: improve timing handling with dual-mode Wey-Yi Guy
2010-09-11 16:08 ` [PATCH 08/10] iwlwifi: fix and describe iwl_adjust_beacon_interval Wey-Yi Guy
2010-09-11 16:08 ` [PATCH 09/10] iwlwifi: make sure runtime calibration is enabled after association Wey-Yi Guy
2010-09-11 16:08 ` [PATCH 10/10] iwlwifi: remove code repetition Wey-Yi Guy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1284221318-28281-2-git-send-email-wey-yi.w.guy@intel.com \
    --to=wey-yi.w.guy@intel.com \
    --cc=ipw3945-devel@lists.sourceforge.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=tomas.winkler@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.