From: Felix Fietkau <nbd@nbd.name>
To: Rob Herring <robh@kernel.org>
Cc: linux-wireless@vger.kernel.org, devicetree@vger.kernel.org,
evelyn.tsai@mediatek.com, Shayne Chen <shayne.chen@mediatek.com>
Subject: Re: [PATCH v3 1/4] dt-bindings: net: wireless: mt76: add power-limits node
Date: Tue, 21 Jul 2020 20:17:50 +0200 [thread overview]
Message-ID: <1fb272a4-1b7a-d054-4c63-7fef1237e269@nbd.name> (raw)
In-Reply-To: <20200721030416.GA3448943@bogus>
On 2020-07-21 05:04, Rob Herring wrote:
> On Wed, Jul 15, 2020 at 03:01:34PM +0200, Felix Fietkau wrote:
>> This subnode can be used to set per-rate tx power limits either per
>> country code / regdomain or globally.
>> These limits are typically provided by the device manufacturers and are
>> used to limit sideband emissions and stay within regulatory limits
>>
>> Co-developed-by: Shayne Chen <shayne.chen@mediatek.com>
>> Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
>> Signed-off-by: Felix Fietkau <nbd@nbd.name>
>> ---
>> v3:
>> - fix S-o-b order
>> v2:
>> - merge 802.11ax rate changes from Shayne's patch
>> - document txs-delta property
>
> This is an extensive enough change that I think it needs to be in schema
> format.
Okay, I will convert the existing file soon and then add these changes
afterwards.
>> .../bindings/net/wireless/mediatek,mt76.txt | 59 +++++++++++++++++++
>> 1 file changed, 59 insertions(+)
>>
>> diff --git a/Documentation/devicetree/bindings/net/wireless/mediatek,mt76.txt b/Documentation/devicetree/bindings/net/wireless/mediatek,mt76.txt
>> index ab7e7a00e534..e4859c974ef4 100644
>> --- a/Documentation/devicetree/bindings/net/wireless/mediatek,mt76.txt
>> +++ b/Documentation/devicetree/bindings/net/wireless/mediatek,mt76.txt
>> @@ -36,6 +36,7 @@ Optional nodes:
>> - led: Properties for a connected LED
>> Optional properties:
>> - led-sources: See Documentation/devicetree/bindings/leds/common.txt
>> +- power-limits: contains per-regdomain/channel rate power limit subnodes
>>
>> &pcie {
>> pcie0 {
>> @@ -76,3 +77,61 @@ wmac: wmac@18000000 {
>>
>> power-domains = <&scpsys MT7622_POWER_DOMAIN_WB>;
>> };
>> +
>> +
>> +Subnodes of power-limits:
>> +
>> +Properties:
>> +- country: One or more country codes, as used by the cfg80211 regdomain code
>
> What are the values? cfg80211 is a Linux thing and doesn't belong in
> bindings.
I'll change the description to leave out cfg80211.
It's a simple alpha2 country code.
>> +- regdomain: "FCC", "ETSI" or "JP"
>
> These aren't implied by the country code?
You use either country code or regdomain.
>> +If neither country, nor regdomain is specified, the power limits node is used
>> +as a fallback when no other subnode matches.
>> +
>> +Subnodes txpower-2g, txpower-5g:
>> +
>> +Properties:
>> +- channels: pairs of first and last channel number
>
> What's the range in terms of channel numbers and pairs?
802.11 channel numbers (0-255)
>> +- cck: 4 half-dBm per-rate power limit values
>> +- ofdm: 8 half-dBm per-rate power limit values
>> +- mcs:
>> + sets of per-rate power limit values for 802.11n/802.11ac rates for
>> + multiple channel bandwidth settings.
>> + Each set starts with the number of channel bandwidth settings for
>> + which the rate set applies, followed by either 8 (MT7603/MT7628) or
>> + 10 (all other chips) power limit values.
>> + The order of the channel bandwidth settings is: 20, 40, 80, 160 MHz.
>
> The example only has 2 sets, so which channels are they?
The format is <number_of_sets set_data>, so a set starting with <3 ...>
would contain the values for 20, 40 and 80 MHz and you'd add another one
with <1 ...> to describe 160 MHz.
Sets often contain the same data for multiple channel bandwidths, so
this reduces duplication.
>> +- ru:
>> + sets of per-rate power limit values for 802.11ax rates for multiple
>> + channel bandwidth or resource unit settings.
>> + Each set starts with the number of channel bandwidth or resource unit
>> + settings for which the rate set applies, followed by 12 power limit
>> + values. The order of the channel resource unit settings is:
>> + RU26, RU52, RU106, RU242/SU20, RU484/SU40, RU996/SU80, RU2x996/SU160.
>
> Could be 8-bit? Doesn't really matter much for the example, but what's
> the worst/typical case?
Yes, 8 bit would also work.
>> +- txs-delta: half-dBm power delta for different numbers of antennas (1, 2, ...)
>> +
>> +
>> +power-limit example:
>> +
>> +power-limits {
>> + r0 {
>
> What's 'r0'? Not documented.
>
>> + regdomain = "FCC";
>> + txpower-5g {
>> + r1 {
>
> What's 'r1' and 'r2'? Not documented.
You add an arbitrary number of subnodes (I just used r0, r1, ...)
containing rules with the documented properties.
- Felix
prev parent reply other threads:[~2020-07-21 18:17 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-15 13:01 [PATCH v3 1/4] dt-bindings: net: wireless: mt76: add power-limits node Felix Fietkau
2020-07-21 3:04 ` Rob Herring
2020-07-21 18:17 ` Felix Fietkau [this message]
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=1fb272a4-1b7a-d054-4c63-7fef1237e269@nbd.name \
--to=nbd@nbd.name \
--cc=devicetree@vger.kernel.org \
--cc=evelyn.tsai@mediatek.com \
--cc=linux-wireless@vger.kernel.org \
--cc=robh@kernel.org \
--cc=shayne.chen@mediatek.com \
/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).