summaryrefslogtreecommitdiff
path: root/net/wireless/ibss.c
diff options
context:
space:
mode:
authorJohn W. Linville <linville@tuxdriver.com>2013-11-06 00:49:02 +0400
committerJohn W. Linville <linville@tuxdriver.com>2013-11-06 00:49:02 +0400
commit353c78152c10027b8da5de446bad3472f977fcdc (patch)
tree8663ca32b912e8b3df428f570b7fd376aa3aa0cb /net/wireless/ibss.c
parent01925efdf7e03b4b803b5c9f985163d687f7f017 (diff)
parentd0a361a5b3f5aa28778a0c336de5a911fc0cd678 (diff)
downloadlinux-353c78152c10027b8da5de446bad3472f977fcdc.tar.xz
Merge branch 'for-john' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next
Conflicts: net/wireless/reg.c
Diffstat (limited to 'net/wireless/ibss.c')
-rw-r--r--net/wireless/ibss.c24
1 files changed, 20 insertions, 4 deletions
diff --git a/net/wireless/ibss.c b/net/wireless/ibss.c
index 403fe29c024d..9d797df56649 100644
--- a/net/wireless/ibss.c
+++ b/net/wireless/ibss.c
@@ -83,6 +83,8 @@ int __cfg80211_join_ibss(struct cfg80211_registered_device *rdev,
struct cfg80211_cached_keys *connkeys)
{
struct wireless_dev *wdev = dev->ieee80211_ptr;
+ struct ieee80211_channel *check_chan;
+ u8 radar_detect_width = 0;
int err;
ASSERT_WDEV_LOCK(wdev);
@@ -114,14 +116,28 @@ int __cfg80211_join_ibss(struct cfg80211_registered_device *rdev,
wdev->connect_keys = connkeys;
wdev->ibss_fixed = params->channel_fixed;
+ wdev->ibss_dfs_possible = params->userspace_handles_dfs;
#ifdef CONFIG_CFG80211_WEXT
wdev->wext.ibss.chandef = params->chandef;
#endif
+ check_chan = params->chandef.chan;
+ if (params->userspace_handles_dfs) {
+ /* use channel NULL to check for radar even if the current
+ * channel is not a radar channel - it might decide to change
+ * to DFS channel later.
+ */
+ radar_detect_width = BIT(params->chandef.width);
+ check_chan = NULL;
+ }
+
+ err = cfg80211_can_use_iftype_chan(rdev, wdev, wdev->iftype,
+ check_chan,
+ (params->channel_fixed &&
+ !radar_detect_width)
+ ? CHAN_MODE_SHARED
+ : CHAN_MODE_EXCLUSIVE,
+ radar_detect_width);
- err = cfg80211_can_use_chan(rdev, wdev, params->chandef.chan,
- params->channel_fixed
- ? CHAN_MODE_SHARED
- : CHAN_MODE_EXCLUSIVE);
if (err) {
wdev->connect_keys = NULL;
return err;