Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 01 Jul 2009 20:31:41 +0200
From:      Markus Dolze <bsdfan@nurfuerspam.de>
To:        Hans Petter Selasky <hselasky@c2i.net>
Cc:        freebsd-usb@freebsd.org
Subject:   Re: Failing controls transfers in VMware
Message-ID:  <4A4BAB8D.9000502@nurfuerspam.de>
In-Reply-To: <200907010913.08747.hselasky@c2i.net>
References:  <4A4A5D7E.70708@nurfuerspam.de> <4A4A7183.2060700@nurfuerspam.de> <200907010913.08747.hselasky@c2i.net>

next in thread | previous in thread | raw e-mail | index | archive | help
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.

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

Thanks,
Markus



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