9.1.2 Bus Enumeration(总线枚举)
When a USB device is attached to or removed from the USB, the host uses a process known as bus
enumeration to identify and manage the device state changes necessary. When a USB device is attached to a powered port, the following actions are taken:
当USB设备插入或拨出,主机采用一个叫总线枚举的过程识别和管理设备的状态变更。当USB设备插入上电的端口,将会出现以下动作:
1. The hub to which the USB device is now attached informs the host of the event via a reply on its status change pipe (refer to Section 11.12.3 for more information). At this point, the USB device is in the Powered state and the port to which it is attached is disabled.
1.USB设备连接的集线器将通过响应状态改变管道告诉主机当前发生的事件(具体参考11.12.3),这时,USB设备将上电,连接端口将被设置为无效。
2. The host determines the exact nature of the change by querying the hub.
2. 主机通过询问集线器,确认具体的改变。
3. Now that the host knows the port to which the new device has been attached, the host then waits for at least 100 ms to allow completion of an insertion process and for power at the device to become stable. The host then issues a port enable and reset command to that port. Refer to Section 7.1.7.5 for
sequence of events and timings of connection through device reset.
3.现在知道新的设备已连接该主机的端口,然后主机等待至少100毫秒,以完成插入进程并保证供电力稳定。主机然后发出一个端口启用和复位命令到该端口。请参阅7.1.7.5: 事件时序,及设备复位的连接时序。
4. The hub performs the required reset processing for that port (see Section 11.5.1.5). When the reset signal is released, the port has been enabled. The USB device is now in the Default state and can draw no more than 100 mA from VBUS. All of its registers and state have been reset and it answers to the default address.
4。该集线器执行该端口(参见11.5.1.5)所需的复位处理。当复位信号释放,端口已被启用。现在的USB设备在默认状态,可以得到不超过100毫安的VBUS。它的寄存器和状态都被重置,并回复了默认的地址。
5. The host assigns a unique address to the USB device, moving the device to the Address state.
5。主机分配一个唯一的地址到USB设备,并将设备置于该地址状态。
6. Before the USB device receives a unique address, its Default Control Pipe is still accessible via the default address. The host reads the device descriptor to determine what actual maximum data payload size this USB device’s default pipe can use.
6。USB设备收到一个唯一的地址之前,它的默认控制管道仍是通过默认地址访问。主机读取设备描述符,以确定这个USB设备的默认管道可以使用的实际最大数据有效载荷大小。
7. The host reads the configuration information from the device by reading each configuration zero to n-1, where n is the number of configurations. This process may take several milliseconds to complete.
7。主机从设备读取由每个配置信息,从零读到n -1,其中n是配置数量的配置。这个过程可能需要几毫秒的时间来完成。
8. Based on the configuration information and how the USB device will be used, the host assigns a
configuration value to the device. The device is now in the Configured state and all of the endpoints in
this configuration have taken on their described characteristics. The USB device may now draw the amount of VBUS power described in its descriptor for the selected configuration. From the device’s point of view, it is now ready for use. When the USB device is removed, the hub again sends a notification to the host. Detaching a device disables the port to which it had been attached. Upon receiving the detach notification, the host will update its local topological information.
8。基于配置信息,以及如何使用USB设备的信息,主机将分配一个配置值到设备。该设备是目前在配置状态,所有端点的特征描述都已在他们的这种配置中。 USB设备现在可以根据选定的配置从描述中提请VBUS电源功率值。从设备的角度来看,现在可以使用了。当USB设备被移除,集线器再次向主机发送一个通知。被移除的设备端口禁用。接到移除通知后,主机将更新其本地集线器拓扑信息。
附注:
相关request流程:
get_hub_descriptor==
get_hub_status==
set_port_feature==
get_port_status==
clear_port_feature==
get_port_status==
get_hub_descriptor==
get_hub_status==
set_port_feature==
set_port_feature==
get_port_status==
get_port_status==
clear_port_feature==
usb 1-1: new high speed USB device using pxa9xx-ehci and address 2
hub_port_init==
set_port_feature==
get_port_status==
clear_port_feature==
hub_set_address==