TianoCore EDK2 master
Loading...
Searching...
No Matches
UsbHub.h File Reference

Go to the source code of this file.

Data Structures

struct  EFI_USB_HUB_DESCRIPTOR
 
struct  USB_CHANGE_FEATURE_MAP
 

Macros

#define USB_ENDPOINT_ADDR(EpAddr)   ((EpAddr) & 0x7F)
 
#define USB_ENDPOINT_TYPE(Desc)   ((Desc)->Attributes & USB_ENDPOINT_TYPE_MASK)
 
#define USB_DESC_TYPE_HUB   0x29
 
#define USB_DESC_TYPE_HUB_SUPER_SPEED   0x2a
 
#define USB_HUB_TARGET_HUB   0
 
#define USB_HUB_TARGET_PORT   3
 
#define USB_HUB_REQ_GET_STATUS   0
 
#define USB_HUB_REQ_CLEAR_FEATURE   1
 
#define USB_HUB_REQ_SET_FEATURE   3
 
#define USB_HUB_REQ_GET_DESC   6
 
#define USB_HUB_REQ_SET_DESC   7
 
#define USB_HUB_REQ_CLEAR_TT   8
 
#define USB_HUB_REQ_RESET_TT   9
 
#define USB_HUB_REQ_GET_TT_STATE   10
 
#define USB_HUB_REQ_STOP_TT   11
 
#define USB_HUB_REQ_SET_DEPTH   12
 
#define USB_HUB_C_HUB_LOCAL_POWER   0
 
#define USB_HUB_C_HUB_OVER_CURRENT   1
 
#define USB_HUB_PORT_CONNECTION   0
 
#define USB_HUB_PORT_ENABLE   1
 
#define USB_HUB_PORT_SUSPEND   2
 
#define USB_HUB_PORT_OVER_CURRENT   3
 
#define USB_HUB_PORT_RESET   4
 
#define USB_HUB_PORT_LINK_STATE   5
 
#define USB_HUB_PORT_POWER   8
 
#define USB_HUB_PORT_LOW_SPEED   9
 
#define USB_HUB_C_PORT_CONNECT   16
 
#define USB_HUB_C_PORT_ENABLE   17
 
#define USB_HUB_C_PORT_SUSPEND   18
 
#define USB_HUB_C_PORT_OVER_CURRENT   19
 
#define USB_HUB_C_PORT_RESET   20
 
#define USB_HUB_PORT_TEST   21
 
#define USB_HUB_PORT_INDICATOR   22
 
#define USB_HUB_C_PORT_LINK_STATE   25
 
#define USB_HUB_PORT_REMOTE_WAKE_MASK   27
 
#define USB_HUB_BH_PORT_RESET   28
 
#define USB_HUB_C_BH_PORT_RESET   29
 
#define USB_SS_PORT_STAT_C_BH_RESET   0x0020
 
#define USB_SS_PORT_STAT_C_PORT_LINK_STATE   0x0040
 
#define USB_HUB_GANG_POWER_CTRL   0
 
#define USB_HUB_PORT_POWER_CTRL   0x01
 
#define USB_HUB_STAT_LOCAL_POWER   0x01
 
#define USB_HUB_STAT_OVER_CURRENT   0x02
 
#define USB_HUB_STAT_C_LOCAL_POWER   0x01
 
#define USB_HUB_STAT_C_OVER_CURRENT   0x02
 
#define USB_HUB_CLASS_CODE   0x09
 
#define USB_HUB_SUBCLASS_CODE   0x00
 
#define USB_WAIT_PORT_STS_CHANGE_LOOP   5000
 

Functions

EFI_STATUS UsbHubCtrlClearTTBuffer (IN USB_DEVICE *UsbDev, IN UINT8 Port, IN UINT16 DevAddr, IN UINT16 EpNum, IN UINT16 EpType)
 
BOOLEAN UsbIsHubInterface (IN USB_INTERFACE *UsbIf)
 
EFI_STATUS UsbHubAckHubStatus (IN USB_DEVICE *UsbDev)
 

Variables

USB_HUB_API mUsbHubApi
 
USB_HUB_API mUsbRootHubApi
 

Detailed Description

The definition for USB hub.

Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file UsbHub.h.

Macro Definition Documentation

◆ USB_DESC_TYPE_HUB

#define USB_DESC_TYPE_HUB   0x29

Definition at line 18 of file UsbHub.h.

◆ USB_DESC_TYPE_HUB_SUPER_SPEED

#define USB_DESC_TYPE_HUB_SUPER_SPEED   0x2a

Definition at line 20 of file UsbHub.h.

◆ USB_ENDPOINT_ADDR

#define USB_ENDPOINT_ADDR (   EpAddr)    ((EpAddr) & 0x7F)

Definition at line 15 of file UsbHub.h.

◆ USB_ENDPOINT_TYPE

#define USB_ENDPOINT_TYPE (   Desc)    ((Desc)->Attributes & USB_ENDPOINT_TYPE_MASK)

Definition at line 16 of file UsbHub.h.

