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

Go to the source code of this file.

Data Structures

struct  UHCI_QH_RESULT
 
struct  _UHCI_ASYNC_REQUEST
 

Macros

#define UHCI_ASYNC_INT_SIGNATURE   SIGNATURE_32 ('u', 'h', 'c', 'a')
 
#define USB_ERR_FAIL_MASK
 
#define UHCI_ASYNC_INT_FROM_LINK(a)    CR (a, UHCI_ASYNC_REQUEST, Link, UHCI_ASYNC_INT_SIGNATURE)
 

Typedefs

typedef struct _UHCI_ASYNC_REQUEST UHCI_ASYNC_REQUEST
 

Functions

EFI_STATUS UhciInitFrameList (IN USB_HC_DEV *Uhc)
 
VOID UhciDestoryFrameList (IN USB_HC_DEV *Uhc)
 
UINTN UhciConvertPollRate (IN UINTN Interval)
 
VOID UhciLinkQhToFrameList (USB_HC_DEV *Uhc, UHCI_QH_SW *Qh)
 
VOID UhciUnlinkQhFromFrameList (USB_HC_DEV *Uhc, UHCI_QH_SW *Qh)
 
EFI_STATUS UhciExecuteTransfer (IN USB_HC_DEV *Uhc, IN UHCI_QH_SW *Qh, IN UHCI_TD_SW *Td, IN UINTN TimeOut, IN BOOLEAN IsLow, OUT UHCI_QH_RESULT *QhResult)
 
EFI_STATUS UhciCreateAsyncReq (IN USB_HC_DEV *Uhc, IN UHCI_QH_SW *Qh, IN UHCI_TD_SW *FirstTd, IN UINT8 DevAddr, IN UINT8 EndPoint, IN UINTN DataLen, IN UINTN Interval, IN UINT8 *Data, IN EFI_ASYNC_USB_TRANSFER_CALLBACK Callback, IN VOID *Context, IN BOOLEAN IsLow)
 
EFI_STATUS UhciRemoveAsyncReq (IN USB_HC_DEV *Uhc, IN UINT8 DevAddr, IN UINT8 EndPoint, OUT UINT8 *Toggle)
 
VOID UhciFreeAllAsyncReq (IN USB_HC_DEV *Uhc)
 
VOID EFIAPI UhciMonitorAsyncReqList (IN EFI_EVENT Event, IN VOID *Context)
 

Detailed Description

The definition for EHCI register operation routines.

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

Definition in file UhciSched.h.

Macro Definition Documentation

◆ UHCI_ASYNC_INT_FROM_LINK

#define UHCI_ASYNC_INT_FROM_LINK (   a)     CR (a, UHCI_ASYNC_REQUEST, Link, UHCI_ASYNC_INT_SIGNATURE)

Definition at line 71 of file UhciSched.h.

◆ UHCI_ASYNC_INT_SIGNATURE

#define UHCI_ASYNC_INT_SIGNATURE   SIGNATURE_32 ('u', 'h', 'c', 'a')

Definition at line 13 of file UhciSched.h.

◆ USB_ERR_FAIL_MASK

#define USB_ERR_FAIL_MASK
Value:
(EFI_USB_ERR_STALL | EFI_USB_ERR_BUFFER | \
EFI_USB_ERR_BABBLE | EFI_USB_ERR_CRC | \
EFI_USB_ERR_TIMEOUT | EFI_USB_ERR_BITSTUFF | \
EFI_USB_ERR_SYSTEM)

Definition at line 20 of file UhciSched.h.

Typedef Documentation

◆ UHCI_ASYNC_REQUEST

Definition at line 37 of file UhciSched.h.

Function Documentation

◆ UhciConvertPollRate()

UINTN UhciConvertPollRate ( IN UINTN  Interval)

Convert the poll rate to the maxium 2^n that is smaller than Interval.

Parameters
IntervalThe poll rate to convert.
Returns
The converted poll rate.

Convert the poll rate to the maximum 2^n that is smaller than Interval.

Parameters
IntervalThe poll rate to convert.
Returns
The converted poll rate.

Definition at line 209 of file UhciSched.c.

◆ UhciCreateAsyncReq()

EFI_STATUS UhciCreateAsyncReq ( IN USB_HC_DEV Uhc,
IN UHCI_QH_SW Qh,
IN UHCI_TD_SW FirstTd,
IN UINT8  DevAddr,
IN UINT8  EndPoint,
IN UINTN  DataLen,
IN UINTN  Interval,
IN UINT8 *  Data,
IN EFI_ASYNC_USB_TRANSFER_CALLBACK  Callback,
IN VOID *  Context,
IN BOOLEAN  IsLow 
)

