eiwd

no dbus iwd with iwctl functionality
git clone https://git.daat.foo/repos/eiwd.git
Log | Files | Refs | Submodules | README | LICENSE

commit e6b43545306a5b2f399e0b76e3f941a651471442
parent 7ecdee6eaaea9d9411ef427eb043a5d74cb3cf75
Author: James Prestwood <prestwoj@gmail.com>
Date:   Mon,  6 Dec 2021 12:17:25 -0800

wiphy: update wiphy_radio_work_is_running to return int

This differentiates between pending, running, and non-existent:
false, true, -ENOENT respectively

Diffstat:
Msrc/wiphy.c | 10+++++-----
Msrc/wiphy.h | 2+-
2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/wiphy.c b/src/wiphy.c @@ -2013,14 +2013,14 @@ 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) +int wiphy_radio_work_is_running(struct wiphy *wiphy, uint32_t id) { - struct wiphy_radio_work_item *item = l_queue_peek_head(wiphy->work); - + struct wiphy_radio_work_item *item = l_queue_find(wiphy->work, match_id, + L_UINT_TO_PTR(id)); if (!item) - return false; + return -ENOENT; - return item->id == id; + return item == l_queue_peek_head(wiphy->work) ? 1 : 0; } static int wiphy_init(void) diff --git a/src/wiphy.h b/src/wiphy.h @@ -130,4 +130,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); +int wiphy_radio_work_is_running(struct wiphy *wiphy, uint32_t id);