linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Zhu Yi <yi.zhu@intel.com>
To: linville@tuxdriver.com
Cc: linux-wireless@vger.kernel.org, Zhu Yi <yi.zhu@intel.com>,
	Tomas Winkler <tomas.winkler@intel.com>
Subject: [PATCH] iwlwifi: add supp_rates to rate scale sta private data
Date: Thu, 27 Sep 2007 11:27:40 +0800	[thread overview]
Message-ID: <1190863679136-git-send-email-yi.zhu@intel.com> (raw)
In-Reply-To: <11908636781043-git-send-email-yi.zhu@intel.com>

This patch adds supp_rate bit mask to rate scale sta private data structre
and thus removes sta from the argument list in helper functions.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
---
 drivers/net/wireless/iwlwifi/iwl-4965-rs.c |   31 +++++++++++++--------------
 1 files changed, 15 insertions(+), 16 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/iwl-4965-rs.c b/drivers/net/wireless/iwlwifi/iwl-4965-rs.c
index b9d7ad8..bad7466 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965-rs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-4965-rs.c
@@ -115,6 +115,7 @@ struct iwl_rate_scale_priv {
 	u8 is_dup;
 	u8 phymode;
 	u8 ibss_sta_added;
+	u32 supp_rates;
 	u16 active_rate;
 	u16 active_siso_rate;
 	u16 active_mimo_rate;
@@ -132,8 +133,7 @@ static void rs_rate_scale_perform(struct iwl_priv *priv,
 				   struct sta_info *sta);
 static int rs_fill_link_cmd(struct iwl_rate_scale_priv *lq_data,
 			     struct iwl_rate *tx_mcs,
-			     struct iwl_link_quality_cmd *tbl,
-			     struct sta_info *sta);
+			     struct iwl_link_quality_cmd *tbl);
 
 
 static s32 expected_tpt_A[IWL_RATE_COUNT] = {
@@ -542,14 +542,13 @@ static u16 rs_get_adjacent_rate(u8 index, u16 rate_mask, int rate_type)
 
 static int rs_get_lower_rate(struct iwl_rate_scale_priv *lq_data,
 			     struct iwl_scale_tbl_info *tbl, u8 scale_index,
-			     u8 ht_possible, struct iwl_rate *mcs_rate,
-			     struct sta_info *sta)
+			     u8 ht_possible, struct iwl_rate *mcs_rate)
 {
-	u8 is_green = lq_data->is_green;
 	s32 low;
 	u16 rate_mask;
 	u16 high_low;
 	u8 switch_to_legacy = 0;
+	u8 is_green = lq_data->is_green;
 
 	/* check if we need to switch from HT to legacy rates.
 	 * assumption is that mandatory rates (1Mbps or 6Mbps)
@@ -576,9 +575,9 @@ static int rs_get_lower_rate(struct iwl_rate_scale_priv *lq_data,
 	if (is_legacy(tbl->lq_type)) {
 		if (lq_data->phymode == (u8) MODE_IEEE80211A)
 			rate_mask  = (u16)(rate_mask &
-			   (sta->supp_rates << IWL_FIRST_OFDM_RATE));
+			   (lq_data->supp_rates << IWL_FIRST_OFDM_RATE));
 		else
-			rate_mask = (u16)(rate_mask & sta->supp_rates);
+			rate_mask = (u16)(rate_mask & lq_data->supp_rates);
 	}
 
 	/* if we did switched from HT to legacy check current rate */
@@ -1391,10 +1390,10 @@ static void rs_rate_scale_perform(struct iwl_priv *priv,
 	if (is_legacy(tbl->lq_type)) {
 		if (lq_data->phymode == (u8) MODE_IEEE80211A)
 			rate_scale_index_msk = (u16) (rate_mask &
-				(sta->supp_rates << IWL_FIRST_OFDM_RATE));
+				(lq_data->supp_rates << IWL_FIRST_OFDM_RATE));
 		else
 			rate_scale_index_msk = (u16) (rate_mask &
-						      sta->supp_rates);
+						      lq_data->supp_rates);
 
 	} else
 		rate_scale_index_msk = rate_mask;
