TianoCore EDK2 master
Loading...
Searching...
No Matches
EhciSched.c File Reference
#include "EhcPeim.h"

Go to the source code of this file.

Functions

EFI_STATUS EhcCreateHelpQ (IN PEI_USB2_HC_DEV *Ehc)
 
EFI_STATUS EhcInitSched (IN PEI_USB2_HC_DEV *Ehc)
 
VOID EhcFreeSched (IN PEI_USB2_HC_DEV *Ehc)
 
VOID EhcLinkQhToAsync (IN PEI_USB2_HC_DEV *Ehc, IN PEI_EHC_QH *Qh)
 
VOID EhcUnlinkQhFromAsync (IN PEI_USB2_HC_DEV *Ehc, IN PEI_EHC_QH *Qh)
 
BOOLEAN EhcCheckUrbResult (IN PEI_USB2_HC_DEV *Ehc, IN PEI_URB *Urb)
 
EFI_STATUS EhcExecTransfer (IN PEI_USB2_HC_DEV *Ehc, IN PEI_URB *Urb, IN UINTN TimeOut)
 

Detailed Description

PEIM to produce gPeiUsb2HostControllerPpiGuid based on gPeiUsbControllerPpiGuid which is used to enable recovery function from USB Drivers.

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

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

Definition in file EhciSched.c.

Function Documentation

◆ EhcCheckUrbResult()

BOOLEAN EhcCheckUrbResult ( IN PEI_USB2_HC_DEV Ehc,
IN PEI_URB Urb 
)

Check the URB's execution result and update the URB's result accordingly.

Parameters
EhcThe EHCI device.
UrbThe URB to check result.
Return values
TRUEURB transfer is finialized.
FALSEURB transfer is not finialized.

Definition at line 304 of file EhciSched.c.

◆ EhcCreateHelpQ()

EFI_STATUS EhcCreateHelpQ ( IN PEI_USB2_HC_DEV Ehc)

Create helper QTD/QH for the EHCI device.

Parameters
EhcThe EHCI device.
Return values
EFI_OUT_OF_RESOURCESFailed to allocate resource for helper QTD/QH.
EFI_SUCCESSHelper QH/QTD are created.

Definition at line 24 of file EhciSched.c.

◆ EhcExecTransfer()

EFI_STATUS EhcExecTransfer ( IN PEI_USB2_HC_DEV Ehc,
IN PEI_URB Urb,
IN UINTN  TimeOut 
)

Execute the transfer by polling the URB. This is a synchronous operation.

Parameters
EhcThe EHCI device.
UrbThe URB to execute.
TimeOutThe time to wait before abort, in millisecond.
Return values
EFI_DEVICE_ERRORThe transfer failed due to transfer error.
EFI_TIMEOUTThe transfer failed due to time out.
EFI_SUCCESSThe transfer finished OK.

Definition at line 417 of file EhciSched.c.

◆ EhcFreeSched()

VOID EhcFreeSched ( IN PEI_USB2_HC_DEV Ehc)

Free the schedule data. It may be partially initialized.

Parameters
EhcThe EHCI device.

Definition at line 188 of file EhciSched.c.

◆ EhcInitSched()

EFI_STATUS EhcInitSched ( IN PEI_USB2_HC_DEV Ehc)

Initialize the schedule data structure such as frame list.

Parameters
EhcThe EHCI device to init schedule data for.
Return values
EFI_OUT_OF_RESOURCESFailed to allocate resource to init schedule data.
EFI_SUCCESSThe schedule data is initialized.

Definition at line 100 of file EhciSched.c.

◆ EhcLinkQhToAsync()

VOID EhcLinkQhToAsync ( IN PEI_USB2_HC_DEV Ehc,
IN PEI_EHC_QH Qh 
)

Link the queue head to the asynchronous schedule list. UEFI only supports one CTRL/BULK transfer at a time due to its interfaces. This simplifies the AsynList management: A reclamation header is always linked to the AsyncListAddr, the only active QH is appended to it.

Parameters
EhcThe EHCI device.
QhThe queue head to link.

Definition at line 233 of file EhciSched.c.

◆ EhcUnlinkQhFromAsync()

VOID EhcUnlinkQhFromAsync ( IN PEI_USB2_HC_DEV Ehc,
IN PEI_EHC_QH Qh 
)

Unlink a queue head from the asynchronous schedule list. Need to synchronize with hardware.

Parameters
EhcThe EHCI device.
QhThe queue head to unlink.

Definition at line 263 of file EhciSched.c.