mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2025-02-18 09:10:38 +01:00
wiphy: Add device_get_path() utility
This commit is contained in:
parent
ae95cbd172
commit
4a4d094d8e
13
src/wiphy.c
13
src/wiphy.c
@ -71,6 +71,14 @@ static void do_debug(const char *str, void *user_data)
|
|||||||
l_info("%s%s", prefix, str);
|
l_info("%s%s", prefix, str);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static const char *device_get_path(struct netdev *netdev)
|
||||||
|
{
|
||||||
|
static char path[256];
|
||||||
|
|
||||||
|
snprintf(path, sizeof(path), "/%u", netdev->index);
|
||||||
|
return path;
|
||||||
|
}
|
||||||
|
|
||||||
static void device_emit_added(struct netdev *netdev)
|
static void device_emit_added(struct netdev *netdev)
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -137,12 +145,11 @@ static void bss_free(void *data)
|
|||||||
static void netdev_free(void *data)
|
static void netdev_free(void *data)
|
||||||
{
|
{
|
||||||
struct netdev *netdev = data;
|
struct netdev *netdev = data;
|
||||||
char path[256];
|
|
||||||
struct l_dbus *dbus;
|
struct l_dbus *dbus;
|
||||||
|
|
||||||
dbus = dbus_get_bus();
|
dbus = dbus_get_bus();
|
||||||
snprintf(path, sizeof(path), "/%u", netdev->index);
|
l_dbus_unregister_interface(dbus, device_get_path(netdev),
|
||||||
l_dbus_unregister_interface(dbus, path, IWD_DEVICE_INTERFACE);
|
IWD_DEVICE_INTERFACE);
|
||||||
|
|
||||||
device_emit_removed(netdev);
|
device_emit_removed(netdev);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user