nl80211: make sure we check for DFS with mesh channel switch
authorLuciano Coelho <luciano.coelho@intel.com>
Thu, 20 Feb 2014 14:36:20 +0000 (16:36 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Fri, 21 Feb 2014 08:31:19 +0000 (09:31 +0100)
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: Luciano Coelho <luciano.coelho@intel.com>
[use switch statement, slight code cleanup]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/wireless/nl80211.c

index 1e5a434e42249871b3e2e8a315bd68d2392c120c..2c38b28a85b9b1d800caaf617be18f06517b63cd 100644 (file)
@@ -5913,17 +5913,22 @@ skip_beacons:
        if (!cfg80211_reg_can_beacon(&rdev->wiphy, &params.chandef))
                return -EINVAL;
 
-       if (dev->ieee80211_ptr->iftype == NL80211_IFTYPE_AP ||
-           dev->ieee80211_ptr->iftype == NL80211_IFTYPE_P2P_GO ||
-           dev->ieee80211_ptr->iftype == NL80211_IFTYPE_ADHOC) {
+       switch (dev->ieee80211_ptr->iftype) {
+       case NL80211_IFTYPE_AP:
+       case NL80211_IFTYPE_P2P_GO:
+       case NL80211_IFTYPE_ADHOC:
+       case NL80211_IFTYPE_MESH_POINT:
                err = cfg80211_chandef_dfs_required(wdev->wiphy,
                                                    &params.chandef);
-               if (err < 0) {
+               if (err < 0)
                        return err;
-               } else if (err) {
+               if (err) {
                        radar_detect_width = BIT(params.chandef.width);
                        params.radar_required = true;
                }
+               break;
+       default:
+               break;
        }
 
        err = cfg80211_can_use_iftype_chan(rdev, wdev, wdev->iftype,