mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2024-12-22 21:22:37 +01:00
wiphy: add __iwd_device_foreach
This commit is contained in:
parent
c13103974c
commit
2d6a50bb27
20
src/wiphy.c
20
src/wiphy.c
@ -91,6 +91,26 @@ bool __iwd_device_append_properties(struct netdev *netdev,
|
||||
return true;
|
||||
}
|
||||
|
||||
void __iwd_device_foreach(iwd_device_foreach_func func, void *user_data)
|
||||
{
|
||||
const struct l_queue_entry *wiphy_entry;
|
||||
|
||||
for (wiphy_entry = l_queue_get_entries(wiphy_list); wiphy_entry;
|
||||
wiphy_entry = wiphy_entry->next) {
|
||||
struct wiphy *wiphy = wiphy_entry->data;
|
||||
const struct l_queue_entry *netdev_entry;
|
||||
|
||||
netdev_entry = l_queue_get_entries(wiphy->netdev_list);
|
||||
|
||||
while (netdev_entry) {
|
||||
struct netdev *netdev = netdev_entry->data;
|
||||
|
||||
func(netdev, user_data);
|
||||
netdev_entry = netdev_entry->next;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void device_emit_added(struct netdev *netdev)
|
||||
{
|
||||
struct l_dbus *dbus = dbus_get_bus();
|
||||
|
@ -25,6 +25,8 @@
|
||||
|
||||
struct netdev;
|
||||
|
||||
typedef void (*iwd_device_foreach_func)(struct netdev *, void *data);
|
||||
|
||||
bool wiphy_init(void);
|
||||
bool wiphy_exit(void);
|
||||
|
||||
@ -34,3 +36,4 @@ void wiphy_set_ssid(const char *ssid);
|
||||
|
||||
bool __iwd_device_append_properties(struct netdev *netdev,
|
||||
struct l_dbus_message_builder *builder);
|
||||
void __iwd_device_foreach(iwd_device_foreach_func func, void *user_data);
|
||||
|
Loading…
Reference in New Issue
Block a user