diff options
author | Johannes Berg <johannes.berg@intel.com> | 2012-05-16 17:50:20 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-06-05 15:32:18 -0400 |
commit | cc1d2806bf06ab92268343d26eb3d8d8f00f8bc9 (patch) | |
tree | b14ffa920d616470715e715df49f990bfdcf12ae /net/wireless/wext-compat.c | |
parent | 685d12a1929f274bd91497e33b4255fe164ac8ec (diff) |
cfg80211: provide channel to join_mesh function
Just like the AP mode patch, instead of setting
the channel and then joining the mesh network,
provide the channel to join the network on to
the join_mesh() function.
Like in AP mode, you can also give the channel
to the join-mesh nl80211 command now.
Unlike AP mode, it picks a default channel if
none was given.
As libertas uses mesh mode interfaces but has
no join_mesh callback and we can't simply break
it, keep some compatibility code for that case
and configure the channel directly for it.
In the non-libertas case, where we store the
channel until join, allow setting it while the
interface is down.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/wireless/wext-compat.c')
-rw-r--r-- | net/wireless/wext-compat.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/net/wireless/wext-compat.c b/net/wireless/wext-compat.c index b082fcc26f06..faeb03548aa4 100644 --- a/net/wireless/wext-compat.c +++ b/net/wireless/wext-compat.c | |||
@@ -796,7 +796,6 @@ static int cfg80211_wext_siwfreq(struct net_device *dev, | |||
796 | case NL80211_IFTYPE_ADHOC: | 796 | case NL80211_IFTYPE_ADHOC: |
797 | return cfg80211_ibss_wext_siwfreq(dev, info, wextfreq, extra); | 797 | return cfg80211_ibss_wext_siwfreq(dev, info, wextfreq, extra); |
798 | case NL80211_IFTYPE_MONITOR: | 798 | case NL80211_IFTYPE_MONITOR: |
799 | case NL80211_IFTYPE_MESH_POINT: | ||
800 | freq = cfg80211_wext_freq(wdev->wiphy, wextfreq); | 799 | freq = cfg80211_wext_freq(wdev->wiphy, wextfreq); |
801 | if (freq < 0) | 800 | if (freq < 0) |
802 | return freq; | 801 | return freq; |
@@ -808,6 +807,17 @@ static int cfg80211_wext_siwfreq(struct net_device *dev, | |||
808 | wdev_unlock(wdev); | 807 | wdev_unlock(wdev); |
809 | mutex_unlock(&rdev->devlist_mtx); | 808 | mutex_unlock(&rdev->devlist_mtx); |
810 | return err; | 809 | return err; |
810 | case NL80211_IFTYPE_MESH_POINT: | ||
811 | freq = cfg80211_wext_freq(wdev->wiphy, wextfreq); | ||
812 | if (freq < 0) | ||
813 | return freq; | ||
814 | if (freq == 0) | ||
815 | return -EINVAL; | ||
816 | mutex_lock(&rdev->devlist_mtx); | ||
817 | err = cfg80211_set_mesh_freq(rdev, wdev, freq, | ||
818 | NL80211_CHAN_NO_HT); | ||
819 | mutex_unlock(&rdev->devlist_mtx); | ||
820 | return err; | ||
811 | default: | 821 | default: |
812 | return -EOPNOTSUPP; | 822 | return -EOPNOTSUPP; |
813 | } | 823 | } |