Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 134934
b: refs/heads/master
c: 69b1572
h: refs/heads/master
v: v3
  • Loading branch information
Luis R. Rodriguez authored and John W. Linville committed Feb 27, 2009
1 parent a356de9 commit 09d4da5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: fff32c04f6074de0719cc46d8f488aaf746f151a
refs/heads/master: 69b1572bd82046cc8f730e05c797062ca8c2b535
19 changes: 8 additions & 11 deletions trunk/net/wireless/reg.c
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ static bool alpha2_equal(const char *alpha2_x, const char *alpha2_y)
return false;
}

static bool regdom_changed(const char *alpha2)
static bool regdom_changes(const char *alpha2)
{
assert_cfg80211_lock();

Expand Down Expand Up @@ -1134,17 +1134,15 @@ static int ignore_request(struct wiphy *wiphy, enum reg_set_by set_by,
* intersect them, but that seems unlikely
* to be correct. Reject second one for now.
*/
if (!alpha2_equal(alpha2,
cfg80211_regdomain->alpha2))
if (regdom_changes(alpha2))
return -EOPNOTSUPP;
return -EALREADY;
}
/*
* Two consecutive Country IE hints on the same wiphy.
* This should be picked up early by the driver/stack
*/
if (WARN_ON(!alpha2_equal(cfg80211_regdomain->alpha2,
alpha2)))
if (WARN_ON(regdom_changes(alpha2)))
return 0;
return -EALREADY;
}
Expand All @@ -1153,7 +1151,7 @@ static int ignore_request(struct wiphy *wiphy, enum reg_set_by set_by,
if (last_request->initiator == REGDOM_SET_BY_CORE) {
if (is_old_static_regdom(cfg80211_regdomain))
return 0;
if (!alpha2_equal(cfg80211_regdomain->alpha2, alpha2))
if (regdom_changes(alpha2))
return 0;
return -EALREADY;
}
Expand All @@ -1164,7 +1162,7 @@ static int ignore_request(struct wiphy *wiphy, enum reg_set_by set_by,
* loaded card also agrees on the regulatory domain.
*/
if (last_request->initiator == REGDOM_SET_BY_DRIVER &&
alpha2_equal(cfg80211_regdomain->alpha2, alpha2))
!regdom_changes(alpha2))
return -EALREADY;

return REG_INTERSECT;
Expand All @@ -1185,13 +1183,12 @@ static int ignore_request(struct wiphy *wiphy, enum reg_set_by set_by,
if (last_request->initiator == REGDOM_SET_BY_CORE ||
last_request->initiator == REGDOM_SET_BY_DRIVER ||
last_request->initiator == REGDOM_SET_BY_USER) {
if (!alpha2_equal(last_request->alpha2,
cfg80211_regdomain->alpha2))
if (regdom_changes(last_request->alpha2))
return -EAGAIN;
}

if (!is_old_static_regdom(cfg80211_regdomain) &&
alpha2_equal(cfg80211_regdomain->alpha2, alpha2))
!regdom_changes(alpha2))
return -EALREADY;

return 0;
Expand Down Expand Up @@ -1720,7 +1717,7 @@ static int __set_regdom(const struct ieee80211_regdomain *rd)
* checking if the alpha2 changes if CRDA was already called
*/
if (!is_old_static_regdom(cfg80211_regdomain) &&
!regdom_changed(rd->alpha2))
!regdom_changes(rd->alpha2))
return -EINVAL;
}

Expand Down

0 comments on commit 09d4da5

Please sign in to comment.