* [PATCH] cfg80211: avoid intersection when applying custom reg
@ 2014-12-07 16:03 Arik Nemtsov
2014-12-12 12:41 ` Johannes Berg
2014-12-12 21:51 ` Luis R. Rodriguez
0 siblings, 2 replies; 4+ messages in thread
From: Arik Nemtsov @ 2014-12-07 16:03 UTC (permalink / raw)
To: linux-wireless; +Cc: Johannes Berg, Luis R. Rodriguez, Arik Nemtsov
The custom-reg handling function can currently only add flags to a given
channel. This results in stale flags being left applied. In some cases
a channel was disabled and even the orig_flags were changed to reflect
this.
Previously the API was designed for a single invocation before wiphy
registration, so this didn't matter. The previous approach doesn't scale
well to self-managed regulatory devices, particularly when a more
permissive regdom is applied after a restrictive one.
Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com>
---
net/wireless/reg.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/net/wireless/reg.c b/net/wireless/reg.c
index 8941e1c..e4f4619 100644
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -1686,8 +1686,7 @@ static void handle_channel_custom(struct wiphy *wiphy,
if (IS_ERR(reg_rule)) {
REG_DBG_PRINT("Disabling freq %d MHz as custom regd has no rule that fits it\n",
chan->center_freq);
- chan->orig_flags |= IEEE80211_CHAN_DISABLED;
- chan->flags = chan->orig_flags;
+ chan->flags |= IEEE80211_CHAN_DISABLED;
return;
}
@@ -1712,7 +1711,7 @@ static void handle_channel_custom(struct wiphy *wiphy,
chan->dfs_state = NL80211_DFS_USABLE;
chan->beacon_found = false;
- chan->flags |= map_regdom_flags(reg_rule->flags) | bw_flags;
+ chan->flags = map_regdom_flags(reg_rule->flags) | bw_flags;
chan->max_antenna_gain = (int) MBI_TO_DBI(power_rule->max_antenna_gain);
chan->max_reg_power = chan->max_power =
(int) MBM_TO_DBM(power_rule->max_eirp);
--
1.9.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] cfg80211: avoid intersection when applying custom reg
2014-12-07 16:03 [PATCH] cfg80211: avoid intersection when applying custom reg Arik Nemtsov
@ 2014-12-12 12:41 ` Johannes Berg
2014-12-14 10:28 ` Arik Nemtsov
2014-12-12 21:51 ` Luis R. Rodriguez
1 sibling, 1 reply; 4+ messages in thread
From: Johannes Berg @ 2014-12-12 12:41 UTC (permalink / raw)
To: Arik Nemtsov; +Cc: linux-wireless, Luis R. Rodriguez
On Sun, 2014-12-07 at 18:03 +0200, Arik Nemtsov wrote:
> The custom-reg handling function can currently only add flags to a given
> channel. This results in stale flags being left applied. In some cases
> a channel was disabled and even the orig_flags were changed to reflect
> this.
>
> Previously the API was designed for a single invocation before wiphy
> registration, so this didn't matter. The previous approach doesn't scale
> well to self-managed regulatory devices, particularly when a more
> permissive regdom is applied after a restrictive one.
This description (not the patch) only makes sense after the other series
with self-managed, please resend it in the self-managed patchset.
johannes
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] cfg80211: avoid intersection when applying custom reg
2014-12-07 16:03 [PATCH] cfg80211: avoid intersection when applying custom reg Arik Nemtsov
2014-12-12 12:41 ` Johannes Berg
@ 2014-12-12 21:51 ` Luis R. Rodriguez
1 sibling, 0 replies; 4+ messages in thread
From: Luis R. Rodriguez @ 2014-12-12 21:51 UTC (permalink / raw)
To: Arik Nemtsov; +Cc: linux-wireless, Johannes Berg
On Sun, Dec 07, 2014 at 06:03:45PM +0200, Arik Nemtsov wrote:
> The custom-reg handling function can currently only add flags to a given
> channel. This results in stale flags being left applied. In some cases
> a channel was disabled and even the orig_flags were changed to reflect
> this.
>
> Previously the API was designed for a single invocation before wiphy
> registration, so this didn't matter. The previous approach doesn't scale
> well to self-managed regulatory devices, particularly when a more
> permissive regdom is applied after a restrictive one.
So why not make this an excemption to only managed devices? You show the
issue but am not convinced this won't introduce regressions so would
prefer to make this an exception for managed devices.
Luis
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] cfg80211: avoid intersection when applying custom reg
2014-12-12 12:41 ` Johannes Berg
@ 2014-12-14 10:28 ` Arik Nemtsov
0 siblings, 0 replies; 4+ messages in thread
From: Arik Nemtsov @ 2014-12-14 10:28 UTC (permalink / raw)
To: Johannes Berg; +Cc: linux-wireless@vger.kernel.org, Luis R. Rodriguez
On Fri, Dec 12, 2014 at 2:41 PM, Johannes Berg
<johannes@sipsolutions.net> wrote:
>
> On Sun, 2014-12-07 at 18:03 +0200, Arik Nemtsov wrote:
> > The custom-reg handling function can currently only add flags to a given
> > channel. This results in stale flags being left applied. In some cases
> > a channel was disabled and even the orig_flags were changed to reflect
> > this.
> >
> > Previously the API was designed for a single invocation before wiphy
> > registration, so this didn't matter. The previous approach doesn't scale
> > well to self-managed regulatory devices, particularly when a more
> > permissive regdom is applied after a restrictive one.
>
> This description (not the patch) only makes sense after the other series
> with self-managed, please resend it in the self-managed patchset.
Sure. I'll also make it self-managed only, so avoid possible
regressions, as Luis commented.
Arik
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2014-12-14 10:28 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-07 16:03 [PATCH] cfg80211: avoid intersection when applying custom reg Arik Nemtsov
2014-12-12 12:41 ` Johannes Berg
2014-12-14 10:28 ` Arik Nemtsov
2014-12-12 21:51 ` Luis R. Rodriguez
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).