device: Add device_set_scan_results

This commit is contained in:
Denis Kenzior 2016-09-19 20:35:57 -05:00
parent 9c9e6f6f29
commit 42fb2a7c0f
2 changed files with 13 additions and 3 deletions

View File

@ -319,10 +319,12 @@ static bool bss_match(const void *a, const void *b)
return !memcmp(bss_a->addr, bss_b->addr, sizeof(bss_a->addr));
}
static bool new_scan_results(uint32_t wiphy_id, uint32_t ifindex,
struct l_queue *bss_list, void *userdata)
/*
* Used when scan results were obtained; either from passive scan running
* inside device.c or active scans running in other state machines, e.g. wsc.c
*/
void device_set_scan_results(struct device *device, struct l_queue *bss_list)
{
struct device *device = userdata;
struct network *network;
const struct l_queue_entry *bss_entry;
struct timespec now;
@ -375,7 +377,14 @@ static bool new_scan_results(uint32_t wiphy_id, uint32_t ifindex,
if (device->state == DEVICE_STATE_AUTOCONNECT)
device_autoconnect_next(device);
}
static bool new_scan_results(uint32_t wiphy_id, uint32_t ifindex,
struct l_queue *bss_list, void *userdata)
{
struct device *device = userdata;
device_set_scan_results(device, bss_list);
return true;
}

View File

@ -66,6 +66,7 @@ uint32_t device_add_state_watch(struct device *device,
device_destroy_func_t destroy);
bool device_remove_state_watch(struct device *device, uint32_t id);
void device_set_scan_results(struct device *device, struct l_queue *bss_list);
struct network *device_network_find(struct device *device, const char *ssid,
enum security security);