linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ivo van Doorn <ivdoorn@gmail.com>
To: "John W. Linville" <linville@tuxdriver.com>
Cc: linux-wireless@vger.kernel.org, rt2400-devel@lists.sourceforge.net
Subject: [PATCH 2/5] rt2x00: Store retry limit values
Date: Tue, 2 Dec 2008 18:20:04 +0100	[thread overview]
Message-ID: <200812021820.05124.IvDoorn@gmail.com> (raw)
In-Reply-To: <200812021819.48603.IvDoorn@gmail.com>

Store retry limit values in the rt2x00dev structure.
This allows the removal of the FIXME where we assumed
the long retry is only used when working with RTS frames.

Instead we should check the current retry limit values
and decide if the required retry count for this frame
is a long or short retry.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
---
 drivers/net/wireless/rt2x00/rt2x00.h       |    6 ++++++
 drivers/net/wireless/rt2x00/rt2x00config.c |    2 ++
 drivers/net/wireless/rt2x00/rt2x00queue.c  |    9 +--------
 3 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/drivers/net/wireless/rt2x00/rt2x00.h b/drivers/net/wireless/rt2x00/rt2x00.h
index 780ba73..e7ed56d 100644
--- a/drivers/net/wireless/rt2x00/rt2x00.h
+++ b/drivers/net/wireless/rt2x00/rt2x00.h
@@ -803,6 +803,12 @@ struct rt2x00_dev {
 	u16 tx_power;
 
 	/*
+	 * Current retry values.
+	 */
+	u8 short_retry;
+	u8 long_retry;
+
+	/*
 	 * Rssi <-> Dbm offset
 	 */
 	u8 rssi_offset;
diff --git a/drivers/net/wireless/rt2x00/rt2x00config.c b/drivers/net/wireless/rt2x00/rt2x00config.c
index 7c62ce1..b3bc8b4 100644
--- a/drivers/net/wireless/rt2x00/rt2x00config.c
+++ b/drivers/net/wireless/rt2x00/rt2x00config.c
@@ -194,6 +194,8 @@ void rt2x00lib_config(struct rt2x00_dev *rt2x00dev,
 
 	rt2x00dev->curr_band = conf->channel->band;
 	rt2x00dev->tx_power = conf->power_level;
+	rt2x00dev->short_retry = conf->short_frame_max_tx_count;
+	rt2x00dev->long_retry = conf->long_frame_max_tx_count;
 
 	rt2x00dev->rx_status.band = conf->channel->band;
 	rt2x00dev->rx_status.freq = conf->channel->center_freq;
diff --git a/drivers/net/wireless/rt2x00/rt2x00queue.c b/drivers/net/wireless/rt2x00/rt2x00queue.c
index b8de9d2..7f908a1 100644
--- a/drivers/net/wireless/rt2x00/rt2x00queue.c
+++ b/drivers/net/wireless/rt2x00/rt2x00queue.c
@@ -231,14 +231,7 @@ static void rt2x00queue_create_tx_descriptor(struct queue_entry *entry,
 	 * Determine retry information.
 	 */
 	txdesc->retry_limit = tx_info->control.rates[0].count - 1;
-	/*
-	 * XXX: If at this point we knew whether the HW is going to use
-	 *	the RETRY_MODE bit or the retry_limit (currently all
-	 *	use the RETRY_MODE bit) we could do something like b43
-	 *	does, set the RETRY_MODE bit when the RC algorithm is
-	 *	requesting more than the long retry limit.
-	 */
-	if (tx_info->control.rates[0].flags & IEEE80211_TX_RC_USE_RTS_CTS)
+	if (txdesc->retry_limit >= rt2x00dev->long_retry)
 		__set_bit(ENTRY_TXD_RETRY_MODE, &txdesc->flags);
 
 	/*
-- 
1.5.6.1


  reply	other threads:[~2008-12-02 17:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-02 17:19 Please pull 'upstream' branch of rt2x00 Ivo van Doorn
2008-12-02 17:19 ` [PATCH 1/5] rt2x00: Optimize IV/EIV handling Ivo van Doorn
2008-12-02 17:20   ` Ivo van Doorn [this message]
2008-12-02 17:20     ` [PATCH 3/5] rt2x00: Remove duplicate code Ivo van Doorn
2008-12-02 17:20       ` [PATCH 4/5] rt2x00: Implement HW encryption (rt2500usb) Ivo van Doorn
2008-12-02 17:20         ` [PATCH 5/5] rt2x00: Release rt2x00 2.2.3 Ivo van Doorn

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=200812021820.05124.IvDoorn@gmail.com \
    --to=ivdoorn@gmail.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=rt2400-devel@lists.sourceforge.net \
    /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).