TianoCore EDK2 master
Loading...
Searching...
No Matches
DebugCommunicationLibUsb3Transfer.c File Reference

Go to the source code of this file.

Functions

EFI_STATUS EFIAPI XhcSyncTrsRing (IN USB3_DEBUG_PORT_HANDLE *Handle, IN TRANSFER_RING *TrsRing)
 
EFI_STATUS EFIAPI XhcSyncEventRing (IN USB3_DEBUG_PORT_HANDLE *Handle, IN EVENT_RING *EvtRing)
 
EFI_STATUS EFIAPI XhcCheckNewEvent (IN USB3_DEBUG_PORT_HANDLE *Handle, IN EVENT_RING *EvtRing, OUT TRB_TEMPLATE **NewEvtTrb)
 
BOOLEAN IsTrbInTrsRing (IN TRANSFER_RING *Ring, IN TRB_TEMPLATE *Trb)
 
VOID XhcCheckUrbResult (IN USB3_DEBUG_PORT_HANDLE *Handle, IN URB *Urb)
 
EFI_STATUS EFIAPI XhcRingDoorBell (IN USB3_DEBUG_PORT_HANDLE *Handle, IN URB *Urb)
 
VOID XhcExecTransfer (IN USB3_DEBUG_PORT_HANDLE *Handle, IN URB *Urb, IN UINTN Timeout)
 
EFI_STATUS XhcCreateTransferTrb (IN USB3_DEBUG_PORT_HANDLE *Handle, IN URB *Urb)
 
URBXhcCreateUrb (IN USB3_DEBUG_PORT_HANDLE *Handle, IN EFI_USB_DATA_DIRECTION Direction, IN VOID *Data, IN UINTN DataLen)
 
EFI_STATUS EFIAPI XhcDataTransfer (IN USB3_DEBUG_PORT_HANDLE *Handle, IN EFI_USB_DATA_DIRECTION Direction, IN OUT VOID *Data, IN OUT UINTN *DataLength, IN UINTN Timeout)
 

Detailed Description

Debug Port Library implementation based on usb3 debug port.

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

Definition in file DebugCommunicationLibUsb3Transfer.c.

Function Documentation

◆ IsTrbInTrsRing()

BOOLEAN IsTrbInTrsRing ( IN TRANSFER_RING Ring,
IN TRB_TEMPLATE Trb 
)

Check if the Trb is a transaction of the URB.

Parameters
RingThe transfer ring to be checked.
TrbThe TRB to be checked.
Return values
TRUEIt is a transaction of the URB.
FALSEIt is not any transaction of the URB.

Definition at line 177 of file DebugCommunicationLibUsb3Transfer.c.

◆ XhcCheckNewEvent()

EFI_STATUS EFIAPI XhcCheckNewEvent ( IN USB3_DEBUG_PORT_HANDLE Handle,
IN EVENT_RING EvtRing,
OUT TRB_TEMPLATE **  NewEvtTrb 
)

Check if there is a new generated event.

Parameters
HandleDebug port handle.
EvtRingThe event ring to check.
NewEvtTrbThe new event TRB found.
Return values
EFI_SUCCESSFound a new event TRB at the event ring.
EFI_NOT_READYThe event ring has no new event.

Definition at line 137 of file DebugCommunicationLibUsb3Transfer.c.

◆ XhcCheckUrbResult()

VOID XhcCheckUrbResult ( IN USB3_DEBUG_PORT_HANDLE Handle,
IN URB Urb 
)

Check the URB's execution result and update the URB's result accordingly.

Parameters
HandleDebug port handle.
UrbThe URB to check result.

Definition at line 209 of file DebugCommunicationLibUsb3Transfer.c.

◆ XhcCreateTransferTrb()

EFI_STATUS XhcCreateTransferTrb ( IN USB3_DEBUG_PORT_HANDLE Handle,
IN URB Urb 
)

