diff mbox series

[v3,3/7] wiphy: add wiphy_regdom_is_updating

Message ID 20220804185112.457670-3-prestwoj@gmail.com (mailing list archive)
State Accepted, archived
Headers show
Series [v3,1/7] wiphy: track GET_REG ID | expand

Checks

Context Check Description
tedd_an/pre-ci_am success Success
prestwoj/iwd-ci-gitlint success GitLint

Commit Message

James Prestwood Aug. 4, 2022, 6:51 p.m. UTC
This allows a module to check the current status of the regdom
in case it misses the wiphy event (e.g. registers after the
STARTED event).
---
 src/wiphy.c | 5 +++++
 src/wiphy.h | 1 +
 2 files changed, 6 insertions(+)
diff mbox series

Patch

diff --git a/src/wiphy.c b/src/wiphy.c
index dfdca989..3beb351c 100644
--- a/src/wiphy.c
+++ b/src/wiphy.c
@@ -921,6 +921,11 @@  int wiphy_estimate_data_rate(struct wiphy *wiphy,
 						out_data_rate);
 }
 
+bool wiphy_regdom_is_updating(struct wiphy *wiphy)
+{
+	return wiphy->pending_freqs != NULL;
+}
+
 uint32_t wiphy_state_watch_add(struct wiphy *wiphy,
 				wiphy_state_watch_func_t func,
 				void *user_data, wiphy_destroy_func_t destroy)
diff --git a/src/wiphy.h b/src/wiphy.h
index da2eca20..2159fc00 100644
--- a/src/wiphy.h
+++ b/src/wiphy.h
@@ -134,6 +134,7 @@  int wiphy_estimate_data_rate(struct wiphy *wiphy,
 				const void *ies, uint16_t ies_len,
 				const struct scan_bss *bss,
 				uint64_t *out_data_rate);
+bool wiphy_regdom_is_updating(struct wiphy *wiphy);
 
 uint32_t wiphy_state_watch_add(struct wiphy *wiphy,
 				wiphy_state_watch_func_t func, void *user_data,