aboutsummaryrefslogtreecommitdiffstats
path: root/net/wireless/mesh.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/wireless/mesh.c')
-rw-r--r--net/wireless/mesh.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/net/wireless/mesh.c b/net/wireless/mesh.c
index bab381344723..c384e77ff77a 100644
--- a/net/wireless/mesh.c
+++ b/net/wireless/mesh.c
@@ -155,6 +155,11 @@ int __cfg80211_join_mesh(struct cfg80211_registered_device *rdev,
155 setup->channel_type)) 155 setup->channel_type))
156 return -EINVAL; 156 return -EINVAL;
157 157
158 err = cfg80211_can_use_chan(rdev, wdev, setup->channel,
159 CHAN_MODE_SHARED);
160 if (err)
161 return err;
162
158 err = rdev->ops->join_mesh(&rdev->wiphy, dev, conf, setup); 163 err = rdev->ops->join_mesh(&rdev->wiphy, dev, conf, setup);
159 if (!err) { 164 if (!err) {
160 memcpy(wdev->ssid, setup->mesh_id, setup->mesh_id_len); 165 memcpy(wdev->ssid, setup->mesh_id, setup->mesh_id_len);
@@ -173,9 +178,11 @@ int cfg80211_join_mesh(struct cfg80211_registered_device *rdev,
173 struct wireless_dev *wdev = dev->ieee80211_ptr; 178 struct wireless_dev *wdev = dev->ieee80211_ptr;
174 int err; 179 int err;
175 180
181 mutex_lock(&rdev->devlist_mtx);
176 wdev_lock(wdev); 182 wdev_lock(wdev);
177 err = __cfg80211_join_mesh(rdev, dev, setup, conf); 183 err = __cfg80211_join_mesh(rdev, dev, setup, conf);
178 wdev_unlock(wdev); 184 wdev_unlock(wdev);
185 mutex_unlock(&rdev->devlist_mtx);
179 186
180 return err; 187 return err;
181} 188}
@@ -208,6 +215,11 @@ int cfg80211_set_mesh_freq(struct cfg80211_registered_device *rdev,
208 if (!netif_running(wdev->netdev)) 215 if (!netif_running(wdev->netdev))
209 return -ENETDOWN; 216 return -ENETDOWN;
210 217
218 err = cfg80211_can_use_chan(rdev, wdev, channel,
219 CHAN_MODE_SHARED);
220 if (err)
221 return err;
222
211 err = rdev->ops->libertas_set_mesh_channel(&rdev->wiphy, 223 err = rdev->ops->libertas_set_mesh_channel(&rdev->wiphy,
212 wdev->netdev, 224 wdev->netdev,
213 channel); 225 channel);