mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2024-11-22 06:29:23 +01:00
network: Pass connected state to network_rank_update
This commit is contained in:
parent
b69f938879
commit
738faa7657
@ -1232,18 +1232,14 @@ int network_rank_compare(const void *a, const void *b, void *user)
|
||||
return network->rank - new_network->rank;
|
||||
}
|
||||
|
||||
void network_rank_update(struct network *network)
|
||||
void network_rank_update(struct network *network, bool connected)
|
||||
{
|
||||
bool connected;
|
||||
int rank;
|
||||
|
||||
/*
|
||||
* Theoretically there may be difference between the BSS selection
|
||||
* here and in network_bss_select but those should be rare cases.
|
||||
*/
|
||||
struct scan_bss *best_bss = l_queue_peek_head(network->bss_list);
|
||||
|
||||
connected = device_get_connected_network(network->device) == network;
|
||||
int rank;
|
||||
|
||||
/*
|
||||
* The rank should separate networks into four groups that use
|
||||
|
@ -61,7 +61,7 @@ bool network_register(struct network *network, const char *path);
|
||||
void network_remove(struct network *network, int reason);
|
||||
|
||||
int network_rank_compare(const void *a, const void *b, void *user);
|
||||
void network_rank_update(struct network *network);
|
||||
void network_rank_update(struct network *network, bool connected);
|
||||
|
||||
void network_connect_new_hidden_network(struct network *network,
|
||||
struct l_dbus_message *message);
|
||||
|
@ -125,8 +125,10 @@ static bool process_network(const void *key, void *data, void *user_data)
|
||||
struct station *station = user_data;
|
||||
|
||||
if (!network_bss_list_isempty(network)) {
|
||||
bool connected = network == station->connected_network;
|
||||
|
||||
/* Build the network list ordered by rank */
|
||||
network_rank_update(network);
|
||||
network_rank_update(network, connected);
|
||||
|
||||
l_queue_insert(station->networks_sorted, network,
|
||||
network_rank_compare, NULL);
|
||||
|
Loading…
Reference in New Issue
Block a user