Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 134924
b: refs/heads/master
c: ba25c14
h: refs/heads/master
v: v3
  • Loading branch information
Luis R. Rodriguez authored and John W. Linville committed Feb 27, 2009
1 parent af4a1a4 commit 9dd73c1
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 10 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: 80778f18c09673df2712c7da28aa920469adcae2
refs/heads/master: ba25c1414264f1f5fc046cf34d20947e41713a0d
34 changes: 25 additions & 9 deletions trunk/net/wireless/reg.c
Original file line number Diff line number Diff line change
Expand Up @@ -1050,11 +1050,7 @@ static int ignore_request(struct wiphy *wiphy, enum reg_set_by set_by,
case REGDOM_SET_BY_INIT:
return -EINVAL;
case REGDOM_SET_BY_CORE:
/*
* Always respect new wireless core hints, should only happen
* when updating the world regulatory domain at init.
*/
return 0;
return -EINVAL;
case REGDOM_SET_BY_COUNTRY_IE:
if (unlikely(!is_an_alpha2(alpha2)))
return -EINVAL;
Expand Down Expand Up @@ -1183,6 +1179,26 @@ int __regulatory_hint(struct wiphy *wiphy, enum reg_set_by set_by,
return call_crda(alpha2);
}

static int regulatory_hint_core(const char *alpha2)
{
struct regulatory_request *request;

BUG_ON(last_request);

request = kzalloc(sizeof(struct regulatory_request),
GFP_KERNEL);
if (!request)
return -ENOMEM;

request->alpha2[0] = alpha2[0];
request->alpha2[1] = alpha2[1];
request->initiator = REGDOM_SET_BY_CORE;

last_request = request;

return call_crda(alpha2);
}

void regulatory_hint(struct wiphy *wiphy, const char *alpha2)
{
int r;
Expand Down Expand Up @@ -1616,16 +1632,16 @@ int regulatory_init(void)
* stuck with the static values. We ignore "EU" code as
* that is not a valid ISO / IEC 3166 alpha2 */
if (ieee80211_regdom[0] != 'E' || ieee80211_regdom[1] != 'U')
err = __regulatory_hint(NULL, REGDOM_SET_BY_CORE,
ieee80211_regdom, 0, ENVIRON_ANY);
err = regulatory_hint_core(ieee80211_regdom);
#else
cfg80211_regdomain = cfg80211_world_regdom;

err = __regulatory_hint(NULL, REGDOM_SET_BY_CORE, "00", 0, ENVIRON_ANY);
if (err)
err = regulatory_hint_core("00");
if (err) {
printk(KERN_ERR "cfg80211: calling CRDA failed - "
"unable to update world regulatory domain, "
"using static definition\n");
}
#endif

return 0;
Expand Down

0 comments on commit 9dd73c1

Please sign in to comment.