Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 159376
b: refs/heads/master
c: 4b44c8b
h: refs/heads/master
v: v3
  • Loading branch information
Luis R. Rodriguez authored and John W. Linville committed Aug 4, 2009
1 parent 3e4db04 commit 1f756df
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 43 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: 9828b0170eef541c3fa583caa0134dadbb1d3ea6
refs/heads/master: 4b44c8bc4d077f1a7a9e5e946a1400c3cbcadee7
51 changes: 9 additions & 42 deletions trunk/net/wireless/reg.c
Original file line number Diff line number Diff line change
Expand Up @@ -1762,6 +1762,10 @@ static bool reg_same_country_ie_hint(struct wiphy *wiphy,
return false;
}

/*
* We hold wdev_lock() here so we cannot hold cfg80211_mutex() and
* therefore cannot iterate over the rdev list here.
*/
void regulatory_hint_11d(struct wiphy *wiphy,
u8 *country_ie,
u8 country_ie_len)
Expand Down Expand Up @@ -1804,51 +1808,14 @@ void regulatory_hint_11d(struct wiphy *wiphy,
* We will run this for *every* beacon processed for the BSSID, so
* we optimize an early check to exit out early if we don't have to
* do anything
*
* We leave conflict resolution to the workqueue, where can hold
* cfg80211_mutex.
*/
if (likely(last_request->initiator ==
NL80211_REGDOM_SET_BY_COUNTRY_IE &&
wiphy_idx_valid(last_request->wiphy_idx))) {
struct cfg80211_registered_device *rdev_last_ie;

rdev_last_ie =
cfg80211_rdev_by_wiphy_idx(last_request->wiphy_idx);

/*
* Lets keep this simple -- we trust the first AP
* after we intersect with CRDA
*/
if (likely(&rdev_last_ie->wiphy == wiphy)) {
/*
* Ignore IEs coming in on this wiphy with
* the same alpha2 and environment cap
*/
if (likely(alpha2_equal(rdev_last_ie->country_ie_alpha2,
alpha2) &&
env == rdev_last_ie->env)) {
goto out;
}
/*
* the wiphy moved on to another BSSID or the AP
* was reconfigured. XXX: We need to deal with the
* case where the user suspends and goes to goes
* to another country, and then gets IEs from an
* AP with different settings
*/
goto out;
} else {
/*
* Ignore IEs coming in on two separate wiphys with
* the same alpha2 and environment cap
*/
if (likely(alpha2_equal(rdev_last_ie->country_ie_alpha2,
alpha2) &&
env == rdev_last_ie->env)) {
goto out;
}
/* We could potentially intersect though */
goto out;
}
}
wiphy_idx_valid(last_request->wiphy_idx)))
goto out;

rd = country_ie_2_rd(country_ie, country_ie_len, &checksum);
if (!rd)
Expand Down

0 comments on commit 1f756df

Please sign in to comment.