3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-10-05 19:08:52 +02:00

device: Update Scanning on periodic scan stop

When we call scan_periodic_stop and a periodic scan is in progress (i.e.
the trigger callback has been called already) we get no new callback
from scan.c and the device Scanning property remains True forever so set
it to False.

The change from scan_periodic_stop to periodic_scan_stop looks silly but
it's consistent with our naming :)
This commit is contained in:
Andrew Zaborowski 2018-01-22 12:45:58 +01:00 committed by Denis Kenzior
parent d98349d201
commit 0ac0c6b129

View File

@ -465,6 +465,19 @@ static void periodic_scan_trigger(int err, void *user_data)
IWD_DEVICE_INTERFACE, "Scanning");
}
static void periodic_scan_stop(struct device *device)
{
struct l_dbus *dbus = dbus_get_bus();
scan_periodic_stop(device->index);
if (device->scanning) {
device->scanning = false;
l_dbus_property_changed(dbus, device_get_path(device),
IWD_DEVICE_INTERFACE, "Scanning");
}
}
uint32_t device_add_state_watch(struct device *device,
device_state_watch_func_t func,
void *user_data,
@ -497,17 +510,17 @@ static void device_enter_state(struct device *device, enum device_state state)
switch (state) {
case DEVICE_STATE_OFF:
scan_periodic_stop(device->index);
periodic_scan_stop(device);
break;
case DEVICE_STATE_AUTOCONNECT:
scan_periodic_start(device->index, periodic_scan_trigger,
new_scan_results, device);
break;
case DEVICE_STATE_DISCONNECTED:
scan_periodic_stop(device->index);
periodic_scan_stop(device);
break;
case DEVICE_STATE_CONNECTED:
scan_periodic_stop(device->index);
periodic_scan_stop(device);
break;
case DEVICE_STATE_CONNECTING:
break;
@ -516,7 +529,7 @@ static void device_enter_state(struct device *device, enum device_state state)
case DEVICE_STATE_ROAMING:
break;
case DEVICE_STATE_AP:
scan_periodic_stop(device->index);
periodic_scan_stop(device);
break;
}