Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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?

Thanks!

share|improve this question
add comment

1 Answer 1

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.

share|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
    
I see. That's interesting, thanks. –  Faheem Mitha Jan 13 '12 at 20:02
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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