TianoCore EDK2 master
|
#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_DEV * | EhcCreateUsb2Hc (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 |
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.
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.
This | This EFI_USB2_HC_PROTOCOL instance. |
DeviceAddress | Target device address. |
EndPointAddress | Endpoint number and its direction encoded in bit 7 |
DeviceSpeed | Indicates device speed. |
MaximumPacketLength | Maximum packet size the target endpoint is capable |
IsNewTransfer | If TRUE, to submit an new asynchronous interrupt transfer If FALSE, to remove the specified asynchronous interrupt. |
DataToggle | On input, the initial data toggle to use; on output, it is updated to indicate the next data toggle. |
PollingInterval | The he interval, in milliseconds, that the transfer is polled. |
DataLength | The length of data to receive at the rate specified by PollingInterval. |
Translator | Transaction translator to use. |
CallBackFunction | Function to call at the rate specified by PollingInterval. |
Context | Context to CallBackFunction. |
EFI_SUCCESS | The request has been successfully submitted or canceled. |
EFI_INVALID_PARAMETER | Some parameters are invalid. |
EFI_OUT_OF_RESOURCES | The request failed due to a lack of resources. |
EFI_DEVICE_ERROR | The transfer failed due to host controller error. |
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.
This | This EFI_USB2_HC_PROTOCOL instance. |
DeviceAddress | Target device address. |
EndPointAddress | End point address with its direction. |
DeviceSpeed | Device speed, Low speed device doesn't support this type. |
MaximumPacketLength | Maximum packet size that the endpoint is capable of sending or receiving. |
DataBuffersNumber | Number of data buffers prepared for the transfer. |
Data | Array of pointers to the buffers of data that will be transmitted to USB device or received from USB device. |
DataLength | The size, in bytes, of the data buffer. |
Translator | Transaction translator to use. |
IsochronousCallBack | Function to be called when the transfer complete. |
Context | Context passed to the call back function as parameter. |
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.
This | This EFI_USB2_HC_PROTOCOL instance. |
DeviceAddress | Target device address. |
EndPointAddress | Endpoint number and its direction in bit 7. |
DeviceSpeed | Device speed, Low speed device doesn't support bulk transfer. |
MaximumPacketLength | Maximum packet size the endpoint is capable of sending or receiving. |
DataBuffersNumber | Number of data buffers prepared for the transfer. |
Data | Array of pointers to the buffers of data to transmit from or receive into. |
DataLength | The lenght of the data buffer. |
DataToggle | On 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. |
TimeOut | Indicates the maximum time, in millisecond, which the transfer is allowed to complete. |
Translator | A pointr to the transaction translator data. |
TransferResult | A pointer to the detailed result information of the bulk transfer. |
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 transfer failed due to host controller error. |
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.
This | A pointer to the EFI_USB2_HC_PROTOCOL instance. |
PortNumber | Specifies the root hub port whose feature is requested to be cleared. |
PortFeature | Indicates the feature selector associated with the feature clear request. |
EFI_SUCCESS | The feature specified by PortFeature was cleared for the USB root hub port specified by PortNumber. |
EFI_INVALID_PARAMETER | PortNumber is invalid or PortFeature is invalid. |
EFI_DEVICE_ERROR | Can't read register. |
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.
This | This EFI_USB2_HC_PROTOCOL instance. |
DeviceAddress | The target device address. |
DeviceSpeed | Target device speed. |
MaximumPacketLength | Maximum packet size the default control transfer endpoint is capable of sending or receiving. |
Request | USB device request to send. |
TransferDirection | Specifies the data direction for the data stage |
Data | Data buffer to be transmitted or received from USB device. |
DataLength | The size (in bytes) of the data buffer. |
TimeOut | Indicates the maximum timeout, in millisecond. |
Translator | Transaction translator to be used by this device. |
TransferResult | Return the result of this control transfer. |
EFI_SUCCESS | Transfer was completed successfully. |
EFI_OUT_OF_RESOURCES | The transfer failed due to lack of resources. |
EFI_INVALID_PARAMETER | Some parameters are invalid. |
EFI_TIMEOUT | Transfer failed due to timeout. |
EFI_DEVICE_ERROR | Transfer failed due to host controller or device error. |
USB2_HC_DEV * EhcCreateUsb2Hc | ( | IN EFI_PCI_IO_PROTOCOL * | PciIo, |
IN EFI_DEVICE_PATH_PROTOCOL * | DevicePath, | ||
IN UINT64 | OriginalPciAttributes | ||
) |
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.
This | Protocol instance pointer. |
Controller | Handle of device to test. |
RemainingDevicePath | Not used. |
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.
This | Protocol instance pointer. |
Controller | Handle of device to stop driver on. |
NumberOfChildren | Number of Children in the ChildHandleBuffer. |
ChildHandleBuffer | List of handles for the children we need to stop. |
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.
This | Protocol instance pointer. |
Controller | Handle of device to test. |
RemainingDevicePath | Not used. |
EFI_STATUS EFIAPI EhcDriverEntryPoint | ( | IN EFI_HANDLE | ImageHandle, |
IN EFI_SYSTEM_TABLE * | SystemTable | ||
) |
Entry point for EFI drivers.
ImageHandle | EFI_HANDLE. |
SystemTable | EFI_SYSTEM_TABLE. |
VOID EFIAPI EhcExitBootService | ( | EFI_EVENT | Event, |
VOID * | Context | ||
) |
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.
This | This EFI_USB_HC_PROTOCOL instance. |
MaxSpeed | Max speed supported by the controller. |
PortNumber | Number of the root hub ports. |
Is64BitCapable | Whether the controller supports 64-bit memory addressing. |
EFI_SUCCESS | Host controller capability were retrieved successfully. |
EFI_INVALID_PARAMETER | Either of the three capability pointer is NULL. |
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.
This | This EFI_USB2_HC_PROTOCOL instance. |
PortNumber | The root hub port to retrieve the state from. This value is zero-based. |
PortStatus | Variable to receive the port state. |
EFI_SUCCESS | The status of the USB root hub port specified. by PortNumber was returned in PortStatus. |
EFI_INVALID_PARAMETER | PortNumber is invalid. |
EFI_DEVICE_ERROR | Can't read register. |
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.
This | This EFI_USB2_HC_PROTOCOL instance. |
State | Variable to return the current host controller state. |
EFI_SUCCESS | Host controller state was returned in State. |
EFI_INVALID_PARAMETER | State is NULL. |
EFI_DEVICE_ERROR | An error was encountered while attempting to retrieve the host controller's current state. |
EFI_STATUS EhcGetUsbDebugPortInfo | ( | IN USB2_HC_DEV * | Ehc | ) |
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.
This | This EFI_USB2_HC_PROTOCOL instance. |
DeviceAddress | Target device address. |
EndPointAddress | End point address with its direction. |
DeviceSpeed | Device speed, Low speed device doesn't support this type. |
MaximumPacketLength | Maximum packet size that the endpoint is capable of sending or receiving. |
DataBuffersNumber | Number of data buffers prepared for the transfer. |
Data | Array of pointers to the buffers of data that will be transmitted to USB device or received from USB device. |
DataLength | The size, in bytes, of the data buffer. |
Translator | Transaction translator to use. |
TransferResult | Variable to receive the transfer result. |
EFI_STATUS EFIAPI EhcReset | ( | IN EFI_USB2_HC_PROTOCOL * | This, |
IN UINT16 | Attributes | ||
) |
Provides software reset for the USB host controller.
This | This EFI_USB2_HC_PROTOCOL instance. |
Attributes | A bit mask of the reset operation to perform. |
EFI_SUCCESS | The reset operation succeeded. |
EFI_INVALID_PARAMETER | Attributes is not valid. |
EFI_UNSUPPOURTED | The type of reset specified by Attributes is not currently supported by the host controller. |
EFI_DEVICE_ERROR | Host controller isn't halted to reset. |
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.
This | This EFI_USB2_HC_PROTOCOL instance. |
PortNumber | Root hub port to set. |
PortFeature | Feature to set. |
EFI_SUCCESS | The feature specified by PortFeature was set. |
EFI_INVALID_PARAMETER | PortNumber is invalid or PortFeature is invalid. |
EFI_DEVICE_ERROR | Can't read register. |
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.
This | This EFI_USB2_HC_PROTOCOL instance. |
State | The state of the host controller that will be set. |
EFI_SUCCESS | The USB host controller was successfully placed in the state specified by State. |
EFI_INVALID_PARAMETER | State is invalid. |
EFI_DEVICE_ERROR | Failed to set the state due to device error. |
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.
This | This EFI_USB2_HC_PROTOCOL instance. |
DeviceAddress | Target device address. |
EndPointAddress | Endpoint number and its direction encoded in bit 7 |
DeviceSpeed | Indicates device speed. |
MaximumPacketLength | Maximum packet size the target endpoint is capable of sending or receiving. |
Data | Buffer of data that will be transmitted to USB device or received from USB device. |
DataLength | On input, the size, in bytes, of the data buffer; On output, the number of bytes transferred. |
DataToggle | On input, the initial data toggle to use; on output, it is updated to indicate the next data toggle. |
TimeOut | Maximum time, in second, to complete. |
Translator | Transaction translator to use. |
TransferResult | Variable to receive the transfer result. |
EFI_DRIVER_BINDING_PROTOCOL gEhciDriverBinding |
USB_PORT_STATE_MAP mUsbPortChangeMap[] |
USB_PORT_STATE_MAP mUsbPortStateMap[] |