A Transfer Descriptor (TD) is a system memory data structure that is used by the Host Controller to define a buffer of data that will be moved to or from an endpoint. TDs come in two types: general and isochronous. The General TD is used for Interrupt, Control, and Bulk Endpoints and an Isochronous TD is used to deal with the unique requirements of isochronous transfers. Two TD types are supported because the nature of isochronous transfers does not lend itself to the standard DMA buffer format and the packetizing of the buffer required for isochronous transfers is too restrictive for general transfer types.
上文:
传输描述符(TD)是主机控制器(HC)使用的系统内存数据结构,用于定义将要传输至端点或从端点接收的数据缓冲区。TD分为两种类型:通用型和等时型。通用TD用于中断、控制和批量端点,而等时TD用于满足等时传输的特殊需求。支持两种TD类型的原因是等时传输的特性不适用于标准DMA缓冲区格式,且等时传输所需的缓冲区分组限制对通用传输类型过于严格。
Both the General TD and the Isochronous TD provide a means of specifying a buffer that is from 0 to 8,192 bytes long. Additionally, the data buffer described in a single TD can span up to two physically disjoint pages. Although the scatter/gather capabilities of a single TD are limited, it eliminates most of the problems associated with forcing buffers to be physically contiguous including the possibility of superfluous data movements.
上文:
通用TD和等时TD均支持定义长度为0至8,192字节的缓冲区。此外,单个TD描述的数据缓冲区最多可跨越两个物理不连续的页面。尽管单个TD的分散/聚集能力有限,但它消除了强制缓冲区物理连续带来的多数问题(包括不必要的数据移动风险)。
Transfer Descriptors are linked to queues attached to EDs. The ED provides the endpoint address to/from which the TD data is to be transferred. The Host Controller Driver adds to the queue and the Host Controller removes from the queue. When the Host Controller removes a TD from a queue, it links the TD to the Done Queue. When a TD is unlinked from the ED and linked to the Done Queue, it is said to be ‘retired’. A TD may be retired due to normal completion or because of an error condition. When the TD is retired, a condition code value is written in the TD which allows the Host Controller Driver to determine the reason it was retired.
上文:
传输描述符通过队列链接到端点描述符(ED)。ED提供TD数据传输的端点地址。主机控制器驱动程序(HCD)负责向队列添加TD,主机控制器(HC)则从队列中移除TD。当主机控制器从队列中移除TD时,会将其链接至完成队列(Done Queue)。当TD从ED解链并链接到完成队列时,称为“退休”(retired)。TD可能因正常完成或错误条件而退休。退休时,TD中会写入条件码(condition code),供HCD判断退休原因。
Details of TD processing are dependent on the type of TD and are discussed in Sections 4.3.1 through 4.3.3.1.
上文:
TD处理的具体细节取决于其类型,详见第4.3.1至4.3.3.1节。