mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2025-01-03 10:32:33 +01:00
network: sync frequencies per-network
The existing frequency syncing was done when IWD closes. Instead we can sync as networks are connected to or promoted to known which will keep the FS more up to date. This also allows hotspot networks to use the known frequency file.
This commit is contained in:
parent
9ed5fba57b
commit
f5db4bfea8
@ -150,6 +150,9 @@ void network_connected(struct network *network)
|
|||||||
err = network_info_touch(network->info);
|
err = network_info_touch(network->info);
|
||||||
if (err < 0)
|
if (err < 0)
|
||||||
l_error("Error %i touching network config", err);
|
l_error("Error %i touching network config", err);
|
||||||
|
|
||||||
|
/* Syncs frequencies of already known network*/
|
||||||
|
known_network_frequency_sync(network->info);
|
||||||
}
|
}
|
||||||
|
|
||||||
l_queue_foreach_remove(network->secrets,
|
l_queue_foreach_remove(network->secrets,
|
||||||
@ -435,11 +438,21 @@ const struct network_info *network_get_info(const struct network *network)
|
|||||||
return network->info;
|
return network->info;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void add_known_frequency(void *data, void *user_data)
|
||||||
|
{
|
||||||
|
struct scan_bss *bss = data;
|
||||||
|
struct network_info *info = user_data;
|
||||||
|
|
||||||
|
known_network_add_frequency(info, bss->frequency);
|
||||||
|
}
|
||||||
|
|
||||||
void network_set_info(struct network *network, struct network_info *info)
|
void network_set_info(struct network *network, struct network_info *info)
|
||||||
{
|
{
|
||||||
if (info) {
|
if (info) {
|
||||||
network->info = info;
|
network->info = info;
|
||||||
network->info->seen_count++;
|
network->info->seen_count++;
|
||||||
|
|
||||||
|
l_queue_foreach(network->bss_list, add_known_frequency, info);
|
||||||
} else {
|
} else {
|
||||||
network->info->seen_count--;
|
network->info->seen_count--;
|
||||||
network->info = NULL;
|
network->info = NULL;
|
||||||
@ -1412,6 +1425,9 @@ static void known_networks_changed(enum known_networks_event event,
|
|||||||
switch (event) {
|
switch (event) {
|
||||||
case KNOWN_NETWORKS_EVENT_ADDED:
|
case KNOWN_NETWORKS_EVENT_ADDED:
|
||||||
station_foreach(match_known_network, (void *) info);
|
station_foreach(match_known_network, (void *) info);
|
||||||
|
|
||||||
|
/* Syncs frequencies of newly known network */
|
||||||
|
known_network_frequency_sync(info);
|
||||||
break;
|
break;
|
||||||
case KNOWN_NETWORKS_EVENT_REMOVED:
|
case KNOWN_NETWORKS_EVENT_REMOVED:
|
||||||
station_foreach(disconnect_no_longer_known, (void *) info);
|
station_foreach(disconnect_no_longer_known, (void *) info);
|
||||||
|
Loading…
Reference in New Issue
Block a user