Failing controls transfers in VMware

Hans Petter Selasky hselasky at c2i.net
Wed Jul 1 19:08:18 UTC 2009


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 at 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



More information about the freebsd-usb mailing list