public inbox for iwd@lists.linux.dev
 help / color / mirror / Atom feed
From: James Prestwood <prestwoj@gmail.com>
To: iwd@lists.linux.dev
Cc: James Prestwood <prestwoj@gmail.com>
Subject: [PATCH 2/4] wiphy: add driver quirk for disabling multicast rx (and helper)
Date: Mon, 25 Nov 2024 07:06:21 -0800	[thread overview]
Message-ID: <20241125150623.1014890-2-prestwoj@gmail.com> (raw)
In-Reply-To: <20241125150623.1014890-1-prestwoj@gmail.com>

This driver quirk and associated helper API lets other modules both
check if multicast RX is supported, and if its been disabled via
the driver quirk setting.
---
 src/wiphy.c | 17 +++++++++++++----
 src/wiphy.h |  1 +
 2 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/src/wiphy.c b/src/wiphy.c
index ecc345e9..5e958d65 100644
--- a/src/wiphy.c
+++ b/src/wiphy.c
@@ -73,6 +73,7 @@ enum driver_flag {
 	FORCE_PAE = 0x2,
 	POWER_SAVE_DISABLE = 0x4,
 	OWE_DISABLE = 0x8,
+	MULTICAST_RX_DISABLE = 0x10,
 };
 
 struct driver_flag_name {
@@ -101,10 +102,11 @@ static const struct driver_info driver_infos[] = {
 };
 
 static const struct driver_flag_name driver_flag_names[] = {
-	{ "DefaultInterface", DEFAULT_IF },
-	{ "ForcePae",         FORCE_PAE },
-	{ "PowerSaveDisable", POWER_SAVE_DISABLE },
-	{ "OweDisable",       OWE_DISABLE },
+	{ "DefaultInterface",   DEFAULT_IF },
+	{ "ForcePae",           FORCE_PAE },
+	{ "PowerSaveDisable",   POWER_SAVE_DISABLE },
+	{ "OweDisable",         OWE_DISABLE },
+	{ "MulticastRxDisable", MULTICAST_RX_DISABLE }
 };
 
 struct wiphy {
@@ -949,6 +951,13 @@ bool wiphy_supports_cmd_offchannel(const struct wiphy *wiphy)
 	return wiphy->supports_cmd_offchannel;
 }
 
+bool wiphy_supports_multicast_rx(const struct wiphy *wiphy)
+{
+	return wiphy_has_ext_feature(wiphy,
+				NL80211_EXT_FEATURE_MULTICAST_REGISTRATIONS) &&
+				!(wiphy->driver_flags & MULTICAST_RX_DISABLE);
+}
+
 const uint8_t *wiphy_get_ht_capabilities(const struct wiphy *wiphy,
 						enum band_freq band,
 						size_t *size)
diff --git a/src/wiphy.h b/src/wiphy.h
index c527c79d..9fcbdcd2 100644
--- a/src/wiphy.h
+++ b/src/wiphy.h
@@ -143,6 +143,7 @@ void wiphy_get_reg_domain_country(struct wiphy *wiphy, char *out);
 bool wiphy_country_is_unknown(struct wiphy *wiphy);
 bool wiphy_supports_uapsd(const struct wiphy *wiphy);
 bool wiphy_supports_cmd_offchannel(const struct wiphy *wiphy);
+bool wiphy_supports_multicast_rx(const struct wiphy *wiphy);
 
 const uint8_t *wiphy_get_ht_capabilities(const struct wiphy *wiphy,
 						enum band_freq band,
-- 
2.34.1


  reply	other threads:[~2024-11-25 15:06 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-25 15:06 [PATCH 1/4] wiphy: make "wiphy" const in wiphy_has_ext_feature James Prestwood
2024-11-25 15:06 ` James Prestwood [this message]
2024-11-25 15:06 ` [PATCH 3/4] dpp: use wiphy_supports_multicast_rx James Prestwood
2024-11-25 15:06 ` [PATCH 4/4] doc: document [DriverQuirks].MulticastRxDisable James Prestwood
2024-11-25 17:48 ` [PATCH 1/4] wiphy: make "wiphy" const in wiphy_has_ext_feature Denis Kenzior

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=20241125150623.1014890-2-prestwoj@gmail.com \
    --to=prestwoj@gmail.com \
    --cc=iwd@lists.linux.dev \
    /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