Create Async Request node, and Link to List.

Parameters
UhcThe UHCI device.
QhThe queue head of the transfer.
FirstTdFirst TD of the transfer.
DevAddrDevice Address.
EndPointEndPoint Address.
DataLenData length.
IntervalPolling Interval when inserted to frame list.
DataData buffer, unmapped.
CallbackCallback after interrupt transfeer.
ContextCallback Context passed as function parameter.
IsLowIs Low Speed.
Return values
EFI_SUCCESSAn asynchronous transfer is created.
EFI_INVALID_PARAMETERParemeter is error.
EFI_OUT_OF_RESOURCESFailed because of resource shortage.

Definition at line 683 of file UhciSched.c.

◆ UhciDestoryFrameList()

VOID UhciDestoryFrameList ( IN USB_HC_DEV Uhc)

Destory FrameList buffer.

Parameters
UhcThe UHCI device.
Returns
None.

Destory FrameList buffer.

Parameters
UhcThe UHCI device.

Definition at line 159 of file UhciSched.c.

◆ UhciExecuteTransfer()

EFI_STATUS UhciExecuteTransfer ( IN USB_HC_DEV Uhc,
IN UHCI_QH_SW Qh,
IN UHCI_TD_SW Td,
IN UINTN  TimeOut,
IN BOOLEAN  IsLow,
OUT UHCI_QH_RESULT QhResult 
)

Check the result of the transfer.

Parameters
UhcThe UHCI device.
QhThe queue head of the transfer.
TdThe first TDs of the transfer.
TimeOutTimeOut value in milliseconds.
IsLowIs Low Speed Device.
QhResultThe variable to return result.
Return values
EFI_SUCCESSThe transfer finished with success.
EFI_DEVICE_ERRORTransfer failed.

Definition at line 558 of file UhciSched.c.

◆ UhciFreeAllAsyncReq()

VOID UhciFreeAllAsyncReq ( IN USB_HC_DEV Uhc)

Release all the asynchronous transfers on the lsit.

Parameters
UhcThe UHCI device.
Returns
None.

Release all the asynchronous transfers on the lsit.

Parameters
UhcThe UHCI device.

Definition at line 907 of file UhciSched.c.

◆ UhciInitFrameList()

EFI_STATUS UhciInitFrameList ( IN USB_HC_DEV Uhc)

Create Frame List Structure.

Parameters
UhcThe UHCI device.
Returns
EFI_OUT_OF_RESOURCES Can't allocate memory resources.
EFI_UNSUPPORTED Map memory fail.
EFI_SUCCESS Success.

Create Frame List Structure.

Parameters
UhcUHCI device.
Return values
EFI_OUT_OF_RESOURCESCan't allocate memory resources.
EFI_UNSUPPORTEDMap memory fail.
EFI_SUCCESSSuccess.

Definition at line 23 of file UhciSched.c.

◆ UhciLinkQhToFrameList()

VOID UhciLinkQhToFrameList ( USB_HC_DEV Uhc,
UHCI_QH_SW Qh 
)

Link a queue head (for asynchronous interrupt transfer) to the frame list.

Parameters
UhcThe UHCI device.
QhThe queue head to link into.

Definition at line 247 of file UhciSched.c.

◆ UhciMonitorAsyncReqList()

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

Interrupt transfer periodic check handler.

Parameters
EventThe event of the time.
ContextContext of the event, pointer to USB_HC_DEV.
Returns
None.

Interrupt transfer periodic check handler.

Parameters
EventThe event of the time.
ContextContext of the event, pointer to USB_HC_DEV.

Definition at line 943 of file UhciSched.c.

◆ UhciRemoveAsyncReq()

EFI_STATUS UhciRemoveAsyncReq ( IN USB_HC_DEV Uhc,
IN UINT8  DevAddr,
IN UINT8  EndPoint,
OUT UINT8 *  Toggle 
)

Delete Async Interrupt QH and TDs.

Parameters
UhcThe UHCI device.
DevAddrDevice Address.
EndPointEndPoint Address.
ToggleThe next data toggle to use.
Return values
EFI_SUCCESSThe request is deleted.
EFI_INVALID_PARAMETERParemeter is error.
EFI_NOT_FOUNDThe asynchronous isn't found.

Definition at line 808 of file UhciSched.c.

◆ UhciUnlinkQhFromFrameList()

VOID UhciUnlinkQhFromFrameList ( USB_HC_DEV Uhc,
UHCI_QH_SW Qh 
)

Unlink QH from the frame list is easier: find all the precedence node, and pointer there next to QhSw's next.

Parameters
UhcThe UHCI device.
QhThe queue head to unlink.

Definition at line 355 of file UhciSched.c.