Re: max data transfer over bulk In endpoint

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jul 23, 2010 at 05:51:20PM +0530, Shivdas Gujare wrote:
> Hi all,
> 
> I am currently trying to implement a vendor specific gadget driver(
> bInterfaceClass = 0xFF, enumerating as bulk In/Out device), Basic task
> of this driver is to send around 500K Bytes of data over bulk In
> endpoint.
> Since, it enumerates as vendor specific device, I have wrote a small
> libusb application on Linux Host side which can talk to my gadget
> driver.
> 
> So, currently I am designing how many bytes can be transfered over
> bulk In endpoint in one attempt.(I understand, wMaxPacketSize for bulk
> In endpoint is 512 bytes). I tried to investigate using Pendrive, and
> it shows following output for usbmon,
> 
> ffff880090667cc0 3741341493 S Bi:2:028:2 -115 32768 <
> ffff880090667cc0 3741343608 C Bi:2:028:2 0 32768 = d6672e3f d3fc537e
> 3d2cc447 c0315740 8d1affdc 34984099 81fbbb67 15b40c4f
> 
> which indicates as it has transfered 32KBytes of data in one attempt.
> 
> So, I would like to know how & who does takes care of 512 byte
> fragmentation for this bulkIn endpoint, and Do I need to loop
> (500K/512) number of times in gadget driver for transferring whole
> 500K data onto bulk In endpoint with wMaxPacketSize=512 ?

The host controller driver does this fragmentation, and you don't have
to loop to get it done yourself.

Just send a big buffer and watch the data flow :)

> more specifically, how should I decide, what should be the value of
> "size" in following implementation.
> req->length = size;
> ret = usb_ep_queue(dev->ep_in, req, GFP_ATOMIC);

It should be bigger than the endpoint.  It depends on your device as to
how big to make it to get the best speed.  Try different values to see
for yourself.

hope this helps,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux