3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-12-22 21:22:37 +01:00

scan: Pass the frequencies scanned to notify cb

This commit is contained in:
Denis Kenzior 2021-02-03 10:02:40 -06:00
parent 4015222f89
commit ccbd32503b
6 changed files with 35 additions and 15 deletions

View File

@ -1283,6 +1283,7 @@ static void p2p_scan_destroy(void *user_data)
static void p2p_provision_scan_start(struct p2p_device *dev); static void p2p_provision_scan_start(struct p2p_device *dev);
static bool p2p_provision_scan_notify(int err, struct l_queue *bss_list, static bool p2p_provision_scan_notify(int err, struct l_queue *bss_list,
const struct scan_freq_set *freqs,
void *user_data) void *user_data)
{ {
struct p2p_device *dev = user_data; struct p2p_device *dev = user_data;
@ -3312,6 +3313,7 @@ static bool p2p_peer_update_existing(struct scan_bss *bss,
} }
static bool p2p_scan_notify(int err, struct l_queue *bss_list, static bool p2p_scan_notify(int err, struct l_queue *bss_list,
const struct scan_freq_set *freqs,
void *user_data) void *user_data)
{ {
struct p2p_device *dev = user_data; struct p2p_device *dev = user_data;

View File

@ -388,7 +388,9 @@ static void rrm_handle_beacon_table(struct rrm_state *rrm,
l_error("Error reporting beacon table results"); l_error("Error reporting beacon table results");
} }
static bool rrm_scan_results(int err, struct l_queue *bss_list, void *userdata) static bool rrm_scan_results(int err, struct l_queue *bss_list,
const struct scan_freq_set *freqs,
void *userdata)
{ {
struct rrm_state *rrm = userdata; struct rrm_state *rrm = userdata;
struct rrm_beacon_req_info *beacon = l_container_of(rrm->pending, struct rrm_beacon_req_info *beacon = l_container_of(rrm->pending,

View File

@ -160,7 +160,7 @@ static void scan_request_failed(struct scan_context *sc,
if (sr->trigger) if (sr->trigger)
sr->trigger(err, sr->userdata); sr->trigger(err, sr->userdata);
else if (sr->callback) else if (sr->callback)
sr->callback(err, NULL, sr->userdata); sr->callback(err, NULL, NULL, sr->userdata);
wiphy_radio_work_done(sc->wiphy, sr->work.id); wiphy_radio_work_done(sc->wiphy, sr->work.id);
} }
@ -683,6 +683,7 @@ static void scan_periodic_triggered(int err, void *user_data)
} }
static bool scan_periodic_notify(int err, struct l_queue *bss_list, static bool scan_periodic_notify(int err, struct l_queue *bss_list,
const struct scan_freq_set *freqs,
void *user_data) void *user_data)
{ {
struct scan_context *sc = user_data; struct scan_context *sc = user_data;
@ -690,7 +691,7 @@ static bool scan_periodic_notify(int err, struct l_queue *bss_list,
scan_periodic_rearm(sc); scan_periodic_rearm(sc);
if (sc->sp.callback) if (sc->sp.callback)
return sc->sp.callback(err, bss_list, sc->sp.userdata); return sc->sp.callback(err, bss_list, freqs, sc->sp.userdata);
return false; return false;
} }
@ -1496,6 +1497,7 @@ static void discover_hidden_network_bsses(struct scan_context *sc,
static void scan_finished(struct scan_context *sc, static void scan_finished(struct scan_context *sc,
int err, struct l_queue *bss_list, int err, struct l_queue *bss_list,
const struct scan_freq_set *freqs,
struct scan_request *sr) struct scan_request *sr)
{ {
bool new_owner = false; bool new_owner = false;
@ -1509,7 +1511,8 @@ static void scan_finished(struct scan_context *sc,
sc->work_started = false; sc->work_started = false;
if (sr->callback) if (sr->callback)
new_owner = sr->callback(err, bss_list, sr->userdata); new_owner = sr->callback(err, bss_list,
freqs, sr->userdata);
/* /*
* Can start a new scan now that we've removed this one from * Can start a new scan now that we've removed this one from
@ -1520,7 +1523,8 @@ static void scan_finished(struct scan_context *sc,
*/ */
wiphy_radio_work_done(sc->wiphy, sr->work.id); wiphy_radio_work_done(sc->wiphy, sr->work.id);
} else if (sc->sp.callback) } else if (sc->sp.callback)
new_owner = sc->sp.callback(err, bss_list, sc->sp.userdata); new_owner = sc->sp.callback(err, bss_list,
freqs, sc->sp.userdata);
if (bss_list && !new_owner) if (bss_list && !new_owner)
l_queue_destroy(bss_list, l_queue_destroy(bss_list,
@ -1537,7 +1541,8 @@ static void get_scan_done(void *user)
sc->get_scan_cmd_id = 0; sc->get_scan_cmd_id = 0;
if (l_queue_peek_head(sc->requests) == results->sr) if (l_queue_peek_head(sc->requests) == results->sr)
scan_finished(sc, 0, results->bss_list, results->sr); scan_finished(sc, 0, results->bss_list,
results->freqs, results->sr);
else else
l_queue_destroy(results->bss_list, l_queue_destroy(results->bss_list,
(l_queue_destroy_func_t) scan_bss_free); (l_queue_destroy_func_t) scan_bss_free);
@ -1652,7 +1657,7 @@ static void scan_notify(struct l_genl_msg *msg, void *user_data)
sc->triggered = false; sc->triggered = false;
if (!sr->callback) { if (!sr->callback) {
scan_finished(sc, -ECANCELED, NULL, sr); scan_finished(sc, -ECANCELED, NULL, NULL, sr);
break; break;
} }
@ -1675,7 +1680,7 @@ static void scan_notify(struct l_genl_msg *msg, void *user_data)
/* An external scan may have flushed our results */ /* An external scan may have flushed our results */
if (sc->started && scan_parse_flush_flag_from_msg(msg)) if (sc->started && scan_parse_flush_flag_from_msg(msg))
scan_finished(sc, -EAGAIN, NULL, sr); scan_finished(sc, -EAGAIN, NULL, NULL, sr);
else else
send_next = true; send_next = true;
@ -1739,7 +1744,7 @@ static void scan_notify(struct l_genl_msg *msg, void *user_data)
if (sc->triggered) { if (sc->triggered) {
sc->triggered = false; sc->triggered = false;
scan_finished(sc, -ECANCELED, NULL, sr); scan_finished(sc, -ECANCELED, NULL, NULL, sr);
} else { } else {
/* /*
* If this was an external scan that got aborted * If this was an external scan that got aborted

View File

@ -103,6 +103,7 @@ struct scan_parameters {
typedef void (*scan_func_t)(struct l_genl_msg *msg, void *user_data); typedef void (*scan_func_t)(struct l_genl_msg *msg, void *user_data);
typedef void (*scan_trigger_func_t)(int, void *); typedef void (*scan_trigger_func_t)(int, void *);
typedef bool (*scan_notify_func_t)(int err, struct l_queue *bss_list, typedef bool (*scan_notify_func_t)(int err, struct l_queue *bss_list,
const struct scan_freq_set *freqs,
void *userdata); void *userdata);
typedef void (*scan_destroy_func_t)(void *userdata); typedef void (*scan_destroy_func_t)(void *userdata);
typedef void (*scan_freq_set_func_t)(uint32_t freq, void *userdata); typedef void (*scan_freq_set_func_t)(uint32_t freq, void *userdata);

View File

@ -1016,7 +1016,9 @@ not_supported:
return NULL; return NULL;
} }
static bool new_scan_results(int err, struct l_queue *bss_list, void *userdata) static bool new_scan_results(int err, struct l_queue *bss_list,
const struct scan_freq_set *freqs,
void *userdata)
{ {
struct station *station = userdata; struct station *station = userdata;
bool autoconnect; bool autoconnect;
@ -1082,6 +1084,7 @@ static uint32_t station_scan_trigger(struct station *station,
} }
static bool station_quick_scan_results(int err, struct l_queue *bss_list, static bool station_quick_scan_results(int err, struct l_queue *bss_list,
const struct scan_freq_set *freqs,
void *userdata) void *userdata)
{ {
struct station *station = userdata; struct station *station = userdata;
@ -1676,6 +1679,7 @@ static void station_roam_scan_triggered(int err, void *user_data)
} }
static bool station_roam_scan_notify(int err, struct l_queue *bss_list, static bool station_roam_scan_notify(int err, struct l_queue *bss_list,
const struct scan_freq_set *freqs,
void *userdata) void *userdata)
{ {
struct station *station = userdata; struct station *station = userdata;
@ -2584,6 +2588,7 @@ static void station_hidden_network_scan_triggered(int err, void *user_data)
static bool station_hidden_network_scan_results(int err, static bool station_hidden_network_scan_results(int err,
struct l_queue *bss_list, struct l_queue *bss_list,
const struct scan_freq_set *freqs,
void *userdata) void *userdata)
{ {
struct station *station = userdata; struct station *station = userdata;
@ -2992,7 +2997,9 @@ static void station_dbus_scan_triggered(int err, void *user_data)
static bool station_dbus_scan_subset(struct station *station); static bool station_dbus_scan_subset(struct station *station);
static bool station_dbus_scan_results(int err, struct l_queue *bss_list, void *userdata) static bool station_dbus_scan_results(int err, struct l_queue *bss_list,
const struct scan_freq_set *freqs,
void *userdata)
{ {
struct station *station = userdata; struct station *station = userdata;
unsigned int next_idx = station->dbus_scan_subset_idx + 1; unsigned int next_idx = station->dbus_scan_subset_idx + 1;

View File

@ -683,6 +683,7 @@ static void pin_timeout(struct l_timeout *timeout, void *user_data)
} }
static bool push_button_scan_results(int err, struct l_queue *bss_list, static bool push_button_scan_results(int err, struct l_queue *bss_list,
const struct scan_freq_set *freqs,
void *userdata) void *userdata)
{ {
struct wsc_station_dbus *wsc = userdata; struct wsc_station_dbus *wsc = userdata;
@ -837,7 +838,9 @@ static bool authorized_macs_contains(const uint8_t *authorized_macs,
return false; return false;
} }
static bool pin_scan_results(int err, struct l_queue *bss_list, void *userdata) static bool pin_scan_results(int err, struct l_queue *bss_list,
const struct scan_freq_set *freqs,
void *userdata)
{ {
static const uint8_t wildcard_address[] = static const uint8_t wildcard_address[] =
{ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };