Commit 28da32d7 authored by Luis R. Rodriguez's avatar Luis R. Rodriguez Committed by John W. Linville

cfg80211: pass the regulatory_request struct in __regulatory_hint()

We were passing value by value, lets just pass the struct.
Signed-off-by: default avatarLuis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent d1c96a9a
...@@ -1328,26 +1328,18 @@ static int ignore_request(struct wiphy *wiphy, enum reg_set_by set_by, ...@@ -1328,26 +1328,18 @@ static int ignore_request(struct wiphy *wiphy, enum reg_set_by set_by,
* __regulatory_hint - hint to the wireless core a regulatory domain * __regulatory_hint - hint to the wireless core a regulatory domain
* @wiphy: if the hint comes from country information from an AP, this * @wiphy: if the hint comes from country information from an AP, this
* is required to be set to the wiphy that received the information * is required to be set to the wiphy that received the information
* @alpha2: the ISO/IEC 3166 alpha2 being claimed the regulatory domain * @pending_request: the regulatory request currently being processed
* should be in.
* @country_ie_checksum: checksum of processed country IE, set this to 0
* if the hint did not come from a country IE
* @country_ie_env: the environment the IE told us we are in, %ENVIRON_*
* *
* The Wireless subsystem can use this function to hint to the wireless core * The Wireless subsystem can use this function to hint to the wireless core
* what it believes should be the current regulatory domain by giving it an * what it believes should be the current regulatory domain.
* ISO/IEC 3166 alpha2 country code it knows its regulatory domain should be
* in.
* *
* Returns zero if all went fine, %-EALREADY if a regulatory domain had * Returns zero if all went fine, %-EALREADY if a regulatory domain had
* already been set or other standard error codes. * already been set or other standard error codes.
* *
* Caller must hold &cfg80211_mutex * Caller must hold &cfg80211_mutex
*/ */
static int __regulatory_hint(struct wiphy *wiphy, enum reg_set_by set_by, static int __regulatory_hint(struct wiphy *wiphy,
const char *alpha2, struct regulatory_request *pending_request)
u32 country_ie_checksum,
enum environment_cap env)
{ {
struct regulatory_request *request; struct regulatory_request *request;
bool intersect = false; bool intersect = false;
...@@ -1355,10 +1347,12 @@ static int __regulatory_hint(struct wiphy *wiphy, enum reg_set_by set_by, ...@@ -1355,10 +1347,12 @@ static int __regulatory_hint(struct wiphy *wiphy, enum reg_set_by set_by,
assert_cfg80211_lock(); assert_cfg80211_lock();
r = ignore_request(wiphy, set_by, alpha2); r = ignore_request(wiphy,
pending_request->initiator,
pending_request->alpha2);
if (r == REG_INTERSECT) { if (r == REG_INTERSECT) {
if (set_by == REGDOM_SET_BY_DRIVER) { if (pending_request->initiator == REGDOM_SET_BY_DRIVER) {
r = reg_copy_regd(&wiphy->regd, cfg80211_regdomain); r = reg_copy_regd(&wiphy->regd, cfg80211_regdomain);
if (r) if (r)
return r; return r;
...@@ -1370,7 +1364,8 @@ static int __regulatory_hint(struct wiphy *wiphy, enum reg_set_by set_by, ...@@ -1370,7 +1364,8 @@ static int __regulatory_hint(struct wiphy *wiphy, enum reg_set_by set_by,
* driver has already been set just copy it to the * driver has already been set just copy it to the
* wiphy * wiphy
*/ */
if (r == -EALREADY && set_by == REGDOM_SET_BY_DRIVER) { if (r == -EALREADY &&
pending_request->initiator == REGDOM_SET_BY_DRIVER) {
r = reg_copy_regd(&wiphy->regd, cfg80211_regdomain); r = reg_copy_regd(&wiphy->regd, cfg80211_regdomain);
if (r) if (r)
return r; return r;
...@@ -1386,13 +1381,13 @@ new_request: ...@@ -1386,13 +1381,13 @@ new_request:
if (!request) if (!request)
return -ENOMEM; return -ENOMEM;
request->alpha2[0] = alpha2[0]; request->alpha2[0] = pending_request->alpha2[0];
request->alpha2[1] = alpha2[1]; request->alpha2[1] = pending_request->alpha2[1];
request->initiator = set_by; request->initiator = pending_request->initiator;
request->wiphy_idx = get_wiphy_idx(wiphy); request->wiphy_idx = pending_request->wiphy_idx;
request->intersect = intersect; request->intersect = intersect;
request->country_ie_checksum = country_ie_checksum; request->country_ie_checksum = pending_request->country_ie_checksum;
request->country_ie_env = env; request->country_ie_env = pending_request->country_ie_env;
kfree(last_request); kfree(last_request);
last_request = request; last_request = request;
...@@ -1411,7 +1406,7 @@ new_request: ...@@ -1411,7 +1406,7 @@ new_request:
* *
* to intersect with the static rd * to intersect with the static rd
*/ */
return call_crda(alpha2); return call_crda(request->alpha2);
} }
/* This currently only processes user and driver regulatory hints */ /* This currently only processes user and driver regulatory hints */
...@@ -1433,11 +1428,7 @@ static int reg_process_hint(struct regulatory_request *reg_request) ...@@ -1433,11 +1428,7 @@ static int reg_process_hint(struct regulatory_request *reg_request)
goto out; goto out;
} }
r = __regulatory_hint(wiphy, r = __regulatory_hint(wiphy, reg_request);
reg_request->initiator,
reg_request->alpha2,
reg_request->country_ie_checksum,
reg_request->country_ie_env);
/* This is required so that the orig_* parameters are saved */ /* This is required so that the orig_* parameters are saved */
if (r == -EALREADY && wiphy && wiphy->strict_regulatory) if (r == -EALREADY && wiphy && wiphy->strict_regulatory)
wiphy_update_regulatory(wiphy, reg_request->initiator); wiphy_update_regulatory(wiphy, reg_request->initiator);
......
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