From owner-freebsd-usb@freebsd.org Mon Jan 29 18:44:48 2018 Return-Path: Delivered-To: freebsd-usb@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 06CFDED75E9 for ; Mon, 29 Jan 2018 18:44:48 +0000 (UTC) (envelope-from romain@blogreen.org) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id 98C00805F5 for ; Mon, 29 Jan 2018 18:44:47 +0000 (UTC) (envelope-from romain@blogreen.org) Received: by mailman.ysv.freebsd.org (Postfix) id 57C83ED75E8; Mon, 29 Jan 2018 18:44:47 +0000 (UTC) Delivered-To: usb@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 43F76ED75E7 for ; Mon, 29 Jan 2018 18:44:47 +0000 (UTC) (envelope-from romain@blogreen.org) Received: from marvin.blogreen.org (blogreen.org [IPv6:2001:41d0:fea8:8901::2]) by mx1.freebsd.org (Postfix) with ESMTP id BD4E4805F3 for ; Mon, 29 Jan 2018 18:44:46 +0000 (UTC) (envelope-from romain@blogreen.org) Received: by marvin.blogreen.org (Postfix, from userid 1001) id 681C392E9E; Mon, 29 Jan 2018 19:44:45 +0100 (CET) Date: Mon, 29 Jan 2018 19:44:45 +0100 From: Romain =?iso-8859-1?Q?Tarti=E8re?= To: usb@freebsd.org Subject: Feedback for portable libusb code Message-ID: <20180129184445.GB7783@blogreen.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="wzJLGUyc3ArbnUjN" Content-Disposition: inline X-PGP-Key: http://romain.blogreen.org/pubkey.asc User-Agent: Mutt/1.9.2 (2017-12-15) X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Jan 2018 18:44:48 -0000 --wzJLGUyc3ArbnUjN Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hello! FreeBSD's libusb allows userland programs to access USB devices in a way similar to GNU/Linux with it's libusb. However, there are some differences between these implementations. I recently diagnosed an issue in sigrok, provided a patch, but the maintainer is having some questions and I am not sure about the best way to address them. If someone with more USB insight could give a look to this GitHub issue, that would be awesome ! Basically, the usb_get_port_path() calls libusb_open() before (and libusb_close() after) libusb_get_port_numbers() because this is required on FreeBSD: https://github.com/sigrokproject/libsigrok/blob/a9010323ddf4e479663e871386c= 05db05ea3522e/src/usb.c#L478-L491 However, calling libusb_open() twice fails=E2=80=A6 The issue is here: https://github.com/sigrokproject/libsigrok/pull/6 Thanks! Romain --=20 Romain Tarti=C3=A8re http://people.FreeBSD.org/~romai= n/ pgp: 8234 9A78 E7C0 B807 0B59 80FF BA4D 1D95 5112 336F (ID: 0x5112336F) (plain text =3Dnon-HTML=3D PGP/GPG encrypted/signed e-mail much appreciated) --wzJLGUyc3ArbnUjN Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAEBCAAdFiEEgjSaeOfAuAcLWYD/uk0dlVESM28FAlpva50ACgkQuk0dlVES M2+umgv+PCb/H76Wnkv10/hfBCBkzeJdjJ2p/7l9ku2nDwruryjonH6s1AN4l9Ee E3yXEhvhr8xMA9A9z1i/ViV5VgdQAPJk/vYgMSrZoIec1uqFfWtpnUnIVKrMz/YS y2Gf2oR52vqkw3pGIC4zerUcFRGywpyJ5aAUkbTjoM2vx0GoKxrvG/11RaIDffRn eKUzRQDUPcQZv4gS1XcebOQ57nnCwXt2Frv+Y+firBcJlbC6Jki+rjM1J41IB9r5 GUnYXW/Meut8YhHtpVYFGUxbeG0q88fGMU9qdRcn/Dj2VZ2P7/iV2ht+EC/mK36L /Niq8gR+jfS9vliOJWLS1czHtVMCDx62iZTNwsqEZrQkcpmt+l+yKPcNN+xWtt9Q pEhHaQJJuykWySUxfnDAG9wHNoxzrm0181Q1mEjODujnSGAoddDw/uBnmns8ygPB pMbFNo9QZUnMDGb2BCNJVenDj+MKpA117VzoM7xMeaJvG2I186gVRe9OX7nnPMIu u/CLQcSm =QZn+ -----END PGP SIGNATURE----- --wzJLGUyc3ArbnUjN--