3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-11-26 10:39:23 +01:00

scan: Add scan_bss_rank_compare

This commit is contained in:
Denis Kenzior 2015-06-16 13:56:03 -05:00
parent 15c9bc7933
commit 0cba8ea2e9
2 changed files with 9 additions and 3 deletions

View File

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

View File

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