From owner-freebsd-usb@freebsd.org Sun Feb 11 20:05:40 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 39048F1371B for ; Sun, 11 Feb 2018 20:05:40 +0000 (UTC) (envelope-from hps@selasky.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 CC44C6882D for ; Sun, 11 Feb 2018 20:05:39 +0000 (UTC) (envelope-from hps@selasky.org) Received: by mailman.ysv.freebsd.org (Postfix) id 8CEE8F13706; Sun, 11 Feb 2018 20:05:39 +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 7AC27F13701 for ; Sun, 11 Feb 2018 20:05:39 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [IPv6:2a01:4f8:c17:6c4b::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1CFCD6882B for ; Sun, 11 Feb 2018 20:05:39 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [62.141.128.70]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id DDFB72600EC; Sun, 11 Feb 2018 21:05:32 +0100 (CET) Subject: Re: Feedback for portable libusb code To: =?UTF-8?Q?Romain_Tarti=c3=a8re?= Cc: usb@freebsd.org References: <20180129184445.GB7783@blogreen.org> <9128056d-c916-597e-f866-48cf6051ee0e@selasky.org> <20180205153559.GA19249@blogreen.org> From: Hans Petter Selasky Message-ID: Date: Sun, 11 Feb 2018 21:02:36 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: <20180205153559.GA19249@blogreen.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit 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: Sun, 11 Feb 2018 20:05:40 -0000 On 02/05/18 16:35, Romain Tartière wrote: > Hi! > > On Mon, Jan 29, 2018 at 08:10:06PM +0100, Hans Petter Selasky wrote: >> Does the attached patch for FreeBSD's libusb solve your issue? > > I have just patched, build and installed libusb. I removed the > libusb_open() / libusb_close() calls from usb_get_port_path() in > libsigrok and tested. > https://github.com/sigrokproject/libsigrok/blob/a9010323ddf4e479663e871386c05db05ea3522e/src/usb.c#L473-L491 > > > Unfortunately, the problem is still present. On the first enumeration, > libusb_get_port_numbers() returns 3 and the firmware is send to the > device successfully. Then, when lbsigrok attempt to re-enumerate > devices, libusb_get_port_numbers() returns -12 > (LIBUSB_ERROR_NOT_SUPPORTED). > > > > I am sure that the firmware is sent successfully because usbconfig(8) > shows the following when I plug the device: > | ugen0.10: at usbus0, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON (100mA) > and after the enumeration failure, I can see this instead: > | ugen0.10: at usbus0, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON (100mA) > Can you run "ldd" on your binaries to see they really are using the libusb you installed? --HPS