TianoCore EDK2 master
Loading...
Searching...
No Matches
UhciQueue.c File Reference
#include "Uhci.h"

Go to the source code of this file.

Functions

EFI_STATUS UhciMapUserRequest (IN USB_HC_DEV *Uhc, IN OUT VOID *Request, OUT UINT8 **MappedAddr, OUT VOID **Map)
 
EFI_STATUS UhciMapUserData (IN USB_HC_DEV *Uhc, IN EFI_USB_DATA_DIRECTION Direction, IN VOID *Data, IN OUT UINTN *Len, OUT UINT8 *PktId, OUT UINT8 **MappedAddr, OUT VOID **Map)
 
VOID UhciLinkTdToQh (IN USB_HC_DEV *Uhc, IN UHCI_QH_SW *Qh, IN UHCI_TD_SW *Td)
 
VOID UhciUnlinkTdFromQh (IN UHCI_QH_SW *Qh, IN UHCI_TD_SW *Td)
 
VOID UhciAppendTd (IN USB_HC_DEV *Uhc, IN UHCI_TD_SW *PrevTd, IN UHCI_TD_SW *ThisTd)
 
VOID UhciDestoryTds (IN USB_HC_DEV *Uhc, IN UHCI_TD_SW *FirstTd)
 
UHCI_QH_SWUhciCreateQh (IN USB_HC_DEV *Uhc, IN UINTN Interval)
 
UHCI_TD_SWUhciCreateTd (IN USB_HC_DEV *Uhc)
 
UHCI_TD_SWUhciCreateSetupTd (IN USB_HC_DEV *Uhc, IN UINT8 DevAddr, IN UINT8 *Request, IN UINT8 *RequestPhy, IN BOOLEAN IsLow)
 
UHCI_TD_SWUhciCreateDataTd (IN USB_HC_DEV *Uhc, IN UINT8 DevAddr, IN UINT8 Endpoint, IN UINT8 *DataPtr, IN UINT8 *DataPhyPtr, IN UINTN Len, IN UINT8 PktId, IN UINT8 Toggle, IN BOOLEAN IsLow)
 
UHCI_TD_SWUhciCreateStatusTd (IN USB_HC_DEV *Uhc, IN UINT8 DevAddr, IN UINT8 PktId, IN BOOLEAN IsLow)
 
UHCI_TD_SWUhciCreateCtrlTds (IN USB_HC_DEV *Uhc, IN UINT8 DeviceAddr, IN UINT8 DataPktId, IN UINT8 *Request, IN UINT8 *RequestPhy, IN UINT8 *Data, IN UINT8 *DataPhy, IN UINTN DataLen, IN UINT8 MaxPacket, IN BOOLEAN IsLow)
 
UHCI_TD_SWUhciCreateBulkOrIntTds (IN USB_HC_DEV *Uhc, IN UINT8 DevAddr, IN UINT8 EndPoint, IN UINT8 PktId, IN UINT8 *Data, IN UINT8 *DataPhy, IN UINTN DataLen, IN OUT UINT8 *DataToggle, IN UINT8 MaxPacket, IN BOOLEAN IsLow)
 

Detailed Description

The UHCI register operation routines.

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

Definition in file UhciQueue.c.

Function Documentation

◆ UhciAppendTd()

VOID UhciAppendTd ( IN USB_HC_DEV Uhc,
IN UHCI_TD_SW PrevTd,
IN UHCI_TD_SW ThisTd 
)

Append a new TD To the previous TD.

Parameters
UhcThe UHCI device.
PrevTdPrevious UHCI_TD_SW to be linked to.
ThisTdTD to link.

Definition at line 196 of file UhciQueue.c.

◆ UhciCreateBulkOrIntTds()

UHCI_TD_SW * UhciCreateBulkOrIntTds ( IN USB_HC_DEV Uhc,
IN UINT8  DevAddr,
IN UINT8  EndPoint,
IN UINT8  PktId,
IN UINT8 *  Data,
IN UINT8 *  DataPhy,
IN UINTN  DataLen,
IN OUT UINT8 *  DataToggle,
IN UINT8  MaxPacket,
IN BOOLEAN  IsLow 
)

Create Tds list for Bulk/Interrupt Transfer.

Parameters
UhcUSB_HC_DEV.
DevAddrAddress of Device.
EndPointEndpoint Number.
PktIdPacket Identification of Data Tds.
DataA pointer to cpu memory address of user data buffer to transfer.
DataPhyA pointer to pci memory address of user data buffer to transfer.
DataLenLength of user data to transfer.
DataToggleData Toggle Pointer.
MaxPacketMaximum packet size for Bulk/Interrupt transfer.
IsLowIs Low Speed Device.
Returns
The Tds list head for the bulk transfer.

Definition at line 610 of file UhciQueue.c.

◆ UhciCreateCtrlTds()

UHCI_TD_SW * UhciCreateCtrlTds ( IN USB_HC_DEV Uhc,
IN UINT8  DeviceAddr,
IN UINT8  DataPktId,
IN UINT8 *  Request,
IN UINT8 *  RequestPhy,
IN UINT8 *  Data,
IN UINT8 *  DataPhy,
IN UINTN  DataLen,
IN UINT8  MaxPacket,
IN BOOLEAN  IsLow 
)

Create Tds list for Control Transfer.

