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

Go to the source code of this file.

Functions

PEI_EHC_QTDEhcCreateQtd (IN PEI_USB2_HC_DEV *Ehc, IN UINT8 *Data, IN UINTN DataLen, IN UINT8 PktId, IN UINT8 Toggle, IN UINTN MaxPacket)
 
VOID EhcInitIntQh (IN USB_ENDPOINT *Ep, IN QH_HW *QhHw)
 
PEI_EHC_QHEhcCreateQh (IN PEI_USB2_HC_DEV *Ehci, IN USB_ENDPOINT *Ep)
 
UINTN EhcConvertPollRate (IN UINTN Interval)
 
VOID EhcFreeQtds (IN PEI_USB2_HC_DEV *Ehc, IN EFI_LIST_ENTRY *Qtds)
 
VOID EhcFreeUrb (IN PEI_USB2_HC_DEV *Ehc, IN PEI_URB *Urb)
 
EFI_STATUS EhcCreateQtds (IN PEI_USB2_HC_DEV *Ehc, IN PEI_URB *Urb)
 
PEI_URBEhcCreateUrb (IN PEI_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 Type, IN EFI_USB_DEVICE_REQUEST *Request, IN VOID *Data, IN UINTN DataLen, IN EFI_ASYNC_USB_TRANSFER_CALLBACK Callback, IN VOID *Context, IN UINTN Interval)
 

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 EhciUrb.c.

Function Documentation

◆ EhcConvertPollRate()

UINTN EhcConvertPollRate ( IN UINTN  Interval)

Convert the poll interval from application to that be used by EHCI interface data structure. Only need to get the max 2^n that is less than interval. UEFI can't support high speed endpoint with a interval less than 8 microframe because interval is specified in the unit of ms (millisecond).

Parameters
IntervalThe interval to convert.
Return values
Theconverted interval.

Definition at line 255 of file EhciUrb.c.

◆ EhcCreateQh()

PEI_EHC_QH * EhcCreateQh ( IN PEI_USB2_HC_DEV Ehci,
IN USB_ENDPOINT Ep 
)

Allocate and initialize a EHCI queue head.

Parameters
EhciThe EHCI device.
EpThe endpoint to create queue head for.
Return values
thepointer to the created queue head or NULL if failed to create one.

Definition at line 165 of file EhciUrb.c.

◆ EhcCreateQtd()

PEI_EHC_QTD * EhcCreateQtd ( IN PEI_USB2_HC_DEV Ehc,
IN UINT8 *  Data,
IN UINTN  DataLen,
IN UINT8  PktId,
IN UINT8  Toggle,
IN UINTN  MaxPacket 
)

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

Parameters
EhcThe EHCI device.
DataCurrent data not associated with a QTD.
DataLenThe length of the data.
PktIdPacket ID to use in the QTD.
ToggleData toggle to use in the QTD.
MaxPacketMaximu packet length of the endpoint.
Return values
thepointer to the created QTD or NULL if failed to create one.

Definition at line 29 of file EhciUrb.c.

◆ EhcCreateQtds()

EFI_STATUS EhcCreateQtds ( IN PEI_USB2_HC_DEV Ehc,
IN PEI_URB Urb 
)

Create a list of QTDs for the URB.

Parameters
EhcThe EHCI device.
UrbThe URB to create QTDs for.
Return values
EFI_OUT_OF_RESOURCESFailed to allocate resource for QTD.
EFI_SUCCESSThe QTDs are allocated for the URB.

Definition at line 345 of file EhciUrb.c.

◆ EhcCreateUrb()

PEI_URB * EhcCreateUrb ( IN PEI_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  Type,
IN EFI_USB_DEVICE_REQUEST Request,
IN VOID *  Data,
IN UINTN  DataLen,
IN EFI_ASYNC_USB_TRANSFER_CALLBACK  Callback,
IN VOID *  Context,
IN UINTN  Interval 
)

Create a new URB and its associated QTD.

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.
TypeThe transaction type.
RequestThe standard USB request for control transfer.
DataThe user data to transfer.
DataLenThe length of data buffer.
CallbackThe function to call when data is transferred.
ContextThe context to the callback.
IntervalThe interval for interrupt transfer.
Return values
thepointer to the created URB or NULL.

Definition at line 514 of file EhciUrb.c.

◆ EhcFreeQtds()

VOID EhcFreeQtds ( IN PEI_USB2_HC_DEV Ehc,
IN EFI_LIST_ENTRY Qtds 
)

Free a list of QTDs.

Parameters
EhcThe EHCI device.
QtdsThe list head of the QTD.

Definition at line 286 of file EhciUrb.c.

◆ EhcFreeUrb()

VOID EhcFreeUrb ( IN PEI_USB2_HC_DEV Ehc,
IN PEI_URB Urb 
)

Free an allocated URB. It is possible for it to be partially inited.

Parameters
EhcThe EHCI device.
UrbThe URB to free.

Definition at line 311 of file EhciUrb.c.

◆ EhcInitIntQh()

VOID EhcInitIntQh ( IN USB_ENDPOINT Ep,
IN QH_HW QhHw 
)

Initialize the queue head for interrupt transfer, that is, initialize the following three fields:

  1. SplitXState in the Status field.
  2. Microframe S-mask.
  3. Microframe C-mask.
Parameters
EpThe queue head's related endpoint.
QhHwThe queue head to initialize.

Definition at line 123 of file EhciUrb.c.