@@ -1434,7 +1433,7 @@ static void rs_rate_scale_perform(struct iwl_priv *priv,
 		rs_stay_in_table(lq_data);
 		if (update_lq) {
 			rs_mcs_from_tbl(&mcs_rate, tbl, index, is_green);
-			rs_fill_link_cmd(lq_data, &mcs_rate, &lq_data->lq, sta);
+			rs_fill_link_cmd(lq_data, &mcs_rate, &lq_data->lq);
 			rs_send_lq_cmd(priv, &lq_data->lq, CMD_ASYNC);
 		}
 		goto out;
@@ -1558,7 +1557,7 @@ static void rs_rate_scale_perform(struct iwl_priv *priv,
  lq_update:
 	if (update_lq) {
 		rs_mcs_from_tbl(&mcs_rate, tbl, index, is_green);
-		rs_fill_link_cmd(lq_data, &mcs_rate, &lq_data->lq, sta);
+		rs_fill_link_cmd(lq_data, &mcs_rate, &lq_data->lq);
 		rs_send_lq_cmd(priv, &lq_data->lq, CMD_ASYNC);
 	}
 	rs_stay_in_table(lq_data);
@@ -1584,7 +1583,7 @@ static void rs_rate_scale_perform(struct iwl_priv *priv,
 			IWL_DEBUG_HT("Switch current  mcs: %X index: %d\n",
 				     tbl->current_rate.rate_n_flags, index);
 			rs_fill_link_cmd(lq_data, &tbl->current_rate,
-					 &(lq_data->lq), sta);
+					 &lq_data->lq);
 			rs_send_lq_cmd(priv, &lq_data->lq, CMD_ASYNC);
 		}
 		tbl1 = &(lq_data->lq_info[lq_data->active_tbl]);
@@ -1680,7 +1679,7 @@ static void rs_initialize_lq(struct iwl_priv *priv,
 	rs_mcs_from_tbl(&mcs_rate, tbl, rate_idx, use_green);
 	tbl->current_rate.rate_n_flags = mcs_rate.rate_n_flags;
 	rs_get_expected_tpt_table(lq, tbl);
-	rs_fill_link_cmd(lq, &mcs_rate, &(lq->lq), sta);
+	rs_fill_link_cmd(lq, &mcs_rate, &lq->lq);
 	rs_send_lq_cmd(priv, &lq->lq, CMD_ASYNC);
  out:
 	return;
@@ -1799,6 +1798,7 @@ static void rs_rate_init(void *priv_rate, void *priv_sta,
 	struct iwl_rate_scale_priv *crl = priv_sta;
 
 	crl->flush_timer = 0;
+	crl->supp_rates = sta->supp_rates;
 	sta->txrate = 3;
 	for (j = 0; j < LQ_SIZE; j++)
 		for (i = 0; i < IWL_RATE_COUNT; i++)
@@ -1875,8 +1875,7 @@ static void rs_rate_init(void *priv_rate, void *priv_sta,
 
 static int rs_fill_link_cmd(struct iwl_rate_scale_priv *lq_data,
 			    struct iwl_rate *tx_mcs,
-			    struct iwl_link_quality_cmd *lq_cmd,
-			    struct sta_info *sta)
+			    struct iwl_link_quality_cmd *lq_cmd)
 {
 	int index = 0;
 	int rc = 0;
@@ -1934,7 +1933,7 @@ static int rs_fill_link_cmd(struct iwl_rate_scale_priv *lq_data,
 			lq_cmd->general_params.mimo_delimiter = index;
 
 		rs_get_lower_rate(lq_data, &tbl_type, rate_idx,
-				  use_ht_possible, &new_rate, sta);
+				  use_ht_possible, &new_rate);
 
 		if (is_legacy(tbl_type.lq_type)) {
 			if (ant_toggle_count < NUM_TRY_BEFORE_ANTENNA_TOGGLE)
-- 
1.5.1

  reply	other threads:[~2007-09-27  3:35 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <11908636643693-git-send-email-yi.zhu@intel.com>
2007-09-27  3:27 ` [PATCH] iwlwifi: replacing IPW with IWL in error messages Zhu Yi
2007-09-27  3:27   ` [PATCH] iwlwifi: workaournd REPLY_COMPRESSED_BA command in iwl_rx_handle Zhu Yi
2007-09-27  3:27     ` [PATCH] iwlwifi: Correction for sending beacon in config_ap Zhu Yi
2007-09-27  3:27       ` [PATCH] iwlwifi: clear station table in rxon unconditionally Zhu Yi
2007-09-27  3:27         ` [PATCH] iwlwifi: Fix typo in rate sacling algorithm Zhu Yi
2007-09-27  3:27           ` [PATCH] iwlwifi: fix add_station to avoid FW error Zhu Yi
2007-09-27  3:27             ` [PATCH] iwlwifi: removing unnecessary memset in 4965 rate scale Zhu Yi
2007-09-27  3:27               ` [PATCH] iwlwifi: add debugfs framework to " Zhu Yi
2007-09-27  3:27                 ` [PATCH] iwlwifi: add read rate scale table debugfs function Zhu Yi
2007-09-27  3:27                   ` [PATCH] iwlwifi: limit printouts on hot path Zhu Yi
2007-09-27  3:27                     ` Zhu Yi [this message]
2007-09-27  3:27                       ` [PATCH] iwlwifi: rs_rate_scale_perform clean up Zhu Yi
2007-09-27  3:27                         ` [PATCH] iwlwifi: set fixed rate through debugfs Zhu Yi
2007-09-27  3:27                           ` [PATCH] iwlwifi: add debugfs rate scale stats Zhu Yi
2007-09-27  3:27                             ` [PATCH] iwlwifi: Update iwlwifi version stamp to 1.1.17 Zhu Yi
2007-09-27  4:35                           ` [PATCH] iwlwifi: set fixed rate through debugfs Randy Dunlap
2007-09-27  4:43                             ` Zhu Yi
2007-09-27 14:26                               ` Randy Dunlap
2007-09-28  7:44                                 ` Tomas Winkler
2007-09-27  4:32   ` [PATCH] iwlwifi: replacing IPW with IWL in error messages Randy Dunlap
2007-09-27  4:42     ` Zhu Yi
2007-09-27 20:41 ` iwlwifi driver updates John W. Linville

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=1190863679136-git-send-email-yi.zhu@intel.com \
    --to=yi.zhu@intel.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).