On Wed, 19 Jul 2006, Kris van Rens wrote:

> Hi Alan,
> 
> I have solved the error now, the firmware is now downloaded as it should.
> 
> It seems that 'usb_control_msg' cannot handle statically allocated
> arrays and a buffer is needed. I solved the issue by:
> 
> ---------------------------------------
> __u8 dBuffer[MAX_INTEL_HEX_RECORD_LENGTH];
> memcpy( dBuffer,
>                firmware->Data,
>                firmware->Length );
> 
> ret = usb_control_msg( udev,
>            usb_sndctrlpipe(udev, 0),
>            INTERNAL_RAM_ADDR, USB_TYPE_VENDOR | USB_DIR_OUT | 
> USB_RECIP_DEVICE,
>            firmware->Address,
>            0,
>            dBuffer,
>            firmware->Length,
>            10*HZ );
> -----------------------------------

Ah yes, that would do it.  In fact, the correct approach is to make 
dBuffer dynamic, not stack-based.  That is, you should use kmalloc() to 
allocate the buffer space.

You've got another mistake in the last argument.  The timeout value should 
be specified in milliseconds, not in jiffies.

> Anyway thanks for your attention!

You're welcome.

Alan Stern


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Linux-usb-users@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-users

Reply via email to