From: James Prestwood <prestwoj@gmail.com>
To: iwd@lists.linux.dev
Cc: James Prestwood <prestwoj@gmail.com>
Subject: [PATCH v2 6/8] station: use wiphy_get_frequency_info
Date: Fri, 16 Dec 2022 09:26:04 -0800 [thread overview]
Message-ID: <20221216172606.1799396-6-prestwoj@gmail.com> (raw)
In-Reply-To: <20221216172606.1799396-1-prestwoj@gmail.com>
Remove uses of supported/disabled scan_freq_set's and replace
with the equivalent calls to wiphy_get_frequency_info() and
wiphy_band_is_disabled().
---
src/station.c | 19 ++++++++-----------
1 file changed, 8 insertions(+), 11 deletions(-)
diff --git a/src/station.c b/src/station.c
index 9a646934..28d6793a 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,11 @@ 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_get_supported_bands(station->wiphy) & BAND_FREQ_6_GHZ &&
+ wiphy_band_is_disabled(station->wiphy,
+ BAND_FREQ_6_GHZ) &&
+ wiphy_country_is_unknown(station->wiphy) &&
+ known_6ghz)
return -ENOTSUP;
if (!wiphy_constrain_freq_set(station->wiphy, known_freq_set)) {
@@ -1812,10 +1812,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();
@@ -1828,6 +1824,7 @@ static void parse_neighbor_report(struct station *station,
uint32_t freq;
enum band_freq band;
const uint8_t *cc = NULL;
+ struct band_freq_attrs attr;
if (ie_tlv_iter_get_tag(&iter) != IE_TYPE_NEIGHBOR_REPORT)
continue;
@@ -1853,8 +1850,8 @@ 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_get_frequency_info(station->wiphy, freq, &attr) ||
+ attr.disabled)
continue;
if (!memcmp(info.addr,
--
2.34.3
next prev 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 ` James Prestwood [this message]
2022-12-16 17:26 ` [PATCH v2 7/8] ap: use wiphy_get_frequency_info James Prestwood
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-6-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;
as well as URLs for NNTP newsgroup(s).