devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Rafał Miłecki" <zajec5-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Arend van Spriel
	<arend.vanspriel-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
Cc: "Johannes Berg"
	<johannes-cdvu00un1VgdHxzADdlk8Q@public.gmane.org>,
	"linux-wireless-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-wireless-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"Martin Blumenstingl"
	<martin.blumenstingl-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org>,
	"Felix Fietkau" <nbd-Vt+b4OUoWG0@public.gmane.org>,
	"Arend van Spriel"
	<arend-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>,
	"Arnd Bergmann" <arnd-r2nGTMty4D4@public.gmane.org>,
	"devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"Rafał Miłecki" <rafal-g1n6cQUeyibVItvQsEIGlw@public.gmane.org>
Subject: Re: [PATCH V3 2/2] cfg80211: support ieee80211-freq-limit DT property
Date: Mon, 2 Jan 2017 23:16:12 +0100	[thread overview]
Message-ID: <CACna6rx5fMFVyjB=4=ZeXhfXWGPQmKiEQuJRY+mz2OFMLYx_HA@mail.gmail.com> (raw)
In-Reply-To: <e194b980-1048-8da6-624b-26f824ff655d-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>

On 2 January 2017 at 21:12, Arend van Spriel
<arend.vanspriel-dY08KVG/lbpWk0Htik3J/w@public.gmane.org> wrote:
> On 02-01-17 18:52, Johannes Berg wrote:
>>> +static void wiphy_freq_limits_apply(struct wiphy *wiphy)
>> [...]
>>> +                    if (!wiphy_freq_limits_valid_chan(wiphy,
>>> chan)) {
>>> +                            pr_debug("Disabling freq %d MHz as
>>> it's out of OF limits\n",
>>> +                                     chan->center_freq);
>>> +                            chan->flags |=
>>> IEEE80211_CHAN_DISABLED;
>>
>> I think you didn't address the problem in the best way now.
>>
>> The problem with the channel sharing was the way you're applying the
>> limits - at runtime. This is now OK since the new function shouldn't be
>> called when the channel structs are shared, but hooking it all into thes
>> regulatory code is now no longer needed.
>>
>> What you can do now, when reading the OF data, is actually apply it to
>> the channel flags immediately. If done *before* wiphy_register(), these
>> flags will be preserved forever, so you no longer need any hooks in
>> regulatory code at all - you can just set the original channel flags
>> according to the OF data.
>
> I suppose this then can also be done early in the wiphy_register()
> function itself, right?

When driver calls wiphy_apply_custom_regulatory I need to already have
limits read from the DT (at least in my current implementation, it may
change, but I need help understanding flow first). As
wiphy_apply_custom_regulatory has to be called before wiphy_register,
I can't read DT so late (in wiphy_register).

-- 
Rafał

  parent reply	other threads:[~2017-01-02 22:16 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-02 16:32 [PATCH V3 1/2] dt-bindings: document common IEEE 802.11 frequency limit property Rafał Miłecki
     [not found] ` <20170102163209.2445-1-zajec5-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-01-02 16:32   ` [PATCH V3 2/2] cfg80211: support ieee80211-freq-limit DT property Rafał Miłecki
     [not found]     ` <20170102163209.2445-2-zajec5-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-01-02 17:52       ` Johannes Berg
     [not found]         ` <1483379548.15591.1.camel-cdvu00un1VgdHxzADdlk8Q@public.gmane.org>
2017-01-02 20:12           ` Arend van Spriel
     [not found]             ` <e194b980-1048-8da6-624b-26f824ff655d-dY08KVG/lbpWk0Htik3J/w@public.gmane.org>
2017-01-02 22:16               ` Rafał Miłecki [this message]
2017-01-03  7:00               ` Johannes Berg
2017-01-02 22:12           ` Rafał Miłecki
     [not found]             ` <CACna6ryrYY5G=Fvmsrq_sD3iX5dWreyz7R8mGEd6ogUck=twnQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-01-03  7:06               ` Johannes Berg
2017-01-02 16:32   ` [PATCH V3 3/2] brcmfmac: use wiphy_read_of_freq_limits to get extra limits Rafał Miłecki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CACna6rx5fMFVyjB=4=ZeXhfXWGPQmKiEQuJRY+mz2OFMLYx_HA@mail.gmail.com' \
    --to=zajec5-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=arend-dY08KVG/lbpWk0Htik3J/w@public.gmane.org \
    --cc=arend.vanspriel-dY08KVG/lbpWk0Htik3J/w@public.gmane.org \
    --cc=arnd-r2nGTMty4D4@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=johannes-cdvu00un1VgdHxzADdlk8Q@public.gmane.org \
    --cc=linux-wireless-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=martin.blumenstingl-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org \
    --cc=nbd-Vt+b4OUoWG0@public.gmane.org \
    --cc=rafal-g1n6cQUeyibVItvQsEIGlw@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).