As far as I'm aware, USB endpoints that use isochronous transfers have a 'wMaxPacketSize' parameter associated with them that is used by the kernel to guarantee a certain amount of bandwidth for the endpoint.

If I'm not mistaken, this maximum packet size can range anywhere between 0 to 1024 bytes (for high speed transfers). How does this parameter translate into bandwidth allocation in terms of Mbps of a high speed (EHCI) controller in a Linux system?

What other factors, if any, does USB bandwidth allocation depend on?



After some research, I can now answer my own question. The maximum isochronous packet size for high speed devices is 1024 bytes. There can be up to three packets per microframe, and a microframe is 125 microseconds wide, meaning that there can be 8 microframes transferred per millisecond.

This gives us a maximum bandwidth allocation of 3*1024*8*1000 = 23.438 MB/s (edit: used to say mbps)

The wMaxPacketSize parameter is a two byte value which contains a bit mapping of both the maximum size per packet and number of packets per microframe is stored.

Thus the bandwidth allocation is as follows:

(packets/microframe) * (max_packet_size) * (8 microframes/millisecond) * (1000ms/s)

It's also important to note that per USB 2.0 spec, only 80% of the total amount of bandwidth can be allocated to periodic transfers such as isochronous and interrupt transfers.

| improve this answer | |
  • So, where is the wMaxPacketSize value set? – Faheem Mitha Jan 13 '12 at 9:02
  • The value is set by the device itself in the device's hierarchy of descriptors. See Here > All USB devices have a hierarchy of descriptors which describe to the host information such as what the device is, who makes it, what version of USB it supports, how many ways it can be configured, the number of endpoints and their types etc. – bsirang Jan 13 '12 at 18:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.