mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2025-04-15 14:47:50 +02:00
client: add access point concept into device
This commit is contained in:
parent
6c80e1e277
commit
f9dc72088e
@ -45,6 +45,7 @@ struct device {
|
|||||||
const struct proxy_interface *adapter;
|
const struct proxy_interface *adapter;
|
||||||
const struct proxy_interface *connected_network;
|
const struct proxy_interface *connected_network;
|
||||||
const struct proxy_interface *wsc;
|
const struct proxy_interface *wsc;
|
||||||
|
const struct proxy_interface *ap;
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct proxy_interface *default_device;
|
static struct proxy_interface *default_device;
|
||||||
@ -458,6 +459,12 @@ static bool device_bind_interface(const struct proxy_interface *proxy,
|
|||||||
|
|
||||||
device->wsc = dependency;
|
device->wsc = dependency;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
} else if (!strcmp(interface, IWD_ACCESS_POINT_INTERFACE)) {
|
||||||
|
struct device *device = proxy_interface_get_data(proxy);
|
||||||
|
|
||||||
|
device->ap = dependency;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -474,6 +481,12 @@ static bool device_unbind_interface(const struct proxy_interface *proxy,
|
|||||||
|
|
||||||
device->wsc = NULL;
|
device->wsc = NULL;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
} else if (!strcmp(interface, IWD_ACCESS_POINT_INTERFACE)) {
|
||||||
|
struct device *device = proxy_interface_get_data(proxy);
|
||||||
|
|
||||||
|
device->ap = NULL;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -544,6 +557,13 @@ static bool match_by_partial_name_and_wsc(const void *a, const void *b)
|
|||||||
return match_by_partial_name(a, b) && device->wsc ? true : false;
|
return match_by_partial_name(a, b) && device->wsc ? true : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool match_by_partial_name_and_ap(const void *a, const void *b)
|
||||||
|
{
|
||||||
|
const struct device *device = a;
|
||||||
|
|
||||||
|
return match_by_partial_name(a, b) && device->ap ? true : false;
|
||||||
|
}
|
||||||
|
|
||||||
static bool match_all(const void *a, const void *b)
|
static bool match_all(const void *a, const void *b)
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
@ -860,6 +880,27 @@ char *device_wsc_family_arg_completion(const char *text, int state)
|
|||||||
"Name", text, state);
|
"Name", text, state);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const struct proxy_interface *device_ap_get(const char *device_name)
|
||||||
|
{
|
||||||
|
const struct device *device;
|
||||||
|
const struct proxy_interface *proxy =
|
||||||
|
get_device_proxy_by_name(device_name);
|
||||||
|
|
||||||
|
if (!proxy)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
device = proxy_interface_get_data(proxy);
|
||||||
|
|
||||||
|
return device->ap;
|
||||||
|
}
|
||||||
|
|
||||||
|
char *device_ap_family_arg_completion(const char *text, int state)
|
||||||
|
{
|
||||||
|
return proxy_property_str_completion(&device_interface_type,
|
||||||
|
match_by_partial_name_and_ap,
|
||||||
|
"Name", text, state);
|
||||||
|
}
|
||||||
|
|
||||||
static char *family_arg_completion(const char *text, int state)
|
static char *family_arg_completion(const char *text, int state)
|
||||||
{
|
{
|
||||||
static bool first_pass;
|
static bool first_pass;
|
||||||
|
@ -23,3 +23,6 @@
|
|||||||
const struct proxy_interface *device_wsc_get(const char *device_name);
|
const struct proxy_interface *device_wsc_get(const char *device_name);
|
||||||
|
|
||||||
char *device_wsc_family_arg_completion(const char *text, int state);
|
char *device_wsc_family_arg_completion(const char *text, int state);
|
||||||
|
|
||||||
|
const struct proxy_interface *device_ap_get(const char *device_name);
|
||||||
|
char *device_ap_family_arg_completion(const char *text, int state);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user