Parameters
UhcThe UHCI device.
DeviceAddrThe device address.
DataPktIdPacket Identification of Data Tds.
RequestA pointer to cpu memory address of request structure buffer to transfer.
RequestPhyA pointer to pci memory address of request structure buffer to transfer.
DataA pointer to cpu memory address of user data buffer to transfer.
DataPhyA pointer to pci memory address of user data buffer to transfer.
DataLenLength of user data to transfer.
MaxPacketMaximum packet size for control transfer.
IsLowFull speed or low speed.
Returns
The Td list head for the control transfer.

Definition at line 475 of file UhciQueue.c.

◆ UhciCreateDataTd()

UHCI_TD_SW * UhciCreateDataTd ( IN USB_HC_DEV Uhc,
IN UINT8  DevAddr,
IN UINT8  Endpoint,
IN UINT8 *  DataPtr,
IN UINT8 *  DataPhyPtr,
IN UINTN  Len,
IN UINT8  PktId,
IN UINT8  Toggle,
IN BOOLEAN  IsLow 
)

Create a TD for data.

Parameters
UhcThe UHCI device.
DevAddrDevice address.
EndpointEndpoint number.
DataPtrA pointer to cpu memory address of Data buffer.
DataPhyPtrA pointer to pci memory address of Data buffer.
LenData length.
PktIdPacket ID.
ToggleData toggle value.
IsLowFull speed or low speed.
Returns
Data Td pointer if success, otherwise NULL.

Definition at line 365 of file UhciQueue.c.

◆ UhciCreateQh()

UHCI_QH_SW * UhciCreateQh ( IN USB_HC_DEV Uhc,
IN UINTN  Interval 
)

Create an initialize a new queue head.

Parameters
UhcThe UHCI device.
IntervalThe polling interval for the queue.
Returns
The newly created queue header.

Definition at line 249 of file UhciQueue.c.

◆ UhciCreateSetupTd()

UHCI_TD_SW * UhciCreateSetupTd ( IN USB_HC_DEV Uhc,
IN UINT8  DevAddr,
IN UINT8 *  Request,
IN UINT8 *  RequestPhy,
IN BOOLEAN  IsLow 
)

Create and initialize a TD for Setup Stage of a control transfer.

Parameters
UhcThe UHCI device.
DevAddrDevice address.
RequestA pointer to cpu memory address of Device request.
RequestPhyA pointer to pci memory address of Device request.
IsLowFull speed or low speed.
Returns
The created setup Td Pointer.

Definition at line 312 of file UhciQueue.c.

◆ UhciCreateStatusTd()

UHCI_TD_SW * UhciCreateStatusTd ( IN USB_HC_DEV Uhc,
IN UINT8  DevAddr,
IN UINT8  PktId,
IN BOOLEAN  IsLow 
)

Create TD for the Status Stage of control transfer.

Parameters
UhcThe UHCI device.
DevAddrDevice address.
PktIdPacket ID.
IsLowFull speed or low speed.
Returns
Status Td Pointer.

Definition at line 422 of file UhciQueue.c.

◆ UhciCreateTd()

UHCI_TD_SW * UhciCreateTd ( IN USB_HC_DEV Uhc)

Create and intialize a TD.

Parameters
UhcThe UHCI device.
Returns
The newly allocated and initialized TD.

Definition at line 280 of file UhciQueue.c.

◆ UhciDestoryTds()

VOID UhciDestoryTds ( IN USB_HC_DEV Uhc,
IN UHCI_TD_SW FirstTd 
)

Delete a list of TDs.

Parameters
UhcThe UHCI device.
FirstTdTD link list head.
Returns
None.

Definition at line 222 of file UhciQueue.c.

◆ UhciLinkTdToQh()

VOID UhciLinkTdToQh ( IN USB_HC_DEV Uhc,
IN UHCI_QH_SW Qh,
IN UHCI_TD_SW Td 
)

Link the TD To QH.

Parameters
UhcThe UHCI device.
QhThe queue head for the TD to link to.
TdThe TD to link.

Definition at line 152 of file UhciQueue.c.

◆ UhciMapUserData()

EFI_STATUS UhciMapUserData ( IN USB_HC_DEV Uhc,
IN EFI_USB_DATA_DIRECTION  Direction,
IN VOID *  Data,
IN OUT UINTN Len,
OUT UINT8 *  PktId,
OUT UINT8 **  MappedAddr,
OUT VOID **  Map 
)

Map address of user data buffer.

Parameters
UhcThe UHCI device.
DirectionDirection of the data transfer.
DataThe user data buffer.
LenLength of the user data.
PktIdPacket identificaion.
MappedAddrMapped address to return.
MapIdentificaion of this mapping to return.
Returns
EFI_SUCCESS Success.
EFI_DEVICE_ERROR Fail to map the user data.

Definition at line 69 of file UhciQueue.c.

◆ UhciMapUserRequest()

EFI_STATUS UhciMapUserRequest ( IN USB_HC_DEV Uhc,
IN OUT VOID *  Request,
OUT UINT8 **  MappedAddr,
OUT VOID **  Map 
)

Map address of request structure buffer.

Parameters
UhcThe UHCI device.
RequestThe user request buffer.
MappedAddrMapped address of request.
MapIdentificaion of this mapping to return.
Returns
EFI_SUCCESS Success.
EFI_DEVICE_ERROR Fail to map the user request.

Definition at line 25 of file UhciQueue.c.

◆ UhciUnlinkTdFromQh()

VOID UhciUnlinkTdFromQh ( IN UHCI_QH_SW Qh,
IN UHCI_TD_SW Td 
)

Unlink TD from the QH.

Parameters
QhThe queue head to unlink from.
TdThe TD to unlink.

Definition at line 176 of file UhciQueue.c.