diff options
Diffstat (limited to 'net/wireless')
-rw-r--r-- | net/wireless/ibss.c | 19 | ||||
-rw-r--r-- | net/wireless/nl80211.c | 17 |
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); |