diff options
Diffstat (limited to 'net/wireless/util.c')
-rw-r--r-- | net/wireless/util.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/net/wireless/util.c b/net/wireless/util.c index a756429b3a0a..8c61d5c6fad3 100644 --- a/net/wireless/util.c +++ b/net/wireless/util.c | |||
@@ -1274,10 +1274,20 @@ int cfg80211_iter_combinations(struct wiphy *wiphy, | |||
1274 | void *data), | 1274 | void *data), |
1275 | void *data) | 1275 | void *data) |
1276 | { | 1276 | { |
1277 | const struct ieee80211_regdomain *regdom; | ||
1278 | enum nl80211_dfs_regions region = 0; | ||
1277 | int i, j, iftype; | 1279 | int i, j, iftype; |
1278 | int num_interfaces = 0; | 1280 | int num_interfaces = 0; |
1279 | u32 used_iftypes = 0; | 1281 | u32 used_iftypes = 0; |
1280 | 1282 | ||
1283 | if (radar_detect) { | ||
1284 | rcu_read_lock(); | ||
1285 | regdom = rcu_dereference(cfg80211_regdomain); | ||
1286 | if (regdom) | ||
1287 | region = regdom->dfs_region; | ||
1288 | rcu_read_unlock(); | ||
1289 | } | ||
1290 | |||
1281 | for (iftype = 0; iftype < NUM_NL80211_IFTYPES; iftype++) { | 1291 | for (iftype = 0; iftype < NUM_NL80211_IFTYPES; iftype++) { |
1282 | num_interfaces += iftype_num[iftype]; | 1292 | num_interfaces += iftype_num[iftype]; |
1283 | if (iftype_num[iftype] > 0 && | 1293 | if (iftype_num[iftype] > 0 && |
@@ -1318,6 +1328,10 @@ int cfg80211_iter_combinations(struct wiphy *wiphy, | |||
1318 | if (radar_detect != (c->radar_detect_widths & radar_detect)) | 1328 | if (radar_detect != (c->radar_detect_widths & radar_detect)) |
1319 | goto cont; | 1329 | goto cont; |
1320 | 1330 | ||
1331 | if (radar_detect && c->radar_detect_regions && | ||
1332 | !(c->radar_detect_regions & BIT(region))) | ||
1333 | goto cont; | ||
1334 | |||
1321 | /* Finally check that all iftypes that we're currently | 1335 | /* Finally check that all iftypes that we're currently |
1322 | * using are actually part of this combination. If they | 1336 | * using are actually part of this combination. If they |
1323 | * aren't then we can't use this combination and have | 1337 | * aren't then we can't use this combination and have |