3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-11-22 14:49:24 +01:00

device/wsc: Use station_set_scan_results

This commit is contained in:
Denis Kenzior 2018-09-04 16:38:06 -05:00
parent 187ea7f5d1
commit 553a8c1bae
3 changed files with 6 additions and 16 deletions

View File

@ -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;
}

View File

@ -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,

View File

@ -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));