mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2025-02-16 23:40:43 +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;
|
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
|
* Theoretically there may be difference between the BSS selection
|
||||||
* here and in network_bss_select but those should be rare cases.
|
* here and in network_bss_select but those should be rare cases.
|
||||||
*/
|
*/
|
||||||
struct scan_bss *best_bss = l_queue_peek_head(network->bss_list);
|
struct scan_bss *best_bss = l_queue_peek_head(network->bss_list);
|
||||||
|
int rank;
|
||||||
connected = device_get_connected_network(network->device) == network;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The rank should separate networks into four groups that use
|
* 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);
|
void network_remove(struct network *network, int reason);
|
||||||
|
|
||||||
int network_rank_compare(const void *a, const void *b, void *user);
|
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,
|
void network_connect_new_hidden_network(struct network *network,
|
||||||
struct l_dbus_message *message);
|
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;
|
struct station *station = user_data;
|
||||||
|
|
||||||
if (!network_bss_list_isempty(network)) {
|
if (!network_bss_list_isempty(network)) {
|
||||||
|
bool connected = network == station->connected_network;
|
||||||
|
|
||||||
/* Build the network list ordered by rank */
|
/* Build the network list ordered by rank */
|
||||||
network_rank_update(network);
|
network_rank_update(network, connected);
|
||||||
|
|
||||||
l_queue_insert(station->networks_sorted, network,
|
l_queue_insert(station->networks_sorted, network,
|
||||||
network_rank_compare, NULL);
|
network_rank_compare, NULL);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user