summaryrefslogtreecommitdiffstats
path: root/net/wireless/mesh.c
diff options
context:
space:
mode:
authorMichal Kazior <michal.kazior@tieto.com>2012-06-29 12:47:08 +0200
committerJohannes Berg <johannes.berg@intel.com>2012-06-29 13:39:19 +0200
commite4e32459c2daea59516da59999706b357e6eb480 (patch)
tree110014ac72ebcf7aed16caa0fa83da75e319fa86 /net/wireless/mesh.c
parentcfg80211: add channel checking for iface combinations (diff)
downloadlinux-e4e32459c2daea59516da59999706b357e6eb480.tar.xz
linux-e4e32459c2daea59516da59999706b357e6eb480.zip
cfg80211: respect iface combinations when starting operation
devlist_mtx locking is changed to accomodate changes. Signed-off-by: Michal Kazior <michal.kazior@tieto.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
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,
setup->channel_type))
return -EINVAL;
+ err = cfg80211_can_use_chan(rdev, wdev, setup->channel,
+ CHAN_MODE_SHARED);
+ if (err)
+ return err;
+
err = rdev->ops->join_mesh(&rdev->wiphy, dev, conf, setup);
if (!err) {
memcpy(wdev->ssid, setup->mesh_id, setup->mesh_id_len);
@@ -173,9 +178,11 @@ int cfg80211_join_mesh(struct cfg80211_registered_device *rdev,
struct wireless_dev *wdev = dev->ieee80211_ptr;
int err;
+ mutex_lock(&rdev->devlist_mtx);
wdev_lock(wdev);
err = __cfg80211_join_mesh(rdev, dev, setup, conf);
wdev_unlock(wdev);
+ mutex_unlock(&rdev->devlist_mtx);
return err;
}
@@ -208,6 +215,11 @@ int cfg80211_set_mesh_freq(struct cfg80211_registered_device *rdev,
if (!netif_running(wdev->netdev))
return -ENETDOWN;
+ err = cfg80211_can_use_chan(rdev, wdev, channel,
+ CHAN_MODE_SHARED);
+ if (err)
+ return err;
+
err = rdev->ops->libertas_set_mesh_channel(&rdev->wiphy,
wdev->netdev,
channel);