From owner-freebsd-usb@FreeBSD.ORG Wed Jul 1 19:08:17 2009 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B1BB91065673 for ; Wed, 1 Jul 2009 19:08:17 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe09.swip.net [212.247.155.1]) by mx1.freebsd.org (Postfix) with ESMTP id 42B468FC23 for ; Wed, 1 Jul 2009 19:08:17 +0000 (UTC) (envelope-from hselasky@c2i.net) X-Cloudmark-Score: 0.000000 [] X-Cloudmark-Analysis: v=1.0 c=1 a=kHiLD6Pb4HYA:10 a=MXw7gxVQKqGXY79tIT8aFQ==:17 a=ZpyUl-9OMg4V-Xq-HS8A:9 a=kwPVBIDVjR4EFKwxmY4A:7 a=5ENWLNFQZprS79Be7GT7GryFgbkA:4 a=bvicLqxvdINj6Xfm:21 a=-eUaa8lvHVCfQbgE:21 Received: from [62.113.132.61] (account mc467741@c2i.net HELO laptop.adsl.tele2.no) by mailfe09.swip.net (CommuniGate Pro SMTP 5.2.13) with ESMTPA id 924938892; Wed, 01 Jul 2009 21:08:16 +0200 From: Hans Petter Selasky To: Markus Dolze Date: Wed, 1 Jul 2009 21:07:47 +0200 User-Agent: KMail/1.11.4 (FreeBSD/8.0-CURRENT; KDE/4.2.4; i386; ; ) References: <4A4A5D7E.70708@nurfuerspam.de> <200907010913.08747.hselasky@c2i.net> <4A4BAB8D.9000502@nurfuerspam.de> In-Reply-To: <4A4BAB8D.9000502@nurfuerspam.de> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200907012107.48635.hselasky@c2i.net> Cc: freebsd-usb@freebsd.org Subject: Re: Failing controls transfers in VMware X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Jul 2009 19:08:18 -0000 On Wednesday 01 July 2009 20:31:41 Markus Dolze wrote: > Hans Petter Selasky wrote: > > On Tuesday 30 June 2009 22:11:47 Markus Dolze wrote: > >> Markus Dolze wrote: > >>> To repeat run the attached program: > >>> > >>> 1. Fill in some vendor / product ID of a device detected as ugen > >>> device 2. Compile and run the code (devel/libusb must be installed). > > > > You should use this function when reading strings: > > > > int usb_get_string_simple(usb_dev_handle * dev, int index, char *buf, > > size_t buflen); > > Yes, this is more easy, but I crafted the control transfers myself to > show that actually the control transfer is failing. Sometimes you have to pass the exact length of the string, and not the maximum length when doing the control request. > > Libusb's usb_get_string_simple internally uses to control transfers to > read a string. The first one to get a list of supported languages and > the second one to actually retrieve the string. I found that the second > control transfer always errors out. > > If I replace the usb_control_msg() in my test program with > usb_get_string_simple() I get: > > root@freebsd7:./test > Found AVR-USB device > USB_control_msg result: -5 > Warning: cannot query manufacturer for device: error sending control > message: Input/output error > USB_control_msg result: -5 > Warning: cannot query product: error sending control message: > Input/output error usbconfig is using the same function to dump the device string. Strange you get different results. --HPS