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

Go to the source code of this file.

Functions

EFI_STATUS EFIAPI EhcGetCapability (IN EFI_USB2_HC_PROTOCOL *This, OUT UINT8 *MaxSpeed, OUT UINT8 *PortNumber, OUT UINT8 *Is64BitCapable)
 
EFI_STATUS EFIAPI EhcReset (IN EFI_USB2_HC_PROTOCOL *This, IN UINT16 Attributes)
 
EFI_STATUS EFIAPI EhcGetState (IN EFI_USB2_HC_PROTOCOL *This, OUT EFI_USB_HC_STATE *State)
 
EFI_STATUS EFIAPI EhcSetState (IN EFI_USB2_HC_PROTOCOL *This, IN EFI_USB_HC_STATE State)
 
EFI_STATUS EFIAPI EhcGetRootHubPortStatus (IN EFI_USB2_HC_PROTOCOL *This, IN UINT8 PortNumber, OUT EFI_USB_PORT_STATUS *PortStatus)
 
EFI_STATUS EFIAPI EhcSetRootHubPortFeature (IN EFI_USB2_HC_PROTOCOL *This, IN UINT8 PortNumber, IN EFI_USB_PORT_FEATURE PortFeature)
 
EFI_STATUS EFIAPI EhcClearRootHubPortFeature (IN EFI_USB2_HC_PROTOCOL *This, IN UINT8 PortNumber, IN EFI_USB_PORT_FEATURE PortFeature)
 
EFI_STATUS EFIAPI EhcControlTransfer (IN EFI_USB2_HC_PROTOCOL *This, IN UINT8 DeviceAddress, IN UINT8 DeviceSpeed, IN UINTN MaximumPacketLength, IN EFI_USB_DEVICE_REQUEST *Request, IN EFI_USB_DATA_DIRECTION TransferDirection, IN OUT VOID *Data, IN OUT UINTN *DataLength, IN UINTN TimeOut, IN EFI_USB2_HC_TRANSACTION_TRANSLATOR *Translator, OUT UINT32 *TransferResult)
 
EFI_STATUS EFIAPI EhcBulkTransfer (IN EFI_USB2_HC_PROTOCOL *This, IN UINT8 DeviceAddress, IN UINT8 EndPointAddress, IN UINT8 DeviceSpeed, IN UINTN MaximumPacketLength, IN UINT8 DataBuffersNumber, IN OUT VOID *Data[EFI_USB_MAX_BULK_BUFFER_NUM], IN OUT UINTN *DataLength, IN OUT UINT8 *DataToggle, IN UINTN TimeOut, IN EFI_USB2_HC_TRANSACTION_TRANSLATOR *Translator, OUT UINT32 *TransferResult)
 
EFI_STATUS EFIAPI EhcAsyncInterruptTransfer (IN EFI_USB2_HC_PROTOCOL *This, IN UINT8 DeviceAddress, IN UINT8 EndPointAddress, IN UINT8 DeviceSpeed, IN UINTN MaximumPacketLength, IN BOOLEAN IsNewTransfer, IN OUT UINT8 *DataToggle, IN UINTN PollingInterval, IN UINTN DataLength, IN EFI_USB2_HC_TRANSACTION_TRANSLATOR *Translator, IN EFI_ASYNC_USB_TRANSFER_CALLBACK CallBackFunction, IN VOID *Context OPTIONAL)
 
EFI_STATUS EFIAPI EhcSyncInterruptTransfer (IN EFI_USB2_HC_PROTOCOL *This, IN UINT8 DeviceAddress, IN UINT8 EndPointAddress, IN UINT8 DeviceSpeed, IN UINTN MaximumPacketLength, IN OUT VOID *Data, IN OUT UINTN *DataLength, IN OUT UINT8 *DataToggle, IN UINTN TimeOut, IN EFI_USB2_HC_TRANSACTION_TRANSLATOR *Translator, OUT UINT32 *TransferResult)
 
