public inbox for linux-wireless@vger.kernel.org
 help / color / mirror / Atom feed
From: Reinette Chatre <reinette.chatre@intel.com>
To: linville@tuxdriver.com
Cc: linux-wireless@vger.kernel.org,
	ipw3945-devel@lists.sourceforge.net,
	Wey-Yi Guy <wey-yi.w.guy@intel.com>,
	Reinette Chatre <reinette.chatre@intel.com>
Subject: [PATCH 01/14] iwlwifi: revert to active table when rate is not valid
Date: Fri, 24 Jul 2009 11:13:00 -0700	[thread overview]
Message-ID: <1248459194-10239-2-git-send-email-reinette.chatre@intel.com> (raw)
In-Reply-To: <1248459194-10239-1-git-send-email-reinette.chatre@intel.com>

From: Wey-Yi Guy <wey-yi.w.guy@intel.com>

When performing rate scaling, if detected that the new rate
index is invalid, clear the search_better_tbl flag
so it will not be stuck in the loop.

Since the search table is already set up in uCode,
we need to empty out the the search table;
revert back to the "active" rate and throughput info.
Also pass the "active" table setup to uCode to make
sure the rate scale is functioning correctly.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
---
 drivers/net/wireless/iwlwifi/iwl-agn-rs.c |   37 +++++++++++++++++++++++++----
 1 files changed, 32 insertions(+), 5 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
index 6328041..40207da 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
@@ -2003,6 +2003,25 @@ static void rs_stay_in_table(struct iwl_lq_sta *lq_sta)
 }
 
 /*
+ * setup rate table in uCode
+ * return rate_n_flags as used in the table
+ */
+static u32 rs_update_rate_tbl(struct iwl_priv *priv,
+				struct iwl_lq_sta *lq_sta,
+				struct iwl_scale_tbl_info *tbl,
+				int index, u8 is_green)
+{
+	u32 rate;
+
+	/* Update uCode's rate table. */
+	rate = rate_n_flags_from_tbl(priv, tbl, index, is_green);
+	rs_fill_link_cmd(priv, lq_sta, rate);
+	iwl_send_lq_cmd(priv, &lq_sta->lq, CMD_ASYNC);
+
+	return rate;
+}
+
+/*
  * Do rate scaling and search for new modulation mode.
  */
 static void rs_rate_scale_perform(struct iwl_priv *priv,
@@ -2098,6 +2117,16 @@ static void rs_rate_scale_perform(struct iwl_priv *priv,
 
 	if (!((1 << index) & rate_scale_index_msk)) {
 		IWL_ERR(priv, "Current Rate is not valid\n");
+		if (lq_sta->search_better_tbl) {
+			/* revert to active table if search table is not valid*/
+			tbl->lq_type = LQ_NONE;
+			lq_sta->search_better_tbl = 0;
+			tbl = &(lq_sta->lq_info[lq_sta->active_tbl]);
+			/* get "active" rate info */
+			index = iwl_hwrate_to_plcp_idx(tbl->current_rate);
+			rate = rs_update_rate_tbl(priv, lq_sta,
+						  tbl, index, is_green);
+		}
 		return;
 	}
 
@@ -2308,11 +2337,9 @@ static void rs_rate_scale_perform(struct iwl_priv *priv,
 
 lq_update:
 	/* Replace uCode's rate table for the destination station. */
-	if (update_lq) {
-		rate = rate_n_flags_from_tbl(priv, tbl, index, is_green);
-		rs_fill_link_cmd(priv, lq_sta, rate);
-		iwl_send_lq_cmd(priv, &lq_sta->lq, CMD_ASYNC);
-	}
+	if (update_lq)
+		rate = rs_update_rate_tbl(priv, lq_sta,
+					  tbl, index, is_green);
 
 	/* Should we stay with this modulation mode, or search for a new one? */
 	rs_stay_in_table(lq_sta);
-- 
1.5.6.3


  reply	other threads:[~2009-07-24 18:13 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-24 18:12 [PATCH 0/14] iwlwifi driver updates 07/24/2009 Reinette Chatre
2009-07-24 18:13 ` Reinette Chatre [this message]
2009-07-24 18:13 ` [PATCH 02/14] iwlwifi: critical temperature enter/exit condition Reinette Chatre
2009-07-24 18:13 ` [PATCH 03/14] iwlwifi: Thermal Throttling Management - Part 1 Reinette Chatre
2009-07-24 18:13 ` [PATCH 04/14] iwlwifi: Thermal Throttling Management - part 2 Reinette Chatre
2009-07-27 22:29   ` Johannes Berg
2009-07-27 22:46     ` reinette chatre
2009-07-28  7:33       ` Johannes Berg
2009-07-28  7:47         ` reinette chatre
2009-07-24 18:13 ` [PATCH 05/14] iwlwifi: Thermal Throttling debugfs function Reinette Chatre
2009-07-24 18:13 ` [PATCH 06/14] iwlwifi: fix up command sending Reinette Chatre
2009-07-24 18:13 ` [PATCH 07/14] iwlwifi: remove command callback return value Reinette Chatre
2009-07-24 18:13 ` [PATCH 08/14] iwlwifi: fix TX queue race Reinette Chatre
2009-07-24 18:13 ` [PATCH 09/14] iwlwifi: print packet contents in error case Reinette Chatre
2009-07-24 18:13 ` [PATCH 10/14] iwlwifi: Name fix for MPDU density for TX aggregation Reinette Chatre
2009-07-24 18:13 ` [PATCH 11/14] iwlwifi: fix LED config option Reinette Chatre
2009-07-24 18:13 ` [PATCH 12/14] iwlwifi: debugFs to enable/disable 40MHz channel support Reinette Chatre
2009-07-24 21:40   ` Gábor Stefanik
2009-07-25 17:24     ` Guy, Wey-Yi W
2009-07-24 18:13 ` [PATCH 13/14] iwlagn: fix null pointer access during ucode load on 1000 Reinette Chatre
2009-07-24 18:13 ` [PATCH 14/14] iwlagn: fix sparse warning when compiling without debug Reinette Chatre
2009-07-24 18:13 ` [PATCH v2.6.31] iwlwifi: fix TX queue race Reinette Chatre

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=1248459194-10239-2-git-send-email-reinette.chatre@intel.com \
    --to=reinette.chatre@intel.com \
    --cc=ipw3945-devel@lists.sourceforge.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=wey-yi.w.guy@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox