diff mbox series

[1/5] nl80211util: populate no-IR list parsing frequencies

Message ID 20221208234812.778191-1-prestwoj@gmail.com (mailing list archive)
State New
Headers show
Series [1/5] nl80211util: populate no-IR list parsing frequencies | expand

Checks

Context Check Description
tedd_an/pre-ci_am success Success
prestwoj/iwd-alpine-ci-fetch success Fetch PR
prestwoj/iwd-ci-fetch success Fetch PR
prestwoj/iwd-ci-gitlint success GitLint
prestwoj/iwd-ci-build pending build SKIP
prestwoj/iwd-ci-makecheckvalgrind pending makecheckvalgrind SKIP
prestwoj/iwd-ci-clang pending clang SKIP
prestwoj/iwd-ci-incremental_build pending incremental_build SKIP
prestwoj/iwd-ci-makecheck pending makecheck SKIP
prestwoj/iwd-ci-makedistcheck pending makedistcheck SKIP
prestwoj/iwd-ci-testrunner pending testrunner SKIP
prestwoj/iwd-alpine-ci-makedistcheck success Make Distcheck
prestwoj/iwd-alpine-ci-build success Build - Configure
prestwoj/iwd-alpine-ci-makecheckvalgrind success Make Check w/Valgrind
prestwoj/iwd-alpine-ci-makecheck success Make Check
prestwoj/iwd-alpine-ci-incremental_build success Incremental Build with patches

Commit Message

James Prestwood Dec. 8, 2022, 11:48 p.m. UTC
In AP mode no-IR channels need to be known since they are effectively
disabled with respect to AP operation. Parse these channels into a
separate list.
---
 src/nl80211util.c | 11 ++++++++++-
 src/nl80211util.h |  3 ++-
 src/wiphy.c       |  6 ++++--
 3 files changed, 16 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/src/nl80211util.c b/src/nl80211util.c
index da36d936..396c82c2 100644
--- a/src/nl80211util.c
+++ b/src/nl80211util.c
@@ -502,7 +502,8 @@  int nl80211_parse_chandef(struct l_genl_msg *msg, struct band_chandef *out)
 
 int nl80211_parse_supported_frequencies(struct l_genl_attr *band_freqs,
 					struct scan_freq_set *supported_list,
-					struct scan_freq_set *disabled_list)
+					struct scan_freq_set *disabled_list,
+					struct scan_freq_set *no_ir_list)
 {
 	uint16_t type, len;
 	const void *data;
@@ -515,6 +516,7 @@  int nl80211_parse_supported_frequencies(struct l_genl_attr *band_freqs,
 	while (l_genl_attr_next(&nested, NULL, NULL, NULL)) {
 		uint32_t freq = 0;
 		bool disabled = false;
+		bool no_ir = false;
 
 		if (!l_genl_attr_recurse(&nested, &attr))
 			continue;
@@ -527,6 +529,9 @@  int nl80211_parse_supported_frequencies(struct l_genl_attr *band_freqs,
 			case NL80211_FREQUENCY_ATTR_DISABLED:
 				disabled = true;
 				break;
+			case NL80211_FREQUENCY_ATTR_NO_IR:
+				no_ir = true;
+				break;
 			}
 		}
 
@@ -538,6 +543,10 @@  int nl80211_parse_supported_frequencies(struct l_genl_attr *band_freqs,
 
 		if (disabled && disabled_list)
 			scan_freq_set_add(disabled_list, freq);
+
+		if (no_ir && no_ir_list)
+			scan_freq_set_add(no_ir_list, freq);
+
 	}
 
 	return 0;
diff --git a/src/nl80211util.h b/src/nl80211util.h
index 44555a25..ce1df2cd 100644
--- a/src/nl80211util.h
+++ b/src/nl80211util.h
@@ -59,4 +59,5 @@  struct l_genl_msg *nl80211_build_cmd_frame(uint32_t ifindex,
 int nl80211_parse_chandef(struct l_genl_msg *msg, struct band_chandef *out);
 int nl80211_parse_supported_frequencies(struct l_genl_attr *band_freqs,
 					struct scan_freq_set *supported,
-					struct scan_freq_set *disabled);
+					struct scan_freq_set *disabled,
+					struct scan_freq_set *no_ir);
diff --git a/src/wiphy.c b/src/wiphy.c
index 10514572..4744e7f4 100644
--- a/src/wiphy.c
+++ b/src/wiphy.c
@@ -1514,7 +1514,8 @@  static void parse_supported_bands(struct wiphy *wiphy,
 			case NL80211_BAND_ATTR_FREQS:
 				nl80211_parse_supported_frequencies(&attr,
 							wiphy->supported_freqs,
-							wiphy->disabled_freqs);
+							wiphy->disabled_freqs,
+							NULL);
 				break;
 
 			case NL80211_BAND_ATTR_RATES:
@@ -1988,7 +1989,8 @@  static void wiphy_dump_callback(struct l_genl_msg *msg,
 				continue;
 
 			nl80211_parse_supported_frequencies(&attr, NULL,
-							wiphy->pending_freqs);
+						wiphy->pending_freqs,
+						NULL);
 		}
 	}
 }