Commit e5d2f954 authored by Luciano Coelho's avatar Luciano Coelho Committed by Johannes Berg

nl80211: make sure we check for DFS with mesh channel switch

Since mesh support for DFS channels was added, we also need to check
for DFS channels when performing a channel switch with
NL80211_IFTYPE_MESHPOINT.
Signed-off-by: default avatarLuciano Coelho <luciano.coelho@intel.com>
[use switch statement, slight code cleanup]
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent 30f55dc1
...@@ -5913,17 +5913,22 @@ static int nl80211_channel_switch(struct sk_buff *skb, struct genl_info *info) ...@@ -5913,17 +5913,22 @@ static int nl80211_channel_switch(struct sk_buff *skb, struct genl_info *info)
if (!cfg80211_reg_can_beacon(&rdev->wiphy, &params.chandef)) if (!cfg80211_reg_can_beacon(&rdev->wiphy, &params.chandef))
return -EINVAL; return -EINVAL;
if (dev->ieee80211_ptr->iftype == NL80211_IFTYPE_AP || switch (dev->ieee80211_ptr->iftype) {
dev->ieee80211_ptr->iftype == NL80211_IFTYPE_P2P_GO || case NL80211_IFTYPE_AP:
dev->ieee80211_ptr->iftype == NL80211_IFTYPE_ADHOC) { case NL80211_IFTYPE_P2P_GO:
case NL80211_IFTYPE_ADHOC:
case NL80211_IFTYPE_MESH_POINT:
err = cfg80211_chandef_dfs_required(wdev->wiphy, err = cfg80211_chandef_dfs_required(wdev->wiphy,
&params.chandef); &params.chandef);
if (err < 0) { if (err < 0)
return err; return err;
} else if (err) { if (err) {
radar_detect_width = BIT(params.chandef.width); radar_detect_width = BIT(params.chandef.width);
params.radar_required = true; params.radar_required = true;
} }
break;
default:
break;
} }
err = cfg80211_can_use_iftype_chan(rdev, wdev, wdev->iftype, err = cfg80211_can_use_iftype_chan(rdev, wdev, wdev->iftype,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment