1. By saying "be documented somewhere", do you mean there is extra
documentation work which needs to be done? Sorry that I missed this
part since it's the first time for me to work on a kernel patch.
It needs to be documented somewhere, otherwise no one knows how to use
it.
2. If no error, returned values are "enum usb_ssp_rate" defined in include/linux/usb/ch9.h
3. ssp rate is only valid for superspeedplus. For other speeds, it should be
USB_SSP_GEN_UNKNOWN.
Ok, that should be documented.
4. I found in libusb, there are two ways to get speed value for a device.
One way is via sysfs, which has supported 20Gbps now. Another way is
to use ioctl USBDEVFS_GET_SPEED. This is when I found this ioctl can only
return USB_SPEED_SUPER_PLUS at most, it cannot determine current ssp rate
further, no matter Gen1x2(10Gbps), Gen2x1(10Gbps) or Gen2x2(20Gbps). So I
thought maybe it's good to provide a similar way like ioctl USBDEVFS_GET_SPEED
in order to get ssp rates.
If libusb doesn't need this ioctl, who would use it? We only add apis
that are actually going to be used.
So if libusb doesn't use it, we need a real-world user for us to be able
to add this.