opnsense-src/lib/libusb
Baptiste Daroussin f35cb87a56 libusb: dequeue next transfer on completion to prevent stalls
The transfer proxy callbacks (bulk/interrupt, control, isochronous)
only called libusb10_submit_transfer_sub() in the START path to
pipeline the second kernel transfer slot. On completion or error,
no attempt was made to dequeue the next pending transfer from
tr_head onto the now-free slot.

When more than two async transfers were submitted on the same
endpoint, the third (and subsequent) transfers would remain stuck
on tr_head indefinitely, since no completion ever triggered their
submission. This caused a protocol-level deadlock in applications
like adb that submit header + payload + zero-length terminator as
three separate bulk transfers in sequence.

Fix by calling libusb10_submit_transfer_sub() after every
libusb10_complete_transfer() in all three proxy callbacks.

MFC After:	2 weeks
Reviewed by:	adrian
Differential Revision:	https://reviews.freebsd.org/D55289

(cherry picked from commit 38c18332642500fdfe075a82f88e033f6673a53f)
2026-03-02 13:49:22 +01:00
..
libusb-0.1.pc.in Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
libusb-1.0.pc.in libusb: claim to be version 1.0.16 2024-06-28 12:18:34 -04:00
libusb-2.0.pc.in Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
libusb.3 libusb: implement libusb_get_platform_descriptor 2025-08-06 10:05:40 -04:00
libusb.h libusb: implement libusb_get_platform_descriptor 2025-08-06 10:05:40 -04:00
libusb01.c libusb: add SUPER_PLUS in speed enum. 2025-05-15 20:30:32 +02:00
libusb10.c libusb: dequeue next transfer on completion to prevent stalls 2026-03-02 13:49:22 +01:00
libusb10.h libusb: implement libusb_setlocale to support different locale of error message 2025-07-11 00:15:30 -04:00
libusb10_desc.c libusb: implement libusb_get_platform_descriptor 2025-08-06 10:05:40 -04:00
libusb10_hotplug.c libusb: make libusb_hotplug_get_user_data actually return user_data 2026-02-19 10:13:19 +01:00
libusb10_io.c libusb: implement libusb_pollfds_handle_timeouts 2025-08-06 10:05:40 -04:00
libusb20.3 libusb: add SUPER_PLUS in speed enum. 2025-05-15 20:30:32 +02:00
libusb20.c Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:29 -06:00
libusb20.h libusb: add SUPER_PLUS in speed enum. 2025-05-15 20:30:32 +02:00
libusb20_desc.c Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:29 -06:00
libusb20_desc.h libusb: rename bNumDeviceCapabilities to bNumDeviceCaps for compatibility with libusb 2025-07-08 11:11:41 -04:00
libusb20_int.h Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:29 -06:00
libusb20_ugen20.c Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:29 -06:00
libusb_global_linux.h Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:29 -06:00
Makefile Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
Makefile.depend Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
usb.h Remove $FreeBSD$: one-line .c comment pattern 2023-08-16 11:54:29 -06:00