Wireless Daemon for Linux
 help / color / mirror / Atom feed
From: James Prestwood <prestwoj@gmail.com>
To: iwd@lists.linux.dev
Cc: James Prestwood <prestwoj@gmail.com>
Subject: [PATCH v3 7/8] ap: use wiphy_get_frequency_info
Date: Fri, 16 Dec 2022 13:27:40 -0800	[thread overview]
Message-ID: <20221216212741.1833286-7-prestwoj@gmail.com> (raw)
In-Reply-To: <20221216212741.1833286-1-prestwoj@gmail.com>

Replace disabled/supported frequency list with the new
wiphy_get_frequency_info()
---
 src/ap.c | 17 ++++-------------
 1 file changed, 4 insertions(+), 13 deletions(-)

diff --git a/src/ap.c b/src/ap.c
index 32d9e1c4..a9027f79 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;
+	const struct band_freq_attrs *attr;
 
 	if (!(wiphy_get_supported_bands(wiphy) & ap->band)) {
 		l_error("AP hardware does not support band");
@@ -3191,19 +3190,11 @@ 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)) {
-		l_error("AP hardware does not support frequency %u", freq);
+	attr = wiphy_get_frequency_info(wiphy, freq);
+	if (!attr || attr->disabled) {
+		l_error("AP frequency %u disabled or unsupported", freq);
 		return false;
 	}
-
-	if (scan_freq_set_contains(disabled, freq)) {
-		l_error("AP hardware has frequency %u disabled", freq);
-		return false;
-	}
-
 	return true;
 }
 
-- 
2.34.3


  parent reply	other threads:[~2022-12-16 21:27 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-16 21:27 [PATCH v3 1/8] band: introduce new method of tracking frequencies James Prestwood
2022-12-16 21:27 ` [PATCH v3 2/8] wiphy: parse/store frequency info in band object James Prestwood
2022-12-16 21:27 ` [PATCH v3 3/8] wiphy: remove pending_freqs from wiphy_regdom_is_updating James Prestwood
2022-12-16 21:27 ` [PATCH v3 4/8] wiphy: don't parse dumps from unregistered wiphy's James Prestwood
2022-12-16 21:27 ` [PATCH v3 5/8] wiphy: add getter for frequency/band info James Prestwood
2022-12-16 21:27 ` [PATCH v3 6/8] station: use wiphy_get_frequency_info James Prestwood
2022-12-16 21:27 ` James Prestwood [this message]
2022-12-16 21:27 ` [PATCH v3 8/8] wiphy: remove disabled_freqs and related dump code James Prestwood
2022-12-16 22:37 ` [PATCH v3 1/8] band: introduce new method of tracking frequencies 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=20221216212741.1833286-7-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