diff --git a/src/wiphy.c b/src/wiphy.c index 9cf0e07c..5943721e 100644 --- a/src/wiphy.c +++ b/src/wiphy.c @@ -1615,6 +1615,16 @@ void wiphy_radio_work_done(struct wiphy *wiphy, uint32_t id) wiphy_radio_work_next(wiphy); } +bool wiphy_radio_work_is_running(struct wiphy *wiphy, uint32_t id) +{ + struct wiphy_radio_work_item *item = l_queue_peek_head(wiphy->work); + + if (!item) + return false; + + return item->id == id; +} + static int wiphy_init(void) { struct l_genl *genl = iwd_get_genl(); diff --git a/src/wiphy.h b/src/wiphy.h index 6c91220c..50fcb182 100644 --- a/src/wiphy.h +++ b/src/wiphy.h @@ -116,3 +116,4 @@ uint32_t wiphy_radio_work_insert(struct wiphy *wiphy, int priority, const struct wiphy_radio_work_item_ops *ops); void wiphy_radio_work_done(struct wiphy *wiphy, uint32_t id); +bool wiphy_radio_work_is_running(struct wiphy *wiphy, uint32_t id);