diff options
author | Luis R. Rodriguez <lrodriguez@atheros.com> | 2009-02-21 00:24:14 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-02-27 14:53:00 -0500 |
commit | 28da32d7cafdd181d6a59e8c0b74e9651a8f8be3 (patch) | |
tree | 0dab03e6f24f8528e2f2dcc9459ac60a64b8e360 /net/wireless | |
parent | d1c96a9a29a5f34fa50133889b6110dca6cc3d43 (diff) |
cfg80211: pass the regulatory_request struct in __regulatory_hint()
We were passing value by value, lets just pass the struct.
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/wireless')
-rw-r--r-- | net/wireless/reg.c | 45 |
1 files changed, 18 insertions, 27 deletions
diff --git a/net/wireless/reg.c b/net/wireless/reg.c index 0253d01cde97..6e1733733e18 100644 --- a/net/wireless/reg.c +++ b/net/wireless/reg.c | |||
@@ -1328,26 +1328,18 @@ static int ignore_request(struct wiphy *wiphy, enum reg_set_by set_by, | |||
1328 | * __regulatory_hint - hint to the wireless core a regulatory domain | 1328 | * __regulatory_hint - hint to the wireless core a regulatory domain |
1329 | * @wiphy: if the hint comes from country information from an AP, this | 1329 | * @wiphy: if the hint comes from country information from an AP, this |
1330 | * is required to be set to the wiphy that received the information | 1330 | * is required to be set to the wiphy that received the information |
1331 | * @alpha2: the ISO/IEC 3166 alpha2 being claimed the regulatory domain | 1331 | * @pending_request: the regulatory request currently being processed |
1332 | * should be in. | ||
1333 | * @country_ie_checksum: checksum of processed country IE, set this to 0 | ||
1334 | * if the hint did not come from a country IE | ||
1335 | * @country_ie_env: the environment the IE told us we are in, %ENVIRON_* | ||
1336 | * | 1332 | * |
1337 | * The Wireless subsystem can use this function to hint to the wireless core | 1333 | * The Wireless subsystem can use this function to hint to the wireless core |
1338 | * what it believes should be the current regulatory domain by giving it an | 1334 | * what it believes should be the current regulatory domain. |
1339 | * ISO/IEC 3166 alpha2 country code it knows its regulatory domain should be | ||
1340 | * in. | ||
1341 | * | 1335 | * |
1342 | * Returns zero if all went fine, %-EALREADY if a regulatory domain had | 1336 | * Returns zero if all went fine, %-EALREADY if a regulatory domain had |
1343 | * already been set or other standard error codes. | 1337 | * already been set or other standard error codes. |
1344 | * | 1338 | * |
1345 | * Caller must hold &cfg80211_mutex | 1339 | * Caller must hold &cfg80211_mutex |
1346 | */ | 1340 | */ |
1347 | static int __regulatory_hint(struct wiphy *wiphy, enum reg_set_by set_by, | 1341 | static int __regulatory_hint(struct wiphy *wiphy, |
1348 | const char *alpha2, | 1342 | struct regulatory_request *pending_request) |
1349 | u32 country_ie_checksum, | ||
1350 | enum environment_cap env) | ||
1351 | { | 1343 | { |
1352 | struct regulatory_request *request; | 1344 | struct regulatory_request *request; |
1353 | bool intersect = false; | 1345 | bool intersect = false; |
@@ -1355,10 +1347,12 @@ static int __regulatory_hint(struct wiphy *wiphy, enum reg_set_by set_by, | |||
1355 | 1347 | ||
1356 | assert_cfg80211_lock(); | 1348 | assert_cfg80211_lock(); |
1357 | 1349 | ||
1358 | r = ignore_request(wiphy, set_by, alpha2); | 1350 | r = ignore_request(wiphy, |
1351 | pending_request->initiator, | ||
1352 | pending_request->alpha2); | ||
1359 | 1353 | ||
1360 | if (r == REG_INTERSECT) { | 1354 | if (r == REG_INTERSECT) { |
1361 | if (set_by == REGDOM_SET_BY_DRIVER) { | 1355 | if (pending_request->initiator == REGDOM_SET_BY_DRIVER) { |
1362 | r = reg_copy_regd(&wiphy->regd, cfg80211_regdomain); | 1356 | r = reg_copy_regd(&wiphy->regd, cfg80211_regdomain); |
1363 | if (r) | 1357 | if (r) |
1364 | return r; | 1358 | return r; |
@@ -1370,7 +1364,8 @@ static int __regulatory_hint(struct wiphy *wiphy, enum reg_set_by set_by, | |||
1370 | * driver has already been set just copy it to the | 1364 | * driver has already been set just copy it to the |
1371 | * wiphy | 1365 | * wiphy |
1372 | */ | 1366 | */ |
1373 | if (r == -EALREADY && set_by == REGDOM_SET_BY_DRIVER) { | 1367 | if (r == -EALREADY && |
1368 | pending_request->initiator == REGDOM_SET_BY_DRIVER) { | ||
1374 | r = reg_copy_regd(&wiphy->regd, cfg80211_regdomain); | 1369 | r = reg_copy_regd(&wiphy->regd, cfg80211_regdomain); |
1375 | if (r) | 1370 | if (r) |
1376 | return r; | 1371 | return r; |
@@ -1386,13 +1381,13 @@ new_request: | |||
1386 | if (!request) | 1381 | if (!request) |
1387 | return -ENOMEM; | 1382 | return -ENOMEM; |
1388 | 1383 | ||
1389 | request->alpha2[0] = alpha2[0]; | 1384 | request->alpha2[0] = pending_request->alpha2[0]; |
1390 | request->alpha2[1] = alpha2[1]; | 1385 | request->alpha2[1] = pending_request->alpha2[1]; |
1391 | request->initiator = set_by; | 1386 | request->initiator = pending_request->initiator; |
1392 | request->wiphy_idx = get_wiphy_idx(wiphy); | 1387 | request->wiphy_idx = pending_request->wiphy_idx; |
1393 | request->intersect = intersect; | 1388 | request->intersect = intersect; |
1394 | request->country_ie_checksum = country_ie_checksum; | 1389 | request->country_ie_checksum = pending_request->country_ie_checksum; |
1395 | request->country_ie_env = env; | 1390 | request->country_ie_env = pending_request->country_ie_env; |
1396 | 1391 | ||
1397 | kfree(last_request); | 1392 | kfree(last_request); |
1398 | last_request = request; | 1393 | last_request = request; |
@@ -1411,7 +1406,7 @@ new_request: | |||
1411 | * | 1406 | * |
1412 | * to intersect with the static rd | 1407 | * to intersect with the static rd |
1413 | */ | 1408 | */ |
1414 | return call_crda(alpha2); | 1409 | return call_crda(request->alpha2); |
1415 | } | 1410 | } |
1416 | 1411 | ||
1417 | /* This currently only processes user and driver regulatory hints */ | 1412 | /* This currently only processes user and driver regulatory hints */ |
@@ -1433,11 +1428,7 @@ static int reg_process_hint(struct regulatory_request *reg_request) | |||
1433 | goto out; | 1428 | goto out; |
1434 | } | 1429 | } |
1435 | 1430 | ||
1436 | r = __regulatory_hint(wiphy, | 1431 | r = __regulatory_hint(wiphy, reg_request); |
1437 | reg_request->initiator, | ||
1438 | reg_request->alpha2, | ||
1439 | reg_request->country_ie_checksum, | ||
1440 | reg_request->country_ie_env); | ||
1441 | /* This is required so that the orig_* parameters are saved */ | 1432 | /* This is required so that the orig_* parameters are saved */ |
1442 | if (r == -EALREADY && wiphy && wiphy->strict_regulatory) | 1433 | if (r == -EALREADY && wiphy && wiphy->strict_regulatory) |
1443 | wiphy_update_regulatory(wiphy, reg_request->initiator); | 1434 | wiphy_update_regulatory(wiphy, reg_request->initiator); |