diff mbox series

[v2,7/8] ap: use wiphy_get_frequency_info

Message ID 20221216172606.1799396-7-prestwoj@gmail.com (mailing list archive)
State New
Headers show
Series [v2,1/8] band: introduce new method of tracking frequencies | expand

Checks

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

Commit Message

James Prestwood Dec. 16, 2022, 5:26 p.m. UTC
Replace disabled/supported frequency list with the new
wiphy_get_frequency_info()
---
 src/ap.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)
diff mbox series

Patch

diff --git a/src/ap.c b/src/ap.c
index 32d9e1c4..7ba1974f 100644
--- a/src/ap.c
+++ b/src/ap.c
@@ -3174,9 +3174,8 @@  static char **ap_ciphers_to_strv(uint16_t ciphers)
 static bool ap_validate_band_channel(struct ap_state *ap)
 {
 	struct wiphy *wiphy = netdev_get_wiphy(ap->netdev);
-	const struct scan_freq_set *supported;
-	const struct scan_freq_set *disabled;
 	uint32_t freq;
+	struct band_freq_attrs attr;
 
 	if (!(wiphy_get_supported_bands(wiphy) & ap->band)) {
 		l_error("AP hardware does not support band");
@@ -3191,15 +3190,12 @@  static bool ap_validate_band_channel(struct ap_state *ap)
 		return false;
 	}
 
-	supported = wiphy_get_supported_freqs(wiphy);
-	disabled = wiphy_get_disabled_freqs(wiphy);
-
-	if (!scan_freq_set_contains(supported, freq)) {
+	if (!wiphy_get_frequency_info(wiphy, freq, &attr)) {
 		l_error("AP hardware does not support frequency %u", freq);
 		return false;
 	}
 
-	if (scan_freq_set_contains(disabled, freq)) {
+	if (attr.disabled) {
 		l_error("AP hardware has frequency %u disabled", freq);
 		return false;
 	}