Page MenuHomeFreeBSD

libusb: implement libusb_wrap_sys_device
ClosedPublic

Authored by aokblast on Aug 5 2025, 1:18 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Oct 13, 11:43 PM
Unknown Object (File)
Mon, Oct 13, 11:43 PM
Unknown Object (File)
Mon, Oct 13, 11:42 PM
Unknown Object (File)
Mon, Oct 13, 11:42 PM
Unknown Object (File)
Mon, Oct 13, 10:14 AM
Unknown Object (File)
Fri, Oct 10, 10:36 PM
Unknown Object (File)
Thu, Oct 9, 7:23 PM
Unknown Object (File)
Tue, Sep 16, 8:21 AM
Subscribers

Details

Summary

The libusb_wrap_sys_device function can wrap an opened fd from the
system into a libusb handler. However, in FreeBSD's libusb implementation, a
USB device contains two fds: one for control transfers and another for
normal (bulk, interrupt, isochronous) transfers.

This design makes it impossible for FreeBSD to implement this function
without exposing a different structure in libusb.h to provide two fds.
Therefore, we return LIBUSB_ERROR_NOT_SUPPORTED to maintain API
compatibility.

Sponsored By: The FreeBSD Foundation.

Diff Detail

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

Event Timeline

lib/libusb/libusb.3
215
lib/libusb/libusb10.c
1922

Extra newline.

This revision is now accepted and ready to land.Aug 5 2025, 1:36 PM
lwhsu added inline comments.
lib/libusb/libusb.3
213
This revision was automatically updated to reflect the committed changes.