3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-12-22 21:22:37 +01:00

client: device dependency binder

This commit is contained in:
Tim Kourt 2017-05-01 10:23:47 -07:00 committed by Denis Kenzior
parent b1d261a790
commit 87b4f282db

View File

@ -345,13 +345,33 @@ static void device_destroy(void *data)
static bool device_bind_interface(const struct proxy_interface *proxy, static bool device_bind_interface(const struct proxy_interface *proxy,
const struct proxy_interface *dependency) const struct proxy_interface *dependency)
{ {
const char *interface = proxy_interface_get_interface(dependency);
if (!strcmp(interface, IWD_WSC_INTERFACE)) {
struct device *device = proxy_interface_get_data(proxy);
device->wsc = dependency;
return true; return true;
}
return false;
} }
static bool device_unbind_interface(const struct proxy_interface *proxy, static bool device_unbind_interface(const struct proxy_interface *proxy,
const struct proxy_interface *dependency) const struct proxy_interface *dependency)
{ {
const char *interface = proxy_interface_get_interface(dependency);
if (!strcmp(interface, IWD_WSC_INTERFACE)) {
struct device *device = proxy_interface_get_data(proxy);
device->wsc = NULL;
return true; return true;
}
return false;
} }
static void display_device_inline(const char *margin, const void *data) static void display_device_inline(const char *margin, const void *data)