diff options
author | Luis R. Rodriguez <lrodriguez@atheros.com> | 2009-02-21 00:24:16 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-02-27 14:53:00 -0500 |
commit | 2f92cd2e5f1751f7da5fa9b58e0ab22da6577cfd (patch) | |
tree | c63d623eabf47740dbfa1d1d44bf517ccc5306fa /net | |
parent | d951c1ddeba3c84c464069c808efc494aa705304 (diff) |
cfg80211: pass the regulatory_request to ignore_request
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/wireless/reg.c | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/net/wireless/reg.c b/net/wireless/reg.c index 6152a7ac9b90..ce66bfdf57ec 100644 --- a/net/wireless/reg.c +++ b/net/wireless/reg.c | |||
@@ -1231,8 +1231,8 @@ static int reg_copy_regd(const struct ieee80211_regdomain **dst_regd, | |||
1231 | 1231 | ||
1232 | /* This has the logic which determines when a new request | 1232 | /* This has the logic which determines when a new request |
1233 | * should be ignored. */ | 1233 | * should be ignored. */ |
1234 | static int ignore_request(struct wiphy *wiphy, enum reg_set_by set_by, | 1234 | static int ignore_request(struct wiphy *wiphy, |
1235 | const char *alpha2) | 1235 | struct regulatory_request *pending_request) |
1236 | { | 1236 | { |
1237 | struct wiphy *last_wiphy = NULL; | 1237 | struct wiphy *last_wiphy = NULL; |
1238 | 1238 | ||
@@ -1242,7 +1242,7 @@ static int ignore_request(struct wiphy *wiphy, enum reg_set_by set_by, | |||
1242 | if (!last_request) | 1242 | if (!last_request) |
1243 | return 0; | 1243 | return 0; |
1244 | 1244 | ||
1245 | switch (set_by) { | 1245 | switch (pending_request->initiator) { |
1246 | case REGDOM_SET_BY_INIT: | 1246 | case REGDOM_SET_BY_INIT: |
1247 | return -EINVAL; | 1247 | return -EINVAL; |
1248 | case REGDOM_SET_BY_CORE: | 1248 | case REGDOM_SET_BY_CORE: |
@@ -1251,7 +1251,7 @@ static int ignore_request(struct wiphy *wiphy, enum reg_set_by set_by, | |||
1251 | 1251 | ||
1252 | last_wiphy = wiphy_idx_to_wiphy(last_request->wiphy_idx); | 1252 | last_wiphy = wiphy_idx_to_wiphy(last_request->wiphy_idx); |
1253 | 1253 | ||
1254 | if (unlikely(!is_an_alpha2(alpha2))) | 1254 | if (unlikely(!is_an_alpha2(pending_request->alpha2))) |
1255 | return -EINVAL; | 1255 | return -EINVAL; |
1256 | if (last_request->initiator == REGDOM_SET_BY_COUNTRY_IE) { | 1256 | if (last_request->initiator == REGDOM_SET_BY_COUNTRY_IE) { |
1257 | if (last_wiphy != wiphy) { | 1257 | if (last_wiphy != wiphy) { |
@@ -1261,7 +1261,7 @@ static int ignore_request(struct wiphy *wiphy, enum reg_set_by set_by, | |||
1261 | * intersect them, but that seems unlikely | 1261 | * intersect them, but that seems unlikely |
1262 | * to be correct. Reject second one for now. | 1262 | * to be correct. Reject second one for now. |
1263 | */ | 1263 | */ |
1264 | if (regdom_changes(alpha2)) | 1264 | if (regdom_changes(pending_request->alpha2)) |
1265 | return -EOPNOTSUPP; | 1265 | return -EOPNOTSUPP; |
1266 | return -EALREADY; | 1266 | return -EALREADY; |
1267 | } | 1267 | } |
@@ -1269,7 +1269,7 @@ static int ignore_request(struct wiphy *wiphy, enum reg_set_by set_by, | |||
1269 | * Two consecutive Country IE hints on the same wiphy. | 1269 | * Two consecutive Country IE hints on the same wiphy. |
1270 | * This should be picked up early by the driver/stack | 1270 | * This should be picked up early by the driver/stack |
1271 | */ | 1271 | */ |
1272 | if (WARN_ON(regdom_changes(alpha2))) | 1272 | if (WARN_ON(regdom_changes(pending_request->alpha2))) |
1273 | return 0; | 1273 | return 0; |
1274 | return -EALREADY; | 1274 | return -EALREADY; |
1275 | } | 1275 | } |
@@ -1278,7 +1278,7 @@ static int ignore_request(struct wiphy *wiphy, enum reg_set_by set_by, | |||
1278 | if (last_request->initiator == REGDOM_SET_BY_CORE) { | 1278 | if (last_request->initiator == REGDOM_SET_BY_CORE) { |
1279 | if (is_old_static_regdom(cfg80211_regdomain)) | 1279 | if (is_old_static_regdom(cfg80211_regdomain)) |
1280 | return 0; | 1280 | return 0; |
1281 | if (regdom_changes(alpha2)) | 1281 | if (regdom_changes(pending_request->alpha2)) |
1282 | return 0; | 1282 | return 0; |
1283 | return -EALREADY; | 1283 | return -EALREADY; |
1284 | } | 1284 | } |
@@ -1289,7 +1289,7 @@ static int ignore_request(struct wiphy *wiphy, enum reg_set_by set_by, | |||
1289 | * loaded card also agrees on the regulatory domain. | 1289 | * loaded card also agrees on the regulatory domain. |
1290 | */ | 1290 | */ |
1291 | if (last_request->initiator == REGDOM_SET_BY_DRIVER && | 1291 | if (last_request->initiator == REGDOM_SET_BY_DRIVER && |
1292 | !regdom_changes(alpha2)) | 1292 | !regdom_changes(pending_request->alpha2)) |
1293 | return -EALREADY; | 1293 | return -EALREADY; |
1294 | 1294 | ||
1295 | return REG_INTERSECT; | 1295 | return REG_INTERSECT; |
@@ -1315,7 +1315,7 @@ static int ignore_request(struct wiphy *wiphy, enum reg_set_by set_by, | |||
1315 | } | 1315 | } |
1316 | 1316 | ||
1317 | if (!is_old_static_regdom(cfg80211_regdomain) && | 1317 | if (!is_old_static_regdom(cfg80211_regdomain) && |
1318 | !regdom_changes(alpha2)) | 1318 | !regdom_changes(pending_request->alpha2)) |
1319 | return -EALREADY; | 1319 | return -EALREADY; |
1320 | 1320 | ||
1321 | return 0; | 1321 | return 0; |
@@ -1346,9 +1346,7 @@ static int __regulatory_hint(struct wiphy *wiphy, | |||
1346 | 1346 | ||
1347 | assert_cfg80211_lock(); | 1347 | assert_cfg80211_lock(); |
1348 | 1348 | ||
1349 | r = ignore_request(wiphy, | 1349 | r = ignore_request(wiphy, pending_request); |
1350 | pending_request->initiator, | ||
1351 | pending_request->alpha2); | ||
1352 | 1350 | ||
1353 | if (r == REG_INTERSECT) { | 1351 | if (r == REG_INTERSECT) { |
1354 | if (pending_request->initiator == REGDOM_SET_BY_DRIVER) { | 1352 | if (pending_request->initiator == REGDOM_SET_BY_DRIVER) { |