linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Brian Norris <briannorris@chromium.org>
To: Carl Huang <cjhuang@codeaurora.org>
Cc: ath10k@lists.infradead.org, linux-wireless@vger.kernel.org,
	dianders@chromium.org, kuabhs@google.com
Subject: Re: [RFC 1/2] nl80211: add common API to configure SAR power limitations.
Date: Wed, 4 Nov 2020 15:27:06 -0800	[thread overview]
Message-ID: <20201104232706.GC3212577@google.com> (raw)
In-Reply-To: <1600753775-4745-1-git-send-email-cjhuang@codeaurora.org>

Hi Carl,

Sorry, I lied; I have a few more notes after spending another day
looking at this:

On Tue, Sep 22, 2020 at 01:49:34PM +0800, Carl Huang wrote:
> --- a/include/net/cfg80211.h
> +++ b/include/net/cfg80211.h
> @@ -1663,6 +1663,55 @@ struct station_info {
> +/**
> + * @struct cfg80211_sar_chan_ranges - sar frequency ranges
> + * @index: the index of this range. It's used to specify
> + *	the frequency range when setting SAR power limitation
> + * @start_freq:  start channel frequency in kHZ. For example,
> + *	2.4G channel 1 is represented as 2412000
> + * @end_freq:    end channel frequency in kHZ

If you accept my comments in nl80211.h, you'll want to change this too.

> + */
> +struct cfg80211_sar_freq_ranges {
> +	u8 index;
> +	u32 start_freq;
> +	u32 end_freq;
> +};

> --- a/include/uapi/linux/nl80211.h
> +++ b/include/uapi/linux/nl80211.h

> + * @NL80211_SAR_ATTR_SPECS_START_FREQ: Required (u32) value to specify the start
> + *	frequency of this range to register SAR capability to wihpy and the unit
> + *	is kHZ
> + *
> + * @NL80211_SAR_ATTR_SPECS_END_FREQ: Required (u32) value to specify the end frequency
> + *	of this range to register SAR capability to wiphy and the unit is kHZ

The documentation here isn't clear whether these are center frequencies
or band edges. The cfg80211 comments do though (center freq). However,
this is inconsistent with NL80211_ATTR_FREQ_RANGE_START and
NL80211_ATTR_FREQ_RANGE_END -- I'd suggest being consistent?

> --- a/net/mac80211/cfg.c
> +++ b/net/mac80211/cfg.c

> @@ -15331,6 +15496,14 @@ static const struct genl_ops nl80211_ops[] = {
>  		.internal_flags = NL80211_FLAG_NEED_NETDEV |
>  				  NL80211_FLAG_NEED_RTNL,
>  	},
> +	{
> +		.cmd = NL80211_CMD_SET_SAR_SPECS,
> +		.validate = GENL_DONT_VALIDATE_STRICT | GENL_DONT_VALIDATE_DUMP,
> +		.doit = nl80211_set_sar_specs,
> +		.flags = GENL_UNS_ADMIN_PERM,
> +		.internal_flags = NL80211_FLAG_NEED_NETDEV_UP |

Is there a reason this needs to be UP? CMD_SET_WIPHY (which can also
configure TX power, a little differently) does not. Seems like this
could just be NL80211_FLAG_NEED_NETDEV -- or maybe not even that, if we
switch this to a WIPHY command like Johannes noted.

Brian

> +				  NL80211_FLAG_NEED_RTNL,
> +	},
>  };

  parent reply	other threads:[~2020-11-04 23:28 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-22  5:49 [RFC 1/2] nl80211: add common API to configure SAR power limitations Carl Huang
2020-09-22  5:49 ` [RFC 2/2] ath10k: allow dynamic SAR power limits via common API Carl Huang
2020-11-04 23:11   ` Brian Norris
2020-11-05 11:27     ` Carl Huang
2020-11-05 17:49       ` Brian Norris
2020-09-28 12:36 ` [RFC 1/2] nl80211: add common API to configure SAR power limitations Johannes Berg
2020-10-30 20:56   ` Abhishek Kumar
2020-10-31  2:46     ` Abhishek Kumar
2020-11-03  2:34       ` Carl Huang
2020-11-03 13:15         ` Johannes Berg
2020-11-04  1:17           ` Abhishek Kumar
2020-11-04  6:18             ` Carl Huang
2020-11-04  8:44   ` Carl Huang
2020-11-04 17:48     ` Brian Norris
2020-11-05 11:37       ` Carl Huang
2020-11-04 23:18   ` Brian Norris
2020-11-04 23:27 ` Brian Norris [this message]
2020-11-05 11:30   ` Carl Huang
  -- strict thread matches above, loose matches on Subject: below --
2020-09-22  5:36 Carl Huang
2020-09-22  5:47 ` cjhuang
2020-09-22  8:09   ` Kalle Valo
2020-11-04  2:00 ` Brian Norris
2020-11-04  7:32   ` Carl Huang
2020-11-04 17:44     ` Brian Norris
2020-11-05  8:35       ` Kalle Valo
2020-11-05 11:10         ` Carl Huang
2020-11-05 18:25           ` Brian Norris
2020-11-06 10:11             ` Carl Huang
2020-11-05 11:17       ` Carl Huang

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=20201104232706.GC3212577@google.com \
    --to=briannorris@chromium.org \
    --cc=ath10k@lists.infradead.org \
    --cc=cjhuang@codeaurora.org \
    --cc=dianders@chromium.org \
    --cc=kuabhs@google.com \
    --cc=linux-wireless@vger.kernel.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).