aboutsummaryrefslogtreecommitdiffstats
path: root/net/wireless/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/wireless/util.c')
-rw-r--r--net/wireless/util.c31
1 files changed, 1 insertions, 30 deletions
diff --git a/net/wireless/util.c b/net/wireless/util.c
index 780b4546c9c7..57b3ce7a6b92 100644
--- a/net/wireless/util.c
+++ b/net/wireless/util.c
@@ -1269,7 +1269,6 @@ int cfg80211_can_use_iftype_chan(struct cfg80211_registered_device *rdev,
1269 enum cfg80211_chan_mode chmode; 1269 enum cfg80211_chan_mode chmode;
1270 int num_different_channels = 0; 1270 int num_different_channels = 0;
1271 int total = 1; 1271 int total = 1;
1272 bool radar_required = false;
1273 int i, j; 1272 int i, j;
1274 1273
1275 ASSERT_RTNL(); 1274 ASSERT_RTNL();
@@ -1277,35 +1276,7 @@ int cfg80211_can_use_iftype_chan(struct cfg80211_registered_device *rdev,
1277 if (WARN_ON(hweight32(radar_detect) > 1)) 1276 if (WARN_ON(hweight32(radar_detect) > 1))
1278 return -EINVAL; 1277 return -EINVAL;
1279 1278
1280 switch (iftype) { 1279 if (WARN_ON(iftype >= NUM_NL80211_IFTYPES))
1281 case NL80211_IFTYPE_ADHOC:
1282 case NL80211_IFTYPE_AP:
1283 case NL80211_IFTYPE_AP_VLAN:
1284 case NL80211_IFTYPE_MESH_POINT:
1285 case NL80211_IFTYPE_P2P_GO:
1286 case NL80211_IFTYPE_WDS:
1287 /* if the interface could potentially choose a DFS channel,
1288 * then mark DFS as required.
1289 */
1290 if (!chan) {
1291 if (chanmode != CHAN_MODE_UNDEFINED && radar_detect)
1292 radar_required = true;
1293 break;
1294 }
1295 radar_required = !!(chan->flags & IEEE80211_CHAN_RADAR);
1296 break;
1297 case NL80211_IFTYPE_P2P_CLIENT:
1298 case NL80211_IFTYPE_STATION:
1299 case NL80211_IFTYPE_P2P_DEVICE:
1300 case NL80211_IFTYPE_MONITOR:
1301 break;
1302 case NUM_NL80211_IFTYPES:
1303 case NL80211_IFTYPE_UNSPECIFIED:
1304 default:
1305 return -EINVAL;
1306 }
1307
1308 if (radar_required && !radar_detect)
1309 return -EINVAL; 1280 return -EINVAL;
1310 1281
1311 /* Always allow software iftypes */ 1282 /* Always allow software iftypes */