diff options
Diffstat (limited to 'net/wireless/mesh.c')
-rw-r--r-- | net/wireless/mesh.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/net/wireless/mesh.c b/net/wireless/mesh.c index 0553fd4d85ae..885862447b63 100644 --- a/net/wireless/mesh.c +++ b/net/wireless/mesh.c | |||
@@ -99,6 +99,7 @@ int __cfg80211_join_mesh(struct cfg80211_registered_device *rdev, | |||
99 | const struct mesh_config *conf) | 99 | const struct mesh_config *conf) |
100 | { | 100 | { |
101 | struct wireless_dev *wdev = dev->ieee80211_ptr; | 101 | struct wireless_dev *wdev = dev->ieee80211_ptr; |
102 | u8 radar_detect_width = 0; | ||
102 | int err; | 103 | int err; |
103 | 104 | ||
104 | BUILD_BUG_ON(IEEE80211_MAX_SSID_LEN != IEEE80211_MAX_MESH_ID_LEN); | 105 | BUILD_BUG_ON(IEEE80211_MAX_SSID_LEN != IEEE80211_MAX_MESH_ID_LEN); |
@@ -141,8 +142,7 @@ int __cfg80211_join_mesh(struct cfg80211_registered_device *rdev, | |||
141 | 142 | ||
142 | for (i = 0; i < sband->n_channels; i++) { | 143 | for (i = 0; i < sband->n_channels; i++) { |
143 | chan = &sband->channels[i]; | 144 | chan = &sband->channels[i]; |
144 | if (chan->flags & (IEEE80211_CHAN_NO_IBSS | | 145 | if (chan->flags & (IEEE80211_CHAN_NO_IR | |
145 | IEEE80211_CHAN_PASSIVE_SCAN | | ||
146 | IEEE80211_CHAN_DISABLED | | 146 | IEEE80211_CHAN_DISABLED | |
147 | IEEE80211_CHAN_RADAR)) | 147 | IEEE80211_CHAN_RADAR)) |
148 | continue; | 148 | continue; |
@@ -178,8 +178,16 @@ int __cfg80211_join_mesh(struct cfg80211_registered_device *rdev, | |||
178 | if (!cfg80211_reg_can_beacon(&rdev->wiphy, &setup->chandef)) | 178 | if (!cfg80211_reg_can_beacon(&rdev->wiphy, &setup->chandef)) |
179 | return -EINVAL; | 179 | return -EINVAL; |
180 | 180 | ||
181 | err = cfg80211_can_use_chan(rdev, wdev, setup->chandef.chan, | 181 | err = cfg80211_chandef_dfs_required(wdev->wiphy, &setup->chandef); |
182 | CHAN_MODE_SHARED); | 182 | if (err < 0) |
183 | return err; | ||
184 | if (err) | ||
185 | radar_detect_width = BIT(setup->chandef.width); | ||
186 | |||
187 | err = cfg80211_can_use_iftype_chan(rdev, wdev, wdev->iftype, | ||
188 | setup->chandef.chan, | ||
189 | CHAN_MODE_SHARED, | ||
190 | radar_detect_width); | ||
183 | if (err) | 191 | if (err) |
184 | return err; | 192 | return err; |
185 | 193 | ||
@@ -269,6 +277,7 @@ static int __cfg80211_leave_mesh(struct cfg80211_registered_device *rdev, | |||
269 | if (!err) { | 277 | if (!err) { |
270 | wdev->mesh_id_len = 0; | 278 | wdev->mesh_id_len = 0; |
271 | wdev->channel = NULL; | 279 | wdev->channel = NULL; |
280 | rdev_set_qos_map(rdev, dev, NULL); | ||
272 | } | 281 | } |
273 | 282 | ||
274 | return err; | 283 | return err; |