diff mbox series

[2/2] ap: add DisableHT setting

Message ID 20230224005723.1411083-2-prestwoj@gmail.com (mailing list archive)
State Accepted, archived
Headers show
Series [1/2] doc: document DisableHT AP setting | expand

Checks

Context Check Description
tedd_an/pre-ci_am success Success
prestwoj/iwd-ci-gitlint success GitLint

Commit Message

James Prestwood Feb. 24, 2023, 12:57 a.m. UTC
This allows the user to disable HT explicitly in the AP profile
---
 src/ap.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/src/ap.c b/src/ap.c
index b51befe4..2867e1ab 100644
--- a/src/ap.c
+++ b/src/ap.c
@@ -3660,7 +3660,18 @@  static int ap_load_config(struct ap_state *ap, const struct l_settings *config,
 		ap->band = BAND_FREQ_2_4_GHZ;
 	}
 
-	ap->supports_ht = wiphy_get_ht_capabilities(wiphy, ap->band,
+	if (l_settings_has_key(config, "General", "DisableHT")) {
+		bool boolval;
+
+		if (!l_settings_get_bool(config, "General", "DisableHT",
+						&boolval)) {
+			l_error("AP [General].DisableHT not a valid boolean");
+			return -EINVAL;
+		}
+
+		ap->supports_ht = !boolval;
+	} else
+		ap->supports_ht = wiphy_get_ht_capabilities(wiphy, ap->band,
 							NULL) != NULL;
 
 	if (!ap_validate_band_channel(ap)) {