DBG("device %p", device);
/* Power request timedout, reset power pending state. */
- if (device->pending_timeout > 0) {
- g_source_remove(device->pending_timeout);
- device->pending_timeout = 0;
- device->powered_pending = PENDING_NONE;
- }
+ device->pending_timeout = 0;
+ device->powered_pending = PENDING_NONE;
return FALSE;
}
if (device->powered_pending == PENDING_NONE && device->powered == FALSE)
return -EALREADY;
+ device->powered_pending = PENDING_DISABLE;
device->reconnect = FALSE;
clear_scan_trigger(device);
reset_scan_trigger(device);
- if (device->driver && device->driver->scan)
+ if (device->driver && device->driver->scan_fast)
+ device->driver->scan_fast(device);
+ else if (device->driver && device->driver->scan)
device->driver->scan(device);
return 0;
return FALSE;
}
-static int device_probe(struct connman_device *device)
+/**
+ * connman_device_register:
+ * @device: device structure
+ *
+ * Register device with the system
+ */
+int connman_device_register(struct connman_device *device)
{
GSList *list;
return __connman_technology_add_device(device);
}
-static void device_remove(struct connman_device *device)
-{
- DBG("device %p name %s", device, device->name);
-
- if (device->driver == NULL)
- return;
-
- remove_device(device);
-}
-
-/**
- * connman_device_register:
- * @device: device structure
- *
- * Register device with the system
- */
-int connman_device_register(struct connman_device *device)
-{
- return device_probe(device);
-}
-
/**
* connman_device_unregister:
* @device: device structure
*/
void connman_device_unregister(struct connman_device *device)
{
- device_remove(device);
+ DBG("device %p name %s", device, device->name);
+
+ if (device->driver == NULL)
+ return;
+
+ remove_device(device);
}
/**