usb-backend: incorrect logic for detecting root hub results in devices not being enumerated
When the libusb backend was split in this commit: 2e19014e
This piece of logic was introduced:
if (info->address == 0xff || /* root hub (HCD) */
info->address <= 1 || /* root hub or bad address */
(desc.bDeviceClass == LIBUSB_CLASS_HUB) /*hub*/) {
return FALSE;
}
Previously, it only checked for LIBUSB_CLASS_HUB
. However, this logic results in devices on macOS/iOS with a valid address of 1 to be filtered out. I didn't test other operating systems, but the logic seems incorrect that all devices with address 1 are to be skipped (was there an &&
that was changed to a ||
somewhere?).
I made a change which disables the logic (osy/spice-gtk@394ec4a8) however, without understanding the original code, I hesitate to submit it as a PR.