All of lore.kernel.org
 help / color / mirror / Atom feed
From: James Prestwood <prestwoj@gmail.com>
To: iwd@lists.linux.dev
Cc: James Prestwood <prestwoj@gmail.com>
Subject: [PATCH v2 7/8] ap: use wiphy_get_frequency_info
Date: Fri, 16 Dec 2022 09:26:05 -0800	[thread overview]
Message-ID: <20221216172606.1799396-7-prestwoj@gmail.com> (raw)
In-Reply-To: <20221216172606.1799396-1-prestwoj@gmail.com>

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

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;
 	}
-- 
2.34.3


  parent reply	other threads:[~2022-12-16 17:26 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-16 17:25 [PATCH v2 1/8] band: introduce new method of tracking frequencies James Prestwood
2022-12-16 17:26 ` [PATCH v2 2/8] wiphy: parse/store frequency info in band object James Prestwood
2022-12-16 17:26 ` [PATCH v2 3/8] wiphy: remove pending_freqs from wiphy_regdom_is_updating James Prestwood
2022-12-16 17:26 ` [PATCH v2 4/8] wiphy: don't parse dumps from unregistered wiphy's James Prestwood
2022-12-16 17:26 ` [PATCH v2 5/8] wiphy: add getter for frequency/band info James Prestwood
2022-12-16 17:26 ` [PATCH v2 6/8] station: use wiphy_get_frequency_info James Prestwood
2022-12-16 17:26 ` James Prestwood [this message]
2022-12-16 17:26 ` [PATCH v2 8/8] wiphy: remove disabled_freqs and related dump code James Prestwood

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=20221216172606.1799396-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 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.