4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncPrivate Header file for Usb Host Controller PEIM
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncCopyright (c) 2010, Intel Corporation. All rights reserved.<BR>
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncThis program and the accompanying materials
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncare licensed and made available under the terms and conditions
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncof the BSD License which accompanies this distribution. The
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncfull text of the license may be found at
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncTHE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncWITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync#define EHC_QTD_SIG SIGNATURE_32 ('U', 'S', 'B', 'T')
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync#define EHC_QH_SIG SIGNATURE_32 ('U', 'S', 'B', 'H')
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync#define EHC_URB_SIG SIGNATURE_32 ('U', 'S', 'B', 'R')
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync// Hardware related bit definitions
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync#define QTD_STAT_ERR_MASK (QTD_STAT_TRANS_ERR | QTD_STAT_BABBLE_ERR | QTD_STAT_BUFF_ERR)
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync// Fill in the hardware link point: pass in a EHC_QH/QH_HW
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync// pointer to QH_LINK; A EHC_QTD/QTD_HW pointer to QTD_LINK
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync ((UINT32) ((EHC_LOW_32BIT (Addr) & 0xFFFFFFE0) | (Type) | ((Term) ? 1 : 0)))
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync#define QTD_LINK(Addr, Term) QH_LINK((Addr), 0, (Term))
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync// The defination of EHCI hardware used data structure for
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync// little endian architecture. The QTD and QH structures
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync// are required to be 32 bytes aligned. Don't add members
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync// to the head of the associated software strucuture.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsynctypedef struct {
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsynctypedef struct {
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync // Endpoint capabilities/Characteristics DWord 1 and DWord 2
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync // Transaction execution overlay area
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync// Endpoint address and its capabilities
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync UINT8 EpAddr; // Endpoint address, no direction encoded in
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync UINT8 Toggle; // Data toggle, not used for control transfer
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync// Software QTD strcture, this is used to manage all the
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync// QTD generated from a URB. Don't add fields before QtdHw.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync EFI_LIST_ENTRY QtdList; // The list of QTDs to one end point
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync UINTN DataLen; // Original amount of data in this QTD
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync// Software QH structure. All three different transaction types
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync// supported by UEFI USB, that is the control/bulk/interrupt
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync// transfers use the queue head and queue token strcuture.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync// Interrupt QHs are linked to periodic frame list in the reversed
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync// 2^N tree. Each interrupt QH is linked to the list starting at
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync// frame 0. There is a dummy interrupt QH linked to each frame as
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync// a sentinental whose polling interval is 1. Synchronous interrupt
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync// transfer is linked after this dummy QH.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync// For control/bulk transfer, only synchronous (in the sense of UEFI)
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync// transfer is supported. A dummy QH is linked to EHCI AsyncListAddr
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync// as the reclamation header. New transfer is inserted after this QH.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync PEI_EHC_QH *NextQh; // The queue head pointed to by horizontal link
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync EFI_LIST_ENTRY Qtds; // The list of QTDs to this queue head
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync// URB (Usb Request Block) contains information for all kinds of
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync// usb requests.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync // Transaction information
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync EFI_USB_DEVICE_REQUEST *Request; // Control transfer only
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync // Schedule data
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync // Transaction result
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Delete a single asynchronous interrupt transfer for
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync the device and endpoint.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Ehc The EHCI device.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Data Current data not associated with a QTD.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param DataLen The length of the data.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param PktId Packet ID to use in the QTD.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Toggle Data toggle to use in the QTD.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param MaxPacket Maximu packet length of the endpoint.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval the pointer to the created QTD or NULL if failed to create one.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Allocate and initialize a EHCI queue head.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Ehci The EHCI device.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Ep The endpoint to create queue head for.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval the pointer to the created queue head or NULL if failed to create one.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Free an allocated URB. It is possible for it to be partially inited.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Ehc The EHCI device.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Urb The URB to free.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Create a new URB and its associated QTD.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Ehc The EHCI device.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param DevAddr The device address.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param EpAddr Endpoint addrress & its direction.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param DevSpeed The device speed.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Toggle Initial data toggle to use.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param MaxPacket The max packet length of the endpoint.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Hub The transaction translator to use.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Type The transaction type.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Request The standard USB request for control transfer.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Data The user data to transfer.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param DataLen The length of data buffer.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Callback The function to call when data is transferred.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Context The context to the callback.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Interval The interval for interrupt transfer.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval the pointer to the created URB or NULL.