linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Mohammed Shafi <mshajakhan@atheros.com>
Cc: linux-wireless@vger.kernel.org,
	"John W. Linville" <linville@tuxdriver.com>
Subject: [PATCH] cfg80211: always set IBSS basic rates
Date: Tue, 28 Sep 2010 12:53:14 +0200	[thread overview]
Message-ID: <1285671194.3885.9.camel@jlt3.sipsolutions.net> (raw)
In-Reply-To: <1285670865.3885.8.camel@jlt3.sipsolutions.net>

From: Johannes Berg <johannes.berg@intel.com>

IBSS started from wireless extensions is currently
missing basic rate configuration, fix this by moving
the code to generate the default to the common code
that gets invoked for both nl80211 and wext.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 net/wireless/ibss.c    |   19 +++++++++++++++++++
 net/wireless/nl80211.c |   17 -----------------
 2 files changed, 19 insertions(+), 17 deletions(-)

--- wireless-testing.orig/net/wireless/ibss.c	2010-09-28 12:49:14.000000000 +0200
+++ wireless-testing/net/wireless/ibss.c	2010-09-28 12:51:24.000000000 +0200
@@ -88,6 +88,25 @@ int __cfg80211_join_ibss(struct cfg80211
 	if (wdev->ssid_len)
 		return -EALREADY;
 
+	if (!params->basic_rates) {
+		/*
+		* If no rates were explicitly configured,
+		* use the mandatory rate set for 11b or
+		* 11a for maximum compatibility.
+		*/
+		struct ieee80211_supported_band *sband =
+			rdev->wiphy.bands[params->channel->band];
+		int j;
+		u32 flag = params->channel->band == IEEE80211_BAND_5GHZ ?
+			IEEE80211_RATE_MANDATORY_A :
+			IEEE80211_RATE_MANDATORY_B;
+
+		for (j = 0; j < sband->n_bitrates; j++) {
+			if (sband->bitrates[j].flags & flag)
+				params->basic_rates |= BIT(j);
+		}
+	}
+
 	if (WARN_ON(wdev->connect_keys))
 		kfree(wdev->connect_keys);
 	wdev->connect_keys = connkeys;
--- wireless-testing.orig/net/wireless/nl80211.c	2010-09-28 12:49:14.000000000 +0200
+++ wireless-testing/net/wireless/nl80211.c	2010-09-28 12:50:32.000000000 +0200
@@ -4119,23 +4119,6 @@ static int nl80211_join_ibss(struct sk_b
 				goto out;
 			}
 		}
-	} else {
-		/*
-		* If no rates were explicitly configured,
-		* use the mandatory rate set for 11b or
-		* 11a for maximum compatibility.
-		*/
-		struct ieee80211_supported_band *sband =
-			wiphy->bands[ibss.channel->band];
-		int j;
-		u32 flag = ibss.channel->band == IEEE80211_BAND_5GHZ ?
-			IEEE80211_RATE_MANDATORY_A :
-			IEEE80211_RATE_MANDATORY_B;
-
-		for (j = 0; j < sband->n_bitrates; j++) {
-			if (sband->bitrates[j].flags & flag)
-				ibss.basic_rates |= BIT(j);
-		}
 	}
 
 	err = cfg80211_join_ibss(rdev, dev, &ibss, connkeys);



  reply	other threads:[~2010-09-28 10:53 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-28  8:29 [RFC] mac80211: sets basic rate set parameter for IBSS creator Mohammed Shafi Shajakhan
2010-09-28  9:02 ` Johannes Berg
2010-09-28  9:31   ` Mohammed Shafi
2010-09-28 10:47     ` Johannes Berg
2010-09-28 10:53       ` Johannes Berg [this message]
2010-09-28 11:00       ` Mohammed Shafi

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=1285671194.3885.9.camel@jlt3.sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=mshajakhan@atheros.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).