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

Go to the source code of this file.

Functions

EFI_STATUS EhcInitSched (IN USB2_HC_DEV *Ehc)
 
VOID EhcFreeSched (IN USB2_HC_DEV *Ehc)
 
VOID EhcLinkQhToAsync (IN USB2_HC_DEV *Ehc, IN EHC_QH *Qh)
 
VOID EhcUnlinkQhFromAsync (IN USB2_HC_DEV *Ehc, IN EHC_QH *Qh)
 
VOID EhcLinkQhToPeriod (IN USB2_HC_DEV *Ehc, IN EHC_QH *Qh)
 
VOID EhcUnlinkQhFromPeriod (IN USB2_HC_DEV *Ehc, IN EHC_QH *Qh)
 
EFI_STATUS EhcExecTransfer (IN USB2_HC_DEV *Ehc, IN URB *Urb, IN UINTN TimeOut)
 
EFI_STATUS EhciDelAsyncIntTransfer (IN USB2_HC_DEV *Ehc, IN UINT8 DevAddr, IN UINT8 EpNum, OUT UINT8 *DataToggle)
 
VOID EhciDelAllAsyncIntTransfers (IN USB2_HC_DEV *Ehc)
 
URBEhciInsertAsyncIntTransfer (IN USB2_HC_DEV *Ehc, IN UINT8 DevAddr, IN UINT8 EpAddr, IN UINT8 DevSpeed, IN UINT8 Toggle, IN UINTN MaxPacket, IN EFI_USB2_HC_TRANSACTION_TRANSLATOR *Hub, IN UINTN DataLen, IN EFI_ASYNC_USB_TRANSFER_CALLBACK Callback, IN VOID *Context, IN UINTN Interval)
 
VOID EFIAPI EhcMonitorAsyncRequests (IN EFI_EVENT Event, IN VOID *Context)
 

Detailed Description

This file contains the definination for host controller schedule routines.

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

Definition in file EhciSched.h.

Function Documentation

◆ EhcExecTransfer()

EFI_STATUS EhcExecTransfer ( IN USB2_HC_DEV Ehc,
IN 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.

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.
Returns
EFI_DEVICE_ERROR The transfer failed due to transfer error.
EFI_TIMEOUT The transfer failed due to time out.
EFI_SUCCESS The transfer finished OK.

Definition at line 668 of file EhciSched.c.

◆ EhcFreeSched()

VOID EhcFreeSched ( IN USB2_HC_DEV Ehc)

Free the schedule data. It may be partially initialized.

Parameters
EhcThe EHCI device.

Definition at line 250 of file EhciSched.c.

◆ EhciDelAllAsyncIntTransfers()

VOID EhciDelAllAsyncIntTransfers ( IN USB2_HC_DEV Ehc)

Remove all the asynchronous interrutp transfers.

Parameters
EhcThe EHCI device.

Definition at line 780 of file EhciSched.c.

◆ EhciDelAsyncIntTransfer()

EFI_STATUS EhciDelAsyncIntTransfer ( IN USB2_HC_DEV Ehc,
IN UINT8  DevAddr,
IN UINT8  EpNum,
OUT UINT8 *  DataToggle 
)

Delete a single asynchronous interrupt transfer for the device and endpoint.

Parameters
EhcThe EHCI device.
DevAddrThe address of the target device.
EpNumThe endpoint of the target.
DataToggleReturn the next data toggle to use.
Return values
EFI_SUCCESSAn asynchronous transfer is removed.
EFI_NOT_FOUNDNo transfer for the device is found.

Definition at line 733 of file EhciSched.c.

◆ EhciInsertAsyncIntTransfer()

URB * EhciInsertAsyncIntTransfer ( IN USB2_HC_DEV Ehc,
IN UINT8  DevAddr,
IN UINT8  EpAddr,
IN UINT8  DevSpeed,
IN UINT8  Toggle,
IN UINTN  MaxPacket,
IN EFI_USB2_HC_TRANSACTION_TRANSLATOR Hub,
IN UINTN  DataLen,
IN EFI_ASYNC_USB_TRANSFER_CALLBACK  Callback,
IN VOID *  Context,
IN UINTN  Interval 
)

Insert a single asynchronous interrupt transfer for the device and endpoint.

Parameters
EhcThe EHCI device.
DevAddrThe device address.
EpAddrEndpoint addrress & its direction.
DevSpeedThe device speed.
ToggleInitial data toggle to use.
MaxPacketThe max packet length of the endpoint.
HubThe transaction translator to use.
DataLenThe length of data buffer.
CallbackThe function to call when data is transferred.
ContextThe context to the callback.
IntervalThe interval for interrupt transfer.
Returns
Created URB or NULL.

Definition at line 819 of file EhciSched.c.

◆ EhcInitSched()

EFI_STATUS EhcInitSched ( IN 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.

Initialize the schedule data structure such as frame list.

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

Definition at line 102 of file EhciSched.c.

◆ EhcLinkQhToAsync()

VOID EhcLinkQhToAsync ( IN USB2_HC_DEV Ehc,
IN 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 312 of file EhciSched.c.

◆ EhcLinkQhToPeriod()

VOID EhcLinkQhToPeriod ( IN USB2_HC_DEV Ehc,
IN EHC_QH Qh 
)

Link a queue head for interrupt transfer to the periodic schedule frame list. This code is very much the same as that in UHCI.

Parameters
EhcThe EHCI device.
QhThe queue head to link.

Definition at line 389 of file EhciSched.c.

◆ EhcMonitorAsyncRequests()

VOID EFIAPI EhcMonitorAsyncRequests ( IN EFI_EVENT  Event,
IN VOID *  Context 
)

Interrupt transfer periodic check handler.

Parameters
EventInterrupt event.
ContextPointer to USB2_HC_DEV.

Definition at line 1021 of file EhciSched.c.

◆ EhcUnlinkQhFromAsync()

VOID EhcUnlinkQhFromAsync ( IN USB2_HC_DEV Ehc,
IN 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 345 of file EhciSched.c.

◆ EhcUnlinkQhFromPeriod()

VOID EhcUnlinkQhFromPeriod ( IN USB2_HC_DEV Ehc,
IN EHC_QH Qh 
)

Unlink an interrupt queue head from the periodic schedule frame list.

Parameters
EhcThe EHCI device.
QhThe queue head to unlink.

Definition at line 490 of file EhciSched.c.