Linux wireless drivers development
 help / color / mirror / Atom feed
From: Ashok Nagarajan <ashok@cozybit.com>
To: linux-wireless@vger.kernel.org
Cc: linville@tuxdriver.com, johannes@sipsolutions.net,
	devel@lists.open80211s.org, ashok@cozybit.com
Subject: [PATCH 2/3] cfg80211: Allow ieee80211g mandatory rate sets in 2.4GHz band
Date: Fri, 10 May 2013 17:50:52 -0700	[thread overview]
Message-ID: <1368233453-10581-2-git-send-email-ashok@cozybit.com> (raw)
In-Reply-To: <1368233453-10581-1-git-send-email-ashok@cozybit.com>

With the current logic of ieee80211_mandatory_rates(), only 11b mandatory rates
are returned when operating in 2.4GHz band. 802.11g mandatory rates are not
fetched even if the operating mode is 11g. This patch assumes 11g support
implies a 11g operation and returns the appropriate mandatory rates.

Signed-off-by: Ashok Nagarajan <ashok@cozybit.com>
---
 net/wireless/util.c |   15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/net/wireless/util.c b/net/wireless/util.c
index d6727f2..d4e3dfa 100644
--- a/net/wireless/util.c
+++ b/net/wireless/util.c
@@ -43,12 +43,19 @@ u32 ieee80211_mandatory_rates(struct ieee80211_supported_band *sband)
 	if (WARN_ON(!sband))
 		return 1;
 
-	if (sband->band == IEEE80211_BAND_2GHZ)
-		mandatory_flag = IEEE80211_RATE_MANDATORY_B;
-	else
+	bitrates = sband->bitrates;
+	if (sband->band == IEEE80211_BAND_5GHZ)
 		mandatory_flag = IEEE80211_RATE_MANDATORY_A;
+	else {
+		mandatory_flag = IEEE80211_RATE_MANDATORY_B;
+		for (i = 0; i < sband->n_bitrates; i++)
+			if (bitrates[i].bitrate > 110) {
+				mandatory_flag =
+					IEEE80211_RATE_MANDATORY_G;
+				break;
+			}
+	}
 
-	bitrates = sband->bitrates;
 	for (i = 0; i < sband->n_bitrates; i++)
 		if (bitrates[i].flags & mandatory_flag)
 			mandatory_rates |= BIT(i);
-- 
1.7.5.4


  reply	other threads:[~2013-05-11  0:51 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-11  0:50 [PATCH 1/3] {cfg,mac}80211: move mandatory rates calculation to cfg80211 Ashok Nagarajan
2013-05-11  0:50 ` Ashok Nagarajan [this message]
2013-05-13  9:42   ` [PATCH 2/3] cfg80211: Allow ieee80211g mandatory rate sets in 2.4GHz band Johannes Berg
2013-05-13 17:13     ` Ashok Nagarajan
2013-05-13 17:18       ` Johannes Berg
2013-05-13 17:20         ` Ashok Nagarajan
2013-05-11  0:50 ` [PATCH 3/3] {nl,mac,cfg}80211: Allow user to configure basic rates for mesh Ashok Nagarajan
2013-05-24 21:59   ` Johannes Berg
2013-05-24 23:13     ` Ashok Nagarajan
2013-05-25  8:20       ` Johannes Berg
2013-05-30 16:47         ` Ashok Nagarajan
2013-05-24 21:56 ` [PATCH 1/3] {cfg,mac}80211: move mandatory rates calculation to cfg80211 Johannes Berg

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=1368233453-10581-2-git-send-email-ashok@cozybit.com \
    --to=ashok@cozybit.com \
    --cc=devel@lists.open80211s.org \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.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