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

Go to the source code of this file.

Data Structures

struct  EFI_USB_HUB_DESCRIPTOR
 
struct  EFI_USB_HUB_STATUS
 

Macros

#define C_HUB_LOCAL_POWER   0
 
#define C_HUB_OVER_CURRENT   1
 
#define CLASS_CODE_HUB   0x09
 
#define SUB_CLASS_CODE_HUB   0
 
#define HUB_STATUS_LOCAL_POWER   0x0001
 
#define HUB_STATUS_OVERCURRENT   0x0002
 
#define HUB_CHANGE_LOCAL_POWER   0x0001
 
#define HUB_CHANGE_OVERCURRENT   0x0002
 
#define HUB_CHAR_LPSM   0x0003
 
#define HUB_CHAR_COMPOUND   0x0004
 
#define HUB_CHAR_OCPM   0x0018
 
#define USB_HUB_CLEAR_FEATURE   0x01
 
#define USB_HUB_CLEAR_FEATURE_REQ_TYPE   0x20
 
#define USB_HUB_CLEAR_FEATURE_PORT   0x01
 
#define USB_HUB_CLEAR_FEATURE_PORT_REQ_TYPE   0x23
 
#define USB_HUB_GET_BUS_STATE   0x02
 
#define USB_HUB_GET_BUS_STATE_REQ_TYPE   0xA3
 
#define USB_HUB_GET_DESCRIPTOR   0x06
 
#define USB_HUB_GET_DESCRIPTOR_REQ_TYPE   0xA0
 
#define USB_HUB_GET_HUB_STATUS   0x00
 
#define USB_HUB_GET_HUB_STATUS_REQ_TYPE   0xA0
 
#define USB_HUB_GET_PORT_STATUS   0x00
 
#define USB_HUB_GET_PORT_STATUS_REQ_TYPE   0xA3
 
#define USB_HUB_SET_DESCRIPTOR   0x07
 
#define USB_HUB_SET_DESCRIPTOR_REQ_TYPE   0x20
 
#define USB_HUB_SET_HUB_FEATURE   0x03
 
#define USB_HUB_SET_HUB_FEATURE_REQ_TYPE   0x20
 
#define USB_HUB_SET_PORT_FEATURE   0x03
 
#define USB_HUB_SET_PORT_FEATURE_REQ_TYPE   0x23
 
#define USB_RT_HUB   (USB_TYPE_CLASS | USB_RECIP_DEVICE)
 
#define USB_RT_PORT   (USB_TYPE_CLASS | USB_RECIP_OTHER)
 
#define USB_HUB_REQ_SET_DEPTH   12
 
#define MAXBYTES   8
 

Functions

EFI_STATUS PeiHubGetPortStatus (IN EFI_PEI_SERVICES **PeiServices, IN PEI_USB_IO_PPI *UsbIoPpi, IN UINT8 Port, OUT UINT32 *PortStatus)
 
EFI_STATUS PeiHubSetPortFeature (IN EFI_PEI_SERVICES **PeiServices, IN PEI_USB_IO_PPI *UsbIoPpi, IN UINT8 Port, IN UINT8 Value)
 
EFI_STATUS PeiHubGetHubStatus (IN EFI_PEI_SERVICES **PeiServices, IN PEI_USB_IO_PPI *UsbIoPpi, OUT UINT32 *HubStatus)
 
EFI_STATUS PeiHubClearPortFeature (IN EFI_PEI_SERVICES **PeiServices, IN PEI_USB_IO_PPI *UsbIoPpi, IN UINT8 Port, IN UINT8 Value)
 
EFI_STATUS PeiHubClearHubFeature (IN EFI_PEI_SERVICES **PeiServices, IN PEI_USB_IO_PPI *UsbIoPpi, IN UINT8 Value)
 
EFI_STATUS PeiGetHubDescriptor (IN EFI_PEI_SERVICES **PeiServices, IN PEI_USB_DEVICE *PeiUsbDevice, IN PEI_USB_IO_PPI *UsbIoPpi, IN UINTN DescriptorSize, OUT EFI_USB_HUB_DESCRIPTOR *HubDescriptor)
 
EFI_STATUS PeiDoHubConfig (IN EFI_PEI_SERVICES **PeiServices, IN PEI_USB_DEVICE *PeiUsbDevice)
 
