aboutsummaryrefslogtreecommitdiffstats
path: root/net/wireless/util.c
diff options
context:
space:
mode:
authorJohn W. Linville <linville@tuxdriver.com>2014-02-24 15:03:32 -0500
committerJohn W. Linville <linville@tuxdriver.com>2014-02-24 15:03:32 -0500
commitc77986c78aa941af8266272841567e78b72d54cc (patch)
treecb30e1bd7d5799bfce5a3837bcfddee059a81733 /net/wireless/util.c
parent9e4b4269ecee426f1647425a24186dd1566db554 (diff)
parent6658ab80fd4ef940fc2366ddb66690a15ea69c18 (diff)
Merge branch 'for-john' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next
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 */