[Spice-devel] [PATCH spice-gtk 03/44] fixup! usb-redir: define interfaces to support emulated devices
Frediano Ziglio
fziglio at redhat.com
Tue Jul 30 12:02:52 UTC 2019
Add some comments
---
src/usb-backend.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/usb-backend.c b/src/usb-backend.c
index f07009ad..ec0ae3e8 100644
--- a/src/usb-backend.c
+++ b/src/usb-backend.c
@@ -47,6 +47,8 @@
struct _SpiceUsbBackendDevice
{
+ /* Pointer to device. Either real device (libusb_device)
+ * or emulated one (edev) */
libusb_device *libusb_device;
SpiceUsbEmulatedDevice *edev;
gint ref_count;
@@ -70,6 +72,8 @@ struct _SpiceUsbBackend
#endif
SpiceUsbEmulatedDeviceCreate dev_init[USB_DEV_TYPE_MAX];
+ /* Mask of allocated device, a specific bit set to 1 to indicate that the device at
+ * that address is allocated */
uint32_t own_devices_mask;
};
@@ -418,7 +422,8 @@ SpiceUsbBackend *spice_usb_backend_new(GError **error)
libusb_set_option(be->libusb_context, LIBUSB_OPTION_USE_USBDK);
#endif
#endif
- be->own_devices_mask = 3; /* exclude addresses 0 and 1 */
+ /* exclude addresses 0 (reserved) and 1 (root hub) */
+ be->own_devices_mask = 3;
}
SPICE_DEBUG("%s <<", __FUNCTION__);
return be;
--
2.20.1
More information about the Spice-devel
mailing list