From: Johannes Berg <johannes-cdvu00un1VgdHxzADdlk8Q@public.gmane.org>
To: "Rafał Miłecki" <zajec5-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
linux-wireless-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: "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,
"Rafał Miłecki" <rafal-g1n6cQUeyibVItvQsEIGlw@public.gmane.org>
Subject: Re: [PATCH V5 3/3] cfg80211: support ieee80211-freq-limit DT property
Date: Wed, 04 Jan 2017 14:26:46 +0100 [thread overview]
Message-ID: <1483536406.7312.3.camel@sipsolutions.net> (raw)
In-Reply-To: <20170103225715.14072-3-zajec5-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> (sfid-20170103_235738_606634_945A6D98)
> V4: Move code to of.c
> Use one helper called at init time (no runtime hooks)
> Modify orig_flags
> +/**
> + * wiphy_read_of_freq_limits - read frequency limits from device
> tree
> + *
> + * @wiphy: the wireless device to get extra limits for
> + *
> + * Some devices may have extra limitations specified in DT. This may
> be useful
> + * for chipsets that normally support more bands but are limited due
> to board
> + * design (e.g. by antennas or extermal power amplifier).
> + *
> + * This function reads info from DT and uses it to *modify* channels
> (disable
> + * unavailable ones). It's usually a *bad* idea to use it in drivers
> with
> + * shared channel data as DT limitations are device specific.
> + *
> + * As this function access device node it has to be called after
> set_wiphy_dev.
> + * It also modifies channels so they have to be set first.
> + */
It should also be called before wiphy_register(), I think? And I
suppose you should add a comment about not being able to use shared
channels.
> + pr_debug("Disabling freq %d MHz as
> it's out of OF limits\n",
> + chan->center_freq);
> + chan->orig_flags |=
> IEEE80211_CHAN_DISABLED;
>
But just setting orig_flags also won't work, since it'd be overwritten
again by wiphy_register(), no?
johannes
next prev parent reply other threads:[~2017-01-04 13:26 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-03 22:57 [PATCH V5 1/3] dt-bindings: document common IEEE 802.11 frequency limit property Rafał Miłecki
[not found] ` <20170103225715.14072-1-zajec5-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-01-03 22:57 ` [PATCH V5 2/3] cfg80211: move function checking range fit to util.c Rafał Miłecki
2017-01-03 22:57 ` [PATCH V5 3/3] cfg80211: support ieee80211-freq-limit DT property Rafał Miłecki
[not found] ` <20170103225715.14072-3-zajec5-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-01-04 13:26 ` Johannes Berg [this message]
[not found] ` <1483536406.7312.3.camel-cdvu00un1VgdHxzADdlk8Q@public.gmane.org>
2017-01-04 16:13 ` Rafał Miłecki
[not found] ` <CACna6ryzk958T0by_4F96hJxUCR5VsKJjrsjByFO96+HcfmXqg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-01-05 11:50 ` Johannes Berg
2017-01-03 22:57 ` [PATCH V5 4/3] brcmfmac: use wiphy_read_of_freq_limits to respect extra limits Rafał Miłecki
[not found] ` <20170103225715.14072-4-zajec5-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-01-04 14:20 ` Rob Herring
2017-01-04 6:20 ` [PATCH V5 1/3] dt-bindings: document common IEEE 802.11 frequency limit property Rafał Miłecki
[not found] ` <d90127bd-6a9e-2773-fdf9-527afdc004a6-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-01-04 10:02 ` Arend Van Spriel
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=1483536406.7312.3.camel@sipsolutions.net \
--to=johannes-cdvu00un1vgdhxzaddlk8q@public.gmane.org \
--cc=arend-dY08KVG/lbpWk0Htik3J/w@public.gmane.org \
--cc=arnd-r2nGTMty4D4@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@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 \
--cc=zajec5-Re5JQEeQqe8AvxtiuMwx3w@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).