/** @file
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 the UHCI driver attaches to the companion UHCI controller.
This way avoids the control transfer on a shared port between EHCI and companion host
controller when UHCI gets attached earlier than EHCI and a USB 2.0 device inserts.
Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
#include "Ehci.h"
//
// Two arrays used to translate the EHCI port state (change)
// to the UEFI protocol's port state (change).
//
};
};
0x30,
NULL,
};
/**
Retrieves the capability of root hub ports.
@param This This EFI_USB_HC_PROTOCOL instance.
@param MaxSpeed Max speed supported by the controller.
@param PortNumber Number of the root hub ports.
@param Is64BitCapable Whether the controller supports 64-bit memory
addressing.
@retval EFI_SUCCESS Host controller capability were retrieved successfully.
@retval EFI_INVALID_PARAMETER Either of the three capability pointer is NULL.
**/
)
{
return EFI_INVALID_PARAMETER;
}
return EFI_SUCCESS;
}
/**
Provides software reset for the USB host controller.
@param This This EFI_USB2_HC_PROTOCOL instance.
@param Attributes A bit mask of the reset operation to perform.
@retval EFI_SUCCESS The reset operation succeeded.
@retval EFI_INVALID_PARAMETER Attributes is not valid.
@retval EFI_UNSUPPOURTED The type of reset specified by Attributes is
not currently supported by the host controller.
@retval EFI_DEVICE_ERROR Host controller isn't halted to reset.
**/
EhcReset (
)
{
switch (Attributes) {
case EFI_USB_HC_RESET_GLOBAL:
//
// Flow through, same behavior as Host Controller Reset
//
//
// Host Controller must be Halt when Reset it
//
if (Ehc->DebugPortNum != 0) {
if ((DbgCtrlStatus & (USB_DEBUG_PORT_IN_USE | USB_DEBUG_PORT_OWNER)) == (USB_DEBUG_PORT_IN_USE | USB_DEBUG_PORT_OWNER)) {
goto ON_EXIT;
}
}
goto ON_EXIT;
}
}
//
// Clean up the asynchronous transfers, currently only
// interrupt supports asynchronous operation.
//
EhcFreeSched (Ehc);
goto ON_EXIT;
}
break;
break;
default:
}
return Status;
}
/**
Retrieve the current state of the USB host controller.
@param This This EFI_USB2_HC_PROTOCOL instance.
@param State Variable to return the current host controller
state.
@retval EFI_SUCCESS Host controller state was returned in State.
@retval EFI_INVALID_PARAMETER State is NULL.
@retval EFI_DEVICE_ERROR An error was encountered while attempting to
retrieve the host controller's current state.
**/
)
{
return EFI_INVALID_PARAMETER;
}
} else {
}
return EFI_SUCCESS;
}
/**
Sets the USB host controller to a specific state.
@param This This EFI_USB2_HC_PROTOCOL instance.
@param State The state of the host controller that will be set.
@retval EFI_SUCCESS The USB host controller was successfully placed
in the state specified by State.
@retval EFI_INVALID_PARAMETER State is invalid.
@retval EFI_DEVICE_ERROR Failed to set the state due to device error.
**/
)
{
return EFI_DEVICE_ERROR;
}
return EFI_SUCCESS;
}
switch (State) {
case EfiUsbHcStateHalt:
break;
case EfiUsbHcStateOperational:
break;
}
//
// Software must not write a one to this field unless the host controller
// is in the Halted state. Doing so will yield undefined results.
// refers to Spec[EHCI1.0-2.3.1]
//
break;
}
break;
case EfiUsbHcStateSuspend:
break;
default:
}
return Status;
}
/**
Retrieves the current status of a USB root hub port.
@param This This EFI_USB2_HC_PROTOCOL instance.
@param PortNumber The root hub port to retrieve the state from.
This value is zero-based.
@param PortStatus Variable to receive the port state.
@retval EFI_SUCCESS The status of the USB root hub port specified.
by PortNumber was returned in PortStatus.
@retval EFI_INVALID_PARAMETER PortNumber is invalid.
@retval EFI_DEVICE_ERROR Can't read register.
**/
)
{
if (PortStatus == NULL) {
return EFI_INVALID_PARAMETER;
}
if (PortNumber >= TotalPort) {
goto ON_EXIT;
}
PortStatus->PortStatus = 0;
PortStatus->PortChangeStatus = 0;
if ((DbgCtrlStatus & (USB_DEBUG_PORT_IN_USE | USB_DEBUG_PORT_OWNER)) == (USB_DEBUG_PORT_IN_USE | USB_DEBUG_PORT_OWNER)) {
goto ON_EXIT;
}
}
//
// Identify device speed. If in K state, it is low speed.
// If the port is enabled after reset, the device is of
// high speed. The USB bus driver should retrieve the actual
// port speed after reset.
//
}
//
//
}
}
PortStatus->PortChangeStatus = (UINT16) (PortStatus->PortChangeStatus | mUsbPortChangeMap[Index].UefiState);
}
}
return Status;
}
/**
Sets a feature for the specified root hub port.
@param This This EFI_USB2_HC_PROTOCOL instance.
@param PortNumber Root hub port to set.
@param PortFeature Feature to set.
@retval EFI_SUCCESS The feature specified by PortFeature was set.
@retval EFI_INVALID_PARAMETER PortNumber is invalid or PortFeature is invalid.
@retval EFI_DEVICE_ERROR Can't read register.
**/
)
{
if (PortNumber >= TotalPort) {
goto ON_EXIT;
}
//
// Mask off the port status change bits, these bits are
// write clean bit
//
State &= ~PORTSC_CHANGE_MASK;
switch (PortFeature) {
case EfiUsbPortEnable:
//
// Sofeware can't set this bit, Port can only be enable by
// EHCI as a part of the reset and enable
//
State |= PORTSC_ENABLED;
break;
case EfiUsbPortSuspend:
State |= PORTSC_SUSPEND;
break;
case EfiUsbPortReset:
//
// Make sure Host Controller not halt before reset it
//
break;
}
}
//
// Set one to PortReset bit must also set zero to PortEnable bit
//
State |= PORTSC_RESET;
State &= ~PORTSC_ENABLED;
break;
case EfiUsbPortPower:
//
// Set port power bit when PPC is 1
//
State |= PORTSC_POWER;
}
break;
case EfiUsbPortOwner:
State |= PORTSC_OWNER;
break;
default:
}
return Status;
}
/**
Clears a feature for the specified root hub port.
@param This A pointer to the EFI_USB2_HC_PROTOCOL instance.
@param PortNumber Specifies the root hub port whose feature is
requested to be cleared.
@param PortFeature Indicates the feature selector associated with the
feature clear request.
@retval EFI_SUCCESS The feature specified by PortFeature was cleared
for the USB root hub port specified by PortNumber.
@retval EFI_INVALID_PARAMETER PortNumber is invalid or PortFeature is invalid.
@retval EFI_DEVICE_ERROR Can't read register.
**/
)
{
if (PortNumber >= TotalPort) {
goto ON_EXIT;
}
State &= ~PORTSC_CHANGE_MASK;
switch (PortFeature) {
case EfiUsbPortEnable:
//
// Clear PORT_ENABLE feature means disable port.
//
State &= ~PORTSC_ENABLED;
break;
case EfiUsbPortSuspend:
//
// A write of zero to this bit is ignored by the host
// controller. The host controller will unconditionally
// set this bit to a zero when:
// 1. software sets the Forct Port Resume bit to a zero from a one.
// 2. software sets the Port Reset bit to a one frome a zero.
//
State &= ~PORSTSC_RESUME;
break;
case EfiUsbPortReset:
//
// Clear PORT_RESET means clear the reset signal.
//
State &= ~PORTSC_RESET;
break;
case EfiUsbPortOwner:
//
// Clear port owner means this port owned by EHC
//
State &= ~PORTSC_OWNER;
break;
case EfiUsbPortConnectChange:
//
// Clear connect status change
//
break;
case EfiUsbPortEnableChange:
//
// Clear enable status change
//
break;
//
// Clear PortOverCurrent change
//
break;
case EfiUsbPortPower:
//
// Clear port power bit when PPC is 1
//
State &= ~PORTSC_POWER;
}
break;
case EfiUsbPortSuspendChange:
case EfiUsbPortResetChange:
//
// Not supported or not related operation
//
break;
default:
break;
}
return Status;
}
/**
Submits control transfer to a target USB device.
@param This This EFI_USB2_HC_PROTOCOL instance.
@param DeviceAddress The target device address.
@param DeviceSpeed Target device speed.
@param MaximumPacketLength Maximum packet size the default control transfer
endpoint is capable of sending or receiving.
@param Request USB device request to send.
@param TransferDirection Specifies the data direction for the data stage
@param Data Data buffer to be transmitted or received from USB
device.
@param DataLength The size (in bytes) of the data buffer.
@param TimeOut Indicates the maximum timeout, in millisecond.
@param Translator Transaction translator to be used by this device.
@param TransferResult Return the result of this control transfer.
@retval EFI_SUCCESS Transfer was completed successfully.
@retval EFI_OUT_OF_RESOURCES The transfer failed due to lack of resources.
@retval EFI_INVALID_PARAMETER Some parameters are invalid.
@retval EFI_TIMEOUT Transfer failed due to timeout.
@retval EFI_DEVICE_ERROR Transfer failed due to host controller or device error.
**/
)
{
//
// Validate parameters
//
return EFI_INVALID_PARAMETER;
}
if ((TransferDirection != EfiUsbDataIn) &&
(TransferDirection != EfiUsbDataOut) &&
(TransferDirection != EfiUsbNoData)) {
return EFI_INVALID_PARAMETER;
}
if ((TransferDirection == EfiUsbNoData) &&
return EFI_INVALID_PARAMETER;
}
if ((TransferDirection != EfiUsbNoData) &&
return EFI_INVALID_PARAMETER;
}
return EFI_INVALID_PARAMETER;
}
return EFI_INVALID_PARAMETER;
}
goto ON_EXIT;
}
//
// Create a new URB, insert it into the asynchronous
// schedule list, then poll the execution status.
//
//
// Encode the direction in address, although default control
// endpoint is bidirectional. EhcCreateUrb expects this
// combination of Ep addr and its direction.
//
Urb = EhcCreateUrb (
Ehc,
0,
Data,
NULL,
NULL,
1
);
goto ON_EXIT;
}
//
// Get the status from URB. The result is updated in EhcCheckUrbResult
// which is called by EhcExecTransfer
//
if (*TransferResult == EFI_USB_NOERROR) {
}
}
return Status;
}
/**
Submits bulk transfer to a bulk endpoint of a USB device.
@param This This EFI_USB2_HC_PROTOCOL instance.
@param DeviceAddress Target device address.
@param EndPointAddress Endpoint number and its direction in bit 7.
@param DeviceSpeed Device speed, Low speed device doesn't support bulk
transfer.
@param MaximumPacketLength Maximum packet size the endpoint is capable of
sending or receiving.
@param DataBuffersNumber Number of data buffers prepared for the transfer.
@param Data Array of pointers to the buffers of data to transmit
from or receive into.
@param DataLength The lenght of the data buffer.
@param 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.
@param TimeOut Indicates the maximum time, in millisecond, which
the transfer is allowed to complete.
@param Translator A pointr to the transaction translator data.
@param TransferResult A pointer to the detailed result information of the
bulk transfer.
@retval EFI_SUCCESS The transfer was completed successfully.
@retval EFI_OUT_OF_RESOURCES The transfer failed due to lack of resource.
@retval EFI_INVALID_PARAMETER Some parameters are invalid.
@retval EFI_TIMEOUT The transfer failed due to timeout.
@retval EFI_DEVICE_ERROR The transfer failed due to host controller error.
**/
)
{
//
// Validate the parameters
//
return EFI_INVALID_PARAMETER;
}
return EFI_INVALID_PARAMETER;
}
if ((DeviceSpeed == EFI_USB_SPEED_LOW) ||
return EFI_INVALID_PARAMETER;
}
goto ON_EXIT;
}
//
// Create a new URB, insert it into the asynchronous
// schedule list, then poll the execution status.
//
Urb = EhcCreateUrb (
Ehc,
NULL,
Data[0],
NULL,
NULL,
1
);
goto ON_EXIT;
}
if (*TransferResult == EFI_USB_NOERROR) {
}
}
return Status;
}
/**
Submits an asynchronous interrupt transfer to an
interrupt endpoint of a USB device.
@param This This EFI_USB2_HC_PROTOCOL instance.
@param DeviceAddress Target device address.
@param EndPointAddress Endpoint number and its direction encoded in bit 7
@param DeviceSpeed Indicates device speed.
@param MaximumPacketLength Maximum packet size the target endpoint is capable
@param IsNewTransfer If TRUE, to submit an new asynchronous interrupt
transfer If FALSE, to remove the specified
asynchronous interrupt.
@param DataToggle On input, the initial data toggle to use; on output,
it is updated to indicate the next data toggle.
@param PollingInterval The he interval, in milliseconds, that the transfer
is polled.
@param DataLength The length of data to receive at the rate specified
by PollingInterval.
@param Translator Transaction translator to use.
@param CallBackFunction Function to call at the rate specified by
PollingInterval.
@param Context Context to CallBackFunction.
@retval EFI_SUCCESS The request has been successfully submitted or canceled.
@retval EFI_INVALID_PARAMETER Some parameters are invalid.
@retval EFI_OUT_OF_RESOURCES The request failed due to a lack of resources.
@retval EFI_DEVICE_ERROR The transfer failed due to host controller error.
**/
)
{
//
// Validate parameters
//
if (!EHCI_IS_DATAIN (EndPointAddress)) {
return EFI_INVALID_PARAMETER;
}
if (IsNewTransfer) {
if (DataLength == 0) {
return EFI_INVALID_PARAMETER;
}
return EFI_INVALID_PARAMETER;
}
return EFI_INVALID_PARAMETER;
}
}
//
// Delete Async interrupt transfer request. DataToggle will return
// the next data toggle to use.
//
if (!IsNewTransfer) {
goto ON_EXIT;
}
goto ON_EXIT;
}
goto ON_EXIT;
}
Urb = EhcCreateUrb (
Ehc,
NULL,
Data,
);
goto ON_EXIT;
}
//
// New asynchronous transfer must inserted to the head.
// Check the comments in EhcMoniteAsyncRequests
//
return Status;
}
/**
Submits synchronous interrupt transfer to an interrupt endpoint
of a USB device.
@param This This EFI_USB2_HC_PROTOCOL instance.
@param DeviceAddress Target device address.
@param EndPointAddress Endpoint number and its direction encoded in bit 7
@param DeviceSpeed Indicates device speed.
@param MaximumPacketLength Maximum packet size the target endpoint is capable
of sending or receiving.
@param Data Buffer of data that will be transmitted to USB
device or received from USB device.
@param DataLength On input, the size, in bytes, of the data buffer; On
output, the number of bytes transferred.
@param DataToggle On input, the initial data toggle to use; on output,
it is updated to indicate the next data toggle.
@param TimeOut Maximum time, in second, to complete.
@param Translator Transaction translator to use.
@param TransferResult Variable to receive the transfer result.
@return EFI_SUCCESS The transfer was completed successfully.
@return EFI_OUT_OF_RESOURCES The transfer failed due to lack of resource.
@return EFI_INVALID_PARAMETER Some parameters are invalid.
@return EFI_TIMEOUT The transfer failed due to timeout.
@return EFI_DEVICE_ERROR The failed due to host controller or device error
**/
)
{
//
// Validates parameters
//
return EFI_INVALID_PARAMETER;
}
if (!EHCI_IS_DATAIN (EndPointAddress)) {
return EFI_INVALID_PARAMETER;
}
return EFI_INVALID_PARAMETER;
}
return EFI_INVALID_PARAMETER;
}
goto ON_EXIT;
}
Urb = EhcCreateUrb (
Ehc,
NULL,
Data,
NULL,
NULL,
1
);
goto ON_EXIT;
}
if (*TransferResult == EFI_USB_NOERROR) {
}
DEBUG ((EFI_D_ERROR, "EhcSyncInterruptTransfer: error - %r, transfer - %x\n", Status, *TransferResult));
}
return Status;
}
/**
Submits isochronous transfer to a target USB device.
@param This This EFI_USB2_HC_PROTOCOL instance.
@param DeviceAddress Target device address.
@param EndPointAddress End point address with its direction.
@param DeviceSpeed Device speed, Low speed device doesn't support this
type.
@param MaximumPacketLength Maximum packet size that the endpoint is capable of
sending or receiving.
@param DataBuffersNumber Number of data buffers prepared for the transfer.
@param Data Array of pointers to the buffers of data that will
be transmitted to USB device or received from USB
device.
@param DataLength The size, in bytes, of the data buffer.
@param Translator Transaction translator to use.
@param TransferResult Variable to receive the transfer result.
@return EFI_UNSUPPORTED Isochronous transfer is unsupported.
**/
)
{
return EFI_UNSUPPORTED;
}
/**
Submits Async isochronous transfer to a target USB device.
@param This This EFI_USB2_HC_PROTOCOL instance.
@param DeviceAddress Target device address.
@param EndPointAddress End point address with its direction.
@param DeviceSpeed Device speed, Low speed device doesn't support this
type.
@param MaximumPacketLength Maximum packet size that the endpoint is capable of
sending or receiving.
@param DataBuffersNumber Number of data buffers prepared for the transfer.
@param Data Array of pointers to the buffers of data that will
be transmitted to USB device or received from USB
device.
@param DataLength The size, in bytes, of the data buffer.
@param Translator Transaction translator to use.
@param IsochronousCallBack Function to be called when the transfer complete.
@param Context Context passed to the call back function as
parameter.
@return EFI_UNSUPPORTED Isochronous transfer isn't supported.
**/
)
{
return EFI_UNSUPPORTED;
}
/**
Entry point for EFI drivers.
@param ImageHandle EFI_HANDLE.
@param SystemTable EFI_SYSTEM_TABLE.
@return EFI_SUCCESS Success.
EFI_DEVICE_ERROR Fail.
**/
)
{
);
}
/**
Test to see if this driver supports ControllerHandle. Any
ControllerHandle that has Usb2HcProtocol installed will
be supported.
@param This Protocol instance pointer.
@param Controller Handle of device to test.
@param RemainingDevicePath Not used.
@return EFI_SUCCESS This driver supports this device.
@return EFI_UNSUPPORTED This driver does not support this device.
**/
)
{
//
// Test whether there is PCI IO Protocol attached on the controller handle.
//
);
return EFI_UNSUPPORTED;
}
sizeof (USB_CLASSC) / sizeof (UINT8),
);
goto ON_EXIT;
}
//
// Test whether the controller belongs to Ehci type
//
if ((UsbClassCReg.BaseCode != PCI_CLASS_SERIAL) || (UsbClassCReg.SubClassCode != PCI_CLASS_SERIAL_USB)
}
gBS->CloseProtocol (
);
return Status;
}
/**
Get the usb debug port related information.
@param Ehc The EHCI device.
@retval RETURN_SUCCESS Get debug port number, bar and offset successfully.
@retval Others The usb host controller does not supported usb debug port capability.
**/
)
{
//
// Detect if the EHCI host controller support Capaility Pointer.
//
sizeof (UINT16),
);
return Status;
}
if ((PciStatus & EFI_PCI_STATUS_CAPABILITY) == 0) {
//
// The Pci Device Doesn't Support Capability Pointer.
//
return EFI_UNSUPPORTED;
}
//
// Get Pointer To Capability List
//
1,
);
return Status;
}
//
// Find Capability ID 0xA, Which Is For Debug Port
//
while (CapabilityPtr != 0) {
1,
);
return Status;
}
if (CapabilityId == EHC_DEBUG_PORT_CAP_ID) {
break;
}
CapabilityPtr + 1,
1,
);
return Status;
}
}
//
// No Debug Port Capability Found
//
if (CapabilityPtr == 0) {
return EFI_UNSUPPORTED;
}
//
// Get The Base Address Of Debug Port Register In Debug Port Capability Register
//
CapabilityPtr + 2,
sizeof (UINT16),
);
return Status;
}
return EFI_SUCCESS;
}
/**
Create and initialize a USB2_HC_DEV.
@param PciIo The PciIo on this device.
@param OriginalPciAttributes Original PCI attributes.
@return The allocated and initialized USB2_HC_DEV structure if created,
otherwise NULL.
**/
)
{
return NULL;
}
//
// Init EFI_USB2_HC_PROTOCOL interface and private data structure
//
//
// EHCI Controllers with a CapLen of 0 are ignored.
//
return NULL;
}
//
// Create AsyncRequest Polling Timer
//
Ehc,
);
return NULL;
}
return Ehc;
}
/**
One notified function to stop the Host Controller when gBS->ExitBootServices() called.
@param Event Pointer to this event
@param Context Event hanlder private data
**/
)
{
//
// Reset the Host Controller
//
}
/**
Starting the Usb EHCI Driver.
@param This Protocol instance pointer.
@param Controller Handle of device to test.
@param RemainingDevicePath Not used.
@return EFI_SUCCESS supports this device.
@return EFI_UNSUPPORTED do not support this device.
@return EFI_DEVICE_ERROR cannot be started due to device Error.
@return EFI_OUT_OF_RESOURCES cannot allocate resources.
**/
)
{
//
// Open the PciIo Protocol, then enable the USB host controller
//
);
return Status;
}
//
// Save original PCI attributes
//
0,
);
goto CLOSE_PCIIO;
}
0,
);
);
}
goto CLOSE_PCIIO;
}
//
// Get the Pci device class code.
//
sizeof (USB_CLASSC) / sizeof (UINT8),
);
goto CLOSE_PCIIO;
}
//
// determine if the device is UHCI host controller or not. If yes, then find out the
// companion usb ehci host controller and force EHCI driver get attached to it before
// UHCI driver attaches to UHCI host controller.
//
);
goto CLOSE_PCIIO;
}
NULL,
);
goto CLOSE_PCIIO;
}
//
// Get the device path on this handle
//
);
sizeof (USB_CLASSC) / sizeof (UINT8),
);
goto CLOSE_PCIIO;
}
);
goto CLOSE_PCIIO;
}
//
// Currently, the judgment on the companion usb host controller is through the
// same bus number, which may vary on different platform.
//
if (EhciBusNumber == UhciBusNumber) {
gBS->CloseProtocol (
);
}
}
}
goto CLOSE_PCIIO;
}
//
// Create then install USB2_HC_PROTOCOL
//
goto CLOSE_PCIIO;
}
);
goto FREE_POOL;
}
//
// Robustnesss improvement such as for Duet platform
// Default is not required.
//
if (FeaturePcdGet (PcdTurnOffUsbLegacySupport)) {
}
if (Ehc->DebugPortNum != 0) {
if ((State & (USB_DEBUG_PORT_IN_USE | USB_DEBUG_PORT_OWNER)) != (USB_DEBUG_PORT_IN_USE | USB_DEBUG_PORT_OWNER)) {
}
}
goto UNINSTALL_USBHC;
}
//
// Start the asynchronous interrupt monitor
//
goto UNINSTALL_USBHC;
}
//
// Create event to stop the HC when exit boot service.
//
Ehc,
);
goto UNINSTALL_USBHC;
}
//
// Install the component name protocol, don't fail the start
// because of something for display.
//
"eng",
L"Enhanced Host Controller (USB 2.0)",
);
"en",
L"Enhanced Host Controller (USB 2.0)",
);
return EFI_SUCCESS;
);
EhcFreeSched (Ehc);
if (PciAttributesSaved) {
//
// Restore original PCI attributes
//
PciIo->Attributes (
);
}
gBS->CloseProtocol (
);
return Status;
}
/**
Stop this driver on ControllerHandle. Support stoping any child handles
created by this driver.
@param This Protocol instance pointer.
@param Controller Handle of device to stop driver on.
@param NumberOfChildren Number of Children in the ChildHandleBuffer.
@param ChildHandleBuffer List of handles for the children we need to stop.
@return EFI_SUCCESS Success.
@return EFI_DEVICE_ERROR Fail.
**/
)
{
//
// Test whether the Controller handler passed in is a valid
// Usb controller handle that should be supported, if not,
// return the error status directly
//
);
return Status;
}
//
// Stop AsyncRequest Polling timer then stop the EHCI driver
// and uninstall the EHCI protocl.
//
);
return Status;
}
}
}
EhcFreeSched (Ehc);
}
//
// Disable routing of all ports to EHCI controller, so all ports are
// routed back to the UHCI controller.
//
//
// Restore original PCI attributes
//
PciIo->Attributes (
);
gBS->CloseProtocol (
);
return EFI_SUCCESS;
}