mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2024-12-22 21:22:37 +01: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:
parent
d98349d201
commit
0ac0c6b129
21
src/device.c
21
src/device.c
@ -465,6 +465,19 @@ static void periodic_scan_trigger(int err, void *user_data)
|
|||||||
IWD_DEVICE_INTERFACE, "Scanning");
|
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,
|
uint32_t device_add_state_watch(struct device *device,
|
||||||
device_state_watch_func_t func,
|
device_state_watch_func_t func,
|
||||||
void *user_data,
|
void *user_data,
|
||||||
@ -497,17 +510,17 @@ static void device_enter_state(struct device *device, enum device_state state)
|
|||||||
|
|
||||||
switch (state) {
|
switch (state) {
|
||||||
case DEVICE_STATE_OFF:
|
case DEVICE_STATE_OFF:
|
||||||
scan_periodic_stop(device->index);
|
periodic_scan_stop(device);
|
||||||
break;
|
break;
|
||||||
case DEVICE_STATE_AUTOCONNECT:
|
case DEVICE_STATE_AUTOCONNECT:
|
||||||
scan_periodic_start(device->index, periodic_scan_trigger,
|
scan_periodic_start(device->index, periodic_scan_trigger,
|
||||||
new_scan_results, device);
|
new_scan_results, device);
|
||||||
break;
|
break;
|
||||||
case DEVICE_STATE_DISCONNECTED:
|
case DEVICE_STATE_DISCONNECTED:
|
||||||
scan_periodic_stop(device->index);
|
periodic_scan_stop(device);
|
||||||
break;
|
break;
|
||||||
case DEVICE_STATE_CONNECTED:
|
case DEVICE_STATE_CONNECTED:
|
||||||
scan_periodic_stop(device->index);
|
periodic_scan_stop(device);
|
||||||
break;
|
break;
|
||||||
case DEVICE_STATE_CONNECTING:
|
case DEVICE_STATE_CONNECTING:
|
||||||
break;
|
break;
|
||||||
@ -516,7 +529,7 @@ static void device_enter_state(struct device *device, enum device_state state)
|
|||||||
case DEVICE_STATE_ROAMING:
|
case DEVICE_STATE_ROAMING:
|
||||||
break;
|
break;
|
||||||
case DEVICE_STATE_AP:
|
case DEVICE_STATE_AP:
|
||||||
scan_periodic_stop(device->index);
|
periodic_scan_stop(device);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user