Create a transfer TRB.

Parameters
HandleDebug port handle.
UrbThe urb used to construct the transfer TRB.
Returns
Created TRB or NULL

Definition at line 417 of file DebugCommunicationLibUsb3Transfer.c.

◆ XhcCreateUrb()

URB * XhcCreateUrb ( IN USB3_DEBUG_PORT_HANDLE Handle,
IN EFI_USB_DATA_DIRECTION  Direction,
IN VOID *  Data,
IN UINTN  DataLen 
)

Create a new URB for a new transaction.

Parameters
HandleDebug port handle.
DirectionThe direction of data flow.
DataThe user data to transfer
DataLenThe length of data buffer
Returns
Created URB or NULL

Definition at line 465 of file DebugCommunicationLibUsb3Transfer.c.

◆ XhcDataTransfer()

EFI_STATUS EFIAPI XhcDataTransfer ( IN USB3_DEBUG_PORT_HANDLE Handle,
IN EFI_USB_DATA_DIRECTION  Direction,
IN OUT VOID *  Data,
IN OUT UINTN DataLength,
IN UINTN  Timeout 
)

Submits bulk transfer to a bulk endpoint of a USB device.

Parameters
HandleDebug port handle.
DirectionThe direction of data transfer.
DataArray of pointers to the buffers of data to transmit from or receive into.
DataLengthThe length of the data buffer.
TimeoutIndicates the maximum time, in microsecond, which the transfer is allowed to complete.
Return values
EFI_SUCCESSThe transfer was completed successfully.
EFI_OUT_OF_RESOURCESThe transfer failed due to lack of resource.
EFI_INVALID_PARAMETERSome parameters are invalid.
EFI_TIMEOUTThe transfer failed due to timeout.
EFI_DEVICE_ERRORThe transfer failed due to host controller error.

Definition at line 534 of file DebugCommunicationLibUsb3Transfer.c.

◆ XhcExecTransfer()

VOID XhcExecTransfer ( IN USB3_DEBUG_PORT_HANDLE Handle,
IN URB Urb,
IN UINTN  Timeout 
)

Execute the transfer by polling the URB. This is a synchronous operation.

Parameters
HandleDebug port handle.
UrbThe URB to execute.
TimeoutThe time to wait before abort, in microsecond.

Definition at line 348 of file DebugCommunicationLibUsb3Transfer.c.

◆ XhcRingDoorBell()

EFI_STATUS EFIAPI XhcRingDoorBell ( IN USB3_DEBUG_PORT_HANDLE Handle,
IN URB Urb 
)

Ring the door bell to notify XHCI there is a transaction to be executed.

Parameters
HandleDebug port handle.
UrbThe pointer to URB.
Return values
EFI_SUCCESSSuccessfully ring the door bell.

Definition at line 318 of file DebugCommunicationLibUsb3Transfer.c.

◆ XhcSyncEventRing()

EFI_STATUS EFIAPI XhcSyncEventRing ( IN USB3_DEBUG_PORT_HANDLE Handle,
IN EVENT_RING EvtRing 
)

Synchronize the specified event ring to update the enqueue and dequeue pointer.

Parameters
HandleDebug port handle.
EvtRingThe event ring to sync.
Return values
EFI_SUCCESSThe event ring is synchronized successfully.

Definition at line 86 of file DebugCommunicationLibUsb3Transfer.c.

◆ XhcSyncTrsRing()

EFI_STATUS EFIAPI XhcSyncTrsRing ( IN USB3_DEBUG_PORT_HANDLE Handle,
IN TRANSFER_RING TrsRing 
)

Synchronize the specified transfer ring to update the enqueue and dequeue pointer.

Parameters
HandleDebug port handle.
TrsRingThe transfer ring to sync.
Return values
EFI_SUCCESSThe transfer ring is synchronized successfully.

Definition at line 21 of file DebugCommunicationLibUsb3Transfer.c.