summaryrefslogtreecommitdiffstats
path: root/net/wireless/ibss.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2010-09-28 12:53:14 +0200
committerJohn W. Linville <linville@tuxdriver.com>2010-09-28 15:47:58 -0400
commit93b05238027420978d785569f8c1aa4a6867bc13 (patch)
tree8f391a9ea2438ed986d36b937fdbaf902e486187 /net/wireless/ibss.c
parentdc4769f0bb949e312ad8d9b652047ff6709978c2 (diff)
downloadop-kernel-dev-93b05238027420978d785569f8c1aa4a6867bc13.zip
op-kernel-dev-93b05238027420978d785569f8c1aa4a6867bc13.tar.gz
cfg80211: always set IBSS basic rates
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> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/wireless/ibss.c')
-rw-r--r--net/wireless/ibss.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/net/wireless/ibss.c b/net/wireless/ibss.c
index 27a8ce9..8cb6e08 100644
--- a/net/wireless/ibss.c
+++ b/net/wireless/ibss.c
@@ -88,6 +88,25 @@ int __cfg80211_join_ibss(struct cfg80211_registered_device *rdev,
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;
OpenPOWER on IntegriCloud