Commit 34782e9e authored by John W. Linville's avatar John W. Linville

wireless: remove unnecessary reg_same_country_ie_hint

"Might as well remove  reg_same_country_ie_hint() completely since we
already dealt with suspend/resume through the regulatory hint
disconnect." -- Luis
Reported-by: default avatarLuis R. Rodriguez <mcgrof@gmail.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 16124541
...@@ -1483,39 +1483,6 @@ int regulatory_hint(struct wiphy *wiphy, const char *alpha2) ...@@ -1483,39 +1483,6 @@ int regulatory_hint(struct wiphy *wiphy, const char *alpha2)
} }
EXPORT_SYMBOL(regulatory_hint); EXPORT_SYMBOL(regulatory_hint);
/* Caller must hold reg_mutex */
static bool reg_same_country_ie_hint(struct wiphy *wiphy,
char *alpha2, enum environment_cap env)
{
struct wiphy *request_wiphy;
assert_reg_lock();
if (unlikely(last_request->initiator !=
NL80211_REGDOM_SET_BY_COUNTRY_IE))
return false;
request_wiphy = wiphy_idx_to_wiphy(last_request->wiphy_idx);
if (!request_wiphy)
return false;
if (likely(request_wiphy != wiphy))
return (last_request->alpha2[0] == alpha2[0] &&
last_request->alpha2[1] == alpha2[1] &&
last_request->country_ie_env == env);
/*
* We should not have let these through at this point, they
* should have been picked up earlier by the first alpha2 check
* on the device
*/
if (WARN_ON((last_request->alpha2[0] == alpha2[0] &&
last_request->alpha2[1] == alpha2[1] &&
last_request->country_ie_env == env )))
return true;
return false;
}
/* /*
* We hold wdev_lock() here so we cannot hold cfg80211_mutex() and * We hold wdev_lock() here so we cannot hold cfg80211_mutex() and
* therefore cannot iterate over the rdev list here. * therefore cannot iterate over the rdev list here.
...@@ -1560,18 +1527,6 @@ void regulatory_hint_11d(struct wiphy *wiphy, ...@@ -1560,18 +1527,6 @@ void regulatory_hint_11d(struct wiphy *wiphy,
wiphy_idx_valid(last_request->wiphy_idx))) wiphy_idx_valid(last_request->wiphy_idx)))
goto out; goto out;
/*
* This will not happen right now but we leave it here for the
* the future when we want to add suspend/resume support and having
* the user move to another country after doing so, or having the user
* move to another AP. Right now we just trust the first AP.
*
* If we hit this before we add this support we want to be informed of
* it as it would indicate a mistake in the current design
*/
if (WARN_ON(reg_same_country_ie_hint(wiphy, alpha2, env)))
goto free_rd_out;
request = kzalloc(sizeof(struct regulatory_request), GFP_KERNEL); request = kzalloc(sizeof(struct regulatory_request), GFP_KERNEL);
if (!request) if (!request)
goto free_rd_out; goto free_rd_out;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment