From: Karl Beldan <karl.beldan@gmail.com>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: linux-wireless <linux-wireless@vger.kernel.org>,
Karl Beldan <karl.beldan@gmail.com>,
Karl Beldan <karl.beldan@rivierawaves.com>
Subject: [PATCH] mac80211: always pick a basic rate to tx RTS/CTS for pre-HT rates
Date: Fri, 5 Apr 2013 12:06:24 +0200 [thread overview]
Message-ID: <1365156384-6699-1-git-send-email-karl.beldan@gmail.com> (raw)
From: Karl Beldan <karl.beldan@rivierawaves.com>
When the 1st rate control entry is a pre-HT rate we want to set
rts_cts_rate_idx "as the fastest basic rate that is not faster than the
data rate"(code comments).
But in case some bss allowed rate indexes are lower than the lowest bss
basic rate, if the rate control selects a rate among the formers for its
1st rate control entry, rts_cts_rate_idx remains 0 and is not a basic
rate index.
This commit sets rts_cts_rate_idx to the lowest bss basic rate index in
this situation.
Note that the code assumes that lowest indexes == lowest bitrates.
Signed-off-by: Karl Beldan <karl.beldan@rivierawaves.com>
---
net/mac80211/tx.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index aad0bf5..c93483f 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -712,19 +712,22 @@ ieee80211_tx_h_rate_ctrl(struct ieee80211_tx_data *tx)
}
/*
- * set up the RTS/CTS rate as the fastest basic rate
- * that is not faster than the data rate
+ * Set up the RTS/CTS rate as the fastest basic rate
+ * that is not faster than the data rate unless there
+ * is no basic rate slower than the data rate, in which
+ * case we pick the slowest basic rate
*
* XXX: Should this check all retry rates?
*/
if (!(info->control.rates[0].flags & IEEE80211_TX_RC_MCS)) {
- s8 baserate = 0;
+ u32 basic_rates = tx->sdata->vif.bss_conf.basic_rates;
+ s8 baserate = basic_rates ? ffs(basic_rates - 1) : 0;
rate = &sband->bitrates[info->control.rates[0].idx];
for (i = 0; i < sband->n_bitrates; i++) {
/* must be a basic rate */
- if (!(tx->sdata->vif.bss_conf.basic_rates & BIT(i)))
+ if (!(basic_rates & BIT(i)))
continue;
/* must not be faster than the data rate */
if (sband->bitrates[i].bitrate > rate->bitrate)
--
1.8.2
next reply other threads:[~2013-04-05 10:10 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-05 10:06 Karl Beldan [this message]
2013-04-09 10:29 ` [PATCH] mac80211: always pick a basic rate to tx RTS/CTS for pre-HT rates Johannes Berg
2013-04-09 10:55 ` Karl Beldan
2013-04-09 11:05 ` Johannes Berg
2013-04-09 11:10 ` Karl Beldan
2013-04-09 11:16 ` Johannes Berg
2013-04-09 11:21 ` Karl Beldan
2013-04-11 10:02 ` Johannes Berg
2013-04-11 10:42 ` Karl Beldan
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=1365156384-6699-1-git-send-email-karl.beldan@gmail.com \
--to=karl.beldan@gmail.com \
--cc=johannes@sipsolutions.net \
--cc=karl.beldan@rivierawaves.com \
--cc=linux-wireless@vger.kernel.org \
/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