VOID PeiResetHubPort (IN EFI_PEI_SERVICES **PeiServices, IN PEI_USB_IO_PPI *UsbIoPpi, IN UINT8 PortNum)
 

Detailed Description

Constants definitions for Usb Hub Peim

Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.

SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file HubPeim.h.

Macro Definition Documentation

◆ C_HUB_LOCAL_POWER

#define C_HUB_LOCAL_POWER   0

Definition at line 16 of file HubPeim.h.

◆ C_HUB_OVER_CURRENT

#define C_HUB_OVER_CURRENT   1

Definition at line 17 of file HubPeim.h.

◆ CLASS_CODE_HUB

#define CLASS_CODE_HUB   0x09

Definition at line 22 of file HubPeim.h.

◆ HUB_CHANGE_LOCAL_POWER

#define HUB_CHANGE_LOCAL_POWER   0x0001

Definition at line 31 of file HubPeim.h.

◆ HUB_CHANGE_OVERCURRENT

#define HUB_CHANGE_OVERCURRENT   0x0002

Definition at line 32 of file HubPeim.h.

◆ HUB_CHAR_COMPOUND

#define HUB_CHAR_COMPOUND   0x0004

Definition at line 38 of file HubPeim.h.

◆ HUB_CHAR_LPSM

#define HUB_CHAR_LPSM   0x0003

Definition at line 37 of file HubPeim.h.

◆ HUB_CHAR_OCPM

#define HUB_CHAR_OCPM   0x0018

Definition at line 39 of file HubPeim.h.

◆ HUB_STATUS_LOCAL_POWER

#define HUB_STATUS_LOCAL_POWER   0x0001

Definition at line 28 of file HubPeim.h.

◆ HUB_STATUS_OVERCURRENT

#define HUB_STATUS_OVERCURRENT   0x0002

Definition at line 29 of file HubPeim.h.

◆ MAXBYTES

#define MAXBYTES   8

Definition at line 77 of file HubPeim.h.

◆ SUB_CLASS_CODE_HUB

#define SUB_CLASS_CODE_HUB   0

Definition at line 23 of file HubPeim.h.

◆ USB_HUB_CLEAR_FEATURE

#define USB_HUB_CLEAR_FEATURE   0x01

Definition at line 45 of file HubPeim.h.

◆ USB_HUB_CLEAR_FEATURE_PORT

#define USB_HUB_CLEAR_FEATURE_PORT   0x01

Definition at line 48 of file HubPeim.h.

◆ USB_HUB_CLEAR_FEATURE_PORT_REQ_TYPE

#define USB_HUB_CLEAR_FEATURE_PORT_REQ_TYPE   0x23

Definition at line 49 of file HubPeim.h.

◆ USB_HUB_CLEAR_FEATURE_REQ_TYPE

#define USB_HUB_CLEAR_FEATURE_REQ_TYPE   0x20

Definition at line 46 of file HubPeim.h.

◆ USB_HUB_GET_BUS_STATE

#define USB_HUB_GET_BUS_STATE   0x02

Definition at line 51 of file HubPeim.h.

◆ USB_HUB_GET_BUS_STATE_REQ_TYPE

#define USB_HUB_GET_BUS_STATE_REQ_TYPE   0xA3

Definition at line 52 of file HubPeim.h.

◆ USB_HUB_GET_DESCRIPTOR

#define USB_HUB_GET_DESCRIPTOR   0x06

Definition at line 54 of file HubPeim.h.

◆ USB_HUB_GET_DESCRIPTOR_REQ_TYPE

#define USB_HUB_GET_DESCRIPTOR_REQ_TYPE   0xA0

Definition at line 55 of file HubPeim.h.

◆ USB_HUB_GET_HUB_STATUS

#define USB_HUB_GET_HUB_STATUS   0x00

Definition at line 57 of file HubPeim.h.

◆ USB_HUB_GET_HUB_STATUS_REQ_TYPE

#define USB_HUB_GET_HUB_STATUS_REQ_TYPE   0xA0

Definition at line 58 of file HubPeim.h.

◆ USB_HUB_GET_PORT_STATUS

#define USB_HUB_GET_PORT_STATUS   0x00

