From 2b544541bc9c476c31a3425d142cd2e548d5e80e Mon Sep 17 00:00:00 2001 From: Andrew Zaborowski Date: Thu, 14 Mar 2019 21:42:11 +0100 Subject: [PATCH] scan: Drop notify callback's ifindex parameter This is not used by any of the scan notify callback implementations and for P2P we're going to need to scan on an interface without an ifindex so without this the other changes should be mostly contained in scan. --- src/scan.c | 4 ++-- src/scan.h | 3 +-- src/station.c | 8 +++----- src/wsc.c | 6 ++---- 4 files changed, 8 insertions(+), 13 deletions(-) diff --git a/src/scan.c b/src/scan.c index 03fe15f4..7649487c 100644 --- a/src/scan.c +++ b/src/scan.c @@ -138,7 +138,7 @@ static void scan_request_failed(struct scan_context *sc, if (sr->trigger) sr->trigger(err, sr->userdata); else if (sr->callback) - sr->callback(sc->ifindex, err, NULL, sr->userdata); + sr->callback(err, NULL, sr->userdata); scan_request_free(sr); } @@ -1176,7 +1176,7 @@ static void scan_finished(struct scan_context *sc, uint32_t wiphy, } if (callback) - new_owner = callback(sc->ifindex, err, bss_list, userdata); + new_owner = callback(err, bss_list, userdata); if (sr) scan_request_free(sr); diff --git a/src/scan.h b/src/scan.h index 446e37ec..907f75aa 100644 --- a/src/scan.h +++ b/src/scan.h @@ -33,8 +33,7 @@ enum scan_state { typedef void (*scan_func_t)(struct l_genl_msg *msg, void *user_data); typedef void (*scan_trigger_func_t)(int, void *); -typedef bool (*scan_notify_func_t)(uint32_t ifindex, int err, - struct l_queue *bss_list, +typedef bool (*scan_notify_func_t)(int err, struct l_queue *bss_list, void *userdata); typedef void (*scan_destroy_func_t)(void *userdata); typedef void (*scan_freq_set_func_t)(uint32_t freq, void *userdata); diff --git a/src/station.c b/src/station.c index f7f3fa97..3c865f26 100644 --- a/src/station.c +++ b/src/station.c @@ -592,8 +592,7 @@ not_supported: return NULL; } -static bool new_scan_results(uint32_t ifindex, int err, - struct l_queue *bss_list, void *userdata) +static bool new_scan_results(int err, struct l_queue *bss_list, void *userdata) { struct station *station = userdata; struct l_dbus *dbus = dbus_get_bus(); @@ -1076,8 +1075,7 @@ static void station_roam_scan_triggered(int err, void *user_data) */ } -static bool station_roam_scan_notify(uint32_t ifindex, int err, - struct l_queue *bss_list, +static bool station_roam_scan_notify(int err, struct l_queue *bss_list, void *userdata) { struct station *station = userdata; @@ -1808,7 +1806,7 @@ static void station_hidden_network_scan_triggered(int err, void *user_data) dbus_error_failed(station->connect_pending)); } -static bool station_hidden_network_scan_results(uint32_t ifindex, int err, +static bool station_hidden_network_scan_results(int err, struct l_queue *bss_list, void *userdata) { diff --git a/src/wsc.c b/src/wsc.c index 64a5c2a9..9b20af99 100644 --- a/src/wsc.c +++ b/src/wsc.c @@ -560,8 +560,7 @@ static void pin_timeout(struct l_timeout *timeout, void *user_data) wsc_error_time_expired(wsc->pending)); } -static bool push_button_scan_results(uint32_t ifindex, int err, - struct l_queue *bss_list, +static bool push_button_scan_results(int err, struct l_queue *bss_list, void *userdata) { struct wsc *wsc = userdata; @@ -718,8 +717,7 @@ static bool authorized_macs_contains(const uint8_t *authorized_macs, return false; } -static bool pin_scan_results(uint32_t ifindex, int err, - struct l_queue *bss_list, void *userdata) +static bool pin_scan_results(int err, struct l_queue *bss_list, void *userdata) { static const uint8_t wildcard_address[] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };