4.2 Endpoint Descriptor
An Endpoint Descriptor (ED) is a 16-byte, memory resident structure that must be aligned to a 16-byte boundary. The Host Controller traverses lists of EDs and if there are TDs linked to an ED, the Host Controller performs the indicated transfer.
4.2.1 Endpoint Descriptor Format

Notes:
1. Fields containing '—' are not interpreted or modified by the Host Controller and are available
for use by the Host Controller Driver for any purpose.
2. Fields containing '0' must be written to 0 by the Host Controller Driver before queued for
Host Controller processing. If Host Controller has write access to the field, it will always
write the field to 0.
4.2.2 Endpoint Descriptor Field Definitions

Field Definitions for Endpoint Descriptor
Name HC
Access
Description
FA R FunctionAddress(7Bits,USB地址)
This is the USB address of the function containing the endpoint that this
ED controls.
EN R EndpointNumber(4Bits,端点号)
This is the USB address of the endpoint within the function.
D R Direction(方向:IN/OUT)
This 2-bit field indicates the direction of data flow (IN or OUT.) If
neither IN nor OUT is specified, then the direction is determined from the
PID field of the TD.
The encoding of the bits of this field are:
00 :Get direction From TD
01 :OUT
10 :IN
11 :Get direction From TD
S R Speed(速率:全速/低速)
Indicates the speed of the endpoint: full-speed (S = 0) or low-speed (S =
1.)
K R sKip
When this bit is set, the HC continues on to the next ED on the list
without attempting access to the TD queue or issuing any USB token for the
endpoint.
F R

Format(链到ED中的TD格式)
This bit indicates the format of the TDs linked to this ED. If this is a
Control, Bulk, or Interrupt Endpoint, then F = 0, indicating that the General
TD format is used.

If this is an Isochronous Endpoint, then F = 1, indicating that the Isochronous
TD format is used.

MPS R MaximumPacketSize(最大Packet的大小)
This field indicates the maximum number of bytes that can be sent to or
received from the endpoint in a single data packet.
TailP R TDQueueTailPointer
If TailP and HeadP are the same, then the list contains no TD that the HC
can process.
If TailP and HeadP are different, then the list contains a TD to be
processed.
H R/W Halted
This bit is set by the HC to indicate that processing of the TD queue on
the endpoint is halted, usually due to an error in processing a TD.
C R/W toggleCarry
This bit is the data toggle carry bit. Whenever a TD is retired, this bit
is written to contain the last data toggle value (LSb of data Toggle field)
from the retired TD.
This field is not used for Isochronous Endpoints.
HeadP R/W TDQueueHeadPointer
Points to the next TD to be processed for this endpoint.
NextED R NextED
If nonzero, then this entry points to the next ED on the list.

4.2.3 Endpoint Descriptor Description
Endpoint Descriptors (ED) are linked in lists that are processed by the HC. An ED is linked to a next ED when the NextED field is nonzero.

When the Host Controller accesses an ED, it checks the sKip and the Halted bits to determine if any further processing of the ED is allowed. If either bit is set, then the Host Controller advances to the next ED on the list. If neither the sKip nor the Halted bit is set, then the Host Controller compares HeadP to TailP. If they are not the same, then the TD pointed to by HeadP defines a buffer to/from which the Host Controller will transfer a data packet.

This linking convention assumes that the Host Controller Driver queues to the 'tail' of the TD queue. It does this by linking a new TD to the TD pointed to by TailP and then updating TailP to point to the TD just added.
When processing of a TD is complete, the Host Controller 'retires' the TD by unlinking it from the ED and linking it to the Done Queue. When a TD is unlinked, NextTD of the TD is copied to HeadP of the ED.

The sKip bit is set and cleared by the Host Controller Driver when it wants the Host Controller to skip processing of the endpoint. This may be necessary when the Host Controller Driver must modify the value of HeadP and the overhead of removing the ED from its list is prohibitive.

The Halted bit is set by the Host Controller when it encounters an error in processing a TD. When the TD in error is moved to the Done Queue, the Host Controller updates HeadP and sets the Halted bit, causing the Host Controller to skip the ED until Halted is cleared. The Host Controller Driver clears the Halted bit when the error condition has been corrected and transfers to/from the endpoint should resume. The Host Controller Driver should not write to HeadP/toggleCarry/Halted unless Halted is set, sKip is set, or the ED has been removed from the list.

When TDs are queued to an ED, the Host Controller processes the TDs asynchronously with respect to processing by the host processor. Therefore, if the Host Controller Driver needs to alter the TD queue other than appending to the queue, it must stop the Host Controller from processing the TD queue for the endpoint so that changes can be made. The nominal mechanisms for stopping TD processing are for the Host Controller Driver to remove the ED from the list or to set the sKip bit in the ED.

When the D field of an ED is 10b (IN), the Host Controller may issue an IN token to the specified endpoint after it determines that HeadP and TailP are not the same. This indicates that a buffer exists for the data and that input of the endpoint data may occur in parallel with the HC's access of the TD which defines the memory buffer.

Since an ED must be aligned to a 16-byte boundary, the Host Controller only uses the upper 28 bits of Dword3 as a pointer to the next ED. TailP and HeadP point to TDs which may be either 16- or 32-byte aligned. The Host Controller uses only the upper 28 bits of Dword1 and Dword2 to point to a 16-byte aligned TD (F = 0). If HeadP and TailP point to a TD that must be 32-byte aligned (F = 1), then bit 4 of these Dwords must be 0.

OpenHCI - 4.2 Endpoint Descriptor的更多相关文章

  1. OpenHCI - Open Host Controller Operational Registers

    The Host Controller (HC) contains a set of on-chip operational registers which are mapped into a non ...

  2. USB组合设备 Interface Association Descriptor (IAD)

    Communication Device Class,简称CDCUSB Compound Device,USB复合设备USB Composite Device,USB组合设备 摘要USB复合设备 Co ...

  3. (USB HID) Configuration Descriptor

    最近完成了HID的基本收發,使用的配置用了2個Endpoint,把一些特別重要要的地方紀錄下來 整個Configuration 分成4大部分 : 1. Configuration 2. Interfa ...

  4. STM32 复合设备编写

    目的 完成一个CDC + MSC的复合USB设备 可以方便在CDC,MSC,复合设备三者间切换 可移植性强 预备知识 cube中USB只有两个入口. main函数中的MX_USB_DEVICE_Ini ...

  5. stm32 hid 键盘描述

    /* USB Standard Device Descriptor */ const uint8_t Joystick_DeviceDescriptor[JOYSTICK_SIZ_DEVICE_DES ...

  6. USB

    [一].USB(Universal Serial Bus):是通用串行总线的缩写,具有方便易用,动态分配带宽,容错性优越和高性价比等特点. USB接口设备结构分:USB Host(主机)和USB De ...

  7. C#:USB设备枚举 --转自CSDN作者:Splash

    (一)DeviceIoControl的PInvoke /* ---------------------------------------------------------- 文件名称:Device ...

  8. usb驱动开发18之设备生命线

    现在已经使用GET_DESCRIPTOR请求取到了包含一个配置里所有相关描述符内容的一堆数据,这些数据是raw的,即原始的,所有数据不管是配置描述符.接口描述符还是端点描述符都挤在一起,所以得想办法将 ...

  9. usb驱动开发13之设备生命线

    上一节勉勉强强把struct urb这个中心给说完,接着看那三个基本点. 第一个基本点,usb_alloc_urb函数,创建urb的专用函数,为一个urb申请内存并做初始化,在drviers/usb/ ...

随机推荐

  1. mysql sql 百万级数据库优化方案

    1.对查询进行优化,应尽量避免全表扫描,首先应考虑在 where 及 order by 涉及的列上建立索引. 2.应尽量避免在 where 子句中对字段进行 null 值判断,否则将导致引擎放弃使用索 ...

  2. Jquery select 选中项中自定义的值

    给select 赋值,除了已有的value及text,新建一属性simple_name function GetDicOfficeList(dicType, sid) { $.ajax({ url: ...

  3. qml支持多平台的编译--尤其对于需要支持xp的情况

    http://www.oschina.net/p/deepin-boot-maker 系统支持: Windows平台: Windows 7/ Windows 8 需要安装显卡驱动 Windows XP ...

  4. GCJ 2015-Qualification-B Infinite House of Pancakes 枚举,思路,误区 难度:3

    https://code.google.com/codejam/contest/6224486/dashboard#s=p1 题目不难,教训记终生 题目给了我们两种操作:1 所有人都吃一个,简记为消除 ...

  5. 关于BIOS的一点东西

    关于BIOS的一点东西 编辑删除转载2016-05-20 00:36:36 去把BIOS的每个单词意思都有道一遍就都明白了,BOOT是更改 启动顺序的(台式机一直按del键就会进入BIOS界面,用上下 ...

  6. iphone判断当前网络连接类型

    eachability只能区分出无网络.wifi和wwan(2G&2.5G&3G)类型的网络连接类型,只需重构networkStatusForFlags方法,即可详细区分出2G与3G网 ...

  7. SharePoint 沙盒解决方案 VS 场解决方案

    博客地址 http://blog.csdn.net/foxdave 最近看书正好看到了关于沙盒解决方案的介绍,便整理记录一下. 虽然沙盒解决方案已经在最新的SharePoint开发中被否决弃用了(被A ...

  8. 【python】list。列表

    列表 list 特点:有序,支持不同类型的元素在一个列表中,可变(使用sort方法排序,影响到的是列表自身而不是创建新的列表——这与字符串不同,所以说字符串是不可变的) 在python中列表也是对象, ...

  9. Javascript 的类型转换之减号

    专职写JS已经有一个月了(对,没错就是一个月),从2014年11月24实习开始到今的2月份,我做的工作一直都是切图,另外跟着老板学产品,现在我一听到切图两字,我就想吐...所以我找了一份专职写JS的工 ...

  10. ResultSet结果集判断是否为空

    目前亲测过能用的一个方法是: if(rs.next())//当前行有内容 { msg2 = "有这个活动!"; } else //rs对象为空表示查无此活动 { msg2 = &q ...