On Mon, 23 May 2005, Henk wrote:

> Hi,
> 
> I am wondering if something obvouis is staring me in the face, may be
> someone on the list can point me in the right direction...
> 
> I am tring to migrate some working test code, using libusb, to a kernel 
> module.
> However the kernel variants seem to crash at the synchronous
> usb_control_msg call, whereas the userspace variants seem to be working:
> 
>   /* userspace variant (libusb wrapper) */
>   err = usb_control_msg(dev_h,
>               USB_MSG_OUT,    /* requesttype  = (1 << 5) | 1 */
>               0x9,            /* request */
>               0x200,          /* value */
>               0x03,           /* index */ 
>               CMD[URB_INIT],URB_LENGTH,       /* init string 16 bytes long*/
>               TIME_OUT);                      /* timeout = 1600 */
> 
> 
> The variant in the kernel module will crash with something like:
>       ... host controller process error. something bad
>       ... host controller halted. very bad 
> 
>   /* KERNEL variant */
>   err = usb_control_msg(chip->udev, usb_sndctrlpipe(chip->udev, 0),
>       0x9,                            /* request */
>       (1 << 5) | 1,                   /* requesttype */
>       USB_TYPE_CLASS | USB_RECIP_INTERFACE | USB_DIR_OUT,
>       0x200,                          /* value */
>       0x03,                           /* index */ 
>       CMD[URB_INIT],URB_LENGTH,       /* init string 16 bytes long*/
>       HZ);                            /* timeout = 1600 */
> 
> 
> I am in the "probe" phase and not within interrupt context, can someone
> see what I am doing wrong here?

You're giving the requesttype argument twice.

Also your comment about the length of the timeout is wrong.

Alan Stern



-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to