Date: Wed, 1 Jul 2009 21:07:47 +0200 From: Hans Petter Selasky <hselasky@c2i.net> To: Markus Dolze <bsdfan@nurfuerspam.de> Cc: freebsd-usb@freebsd.org Subject: Re: Failing controls transfers in VMware Message-ID: <200907012107.48635.hselasky@c2i.net> In-Reply-To: <4A4BAB8D.9000502@nurfuerspam.de> References: <4A4A5D7E.70708@nurfuerspam.de> <200907010913.08747.hselasky@c2i.net> <4A4BAB8D.9000502@nurfuerspam.de>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200907012107.48635.hselasky>