




已阅读5页,还剩10页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
英文翻译 USB 的互连支持数据在 USB 主机与 USB 设备之间的流动。这一章主要讲述为了简化主机上的 客户软件 (Software client)与设备的功能部件 (function)之间的通信而必须的主机接口 (host interface)。在本章中所涉及的具体实现部份并不是必要的,这些实现部份是作为例子来阐述在响应 USB 设备请求时的主机系统的行为。只要 USB 设备并不感觉到主机行为的改变, USB 主机完全可以提供一个不同的软件系统实现方法。 10.1 USB 主机概况 10.1.1 概论 图 10-1 展示了 USB 通信模型之间基本的信息流与互连关系: 逻辑的信息流 实际的信息流 图 10-1 通信模型层次关系图 由图 10-1 可见,主机与设备都被划分成不同的层次。主机上垂直的箭头是实际的信息流。设备上对应的接口是基于不同实现的。在主机与设备之间的所有通信最终都是通过 USB 的电缆进行,然而,在上层的水平层之间存在逻辑的 主机 设备信息流。主机上的客户软件和设备功能部件之间的通信是基于实际的应用需求及设备所能提供的能力。 客户软件与功能部件之间的透明通信的要求,决定主机和设备下层部件的功客户 USB 系统 主机控制器 功能部件 USB 设备 USB 总线接口 能以及它们的界面 (interface) 这一章从主机的角度来描述上述的通信模型,图 10-2 描述了从主机角度看到的它与设备的连接。 主机在整个 USB 系统中是唯一的,它包括如下几个层次。 USB 总线接口 USB 系统 (USB System) USB 客户 (Client) 其中, USB 总线接 口处理电气及协议层的互连 (详见第 7 章及第 8 章 )。从互连的角度看, USB 设备和 USB 主机都提供类似的 USB 总线接口,如串行接口引擎(Serial Interface Engine SIE)。由于主机在 USB 系统中的特殊性, USB 主机上的总线接口还必须具备主机控制器的功能 (Host Controller),主机控制器具有一个内集成的集线器 (根集线器 )提供与 USB 电缆的连接。 USB 系统 (USB System)使用主机控制器来管理主机与 USB 设备的数据传输。USB 系统与主机控制器之间的界面基于主机控制器的硬件特性 。 USB 系统层相对于主机控制器而言,处理的是以客户观点见到的数据传输及客户与设备的交互。这包括附加的 USB 信息,比如协议头 (Protocol Wrappers)。 USB 系统还必须管理 USB 的系统资源,以使得客户的访问成为可能。 通道组(到某一接口) IRPS 配置信息 客户 (管理界面) USB 系统(管理通道) USB 驱动器 主机软件 标准通道(到缺省端口地址) 硬件定义 USB 电缆 通道,代表相应层之间连接的抽象 图 10-2 主机通信图 USB 系统有三个主要组成部份 : 主机控制器驱动( Host Controller Driver) USB 驱动 (USB Driver) 主机软件 (host software) 主机控制器驱动的存在,方便地将各种不同的主机控制器实现映射到 USB系统,客户可以不必知道设备到底接在哪个主机控制器上就能同设备进行通信。USB 驱动提供了基本的面向客户的主机界面。在 HCD 与 USB 之间的接口称为主机控制器驱动接口 (Host Controller Driver Interface HCDI)。这层接口不能被客户直接访问,所以也不是由 USB 具体来完成的。一个典型的 HCDI 是由支撑各种不同主机控制器的 操作系统来定义的。 USBD 提供 I/O 请求包 (I/O Request Packets)形式的数据传输,以某一特定通道来传输数据。另外, USBD 为它的客户提供一个容易被支配及配置的抽象的设备。作为这种抽象的一部份, USBD 拥有标准通道 (参见第 5 章及第 9 章 )对设 主机控制器 驱动 硬件定义 USB 总线接口 主机控制器 SIE 备进行一些标准的控制。这标准通道实现了 USBD 与抽象设备之间的逻辑通信。(见图 10-2) 在有些操作系统中,提供了额外的非 USB 系统软件以支持设备的配置及设备驱动程序的加载。在这样的操作系统中,设备驱动程序应使用提供的主机软件接口而不是直 接访问 USBDI。 客户层描述的是直接与 USB 设备进行交互所需要的软件包。当所有的设备都已连上系统时,这些客户就可以直接通设备进行通信。一个客户不能直接访问设备的硬件。 该言之,主机可提供如下的功能 检测 USB 设备的连接与断开。 管理主机与设备之间的标准控制流。 管理主机与设备之间的数据流。 收集状态及一些活动的统计数字。 控制主机控制器与 USB 设备的电气接口,包括提供有限的能源。 在下面的章节中,我们将较细的阐述 USBDI 所能提供的功能。对于特定的主机平台 与操作系统下的实现接口请参照相关的操作系统手册。 所有的集线器都通过状态改变通道报告它的状态的改变,其中包括设备的连上与断开等。 USBD 的一类特殊客户即:集线器驱动器拥有这些状态改变通道,接收这些状态的改变。对于像设备连结这种状态改变,集线器驱动器将加载设备的驱动程序。在有些系统中,这种集线器驱动程序是操作系统提供的主机软件的一部份,它用来管理设备。 10 1.2 控制机构 控 制 信 号 可 通 过 带 内 信 号 ( in-band-singling ) 及 带 外 信 号(out-of-bard-signaling)两种方式在主机与 设备之间传输。带内信号将控制信息及数据信息混在一起用同一通道传输,以至于主机根本就没有觉察到。而外带信号是通过单独的通道进行传输。 任何一个已连接的设备都有一个标准的信息通道,即标准通道。这个主机与设备之间的逻辑的连接用于传输 USB 的标准控制信息,比如对设备的配置信息等。这些标准通道为 USB 的设备提供了标准的接口,它也可以用来进行基于特定设备而不同的通信,这些通信由拥有所有这些通道的 USBD 作媒介。 一些特定的设备可能允许使用额外的信息通道来传输特定设备的控制信息。这些额外的信息通道与标准通道使用同 样的协议,但是传递的信息是基于特定的设备的,也不是由 USB 具体标准化的。 USBD 支持和它的客户共享使用标准通道,它还提供给客户与设备相连的其它控制通道的访问。 10.1.3 数据流 主机控制器在主机与 USB 设备之间传递数据。这些数据被看作连续的字节流。 USB 支持 4 种形式的数据传输 控制传输。 同步传输。 中断传输。 块传输。 有关于传输方式的额外信息请参见第 5 章 每个设备具有一到多个界面以用于客户与设备之间的数据传输。每个接口由一到多个在客户及设备 端点之间独立传输的通道组成。 USBD 根据主机软件的请求来初始化这些通道和接口。当这些配置请求提出后,主机控制器将基于主机软件所提供的参数来提供服务。 每个通道基于数据传输模式和请求的有如下几个特性: 数据传输的频率。 数据是以恒定速率提供还是随机出现的。 在数据传输前可延迟的时间。 在传输过程中数据的丢失是否是具有灾难性。 USB 设备的端口描述了与之相连接的通道的特性。 USB 设备端口的特性的具体描述可参照第 9 章。 10.1.4 收集状态及活动统计数据 作为普通的为所有主机与设备之间的控制流与数据流服务的 USB 系统与主机控制器,一直处于随时接收状态变化及活动信息的状态,以使软件能及时接收并处理这些状态的变化。这里并不具体讲述需要被跟踪的状态信息及这些状态信息的特殊的格式。 10.1.5 电气接口因素 主机为连在集线器上的 USB 设备提供能量。一个集线器口所能提供的能量具体值在第七章有详细说明。 10.2 主机控制器功能 在所有的实现中,主机控制器都必须提供基本相同的功能。主机控制器对主机及设备来讲都必须满足一定的要求。下面是主机控制器所 提供的功能的概况。每种功能在下面的小节中还有具体的说明。 1 状态处理 (State Handling) 作为主机的一部份,主机控制器报告及管理它的状态。 2 串行化与反串行化 对于从主机输出的数据,主机控制器将协议及数据信息从它原始形状转换为字位流。而对于主机接收的数据主机控制器进行反向操作。 3 帧产生 (Frame Generation) 主机控制器以每 1ms 为单位产生 SOF 标志包。 4 数据处理 主机控制器处理从主机输入输出数据的请求。 5 协议引擎 主机控制器支持 USB 具 体规定的协议 6 传输差错控制 所有的主机控制器在发现和处理已定义的错误时展现相似的行为。 7 远程唤醒 所有的主机控制器都应具有将总线置于挂起状态及在远程唤醒事件下重新启动的能力。 8 集线器 集线器提供了标准的将多个 USB 设备连到主机控制器的功能。 9 主机系统接口 主机控制器在主机系统控制器之间建立一个高速的数据通道。 下面的各节将对上面提到的各功能进行详细的讨论。 10.2.1 状态处理 主机控制器具有一系列 USB 系统管理的状态。另外,主机控制器为 下面两个与 USB 有关的部份提供接口。 状态改变传播 根集线器 根集线器提供与其它 USB 设备一样的标准状态给集线器驱动器。有关 USB状态与其它之间的相互关系的详细讨论请参照第 7 章。 主机控制器的总的状态与根集线器及总体的 USB 密不可分。任何一个对设备来说可见的状态的改变都应反映设备状态的相应改变。从而保证主机控制器与设备之间的状态是一致的。 USB 设备通过使用恢复信号请求唤醒,使设备回利已配置的状态。主机控制器本身也可以通过同样的方法产生一个恢复事件。主机控制器通过 使用该实现系统的某种机制来通知主机的其它部份已产生了一个恢复事件。 10.2.2 串行化与反串行化 通过物理上的传输是以字位流的形式出现的。不管是作为主机的一部份,还是作为设备的一部份,串行接口引擎 (STE)处理 USB 传输过程中的串行化与文串行化工作。在主机上,串行接口引擎是主机控制器的一部份。 The basic flow and interrelationships of the USB communications model are shown in Figure 10-1 Figure 10-1. Interlayer Communications Model The host and the device are divided into the distinct layers depicted in Figure 10-1. Vertical arrows indicate the actual communication on the host. The corresponding interfaces on the device are implementation-specific. All communications between the host and device ultimately occur on the physical USB wire. However, there are logical host-device interfaces between each horizontal layer. These communications, between client software resident on the host and the function provided by the device, are typified by a contract based on the needs of the application currently using the device and the capabilities provided by the device. This client-function interaction creates the requirements for all of the underlying layers and their interfaces. Universal Serial Bus Specification Revision 1.1 208 This chapter describes this model from the point of view of the host and its layers. Figure 10-2 describes, based on the overall view introduced in Chapter 5, the hosts view of its communication with the device. Figure 10-2. Host Communications Universal Serial Bus Specification Revision 1.1 209 There is only one host for each USB. The major layers of a host consist of the following: _ USB bus interface _ USB System _ Client. The USB bus interface handles interactions for the electrical and protocol layers (refer to Chapter 7 and Chapter 8). From the interconnect point of view, a similar USB bus interface is provided by both the USB device and the host, as exemplified by the Serial Interface Engine (SIE). On the host, however, the USB bus interface has additional responsibilities due to the unique role of the host on the USB and is implemented as the Host Controller. The Host Controller has an integrated root hub providing attachment points to the USB wire. The USB System uses the Host Controller to manage data transfers between the host and USB devices. The interface between the USB System and the Host Controller is dependent on the hardware definition of the Host Controller. The USB System, in concert with the Host Controller, performs the translation between the clients view of data transfers and the USB transactions appearing on the interconnect. This includes the addition of any USB feature support such as protocol wrappers. The USB System is also responsible for managing USB resources, such as bandwidth and bus power, so that client access to the USB is possible. The USB System has three basic components: _ Host Controller Driver _ USB Driver _ Host Software. The Host Controller Driver (HCD) exists to more easily map the various Host Controller implementations into the USB System, such that a client can interact with its device without knowing to which Host Controller the device is connected. The USB Driver (USBD) provides the basic host interface (USBDI) for clients to USB devices. The interface between the HCD and the USBD is known as the Host Controller Driver Interface (HCDI). This interface is never available directly to clients and thus is not defined by the USB Specification. A particular HCDI is, however, defined by each operating system that supports various Host Controller implementations. The USBD provides data transfer mechanisms in the form of I/O Request Packets (IRPs), which consist of a request to transport data across a specific pipe. In addition to providing data transfer mechanisms, the USBD is responsible for presenting to its clients an abstraction of a USB device that can be manipulated for configuration and state management. As part of this abstraction, the USBD owns the default pipe (see Chapter 5 and Chapter 9) through which all USB devices are accessed for the purposes of standard USB control. This default pipe represents a logical communication between the USBD and the abstraction of a USB device as shown in Figure 10-2. In some operating systems, additional non-USB System Software is available that provides configuration and loading mechanisms to device drivers. In such operating systems, the device driver shall use the provided interfaces instead of directly accessing the USBDI mechanisms. The client layer describes all the software entities that are responsible for directly interacting with USB devices. When each device is attached to the system, these clients might interact directly with the peripheral hardware. The shared characteristics of the USB place USB System Software between the client and its device; that is, a client cannot directly access the devices hardware. Universal Serial Bus Specification Revision 1.1 210 Overall, the host layers provide the following capabilities: _ Detecting the attachment and removal of USB devices _ Managing USB standard control flow between the host and USB devices _ Managing data flow between the host and USB devices _ Collecting status and activity statistics _ Controlling the electrical interface between the Host Controller and USB devices, including the provision of a limited amount of power. The following sections describe these responsibilities and the requirements placed on the USBDI in greater detail. The actual interfaces used for a specific combination of host platform and operating system are described in the appropriate operating system environment guide. All hubs (see Chapter 11) report internal status changes and their port change status via the status change pipe. This includes a notification of when a USB device is attached to or removed from one of their ports. A USBD client generically known as the hub driver receives these notifications as owner of the hubs Status Change pipe. For device attachments, the hub driver then initiates the device configuration process. In some systems, this hub driver is a part of the host software provided by the operating system for managing devices. 10.1.2 Control Mechanisms Control information may be passed between the host and a USB device using in-band or out-of-band signaling. In-band signaling mixes control information with data in a pipe outside the awareness of the host. Out-of-band signaling places control information in a separate pipe. There is a message pipe called the default pipe for each attached USB device. This logical association between a host and a USB device is used for USB standard control flow such as device enumeration and configuration. The default pipe provides a standard interface to all USB devices. The default pipe may also be used for device-specific communications, as mediated by the USBD, which owns the default pipes of all of the USB devices. A particular USB device may allow the use of additional message pipes to transfer device-specific control information. These pipes use the same communications protocol as the default pipe, but the information transferred is specific to the USB device and is not standardized by the USB Specification. The USBD supports the sharing of the default pipe, which it owns and uses, with its clients. It also provides access to any other control pipes associated with the device. 10.1.3 Data Flow The Host Controller is responsible for transferring streams of data between the host and USB devices. These data transfers are treated as a continuous stream of bytes. The USB supports four basic types of data transfers: _ Control transfers _ Isochronous transfers _ Interrupt transfers _ Bulk transfers. For additional information on transfer types, refer to Chapter 5. Each device presents one or more interfaces that a client may use to communicate with the device. Each interface is composed of zero or more pipes that individually transfer data between the client and a particular endpoint on the device. The USBD establishes interfaces and pipes at the explicit request of the Host Software. The Host Controller provides service based on parameters provided by the Host Software when the configuration request is made. Universal Serial Bus Specification Revision 1.1 211 A pipe has several characteristics based on the delivery requirements of the data to be transferred. Examples of these characteristics include the following: _ the rate at which data needs to be transferred _ whether data is provided at a steady rate or sporadically _ how long data may be delayed before delivery _ whether the loss of data being transferred is catastrophic. A USB device endpoint describes the characteristics required for a specific pipe. Endpoints are described as part of a USB devices characterization information. For additional details, refer to Chapter 9. 10.1.4 Collecting Status and Activity Statistics As a common communicant for all control and data transfers between the host and USB devices, the USB System and the Host Controller are well-positioned to track status and activity information. Such information is provided upon request to the Host Software, allowing that software to manage status and activity information. This specification does not identify any specific information that should be tracked or require any particular format for reporting activity and status information. 10.1.5 Electrical Interface Considerations The host provides power to USB devices attached to the root hub. The amount of power provided by a port is specified in Chapter 7. 10.2 Host Controller Requirements In all implementations, Host Controllers perform the same basic duties with regard to the USB and its attached devices. These basic duties are described below. The Host Controller has requirements from both the host and the USB. The following is a brief overview of the functionality provided. Each capability is discussed in detail in subsequent sections. State Handling As a component of the host, the Host Controller reports and manages its states. Serializer/Deserializer For data transmitted from the host, the Host Controller converts protocol and data information from its native format to a bit stream transmitted on the USB. For data being received into the host, the reverse operation is performed. Frame Generation The Host Controller produces SOF tokens at a period of 1ms. Data Processing The Host Controller processes requests for data transmission to and from the host. Protocol Engine The Host Controller supports the protocol specified by the USB. Transmission Error Handling All Host Controllers exhibit the same behavior when detecting and reacting to the defined error categories. Remote Wakeup All host controlers must have the ability to place the bus into the Suspended state and to respond to bus wakeup events. Root Hub The root hub provides standard hub function to link the Host Controller to one or more USB ports. Universal Serial Bus Specification Revision 1.1 212 Host System Interface Provides a high-speed data path between the Host Controller
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- ××超市资源调配规定
- 多方合作基金投资协议
- 实习经历及工作表现证明(5篇)
- 关于勤奋学习的讨论话题展开论述议论文创作12篇
- 人工智能技术研发经历证明书(6篇)
- 2025年物业管理师职业能力测试卷:智慧社区管理案例分析试题
- 2025年金属硫蛋白(MT)、高纯度MT、MT多糖项目提案报告
- 2025年电工(高级)职业技能鉴定实操试卷:电力系统节能技术考核
- 2025年自动驱鸟设备项目规划申请报告
- 国际贸易合同执行及业务经历证明书(7篇)
- 学校五年发展规划2026-2030年
- 2025年全国保密教育线上培训考试试题库附答案(完整版)含答案详解
- 完整的离婚协议书打印电子版(2025年版)
- 期末培优拔高卷(试题)-2023-2024学年五年级下册数学北师大版
- 中华民族共同体概论课件专家版2第二讲 树立正确的中华民族历史观
- 抖音认证承诺函
- 设施农用地管理政策---培训会--课件(第二部分)
- 英语活动小组活动记录表(共10页)
- 超声波探伤报告(焊缝)
- 2022社区工作者考试试题-历年真题及答案
- 安全员上岗证继续教育考试
评论
0/150
提交评论