/*++\r
\r
-Copyright (c) 2006, Intel Corporation \r
-All rights reserved. This program and the accompanying materials \r
-are licensed and made available under the terms and conditions of the BSD License \r
-which accompanies this distribution. The full text of the license may be found at \r
-http://opensource.org/licenses/bsd-license.php \r
- \r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
+Copyright (c) 2006, Intel Corporation\r
+All rights reserved. This program and the accompanying materials\r
+are licensed and made available under the terms and conditions of the BSD License\r
+which accompanies this distribution. The full text of the license may be found at\r
+http://opensource.org/licenses/bsd-license.php\r
+\r
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
\r
Module Name:\r
\r
Uhci.c\r
- \r
-Abstract: \r
- \r
+\r
+Abstract:\r
+\r
\r
Revision History\r
--*/\r
\r
#include "uhci.h"\r
\r
-//\r
-// Prototypes\r
-// Driver model protocol interface\r
-//\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UHCIDriverBindingSupported (\r
- IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
- IN EFI_HANDLE Controller,\r
- IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath\r
- );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UHCIDriverBindingStart (\r
- IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
- IN EFI_HANDLE Controller,\r
- IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath\r
- );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UHCIDriverBindingStop (\r
- IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
- IN EFI_HANDLE Controller,\r
- IN UINTN NumberOfChildren,\r
- IN EFI_HANDLE *ChildHandleBuffer\r
- );\r
-\r
-//\r
-// UHCI interface functions\r
-//\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UHCIReset (\r
- IN EFI_USB_HC_PROTOCOL *This,\r
- IN UINT16 Attributes\r
- );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UHCIGetState (\r
- IN EFI_USB_HC_PROTOCOL *This,\r
- OUT EFI_USB_HC_STATE *State\r
- );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UHCISetState (\r
- IN EFI_USB_HC_PROTOCOL *This,\r
- IN EFI_USB_HC_STATE State\r
- );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UHCIControlTransfer (\r
- IN EFI_USB_HC_PROTOCOL *This,\r
- IN UINT8 DeviceAddress,\r
- IN BOOLEAN IsSlowDevice,\r
- IN UINT8 MaximumPacketLength,\r
- IN EFI_USB_DEVICE_REQUEST *Request,\r
- IN EFI_USB_DATA_DIRECTION TransferDirection,\r
- IN OUT VOID *Data, OPTIONAL\r
- IN OUT UINTN *DataLength, OPTIONAL\r
- IN UINTN TimeOut,\r
- OUT UINT32 *TransferResult\r
- );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UHCIBulkTransfer (\r
- IN EFI_USB_HC_PROTOCOL *This,\r
- IN UINT8 DeviceAddress,\r
- IN UINT8 EndPointAddress,\r
- IN UINT8 MaximumPacketLength,\r
- IN OUT VOID *Data,\r
- IN OUT UINTN *DataLength,\r
- IN OUT UINT8 *DataToggle,\r
- IN UINTN TimeOut,\r
- OUT UINT32 *TransferResult\r
- );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UHCIAsyncInterruptTransfer (\r
- IN EFI_USB_HC_PROTOCOL * This,\r
- IN UINT8 DeviceAddress,\r
- IN UINT8 EndPointAddress,\r
- IN BOOLEAN IsSlowDevice,\r
- IN UINT8 MaximumPacketLength,\r
- IN BOOLEAN IsNewTransfer,\r
- IN OUT UINT8 *DataToggle,\r
- IN UINTN PollingInterval, OPTIONAL\r
- IN UINTN DataLength, OPTIONAL\r
- IN EFI_ASYNC_USB_TRANSFER_CALLBACK CallBackFunction, OPTIONAL\r
- IN VOID *Context OPTIONAL\r
- );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UHCISyncInterruptTransfer (\r
- IN EFI_USB_HC_PROTOCOL *This,\r
- IN UINT8 DeviceAddress,\r
- IN UINT8 EndPointAddress,\r
- IN BOOLEAN IsSlowDevice,\r
- IN UINT8 MaximumPacketLength,\r
- IN OUT VOID *Data,\r
- IN OUT UINTN *DataLength,\r
- IN OUT UINT8 *DataToggle,\r
- IN UINTN TimeOut,\r
- OUT UINT32 *TransferResult\r
- );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UHCIIsochronousTransfer (\r
- IN EFI_USB_HC_PROTOCOL *This,\r
- IN UINT8 DeviceAddress,\r
- IN UINT8 EndPointAddress,\r
- IN UINT8 MaximumPacketLength,\r
- IN OUT VOID *Data,\r
- IN UINTN DataLength,\r
- OUT UINT32 *TransferResult\r
- );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UHCIAsyncIsochronousTransfer (\r
- IN EFI_USB_HC_PROTOCOL * This,\r
- IN UINT8 DeviceAddress,\r
- IN UINT8 EndPointAddress,\r
- IN UINT8 MaximumPacketLength,\r
- IN OUT VOID *Data,\r
- IN UINTN DataLength,\r
- IN EFI_ASYNC_USB_TRANSFER_CALLBACK IsochronousCallBack,\r
- IN VOID *Context OPTIONAL\r
- );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UHCIGetRootHubPortNumber (\r
- IN EFI_USB_HC_PROTOCOL *This,\r
- OUT UINT8 *PortNumber\r
- );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UHCIGetRootHubPortStatus (\r
- IN EFI_USB_HC_PROTOCOL *This,\r
- IN UINT8 PortNumber,\r
- OUT EFI_USB_PORT_STATUS *PortStatus\r
- );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UHCISetRootHubPortFeature (\r
- IN EFI_USB_HC_PROTOCOL *This,\r
- IN UINT8 PortNumber,\r
- IN EFI_USB_PORT_FEATURE PortFeature\r
- );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UHCIClearRootHubPortFeature (\r
- IN EFI_USB_HC_PROTOCOL *This,\r
- IN UINT8 PortNumber,\r
- IN EFI_USB_PORT_FEATURE PortFeature\r
- );\r
-\r
-//\r
-// UEFI 2.0 Protocol\r
-//\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UHCI2GetCapability(\r
- IN EFI_USB2_HC_PROTOCOL * This,\r
- OUT UINT8 *MaxSpeed,\r
- OUT UINT8 *PortNumber,\r
- OUT UINT8 *Is64BitCapable\r
- );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UHCI2Reset (\r
- IN EFI_USB2_HC_PROTOCOL * This,\r
- IN UINT16 Attributes\r
- );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UHCI2GetState (\r
- IN EFI_USB2_HC_PROTOCOL * This,\r
- OUT EFI_USB_HC_STATE * State\r
- );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UHCI2SetState (\r
- IN EFI_USB2_HC_PROTOCOL * This,\r
- IN EFI_USB_HC_STATE State\r
- );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UHCI2ControlTransfer (\r
- IN EFI_USB2_HC_PROTOCOL * This,\r
- IN UINT8 DeviceAddress,\r
- IN UINT8 DeviceSpeed,\r
- IN UINTN MaximumPacketLength,\r
- IN EFI_USB_DEVICE_REQUEST * Request,\r
- IN EFI_USB_DATA_DIRECTION TransferDirection,\r
- IN OUT VOID *Data, OPTIONAL\r
- IN OUT UINTN *DataLength, OPTIONAL\r
- IN UINTN TimeOut,\r
- IN EFI_USB2_HC_TRANSACTION_TRANSLATOR *Translator,\r
- OUT UINT32 *TransferResult\r
- );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UHCI2BulkTransfer (\r
- IN EFI_USB2_HC_PROTOCOL * This,\r
- IN UINT8 DeviceAddress,\r
- IN UINT8 EndPointAddress,\r
- IN UINT8 DeviceSpeed,\r
- IN UINTN MaximumPacketLength,\r
- IN UINT8 DataBuffersNumber,\r
- IN OUT VOID *Data[EFI_USB_MAX_BULK_BUFFER_NUM],\r
- IN OUT UINTN *DataLength,\r
- IN OUT UINT8 *DataToggle,\r
- IN UINTN TimeOut,\r
- IN EFI_USB2_HC_TRANSACTION_TRANSLATOR *Translator,\r
- OUT UINT32 *TransferResult\r
- );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UHCI2AsyncInterruptTransfer (\r
- IN EFI_USB2_HC_PROTOCOL * This,\r
- IN UINT8 DeviceAddress,\r
- IN UINT8 EndPointAddress,\r
- IN UINT8 DeviceSpeed,\r
- IN UINTN MaximumPacketLength,\r
- IN BOOLEAN IsNewTransfer,\r
- IN OUT UINT8 *DataToggle,\r
- IN UINTN PollingInterval, OPTIONAL\r
- IN UINTN DataLength, OPTIONAL\r
- IN EFI_USB2_HC_TRANSACTION_TRANSLATOR *Translator,\r
- IN EFI_ASYNC_USB_TRANSFER_CALLBACK CallBackFunction, OPTIONAL\r
- IN VOID *Context OPTIONAL\r
- );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UHCI2SyncInterruptTransfer (\r
- IN EFI_USB2_HC_PROTOCOL * This,\r
- IN UINT8 DeviceAddress,\r
- IN UINT8 EndPointAddress,\r
- IN UINT8 DeviceSpeed,\r
- IN UINTN MaximumPacketLength,\r
- IN OUT VOID *Data,\r
- IN OUT UINTN *DataLength,\r
- IN OUT UINT8 *DataToggle,\r
- IN UINTN TimeOut,\r
- IN EFI_USB2_HC_TRANSACTION_TRANSLATOR *Translator,\r
- OUT UINT32 *TransferResult\r
- );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UHCI2IsochronousTransfer (\r
- IN EFI_USB2_HC_PROTOCOL * This,\r
- IN UINT8 DeviceAddress,\r
- IN UINT8 EndPointAddress,\r
- IN UINT8 DeviceSpeed,\r
- IN UINTN MaximumPacketLength,\r
- IN UINT8 DataBuffersNumber,\r
- IN OUT VOID *Data[EFI_USB_MAX_ISO_BUFFER_NUM],\r
- IN UINTN DataLength,\r
- IN EFI_USB2_HC_TRANSACTION_TRANSLATOR *Translator,\r
- OUT UINT32 *TransferResult\r
- );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UHCI2AsyncIsochronousTransfer (\r
- IN EFI_USB2_HC_PROTOCOL * This,\r
- IN UINT8 DeviceAddress,\r
- IN UINT8 EndPointAddress,\r
- IN UINT8 DeviceSpeed,\r
- IN UINTN MaximumPacketLength,\r
- IN UINT8 DataBuffersNumber,\r
- IN OUT VOID *Data[EFI_USB_MAX_ISO_BUFFER_NUM],\r
- IN UINTN DataLength,\r
- IN EFI_USB2_HC_TRANSACTION_TRANSLATOR *Translator,\r
- IN EFI_ASYNC_USB_TRANSFER_CALLBACK IsochronousCallBack,\r
- IN VOID *Context OPTIONAL\r
- );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UHCI2GetRootHubPortStatus (\r
- IN EFI_USB2_HC_PROTOCOL * This,\r
- IN UINT8 PortNumber,\r
- OUT EFI_USB_PORT_STATUS * PortStatus\r
- );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UHCI2SetRootHubPortFeature (\r
- IN EFI_USB2_HC_PROTOCOL * This,\r
- IN UINT8 PortNumber,\r
- IN EFI_USB_PORT_FEATURE PortFeature\r
- );\r
-\r
-EFI_STATUS\r
-EFIAPI\r
-UHCI2ClearRootHubPortFeature (\r
- IN EFI_USB2_HC_PROTOCOL * This,\r
- IN UINT8 PortNumber,\r
- IN EFI_USB_PORT_FEATURE PortFeature\r
- );\r
-\r
-//\r
-// Asynchronous interrupt transfer monitor function\r
-//\r
-VOID\r
-EFIAPI\r
-MonitorInterruptTrans (\r
- IN EFI_EVENT Event,\r
- IN VOID *Context\r
- );\r
-\r
//\r
// UHCI Driver Global Variables\r
//\r
EFI_OUT_OF_RESOURCES\r
\r
--*/\r
-{ \r
- EFI_STATUS Status; \r
- UINTN FlBaseAddrReg; \r
- EFI_PCI_IO_PROTOCOL *PciIo; \r
+{\r
+ EFI_STATUS Status;\r
+ UINTN FlBaseAddrReg;\r
+ EFI_PCI_IO_PROTOCOL *PciIo;\r
USB_HC_DEV *HcDev;\r
- \r
+ UINT64 Supports;\r
+\r
HcDev = NULL;\r
\r
Status = gBS->OpenProtocol (\r
//\r
Status = PciIo->Attributes (\r
PciIo,\r
- EfiPciIoAttributeOperationEnable,\r
- EFI_PCI_DEVICE_ENABLE,\r
- NULL\r
+ EfiPciIoAttributeOperationSupported,\r
+ 0,\r
+ &Supports\r
);\r
+ if (!EFI_ERROR (Status)) {\r
+ Supports &= EFI_PCI_DEVICE_ENABLE;\r
+ Status = PciIo->Attributes (\r
+ PciIo,\r
+ EfiPciIoAttributeOperationEnable,\r
+ Supports,\r
+ NULL\r
+ );\r
+ }\r
if (EFI_ERROR (Status)) {\r
gBS->CloseProtocol (\r
Controller,\r
HcDev->Usb2Hc.GetRootHubPortStatus = UHCI2GetRootHubPortStatus;\r
HcDev->Usb2Hc.SetRootHubPortFeature = UHCI2SetRootHubPortFeature;\r
HcDev->Usb2Hc.ClearRootHubPortFeature = UHCI2ClearRootHubPortFeature;\r
- \r
+\r
HcDev->Usb2Hc.MajorRevision = 0x1;\r
HcDev->Usb2Hc.MinorRevision = 0x1;\r
- \r
+\r
//\r
// Init UHCI private data structures\r
//\r
// Create timer for interrupt transfer result polling\r
//\r
Status = gBS->CreateEvent (\r
- EFI_EVENT_TIMER | EFI_EVENT_NOTIFY_SIGNAL,\r
- EFI_TPL_NOTIFY,\r
+ EVT_TIMER | EVT_NOTIFY_SIGNAL,\r
+ TPL_NOTIFY,\r
MonitorInterruptTrans,\r
HcDev,\r
&HcDev->InterruptTransTimer\r
);\r
return EFI_UNSUPPORTED;\r
}\r
- \r
+\r
//\r
// QH,TD structures must in common buffer that will be\r
// accessed by both cpu and usb bus master at the same time.\r
//\r
Status = InitializeMemoryManagement (HcDev);\r
if (EFI_ERROR (Status)) {\r
- \r
+\r
gBS->CloseEvent (HcDev->InterruptTransTimer);\r
- \r
+\r
FreeFrameListEntry (HcDev);\r
\r
if (HcDev != NULL) {\r
}\r
\r
gBS->CloseProtocol (\r
- Controller, \r
- &gEfiPciIoProtocolGuid, \r
- This->DriverBindingHandle, \r
+ Controller,\r
+ &gEfiPciIoProtocolGuid,\r
+ This->DriverBindingHandle,\r
Controller\r
);\r
return Status;\r
\r
return Status;\r
}\r
- \r
+\r
//\r
// component name protocol.\r
//\r
--*/\r
{\r
USB_HC_DEV *HcDev;\r
+ EFI_STATUS Status;\r
+ UINT64 Supports;\r
\r
HcDev = USB_HC_DEV_FROM_THIS (This);\r
\r
&gEfiUsbHcProtocolGuid,\r
&HcDev->UsbHc\r
);\r
- \r
+\r
gBS->UninstallProtocolInterface (\r
Controller,\r
&gEfiUsb2HcProtocolGuid,\r
&HcDev->Usb2Hc\r
);\r
- // \r
+ //\r
// first stop USB Host Controller\r
//\r
This->SetState (This, EfiUsbHcStateHalt);\r
//\r
// Disable the USB Host Controller\r
//\r
- HcDev->PciIo->Attributes (\r
- HcDev->PciIo,\r
- EfiPciIoAttributeOperationDisable,\r
- EFI_PCI_DEVICE_ENABLE,\r
- NULL\r
- );\r
+ Status = HcDev->PciIo->Attributes (\r
+ HcDev->PciIo,\r
+ EfiPciIoAttributeOperationSupported,\r
+ 0,\r
+ &Supports\r
+ );\r
+ if (!EFI_ERROR (Status)) {\r
+ Supports &= EFI_PCI_DEVICE_ENABLE;\r
+ Status = HcDev->PciIo->Attributes (\r
+ HcDev->PciIo,\r
+ EfiPciIoAttributeOperationDisable,\r
+ Supports,\r
+ NULL\r
+ );\r
+ }\r
\r
gBS->FreePool (HcDev);\r
\r
IN UINT16 Attributes\r
)\r
/*++\r
- \r
+\r
Routine Description:\r
Provides software reset for the USB host controller.\r
- \r
+\r
Arguments:\r
- \r
- This A pointer to the EFI_USB_HC_PROTOCOL instance. \r
- \r
- Attributes A bit mask of the reset operation to perform. \r
+\r
+ This A pointer to the EFI_USB_HC_PROTOCOL instance.\r
+\r
+ Attributes A bit mask of the reset operation to perform.\r
See below for a list of the supported bit mask values.\r
- \r
+\r
#define EFI_USB_HC_RESET_GLOBAL 0x0001\r
#define EFI_USB_HC_RESET_HOST_CONTROLLER 0x0002\r
\r
- EFI_USB_HC_RESET_GLOBAL \r
+ EFI_USB_HC_RESET_GLOBAL\r
If this bit is set, a global reset signal will be sent to the USB bus.\r
- This resets all of the USB bus logic, including the USB host \r
+ This resets all of the USB bus logic, including the USB host\r
controller hardware and all the devices attached on the USB bus.\r
- EFI_USB_HC_RESET_HOST_CONTROLLER \r
- If this bit is set, the USB host controller hardware will be reset. \r
+ EFI_USB_HC_RESET_HOST_CONTROLLER\r
+ If this bit is set, the USB host controller hardware will be reset.\r
No reset signal will be sent to the USB bus.\r
- \r
+\r
Returns:\r
- EFI_SUCCESS \r
+ EFI_SUCCESS\r
The reset operation succeeded.\r
- EFI_INVALID_PARAMETER \r
+ EFI_INVALID_PARAMETER\r
Attributes is not valid.\r
- EFI_DEVICE_ERROR \r
- An error was encountered while attempting to perform \r
+ EFI_DEVICE_ERROR\r
+ An error was encountered while attempting to perform\r
the reset operation.\r
--*/\r
{\r
if (!Match) {\r
return EFI_INVALID_PARAMETER;\r
}\r
- \r
+\r
//\r
// Delete all old transactions on the USB bus\r
//\r
OUT EFI_USB_HC_STATE *State\r
)\r
/*++\r
- \r
+\r
Routine Description:\r
Retrieves current state of the USB host controller.\r
- \r
+\r
Arguments:\r
- \r
+\r
This A pointer to the EFI_USB_HC_PROTOCOL instance.\r
- \r
- State A pointer to the EFI_USB_HC_STATE data structure that \r
- indicates current state of the USB host controller. \r
+\r
+ State A pointer to the EFI_USB_HC_STATE data structure that\r
+ indicates current state of the USB host controller.\r
Type EFI_USB_HC_STATE is defined below.\r
- \r
+\r
typedef enum {\r
EfiUsbHcStateHalt,\r
EfiUsbHcStateOperational,\r
EfiUsbHcStateSuspend,\r
EfiUsbHcStateMaximum\r
} EFI_USB_HC_STATE;\r
- \r
+\r
Returns:\r
- EFI_SUCCESS \r
+ EFI_SUCCESS\r
The state information of the host controller was returned in State.\r
- EFI_INVALID_PARAMETER \r
+ EFI_INVALID_PARAMETER\r
State is NULL.\r
- EFI_DEVICE_ERROR \r
- An error was encountered while attempting to retrieve the \r
- host controller's current state. \r
+ EFI_DEVICE_ERROR\r
+ An error was encountered while attempting to retrieve the\r
+ host controller's current state.\r
--*/\r
{\r
USB_HC_DEV *HcDev;\r
IN EFI_USB_HC_STATE State\r
)\r
/*++\r
- \r
+\r
Routine Description:\r
Sets the USB host controller to a specific state.\r
- \r
+\r
Arguments:\r
- \r
+\r
This A pointer to the EFI_USB_HC_PROTOCOL instance.\r
\r
State Indicates the state of the host controller that will be set.\r
- \r
+\r
Returns:\r
- EFI_SUCCESS \r
- The USB host controller was successfully placed in the state \r
+ EFI_SUCCESS\r
+ The USB host controller was successfully placed in the state\r
specified by State.\r
- EFI_INVALID_PARAMETER \r
+ EFI_INVALID_PARAMETER\r
State is invalid.\r
- EFI_DEVICE_ERROR \r
- Failed to set the state specified by State due to device error. \r
+ EFI_DEVICE_ERROR\r
+ Failed to set the state specified by State due to device error.\r
--*/\r
{\r
USB_HC_DEV *HcDev;\r
if (EFI_ERROR (Status)) {\r
return EFI_DEVICE_ERROR;\r
}\r
- \r
+\r
//\r
// FGR(Force Global Resume) bit is 0\r
//\r
Command\r
);\r
}\r
- \r
+\r
//\r
// wait 20ms to let resume complete\r
// (20ms is specified by UHCI spec)\r
OUT UINT8 *PortNumber\r
)\r
/*++\r
- \r
+\r
Routine Description:\r
Retrieves the number of root hub ports.\r
- \r
+\r
Arguments:\r
- \r
+\r
This A pointer to the EFI_USB_HC_PROTOCOL instance.\r
- \r
+\r
PortNumber A pointer to the number of the root hub ports.\r
- \r
+\r
Returns:\r
- EFI_SUCCESS \r
+ EFI_SUCCESS\r
The port number was retrieved successfully.\r
- EFI_INVALID_PARAMETER \r
+ EFI_INVALID_PARAMETER\r
PortNumber is NULL.\r
- EFI_DEVICE_ERROR \r
- An error was encountered while attempting to \r
- retrieve the port number. \r
+ EFI_DEVICE_ERROR\r
+ An error was encountered while attempting to\r
+ retrieve the port number.\r
--*/\r
{\r
USB_HC_DEV *HcDev;\r
OUT EFI_USB_PORT_STATUS *PortStatus\r
)\r
/*++\r
- \r
+\r
Routine Description:\r
Retrieves the current status of a USB root hub port.\r
- \r
+\r
Arguments:\r
- \r
+\r
This A pointer to the EFI_USB_HC_PROTOCOL.\r
- \r
- PortNumber Specifies the root hub port from which the status \r
- is to be retrieved. This value is zero-based. For example, \r
+\r
+ PortNumber Specifies the root hub port from which the status\r
+ is to be retrieved. This value is zero-based. For example,\r
if a root hub has two ports, then the first port is numbered 0,\r
and the second port is numbered 1.\r
- \r
- PortStatus A pointer to the current port status bits and \r
- port status change bits. \r
- \r
+\r
+ PortStatus A pointer to the current port status bits and\r
+ port status change bits.\r
+\r
Returns:\r
- EFI_SUCCESS \r
- The status of the USB root hub port specified by PortNumber \r
+ EFI_SUCCESS\r
+ The status of the USB root hub port specified by PortNumber\r
was returned in PortStatus.\r
- EFI_INVALID_PARAMETER \r
- PortNumber is invalid. \r
- EFI_DEVICE_ERROR - Can't read register \r
+ EFI_INVALID_PARAMETER\r
+ PortNumber is invalid.\r
+ EFI_DEVICE_ERROR - Can't read register\r
--*/\r
{\r
USB_HC_DEV *HcDev;\r
//\r
// Fill Port Status bits\r
//\r
- \r
+\r
//\r
// Current Connect Status\r
//\r
if (RHPortStatus & USBPORTSC_PED) {\r
PortStatus->PortStatus |= USB_PORT_STAT_ENABLE;\r
}\r
- \r
+\r
//\r
// Port Suspend\r
//\r
if (RHPortStatus & USBPORTSC_SUSP) {\r
PortStatus->PortStatus |= USB_PORT_STAT_SUSPEND;\r
}\r
- \r
+\r
//\r
// Port Reset\r
//\r
if (RHPortStatus & USBPORTSC_PR) {\r
PortStatus->PortStatus |= USB_PORT_STAT_RESET;\r
}\r
- \r
+\r
//\r
// Low Speed Device Attached\r
//\r
//\r
// Fill Port Status Change bits\r
//\r
- \r
+\r
//\r
// Connect Status Change\r
//\r
if (RHPortStatus & USBPORTSC_CSC) {\r
PortStatus->PortChangeStatus |= USB_PORT_STAT_C_CONNECTION;\r
}\r
- \r
+\r
//\r
// Port Enabled/Disabled Change\r
//\r
IN EFI_USB_PORT_FEATURE PortFeature\r
)\r
/*++\r
- \r
+\r
Routine Description:\r
Sets a feature for the specified root hub port.\r
- \r
+\r
Arguments:\r
- \r
+\r
This A pointer to the EFI_USB_HC_PROTOCOL.\r
- \r
- PortNumber Specifies the root hub port whose feature \r
+\r
+ PortNumber Specifies the root hub port whose feature\r
is requested to be set.\r
- \r
- PortFeature Indicates the feature selector associated \r
- with the feature set request. \r
- \r
+\r
+ PortFeature Indicates the feature selector associated\r
+ with the feature set request.\r
+\r
Returns:\r
- EFI_SUCCESS \r
- The feature specified by PortFeature was set for the \r
+ EFI_SUCCESS\r
+ The feature specified by PortFeature was set for the\r
USB root hub port specified by PortNumber.\r
- EFI_INVALID_PARAMETER \r
+ EFI_INVALID_PARAMETER\r
PortNumber is invalid or PortFeature is invalid.\r
EFI_DEVICE_ERROR\r
Can't read register\r
IN EFI_USB_PORT_FEATURE PortFeature\r
)\r
/*++\r
- \r
+\r
Routine Description:\r
Clears a feature for the specified root hub port.\r
- \r
+\r
Arguments:\r
- \r
+\r
This A pointer to the EFI_USB_HC_PROTOCOL instance.\r
- \r
- PortNumber Specifies the root hub port whose feature \r
+\r
+ PortNumber Specifies the root hub port whose feature\r
is requested to be cleared.\r
- \r
- PortFeature Indicates the feature selector associated with the \r
+\r
+ PortFeature Indicates the feature selector associated with the\r
feature clear request.\r
- \r
+\r
Returns:\r
- EFI_SUCCESS \r
- The feature specified by PortFeature was cleared for the \r
+ EFI_SUCCESS\r
+ The feature specified by PortFeature was cleared for the\r
USB root hub port specified by PortNumber.\r
- EFI_INVALID_PARAMETER \r
+ EFI_INVALID_PARAMETER\r
PortNumber is invalid or PortFeature is invalid.\r
EFI_DEVICE_ERROR\r
Can't read register\r
OUT UINT32 *TransferResult\r
)\r
/*++\r
- \r
+\r
Routine Description:\r
Submits control transfer to a target USB device.\r
- \r
+\r
Arguments:\r
- \r
+\r
This A pointer to the EFI_USB_HC_PROTOCOL instance.\r
\r
DeviceAddress Represents the address of the target device on the USB,\r
which is assigned during USB enumeration.\r
\r
- IsSlowDevice Indicates whether the target device is slow device \r
+ IsSlowDevice Indicates whether the target device is slow device\r
or full-speed device.\r
- \r
- MaximumPacketLength Indicates the maximum packet size that the \r
- default control transfer endpoint is capable of \r
+\r
+ MaximumPacketLength Indicates the maximum packet size that the\r
+ default control transfer endpoint is capable of\r
sending or receiving.\r
- \r
- Request A pointer to the USB device request that will be sent \r
- to the USB device. \r
- \r
+\r
+ Request A pointer to the USB device request that will be sent\r
+ to the USB device.\r
+\r
TransferDirection Specifies the data direction for the transfer.\r
- There are three values available, DataIn, DataOut \r
+ There are three values available, DataIn, DataOut\r
and NoData.\r
- \r
- Data A pointer to the buffer of data that will be transmitted \r
+\r
+ Data A pointer to the buffer of data that will be transmitted\r
to USB device or received from USB device.\r
- \r
- DataLength Indicates the size, in bytes, of the data buffer \r
+\r
+ DataLength Indicates the size, in bytes, of the data buffer\r
specified by Data.\r
- \r
- TimeOut Indicates the maximum time, in microseconds, \r
+\r
+ TimeOut Indicates the maximum time, in microseconds,\r
which the transfer is allowed to complete.\r
- \r
- TransferResult A pointer to the detailed result information generated \r
+\r
+ TransferResult A pointer to the detailed result information generated\r
by this control transfer.\r
- \r
+\r
Returns:\r
- EFI_SUCCESS \r
+ EFI_SUCCESS\r
The control transfer was completed successfully.\r
- EFI_OUT_OF_RESOURCES \r
+ EFI_OUT_OF_RESOURCES\r
The control transfer could not be completed due to a lack of resources.\r
- EFI_INVALID_PARAMETER \r
+ EFI_INVALID_PARAMETER\r
Some parameters are invalid.\r
- EFI_TIMEOUT \r
+ EFI_TIMEOUT\r
The control transfer failed due to timeout.\r
- EFI_DEVICE_ERROR \r
- The control transfer failed due to host controller or device error. \r
+ EFI_DEVICE_ERROR\r
+ The control transfer failed due to host controller or device error.\r
Caller should check TranferResult for detailed error information.\r
\r
--*/\r
if (Request == NULL || TransferResult == NULL) {\r
return EFI_INVALID_PARAMETER;\r
}\r
- \r
+\r
//\r
// if errors exist that cause host controller halt,\r
// then return EFI_DEVICE_ERROR.\r
*TransferResult = EFI_USB_ERR_SYSTEM;\r
return EFI_DEVICE_ERROR;\r
}\r
- \r
+\r
//\r
// low speed usb devices are limited to only an eight-byte\r
// maximum data payload size\r
return EFI_INVALID_PARAMETER;\r
}\r
\r
- if (MaximumPacketLength != 8 && \r
+ if (MaximumPacketLength != 8 &&\r
MaximumPacketLength != 16 &&\r
MaximumPacketLength != 32 &&\r
MaximumPacketLength != 64) {\r
HcDev->PciIo->Unmap (HcDev->PciIo, Mapping);\r
return Status;\r
}\r
- \r
+\r
//\r
// map the Request for bus master access.\r
// BusMasterRead means cpu write\r
HcDev->PciIo->Unmap (HcDev->PciIo, RequestMapping);\r
return Status;\r
}\r
- \r
+\r
//\r
// Data Stage of Control Transfer\r
//\r
//\r
// create TD structures and link together\r
//\r
- \r
+\r
//\r
// PktSize is the data load size that each TD carries.\r
//\r
DeleteQueuedTDs (HcDev, PtrFirstDataTD);\r
return Status;\r
}\r
- \r
+\r
//\r
// Link two TDs in vertical depth\r
//\r
} else {\r
PktID = OUTPUT_PACKET_ID;\r
}\r
- \r
+\r
//\r
// create Status Stage TD structure\r
//\r
OUT UINT32 *TransferResult\r
)\r
/*++\r
- \r
+\r
Routine Description:\r
Submits bulk transfer to a bulk endpoint of a USB device.\r
- \r
+\r
Arguments:\r
- \r
+\r
This A pointer to the EFI_USB_HC_PROTOCOL instance.\r
- \r
+\r
DeviceAddress Represents the address of the target device on the USB,\r
which is assigned during USB enumeration.\r
- EndPointAddress The combination of an endpoint number and an \r
- endpoint direction of the target USB device. \r
- Each endpoint address supports data transfer in \r
- one direction except the control endpoint \r
- (whose default endpoint address is 0). \r
- It is the caller's responsibility to make sure that \r
- the EndPointAddress represents a bulk endpoint. \r
- \r
+ EndPointAddress The combination of an endpoint number and an\r
+ endpoint direction of the target USB device.\r
+ Each endpoint address supports data transfer in\r
+ one direction except the control endpoint\r
+ (whose default endpoint address is 0).\r
+ It is the caller's responsibility to make sure that\r
+ the EndPointAddress represents a bulk endpoint.\r
+\r
MaximumPacketLength Indicates the maximum packet size the target endpoint\r
is capable of sending or receiving.\r
- \r
- Data A pointer to the buffer of data that will be transmitted \r
+\r
+ Data A pointer to the buffer of data that will be transmitted\r
to USB device or received from USB device.\r
DataLength When input, indicates the size, in bytes, of the data buffer\r
- specified by Data. When output, indicates the actually \r
+ specified by Data. When output, indicates the actually\r
transferred data size.\r
- \r
- DataToggle A pointer to the data toggle value. On input, it indicates \r
+\r
+ DataToggle A pointer to the data toggle value. On input, it indicates\r
the initial data toggle value the bulk transfer should adopt;\r
- on output, it is updated to indicate the data toggle value \r
- of the subsequent bulk transfer. \r
- \r
- TimeOut Indicates the maximum time, in microseconds, which the \r
+ on output, it is updated to indicate the data toggle value\r
+ of the subsequent bulk transfer.\r
+\r
+ TimeOut Indicates the maximum time, in microseconds, which the\r
transfer is allowed to complete.\r
- \r
- TransferResult A pointer to the detailed result information of the \r
+\r
+ TransferResult A pointer to the detailed result information of the\r
bulk transfer.\r
\r
Returns:\r
- EFI_SUCCESS \r
+ EFI_SUCCESS\r
The bulk transfer was completed successfully.\r
- EFI_OUT_OF_RESOURCES \r
+ EFI_OUT_OF_RESOURCES\r
The bulk transfer could not be submitted due to lack of resource.\r
- EFI_INVALID_PARAMETER \r
+ EFI_INVALID_PARAMETER\r
Some parameters are invalid.\r
- EFI_TIMEOUT \r
+ EFI_TIMEOUT\r
The bulk transfer failed due to timeout.\r
- EFI_DEVICE_ERROR \r
+ EFI_DEVICE_ERROR\r
The bulk transfer failed due to host controller or device error.\r
Caller should check TranferResult for detailed error information.\r
\r
//\r
// Parameters Checking\r
//\r
- \r
+\r
if ((DataLength == NULL) ||\r
(Data == NULL) ||\r
(TransferResult == NULL)) {\r
return EFI_INVALID_PARAMETER;\r
}\r
- \r
+\r
//\r
// if has errors that cause host controller halt,\r
// then return EFI_DEVICE_ERROR directly.\r
MaximumPacketLength != 64) {\r
return EFI_INVALID_PARAMETER;\r
}\r
- \r
+\r
//\r
// Enable the maximum packet size (64bytes)\r
// that can be used for full speed bandwidth reclamation\r
if (EFI_ERROR (Status)) {\r
return EFI_DEVICE_ERROR;\r
}\r
- \r
+\r
//\r
// construct QH and TD data structures,\r
// and link them together\r
default:\r
return EFI_INVALID_PARAMETER;\r
}\r
- \r
+\r
//\r
// create QH structure and init\r
//\r
HcDev->PciIo->Unmap (HcDev->PciIo, Mapping);\r
return Status;\r
}\r
- \r
+\r
//\r
// i is used to calculate the total number of TDs.\r
//\r
\r
IsFirstTD = TRUE;\r
while (DataLen > 0) {\r
- \r
+\r
//\r
// create TD structures and link together\r
//\r
- \r
+\r
PktSize = (UINT8) DataLen;\r
if (DataLen > MaximumPacketLength) {\r
PktSize = MaximumPacketLength;\r
DeleteQueuedTDs (HcDev, PtrFirstTD);\r
return Status;\r
}\r
- \r
+\r
//\r
// Enable short packet detection.\r
// (default action is disabling short packet detection)\r
Ptr += PktSize;\r
DataLen -= PktSize;\r
}\r
- \r
+\r
//\r
// link TD structures to QH structure\r
//\r
SavedFrameListIndex = LoadFrameListIndex;\r
\r
for (Index = 0; Index <= LinkTimes; Index++) {\r
- \r
+\r
//\r
// put the QH-TD directly or indirectly into the proper place\r
// in the Frame List\r
if (Mapping != NULL) {\r
HcDev->PciIo->Unmap (HcDev->PciIo, Mapping);\r
}\r
- \r
+\r
//\r
// if has errors that cause host controller halt,\r
// then return EFI_DEVICE_ERROR directly.\r
IN VOID *Context OPTIONAL\r
)\r
/*++\r
- \r
+\r
Routine Description:\r
- Submits an asynchronous interrupt transfer to an \r
+ Submits an asynchronous interrupt transfer to an\r
interrupt endpoint of a USB device.\r
- \r
+\r
Arguments:\r
- \r
+\r
This A pointer to the EFI_USB_HC_PROTOCOL instance.\r
- \r
+\r
DeviceAddress Represents the address of the target device on the USB,\r
which is assigned during USB enumeration.\r
- \r
- EndPointAddress The combination of an endpoint number and an endpoint \r
- direction of the target USB device. Each endpoint address \r
- supports data transfer in one direction except the \r
- control endpoint (whose default endpoint address is 0). \r
- It is the caller's responsibility to make sure that \r
+\r
+ EndPointAddress The combination of an endpoint number and an endpoint\r
+ direction of the target USB device. Each endpoint address\r
+ supports data transfer in one direction except the\r
+ control endpoint (whose default endpoint address is 0).\r
+ It is the caller's responsibility to make sure that\r
the EndPointAddress represents an interrupt endpoint.\r
- \r
- IsSlowDevice Indicates whether the target device is slow device \r
+\r
+ IsSlowDevice Indicates whether the target device is slow device\r
or full-speed device.\r
- \r
+\r
MaximumPacketLength Indicates the maximum packet size the target endpoint\r
is capable of sending or receiving.\r
- \r
+\r
IsNewTransfer If TRUE, an asynchronous interrupt pipe is built between\r
- the host and the target interrupt endpoint. \r
- If FALSE, the specified asynchronous interrupt pipe \r
+ the host and the target interrupt endpoint.\r
+ If FALSE, the specified asynchronous interrupt pipe\r
is canceled.\r
- \r
- DataToggle A pointer to the data toggle value. On input, it is valid \r
- when IsNewTransfer is TRUE, and it indicates the initial \r
- data toggle value the asynchronous interrupt transfer \r
- should adopt. \r
- On output, it is valid when IsNewTransfer is FALSE, \r
- and it is updated to indicate the data toggle value of \r
+\r
+ DataToggle A pointer to the data toggle value. On input, it is valid\r
+ when IsNewTransfer is TRUE, and it indicates the initial\r
+ data toggle value the asynchronous interrupt transfer\r
+ should adopt.\r
+ On output, it is valid when IsNewTransfer is FALSE,\r
+ and it is updated to indicate the data toggle value of\r
the subsequent asynchronous interrupt transfer.\r
- \r
- PollingInterval Indicates the interval, in milliseconds, that the \r
- asynchronous interrupt transfer is polled. \r
+\r
+ PollingInterval Indicates the interval, in milliseconds, that the\r
+ asynchronous interrupt transfer is polled.\r
This parameter is required when IsNewTransfer is TRUE.\r
- \r
- DataLength Indicates the length of data to be received at the \r
- rate specified by PollingInterval from the target \r
- asynchronous interrupt endpoint. This parameter \r
+\r
+ DataLength Indicates the length of data to be received at the\r
+ rate specified by PollingInterval from the target\r
+ asynchronous interrupt endpoint. This parameter\r
is only required when IsNewTransfer is TRUE.\r
- \r
- CallBackFunction The Callback function.This function is called at the \r
- rate specified by PollingInterval.This parameter is \r
+\r
+ CallBackFunction The Callback function.This function is called at the\r
+ rate specified by PollingInterval.This parameter is\r
only required when IsNewTransfer is TRUE.\r
- \r
+\r
Context The context that is passed to the CallBackFunction.\r
This is an optional parameter and may be NULL.\r
- \r
+\r
Returns:\r
- EFI_SUCCESS \r
- The asynchronous interrupt transfer request has been successfully \r
+ EFI_SUCCESS\r
+ The asynchronous interrupt transfer request has been successfully\r
submitted or canceled.\r
- EFI_INVALID_PARAMETER \r
+ EFI_INVALID_PARAMETER\r
Some parameters are invalid.\r
- EFI_OUT_OF_RESOURCES \r
- The request could not be completed due to a lack of resources. \r
+ EFI_OUT_OF_RESOURCES\r
+ The request could not be completed due to a lack of resources.\r
EFI_DEVICE_ERROR\r
Can't read register\r
--*/\r
if ((EndPointAddress & 0x80) == 0) {\r
return EFI_INVALID_PARAMETER;\r
}\r
- \r
+\r
//\r
// delete Async interrupt transfer request\r
//\r
if (!IsNewTransfer) {\r
\r
- OldTpl = gBS->RaiseTPL (EFI_TPL_NOTIFY);\r
+ OldTpl = gBS->RaiseTPL (TPL_NOTIFY);\r
\r
Status = DeleteAsyncINTQHTDs (\r
HcDev,\r
//\r
// create TD structures and link together\r
//\r
- \r
+\r
PktSize = (UINT8) DataLen;\r
if (DataLen > MaximumPacketLength) {\r
PktSize = MaximumPacketLength;\r
MappedPtr += PktSize;\r
DataLen -= PktSize;\r
}\r
- \r
+\r
//\r
// roll one value back\r
//\r
\r
return Status;\r
}\r
- \r
+\r
//\r
// link TD structures to QH structure\r
//\r
PtrQH = ptrFirstQH;\r
\r
for (Index = LoadFrameListIndex; Index < (1024 + LoadFrameListIndex);) {\r
- \r
+\r
//\r
// put the QH-TD directly or indirectly into the proper place\r
// in the Frame List\r
OUT UINT32 *TransferResult\r
)\r
/*++\r
- \r
+\r
Routine Description:\r
- Submits synchronous interrupt transfer to an interrupt endpoint \r
+ Submits synchronous interrupt transfer to an interrupt endpoint\r
of a USB device.\r
- \r
+\r
Arguments:\r
- \r
+\r
This A pointer to the EFI_USB_HC_PROTOCOL instance.\r
- \r
- DeviceAddress Represents the address of the target device on the USB, \r
+\r
+ DeviceAddress Represents the address of the target device on the USB,\r
which is assigned during USB enumeration.\r
- \r
- EndPointAddress The combination of an endpoint number and an endpoint \r
- direction of the target USB device. Each endpoint \r
- address supports data transfer in one direction \r
- except the control endpoint (whose default \r
+\r
+ EndPointAddress The combination of an endpoint number and an endpoint\r
+ direction of the target USB device. Each endpoint\r
+ address supports data transfer in one direction\r
+ except the control endpoint (whose default\r
endpoint address is 0). It is the caller's responsibility\r
- to make sure that the EndPointAddress represents \r
- an interrupt endpoint. \r
- \r
- IsSlowDevice Indicates whether the target device is slow device \r
+ to make sure that the EndPointAddress represents\r
+ an interrupt endpoint.\r
+\r
+ IsSlowDevice Indicates whether the target device is slow device\r
or full-speed device.\r
- \r
- MaximumPacketLength Indicates the maximum packet size the target endpoint \r
+\r
+ MaximumPacketLength Indicates the maximum packet size the target endpoint\r
is capable of sending or receiving.\r
- \r
- Data A pointer to the buffer of data that will be transmitted \r
+\r
+ Data A pointer to the buffer of data that will be transmitted\r
to USB device or received from USB device.\r
- \r
- DataLength On input, the size, in bytes, of the data buffer specified \r
+\r
+ DataLength On input, the size, in bytes, of the data buffer specified\r
by Data. On output, the number of bytes transferred.\r
- \r
+\r
DataToggle A pointer to the data toggle value. On input, it indicates\r
- the initial data toggle value the synchronous interrupt \r
- transfer should adopt; \r
- on output, it is updated to indicate the data toggle value \r
- of the subsequent synchronous interrupt transfer. \r
- \r
- TimeOut Indicates the maximum time, in microseconds, which the \r
+ the initial data toggle value the synchronous interrupt\r
+ transfer should adopt;\r
+ on output, it is updated to indicate the data toggle value\r
+ of the subsequent synchronous interrupt transfer.\r
+\r
+ TimeOut Indicates the maximum time, in microseconds, which the\r
transfer is allowed to complete.\r
- \r
- TransferResult A pointer to the detailed result information from \r
- the synchronous interrupt transfer. \r
+\r
+ TransferResult A pointer to the detailed result information from\r
+ the synchronous interrupt transfer.\r
\r
Returns:\r
- EFI_SUCCESS \r
+ EFI_SUCCESS\r
The synchronous interrupt transfer was completed successfully.\r
- EFI_OUT_OF_RESOURCES \r
- The synchronous interrupt transfer could not be submitted due \r
+ EFI_OUT_OF_RESOURCES\r
+ The synchronous interrupt transfer could not be submitted due\r
to lack of resource.\r
- EFI_INVALID_PARAMETER \r
+ EFI_INVALID_PARAMETER\r
Some parameters are invalid.\r
- EFI_TIMEOUT \r
+ EFI_TIMEOUT\r
The synchronous interrupt transfer failed due to timeout.\r
- EFI_DEVICE_ERROR \r
- The synchronous interrupt transfer failed due to host controller \r
- or device error. Caller should check TranferResult for detailed \r
- error information. \r
+ EFI_DEVICE_ERROR\r
+ The synchronous interrupt transfer failed due to host controller\r
+ or device error. Caller should check TranferResult for detailed\r
+ error information.\r
--*/\r
{\r
USB_HC_DEV *HcDev;\r
//\r
// Parameters Checking\r
//\r
- \r
+\r
if ((DataLength == NULL) ||\r
(Data == NULL) ||\r
(TransferResult == NULL)) {\r
return EFI_INVALID_PARAMETER;\r
}\r
- \r
+\r
//\r
// if has errors that cause host controller halt,\r
// then return EFI_DEVICE_ERROR directly.\r
if (EFI_ERROR (Status)) {\r
return Status;\r
}\r
- \r
+\r
//\r
// BusMasterWrite means cpu read\r
//\r
Ptr += PktSize;\r
DataLen -= PktSize;\r
}\r
- \r
+\r
//\r
// link TD structures to QH structure\r
//\r
SavedFrameListIndex = LoadFrameListIndex;\r
\r
for (Index = 0; Index < LinkTimes; Index++) {\r
- \r
+\r
//\r
// put the QH-TD directly or indirectly into the proper place\r
// in the Frame List\r
OUT UINT32 *TransferResult\r
)\r
/*++\r
- \r
+\r
Routine Description:\r
Submits isochronous transfer to a target USB device.\r
- \r
+\r
Arguments:\r
- \r
+\r
This - A pointer to the EFI_USB_HC_PROTOCOL instance.\r
DeviceAddress - Represents the address of the target device on the USB,\r
which is assigned during USB enumeration.\r
EndPointAddress - End point address\r
- MaximumPacketLength - Indicates the maximum packet size that the \r
- default control transfer endpoint is capable of \r
+ MaximumPacketLength - Indicates the maximum packet size that the\r
+ default control transfer endpoint is capable of\r
sending or receiving.\r
- Data - A pointer to the buffer of data that will be transmitted \r
+ Data - A pointer to the buffer of data that will be transmitted\r
to USB device or received from USB device.\r
- DataLength - Indicates the size, in bytes, of the data buffer \r
+ DataLength - Indicates the size, in bytes, of the data buffer\r
specified by Data.\r
- TransferResult - A pointer to the detailed result information generated \r
- by this control transfer. \r
+ TransferResult - A pointer to the detailed result information generated\r
+ by this control transfer.\r
Returns:\r
- EFI_UNSUPPORTED \r
+ EFI_UNSUPPORTED\r
\r
--*/\r
{\r
IN VOID *Context OPTIONAL\r
)\r
/*++\r
- \r
+\r
Routine Description:\r
Submits Async isochronous transfer to a target USB device.\r
- \r
+\r
Arguments:\r
- \r
+\r
This - A pointer to the EFI_USB_HC_PROTOCOL instance.\r
- \r
+\r
DeviceAddress - Represents the address of the target device on the USB,\r
which is assigned during USB enumeration.\r
\r
EndPointAddress - End point address\r
- \r
- MaximumPacketLength - Indicates the maximum packet size that the \r
- default control transfer endpoint is capable of \r
+\r
+ MaximumPacketLength - Indicates the maximum packet size that the\r
+ default control transfer endpoint is capable of\r
sending or receiving.\r
- \r
- Data - A pointer to the buffer of data that will be transmitted \r
+\r
+ Data - A pointer to the buffer of data that will be transmitted\r
to USB device or received from USB device.\r
- \r
+\r
IsochronousCallBack - When the transfer complete, the call back function will be called\r
- \r
+\r
Context - Pass to the call back function as parameter\r
- \r
+\r
Returns:\r
- EFI_UNSUPPORTED \r
+ EFI_UNSUPPORTED\r
\r
--*/\r
{\r
\r
Arguments:\r
This - A pointer to the EFI_USB2_HC_PROTOCOL instance.\r
- \r
+\r
MaxSpeed - A pointer to the max speed USB host controller supports.\r
- \r
+\r
PortNumber - A pointer to the number of root hub ports.\r
- \r
+\r
Is64BitCapable - A pointer to an integer to show whether USB host controller\r
supports 64-bit memory addressing.\r
Returns:\r
- EFI_SUCCESS \r
+ EFI_SUCCESS\r
The host controller capabilities were retrieved successfully.\r
- EFI_INVALID_PARAMETER \r
+ EFI_INVALID_PARAMETER\r
MaxSpeed or PortNumber or Is64BitCapable is NULL.\r
- EFI_DEVICE_ERROR \r
+ EFI_DEVICE_ERROR\r
An error was encountered while attempting to retrieve the capabilities.\r
- \r
---*/ \r
+\r
+--*/\r
{\r
USB_HC_DEV *HcDev;\r
\r
HcDev = USB2_HC_DEV_FROM_THIS (This);\r
- \r
- if ((NULL == MaxSpeed) \r
+\r
+ if ((NULL == MaxSpeed)\r
||(NULL == PortNumber)\r
|| (NULL == Is64BitCapable))\r
{\r
return EFI_INVALID_PARAMETER;\r
}\r
- \r
+\r
*MaxSpeed = EFI_USB_SPEED_FULL;\r
*Is64BitCapable = (UINT8)FALSE;\r
return UHCIGetRootHubPortNumber(&HcDev->UsbHc, PortNumber);\r
\r
Arguments:\r
This - A pointer to the EFI_USB2_HC_PROTOCOL instance.\r
- \r
- Attributes - A bit mask of the reset operation to perform. \r
+\r
+ Attributes - A bit mask of the reset operation to perform.\r
See below for a list of the supported bit mask values.\r
- \r
+\r
#define EFI_USB_HC_RESET_GLOBAL 0x0001\r
#define EFI_USB_HC_RESET_HOST_CONTROLLER 0x0002\r
#define EFI_USB_HC_RESET_GLOBAL _WITH_DEBUG 0x0004\r
#define EFI_USB_HC_RESET_HOST_WITH_DEBUG 0x0008\r
\r
- EFI_USB_HC_RESET_GLOBAL \r
+ EFI_USB_HC_RESET_GLOBAL\r
If this bit is set, a global reset signal will be sent to the USB bus.\r
- This resets all of the USB bus logic, including the USB host \r
+ This resets all of the USB bus logic, including the USB host\r
controller hardware and all the devices attached on the USB bus.\r
- EFI_USB_HC_RESET_HOST_CONTROLLER \r
- If this bit is set, the USB host controller hardware will be reset. \r
+ EFI_USB_HC_RESET_HOST_CONTROLLER\r
+ If this bit is set, the USB host controller hardware will be reset.\r
No reset signal will be sent to the USB bus.\r
- \r
+\r
Returns:\r
- EFI_SUCCESS \r
+ EFI_SUCCESS\r
The reset operation succeeded.\r
- EFI_INVALID_PARAMETER \r
+ EFI_INVALID_PARAMETER\r
Attributes is not valid.\r
EFI_UNSUPPORTED\r
The type of reset specified by Attributes is not currently supported by the host controller hardware.\r
EFI_ACCESS_DENIED\r
Reset operation is rejected due to the debug port being configured and active.\r
- EFI_DEVICE_ERROR \r
- An error was encountered while attempting to perform \r
+ EFI_DEVICE_ERROR\r
+ An error was encountered while attempting to perform\r
the reset operation.\r
--*/\r
{\r
USB_HC_DEV *HcDev;\r
\r
HcDev = USB2_HC_DEV_FROM_THIS (This);\r
- \r
+\r
if (Attributes==EFI_USB_HC_RESET_GLOBAL_WITH_DEBUG || Attributes==EFI_USB_HC_RESET_HOST_WITH_DEBUG)\r
return EFI_UNSUPPORTED;\r
- \r
+\r
return UHCIReset(\r
- &HcDev->UsbHc, \r
+ &HcDev->UsbHc,\r
Attributes\r
);\r
}\r
OUT EFI_USB_HC_STATE * State\r
)\r
/*++\r
- \r
+\r
Routine Description:\r
Retrieves current state of the USB host controller according to UEFI 2.0 spec.\r
- \r
+\r
Arguments:\r
- \r
+\r
This - A pointer to the EFI_USB_HC_PROTOCOL instance.\r
- \r
- State - A pointer to the EFI_USB_HC_STATE data structure that \r
- indicates current state of the USB host controller. \r
+\r
+ State - A pointer to the EFI_USB_HC_STATE data structure that\r
+ indicates current state of the USB host controller.\r
Type EFI_USB_HC_STATE is defined below.\r
- \r
+\r
typedef enum {\r
EfiUsbHcStateHalt,\r
EfiUsbHcStateOperational,\r
EfiUsbHcStateSuspend,\r
EfiUsbHcStateMaximum\r
} EFI_USB_HC_STATE;\r
- \r
+\r
Returns:\r
- EFI_SUCCESS \r
+ EFI_SUCCESS\r
The state information of the host controller was returned in State.\r
- EFI_INVALID_PARAMETER \r
+ EFI_INVALID_PARAMETER\r
State is NULL.\r
- EFI_DEVICE_ERROR \r
- An error was encountered while attempting to retrieve the \r
- host controller's current state. \r
---*/ \r
+ EFI_DEVICE_ERROR\r
+ An error was encountered while attempting to retrieve the\r
+ host controller's current state.\r
+--*/\r
{\r
USB_HC_DEV *HcDev;\r
\r
HcDev = USB2_HC_DEV_FROM_THIS (This);\r
return UHCIGetState(\r
- &HcDev->UsbHc, \r
+ &HcDev->UsbHc,\r
State\r
);\r
}\r
IN EFI_USB_HC_STATE State\r
)\r
/*++\r
- \r
+\r
Routine Description:\r
Sets the USB host controller to a specific state according to UEFI 2.0 spec.\r
- \r
+\r
Arguments:\r
- \r
+\r
This - A pointer to the EFI_USB_HC_PROTOCOL instance.\r
\r
State - Indicates the state of the host controller that will be set.\r
- \r
+\r
Returns:\r
- EFI_SUCCESS \r
- The USB host controller was successfully placed in the state \r
+ EFI_SUCCESS\r
+ The USB host controller was successfully placed in the state\r
specified by State.\r
- EFI_INVALID_PARAMETER \r
+ EFI_INVALID_PARAMETER\r
State is invalid.\r
- EFI_DEVICE_ERROR \r
- Failed to set the state specified by State due to device error. \r
+ EFI_DEVICE_ERROR\r
+ Failed to set the state specified by State due to device error.\r
--*/\r
{\r
USB_HC_DEV *HcDev;\r
\r
HcDev = USB2_HC_DEV_FROM_THIS (This);\r
return UHCISetState(\r
- &HcDev->UsbHc, \r
+ &HcDev->UsbHc,\r
State\r
);\r
}\r
OUT UINT32 *TransferResult\r
)\r
/*++\r
- \r
+\r
Routine Description:\r
Submits control transfer to a target USB device accroding to UEFI 2.0 spec..\r
- \r
+\r
Arguments:\r
- \r
+\r
This - A pointer to the EFI_USB_HC_PROTOCOL instance.\r
\r
DeviceAddress -Represents the address of the target device on the USB,\r
which is assigned during USB enumeration.\r
\r
DeviceSpeed - Indicates transfer speed of device.\r
- \r
- MaximumPacketLength - Indicates the maximum packet size that the \r
- default control transfer endpoint is capable of \r
+\r
+ MaximumPacketLength - Indicates the maximum packet size that the\r
+ default control transfer endpoint is capable of\r
sending or receiving.\r
- \r
- Request - A pointer to the USB device request that will be sent \r
- to the USB device. \r
- \r
+\r
+ Request - A pointer to the USB device request that will be sent\r
+ to the USB device.\r
+\r
TransferDirection - Specifies the data direction for the transfer.\r
- There are three values available, DataIn, DataOut \r
+ There are three values available, DataIn, DataOut\r
and NoData.\r
- \r
- Data -A pointer to the buffer of data that will be transmitted \r
+\r
+ Data -A pointer to the buffer of data that will be transmitted\r
to USB device or received from USB device.\r
- \r
- DataLength - Indicates the size, in bytes, of the data buffer \r
+\r
+ DataLength - Indicates the size, in bytes, of the data buffer\r
specified by Data.\r
- \r
- TimeOut - Indicates the maximum time, in microseconds, \r
+\r
+ TimeOut - Indicates the maximum time, in microseconds,\r
which the transfer is allowed to complete.\r
- \r
- TransferResult - A pointer to the detailed result information generated \r
+\r
+ TransferResult - A pointer to the detailed result information generated\r
by this control transfer.\r
- \r
+\r
Returns:\r
- EFI_SUCCESS \r
+ EFI_SUCCESS\r
The control transfer was completed successfully.\r
- EFI_OUT_OF_RESOURCES \r
+ EFI_OUT_OF_RESOURCES\r
The control transfer could not be completed due to a lack of resources.\r
- EFI_INVALID_PARAMETER \r
+ EFI_INVALID_PARAMETER\r
Some parameters are invalid.\r
- EFI_TIMEOUT \r
+ EFI_TIMEOUT\r
The control transfer failed due to timeout.\r
- EFI_DEVICE_ERROR \r
- The control transfer failed due to host controller or device error. \r
+ EFI_DEVICE_ERROR\r
+ The control transfer failed due to host controller or device error.\r
Caller should check TranferResult for detailed error information.\r
\r
--*/\r
BOOLEAN IsSlowDevice = (BOOLEAN) ((EFI_USB_SPEED_LOW == DeviceSpeed) ? TRUE : FALSE);\r
\r
HcDev = USB2_HC_DEV_FROM_THIS (This);\r
- \r
+\r
return UHCIControlTransfer(\r
- &HcDev->UsbHc, \r
- DeviceAddress, \r
- IsSlowDevice, \r
- (UINT8) MaximumPacketLength, \r
- Request, \r
- TransferDirection, \r
- Data, \r
+ &HcDev->UsbHc,\r
+ DeviceAddress,\r
+ IsSlowDevice,\r
+ (UINT8) MaximumPacketLength,\r
+ Request,\r
+ TransferDirection,\r
+ Data,\r
DataLength,\r
TimeOut,\r
TransferResult\r
- ); \r
+ );\r
}\r
\r
EFI_STATUS\r
IN UINTN TimeOut,\r
IN EFI_USB2_HC_TRANSACTION_TRANSLATOR *Translator,\r
OUT UINT32 *TransferResult\r
- ) \r
+ )\r
/*++\r
- \r
+\r
Routine Description:\r
Submits bulk transfer to a bulk endpoint of a USB device according to UEFI 2.0 spec.\r
- \r
+\r
Arguments:\r
- \r
+\r
This A pointer to the EFI_USB2_HC_PROTOCOL instance.\r
- \r
+\r
DeviceAddress Represents the address of the target device on the USB,\r
which is assigned during USB enumeration.\r
- \r
- EndPointAddress The combination of an endpoint number and an \r
- endpoint direction of the target USB device. \r
- Each endpoint address supports data transfer in \r
- one direction except the control endpoint \r
- (whose default endpoint address is 0). \r
- It is the caller's responsibility to make sure that \r
- the EndPointAddress represents a bulk endpoint. \r
- \r
+\r
+ EndPointAddress The combination of an endpoint number and an\r
+ endpoint direction of the target USB device.\r
+ Each endpoint address supports data transfer in\r
+ one direction except the control endpoint\r
+ (whose default endpoint address is 0).\r
+ It is the caller's responsibility to make sure that\r
+ the EndPointAddress represents a bulk endpoint.\r
+\r
DeviceSpeed Indicates device speed. The supported values are EFI_USB_SPEED_FULL\r
and EFI_USB_SPEED_HIGH.\r
- \r
+\r
MaximumPacketLength Indicates the maximum packet size the target endpoint\r
is capable of sending or receiving.\r
- \r
+\r
DataBuffersNumber Number of data buffers prepared for the transfer.\r
- \r
- Data Array of pointers to the buffers of data that will be transmitted \r
+\r
+ Data Array of pointers to the buffers of data that will be transmitted\r
to USB device or received from USB device.\r
- \r
+\r
DataLength When input, indicates the size, in bytes, of the data buffer\r
- specified by Data. When output, indicates the actually \r
+ specified by Data. When output, indicates the actually\r
transferred data size.\r
- \r
- DataToggle A pointer to the data toggle value. On input, it indicates \r
+\r
+ DataToggle A pointer to the data toggle value. On input, it indicates\r
the initial data toggle value the bulk transfer should adopt;\r
- on output, it is updated to indicate the data toggle value \r
- of the subsequent bulk transfer. \r
- \r
+ on output, it is updated to indicate the data toggle value\r
+ of the subsequent bulk transfer.\r
+\r
Translator A pointr to the transaction translator data.\r
- \r
- TimeOut Indicates the maximum time, in microseconds, which the \r
+\r
+ TimeOut Indicates the maximum time, in microseconds, which the\r
transfer is allowed to complete.\r
- \r
- TransferResult A pointer to the detailed result information of the \r
+\r
+ TransferResult A pointer to the detailed result information of the\r
bulk transfer.\r
\r
Returns:\r
- EFI_SUCCESS \r
+ EFI_SUCCESS\r
The bulk transfer was completed successfully.\r
- \r
- EFI_OUT_OF_RESOURCES \r
+\r
+ EFI_OUT_OF_RESOURCES\r
The bulk transfer could not be submitted due to lack of resource.\r
- \r
- EFI_INVALID_PARAMETER \r
+\r
+ EFI_INVALID_PARAMETER\r
Some parameters are invalid.\r
- \r
- EFI_TIMEOUT \r
+\r
+ EFI_TIMEOUT\r
The bulk transfer failed due to timeout.\r
- \r
- EFI_DEVICE_ERROR \r
+\r
+ EFI_DEVICE_ERROR\r
The bulk transfer failed due to host controller or device error.\r
Caller should check TranferResult for detailed error information.\r
\r
---*/ \r
+--*/\r
{\r
USB_HC_DEV *HcDev;\r
\r
HcDev = USB2_HC_DEV_FROM_THIS (This);\r
- \r
+\r
if( Data == NULL || DeviceSpeed==EFI_USB_SPEED_LOW)\r
return EFI_INVALID_PARAMETER;\r
/* For full-speed bulk transfers only the data pointed by Data[0] shall be used */\r
\r
return UHCIBulkTransfer (\r
- &HcDev->UsbHc, \r
- DeviceAddress, \r
- EndPointAddress, \r
- (UINT8) MaximumPacketLength, \r
- *Data, \r
- DataLength, \r
- DataToggle, \r
- TimeOut, \r
+ &HcDev->UsbHc,\r
+ DeviceAddress,\r
+ EndPointAddress,\r
+ (UINT8) MaximumPacketLength,\r
+ *Data,\r
+ DataLength,\r
+ DataToggle,\r
+ TimeOut,\r
TransferResult\r
);\r
}\r
IN VOID *Context\r
)\r
/*++\r
- \r
+\r
Routine Description:\r
- Submits an asynchronous interrupt transfer to an \r
+ Submits an asynchronous interrupt transfer to an\r
interrupt endpoint of a USB device according to UEFI 2.0 spec.\r
- \r
+\r
Arguments:\r
- \r
+\r
This A pointer to the EFI_USB2_HC_PROTOCOL instance.\r
- \r
+\r
DeviceAddress Represents the address of the target device on the USB,\r
which is assigned during USB enumeration.\r
- \r
- EndPointAddress The combination of an endpoint number and an endpoint \r
- direction of the target USB device. Each endpoint address \r
- supports data transfer in one direction except the \r
- control endpoint (whose default endpoint address is 0). \r
- It is the caller's responsibility to make sure that \r
+\r
+ EndPointAddress The combination of an endpoint number and an endpoint\r
+ direction of the target USB device. Each endpoint address\r
+ supports data transfer in one direction except the\r
+ control endpoint (whose default endpoint address is 0).\r
+ It is the caller's responsibility to make sure that\r
the EndPointAddress represents an interrupt endpoint.\r
- \r
+\r
DeviceSpeed Indicates device speed.\r
- \r
+\r
MaximumPacketLength Indicates the maximum packet size the target endpoint\r
is capable of sending or receiving.\r
- \r
+\r
IsNewTransfer If TRUE, an asynchronous interrupt pipe is built between\r
- the host and the target interrupt endpoint. \r
- If FALSE, the specified asynchronous interrupt pipe \r
+ the host and the target interrupt endpoint.\r
+ If FALSE, the specified asynchronous interrupt pipe\r
is canceled.\r
- \r
- DataToggle A pointer to the data toggle value. On input, it is valid \r
- when IsNewTransfer is TRUE, and it indicates the initial \r
- data toggle value the asynchronous interrupt transfer \r
- should adopt. \r
- On output, it is valid when IsNewTransfer is FALSE, \r
- and it is updated to indicate the data toggle value of \r
+\r
+ DataToggle A pointer to the data toggle value. On input, it is valid\r
+ when IsNewTransfer is TRUE, and it indicates the initial\r
+ data toggle value the asynchronous interrupt transfer\r
+ should adopt.\r
+ On output, it is valid when IsNewTransfer is FALSE,\r
+ and it is updated to indicate the data toggle value of\r
the subsequent asynchronous interrupt transfer.\r
- \r
- PollingInterval Indicates the interval, in milliseconds, that the \r
- asynchronous interrupt transfer is polled. \r
+\r
+ PollingInterval Indicates the interval, in milliseconds, that the\r
+ asynchronous interrupt transfer is polled.\r
This parameter is required when IsNewTransfer is TRUE.\r
- \r
- DataLength Indicates the length of data to be received at the \r
- rate specified by PollingInterval from the target \r
- asynchronous interrupt endpoint. This parameter \r
+\r
+ DataLength Indicates the length of data to be received at the\r
+ rate specified by PollingInterval from the target\r
+ asynchronous interrupt endpoint. This parameter\r
is only required when IsNewTransfer is TRUE.\r
- \r
+\r
Translator A pointr to the transaction translator data.\r
- \r
- CallBackFunction The Callback function.This function is called at the \r
- rate specified by PollingInterval.This parameter is \r
+\r
+ CallBackFunction The Callback function.This function is called at the\r
+ rate specified by PollingInterval.This parameter is\r
only required when IsNewTransfer is TRUE.\r
- \r
+\r
Context The context that is passed to the CallBackFunction.\r
This is an optional parameter and may be NULL.\r
- \r
+\r
Returns:\r
- \r
- EFI_SUCCESS \r
- The asynchronous interrupt transfer request has been successfully \r
+\r
+ EFI_SUCCESS\r
+ The asynchronous interrupt transfer request has been successfully\r
submitted or canceled.\r
- \r
- EFI_INVALID_PARAMETER \r
+\r
+ EFI_INVALID_PARAMETER\r
Some parameters are invalid.\r
- \r
- EFI_OUT_OF_RESOURCES \r
- The request could not be completed due to a lack of resources. \r
- \r
+\r
+ EFI_OUT_OF_RESOURCES\r
+ The request could not be completed due to a lack of resources.\r
+\r
EFI_DEVICE_ERROR\r
Can't read register\r
---*/ \r
+--*/\r
{\r
USB_HC_DEV *HcDev;\r
BOOLEAN IsSlowDevice = (BOOLEAN) ((EFI_USB_SPEED_LOW == DeviceSpeed) ? TRUE : FALSE);\r
- \r
+\r
HcDev = USB2_HC_DEV_FROM_THIS (This);\r
return UHCIAsyncInterruptTransfer(\r
- &HcDev->UsbHc, \r
- DeviceAddress, \r
- EndPointAddress, \r
- IsSlowDevice, \r
- (UINT8) MaximumPacketLength, \r
- IsNewTransfer, \r
- DataToggle, \r
+ &HcDev->UsbHc,\r
+ DeviceAddress,\r
+ EndPointAddress,\r
+ IsSlowDevice,\r
+ (UINT8) MaximumPacketLength,\r
+ IsNewTransfer,\r
+ DataToggle,\r
PollingInterval,\r
- DataLength, \r
+ DataLength,\r
CallBackFunction,\r
Context\r
);\r
OUT UINT32 *TransferResult\r
)\r
/*++\r
- \r
+\r
Routine Description:\r
- Submits synchronous interrupt transfer to an interrupt endpoint \r
+ Submits synchronous interrupt transfer to an interrupt endpoint\r
of a USB device according to UEFI 2.0 spec.\r
- \r
+\r
Arguments:\r
- \r
+\r
This A pointer to the EFI_USB2_HC_PROTOCOL instance.\r
- \r
- DeviceAddress Represents the address of the target device on the USB, \r
+\r
+ DeviceAddress Represents the address of the target device on the USB,\r
which is assigned during USB enumeration.\r
- \r
- EndPointAddress The combination of an endpoint number and an endpoint \r
- direction of the target USB device. Each endpoint \r
- address supports data transfer in one direction \r
- except the control endpoint (whose default \r
+\r
+ EndPointAddress The combination of an endpoint number and an endpoint\r
+ direction of the target USB device. Each endpoint\r
+ address supports data transfer in one direction\r
+ except the control endpoint (whose default\r
endpoint address is 0). It is the caller's responsibility\r
- to make sure that the EndPointAddress represents \r
- an interrupt endpoint. \r
- \r
+ to make sure that the EndPointAddress represents\r
+ an interrupt endpoint.\r
+\r
DeviceSpeed Indicates device speed.\r
- \r
- MaximumPacketLength Indicates the maximum packet size the target endpoint \r
+\r
+ MaximumPacketLength Indicates the maximum packet size the target endpoint\r
is capable of sending or receiving.\r
- \r
- Data A pointer to the buffer of data that will be transmitted \r
+\r
+ Data A pointer to the buffer of data that will be transmitted\r
to USB device or received from USB device.\r
- \r
- DataLength On input, the size, in bytes, of the data buffer specified \r
+\r
+ DataLength On input, the size, in bytes, of the data buffer specified\r
by Data. On output, the number of bytes transferred.\r
- \r
+\r
DataToggle A pointer to the data toggle value. On input, it indicates\r
- the initial data toggle value the synchronous interrupt \r
- transfer should adopt; \r
- on output, it is updated to indicate the data toggle value \r
- of the subsequent synchronous interrupt transfer. \r
- \r
- TimeOut Indicates the maximum time, in microseconds, which the \r
+ the initial data toggle value the synchronous interrupt\r
+ transfer should adopt;\r
+ on output, it is updated to indicate the data toggle value\r
+ of the subsequent synchronous interrupt transfer.\r
+\r
+ TimeOut Indicates the maximum time, in microseconds, which the\r
transfer is allowed to complete.\r
Translator A pointr to the transaction translator data.\r
- TransferResult A pointer to the detailed result information from \r
- the synchronous interrupt transfer. \r
+ TransferResult A pointer to the detailed result information from\r
+ the synchronous interrupt transfer.\r
\r
Returns:\r
- EFI_SUCCESS \r
+ EFI_SUCCESS\r
The synchronous interrupt transfer was completed successfully.\r
- EFI_OUT_OF_RESOURCES \r
- The synchronous interrupt transfer could not be submitted due \r
+ EFI_OUT_OF_RESOURCES\r
+ The synchronous interrupt transfer could not be submitted due\r
to lack of resource.\r
- EFI_INVALID_PARAMETER \r
+ EFI_INVALID_PARAMETER\r
Some parameters are invalid.\r
- EFI_TIMEOUT \r
+ EFI_TIMEOUT\r
The synchronous interrupt transfer failed due to timeout.\r
- EFI_DEVICE_ERROR \r
- The synchronous interrupt transfer failed due to host controller \r
- or device error. Caller should check TranferResult for detailed \r
- error information. \r
---*/ \r
+ EFI_DEVICE_ERROR\r
+ The synchronous interrupt transfer failed due to host controller\r
+ or device error. Caller should check TranferResult for detailed\r
+ error information.\r
+--*/\r
{\r
USB_HC_DEV *HcDev;\r
BOOLEAN IsSlowDevice;\r
- \r
+\r
if(DeviceSpeed==EFI_USB_SPEED_HIGH)\r
return EFI_INVALID_PARAMETER;\r
- \r
- IsSlowDevice = (BOOLEAN) ((EFI_USB_SPEED_LOW == DeviceSpeed) ? TRUE : FALSE); \r
+\r
+ IsSlowDevice = (BOOLEAN) ((EFI_USB_SPEED_LOW == DeviceSpeed) ? TRUE : FALSE);\r
HcDev = USB2_HC_DEV_FROM_THIS (This);\r
- \r
+\r
return UHCISyncInterruptTransfer(\r
- &HcDev->UsbHc, \r
- DeviceAddress, \r
- EndPointAddress, \r
- IsSlowDevice, \r
- (UINT8) MaximumPacketLength, \r
- Data, \r
- DataLength, \r
+ &HcDev->UsbHc,\r
+ DeviceAddress,\r
+ EndPointAddress,\r
+ IsSlowDevice,\r
+ (UINT8) MaximumPacketLength,\r
+ Data,\r
+ DataLength,\r
DataToggle,\r
TimeOut,\r
TransferResult\r
OUT UINT32 *TransferResult\r
)\r
/*++\r
- \r
+\r
Routine Description:\r
- \r
+\r
Submits isochronous transfer to a target USB device according to UEFI 2.0 spec.\r
- \r
+\r
Arguments:\r
- \r
+\r
This A pointer to the EFI_USB2_HC_PROTOCOL instance.\r
- \r
+\r
DeviceAddress Represents the address of the target device on the USB,\r
which is assigned during USB enumeration.\r
- \r
+\r
EndPointAddress End point address\r
- \r
+\r
DeviceSpeed Indicates device speed.\r
- \r
- MaximumPacketLength Indicates the maximum packet size that the \r
- default control transfer endpoint is capable of \r
+\r
+ MaximumPacketLength Indicates the maximum packet size that the\r
+ default control transfer endpoint is capable of\r
sending or receiving.\r
- \r
+\r
DataBuffersNumber Number of data buffers prepared for the transfer.\r
- \r
- Data Array of pointers to the buffers of data that will be \r
+\r
+ Data Array of pointers to the buffers of data that will be\r
transmitted to USB device or received from USB device.\r
- \r
- DataLength Indicates the size, in bytes, of the data buffer \r
+\r
+ DataLength Indicates the size, in bytes, of the data buffer\r
specified by Data.\r
- \r
+\r
Translator A pointr to the transaction translator data.\r
- \r
- TransferResult A pointer to the detailed result information generated \r
- by this control transfer. \r
+\r
+ TransferResult A pointer to the detailed result information generated\r
+ by this control transfer.\r
Returns:\r
- \r
- EFI_UNSUPPORTED \r
\r
---*/ \r
+ EFI_UNSUPPORTED\r
+\r
+--*/\r
{\r
return EFI_UNSUPPORTED;\r
}\r
IN VOID *Context\r
)\r
/*++\r
- \r
+\r
Routine Description:\r
- \r
+\r
Submits Async isochronous transfer to a target USB device according to UEFI 2.0 spec.\r
- \r
+\r
Arguments:\r
- \r
+\r
This A pointer to the EFI_USB2_HC_PROTOCOL instance.\r
- \r
+\r
DeviceAddress Represents the address of the target device on the USB,\r
which is assigned during USB enumeration.\r
\r
EndPointAddress End point address\r
- \r
+\r
DeviceSpeed Indicates device speed.\r
- \r
- MaximumPacketLength Indicates the maximum packet size that the \r
- default control transfer endpoint is capable of \r
+\r
+ MaximumPacketLength Indicates the maximum packet size that the\r
+ default control transfer endpoint is capable of\r
sending or receiving.\r
- \r
+\r
DataBuffersNumber Number of data buffers prepared for the transfer.\r
- \r
- Data Array of pointers to the buffers of data that will be transmitted \r
+\r
+ Data Array of pointers to the buffers of data that will be transmitted\r
to USB device or received from USB device.\r
- \r
+\r
Translator A pointr to the transaction translator data.\r
- \r
+\r
IsochronousCallBack When the transfer complete, the call back function will be called\r
- \r
+\r
Context Pass to the call back function as parameter\r
- \r
+\r
Returns:\r
- \r
- EFI_UNSUPPORTED \r
\r
---*/ \r
+ EFI_UNSUPPORTED\r
+\r
+--*/\r
{\r
return EFI_UNSUPPORTED;\r
}\r
OUT EFI_USB_PORT_STATUS * PortStatus\r
)\r
/*++\r
- \r
+\r
Routine Description:\r
Retrieves the current status of a USB root hub port according to UEFI 2.0 spec.\r
- \r
+\r
Arguments:\r
- \r
+\r
This A pointer to the EFI_USB2_HC_PROTOCOL.\r
- \r
- PortNumber Specifies the root hub port from which the status \r
- is to be retrieved. This value is zero-based. For example, \r
+\r
+ PortNumber Specifies the root hub port from which the status\r
+ is to be retrieved. This value is zero-based. For example,\r
if a root hub has two ports, then the first port is numbered 0,\r
and the second port is numbered 1.\r
- \r
- PortStatus A pointer to the current port status bits and \r
- port status change bits. \r
- \r
+\r
+ PortStatus A pointer to the current port status bits and\r
+ port status change bits.\r
+\r
Returns:\r
- EFI_SUCCESS \r
- The status of the USB root hub port specified by PortNumber \r
+ EFI_SUCCESS\r
+ The status of the USB root hub port specified by PortNumber\r
was returned in PortStatus.\r
- EFI_INVALID_PARAMETER \r
- PortNumber is invalid. \r
- EFI_DEVICE_ERROR - Can't read register \r
---*/ \r
+ EFI_INVALID_PARAMETER\r
+ PortNumber is invalid.\r
+ EFI_DEVICE_ERROR - Can't read register\r
+--*/\r
{\r
USB_HC_DEV *HcDev;\r
\r
HcDev = USB2_HC_DEV_FROM_THIS (This);\r
- \r
+\r
return UHCIGetRootHubPortStatus(\r
- &HcDev->UsbHc, \r
- PortNumber, \r
+ &HcDev->UsbHc,\r
+ PortNumber,\r
PortStatus\r
);\r
}\r
IN EFI_USB_PORT_FEATURE PortFeature\r
)\r
/*++\r
- \r
+\r
Routine Description:\r
Sets a feature for the specified root hub port according to UEFI 2.0 spec.\r
- \r
+\r
Arguments:\r
- \r
+\r
This A pointer to the EFI_USB2_HC_PROTOCOL.\r
- \r
- PortNumber Specifies the root hub port whose feature \r
+\r
+ PortNumber Specifies the root hub port whose feature\r
is requested to be set.\r
- \r
- PortFeature Indicates the feature selector associated \r
- with the feature set request. \r
- \r
+\r
+ PortFeature Indicates the feature selector associated\r
+ with the feature set request.\r
+\r
Returns:\r
- EFI_SUCCESS \r
- The feature specified by PortFeature was set for the \r
+ EFI_SUCCESS\r
+ The feature specified by PortFeature was set for the\r
USB root hub port specified by PortNumber.\r
- EFI_INVALID_PARAMETER \r
+ EFI_INVALID_PARAMETER\r
PortNumber is invalid or PortFeature is invalid.\r
EFI_DEVICE_ERROR\r
Can't read register\r
---*/ \r
+--*/\r
{\r
USB_HC_DEV *HcDev;\r
\r
HcDev = USB2_HC_DEV_FROM_THIS (This);\r
return UHCISetRootHubPortFeature(\r
- &HcDev->UsbHc, \r
- PortNumber, \r
+ &HcDev->UsbHc,\r
+ PortNumber,\r
PortFeature\r
);\r
}\r
IN EFI_USB_PORT_FEATURE PortFeature\r
)\r
/*++\r
- \r
+\r
Routine Description:\r
Clears a feature for the specified root hub port according to Uefi 2.0 spec.\r
- \r
+\r
Arguments:\r
- \r
+\r
This A pointer to the EFI_USB2_HC_PROTOCOL instance.\r
- \r
- PortNumber Specifies the root hub port whose feature \r
+\r
+ PortNumber Specifies the root hub port whose feature\r
is requested to be cleared.\r
- \r
- PortFeature Indicates the feature selector associated with the \r
+\r
+ PortFeature Indicates the feature selector associated with the\r
feature clear request.\r
- \r
+\r
Returns:\r
- EFI_SUCCESS \r
- The feature specified by PortFeature was cleared for the \r
+ EFI_SUCCESS\r
+ The feature specified by PortFeature was cleared for the\r
USB root hub port specified by PortNumber.\r
- EFI_INVALID_PARAMETER \r
+ EFI_INVALID_PARAMETER\r
PortNumber is invalid or PortFeature is invalid.\r
EFI_DEVICE_ERROR\r
Can't read register\r
---*/ \r
+--*/\r
{\r
USB_HC_DEV *HcDev;\r
\r
HcDev = USB2_HC_DEV_FROM_THIS (This);\r
return UHCIClearRootHubPortFeature(\r
- &HcDev->UsbHc, \r
- PortNumber, \r
+ &HcDev->UsbHc,\r
+ PortNumber,\r
PortFeature\r
);\r
}\r
Contex - Pointer to USB_HC_DEV\r
Returns:\r
None\r
---*/ \r
+--*/\r
{\r
\r
USB_HC_DEV *HcDev;\r
if (DataBuffer) {\r
gBS->FreePool (DataBuffer);\r
}\r
- \r
+\r
//\r
// update should done after data buffer got.\r
//\r