libusb & API versions

Adriaan de Groot adridg at freebsd.org
Mon Jul 27 20:34:37 UTC 2020


I'm wondering about libusb, because the libusb in base is missing a bunch of 
"current" API, and the API version number doesn't match Linux (upstream?) idea 
of what was available in historical versions.

tl;dr: would a libusb port make any sense? Is updating libusb in base 
feasible?

Background:
 - KDE Plasma currently displays nothing useful in the System Information 
panel about USB devices. This is because it reads data from files in /sys .. 
and doesn't expect to find the source code of the operating system there.
 - Switching to libusb is an obvious improvement: libusb supports a dozen 
OS'es, with backends for NetBSD, OpenBSD, Solaris .. and not FreeBSD, for 
whatever reason, but we have our own libusb in base anyway.
 - *Current* upstream libusb has at least these two things that original 
version 1.0 libusb from 2010 or so didn't have:
   - libusb_device *libusb_get_parent(libusb_device *)
   - LIBUSB_SPEED_SUPER_PLUS
 - Our libusb.h defines an API version #define LIBUSB_API_VERSION 0x01000102
 - libusb upstream introduced libusb_get_parent in v1.0.12
 - libusb upstream introduced LIBUSBX_API_VERSION in v1.0.13, as 0x01000100
 - much later LIBUSBX_API_VERSION was renamed LIBUSB_API_VERSION

But it comes down to this: the API_VERSIONs don't match up with the available 
functionality; libusb 2.0 was though-about in 2012 or so, but never gained any 
traction. Our libusb has things for the apparently abandoned 2.0 API, but 
nothing for the continued evolution of the 1.0 API.

Any recommendations? I'd like to avoid patches upstream, but if things need to 
be rewritten to match our libusb, so be it.

[ade]
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.freebsd.org/pipermail/freebsd-ports/attachments/20200727/8046bde1/attachment.sig>


More information about the freebsd-ports mailing list