commit 553a8c1baec076d92b03f094a26914a9d66216d3
parent 187ea7f5d12eb8f4b22d0b9cd41acc44a5ef7a99
Author: Denis Kenzior <denkenz@gmail.com>
Date: Tue, 4 Sep 2018 16:38:06 -0500
device/wsc: Use station_set_scan_results
Diffstat:
3 files changed, 6 insertions(+), 16 deletions(-)
diff --git a/src/device.c b/src/device.c
@@ -78,16 +78,11 @@ static uint32_t netdev_watch;
static void device_netdev_event(struct netdev *netdev, enum netdev_event event,
void *user_data);
-void device_set_scan_results(struct device *device, struct l_queue *bss_list,
- bool add_to_autoconnect)
-{
- station_set_scan_results(device->station, bss_list, add_to_autoconnect);
-}
-
static bool new_scan_results(uint32_t wiphy_id, uint32_t ifindex, int err,
struct l_queue *bss_list, void *userdata)
{
struct device *device = userdata;
+ struct station *station = device->station;
struct l_dbus *dbus = dbus_get_bus();
bool autoconnect;
@@ -104,12 +99,11 @@ static bool new_scan_results(uint32_t wiphy_id, uint32_t ifindex, int err,
if (netdev_get_iftype(device->netdev) != NETDEV_IFTYPE_STATION)
return false;
- autoconnect = station_get_state(device->station) ==
- STATION_STATE_AUTOCONNECT;
- device_set_scan_results(device, bss_list, autoconnect);
+ autoconnect = station_get_state(station) == STATION_STATE_AUTOCONNECT;
+ station_set_scan_results(station, bss_list, autoconnect);
if (autoconnect)
- station_autoconnect_next(device->station);
+ station_autoconnect_next(station);
return true;
}
diff --git a/src/device.h b/src/device.h
@@ -30,8 +30,6 @@ struct device;
void device_disassociated(struct device *device);
void device_transition_start(struct device *device, struct scan_bss *bss);
-void device_set_scan_results(struct device *device, struct l_queue *bss_list,
- bool add_to_autoconnect);
bool device_set_autoconnect(struct device *device, bool autoconnect);
int __device_connect_network(struct device *device, struct network *network,
diff --git a/src/wsc.c b/src/wsc.c
@@ -570,7 +570,6 @@ static bool push_button_scan_results(uint32_t wiphy_id, uint32_t ifindex,
void *userdata)
{
struct wsc *wsc = userdata;
- struct device *device = netdev_get_device(wsc->netdev);
struct scan_bss *bss_2g;
struct scan_bss *bss_5g;
struct scan_bss *target;
@@ -673,7 +672,7 @@ static bool push_button_scan_results(uint32_t wiphy_id, uint32_t ifindex,
}
wsc_cancel_scan(wsc);
- device_set_scan_results(device, bss_list, false);
+ station_set_scan_results(wsc->station, bss_list, false);
l_debug("Found AP to connect to: %s",
util_address_to_string(target->addr));
@@ -730,7 +729,6 @@ static bool pin_scan_results(uint32_t wiphy_id, uint32_t ifindex, int err,
static const uint8_t wildcard_address[] =
{ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
struct wsc *wsc = userdata;
- struct device *device = netdev_get_device(wsc->netdev);
struct scan_bss *target = NULL;
const struct l_queue_entry *bss_entry;
struct wsc_probe_response probe_response;
@@ -821,7 +819,7 @@ static bool pin_scan_results(uint32_t wiphy_id, uint32_t ifindex, int err,
}
wsc_cancel_scan(wsc);
- device_set_scan_results(device, bss_list, false);
+ station_set_scan_results(wsc->station, bss_list, false);
l_debug("Found AP to connect to: %s",
util_address_to_string(target->addr));