hub controller is itself controlled by the host through two endpoints.

A hub is configured and interrogated through its standard Endpoint 0. This default pipe implements most of the standard control transactions and then goes on to implement various hub class specific control transactions (ClearHubFeature, ClearPortFeature, GetBusState, GetHubDescriptor, GetHubStatus, GetPortStatus, SetHubDescriptor, SetHubFeature, and SetPortFeature).

A hub also has a Status Change interrupt endpoint, used to inform the host of changes to each of its downstream ports. A port change bit is set if any of the following states change: device connected, port enabled, suspended, over-current indicated, reset, and powered. The host asks for the Status Change interrupt data every 255ms. The hub simply returns NAK if nothing has changed (e.g., if no devices have been added or removed).

Standard Control Transactions

The USB system uses standard control transactions to set up all devices. Further class and vendor specific requests can be defined.

A control transaction starts with a SETUP packet that includes eight data bytes in a customizable format, as shown in Table 20.2. Table 20.3 shows the bit definitions of the first byte, bmRequestType. The next byte is the request code.

Table 20.2 Control transfers

Field Size Description
bmRequestType 1 byte Request characteristics, see Table 20.3
bRequest 1 Request code, see Table 20.4
wValue 2 word parameter
wIndex 2 index parameter
wLength 2 Number of bytes to transfer

Table 20.3 bmRequestType bit definitions

Bit 7 Transfer direction 0 = Host to device
1 = Device to host
Bits 6..5 Type 0 = Standard
1 = Class
2 = Vendor
3 = Reserved
Bits 4..0 Recipient 0 = Device
1 = Interface
2 = Endpoint
3 = Other
4..31 reserved

The basic USB spec only defines the Standard type control transfers listed in Table 20.4. The table indicates the possible destinations, such as Device (D), Interface (I), or Endpoint (E).

Table 20.4 Standard USB SETUP transfer requests

Request code Recipient Description
CLEAR_FEATURE
Добавить отзыв
ВСЕ ОТЗЫВЫ О КНИГЕ В ИЗБРАННОЕ

0

Вы можете отметить интересные вам фрагменты текста, которые будут доступны по уникальной ссылке в адресной строке браузера.

Отметить Добавить цитату
×