A Transfer Type for Every Purpose
69
trol transfers should be reserved as much as possible for servicing the standard
USB requests and performing other infrequent configuration tasks. This
approach helps ensure that the transfers complete quickly by keeping the
reserved bandwidth as open as possible. But the USB specifications don’t forbid
other uses for control transfers, and some see no problem in using control trans-
fers for any purpose. Low-speed devices have no other option except periodic
interrupt transfers that can waste bandwidth if data transfers are infrequent.
Control transfers aren’t the most efficient way to transfer data. Each transfer has
significant overhead. At low speed, a single control transfer with 8 data bytes
uses over 1/3 of a frame’s bandwidth, though the transfer’s individual transac-
tions may travel in multiple frames. In a control transfer with multiple data
packets in the Data stage, the data may travel in the same or different
(micro)frames or bus intervals. On a busy bus, all control transfers may have to
share the reserved portion of the bandwidth.
The USB specifications define timing limits that apply to control requests
unless a class requires a faster response. Where stricter timing isn’t specified, in a
transfer where the host requests data from the device, a device may delay as long
as 500 ms before making the data available to the host. To find out if data is
available, a USB 2.0 host sends a token packet to request the data. If the data is
ready, the device returns the data in that transaction’s data packet. Otherwise
the device returns NAK to advise the host to retry later. The host keeps trying
at intervals for up to 500 ms. SuperSpeed devices can delay communications by
setting NumP = 0 and Sequence Number = 0 in response to a Setup Data
Packet or by sending NRDY in response to requested or received data. In a
transfer where the host sends data to the device, if the host sends the data at the
maximum rate the device can accept the data, a USB 2.0 device can take up to
5 seconds to accept all of the data and complete the Status stage (though once
begun, the Status stage must complete within 50 ms). USB 3.0 devices must
complete each transaction within 50 ms. Additional delays by the host extend
the allowed time. In a transfer with no Data stage, the device must complete the
request and the Status stage within 50 ms. The host and its drivers aren’t
required to enforce the limits, but all devices should comply with the limits to
ensure proper operation with any host. For the hub class, USB 2.0 and USB 3.0
recommend average response times of under 5 ms.
&GVGEVKPICPF*CPFNKPI'TTQTU
If a USB 2.0 device doesn’t return an expected handshake packet during a con-
trol transfer, the host retries. On receiving no response after a (typical) total of