Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
USB System Architecture (USB 2.0).pdf
Скачиваний:
172
Добавлен:
03.05.2015
Размер:
7.03 Mб
Скачать

Chapter 20: Hub Configuration

Powering the Hub

Once a hub has been configured, power may need to be applied to the ports. Configuration software detects the port power mode when reading the hub class descriptor. If power must be manually applied, then the software issues a “Set Port Power Feature” request. Once power is applied to a port, the hub port will be able to detect that a device is connected to the port and set status bits to indicate the connect event. The hub port also transitions from its powered-off state to its powered-on state. This status change event will be detected by software when status is checked.

Checking Hub Status

Configuration software polls the status change endpoint to detect which ports have incurred a status change event. The status change endpoint merely reports whether the hub or a hub port has incurred a status change but does not identify the nature of the change. Specific requests must be made to the hub or port to determine the:

1.specific event(s) that has occurred.

2.current state of the item causing the event.

Detecting Hub Status Changes

Figure 20-3 illustrates the hub and port status change bitmap that is returned when the status change endpoint is polled. All status changes are sampled at the end of frame (EOP2 sample point), and are available to be read during the next frame. Configuration software is aware of the number of ports and therefore the size of the bitmap returned when the hub status change endpoint is polled. Status is reported in byte-sized fields, and zeros are returned in the bit field corresponding to ports that are not implemented. For most implementations a byte will be returned, because hubs will rarely implement more than 7 ports.

When software polls the status change endpoint, the bitmap illustrated in Figure 20-3 on page 398 is returned, providing a status change has occurred. If none of the bits are set, then no changes need to be reported. In this case, the status change endpoint returns NAK during the IN transaction, indicating that no change has occurred.

397

USB System Architecture

If a specific port change is detected, then software can perform the Get Port Status” request. Hub requests are defined in “Hub Class Requests” on page 450.

Figure 20-3: Hub and Port Status Change Bitmap

N

 

8

7

6

5

4

3

2

1

0

 

 

 

 

 

 

 

 

 

 

 

Hub Change Detected

Port 1 Change Detecte

Port 2 Change Detecte

Port 3 Change Detecte

Port 4 Change Detecte

Port 5 Change Detecte

Port 6 Change Detecte

Port 7 Change Detecte

Port 8 Change Detecte

Port N Change Detecte

Reading the Hub Status Field

If a hub status change is detected, software can perform the Get Hub Status request to obtain the source of the change. Hub status changes consist of:

Local power change

Over-current change

Refer to page 453 for details regarding the hub status fields. Once the specific hub status item that has changed is detected, software can take the appropriate action (e.g., by notifying the user of the event). Software must also acknowledge and clear the hub status change field by using the related Clear Hub Feature request. For example, if a local power change has occurred, software uses the

398

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]