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

Go to the source code of this file.

Functions

EHC_QTDEhcCreateQtd (IN USB2_HC_DEV *Ehc, IN UINT8 *Data, IN UINT8 *DataPhy, IN UINTN DataLen, IN UINT8 PktId, IN UINT8 Toggle, IN UINTN MaxPacket)
 
VOID EhcInitIntQh (IN USB_ENDPOINT *Ep, IN QH_HW *QhHw)
 
EHC_QHEhcCreateQh (IN USB2_HC_DEV *Ehci, IN USB_ENDPOINT *Ep)
 
UINTN EhcConvertPollRate (IN UINTN Interval)
 
VOID EhcFreeQtds (IN USB2_HC_DEV *Ehc, IN LIST_ENTRY *Qtds)
 
VOID EhcFreeUrb (IN USB2_HC_DEV *Ehc, IN URB *Urb)
 
EFI_STATUS EhcCreateQtds (IN USB2_HC_DEV *Ehc, IN URB *Urb)
 
URBEhcCreateUrb (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 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

This file contains URB request, each request is warpped in a URB (Usb Request Block).

Copyright (c) 2007 - 2010, 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.
Returns
The converted interval.

Definition at line 257 of file EhciUrb.c.

◆ EhcCreateQh()

EHC_QH * EhcCreateQh ( IN 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.
Returns
Created queue head or NULL if failed to create one.

Definition at line 167 of file EhciUrb.c.

◆ EhcCreateQtd()

EHC_QTD * EhcCreateQtd ( IN USB2_HC_DEV Ehc,
IN UINT8 *  Data,
IN UINT8 *  DataPhy,
IN UINTN  DataLen,
IN UINT8  PktId,
IN UINT8  Toggle,
IN UINTN  MaxPacket 
)

Create a single QTD to hold the data.

Parameters
EhcThe EHCI device.
DataThe cpu memory address of current data not associated with a QTD.
DataPhyThe pci bus address of current 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.
Returns
Created QTD or NULL if failed to create one.

Definition at line 29 of file EhciUrb.c.

◆ EhcCreateQtds()

EFI_STATUS EhcCreateQtds ( IN USB2_HC_DEV Ehc,
IN 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 353 of file EhciUrb.c.

◆ EhcCreateUrb()

URB * EhcCreateUrb ( 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  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.
Returns
Created URB or NULL.

Definition at line 528 of file EhciUrb.c.

◆ EhcFreeQtds()

VOID EhcFreeQtds ( IN USB2_HC_DEV Ehc,
IN LIST_ENTRY Qtds 
)

Free a list of QTDs.

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

Definition at line 288 of file EhciUrb.c.

◆ EhcFreeUrb()

VOID EhcFreeUrb ( IN USB2_HC_DEV Ehc,
IN 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 313 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 125 of file EhciUrb.c.