Page MenuHomeFreeBSD

libusb: implement libusb_wrap_sys_device
ClosedPublic

Authored by aokblast on Aug 5 2025, 1:18 PM.
Tags
None
Referenced Files
F166976051: D51739.id159766.diff
Tue, Aug 18, 7:59 AM
F166925789: D51739.id159766.diff
Mon, Aug 17, 7:48 PM
Unknown Object (File)
Wed, Aug 12, 3:31 PM
Unknown Object (File)
Tue, Aug 11, 7:22 AM
Unknown Object (File)
Tue, Aug 11, 6:35 AM
Unknown Object (File)
Mon, Aug 10, 11:38 PM
Unknown Object (File)
Mon, Aug 10, 9:50 PM
Unknown Object (File)
Sun, Aug 9, 2:33 PM
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 Passed
Unit
No Test Coverage
Build Status
Buildable 65972
Build 62855: arc lint + arc unit

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.