EFI_STATUS EFIAPI EhcIsochronousTransfer (IN EFI_USB2_HC_PROTOCOL *This, IN UINT8 DeviceAddress, IN UINT8 EndPointAddress, IN UINT8 DeviceSpeed, IN UINTN MaximumPacketLength, IN UINT8 DataBuffersNumber, IN OUT VOID *Data[EFI_USB_MAX_ISO_BUFFER_NUM], IN UINTN DataLength, IN EFI_USB2_HC_TRANSACTION_TRANSLATOR *Translator, OUT UINT32 *TransferResult)
 
EFI_STATUS EFIAPI EhcAsyncIsochronousTransfer (IN EFI_USB2_HC_PROTOCOL *This, IN UINT8 DeviceAddress, IN UINT8 EndPointAddress, IN UINT8 DeviceSpeed, IN UINTN MaximumPacketLength, IN UINT8 DataBuffersNumber, IN OUT VOID *Data[EFI_USB_MAX_ISO_BUFFER_NUM], IN UINTN DataLength, IN EFI_USB2_HC_TRANSACTION_TRANSLATOR *Translator, IN EFI_ASYNC_USB_TRANSFER_CALLBACK IsochronousCallBack, IN VOID *Context)
 
EFI_STATUS EFIAPI EhcDriverEntryPoint (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
 
EFI_STATUS EFIAPI EhcDriverBindingSupported (IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE Controller, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath)
 
EFI_STATUS EhcGetUsbDebugPortInfo (IN USB2_HC_DEV *Ehc)
 
USB2_HC_DEVEhcCreateUsb2Hc (IN EFI_PCI_IO_PROTOCOL *PciIo, IN EFI_DEVICE_PATH_PROTOCOL *DevicePath, IN UINT64 OriginalPciAttributes)
 
VOID EFIAPI EhcExitBootService (EFI_EVENT Event, VOID *Context)
 
EFI_STATUS EFIAPI EhcDriverBindingStart (IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE Controller, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath)
 
EFI_STATUS EFIAPI EhcDriverBindingStop (IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE Controller, IN UINTN NumberOfChildren, IN EFI_HANDLE *ChildHandleBuffer)
 

Variables

USB_PORT_STATE_MAP mUsbPortStateMap []
 
USB_PORT_STATE_MAP mUsbPortChangeMap []
 
EFI_DRIVER_BINDING_PROTOCOL gEhciDriverBinding
 

Detailed Description

The Ehci controller driver.

EhciDxe driver is responsible for managing the behavior of EHCI controller. It implements the interfaces of monitoring the status of all ports and transferring Control, Bulk, Interrupt and Isochronous requests to Usb2.0 device.

Note that EhciDxe driver is enhanced to guarantee that the EHCI controller get attached to the EHCI controller before a UHCI or OHCI driver attaches to the companion UHCI or OHCI controller. This way avoids the control transfer on a shared port between EHCI and companion host controller when UHCI or OHCI gets attached earlier than EHCI and a USB 2.0 device inserts.

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

Definition in file Ehci.c.

Function Documentation

◆ EhcAsyncInterruptTransfer()

EFI_STATUS EFIAPI EhcAsyncInterruptTransfer ( IN EFI_USB2_HC_PROTOCOL This,
IN UINT8  DeviceAddress,
IN UINT8  EndPointAddress,
IN UINT8  DeviceSpeed,
IN UINTN  MaximumPacketLength,
IN BOOLEAN  IsNewTransfer,
IN OUT UINT8 *  DataToggle,
IN UINTN  PollingInterval,
IN UINTN  DataLength,
IN EFI_USB2_HC_TRANSACTION_TRANSLATOR Translator,
IN EFI_ASYNC_USB_TRANSFER_CALLBACK  CallBackFunction,
IN VOID *Context  OPTIONAL 
)

Submits an asynchronous interrupt transfer to an interrupt endpoint of a USB device.

Parameters
ThisThis EFI_USB2_HC_PROTOCOL instance.
DeviceAddressTarget device address.
EndPointAddressEndpoint number and its direction encoded in bit 7
DeviceSpeedIndicates device speed.
MaximumPacketLengthMaximum packet size the target endpoint is capable
IsNewTransferIf TRUE, to submit an new asynchronous interrupt transfer If FALSE, to remove the specified asynchronous interrupt.
DataToggleOn input, the initial data toggle to use; on output, it is updated to indicate the next data toggle.
PollingIntervalThe he interval, in milliseconds, that the transfer is polled.
DataLengthThe length of data to receive at the rate specified by PollingInterval.
TranslatorTransaction translator to use.
CallBackFunctionFunction to call at the rate specified by PollingInterval.
ContextContext to CallBackFunction.
Return values
EFI_SUCCESSThe request has been successfully submitted or canceled.
EFI_INVALID_PARAMETERSome parameters are invalid.
EFI_OUT_OF_RESOURCESThe request failed due to a lack of resources.
EFI_DEVICE_ERRORThe transfer failed due to host controller error.

Definition at line 979 of file Ehci.c.

◆ EhcAsyncIsochronousTransfer()

EFI_STATUS EFIAPI EhcAsyncIsochronousTransfer ( IN EFI_USB2_HC_PROTOCOL This,
IN UINT8  DeviceAddress,
IN UINT8  EndPointAddress,
IN UINT8  DeviceSpeed,
IN UINTN  MaximumPacketLength,
IN UINT8  DataBuffersNumber,
IN OUT VOID *  Data[EFI_USB_MAX_ISO_BUFFER_NUM],
IN UINTN  DataLength,
IN EFI_USB2_HC_TRANSACTION_TRANSLATOR Translator,
IN EFI_ASYNC_USB_TRANSFER_CALLBACK  IsochronousCallBack,
IN VOID *  Context 
)

Submits Async isochronous transfer to a target USB device.

Parameters
ThisThis EFI_USB2_HC_PROTOCOL instance.
DeviceAddressTarget device address.
EndPointAddressEnd point address with its direction.
DeviceSpeedDevice speed, Low speed device doesn't support this type.
MaximumPacketLengthMaximum packet size that the endpoint is capable of sending or receiving.
DataBuffersNumberNumber of data buffers prepared for the transfer.
DataArray of pointers to the buffers of data that will be transmitted to USB device or received from USB device.
DataLengthThe size, in bytes, of the data buffer.
TranslatorTransaction translator to use.
IsochronousCallBackFunction to be called when the transfer complete.
ContextContext passed to the call back function as parameter.
Returns
EFI_UNSUPPORTED Isochronous transfer isn't supported.

Definition at line 1267 of file Ehci.c.

◆ EhcBulkTransfer()

EFI_STATUS EFIAPI EhcBulkTransfer ( IN EFI_USB2_HC_PROTOCOL This,
IN UINT8  DeviceAddress,
IN UINT8  EndPointAddress,
IN UINT8  DeviceSpeed,
IN UINTN  MaximumPacketLength,
IN UINT8  DataBuffersNumber,
IN OUT VOID *  Data[EFI_USB_MAX_BULK_BUFFER_NUM],
IN OUT UINTN DataLength,
IN OUT UINT8 *  DataToggle,
IN UINTN  TimeOut,
IN EFI_USB2_HC_TRANSACTION_TRANSLATOR Translator,
OUT UINT32 *  TransferResult 
)

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

Parameters
ThisThis EFI_USB2_HC_PROTOCOL instance.
DeviceAddressTarget device address.
EndPointAddressEndpoint number and its direction in bit 7.
DeviceSpeedDevice speed, Low speed device doesn't support bulk transfer.
MaximumPacketLengthMaximum packet size the endpoint is capable of sending or receiving.
DataBuffersNumberNumber of data buffers prepared for the transfer.
DataArray of pointers to the buffers of data to transmit from or receive into.
DataLengthThe lenght of the data buffer.
DataToggleOn input, the initial data toggle for the transfer; On output, it is updated to to next data toggle to use of the subsequent bulk transfer.
TimeOutIndicates the maximum time, in millisecond, which the transfer is allowed to complete.
TranslatorA pointr to the transaction translator data.
TransferResultA pointer to the detailed result information of the bulk transfer.
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 832 of file Ehci.c.

◆ EhcClearRootHubPortFeature()

EFI_STATUS EFIAPI EhcClearRootHubPortFeature ( IN EFI_USB2_HC_PROTOCOL This,
IN UINT8  PortNumber,
IN EFI_USB_PORT_FEATURE  PortFeature 
)

Clears a feature for the specified root hub port.

Parameters
ThisA pointer to the EFI_USB2_HC_PROTOCOL instance.
PortNumberSpecifies the root hub port whose feature is requested to be cleared.
PortFeatureIndicates the feature selector associated with the feature clear request.
Return values
EFI_SUCCESSThe feature specified by PortFeature was cleared for the USB root hub port specified by PortNumber.
EFI_INVALID_PARAMETERPortNumber is invalid or PortFeature is invalid.
EFI_DEVICE_ERRORCan't read register.

Definition at line 523 of file Ehci.c.

◆ EhcControlTransfer()

EFI_STATUS EFIAPI EhcControlTransfer ( IN EFI_USB2_HC_PROTOCOL This,
IN UINT8  DeviceAddress,
IN UINT8  DeviceSpeed,
IN UINTN  MaximumPacketLength,
IN EFI_USB_DEVICE_REQUEST Request,
IN EFI_USB_DATA_DIRECTION  TransferDirection,
IN OUT VOID *  Data,
IN OUT UINTN DataLength,
IN UINTN  TimeOut,
IN EFI_USB2_HC_TRANSACTION_TRANSLATOR Translator,
OUT UINT32 *  TransferResult 
)

Submits control transfer to a target USB device.

Parameters
ThisThis EFI_USB2_HC_PROTOCOL instance.
DeviceAddressThe target device address.
DeviceSpeedTarget device speed.
MaximumPacketLengthMaximum packet size the default control transfer endpoint is capable of sending or receiving.
RequestUSB device request to send.
TransferDirectionSpecifies the data direction for the data stage
DataData buffer to be transmitted or received from USB device.
DataLengthThe size (in bytes) of the data buffer.
TimeOutIndicates the maximum timeout, in millisecond.
TranslatorTransaction translator to be used by this device.
TransferResultReturn the result of this control transfer.
Return values
EFI_SUCCESSTransfer was completed successfully.
EFI_OUT_OF_RESOURCESThe transfer failed due to lack of resources.
EFI_INVALID_PARAMETERSome parameters are invalid.
EFI_TIMEOUTTransfer failed due to timeout.
EFI_DEVICE_ERRORTransfer failed due to host controller or device error.

Definition at line 666 of file Ehci.c.

◆ EhcCreateUsb2Hc()

USB2_HC_DEV * EhcCreateUsb2Hc ( IN EFI_PCI_IO_PROTOCOL PciIo,
IN EFI_DEVICE_PATH_PROTOCOL DevicePath,
IN UINT64  OriginalPciAttributes 
)

Create and initialize a USB2_HC_DEV.

Parameters
PciIoThe PciIo on this device.
DevicePathThe device path of host controller.
OriginalPciAttributesOriginal PCI attributes.
Returns
The allocated and initialized USB2_HC_DEV structure if created, otherwise NULL.

Definition at line 1520 of file Ehci.c.

◆ EhcDriverBindingStart()

EFI_STATUS EFIAPI EhcDriverBindingStart ( IN EFI_DRIVER_BINDING_PROTOCOL This,
IN EFI_HANDLE  Controller,
IN EFI_DEVICE_PATH_PROTOCOL RemainingDevicePath 
)

Starting the Usb EHCI Driver.

Parameters
ThisProtocol instance pointer.
ControllerHandle of device to test.
RemainingDevicePathNot used.
Returns
EFI_SUCCESS supports this device.
EFI_UNSUPPORTED do not support this device.
EFI_DEVICE_ERROR cannot be started due to device Error.
EFI_OUT_OF_RESOURCES cannot allocate resources.

Definition at line 1637 of file Ehci.c.

◆ EhcDriverBindingStop()

EFI_STATUS EFIAPI EhcDriverBindingStop ( IN EFI_DRIVER_BINDING_PROTOCOL This,
IN EFI_HANDLE  Controller,
IN UINTN  NumberOfChildren,
IN EFI_HANDLE ChildHandleBuffer 
)

Stop this driver on ControllerHandle. Support stopping any child handles created by this driver.

Parameters
ThisProtocol instance pointer.
ControllerHandle of device to stop driver on.
NumberOfChildrenNumber of Children in the ChildHandleBuffer.
ChildHandleBufferList of handles for the children we need to stop.
Returns
EFI_SUCCESS Success.
EFI_DEVICE_ERROR Fail.

Definition at line 2003 of file Ehci.c.

◆ EhcDriverBindingSupported()

EFI_STATUS EFIAPI EhcDriverBindingSupported ( IN EFI_DRIVER_BINDING_PROTOCOL This,
IN EFI_HANDLE  Controller,
IN EFI_DEVICE_PATH_PROTOCOL RemainingDevicePath 
)

Test to see if this driver supports ControllerHandle. Any ControllerHandle that has Usb2HcProtocol installed will be supported.

Parameters
ThisProtocol instance pointer.
ControllerHandle of device to test.
RemainingDevicePathNot used.
Returns
EFI_SUCCESS This driver supports this device.
EFI_UNSUPPORTED This driver does not support this device.

Definition at line 1326 of file Ehci.c.

◆ EhcDriverEntryPoint()

EFI_STATUS EFIAPI EhcDriverEntryPoint ( IN EFI_HANDLE  ImageHandle,
IN EFI_SYSTEM_TABLE SystemTable 
)

Entry point for EFI drivers.

Parameters
ImageHandleEFI_HANDLE.
SystemTableEFI_SYSTEM_TABLE.
Returns
EFI_SUCCESS Success. EFI_DEVICE_ERROR Fail.

Definition at line 1296 of file Ehci.c.

◆ EhcExitBootService()

VOID EFIAPI EhcExitBootService ( EFI_EVENT  Event,
VOID *  Context 
)

One notified function to stop the Host Controller when gBS->ExitBootServices() called.

Parameters
EventPointer to this event
ContextEvent handler private data

Definition at line 1606 of file Ehci.c.

◆ EhcGetCapability()

EFI_STATUS EFIAPI EhcGetCapability ( IN EFI_USB2_HC_PROTOCOL This,
OUT UINT8 *  MaxSpeed,
OUT UINT8 *  PortNumber,
OUT UINT8 *  Is64BitCapable 
)

Retrieves the capability of root hub ports.

Parameters
ThisThis EFI_USB_HC_PROTOCOL instance.
MaxSpeedMax speed supported by the controller.
PortNumberNumber of the root hub ports.
Is64BitCapableWhether the controller supports 64-bit memory addressing.
Return values
EFI_SUCCESSHost controller capability were retrieved successfully.
EFI_INVALID_PARAMETEREither of the three capability pointer is NULL.

Definition at line 66 of file Ehci.c.

◆ EhcGetRootHubPortStatus()

EFI_STATUS EFIAPI EhcGetRootHubPortStatus ( IN EFI_USB2_HC_PROTOCOL This,
IN UINT8  PortNumber,
OUT EFI_USB_PORT_STATUS PortStatus 
)

Retrieves the current status of a USB root hub port.

Parameters
ThisThis EFI_USB2_HC_PROTOCOL instance.
PortNumberThe root hub port to retrieve the state from. This value is zero-based.
PortStatusVariable to receive the port state.
Return values
EFI_SUCCESSThe status of the USB root hub port specified. by PortNumber was returned in PortStatus.
EFI_INVALID_PARAMETERPortNumber is invalid.
EFI_DEVICE_ERRORCan't read register.

Definition at line 319 of file Ehci.c.

◆ EhcGetState()

EFI_STATUS EFIAPI EhcGetState ( IN EFI_USB2_HC_PROTOCOL This,
OUT EFI_USB_HC_STATE State 
)

Retrieve the current state of the USB host controller.

Parameters
ThisThis EFI_USB2_HC_PROTOCOL instance.
StateVariable to return the current host controller state.
Return values
EFI_SUCCESSHost controller state was returned in State.
EFI_INVALID_PARAMETERState is NULL.
EFI_DEVICE_ERRORAn error was encountered while attempting to retrieve the host controller's current state.

Definition at line 202 of file Ehci.c.

◆ EhcGetUsbDebugPortInfo()

EFI_STATUS EhcGetUsbDebugPortInfo ( IN USB2_HC_DEV Ehc)

Get the usb debug port related information.

Parameters
EhcThe EHCI device.
Return values
RETURN_SUCCESSGet debug port number, bar and offset successfully.
OthersThe usb host controller does not supported usb debug port capability.

Definition at line 1395 of file Ehci.c.

◆ EhcIsochronousTransfer()

EFI_STATUS EFIAPI EhcIsochronousTransfer ( IN EFI_USB2_HC_PROTOCOL This,
IN UINT8  DeviceAddress,
IN UINT8  EndPointAddress,
IN UINT8  DeviceSpeed,
IN UINTN  MaximumPacketLength,
IN UINT8  DataBuffersNumber,
IN OUT VOID *  Data[EFI_USB_MAX_ISO_BUFFER_NUM],
IN UINTN  DataLength,
IN EFI_USB2_HC_TRANSACTION_TRANSLATOR Translator,
OUT UINT32 *  TransferResult 
)

Submits isochronous transfer to a target USB device.

Parameters
ThisThis EFI_USB2_HC_PROTOCOL instance.
DeviceAddressTarget device address.
EndPointAddressEnd point address with its direction.
DeviceSpeedDevice speed, Low speed device doesn't support this type.
MaximumPacketLengthMaximum packet size that the endpoint is capable of sending or receiving.
DataBuffersNumberNumber of data buffers prepared for the transfer.
DataArray of pointers to the buffers of data that will be transmitted to USB device or received from USB device.
DataLengthThe size, in bytes, of the data buffer.
TranslatorTransaction translator to use.
TransferResultVariable to receive the transfer result.
Returns
EFI_UNSUPPORTED Isochronous transfer is unsupported.

Definition at line 1226 of file Ehci.c.

◆ EhcReset()

EFI_STATUS EFIAPI EhcReset ( IN EFI_USB2_HC_PROTOCOL This,
IN UINT16  Attributes 
)

Provides software reset for the USB host controller.

Parameters
ThisThis EFI_USB2_HC_PROTOCOL instance.
AttributesA bit mask of the reset operation to perform.
Return values
EFI_SUCCESSThe reset operation succeeded.
EFI_INVALID_PARAMETERAttributes is not valid.
EFI_UNSUPPOURTEDThe type of reset specified by Attributes is not currently supported by the host controller.
EFI_DEVICE_ERRORHost controller isn't halted to reset.

Definition at line 108 of file Ehci.c.

◆ EhcSetRootHubPortFeature()

EFI_STATUS EFIAPI EhcSetRootHubPortFeature ( IN EFI_USB2_HC_PROTOCOL This,
IN UINT8  PortNumber,
IN EFI_USB_PORT_FEATURE  PortFeature 
)

Sets a feature for the specified root hub port.

Parameters
ThisThis EFI_USB2_HC_PROTOCOL instance.
PortNumberRoot hub port to set.
PortFeatureFeature to set.
Return values
EFI_SUCCESSThe feature specified by PortFeature was set.
EFI_INVALID_PARAMETERPortNumber is invalid or PortFeature is invalid.
EFI_DEVICE_ERRORCan't read register.

Definition at line 410 of file Ehci.c.

◆ EhcSetState()

EFI_STATUS EFIAPI EhcSetState ( IN EFI_USB2_HC_PROTOCOL This,
IN EFI_USB_HC_STATE  State 
)

Sets the USB host controller to a specific state.

Parameters
ThisThis EFI_USB2_HC_PROTOCOL instance.
StateThe state of the host controller that will be set.
Return values
EFI_SUCCESSThe USB host controller was successfully placed in the state specified by State.
EFI_INVALID_PARAMETERState is invalid.
EFI_DEVICE_ERRORFailed to set the state due to device error.

Definition at line 243 of file Ehci.c.

◆ EhcSyncInterruptTransfer()

EFI_STATUS EFIAPI EhcSyncInterruptTransfer ( IN EFI_USB2_HC_PROTOCOL This,
IN UINT8  DeviceAddress,
IN UINT8  EndPointAddress,
IN UINT8  DeviceSpeed,
IN UINTN  MaximumPacketLength,
IN OUT VOID *  Data,
IN OUT UINTN DataLength,
IN OUT UINT8 *  DataToggle,
IN UINTN  TimeOut,
IN EFI_USB2_HC_TRANSACTION_TRANSLATOR Translator,
OUT UINT32 *  TransferResult 
)

Submits synchronous interrupt transfer to an interrupt endpoint of a USB device.

Parameters
ThisThis EFI_USB2_HC_PROTOCOL instance.
DeviceAddressTarget device address.
EndPointAddressEndpoint number and its direction encoded in bit 7
DeviceSpeedIndicates device speed.
MaximumPacketLengthMaximum packet size the target endpoint is capable of sending or receiving.
DataBuffer of data that will be transmitted to USB device or received from USB device.
DataLengthOn input, the size, in bytes, of the data buffer; On output, the number of bytes transferred.
DataToggleOn input, the initial data toggle to use; on output, it is updated to indicate the next data toggle.
TimeOutMaximum time, in second, to complete.
TranslatorTransaction translator to use.
TransferResultVariable to receive the transfer result.
Returns
EFI_SUCCESS The transfer was completed successfully.
EFI_OUT_OF_RESOURCES The transfer failed due to lack of resource.
EFI_INVALID_PARAMETER Some parameters are invalid.
EFI_TIMEOUT The transfer failed due to timeout.
EFI_DEVICE_ERROR The failed due to host controller or device error

Definition at line 1101 of file Ehci.c.

Variable Documentation

◆ gEhciDriverBinding

EFI_DRIVER_BINDING_PROTOCOL gEhciDriverBinding
Initial value:
= {
0x30,
}
EFI_STATUS EFIAPI EhcDriverBindingSupported(IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE Controller, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath)
Definition: Ehci.c:1326
EFI_STATUS EFIAPI EhcDriverBindingStop(IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE Controller, IN UINTN NumberOfChildren, IN EFI_HANDLE *ChildHandleBuffer)
Definition: Ehci.c:2003
EFI_STATUS EFIAPI EhcDriverBindingStart(IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE Controller, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath)
Definition: Ehci.c:1637
#define NULL
Definition: Base.h:319

Definition at line 42 of file Ehci.c.

◆ mUsbPortChangeMap

USB_PORT_STATE_MAP mUsbPortChangeMap[]
Initial value:
= {
{ PORTSC_CONN_CHANGE, USB_PORT_STAT_C_CONNECTION },
{ PORTSC_ENABLE_CHANGE, USB_PORT_STAT_C_ENABLE },
{ PORTSC_OVERCUR_CHANGE, USB_PORT_STAT_C_OVERCURRENT }
}
#define USB_PORT_STAT_C_CONNECTION

Definition at line 35 of file Ehci.c.

◆ mUsbPortStateMap

USB_PORT_STATE_MAP mUsbPortStateMap[]
Initial value:
= {
{ PORTSC_CONN, USB_PORT_STAT_CONNECTION },
{ PORTSC_ENABLED, USB_PORT_STAT_ENABLE },
{ PORTSC_SUSPEND, USB_PORT_STAT_SUSPEND },
{ PORTSC_OVERCUR, USB_PORT_STAT_OVERCURRENT },
{ PORTSC_RESET, USB_PORT_STAT_RESET },
{ PORTSC_POWER, USB_PORT_STAT_POWER },
{ PORTSC_OWNER, USB_PORT_STAT_OWNER }
}
#define USB_PORT_STAT_CONNECTION

Definition at line 25 of file Ehci.c.