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

Go to the source code of this file.

Data Structures

struct  UHCI_QH_HW
 
struct  UHCI_TD_HW
 
struct  _UHCI_QH_SW
 
struct  _UHCI_TD_SW
 

Macros

#define QH_HLINK(Pointer, Terminate)    (((UINT32) ((UINTN) (Pointer)) & 0xFFFFFFF0) | 0x02 | ((Terminate) ? 0x01 : 0))
 
#define QH_VLINK(Pointer, Terminate)    (((UINT32) ((UINTN) (Pointer)) & 0xFFFFFFF0) | ((Terminate) ? 0x01 : 0))
 
#define TD_LINK(Pointer, VertFirst, Terminate)
 
#define LINK_TERMINATED(Link)   (((Link) & 0x01) != 0)
 
#define UHCI_ADDR(QhOrTd)   ((VOID *) (UINTN) ((QhOrTd) & 0xFFFFFFF0))
 

Typedefs

typedef struct _UHCI_TD_SW UHCI_TD_SW
 
typedef struct _UHCI_QH_SW UHCI_QH_SW
 

Functions

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)
 
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 UhciDestoryTds (IN USB_HC_DEV *Uhc, IN UHCI_TD_SW *FirstTd)
 
UHCI_QH_SWUhciCreateQh (IN USB_HC_DEV *Uhc, IN UINTN Interval)
 
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 definition for UHCI register operation routines.

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

Definition in file UhciQueue.h.

Macro Definition Documentation

◆ LINK_TERMINATED

#define LINK_TERMINATED (   Link)    (((Link) & 0x01) != 0)

Definition at line 33 of file UhciQueue.h.

◆ QH_HLINK

#define QH_HLINK (   Pointer,
  Terminate 
)     (((UINT32) ((UINTN) (Pointer)) & 0xFFFFFFF0) | 0x02 | ((Terminate) ? 0x01 : 0))

Definition at line 23 of file UhciQueue.h.

◆ QH_VLINK

#define QH_VLINK (   Pointer,
  Terminate 
)     (((UINT32) ((UINTN) (Pointer)) & 0xFFFFFFF0) | ((Terminate) ? 0x01 : 0))

Definition at line 26 of file UhciQueue.h.

◆ TD_LINK

#define TD_LINK (   Pointer,
  VertFirst,
  Terminate 
)
Value:
(((UINT32) ((UINTN) (Pointer)) & 0xFFFFFFF0) | \
((VertFirst) ? 0x04 : 0) | ((Terminate) ? 0x01 : 0))
UINT64 UINTN

Definition at line 29 of file UhciQueue.h.

◆ UHCI_ADDR

#define UHCI_ADDR (   QhOrTd)    ((VOID *) (UINTN) ((QhOrTd) & 0xFFFFFFF0))

Definition at line 35 of file UhciQueue.h.

Typedef Documentation

◆ UHCI_QH_SW

typedef struct _UHCI_QH_SW UHCI_QH_SW

Definition at line 74 of file UhciQueue.h.

◆ UHCI_TD_SW

typedef struct _UHCI_TD_SW UHCI_TD_SW

Definition at line 73 of file UhciQueue.h.

Function Documentation

◆ 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.

◆ 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.

◆ 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.
Returns
None.

Unlink TD from the QH.

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

Definition at line 176 of file UhciQueue.c.