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

USB System Architecture

Table 20-1: Hub’s Device Descriptor

Offset

Field

Size

Value

Description

 

 

 

 

 

 

 

 

 

 

6

DeviceProtocol

1

0

Protocol code (assigned by USB).

 

 

 

 

These codes are qualified by the value of the Device-

 

 

 

 

Class and the DeviceSubClass fields. If a device sup-

 

 

 

 

ports class-specific protocols on a device basis as

 

 

 

 

opposed to an interface basis, this code identifies the

 

 

 

 

protocols that the device uses as defined by the specifi-

 

 

 

 

cation of the device class.

 

 

 

 

If this field is reset to zero, the device does not use class-

 

 

 

 

specific protocols on a device basis. However, it my use

 

 

 

 

class -specific protocols on an interface basis.

 

 

 

 

If this field is set to 0xFF, the device uses a vendor-spe-

 

 

 

 

cific protocol on a device basis.

 

 

 

 

 

7

MaxPacketSize0

1

08h

Maximum packet size for endpoint zero.

 

 

 

 

 

8

Vendor

2

ID

Vendor ID (assigned by USB).

 

 

 

 

 

10

Product

2

ID

Product ID (assigned by manufacturer).

 

 

 

 

 

12

Device

2

BCD

Device release number in binary-coded decimal.

 

 

 

 

 

14

Manufacturer

1

Index

Index of string descriptor describing manufacturer.

 

 

 

 

 

15

Product

1

Index

Index of string descriptor describing product.

 

 

 

 

 

16

SerialNumber

1

Index

Index of string descriptor describing the device’s serial

 

 

 

 

number.

 

 

 

 

 

17

NumConfigura-

1

Number

Number of possible configurations.

 

tions

 

 

 

 

 

 

 

 

Hub Configuration Descriptor

A typical hub has a single configuration descriptor. This descriptor has the same definition as it does for standard USB devices. Configuration software accesses this descriptor to obtain the following information:

number of interfaces supported by this configuration

the configuration value used to configure the hub

whether hub is bus powered or self powered

maximum amount of bus power consumed by hub in this configuration

380

Chapter 20: Hub Configuration

Table 20-2 defines the standard configuration descriptor fields implemented by a hub device. Refer to Table 20-2 during the following discussions.

Number of Interfaces

The number of interfaces defined at offset 4 depends on whether the hub is a compound device or not. If the hub is a single function device (no embedded devices), then the hub will contain only one interface. However, composite devices that contain hubs contain one or more embedded devices, each of which requires one or more interfaces.

Configuration Value

The configuration value at offset 5 is used by the USB enumerator to assign the selected configuration for the hub. The configuration value is assigned using the Set Configuration request. This also enable access to the hub’s status change port, which the enumerator reads to determine the number of devices attached to the hub’s ports.

Setting the configuration also allows power to be applied to the hub ports if the hub does not implement power switching. If power switching is supported, additional accesses must be made to apply power to the ports. Note that the status change port cannot report device attachment until power is applied to the ports.

Busor Self-Powered Hub

Offset 7 within the configuration descriptor is defined as device attributes. These attributes specify whether the hub uses bus power, is self-powered, or both. If both bit fields are set, then the hub is a hybrid-powered device. If the hub is bus-powered, the maximum bus power field can used by configuration software to determine the amount of power available at each port. See Chapter 4 for details regarding issues related to busand self-powered hubs.

Maximum Bus Power Consumed

This field is only valid to hubs that are busor hybrid-powered. It specifies the maximum amount of current this hub will draw from the USB bus. Configuration software can use this value to deduce the maximum amount of current available at each port. This value includes power consumed by pull-up and pull-down resistors, the hub controller, all embedded devices, and all ports.

381

USB System Architecture

Table 20-2: Hub Configuration Descriptor

Offset

Field

Size

Value

 

Description

 

 

 

 

 

0

Length

1

Number

Size of this descriptor in bytes.

 

 

 

 

 

1

Descriptor-

1

02h

CONFIGURATION.

 

Type

 

 

 

 

 

 

 

 

 

2

TotalLength

2

Number

Total length of data returned for this configura-

 

 

 

 

tion. Includes the combined length of all descrip-

 

 

 

 

tors (configuration, interface, endpoint, and class

 

 

 

 

or vendor specific) returned for this configura-

 

 

 

 

tion.

 

 

 

 

 

 

4

NumInter-

1

Number

Number of interfaces supported by this configu-

 

faces

 

 

ration.

 

 

 

 

 

 

5

Configura-

1

Number

Value to use as an argument to Set Configuration

 

tionValue

 

 

to select this configuration.

 

 

 

 

 

6

Configura-

1

Index

Index of string descriptor describing this config-

 

tion

 

 

uration.

 

 

 

 

 

 

7

Attributes

1

Bitmap

Configuration characteristics

 

 

 

 

D7

Bus Powered

 

 

 

 

D6

Self Powered

 

 

 

 

D5

Remote Wakeup (not used by hub)

 

 

 

 

D4:0 Reserved (reset to 0)

 

 

 

 

A device configuration that uses power from the

 

 

 

 

bus and a local source at runtime may be deter-

 

 

 

 

mined using the Get Status device request.

 

 

 

 

 

8

MaxPower

1

X 2ma

Maximum amount of bus power this hub will

 

 

 

 

consume in this configuration. This value

 

 

 

 

includes the hub controller, all embedded

 

 

 

 

devices, and all ports (value based on 2ma incre-

 

 

 

 

ments).

 

 

 

 

 

 

 

382

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