◆ USB_HUB_BH_PORT_RESET

#define USB_HUB_BH_PORT_RESET   28

Definition at line 67 of file UsbHub.h.

◆ USB_HUB_C_BH_PORT_RESET

#define USB_HUB_C_BH_PORT_RESET   29

Definition at line 68 of file UsbHub.h.

◆ USB_HUB_C_HUB_LOCAL_POWER

#define USB_HUB_C_HUB_LOCAL_POWER   0

Definition at line 45 of file UsbHub.h.

◆ USB_HUB_C_HUB_OVER_CURRENT

#define USB_HUB_C_HUB_OVER_CURRENT   1

Definition at line 46 of file UsbHub.h.

◆ USB_HUB_C_PORT_CONNECT

#define USB_HUB_C_PORT_CONNECT   16

Definition at line 57 of file UsbHub.h.

◆ USB_HUB_C_PORT_ENABLE

#define USB_HUB_C_PORT_ENABLE   17

Definition at line 58 of file UsbHub.h.

◆ USB_HUB_C_PORT_LINK_STATE

#define USB_HUB_C_PORT_LINK_STATE   25

Definition at line 65 of file UsbHub.h.

◆ USB_HUB_C_PORT_OVER_CURRENT

#define USB_HUB_C_PORT_OVER_CURRENT   19

Definition at line 60 of file UsbHub.h.

◆ USB_HUB_C_PORT_RESET

#define USB_HUB_C_PORT_RESET   20

Definition at line 61 of file UsbHub.h.

◆ USB_HUB_C_PORT_SUSPEND

#define USB_HUB_C_PORT_SUSPEND   18

Definition at line 59 of file UsbHub.h.

◆ USB_HUB_CLASS_CODE

#define USB_HUB_CLASS_CODE   0x09

Definition at line 88 of file UsbHub.h.

◆ USB_HUB_GANG_POWER_CTRL

#define USB_HUB_GANG_POWER_CTRL   0

Definition at line 78 of file UsbHub.h.

◆ USB_HUB_PORT_CONNECTION

#define USB_HUB_PORT_CONNECTION   0

Definition at line 47 of file UsbHub.h.

◆ USB_HUB_PORT_ENABLE

#define USB_HUB_PORT_ENABLE   1

Definition at line 48 of file UsbHub.h.

◆ USB_HUB_PORT_INDICATOR

#define USB_HUB_PORT_INDICATOR   22

Definition at line 63 of file UsbHub.h.

◆ USB_HUB_PORT_LINK_STATE

#define USB_HUB_PORT_LINK_STATE   5

Definition at line 53 of file UsbHub.h.

◆ USB_HUB_PORT_LOW_SPEED

#define USB_HUB_PORT_LOW_SPEED   9

Definition at line 56 of file UsbHub.h.

◆ USB_HUB_PORT_OVER_CURRENT

#define USB_HUB_PORT_OVER_CURRENT   3

Definition at line 50 of file UsbHub.h.

◆ USB_HUB_PORT_POWER

#define USB_HUB_PORT_POWER   8

Definition at line 55 of file UsbHub.h.

◆ USB_HUB_PORT_POWER_CTRL

#define USB_HUB_PORT_POWER_CTRL   0x01

Definition at line 79 of file UsbHub.h.

◆ USB_HUB_PORT_REMOTE_WAKE_MASK

#define USB_HUB_PORT_REMOTE_WAKE_MASK   27

Definition at line 66 of file UsbHub.h.

◆ USB_HUB_PORT_RESET

#define USB_HUB_PORT_RESET   4

Definition at line 51 of file UsbHub.h.

◆ USB_HUB_PORT_SUSPEND

#define USB_HUB_PORT_SUSPEND   2

Definition at line 49 of file UsbHub.h.

◆ USB_HUB_PORT_TEST

#define USB_HUB_PORT_TEST   21

Definition at line 62 of file UsbHub.h.

◆ USB_HUB_REQ_CLEAR_FEATURE

#define USB_HUB_REQ_CLEAR_FEATURE   1

Definition at line 31 of file UsbHub.h.

◆ USB_HUB_REQ_CLEAR_TT

#define USB_HUB_REQ_CLEAR_TT   8

Definition at line 35 of file UsbHub.h.

◆ USB_HUB_REQ_GET_DESC

#define USB_HUB_REQ_GET_DESC   6

Definition at line 33 of file UsbHub.h.

◆ USB_HUB_REQ_GET_STATUS

#define USB_HUB_REQ_GET_STATUS   0

Definition at line 30 of file UsbHub.h.

◆ USB_HUB_REQ_GET_TT_STATE

#define USB_HUB_REQ_GET_TT_STATE   10

Definition at line 37 of file UsbHub.h.

◆ USB_HUB_REQ_RESET_TT

#define USB_HUB_REQ_RESET_TT   9

Definition at line 36 of file UsbHub.h.

◆ USB_HUB_REQ_SET_DEPTH

#define USB_HUB_REQ_SET_DEPTH   12

