mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2025-01-09 00:12:36 +01:00
device: Remove legacy GetOrderedNetworks
This commit is contained in:
parent
96330fd75a
commit
42e5dbf6f8
16
src/device.c
16
src/device.c
@ -72,19 +72,6 @@ static void device_ap_roam_frame_event(struct netdev *netdev,
|
||||
station_ap_directed_roam(station, hdr, body, body_len);
|
||||
}
|
||||
|
||||
static struct l_dbus_message *device_get_networks(struct l_dbus *dbus,
|
||||
struct l_dbus_message *message,
|
||||
void *user_data)
|
||||
{
|
||||
struct device *device = user_data;
|
||||
struct station *station = device->station;
|
||||
|
||||
if (!device->powered || !device->station)
|
||||
return dbus_error_not_available(message);
|
||||
|
||||
return station_build_get_networks_reply(station, message, true);
|
||||
}
|
||||
|
||||
static bool device_property_get_name(struct l_dbus *dbus,
|
||||
struct l_dbus_message *message,
|
||||
struct l_dbus_message_builder *builder,
|
||||
@ -419,9 +406,6 @@ static struct l_dbus_message *device_property_set_mode(struct l_dbus *dbus,
|
||||
|
||||
static void setup_device_interface(struct l_dbus_interface *interface)
|
||||
{
|
||||
l_dbus_interface_method(interface, "GetOrderedNetworks", 0,
|
||||
device_get_networks, "a(osns)", "",
|
||||
"networks");
|
||||
l_dbus_interface_property(interface, "Name", 0, "s",
|
||||
device_property_get_name, NULL);
|
||||
l_dbus_interface_property(interface, "Address", 0, "s",
|
||||
|
@ -1843,48 +1843,29 @@ static struct l_dbus_message *station_dbus_disconnect(struct l_dbus *dbus,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
struct l_dbus_message *station_build_get_networks_reply(
|
||||
struct station *station,
|
||||
static struct l_dbus_message *station_dbus_get_networks(struct l_dbus *dbus,
|
||||
struct l_dbus_message *message,
|
||||
bool legacy)
|
||||
void *user_data)
|
||||
{
|
||||
struct l_dbus_message *reply;
|
||||
struct l_dbus_message_builder *builder;
|
||||
struct station *station = user_data;
|
||||
struct l_dbus_message *reply =
|
||||
l_dbus_message_new_method_return(message);
|
||||
struct l_dbus_message_builder *builder =
|
||||
l_dbus_message_builder_new(reply);
|
||||
struct l_queue *sorted = station->networks_sorted;
|
||||
const struct l_queue_entry *entry;
|
||||
|
||||
reply = l_dbus_message_new_method_return(message);
|
||||
builder = l_dbus_message_builder_new(reply);
|
||||
|
||||
if (legacy)
|
||||
l_dbus_message_builder_enter_array(builder, "(osns)");
|
||||
else
|
||||
l_dbus_message_builder_enter_array(builder, "(on)");
|
||||
l_dbus_message_builder_enter_array(builder, "(on)");
|
||||
|
||||
for (entry = l_queue_get_entries(sorted); entry; entry = entry->next) {
|
||||
const struct network *network = entry->data;
|
||||
enum security security = network_get_security(network);
|
||||
int16_t signal_strength = network_get_signal_strength(network);
|
||||
|
||||
if (legacy)
|
||||
l_dbus_message_builder_enter_struct(builder, "osns");
|
||||
else
|
||||
l_dbus_message_builder_enter_struct(builder, "on");
|
||||
|
||||
l_dbus_message_builder_enter_struct(builder, "on");
|
||||
l_dbus_message_builder_append_basic(builder, 'o',
|
||||
network_get_path(network));
|
||||
|
||||
if (legacy)
|
||||
l_dbus_message_builder_append_basic(builder, 's',
|
||||
network_get_ssid(network));
|
||||
|
||||
l_dbus_message_builder_append_basic(builder, 'n',
|
||||
&signal_strength);
|
||||
|
||||
if (legacy)
|
||||
l_dbus_message_builder_append_basic(builder, 's',
|
||||
security_to_str(security));
|
||||
|
||||
l_dbus_message_builder_leave_struct(builder);
|
||||
}
|
||||
|
||||
@ -1896,14 +1877,6 @@ struct l_dbus_message *station_build_get_networks_reply(
|
||||
return reply;
|
||||
}
|
||||
|
||||
static struct l_dbus_message *station_dbus_get_networks(struct l_dbus *dbus,
|
||||
struct l_dbus_message *message,
|
||||
void *user_data)
|
||||
{
|
||||
struct station *station = user_data;
|
||||
return station_build_get_networks_reply(station, message, false);
|
||||
}
|
||||
|
||||
static void station_dbus_scan_triggered(int err, void *user_data)
|
||||
{
|
||||
struct station *station = user_data;
|
||||
|
@ -99,11 +99,6 @@ void station_ap_directed_roam(struct station *station,
|
||||
const struct mmpdu_header *hdr,
|
||||
const void *body, size_t body_len);
|
||||
|
||||
struct l_dbus_message *station_build_get_networks_reply(
|
||||
struct station *station,
|
||||
struct l_dbus_message *message,
|
||||
bool legacy);
|
||||
|
||||
int __station_connect_network(struct station *station, struct network *network,
|
||||
struct scan_bss *bss);
|
||||
void station_connect_network(struct station *station, struct network *network,
|
||||
|
Loading…
Reference in New Issue
Block a user