mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2024-12-27 02:32:52 +01:00
scan: Add scan_bss_rank_compare
This commit is contained in:
parent
15c9bc7933
commit
0cba8ea2e9
11
src/scan.c
11
src/scan.c
@ -501,6 +501,13 @@ void bss_get_supported_ciphers(struct scan_bss *bss,
|
||||
*group_ciphers = ie.group_cipher;
|
||||
}
|
||||
|
||||
int scan_bss_rank_compare(const void *a, const void *b, void *user_data)
|
||||
{
|
||||
const struct scan_bss *new_bss = a, *bss = b;
|
||||
|
||||
return bss->rank - new_bss->rank;
|
||||
}
|
||||
|
||||
static void get_scan_callback(struct l_genl_msg *msg, void *user_data)
|
||||
{
|
||||
struct scan_results *results = user_data;
|
||||
@ -523,9 +530,7 @@ static void get_scan_callback(struct l_genl_msg *msg, void *user_data)
|
||||
}
|
||||
|
||||
scan_bss_compute_rank(bss);
|
||||
l_debug("computed rank: %u", bss->rank);
|
||||
|
||||
l_queue_push_tail(results->bss_list, bss);
|
||||
l_queue_insert(results->bss_list, bss, scan_bss_rank_compare, NULL);
|
||||
}
|
||||
|
||||
static void get_scan_done(void *user)
|
||||
|
@ -65,6 +65,7 @@ enum scan_ssid_security scan_get_ssid_security(enum ie_bss_capability bss_cap,
|
||||
const struct ie_rsn_info *info);
|
||||
void scan_bss_free(struct scan_bss *bss);
|
||||
void scan_bss_compute_rank(struct scan_bss *bss);
|
||||
int scan_bss_rank_compare(const void *a, const void *b, void *user);
|
||||
|
||||
void bss_get_supported_ciphers(struct scan_bss *bss,
|
||||
uint16_t *pairwise_ciphers,
|
||||
|
Loading…
Reference in New Issue
Block a user