Retrieving maximum buffer length supported by USB hardware?

Hi guys,
I was searching the docs regarding this but haven’t found the proper call yet. Is there a WDF function that can retrieve the maximum buffer size returned by a USB hardware?

xxxxx@gmail.com wrote:

I was searching the docs regarding this but haven’t found the proper call yet. Is there a WDF function that can retrieve the maximum buffer size returned by a USB hardware?

There is no such thing. USB devices work in terms of packets. For a
high-speed bulk pipe, as an example, everything is done 512 bytes at a
time. You can send down a request to read a megabyte, but the device is
never told that. The USB controller will just keep reading a packet at
a time until your megabyte is filled, or until the device sends a packet
shorter than the endpoint packet size.

USB bulk pipes do have the concept of a “transfer”; as long as the
device keeps sending full packets, it’s all part of the same transfer.
As soon as there is a short packet, that ends the transfer. However,
there is no limit.

Now, the USB host controller does have a limit on the size of a single
IRP. For bulk pipes in the current systems, that limit is 4 MB. But if
your device wants to send 64 MB, it can do that. Your driver would just
keep submitting 4 MB IRPs one at a time; the host controller driver will
chop those into 8,000 512-byte packets and read them from the device.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

Thanks for the info Tim! It seems like we have to prepare to slice any data the device gives us if it exceeds the maximum buffer size given by the user-app.