[spice-gtk,03/44] fixup! usb-redir: define interfaces to support emulated devices

Submitted by Frediano Ziglio on July 30, 2019, 12:02 p.m.

Details

Message ID 20190730120331.17967-4-fziglio@redhat.com
State Superseded
Headers show
Series "Follow ups for CD emulation patch series" ( rev: 1 ) in Spice

Not browsing as part of any series.

Commit Message

Frediano Ziglio July 30, 2019, 12:02 p.m.
Add some comments
---
 src/usb-backend.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

Patch hide | download patch | download mbox

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;