linux: Fix libusb_get_device_speed() not working on wrapped devices
authorHans de Goede <hdegoede@redhat.com>
Mon, 7 Sep 2020 08:30:54 +0000 (10:30 +0200)
committerHans de Goede <hdegoede@redhat.com>
Mon, 14 Sep 2020 07:48:14 +0000 (09:48 +0200)
commitf6068e83c4f5e5fba16b23b6a87f1f6d7ab7200a
tree8a57225c8ac34e616e20f75b901adc3f5151aa16
parenta6bfd45deab1e9550a7e7f8bf618b484da7e2816
linux: Fix libusb_get_device_speed() not working on wrapped devices

We don't have a sysfs_dir for wrapped devices, so we cannot read the speed
from sysfs.

The Linux kernel has supported a new ioctl to get the speed directly from
the fd for a while now, use that when we don't have sysfs access.

Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1871818
Reported-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
libusb/os/linux_usbfs.c
libusb/os/linux_usbfs.h