All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] network: add DisableHT/VHT/HE/EHT settings
@ 2026-08-16 14:45 Christopher Fraser
  0 siblings, 0 replies; only message in thread
From: Christopher Fraser @ 2026-08-16 14:45 UTC (permalink / raw)
  To: iwd; +Cc: Christopher Fraser

Add per-network [Settings] options (DisableHT, DisableVHT, DisableHE,
DisableEHT) that let a network's config force a specific PHY
generation off when associating with that network, by setting the
matching NL80211_ATTR_DISABLE_* flag on the connect/associate
netlink command, similar to flags that exist in wpa_supplicant.

This is useful for APs where negotiating a particular mode causes
instability.
---
 src/handshake.h     |  4 ++++
 src/iwd.network.rst | 16 ++++++++++++++++
 src/knownnetworks.c | 20 ++++++++++++++++++++
 src/knownnetworks.h |  8 ++++++++
 src/netdev.c        | 24 ++++++++++++++++++++++++
 src/network.c       |  4 ++++
 6 files changed, 76 insertions(+)

diff --git a/src/handshake.h b/src/handshake.h
index 9ddeecd6..de86ee86 100644
--- a/src/handshake.h
+++ b/src/handshake.h
@@ -145,6 +145,10 @@ struct handshake_state {
 	bool supplicant_ocvc : 1;
 	bool ext_key_id_capable : 1;
 	bool force_default_ecc_group : 1;
+	bool disable_ht : 1;
+	bool disable_vht : 1;
+	bool disable_he : 1;
+	bool disable_eht : 1;
 	bool have_pmksa : 1;
 	union {
 		struct pmksa *pmksa;
diff --git a/src/iwd.network.rst b/src/iwd.network.rst
index 892c6eb8..a031d50b 100644
--- a/src/iwd.network.rst
+++ b/src/iwd.network.rst
@@ -181,6 +181,22 @@ The group ``[Settings]`` contains general settings.
        (WPA3 and OWE) if set true. If unset IWD will learn the capabilities of
        the network based on its initial association and retain that setting for
        the duration of its process lifetime.
+   * - DisableHT
+     - Values: true, **false**
+
+       If enabled, forces HT (802.11n) off when associating with this network.
+   * - DisableVHT
+     - Values: true, **false**
+
+       If enabled, forces VHT (802.11ac) off when associating with this network.
+   * - DisableHE
+     - Values: true, **false**
+
+       If enabled, forces HE (802.11ax) off when associating with this network.
+   * - DisableEHT
+     - Values: true, **false**
+
+       If enabled, forces EHT (802.11be) off when associating with this network.
 
 Network Authentication Settings
 -------------------------------
diff --git a/src/knownnetworks.c b/src/knownnetworks.c
index 886f8145..edec565c 100644
--- a/src/knownnetworks.c
+++ b/src/knownnetworks.c
@@ -135,6 +135,26 @@ void __network_config_parse(const struct l_settings *settings,
 					NET_USE_DEFAULT_ECC_GROUP);
 	} else
 		config->ecc_group = KNOWN_NETWORK_ECC_GROUP_AUTO;
+
+	if (!l_settings_get_bool(settings, NET_DISABLE_HT, &b))
+		b = false;
+
+	config->disable_ht = b;
+
+	if (!l_settings_get_bool(settings, NET_DISABLE_VHT, &b))
+		b = false;
+
+	config->disable_vht = b;
+
+	if (!l_settings_get_bool(settings, NET_DISABLE_HE, &b))
+		b = false;
+
+	config->disable_he = b;
+
+	if (!l_settings_get_bool(settings, NET_DISABLE_EHT, &b))
+		b = false;
+
+	config->disable_eht = b;
 }
 
 void __network_info_init(struct network_info *info,
diff --git a/src/knownnetworks.h b/src/knownnetworks.h
index a117ded5..4fcba97e 100644
--- a/src/knownnetworks.h
+++ b/src/knownnetworks.h
@@ -30,6 +30,10 @@
 #define NET_TRANSITION_DISABLE SETTINGS, "TransitionDisable"
 #define NET_TRANSITION_DISABLE_MODES SETTINGS, "DisabledTransitionModes"
 #define NET_USE_DEFAULT_ECC_GROUP SETTINGS, "UseDefaultEccGroup"
+#define NET_DISABLE_HT SETTINGS, "DisableHT"
+#define NET_DISABLE_VHT SETTINGS, "DisableVHT"
+#define NET_DISABLE_HE SETTINGS, "DisableHE"
+#define NET_DISABLE_EHT SETTINGS, "DisableEHT"
 
 enum security;
 struct scan_freq_set;
@@ -82,6 +86,10 @@ struct network_config {
 	bool have_transition_disable : 1;
 	uint8_t transition_disable;
 	enum known_network_ecc_group ecc_group;
+	bool disable_ht:1;
+	bool disable_vht:1;
+	bool disable_he:1;
+	bool disable_eht:1;
 };
 
 struct network_info {
diff --git a/src/netdev.c b/src/netdev.c
index e639a1f8..ff6e896f 100644
--- a/src/netdev.c
+++ b/src/netdev.c
@@ -2647,6 +2647,18 @@ static struct l_genl_msg *netdev_build_cmd_connect(struct netdev *netdev,
 
 	l_genl_msg_append_attr(msg, NL80211_ATTR_SOCKET_OWNER, 0, NULL);
 
+	if (hs->disable_ht)
+		l_genl_msg_append_attr(msg, NL80211_ATTR_DISABLE_HT, 0, NULL);
+
+	if (hs->disable_vht)
+		l_genl_msg_append_attr(msg, NL80211_ATTR_DISABLE_VHT, 0, NULL);
+
+	if (hs->disable_he)
+		l_genl_msg_append_attr(msg, NL80211_ATTR_DISABLE_HE, 0, NULL);
+
+	if (hs->disable_eht)
+		l_genl_msg_append_attr(msg, NL80211_ATTR_DISABLE_EHT, 0, NULL);
+
 	if (is_rsn) {
 		nl80211_append_rsn_attributes(msg, hs);
 		c_iov = iov_ie_append(iov, n_iov, c_iov, hs->supplicant_ie,
@@ -2989,6 +3001,18 @@ static struct l_genl_msg *netdev_build_cmd_associate_common(
 	l_genl_msg_append_attr(msg, NL80211_ATTR_SSID, hs->ssid_len, hs->ssid);
 	l_genl_msg_append_attr(msg, NL80211_ATTR_SOCKET_OWNER, 0, NULL);
 
+	if (hs->disable_ht)
+		l_genl_msg_append_attr(msg, NL80211_ATTR_DISABLE_HT, 0, NULL);
+
+	if (hs->disable_vht)
+		l_genl_msg_append_attr(msg, NL80211_ATTR_DISABLE_VHT, 0, NULL);
+
+	if (hs->disable_he)
+		l_genl_msg_append_attr(msg, NL80211_ATTR_DISABLE_HE, 0, NULL);
+
+	if (hs->disable_eht)
+		l_genl_msg_append_attr(msg, NL80211_ATTR_DISABLE_EHT, 0, NULL);
+
 	if (is_rsn)
 		nl80211_append_rsn_attributes(msg, hs);
 
diff --git a/src/network.c b/src/network.c
index a5a2375a..b2735fb6 100644
--- a/src/network.c
+++ b/src/network.c
@@ -536,6 +536,10 @@ int network_handshake_setup(struct network *network, struct scan_bss *bss,
 	}
 
 	hs->force_default_ecc_group = network->force_default_ecc_group;
+	hs->disable_ht = info && info->config.disable_ht;
+	hs->disable_vht = info && info->config.disable_vht;
+	hs->disable_he = info && info->config.disable_he;
+	hs->disable_eht = info && info->config.disable_eht;
 
 	/*
 	 * The randomization options in the provisioning file are dependent on
-- 
2.55.0


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-08-16 14:45 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-16 14:45 [PATCH] network: add DisableHT/VHT/HE/EHT settings Christopher Fraser

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.