Page MenuHomeFreeBSD

libusb: don't treat EINVAL from USB_FS_COMPLETE as device detach
ClosedPublic

Authored by aokblast on Thu, Jun 11, 3:00 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Jul 8, 5:47 AM
Unknown Object (File)
Mon, Jul 6, 11:50 AM
Unknown Object (File)
Mon, Jul 6, 4:02 AM
Unknown Object (File)
Mon, Jul 6, 12:54 AM
Unknown Object (File)
Sun, Jul 5, 10:07 PM
Unknown Object (File)
Sun, Jul 5, 6:09 PM
Unknown Object (File)
Sun, Jul 5, 4:46 AM
Unknown Object (File)
Fri, Jul 3, 3:23 AM
Subscribers

Details

Summary

ugen20_process() treats any non-EBUSY errno returned by USB_FS_COMPLETE
as device detach and returns LIBUSB20_ERROR_OTHER. This causes libusb10
to set device_is_gone and fail all subsequent transfer with
LIBUSB_ERROR_NO_DEVICE.

However, USB_FS_COMPLETE can also return EINVAL when a completion
references an endpoint that no longer exists, for example after
SET_INTERFACE or SET_CONFIG removes and recreates endpoints. This is a
transient condition and does not indicate device detach.

Treat EINVAL the same as EBUSY and stop draining completions. This
prevents a guest selecting an isochronous streaming altsetting from
permanently breaking the passed-through device.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable