linux_usbfs: Gracefully handle buggy devices with a configuration 0
authorChris Dickens <christopher.a.dickens@gmail.com>
Mon, 8 Feb 2021 19:56:13 +0000 (11:56 -0800)
committerChris Dickens <christopher.a.dickens@gmail.com>
Mon, 8 Feb 2021 19:56:13 +0000 (11:56 -0800)
commitf38f09da98acc63966b65b72029b1f7f81166bef
tree34589346dee68d2b95d78b590333a9a6fdf4d58d
parentc486d01297a366aae8dcd3f715d0bfd8b995949b
linux_usbfs: Gracefully handle buggy devices with a configuration 0

The USB spec states that a configuration value of 0 is reserved and is
used to indicate the device in not configured (e.g. is in the address
state). Unfortunately some devices do exist that violate this and use 0
as the bConfigurationValue of the configuration descriptor.

Improve how the Linux backend handles such non-conformant devices by
adding special handling around the configuration value 0. Most devices
will not require this special handling, but for those that do there is
no way to distinguish between the device being unconfigured and using
configuration 0.

Closes #850

Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
libusb/os/linux_usbfs.c
libusb/version_nano.h