diff options
Diffstat (limited to 'net/wireless/ibss.c')
-rw-r--r-- | net/wireless/ibss.c | 24 |
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, | |||
83 | struct cfg80211_cached_keys *connkeys) | 83 | struct cfg80211_cached_keys *connkeys) |
84 | { | 84 | { |
85 | struct wireless_dev *wdev = dev->ieee80211_ptr; | 85 | struct wireless_dev *wdev = dev->ieee80211_ptr; |
86 | struct ieee80211_channel *check_chan; | ||
87 | u8 radar_detect_width = 0; | ||
86 | int err; | 88 | int err; |
87 | 89 | ||
88 | ASSERT_WDEV_LOCK(wdev); | 90 | ASSERT_WDEV_LOCK(wdev); |
@@ -114,14 +116,28 @@ int __cfg80211_join_ibss(struct cfg80211_registered_device *rdev, | |||
114 | wdev->connect_keys = connkeys; | 116 | wdev->connect_keys = connkeys; |
115 | 117 | ||
116 | wdev->ibss_fixed = params->channel_fixed; | 118 | wdev->ibss_fixed = params->channel_fixed; |
119 | wdev->ibss_dfs_possible = params->userspace_handles_dfs; | ||
117 | #ifdef CONFIG_CFG80211_WEXT | 120 | #ifdef CONFIG_CFG80211_WEXT |
118 | wdev->wext.ibss.chandef = params->chandef; | 121 | wdev->wext.ibss.chandef = params->chandef; |
119 | #endif | 122 | #endif |
123 | check_chan = params->chandef.chan; | ||
124 | if (params->userspace_handles_dfs) { | ||
125 | /* use channel NULL to check for radar even if the current | ||
126 | * channel is not a radar channel - it might decide to change | ||
127 | * to DFS channel later. | ||
128 | */ | ||
129 | radar_detect_width = BIT(params->chandef.width); | ||
130 | check_chan = NULL; | ||
131 | } | ||
132 | |||
133 | err = cfg80211_can_use_iftype_chan(rdev, wdev, wdev->iftype, | ||
134 | check_chan, | ||
135 | (params->channel_fixed && | ||
136 | !radar_detect_width) | ||
137 | ? CHAN_MODE_SHARED | ||
138 | : CHAN_MODE_EXCLUSIVE, | ||
139 | radar_detect_width); | ||
120 | 140 | ||
121 | err = cfg80211_can_use_chan(rdev, wdev, params->chandef.chan, | ||
122 | params->channel_fixed | ||
123 | ? CHAN_MODE_SHARED | ||
124 | : CHAN_MODE_EXCLUSIVE); | ||
125 | if (err) { | 141 | if (err) { |
126 | wdev->connect_keys = NULL; | 142 | wdev->connect_keys = NULL; |
127 | return err; | 143 | return err; |