The bNumDeviceCapabilities is bNumDeviceCaps when it is imported to
libusb.
For a better compatibility, we should rename the member
See: https://github.com/libusb/libusb/commit/02ebafc85d3f219842cbabaf78abc8100b6656e5
Differential D50740
libusb: fix incorrect member name in bos_descriptor aokblast on Jun 7 2025, 7:45 PM. Authored by Tags None Referenced Files
Details The bNumDeviceCapabilities is bNumDeviceCaps when it is imported to For a better compatibility, we should rename the member See: https://github.com/libusb/libusb/commit/02ebafc85d3f219842cbabaf78abc8100b6656e5
Diff Detail
Event TimelineComment Actions This is likely to bite a few ports (see, for instance, https://grep.app/search?q=bNumDeviceCapabilities) -- that's not at all a large number of candidates, but I think it's worth a note in ^/UPDATING or something (macro to alias bNumDeviceCapabilities -> bNumDeviceCaps?) Comment Actions Is it worth to use something like: #define bNumDeviceCapabilities bNumDeviceCaps I have recommend the libusb upstream to do so on https://github.com/libusb/libusb/pull/1652 Comment Actions Please use this patch https://github.com/aokblast/freebsd-src/commit/d7e07f91d6f7673aa3467526b9e10784e98f6674.patch to merge. Thanks! Comment Actions In libusb20_desc.h I see a macro LIBUSB20_BOS_DESCRIPTOR which references the old field name. I'm not really sure what that macro is doing--should that be updated as well? Comment Actions The BOS_DESCRIPTOR in libusb20 is a dedicated structure for decode in libusb20 and the definition resides inside the libusb20_desc.c. Thus there is no reference from libusb10 structure. For libusb10, we require a xfer and copy it into buffer directly. It will not be parsed by libusb20. |