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>
This commit is contained in:
Chun-Yeow Yeoh 2013-12-02 16:05:49 +08:00 коммит произвёл Johannes Berg
Родитель ad7e718c9b
Коммит 33dde2bfe8
1 изменённых файлов: 11 добавлений и 2 удалений

Просмотреть файл

@ -99,6 +99,7 @@ int __cfg80211_join_mesh(struct cfg80211_registered_device *rdev,
const struct mesh_config *conf) const struct mesh_config *conf)
{ {
struct wireless_dev *wdev = dev->ieee80211_ptr; struct wireless_dev *wdev = dev->ieee80211_ptr;
u8 radar_detect_width = 0;
int err; int err;
BUILD_BUG_ON(IEEE80211_MAX_SSID_LEN != IEEE80211_MAX_MESH_ID_LEN); 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,
if (!cfg80211_reg_can_beacon(&rdev->wiphy, &setup->chandef)) if (!cfg80211_reg_can_beacon(&rdev->wiphy, &setup->chandef))
return -EINVAL; return -EINVAL;
err = cfg80211_can_use_chan(rdev, wdev, setup->chandef.chan, err = cfg80211_chandef_dfs_required(wdev->wiphy, &setup->chandef);
CHAN_MODE_SHARED); if (err < 0)
return err;
if (err)
radar_detect_width = BIT(setup->chandef.width);
err = cfg80211_can_use_iftype_chan(rdev, wdev, wdev->iftype,
setup->chandef.chan,
CHAN_MODE_SHARED,
radar_detect_width);
if (err) if (err)
return err; return err;