Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 351738
b: refs/heads/master
c: 5d885b9
h: refs/heads/master
v: v3
  • Loading branch information
Johannes Berg committed Jan 3, 2013
1 parent 57338e5 commit 2d9edcd
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 16 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: 0ba857ad671aa8aa2a1276aa7a0c79abd0575146
refs/heads/master: 5d885b999c68283c493cf00cc020260d38951ae6
31 changes: 16 additions & 15 deletions trunk/net/wireless/reg.c
Original file line number Diff line number Diff line change
Expand Up @@ -678,28 +678,15 @@ static int freq_reg_info_regd(struct wiphy *wiphy,
u32 center_freq,
u32 desired_bw_khz,
const struct ieee80211_reg_rule **reg_rule,
const struct ieee80211_regdomain *custom_regd)
const struct ieee80211_regdomain *regd)
{
int i;
bool band_rule_found = false;
const struct ieee80211_regdomain *regd;
bool bw_fits = false;

if (!desired_bw_khz)
desired_bw_khz = MHZ_TO_KHZ(20);

regd = custom_regd ? custom_regd : cfg80211_regdomain;

/*
* Follow the driver's regulatory domain, if present, unless a country
* IE has been processed or a user wants to help complaince further
*/
if (!custom_regd &&
last_request->initiator != NL80211_REGDOM_SET_BY_COUNTRY_IE &&
last_request->initiator != NL80211_REGDOM_SET_BY_USER &&
wiphy->regd)
regd = wiphy->regd;

if (!regd)
return -EINVAL;

Expand Down Expand Up @@ -735,10 +722,24 @@ static int freq_reg_info_regd(struct wiphy *wiphy,
int freq_reg_info(struct wiphy *wiphy, u32 center_freq, u32 desired_bw_khz,
const struct ieee80211_reg_rule **reg_rule)
{
const struct ieee80211_regdomain *regd;

assert_reg_lock();
assert_cfg80211_lock();

/*
* Follow the driver's regulatory domain, if present, unless a country
* IE has been processed or a user wants to help complaince further
*/
if (last_request->initiator != NL80211_REGDOM_SET_BY_COUNTRY_IE &&
last_request->initiator != NL80211_REGDOM_SET_BY_USER &&
wiphy->regd)
regd = wiphy->regd;
else
regd = cfg80211_regdomain;

return freq_reg_info_regd(wiphy, center_freq, desired_bw_khz,
reg_rule, NULL);
reg_rule, regd);
}
EXPORT_SYMBOL(freq_reg_info);

Expand Down

0 comments on commit 2d9edcd

Please sign in to comment.