From: Johannes Berg <johannes@sipsolutions.net>
To: Felix Fietkau <nbd@nbd.name>, linux-wireless@vger.kernel.org
Subject: Re: [PATCH 01/11] wifi: cfg80211: add option for vif allowed radios
Date: Wed, 02 Oct 2024 14:55:03 +0200 [thread overview]
Message-ID: <c049e6f7de9c840affa3970cb774c7bd4aa21629.camel@sipsolutions.net> (raw)
In-Reply-To: <0ab36f572fd2a2fd8d1d1d6e6c348cf20ca9826f.1727869380.git-series.nbd@nbd.name>
> + * @NL80211_ATTR_VIF_RADIO_MASK: Bitmask of allowed radios (u32).
> + * A value of 0 means all radios.
The handling of 0 seems inconsistent, you don't always initialize it, so
0 could be reported to userspace (for interfaces created other than
through nl80211), but setting it to 0 results in non-zero "full" bitmap.
Probably just need to always initialize it in cfg80211_init_wdev()?
Though not quite sure how that meshes with the nl80211 creation.
> +static int nl80211_parse_vif_radio_mask(struct genl_info *info,
> + u32 *radio_mask)
> +{
> + struct cfg80211_registered_device *rdev = info->user_ptr[0];
> + struct nlattr *attr = info->attrs[NL80211_ATTR_VIF_RADIO_MASK];
> + u32 mask, allowed;
> +
> + if (!attr)
> + return 0;
Might be nicer to also initialize *radio_mask here
> + err = nl80211_parse_vif_radio_mask(info, &radio_mask);
> + if (err < 0)
> + return err;
> + if (radio_mask && netif_running(dev))
> + return -EBUSY;
and use the return value (==1) to distinguish this, rather than the
value you initialized radio_mask to (which is then not needed)?
Not sure, I can see benefits of this approach too I guess, just got
confused about it - and especially due to the zero issue pointed out
above.
johannes
next prev parent reply other threads:[~2024-10-02 12:55 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-02 11:45 [PATCH 00/11] wifi: cfg80211/mac80211: improve support for multiple radios Felix Fietkau
2024-10-02 11:45 ` [PATCH 01/11] wifi: cfg80211: add option for vif allowed radios Felix Fietkau
2024-10-02 12:55 ` Johannes Berg [this message]
2024-10-02 11:45 ` [PATCH 02/11] wifi: mac80211: use vif radio mask to limit ibss scan frequencies Felix Fietkau
2024-10-02 12:57 ` Johannes Berg
2024-10-02 11:45 ` [PATCH 03/11] wifi: mac80211: use vif radio mask to limit chanctx and remain-on-channel Felix Fietkau
2024-10-02 12:58 ` Johannes Berg
2024-10-02 14:38 ` Felix Fietkau
2024-10-02 11:45 ` [PATCH 04/11] wifi: cfg80211: report per wiphy radio antenna mask Felix Fietkau
2024-10-02 11:45 ` [PATCH 05/11] wifi: mac80211: remove status->ampdu_delimiter_crc Felix Fietkau
2024-10-02 11:45 ` [PATCH 06/11] wifi: cfg80211: pass net_device to .set_monitor_channel Felix Fietkau
2024-10-02 11:45 ` [PATCH 07/11] wifi: mac80211: add flag to opt out of virtual monitor support Felix Fietkau
2024-10-02 11:45 ` [PATCH 08/11] wifi: cfg80211: add monitor SKIP_TX flag Felix Fietkau
2024-10-02 11:45 ` [PATCH 09/11] wifi: mac80211: add support for the " Felix Fietkau
2024-10-02 11:45 ` [PATCH 10/11] wifi: mac80211: refactor ieee80211_rx_monitor Felix Fietkau
2024-10-02 11:45 ` [PATCH 11/11] wifi: mac80211: filter on monitor interfaces based on configured channel Felix Fietkau
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=c049e6f7de9c840affa3970cb774c7bd4aa21629.camel@sipsolutions.net \
--to=johannes@sipsolutions.net \
--cc=linux-wireless@vger.kernel.org \
--cc=nbd@nbd.name \
/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