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: Helmut Schaa <helmut.schaa@googlemail.com>,
	rt2x00 Users List <users@rt2x00.serialmonkey.com>,
	linux-wireless@vger.kernel.org,
	Gertjan van Wingerde <gwingerde@gmail.com>
Subject: [PATCH 09/14] rt2x00: Fix tx status reporting when falling back to the lowest rate
Date: Mon, 14 Jun 2010 22:12:26 +0200	[thread overview]
Message-ID: <201006142212.27713.IvDoorn@gmail.com> (raw)
In-Reply-To: <201006142212.02575.IvDoorn@gmail.com>

From: Helmut Schaa <helmut.schaa@googlemail.com>

In some corner cases the reported tx rates/retries didn't match the really
used ones.

The hardware lowers the tx rate on each consecutive retry by 1 (but won't
fall back from MCS to legacy rates) _until_ it reaches the lowest one.

In case the frame wasn't sent succesful the number of retries is 7 and if
a rate index <7 was used the previous code reported negative rate indexes
which were then ignored by the rate control algorithm and mac80211.

Instead, report the remaining number of retries to have happened with
the lowest rate (index 0). This should give the rate control algorithm
slightly more accurate information about the used tx rates/retries.

Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
---
 drivers/net/wireless/rt2x00/rt2x00dev.c |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/drivers/net/wireless/rt2x00/rt2x00dev.c b/drivers/net/wireless/rt2x00/rt2x00dev.c
index e7a208d..918451a 100644
--- a/drivers/net/wireless/rt2x00/rt2x00dev.c
+++ b/drivers/net/wireless/rt2x00/rt2x00dev.c
@@ -258,11 +258,22 @@ void rt2x00lib_txdone(struct queue_entry *entry,
 	/*
 	 * Frame was send with retries, hardware tried
 	 * different rates to send out the frame, at each
-	 * retry it lowered the rate 1 step.
+	 * retry it lowered the rate 1 step except when the
+	 * lowest rate was used.
 	 */
 	for (i = 0; i < retry_rates && i < IEEE80211_TX_MAX_RATES; i++) {
 		tx_info->status.rates[i].idx = rate_idx - i;
 		tx_info->status.rates[i].flags = rate_flags;
+
+		if (rate_idx - i == 0) {
+			/*
+			 * The lowest rate (index 0) was used until the
+			 * number of max retries was reached.
+			 */
+			tx_info->status.rates[i].count = retry_rates - i;
+			i++;
+			break;
+		}
 		tx_info->status.rates[i].count = 1;
 	}
 	if (i < (IEEE80211_TX_MAX_RATES - 1))
-- 
1.6.6.1


  reply	other threads:[~2010-06-14 20:15 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-14 20:08 [PATCH 01/14] rt2x00: clarify meaning of txdone flags Ivo van Doorn
2010-06-14 20:09 ` [PATCH 02/14] rt2x00: don't use TXDONE_FALLBACK as success indicator Ivo van Doorn
2010-06-14 20:09   ` [PATCH 03/14] rt2x00: only set TXDONE_FALLBACK in rt2800pci if the frame was retried Ivo van Doorn
2010-06-14 20:10     ` [PATCH 04/14] rt2x00: Fix IEEE80211_TX_CTL_MORE_FRAMES handling Ivo van Doorn
2010-06-14 20:10       ` [PATCH 05/14] rt2x00: Add comment about BBP1_TX_POWER Ivo van Doorn
2010-06-14 20:11         ` [PATCH 06/14] rt2x00: Fix TX_STA_FIFO handling Ivo van Doorn
2010-06-14 20:11           ` [PATCH 07/14] rt2x00: Fix typo in rt2800_config_txpower Ivo van Doorn
2010-06-14 20:12             ` [PATCH 08/14] rt2x00: provide mac80211 a suitable max_rates value Ivo van Doorn
2010-06-14 20:12               ` Ivo van Doorn [this message]
2010-06-14 20:12                 ` [PATCH 10/14] rt2x00: Enable fallback rates for rt61pci and rt73usb Ivo van Doorn
2010-06-14 20:13                   ` [PATCH 11/14] rt2x00: Update author rt2800lib Ivo van Doorn
2010-06-14 20:13                     ` [PATCH 12/14] rt2x00: Limit TX done looping to number of TX ring entries Ivo van Doorn
2010-06-14 20:13                       ` [PATCH 13/14] rt2x00: Enable HW crypto by default Ivo van Doorn
2010-06-14 20:14                         ` [PATCH 14/14] rt2x00: Synchronize WCID initialization with legacy driver 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=201006142212.27713.IvDoorn@gmail.com \
    --to=ivdoorn@gmail.com \
    --cc=gwingerde@gmail.com \
    --cc=helmut.schaa@googlemail.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=users@rt2x00.serialmonkey.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).