TianoCore EDK2 master
Loading...
Searching...
No Matches
HubPeim.c File Reference
#include "UsbPeim.h"
#include "HubPeim.h"
#include "PeiUsbLib.h"

Go to the source code of this file.

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 PeiHubClearPortFeature (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 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 PeiUsbHubReadDesc (IN EFI_PEI_SERVICES **PeiServices, IN PEI_USB_DEVICE *PeiUsbDevice, IN PEI_USB_IO_PPI *UsbIoPpi, OUT EFI_USB_HUB_DESCRIPTOR *HubDescriptor)
 
EFI_STATUS PeiUsbHubCtrlSetHubDepth (IN EFI_PEI_SERVICES **PeiServices, IN PEI_USB_DEVICE *PeiUsbDevice, IN PEI_USB_IO_PPI *UsbIoPpi)
 
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

Usb Hub Request Support In PEI Phase

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

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

Definition in file HubPeim.c.

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 (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.

◆ PeiUsbHubCtrlSetHubDepth()

EFI_STATUS PeiUsbHubCtrlSetHubDepth ( IN EFI_PEI_SERVICES **  PeiServices,
IN PEI_USB_DEVICE PeiUsbDevice,
IN PEI_USB_IO_PPI UsbIoPpi 
)

USB hub control transfer to set the hub depth.

Parameters
PeiServicesGeneral-purpose services that are available to every PEIM.
PeiUsbDeviceIndicates the hub controller device.
UsbIoPpiIndicates the PEI_USB_IO_PPI instance.
Return values
EFI_SUCCESSDepth of the hub is set.
OthersFailed to set the depth.

Definition at line 333 of file HubPeim.c.

◆ PeiUsbHubReadDesc()

EFI_STATUS PeiUsbHubReadDesc ( IN EFI_PEI_SERVICES **  PeiServices,
IN PEI_USB_DEVICE PeiUsbDevice,
IN PEI_USB_IO_PPI UsbIoPpi,
OUT EFI_USB_HUB_DESCRIPTOR HubDescriptor 
)

Read the whole usb hub descriptor. It is necessary to do it in two steps because hub descriptor is of variable length.

Parameters
PeiServicesGeneral-purpose services that are available to every PEIM.
PeiUsbDeviceIndicates the hub controller device.
UsbIoPpiIndicates the PEI_USB_IO_PPI instance.
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 297 of file HubPeim.c.