aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/wireless/reg.c45
1 files changed, 0 insertions, 45 deletions
diff --git a/net/wireless/reg.c b/net/wireless/reg.c
index 678d0bd433f0..48baf28cc4b6 100644
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -1483,39 +1483,6 @@ int regulatory_hint(struct wiphy *wiphy, const char *alpha2)
1483} 1483}
1484EXPORT_SYMBOL(regulatory_hint); 1484EXPORT_SYMBOL(regulatory_hint);
1485 1485
1486/* Caller must hold reg_mutex */
1487static bool reg_same_country_ie_hint(struct wiphy *wiphy,
1488 char *alpha2, enum environment_cap env)
1489{
1490 struct wiphy *request_wiphy;
1491
1492 assert_reg_lock();
1493
1494 if (unlikely(last_request->initiator !=
1495 NL80211_REGDOM_SET_BY_COUNTRY_IE))
1496 return false;
1497
1498 request_wiphy = wiphy_idx_to_wiphy(last_request->wiphy_idx);
1499
1500 if (!request_wiphy)
1501 return false;
1502
1503 if (likely(request_wiphy != wiphy))
1504 return (last_request->alpha2[0] == alpha2[0] &&
1505 last_request->alpha2[1] == alpha2[1] &&
1506 last_request->country_ie_env == env);
1507 /*
1508 * We should not have let these through at this point, they
1509 * should have been picked up earlier by the first alpha2 check
1510 * on the device
1511 */
1512 if (WARN_ON((last_request->alpha2[0] == alpha2[0] &&
1513 last_request->alpha2[1] == alpha2[1] &&
1514 last_request->country_ie_env == env )))
1515 return true;
1516 return false;
1517}
1518
1519/* 1486/*
1520 * We hold wdev_lock() here so we cannot hold cfg80211_mutex() and 1487 * We hold wdev_lock() here so we cannot hold cfg80211_mutex() and
1521 * therefore cannot iterate over the rdev list here. 1488 * therefore cannot iterate over the rdev list here.
@@ -1560,18 +1527,6 @@ void regulatory_hint_11d(struct wiphy *wiphy,
1560 wiphy_idx_valid(last_request->wiphy_idx))) 1527 wiphy_idx_valid(last_request->wiphy_idx)))
1561 goto out; 1528 goto out;
1562 1529
1563 /*
1564 * This will not happen right now but we leave it here for the
1565 * the future when we want to add suspend/resume support and having
1566 * the user move to another country after doing so, or having the user
1567 * move to another AP. Right now we just trust the first AP.
1568 *
1569 * If we hit this before we add this support we want to be informed of
1570 * it as it would indicate a mistake in the current design
1571 */
1572 if (WARN_ON(reg_same_country_ie_hint(wiphy, alpha2, env)))
1573 goto free_rd_out;
1574
1575 request = kzalloc(sizeof(struct regulatory_request), GFP_KERNEL); 1530 request = kzalloc(sizeof(struct regulatory_request), GFP_KERNEL);
1576 if (!request) 1531 if (!request)
1577 goto free_rd_out; 1532 goto free_rd_out;