Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 27 Jul 2020 22:34:34 +0200
From:      Adriaan de Groot <adridg@freebsd.org>
To:        freebsd-ports@freebsd.org
Subject:   libusb & API versions
Message-ID:  <2124799.5gTYqTD1LS@beastie.bionicmutton.org>

next in thread | raw e-mail | index | archive | help
--nextPart1786419.CJpZife00y
Content-Transfer-Encoding: 7Bit
Content-Type: text/plain; charset="utf-8"

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]
--nextPart1786419.CJpZife00y
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: This is a digitally signed message part.
Content-Transfer-Encoding: 7Bit

-----BEGIN PGP SIGNATURE-----

iQGzBAABCAAdFiEEhrjttu2OP5apuuy1z93JbxKxkVwFAl8fOloACgkQz93JbxKx
kVyhhQv9EBQkizj9s9icUEseQxkcTBHmu2ft04ciwVvD/RVLwuBlu4K/FBdMi7KK
5yCXWNxdMWjoCNyZYuUzXQ/G5Dr8mGCvdocwF4EQjS2Nanp8ZNEjWpWPlhl57J1f
Y/eBUo6h1dI6jkhXNxPJZhCgxp4DVAcDx7i9IYnm2gxG9Jn2+mBi0HmTrGUAOgDL
vKmzXx9aL8vvyGfvsivfxwZLZ5zw3Vjf51cwgyY5E9d1PGJCczGKT/7PMhaP56uy
sWbHvllMLNCJSXGFNNmcFZ2gWt5/WpLioCROUX7aKG7Evxo4Bb00KN3AnT/PoTy7
YTrsHCRyObmC+bQ0MngeV8mAD09YFsxyw9pic+8P/ivRUiKWT3g57sr6N8Loyg+B
6+5U3qvPNGjPKDxoWy6ckyDWWMkEpZtzAeln9dVPgRRQuvKf3GCKsBBJgy9j7+rs
tdYoe4N6R9D2gCYtUHfQ2XRhAClxmes6pSwsWD10fJm7xNARixKaWLeGErWIYRoT
FGECXGI1
=A2Sv
-----END PGP SIGNATURE-----

--nextPart1786419.CJpZife00y--






Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?2124799.5gTYqTD1LS>