iwd.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: James Prestwood <prestwoj@gmail.com>
To: iwd@lists.linux.dev
Cc: James Prestwood <prestwoj@gmail.com>
Subject: [PATCH 1/4] wiphy: add wiphy_get_frequency_info_list
Date: Fri, 30 Dec 2022 14:12:13 -0800	[thread overview]
Message-ID: <20221230221216.2985011-1-prestwoj@gmail.com> (raw)

Gets the entire list of frequency attributes advertised. This is
needed for AP mode to create a country IE which includes subband
triplet fields.
---
 src/wiphy.c | 17 +++++++++++++++++
 src/wiphy.h |  5 +++++
 2 files changed, 22 insertions(+)

diff --git a/src/wiphy.c b/src/wiphy.c
index 4ff3085a..9ca651f4 100644
--- a/src/wiphy.c
+++ b/src/wiphy.c
@@ -526,6 +526,23 @@ const struct band_freq_attrs *wiphy_get_frequency_info(
 	return attr;
 }
 
+const struct band_freq_attrs *wiphy_get_frequency_info_list(
+						const struct wiphy *wiphy,
+						enum band_freq band,
+						size_t *size)
+{
+	struct band *bandp;
+
+	bandp = wiphy_get_band(wiphy, band);
+	if (!bandp)
+		return NULL;
+
+	if (size)
+		*size = bandp->freqs_len;
+
+	return bandp->freq_attrs;
+}
+
 bool wiphy_band_is_disabled(const struct wiphy *wiphy, enum band_freq band)
 {
 	struct band_freq_attrs attr;
diff --git a/src/wiphy.h b/src/wiphy.h
index 1056ac0c..d5d1cc8f 100644
--- a/src/wiphy.h
+++ b/src/wiphy.h
@@ -104,6 +104,11 @@ const struct scan_freq_set *wiphy_get_supported_freqs(
 const struct band_freq_attrs *wiphy_get_frequency_info(
 						const struct wiphy *wiphy,
 						uint32_t freq);
+const struct band_freq_attrs *wiphy_get_frequency_info_list(
+						const struct wiphy *wiphy,
+						enum band_freq band,
+						size_t *size);
+
 bool wiphy_band_is_disabled(const struct wiphy *wiphy, enum band_freq band);
 
 bool wiphy_supports_probe_resp_offload(struct wiphy *wiphy);
-- 
2.34.3


             reply	other threads:[~2022-12-30 22:12 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-30 22:12 James Prestwood [this message]
2022-12-30 22:12 ` [PATCH 2/4] band: add tx_power to frequency info attributes James Prestwood
2022-12-30 22:12 ` [PATCH 3/4] nl80211util: parse TX power in frequency attributes James Prestwood
2022-12-30 22:12 ` [PATCH 4/4] ap: support setting country IE James Prestwood
2023-01-03 15:19 ` [PATCH 1/4] wiphy: add wiphy_get_frequency_info_list 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=20221230221216.2985011-1-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).