iwd.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/4] wiphy: add wiphy_get_frequency_info_list
@ 2022-12-30 22:12 James Prestwood
  2022-12-30 22:12 ` [PATCH 2/4] band: add tx_power to frequency info attributes James Prestwood
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: James Prestwood @ 2022-12-30 22:12 UTC (permalink / raw)
  To: iwd; +Cc: James Prestwood

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


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-01-03 15:23 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-30 22:12 [PATCH 1/4] wiphy: add wiphy_get_frequency_info_list James Prestwood
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

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).