TianoCore EDK2 master
|
#include "XhcPeim.h"
Go to the source code of this file.
PEIM to produce gPeiUsb2HostControllerPpiGuid based on gPeiUsbControllerPpiGuid which is used to enable recovery function from USB Drivers.
Copyright (c) 2014 - 2018, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file XhcPeim.c.
EFI_STATUS EFIAPI XhcEndOfPei | ( | IN EFI_PEI_SERVICES ** | PeiServices, |
IN EFI_PEI_NOTIFY_DESCRIPTOR * | NotifyDescriptor, | ||
IN VOID * | Ppi | ||
) |
One notified function to stop the Host Controller at the end of PEI
[in] | PeiServices | Pointer to PEI Services Table. |
[in] | NotifyDescriptor | Pointer to the descriptor for the Notification event that caused this function to execute. |
[in] | Ppi | Pointer to the PPI data associated with this function. |
EFI_SUCCESS | The function completes successfully |
others |
EFI_STATUS EFIAPI XhcPeiBulkTransfer | ( | IN EFI_PEI_SERVICES ** | PeiServices, |
IN PEI_USB2_HOST_CONTROLLER_PPI * | This, | ||
IN UINT8 | DeviceAddress, | ||
IN UINT8 | EndPointAddress, | ||
IN UINT8 | DeviceSpeed, | ||
IN UINTN | MaximumPacketLength, | ||
IN OUT VOID * | Data[EFI_USB_MAX_BULK_BUFFER_NUM], | ||
IN OUT UINTN * | DataLength, | ||
IN OUT UINT8 * | DataToggle, | ||
IN UINTN | TimeOut, | ||
IN EFI_USB2_HC_TRANSACTION_TRANSLATOR * | Translator, | ||
OUT UINT32 * | TransferResult | ||
) |
Submits bulk transfer to a bulk endpoint of a USB device.
PeiServices | The pointer of EFI_PEI_SERVICES. |
This | The pointer of PEI_USB2_HOST_CONTROLLER_PPI. |
DeviceAddress | Target device address. |
EndPointAddress | Endpoint number and its direction in bit 7. |
DeviceSpeed | Device speed, Low speed device doesn't support bulk transfer. |
MaximumPacketLength | Maximum packet size the endpoint is capable of sending or receiving. |
Data | Array of pointers to the buffers of data to transmit from or receive into. |
DataLength | The lenght of the data buffer. |
DataToggle | On input, the initial data toggle for the transfer; On output, it is updated to to next data toggle to use of the subsequent bulk transfer. |
TimeOut | Indicates the maximum time, in millisecond, which the transfer is allowed to complete. If Timeout is 0, then the caller must wait for the function to be completed until EFI_SUCCESS or EFI_DEVICE_ERROR is returned. |
Translator | A pointr to the transaction translator data. |
TransferResult | A pointer to the detailed result information of the bulk transfer. |
EFI_SUCCESS | The transfer was completed successfully. |
EFI_OUT_OF_RESOURCES | The transfer failed due to lack of resource. |
EFI_INVALID_PARAMETER | Parameters are invalid. |
EFI_TIMEOUT | The transfer failed due to timeout. |
EFI_DEVICE_ERROR | The transfer failed due to host controller error. |
VOID XhcPeiClearOpRegBit | ( | IN PEI_XHC_DEV * | Xhc, |
IN UINT32 | Offset, | ||
IN UINT32 | Bit | ||
) |
EFI_STATUS EFIAPI XhcPeiClearRootHubPortFeature | ( | IN EFI_PEI_SERVICES ** | PeiServices, |
IN PEI_USB2_HOST_CONTROLLER_PPI * | This, | ||
IN UINT8 | PortNumber, | ||
IN EFI_USB_PORT_FEATURE | PortFeature | ||
) |
Clears a feature for the specified root hub port.
PeiServices | The pointer of EFI_PEI_SERVICES. |
This | The pointer of PEI_USB2_HOST_CONTROLLER_PPI. |
PortNumber | Specifies the root hub port whose feature is requested to be cleared. |
PortFeature | Indicates the feature selector associated with the feature clear request. |
EFI_SUCCESS | The feature specified by PortFeature was cleared for the USB root hub port specified by PortNumber. |
EFI_INVALID_PARAMETER | PortNumber is invalid or PortFeature is invalid. |
VOID XhcPeiClearRuntimeRegBit | ( | IN PEI_XHC_DEV * | Xhc, |
IN UINT32 | Offset, | ||
IN UINT32 | Bit | ||
) |
EFI_STATUS EFIAPI XhcPeiControlTransfer | ( | IN EFI_PEI_SERVICES ** | PeiServices, |
IN PEI_USB2_HOST_CONTROLLER_PPI * | This, | ||
IN UINT8 | DeviceAddress, | ||
IN UINT8 | DeviceSpeed, | ||
IN UINTN | MaximumPacketLength, | ||
IN EFI_USB_DEVICE_REQUEST * | Request, | ||
IN EFI_USB_DATA_DIRECTION | TransferDirection, | ||
IN OUT VOID * | Data, | ||
IN OUT UINTN * | DataLength, | ||
IN UINTN | TimeOut, | ||
IN EFI_USB2_HC_TRANSACTION_TRANSLATOR * | Translator, | ||
OUT UINT32 * | TransferResult | ||
) |
Submits control transfer to a target USB device.
PeiServices | The pointer of EFI_PEI_SERVICES. |
This | The pointer of PEI_USB2_HOST_CONTROLLER_PPI. |
DeviceAddress | The target device address. |
DeviceSpeed | Target device speed. |
MaximumPacketLength | Maximum packet size the default control transfer endpoint is capable of sending or receiving. |
Request | USB device request to send. |
TransferDirection | Specifies the data direction for the data stage. |
Data | Data buffer to be transmitted or received from USB device. |
DataLength | The size (in bytes) of the data buffer. |
TimeOut | Indicates the maximum timeout, in millisecond. If Timeout is 0, then the caller must wait for the function to be completed until EFI_SUCCESS or EFI_DEVICE_ERROR is returned. |
Translator | Transaction translator to be used by this device. |
TransferResult | Return the result of this control transfer. |
EFI_SUCCESS | Transfer was completed successfully. |
EFI_OUT_OF_RESOURCES | The transfer failed due to lack of resources. |
EFI_INVALID_PARAMETER | Some parameters are invalid. |
EFI_TIMEOUT | Transfer failed due to timeout. |
EFI_DEVICE_ERROR | Transfer failed due to host controller or device error. |
EFI_STATUS EFIAPI XhcPeiGetRootHubPortNumber | ( | IN EFI_PEI_SERVICES ** | PeiServices, |
IN PEI_USB2_HOST_CONTROLLER_PPI * | This, | ||
OUT UINT8 * | PortNumber | ||
) |
Retrieves the number of root hub ports.
[in] | PeiServices | The pointer to the PEI Services Table. |
[in] | This | The pointer to this instance of the PEI_USB2_HOST_CONTROLLER_PPI. |
[out] | PortNumber | The pointer to the number of the root hub ports. |
EFI_SUCCESS | The port number was retrieved successfully. |
EFI_INVALID_PARAMETER | PortNumber is NULL. |
EFI_STATUS EFIAPI XhcPeiGetRootHubPortStatus | ( | IN EFI_PEI_SERVICES ** | PeiServices, |
IN PEI_USB2_HOST_CONTROLLER_PPI * | This, | ||
IN UINT8 | PortNumber, | ||
OUT EFI_USB_PORT_STATUS * | PortStatus | ||
) |
Retrieves the current status of a USB root hub port.
PeiServices | The pointer of EFI_PEI_SERVICES. |
This | The pointer of PEI_USB2_HOST_CONTROLLER_PPI. |
PortNumber | The root hub port to retrieve the state from. |
PortStatus | Variable to receive the port state. |
EFI_SUCCESS | The status of the USB root hub port specified. by PortNumber was returned in PortStatus. |
EFI_INVALID_PARAMETER | PortNumber is invalid. |
EFI_STATUS XhcPeiHaltHC | ( | IN PEI_XHC_DEV * | Xhc, |
IN UINT32 | Timeout | ||
) |
BOOLEAN XhcPeiIsHalt | ( | IN PEI_XHC_DEV * | Xhc | ) |
BOOLEAN XhcPeiIsSysError | ( | IN PEI_XHC_DEV * | Xhc | ) |
EFI_STATUS EFIAPI XhcPeimEntry | ( | IN EFI_PEI_FILE_HANDLE | FileHandle, |
IN CONST EFI_PEI_SERVICES ** | PeiServices | ||
) |
UINT32 XhcPeiReadCapRegister | ( | IN PEI_XHC_DEV * | Xhc, |
IN UINT32 | Offset | ||
) |
UINT32 XhcPeiReadOpReg | ( | IN PEI_XHC_DEV * | Xhc, |
IN UINT32 | Offset | ||
) |
UINT32 XhcPeiReadRuntimeReg | ( | IN PEI_XHC_DEV * | Xhc, |
IN UINT32 | Offset | ||
) |
EFI_STATUS XhcPeiResetHC | ( | IN PEI_XHC_DEV * | Xhc, |
IN UINT32 | Timeout | ||
) |
EFI_STATUS XhcPeiRunHC | ( | IN PEI_XHC_DEV * | Xhc, |
IN UINT32 | Timeout | ||
) |
VOID XhcPeiSetOpRegBit | ( | IN PEI_XHC_DEV * | Xhc, |
IN UINT32 | Offset, | ||
IN UINT32 | Bit | ||
) |
EFI_STATUS EFIAPI XhcPeiSetRootHubPortFeature | ( | IN EFI_PEI_SERVICES ** | PeiServices, |
IN PEI_USB2_HOST_CONTROLLER_PPI * | This, | ||
IN UINT8 | PortNumber, | ||
IN EFI_USB_PORT_FEATURE | PortFeature | ||
) |
Sets a feature for the specified root hub port.
PeiServices | The pointer of EFI_PEI_SERVICES |
This | The pointer of PEI_USB2_HOST_CONTROLLER_PPI |
PortNumber | Root hub port to set. |
PortFeature | Feature to set. |
EFI_SUCCESS | The feature specified by PortFeature was set. |
EFI_INVALID_PARAMETER | PortNumber is invalid or PortFeature is invalid. |
EFI_TIMEOUT | The time out occurred. |
VOID XhcPeiSetRuntimeRegBit | ( | IN PEI_XHC_DEV * | Xhc, |
IN UINT32 | Offset, | ||
IN UINT32 | Bit | ||
) |
EFI_STATUS XhcPeiWaitOpRegBit | ( | IN PEI_XHC_DEV * | Xhc, |
IN UINT32 | Offset, | ||
IN UINT32 | Bit, | ||
IN BOOLEAN | WaitToSet, | ||
IN UINT32 | Timeout | ||
) |
Wait the operation register's bit as specified by Bit to become set (or clear).
Xhc | The XHCI device. |
Offset | The offset of the operational register. |
Bit | The bit mask of the register to wait for. |
WaitToSet | Wait the bit to set or clear. |
Timeout | The time to wait before abort (in millisecond, ms). |
EFI_SUCCESS | The bit successfully changed by host controller. |
EFI_TIMEOUT | The time out occurred. |
VOID XhcPeiWriteDoorBellReg | ( | IN PEI_XHC_DEV * | Xhc, |
IN UINT32 | Offset, | ||
IN UINT32 | Data | ||
) |
VOID XhcPeiWriteOpReg | ( | IN PEI_XHC_DEV * | Xhc, |
IN UINT32 | Offset, | ||
IN UINT32 | Data | ||
) |
VOID XhcPeiWriteRuntimeReg | ( | IN PEI_XHC_DEV * | Xhc, |
IN UINT32 | Offset, | ||
IN UINT32 | Data | ||
) |
USB_CLEAR_PORT_MAP mUsbClearPortChangeMap[] |
USB_CLEAR_PORT_MAP mUsbHubClearPortChangeMap[] |
USB_PORT_STATE_MAP mUsbHubPortChangeMap[] |
USB_PORT_STATE_MAP mUsbHubPortStateMap[] |
USB_PORT_STATE_MAP mUsbPortChangeMap[] |
USB_PORT_STATE_MAP mUsbPortStateMap[] |