aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorLuciano Coelho <luciano.coelho@intel.com>2014-05-15 06:05:39 -0400
committerJohannes Berg <johannes.berg@intel.com>2014-05-15 08:50:34 -0400
commit00ec75fc5a6499d8fdeb6ec9f8f5df68b9291c74 (patch)
tree39a045532237ff61d58f7dc8e12ad593722cfa58 /net
parent67ae07a109f3d518085e3b81aa48740e8c5cc3f7 (diff)
cfg80211: pass the actual iftype when calling cfg80211_chandef_dfs_required()
There is no need to pass NL80211_IFTYPE_UNSPECIFIED when calling cfg80211_chandef_dfs_required() since we always already have the interface type. So, pass the actual interface type instead. Additionally, have cfg80211_chandef_dfs_required() WARN if the passed interface type is NL80211_IFTYPE_UNSPECIFIED, so we can detect problems more easily. Tested-by: Janusz Dziedzic <janusz.dziedzic@tieto.com> Reported-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <luciano.coelho@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net')
-rw-r--r--net/wireless/chan.c5
-rw-r--r--net/wireless/nl80211.c2
2 files changed, 3 insertions, 4 deletions
diff --git a/net/wireless/chan.c b/net/wireless/chan.c
index 7a679a6e1d1a..992b34070bcb 100644
--- a/net/wireless/chan.c
+++ b/net/wireless/chan.c
@@ -340,7 +340,6 @@ int cfg80211_chandef_dfs_required(struct wiphy *wiphy,
340 case NL80211_IFTYPE_AP: 340 case NL80211_IFTYPE_AP:
341 case NL80211_IFTYPE_P2P_GO: 341 case NL80211_IFTYPE_P2P_GO:
342 case NL80211_IFTYPE_MESH_POINT: 342 case NL80211_IFTYPE_MESH_POINT:
343 case NL80211_IFTYPE_UNSPECIFIED:
344 width = cfg80211_chandef_get_width(chandef); 343 width = cfg80211_chandef_get_width(chandef);
345 if (width < 0) 344 if (width < 0)
346 return -EINVAL; 345 return -EINVAL;
@@ -372,6 +371,7 @@ int cfg80211_chandef_dfs_required(struct wiphy *wiphy,
372 case NL80211_IFTYPE_WDS: 371 case NL80211_IFTYPE_WDS:
373 case NL80211_IFTYPE_P2P_DEVICE: 372 case NL80211_IFTYPE_P2P_DEVICE:
374 break; 373 break;
374 case NL80211_IFTYPE_UNSPECIFIED:
375 case NUM_NL80211_IFTYPES: 375 case NUM_NL80211_IFTYPES:
376 WARN_ON(1); 376 WARN_ON(1);
377 } 377 }
@@ -796,8 +796,7 @@ bool cfg80211_reg_can_beacon(struct wiphy *wiphy,
796 !cfg80211_go_permissive_chan(rdev, chandef->chan)) 796 !cfg80211_go_permissive_chan(rdev, chandef->chan))
797 prohibited_flags |= IEEE80211_CHAN_NO_IR; 797 prohibited_flags |= IEEE80211_CHAN_NO_IR;
798 798
799 if (cfg80211_chandef_dfs_required(wiphy, chandef, 799 if (cfg80211_chandef_dfs_required(wiphy, chandef, iftype) > 0 &&
800 NL80211_IFTYPE_UNSPECIFIED) > 0 &&
801 cfg80211_chandef_dfs_available(wiphy, chandef)) { 800 cfg80211_chandef_dfs_available(wiphy, chandef)) {
802 /* We can skip IEEE80211_CHAN_NO_IR if chandef dfs available */ 801 /* We can skip IEEE80211_CHAN_NO_IR if chandef dfs available */
803 prohibited_flags = IEEE80211_CHAN_DISABLED; 802 prohibited_flags = IEEE80211_CHAN_DISABLED;
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index c0833830cfe7..74e7299e4add 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -5822,7 +5822,7 @@ static int nl80211_start_radar_detection(struct sk_buff *skb,
5822 return -EBUSY; 5822 return -EBUSY;
5823 5823
5824 err = cfg80211_chandef_dfs_required(wdev->wiphy, &chandef, 5824 err = cfg80211_chandef_dfs_required(wdev->wiphy, &chandef,
5825 NL80211_IFTYPE_UNSPECIFIED); 5825 wdev->iftype);
5826 if (err < 0) 5826 if (err < 0)
5827 return err; 5827 return err;
5828 5828