diff options
author | Chun-Yeow Yeoh <yeohchunyeow@gmail.com> | 2013-12-02 03:05:49 -0500 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2013-12-04 03:12:10 -0500 |
commit | 33dde2bfe8ca97bdd8253bc0496482b048fa0b32 (patch) | |
tree | be7aa2dca5822741d0e81b796f500c5e21cde96b | |
parent | ad7e718c9b4f717823fd920a0103f7b0fb06183f (diff) |
nl80211: allow the use of DFS channel in mesh
This permits the use of DFS channel once the CAC is conducted and
no radar is detected.
Signed-off-by: Chun-Yeow Yeoh <yeohchunyeow@gmail.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
-rw-r--r-- | net/wireless/mesh.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/net/wireless/mesh.c b/net/wireless/mesh.c index b0e1869de7de..9c7a11ae7936 100644 --- a/net/wireless/mesh.c +++ b/net/wireless/mesh.c | |||
@@ -99,6 +99,7 @@ int __cfg80211_join_mesh(struct cfg80211_registered_device *rdev, | |||
99 | const struct mesh_config *conf) | 99 | const struct mesh_config *conf) |
100 | { | 100 | { |
101 | struct wireless_dev *wdev = dev->ieee80211_ptr; | 101 | struct wireless_dev *wdev = dev->ieee80211_ptr; |
102 | u8 radar_detect_width = 0; | ||
102 | int err; | 103 | int err; |
103 | 104 | ||
104 | BUILD_BUG_ON(IEEE80211_MAX_SSID_LEN != IEEE80211_MAX_MESH_ID_LEN); | 105 | BUILD_BUG_ON(IEEE80211_MAX_SSID_LEN != IEEE80211_MAX_MESH_ID_LEN); |
@@ -177,8 +178,16 @@ int __cfg80211_join_mesh(struct cfg80211_registered_device *rdev, | |||
177 | if (!cfg80211_reg_can_beacon(&rdev->wiphy, &setup->chandef)) | 178 | if (!cfg80211_reg_can_beacon(&rdev->wiphy, &setup->chandef)) |
178 | return -EINVAL; | 179 | return -EINVAL; |
179 | 180 | ||
180 | err = cfg80211_can_use_chan(rdev, wdev, setup->chandef.chan, | 181 | err = cfg80211_chandef_dfs_required(wdev->wiphy, &setup->chandef); |
181 | CHAN_MODE_SHARED); | 182 | if (err < 0) |
183 | return err; | ||
184 | if (err) | ||
185 | radar_detect_width = BIT(setup->chandef.width); | ||
186 | |||
187 | err = cfg80211_can_use_iftype_chan(rdev, wdev, wdev->iftype, | ||
188 | setup->chandef.chan, | ||
189 | CHAN_MODE_SHARED, | ||
190 | radar_detect_width); | ||
182 | if (err) | 191 | if (err) |
183 | return err; | 192 | return err; |
184 | 193 | ||