|
@@ -1269,7 +1269,6 @@ int cfg80211_can_use_iftype_chan(struct cfg80211_registered_device *rdev,
|
|
enum cfg80211_chan_mode chmode;
|
|
enum cfg80211_chan_mode chmode;
|
|
int num_different_channels = 0;
|
|
int num_different_channels = 0;
|
|
int total = 1;
|
|
int total = 1;
|
|
- bool radar_required = false;
|
|
|
|
int i, j;
|
|
int i, j;
|
|
|
|
|
|
ASSERT_RTNL();
|
|
ASSERT_RTNL();
|
|
@@ -1277,35 +1276,7 @@ int cfg80211_can_use_iftype_chan(struct cfg80211_registered_device *rdev,
|
|
if (WARN_ON(hweight32(radar_detect) > 1))
|
|
if (WARN_ON(hweight32(radar_detect) > 1))
|
|
return -EINVAL;
|
|
return -EINVAL;
|
|
|
|
|
|
- switch (iftype) {
|
|
|
|
- case NL80211_IFTYPE_ADHOC:
|
|
|
|
- case NL80211_IFTYPE_AP:
|
|
|
|
- case NL80211_IFTYPE_AP_VLAN:
|
|
|
|
- case NL80211_IFTYPE_MESH_POINT:
|
|
|
|
- case NL80211_IFTYPE_P2P_GO:
|
|
|
|
- case NL80211_IFTYPE_WDS:
|
|
|
|
- /* if the interface could potentially choose a DFS channel,
|
|
|
|
- * then mark DFS as required.
|
|
|
|
- */
|
|
|
|
- if (!chan) {
|
|
|
|
- if (chanmode != CHAN_MODE_UNDEFINED && radar_detect)
|
|
|
|
- radar_required = true;
|
|
|
|
- break;
|
|
|
|
- }
|
|
|
|
- radar_required = !!(chan->flags & IEEE80211_CHAN_RADAR);
|
|
|
|
- break;
|
|
|
|
- case NL80211_IFTYPE_P2P_CLIENT:
|
|
|
|
- case NL80211_IFTYPE_STATION:
|
|
|
|
- case NL80211_IFTYPE_P2P_DEVICE:
|
|
|
|
- case NL80211_IFTYPE_MONITOR:
|
|
|
|
- break;
|
|
|
|
- case NUM_NL80211_IFTYPES:
|
|
|
|
- case NL80211_IFTYPE_UNSPECIFIED:
|
|
|
|
- default:
|
|
|
|
- return -EINVAL;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (radar_required && !radar_detect)
|
|
|
|
|
|
+ if (WARN_ON(iftype >= NUM_NL80211_IFTYPES))
|
|
return -EINVAL;
|
|
return -EINVAL;
|
|
|
|
|
|
/* Always allow software iftypes */
|
|
/* Always allow software iftypes */
|