Definition at line 60 of file HubPeim.h.

◆ USB_HUB_GET_PORT_STATUS_REQ_TYPE

#define USB_HUB_GET_PORT_STATUS_REQ_TYPE   0xA3

Definition at line 61 of file HubPeim.h.

◆ USB_HUB_REQ_SET_DEPTH

#define USB_HUB_REQ_SET_DEPTH   12

Definition at line 75 of file HubPeim.h.

◆ USB_HUB_SET_DESCRIPTOR

#define USB_HUB_SET_DESCRIPTOR   0x07

Definition at line 63 of file HubPeim.h.

◆ USB_HUB_SET_DESCRIPTOR_REQ_TYPE

#define USB_HUB_SET_DESCRIPTOR_REQ_TYPE   0x20

Definition at line 64 of file HubPeim.h.

◆ USB_HUB_SET_HUB_FEATURE

#define USB_HUB_SET_HUB_FEATURE   0x03

Definition at line 66 of file HubPeim.h.

◆ USB_HUB_SET_HUB_FEATURE_REQ_TYPE

#define USB_HUB_SET_HUB_FEATURE_REQ_TYPE   0x20

Definition at line 67 of file HubPeim.h.

◆ USB_HUB_SET_PORT_FEATURE

#define USB_HUB_SET_PORT_FEATURE   0x03

Definition at line 69 of file HubPeim.h.

◆ USB_HUB_SET_PORT_FEATURE_REQ_TYPE

#define USB_HUB_SET_PORT_FEATURE_REQ_TYPE   0x23

Definition at line 70 of file HubPeim.h.

◆ USB_RT_HUB

#define USB_RT_HUB   (USB_TYPE_CLASS | USB_RECIP_DEVICE)

Definition at line 72 of file HubPeim.h.

◆ USB_RT_PORT

#define USB_RT_PORT   (USB_TYPE_CLASS | USB_RECIP_OTHER)

Definition at line 73 of file HubPeim.h.

Function Documentation

◆ PeiDoHubConfig()

EFI_STATUS PeiDoHubConfig ( IN EFI_PEI_SERVICES **  PeiServices,
IN PEI_USB_DEVICE PeiUsbDevice 
)

Configure a given hub.

Parameters
PeiServicesGeneral-purpose services that are available to every PEIM.
PeiUsbDeviceIndicating the hub controller device that will be configured
Return values
EFI_SUCCESSHub configuration is done successfully.
EFI_DEVICE_ERRORCannot configure the hub due to a hardware error.

Definition at line 373 of file HubPeim.c.

◆ PeiGetHubDescriptor()

EFI_STATUS PeiGetHubDescriptor ( IN EFI_PEI_SERVICES **  PeiServices,
IN PEI_USB_DEVICE PeiUsbDevice,
IN PEI_USB_IO_PPI UsbIoPpi,
IN UINTN  DescriptorSize,
OUT EFI_USB_HUB_DESCRIPTOR HubDescriptor 
)

Get a given hub descriptor.

Parameters
PeiServicesGeneral-purpose services that are available to every PEIM.
PeiUsbDeviceIndicates the hub controller device.
UsbIoPpiIndicates the PEI_USB_IO_PPI instance.
DescriptorSizeThe length of Hub Descriptor buffer.
HubDescriptorCaller allocated buffer to store the hub descriptor if successfully returned.
Return values
EFI_SUCCESSHub descriptor is obtained successfully.
EFI_DEVICE_ERRORCannot get the hub descriptor due to a hardware error.
OthersOther failure occurs.

Get a given (SuperSpeed) hub descriptor.

Parameters
PeiServicesGeneral-purpose services that are available to every PEIM.
PeiUsbDeviceIndicates the hub controller device.
UsbIoPpiIndicates the PEI_USB_IO_PPI instance.
DescriptorSizeThe length of Hub Descriptor buffer.
HubDescriptorCaller allocated buffer to store the hub descriptor if successfully returned.
Return values
EFI_SUCCESSHub descriptor is obtained successfully.
EFI_DEVICE_ERRORCannot get the hub descriptor due to a hardware error.
OthersOther failure occurs.

Definition at line 244 of file HubPeim.c.

◆ PeiHubClearHubFeature()

