On Fri, Nov 15, 2002 at 02:46:57PM -0800, shino korah wrote:
> Hi
> 
>    I'm writing a driver based on usb-skelton.c.This is
> my problem
> 
>   I need to read/write chunks of data, but in the
> skel_write() function(usb-skelton.c) the maximum data
> I can read/write is 512.What is teh best way to add
> this feature?
> 
> 1. split data as 512 chunks inside this function and
> loop it until I read/write all the data?
> Is there a function which I can use for this?

There are lots of example drivers that do this in the kernel tree.

> 1.5 Do I need to add an array of struct urbs for this?
> because I was getting -EINPROGRESS error so I ahd to
> put mdelay to make it work.

Did you use the BULK_QUEUE flag that lets you submit more than one urb
at the same time?

> 2. Which will be better usb_bulk_msg() or
> FILL_BULK_URB and the usb_submit_urb()? for
> read/writing

Depends on what you want to do.  Why not just submit one really big urb
and let the USB core split it up into smaller pieces?

And why not just send a small bit at a time, and let userspace handle
the fact that everything wasn't written yet?  That's the simplest way of
doing this.

What kind of USB driver are you writing?  For what kind of device?

thanks,

greg k-h


-------------------------------------------------------
This sf.net email is sponsored by: To learn the basics of securing 
your web site with SSL, click here to get a FREE TRIAL of a Thawte 
Server Certificate: http://www.gothawte.com/rd524.html
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to