aboutsummaryrefslogtreecommitdiffstats
path: root/net/wireless
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2010-09-28 06:53:14 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-09-28 15:47:58 -0400
commit93b05238027420978d785569f8c1aa4a6867bc13 (patch)
tree8f391a9ea2438ed986d36b937fdbaf902e486187 /net/wireless
parentdc4769f0bb949e312ad8d9b652047ff6709978c2 (diff)
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')
-rw-r--r--net/wireless/ibss.c19
-rw-r--r--net/wireless/nl80211.c17
2 files changed, 19 insertions, 17 deletions
diff --git a/net/wireless/ibss.c b/net/wireless/ibss.c
index 27a8ce9343c3..8cb6e08373b9 100644
--- a/net/wireless/ibss.c
+++ b/net/wireless/ibss.c
@@ -88,6 +88,25 @@ int __cfg80211_join_ibss(struct cfg80211_registered_device *rdev,
88 if (wdev->ssid_len) 88 if (wdev->ssid_len)
89 return -EALREADY; 89 return -EALREADY;
90 90
91 if (!params->basic_rates) {
92 /*
93 * If no rates were explicitly configured,
94 * use the mandatory rate set for 11b or
95 * 11a for maximum compatibility.
96 */
97 struct ieee80211_supported_band *sband =
98 rdev->wiphy.bands[params->channel->band];
99 int j;
100 u32 flag = params->channel->band == IEEE80211_BAND_5GHZ ?
101 IEEE80211_RATE_MANDATORY_A :
102 IEEE80211_RATE_MANDATORY_B;
103
104 for (j = 0; j < sband->n_bitrates; j++) {
105 if (sband->bitrates[j].flags & flag)
106 params->basic_rates |= BIT(j);
107 }
108 }
109
91 if (WARN_ON(wdev->connect_keys)) 110 if (WARN_ON(wdev->connect_keys))
92 kfree(wdev->connect_keys); 111 kfree(wdev->connect_keys);
93 wdev->connect_keys = connkeys; 112 wdev->connect_keys = connkeys;
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 4ff827e8c362..9c84825803ce 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -4119,23 +4119,6 @@ static int nl80211_join_ibss(struct sk_buff *skb, struct genl_info *info)
4119 goto out; 4119 goto out;
4120 } 4120 }
4121 } 4121 }
4122 } else {
4123 /*
4124 * If no rates were explicitly configured,
4125 * use the mandatory rate set for 11b or
4126 * 11a for maximum compatibility.
4127 */
4128 struct ieee80211_supported_band *sband =
4129 wiphy->bands[ibss.channel->band];
4130 int j;
4131 u32 flag = ibss.channel->band == IEEE80211_BAND_5GHZ ?
4132 IEEE80211_RATE_MANDATORY_A :
4133 IEEE80211_RATE_MANDATORY_B;
4134
4135 for (j = 0; j < sband->n_bitrates; j++) {
4136 if (sband->bitrates[j].flags & flag)
4137 ibss.basic_rates |= BIT(j);
4138 }
4139 } 4122 }
4140 4123
4141 err = cfg80211_join_ibss(rdev, dev, &ibss, connkeys); 4124 err = cfg80211_join_ibss(rdev, dev, &ibss, connkeys);