network: Add network_disconnected

Let network handle anything that needs to be done on a disconnection,
this way keep the settings opening and closing logic in network.c.
This commit is contained in:
Andrew Zaborowski 2016-06-09 19:55:18 +02:00 committed by Denis Kenzior
parent b3abd2f7ca
commit 3fa9a21a39
3 changed files with 7 additions and 1 deletions

View File

@ -182,6 +182,11 @@ fail:
return false;
}
void network_disconnected(struct network *network)
{
network_settings_close(network);
}
/* First 64 entries calculated by 1 / pow(n, 0.3) for n >= 1 */
static const double rankmod_table[] = {
1.0000000000, 0.8122523964, 0.7192230933, 0.6597539554,

View File

@ -27,6 +27,7 @@ struct network;
bool network_seen(struct network *network);
bool network_connected(struct network *network);
void network_disconnected(struct network *network);
double network_rankmod(uint32_t type, const char *ssid);
struct network *network_create(struct device *device,

View File

@ -218,7 +218,7 @@ static void device_disassociated(struct device *device)
struct network *network = device->connected_network;
struct l_dbus *dbus = dbus_get_bus();
network_settings_close(network);
network_disconnected(network);
device->connected_bss = NULL;
device->connected_network = NULL;