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

Chapter 20: Hub Configuration

Hub Class Descriptor

A class-specific descriptor is defined for hub devices as in Table 20-5 on page 388. This descriptor is read via the class-specific “Get Descriptor” request. Note that this descriptor is pre-defined by the specification with an index of zero. The USB enumerator reads the hub class descriptor to determine the following information:

Power switching mode implemented.

Whether hub is part of compound device or not.

Whether device implements global, individual port, or no over-current protection.

The time delay from software requesting power be applied to a port until power is valid.

Maximum bus current required by the hub controller (compare offset 8 of Table 20-2 on page 382).

Whether the device attached to a port is removable or not.

Whether a port is powered in gang mode or individually.

Refer to Table 20-5 on page 388 during the following discussions.

Power Switching Mode Implemented

A hub may control power to ports in three ways. Offset 3, bits 1:0, within the hub class descriptor defines which method is employed by this hub:

Ganged power switching — power is switched to all ports at the same time.

Individual port power switching — power is applied to each port separately. The “Set Port Power” Feature request is used to apply power to the individual port selected.

No power switching — power is applied to all ports when the hub is configured (i.e., when the “Set Configuration” request is made).

Note that if ganged power mode switching is defined, some ports may be unaffected by the ganged power switching. Refer to the section entitled “Port Power Mask” on page 391 for more information.

387

USB System Architecture

Table 20-5: Hub Class Descriptor

Offset

Field

Size

 

Description

 

 

 

 

0

DescLength

1

Number of bytes in the descriptor, including this byte.

 

 

 

 

1

DescriptorType

1

Descriptor Type = 29h (hub class descriptor).

 

 

 

 

2

NbrPorts

1

Number of downstream ports that this hub supports.

 

 

 

 

 

3

HubCharacteristics

2

D1:D0

Power Switching Mode.

 

 

 

00

Ganged power switching (all ports powered at

 

 

 

 

once)

 

 

 

01 Individual port power switching

 

 

 

1X Used in 1.0 hubs to indicate no power switching

 

 

 

 

(ports always powered on when hub is on, and

 

 

 

 

off when hub is off)

 

 

 

 

Reserved in 2.0

 

 

 

D2

Identifies a Compound Device

 

 

 

0 Hub is not part of a compound device

 

 

 

1 Hub is part of a compound device

 

 

 

D4:D3

Over-current Protection Mode.

 

 

 

00 Global Over-Current Protection. The hub

 

 

 

 

reports over-current as a summation of all

 

 

 

 

ports’ current draw, without a breakdown of

 

 

 

 

individual port over-current status.

 

 

 

01 Individual Port Over-Current Protection. The

 

 

 

 

hub reports over-current on a per port basis.

 

 

 

 

Each port has an over-current indicator.

 

 

 

1X

No Over-Current Protection. This option is only

 

 

 

 

allowed for bus-powered hubs that don’t

 

 

 

 

implement over-current protection.

 

 

 

D15:D5

Reserved

 

 

 

 

5

PwrOn2PwrGood

1

Time (in 2ms intervals) from the time power-on sequence

 

 

 

begins on a port until power is good on that port. System

 

 

 

software uses this value to determine how long to wait

 

 

 

before accessing a powered-on port.

 

 

 

 

6

HubContrCurrent

1

Maximum current requirements of the hub controller

 

 

 

electronics, in 2ma increments.

 

 

 

 

 

388

Chapter 20: Hub Configuration

Table 20-5: Hub Class Descriptor

Offset

Field

Size

 

Description

 

 

 

 

 

 

 

 

7

DeviceRemovable

Depends on

Indicates if a port has a removable device attached. If a

 

 

num of ports

non-removable device is attached to a port, that port will

 

 

 

never receive an insertion change notification. This field

 

 

 

is reported on byte-granularity. Within a byte, if no port

 

 

 

exists for a given location, then the field representing the

 

 

 

port characteristics returns to 0.

 

 

 

Bit definition:

 

 

 

0

Device is removable.

 

 

 

1 Device is not removable.

 

 

 

This is a bitmap corresponding to the individual ports on

 

 

 

the hub:

 

 

 

 

Bit 0

Reserved

 

 

 

Bit 1

Port 1

 

 

 

Bit 2

Port 2

 

 

 

:

 

 

 

 

Bit n Port n (implementation dependent)

 

 

 

 

Vari-

PortPwrCtrlMask

Depends on

In 2.0 these bits are all set to “1b.” These bits are used

able

 

num of ports

only in 1.0 hubs as discussed below:

 

 

 

Indicates if a port is not affected by a gang-mode power

 

 

 

control request. Ports that have this field set always

 

 

 

require a manual SetPortFeature (PORT_POWER)

 

 

 

request to control the port’s power state.

 

 

 

Bit definition

 

 

 

0

Port does not mask the gang-mode power con-

 

 

 

 

trol capability.

 

 

 

1

Port is not affected by gang-mode power com-

 

 

 

 

mands. Manual commands must be sent to

 

 

 

 

this port to turn power on and off.

 

 

 

This is a bitmap corresponding to the individual ports on

 

 

 

the hub:

 

 

 

 

Bit 0 Reserved for future use.

 

 

 

Bit 1

Port 1

 

 

 

Bit 2

Port 2

 

 

 

:

 

 

 

 

Bit n Port n (implementation dependent)

 

 

 

 

 

389

USB System Architecture

Compound Device or Hub Only

Whether a hub is part of a compound device implementation or not is defined at offset 3, bit 2, within the hub class descriptor.

Over-Current Protection Mode

A hub may choose to implement over-current protection in different ways, as long as it conforms to the safety requirement of allowing no more than 5a of current to be drawn by a given port. Offset 3, bits 4:3, specify which over-cur- rent protection mode is implemented for this hub as described in Table 20-5 on page 388.

Power On to Power Good Delay

Configuration software must know how long the device requires power to be applied to the device. Once system software requests that power be applied to the hub, there will be a delay until power is good at the port. Software must wait until it knows that power is good before accessing the port. Offset 5 defines the delay between the power-on request and power good. The value is defined in 2ms intervals.

Maximum Bus Current for Hub Controller

Offset 6 within the hub class descriptor specifies the maximum amount of current that the hub controller consumes. Note that this value is different from the maximum current field in the configuration descriptor, which specifies total power that the device consumes. (See the section entitled “Maximum Bus Power Consumed” on page 381.)

Device Removable/Non-removable

The DeviceRemovable field at offset 7 provides a bitmap of all ports supported by this hub. Each bit position corresponds to a given hub (i.e., bit 1 specifies port 1). If the bit field corresponding to a port is cleared, the device is removable, and if the bit is set, the device is permanently attached (e.g., an embedded device). The field size is one byte for hubs that support from one to seven ports. Another byte must be added for 8 to 15 ports, etc.

390

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