EFI_STATUS PeiHubClearHubFeature ( IN EFI_PEI_SERVICES **  PeiServices,
IN PEI_USB_IO_PPI UsbIoPpi,
IN UINT8  Value 
)

Clear specified feature on a given hub.

Parameters
PeiServicesGeneral-purpose services that are available to every PEIM.
UsbIoPpiIndicates the PEI_USB_IO_PPI instance.
ValueFeature value that will be cleared from the hub port.
Return values
EFI_SUCCESSHub feature is cleared successfully.
EFI_DEVICE_ERRORCannot clear the hub feature due to a hardware error.
OthersOther failure occurs.

Definition at line 200 of file HubPeim.c.

◆ PeiHubClearPortFeature()

EFI_STATUS PeiHubClearPortFeature ( IN EFI_PEI_SERVICES **  PeiServices,
IN PEI_USB_IO_PPI UsbIoPpi,
IN UINT8  Port,
IN UINT8  Value 
)

Clear specified feature on a given hub port.

Parameters
PeiServicesGeneral-purpose services that are available to every PEIM.
UsbIoPpiIndicates the PEI_USB_IO_PPI instance.
PortUsb hub port number (starting from 1).
ValueFeature value that will be cleared from the hub port.
Return values
EFI_SUCCESSPort feature is cleared successfully.
EFI_DEVICE_ERRORCannot clear the port feature due to a hardware error.
OthersOther failure occurs.

Definition at line 116 of file HubPeim.c.

◆ PeiHubGetHubStatus()

EFI_STATUS PeiHubGetHubStatus ( IN EFI_PEI_SERVICES **  PeiServices,
IN PEI_USB_IO_PPI UsbIoPpi,
OUT UINT32 *  HubStatus 
)

Get a given hub status.

Parameters
PeiServicesGeneral-purpose services that are available to every PEIM.
UsbIoPpiIndicates the PEI_USB_IO_PPI instance.
HubStatusCurrent Hub status and change status.
Return values
EFI_SUCCESSHub status is obtained successfully.
EFI_DEVICE_ERRORCannot get the hub status due to a hardware error.
OthersOther failure occurs.

Definition at line 159 of file HubPeim.c.

◆ PeiHubGetPortStatus()

EFI_STATUS PeiHubGetPortStatus ( IN EFI_PEI_SERVICES **  PeiServices,
IN PEI_USB_IO_PPI UsbIoPpi,
IN UINT8  Port,
OUT UINT32 *  PortStatus 
)

Get a given hub port status.

Parameters
PeiServicesGeneral-purpose services that are available to every PEIM.
UsbIoPpiIndicates the PEI_USB_IO_PPI instance.
PortUsb hub port number (starting from 1).
PortStatusCurrent Hub port status and change status.
Return values
EFI_SUCCESSPort status is obtained successfully.
EFI_DEVICE_ERRORCannot get the port status due to a hardware error.
OthersOther failure occurs.

Definition at line 28 of file HubPeim.c.

◆ PeiHubSetPortFeature()

EFI_STATUS PeiHubSetPortFeature ( IN EFI_PEI_SERVICES **  PeiServices,
IN PEI_USB_IO_PPI UsbIoPpi,
IN UINT8  Port,
IN UINT8  Value 
)

Set specified feature to a given hub port.

Parameters
PeiServicesGeneral-purpose services that are available to every PEIM.
UsbIoPpiIndicates the PEI_USB_IO_PPI instance.
PortUsb hub port number (starting from 1).
ValueNew feature value.
Return values
EFI_SUCCESSPort feature is set successfully.
EFI_DEVICE_ERRORCannot set the port feature due to a hardware error.
OthersOther failure occurs.

Definition at line 72 of file HubPeim.c.

◆ PeiResetHubPort()

VOID PeiResetHubPort ( IN EFI_PEI_SERVICES **  PeiServices,
IN PEI_USB_IO_PPI UsbIoPpi,
IN UINT8  PortNum 
)

Send reset signal over the given root hub port.

Parameters
PeiServicesGeneral-purpose services that are available to every PEIM.
UsbIoPpiIndicates the PEI_USB_IO_PPI instance.
PortNumUsb hub port number (starting from 1).

Definition at line 484 of file HubPeim.c.