diff options
author | Luis R. Rodriguez <mcgrof@do-not-panic.com> | 2013-11-13 12:54:03 -0500 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2013-11-25 14:52:14 -0500 |
commit | adbfb058155dfabe77ea73c303cbd75af7e4d9d3 (patch) | |
tree | 05a4504299763851d6e338e9e378e746b5d37a5f /net/wireless/reg.c | |
parent | 4c7d3982a6e37831382b9ef90aa0dbadc0bf3a22 (diff) |
cfg80211: intersection dfs regions when intersecting regdomains
Only allow DFS to be set if the DFS regions agree.
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/wireless/reg.c')
-rw-r--r-- | net/wireless/reg.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/net/wireless/reg.c b/net/wireless/reg.c index 2796b622890f..068cb4055a62 100644 --- a/net/wireless/reg.c +++ b/net/wireless/reg.c | |||
@@ -571,6 +571,20 @@ static bool freq_in_rule_band(const struct ieee80211_freq_range *freq_range, | |||
571 | } | 571 | } |
572 | 572 | ||
573 | /* | 573 | /* |
574 | * Later on we can perhaps use the more restrictive DFS | ||
575 | * region but we don't have information for that yet so | ||
576 | * for now simply disallow conflicts. | ||
577 | */ | ||
578 | static enum nl80211_dfs_regions | ||
579 | reg_intersect_dfs_region(const enum nl80211_dfs_regions dfs_region1, | ||
580 | const enum nl80211_dfs_regions dfs_region2) | ||
581 | { | ||
582 | if (dfs_region1 != dfs_region2) | ||
583 | return NL80211_DFS_UNSET; | ||
584 | return dfs_region1; | ||
585 | } | ||
586 | |||
587 | /* | ||
574 | * Helper for regdom_intersect(), this does the real | 588 | * Helper for regdom_intersect(), this does the real |
575 | * mathematical intersection fun | 589 | * mathematical intersection fun |
576 | */ | 590 | */ |
@@ -701,6 +715,8 @@ regdom_intersect(const struct ieee80211_regdomain *rd1, | |||
701 | rd->n_reg_rules = num_rules; | 715 | rd->n_reg_rules = num_rules; |
702 | rd->alpha2[0] = '9'; | 716 | rd->alpha2[0] = '9'; |
703 | rd->alpha2[1] = '8'; | 717 | rd->alpha2[1] = '8'; |
718 | rd->dfs_region = reg_intersect_dfs_region(rd1->dfs_region, | ||
719 | rd2->dfs_region); | ||
704 | 720 | ||
705 | return rd; | 721 | return rd; |
706 | } | 722 | } |