diff mbox series

[5/7] station: use wiphy_check_{frequency,band}

Message ID 20221213203624.1423277-5-prestwoj@gmail.com (mailing list archive)
State New
Headers show
Series [1/7] 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. 13, 2022, 8:36 p.m. UTC
Remove uses of supported/disabled scan_freq_set's and replace
with the equivalent calls to wiphy_check_frequency/band.
---
 src/station.c | 19 ++++++++-----------
 1 file changed, 8 insertions(+), 11 deletions(-)
diff mbox series

Patch

diff --git a/src/station.c b/src/station.c
index a467b4e9..95a6d830 100644
--- a/src/station.c
+++ b/src/station.c
@@ -1407,8 +1407,6 @@  static int station_quick_scan_trigger(struct station *station)
 {
 	_auto_(scan_freq_set_free) struct scan_freq_set *known_freq_set = NULL;
 	bool known_6ghz;
-	const struct scan_freq_set *disabled = wiphy_get_disabled_freqs(
-								station->wiphy);
 
 	if (wiphy_regdom_is_updating(station->wiphy)) {
 		l_debug("regdom is updating, delaying quick scan");
@@ -1430,9 +1428,10 @@  static int station_quick_scan_trigger(struct station *station)
 	 * this since its so limited, so return an error which will fall back to
 	 * full autoconnect.
 	 */
-	if ((scan_freq_set_get_bands(disabled) & BAND_FREQ_6_GHZ) &&
-				wiphy_country_is_unknown(station->wiphy) &&
-				known_6ghz)
+	if (wiphy_check_band(station->wiphy, BAND_FREQ_6_GHZ,
+			BAND_FREQ_ATTR_SUPPORTED | BAND_FREQ_ATTR_DISABLED) &&
+			wiphy_country_is_unknown(station->wiphy) &&
+			known_6ghz)
 		return -ENOTSUP;
 
 	if (!wiphy_constrain_freq_set(station->wiphy, known_freq_set)) {
@@ -1812,10 +1811,6 @@  static void parse_neighbor_report(struct station *station,
 	struct scan_freq_set *freq_set_md, *freq_set_no_md;
 	uint32_t current_freq = 0;
 	struct handshake_state *hs = netdev_get_handshake(station->netdev);
-	const struct scan_freq_set *supported =
-				wiphy_get_supported_freqs(station->wiphy);
-	const struct scan_freq_set *disabled =
-				wiphy_get_disabled_freqs(station->wiphy);
 
 	freq_set_md = scan_freq_set_new();
 	freq_set_no_md = scan_freq_set_new();
@@ -1853,8 +1848,10 @@  static void parse_neighbor_report(struct station *station,
 			continue;
 
 		/* Skip if frequency is not supported or disabled */
-		if (!scan_freq_set_contains(supported, freq) ||
-				scan_freq_set_contains(disabled, freq))
+		if (!wiphy_check_frequency(station->wiphy, freq,
+						BAND_FREQ_ATTR_SUPPORTED) ||
+				wiphy_check_frequency(station->wiphy, freq,
+						BAND_FREQ_ATTR_DISABLED))
 			continue;
 
 		if (!memcmp(info.addr,