All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Aloka Dixit <quic_alokad@quicinc.com>, linux-wireless@vger.kernel.org
Cc: Muna Sinada <quic_msinada@quicinc.com>
Subject: Re: [PATCH v3 1/6] wifi: nl80211: configure puncturing bitmap in NL80211_CMD_START_AP
Date: Mon, 30 Jan 2023 09:40:04 +0100	[thread overview]
Message-ID: <3552eaee6a02d0b76dc4353b0d5556c3fe503d8e.camel@sipsolutions.net> (raw)
In-Reply-To: <20230130072239.26345-2-quic_alokad@quicinc.com>

On Sun, 2023-01-29 at 23:22 -0800, Aloka Dixit wrote:
> 
> v3: Validation and storing the bitmap moved to MAC80211.

I think I'd prefer we move the validation function to cfg80211 so both
can use it, this way all potential non-mac80211 drivers have to do it as
well, and then they'll move the function _anyway_ to do the validation
in a single place, I'd hope?

> + * @punct_bitmap: Preamble puncturing bitmap. Each bit represents a 20 MHz
> + *	channel, lowest bit corresponding to the lowest frequency. Bit set
> + *	to 1 indicates that the channel is punctured. Higher 16 bits are
> + *	reserved.
>   */
>  struct cfg80211_ap_settings {
>  	struct cfg80211_chan_def chandef;
> @@ -1350,6 +1354,7 @@ struct cfg80211_ap_settings {
>  	struct cfg80211_fils_discovery fils_discovery;
>  	struct cfg80211_unsol_bcast_probe_resp unsol_bcast_probe_resp;
>  	struct cfg80211_mbssid_config mbssid_config;
> +	u32 punct_bitmap;

Internally I think we can continue to use u16, that's trivial to change
later.

> + * @NL80211_EXT_FEATURE_EHT_PUNCTURING: Driver supports preamble puncturing in
> + *	EHT.

That should probably make some mention of AP mode? It's not optional in
any way for client, after all, and also not relevant to the API how
client does it.

> +static int nl80211_parse_punct_bitmap(struct cfg80211_registered_device *rdev,
> +				      struct genl_info *info,
> +				      u32 *bitmap)
> +{
> +	if (!bitmap ||
> +	    !wiphy_ext_feature_isset(&rdev->wiphy,
> +				     NL80211_EXT_FEATURE_EHT_PUNCTURING))
> +		return -EINVAL;
> +
> +	*bitmap = nla_get_u32(info->attrs[NL80211_ATTR_PUNCT_BITMAP]) & 0xFFFF;

As the top bits are *reserved* then you should check that they're indeed
zero - now they're ignored, which is generally bad. They might not
always be.

johannes

  reply	other threads:[~2023-01-30  8:40 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-30  7:22 [PATCH v3 0/6] Puncturing support in AP mode Aloka Dixit
2023-01-30  7:22 ` [PATCH v3 1/6] wifi: nl80211: configure puncturing bitmap in NL80211_CMD_START_AP Aloka Dixit
2023-01-30  8:40   ` Johannes Berg [this message]
2023-01-30 19:35     ` Aloka Dixit
2023-01-30 19:40       ` Aloka Dixit
2023-01-30  7:22 ` [PATCH v3 2/6] wifi: mac80211: validate and configure puncturing bitmap in start_ap() Aloka Dixit
2023-01-30  8:42   ` Johannes Berg
2023-01-30  7:22 ` [PATCH v3 3/6] wifi: nl80211: configure puncturing in NL80211_CMD_CHANNEL_SWITCH Aloka Dixit
2023-01-30  8:43   ` Johannes Berg
2023-01-30  7:22 ` [PATCH v3 4/6] wifi: mac80211: configure puncturing bitmap in channel_switch() Aloka Dixit
2023-01-30  8:44   ` Johannes Berg
2023-01-30  7:22 ` [PATCH v3 5/6] wifi: cfg80211: add puncturing bitmap in channel switch notifications Aloka Dixit
2023-01-30  8:45   ` Johannes Berg
2023-01-30  7:22 ` [PATCH v3 6/6] wifi: nl80211: add puncturing bitmap in channel switch events Aloka Dixit
2023-01-30  8:48 ` [PATCH v3 0/6] Puncturing support in AP mode Johannes Berg
2023-01-30 19:44   ` Aloka Dixit

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=3552eaee6a02d0b76dc4353b0d5556c3fe503d8e.camel@sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=quic_alokad@quicinc.com \
    --cc=quic_msinada@quicinc.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.