On Thu, 10 Feb 2005, Joaquin Durand Gomez wrote:

> Can the size of a bulk transfer buffer be grater than the max packet 
> size for the endpoint?

Yes.

> Consider the following:
> 
> current_device->read_urb = usb_alloc_urb(0, mem_flags);
> usb_fill_bulk_urb(current_device->read_urb,
>     current_device->usb_device,
>     usb_rcvbulkpipe(current_device->usb_device, 
> current_device->read_end_point),
>     current_device->read_buffer,
>     READ_BUFFER_SIZE,
>     read_callback,
>     current_device);
> usb_submit_urb(current_device->read_urb, GFP_KERNEL);
> 
> Where in my case READ_BUFFER_SIZE is 4096.
> The data that I'm expecting to receive from the device varies from 8 
> bytes up to almost 4K. In my experience the transfer_buffer in the 
> read_callback() function actually has the amount of data expected. I'm 
> just wondering if doing this causes memory problems for not honoring 
> the max packet size for my endpoint.

No, it won't cause problems.

Alan Stern



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to