Definition at line 40 of file UsbHub.h.

◆ USB_HUB_REQ_SET_DESC

#define USB_HUB_REQ_SET_DESC   7

Definition at line 34 of file UsbHub.h.

◆ USB_HUB_REQ_SET_FEATURE

#define USB_HUB_REQ_SET_FEATURE   3

Definition at line 32 of file UsbHub.h.

◆ USB_HUB_REQ_STOP_TT

#define USB_HUB_REQ_STOP_TT   11

Definition at line 38 of file UsbHub.h.

◆ USB_HUB_STAT_C_LOCAL_POWER

#define USB_HUB_STAT_C_LOCAL_POWER   0x01

Definition at line 85 of file UsbHub.h.

◆ USB_HUB_STAT_C_OVER_CURRENT

#define USB_HUB_STAT_C_OVER_CURRENT   0x02

Definition at line 86 of file UsbHub.h.

◆ USB_HUB_STAT_LOCAL_POWER

#define USB_HUB_STAT_LOCAL_POWER   0x01

Definition at line 83 of file UsbHub.h.

◆ USB_HUB_STAT_OVER_CURRENT

#define USB_HUB_STAT_OVER_CURRENT   0x02

Definition at line 84 of file UsbHub.h.

◆ USB_HUB_SUBCLASS_CODE

#define USB_HUB_SUBCLASS_CODE   0x00

Definition at line 89 of file UsbHub.h.

◆ USB_HUB_TARGET_HUB

#define USB_HUB_TARGET_HUB   0

Definition at line 25 of file UsbHub.h.

◆ USB_HUB_TARGET_PORT

#define USB_HUB_TARGET_PORT   3

Definition at line 26 of file UsbHub.h.

◆ USB_SS_PORT_STAT_C_BH_RESET

#define USB_SS_PORT_STAT_C_BH_RESET   0x0020

Definition at line 73 of file UsbHub.h.

◆ USB_SS_PORT_STAT_C_PORT_LINK_STATE

#define USB_SS_PORT_STAT_C_PORT_LINK_STATE   0x0040

Definition at line 74 of file UsbHub.h.

◆ USB_WAIT_PORT_STS_CHANGE_LOOP

#define USB_WAIT_PORT_STS_CHANGE_LOOP   5000

Definition at line 95 of file UsbHub.h.

Function Documentation

◆ UsbHubAckHubStatus()

EFI_STATUS UsbHubAckHubStatus ( IN USB_DEVICE HubDev)

Ack the hub change bits. If these bits are not ACKed, Hub will always return changed bit map from its interrupt endpoint.

Parameters
UsbDevThe Usb device.
Return values
EFI_SUCCESSThe hub change status is ACKed.
OthersFailed to ACK the hub status.

Ack the hub change bits. If these bits are not ACKed, Hub will always return changed bit map from its interrupt endpoint.

Parameters
HubDevThe hub device.
Return values
EFI_SUCCESSThe hub change status is ACKed.
OthersFailed to ACK the hub status.

Definition at line 395 of file UsbHub.c.

◆ UsbHubCtrlClearTTBuffer()

EFI_STATUS UsbHubCtrlClearTTBuffer ( IN USB_DEVICE HubDev,
IN UINT8  Port,
IN UINT16  DevAddr,
IN UINT16  EpNum,
IN UINT16  EpType 
)

Clear the transaction translate buffer if full/low speed control/bulk transfer failed and the transfer uses this hub as translator.Remember to clear the TT buffer of transaction translator, not that of the parent.

Parameters
UsbDevThe Usb device.
PortThe port of the hub.
DevAddrAddress of the failed transaction.
EpNumThe endpoint number of the failed transaction.
EpTypeThe type of failed transaction.
Return values
EFI_SUCCESSThe TT buffer is cleared.
OthersFailed to clear the TT buffer.

Clear the transaction translate buffer if full/low speed control/bulk transfer failed and the transfer uses this hub as translator.Remember to clear the TT buffer of transaction translator, not that of the parent.

Parameters
HubDevThe hub device.
PortThe port of the hub.
DevAddrAddress of the failed transaction.
EpNumThe endpoint number of the failed transaction.
EpTypeThe type of failed transaction.
Return values
EFI_SUCCESSThe TT buffer is cleared.
OthersFailed to clear the TT buffer.

Definition at line 164 of file UsbHub.c.

◆ UsbIsHubInterface()

BOOLEAN UsbIsHubInterface ( IN USB_INTERFACE UsbIf)

Test whether the interface is a hub interface.

Parameters
UsbIfThe interface to test.
Return values
TRUEThe interface is a hub interface.
FALSEThe interface isn't a hub interface.

Definition at line 429 of file UsbHub.c.

Variable Documentation

◆ mUsbHubApi

USB_HUB_API mUsbHubApi
extern

Definition at line 1252 of file UsbHub.c.

◆ mUsbRootHubApi

USB_HUB_API mUsbRootHubApi
extern

Definition at line 1262 of file UsbHub.c.