diff options
Diffstat (limited to 'EdkModulePkg/Bus/Usb/UsbBus/Dxe/usbbus.c')
-rw-r--r-- | EdkModulePkg/Bus/Usb/UsbBus/Dxe/usbbus.c | 638 |
1 files changed, 319 insertions, 319 deletions
diff --git a/EdkModulePkg/Bus/Usb/UsbBus/Dxe/usbbus.c b/EdkModulePkg/Bus/Usb/UsbBus/Dxe/usbbus.c index e1fdce7997..97c9f5efee 100644 --- a/EdkModulePkg/Bus/Usb/UsbBus/Dxe/usbbus.c +++ b/EdkModulePkg/Bus/Usb/UsbBus/Dxe/usbbus.c @@ -1,13 +1,13 @@ /*++
-Copyright (c) 2006, Intel Corporation
-All rights reserved. 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
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+Copyright (c) 2006, Intel Corporation
+All rights reserved. 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
+http://opensource.org/licenses/bsd-license.php
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
@@ -201,7 +201,7 @@ UsbFreeAddress ( Arguments:
DevAddress - Usb device address
AddressPool - Pool of usb device address
-
+
Returns:
VOID
@@ -259,7 +259,7 @@ UsbBusControllerDriverSupported ( return EFI_UNSUPPORTED;
}
}
-
+
//
// Open the IO Abstraction(s) needed to perform the supported test
//
@@ -285,7 +285,7 @@ UsbBusControllerDriverSupported ( This->DriverBindingHandle,
Controller
);
-
+
//
// Check whether USB Host Controller Protocol is already
// installed on this handle. If it is installed, we can start
@@ -302,7 +302,7 @@ UsbBusControllerDriverSupported ( if (Status == EFI_ALREADY_STARTED) {
return EFI_SUCCESS;
}
-
+
if (EFI_ERROR (Status)) {
Status = gBS->OpenProtocol (
Controller,
@@ -328,7 +328,7 @@ UsbBusControllerDriverSupported ( );
return EFI_SUCCESS;
}
-
+
gBS->CloseProtocol (
Controller,
&gEfiUsb2HcProtocolGuid,
@@ -622,8 +622,8 @@ UsbBusControllerDriverStart ( // Create a timer to query root ports periodically
//
Status = gBS->CreateEvent (
- EFI_EVENT_TIMER | EFI_EVENT_NOTIFY_SIGNAL,
- EFI_TPL_CALLBACK,
+ EVT_TIMER | EVT_NOTIFY_SIGNAL,
+ TPL_CALLBACK,
RootHubEnumeration,
RootHubController,
&RootHubController->HubNotify
@@ -670,7 +670,7 @@ UsbBusControllerDriverStart ( // there will be an interval between bus start and devices start.
//
gBS->SignalEvent (RootHubController->HubNotify);
-
+
Status = gBS->SetTimer (
RootHubController->HubNotify,
TimerPeriodic,
@@ -1229,7 +1229,7 @@ UsbDeviceDeConfiguration ( Arguments:
UsbIoDevice - The device to be deconfigured.
- Returns:
+ Returns:
EFI_SUCCESS
EFI_DEVICE_ERROR
@@ -1307,7 +1307,7 @@ UsbDeviceDeConfiguration ( NULL
);
}
-
+
//
// remove child handle reference to the USB_HC_PROTOCOL
//
@@ -1422,7 +1422,7 @@ OnHubInterruptComplete ( &UsbResult
);
}
-
+
//
// Delete & Submit this interrupt again
//
@@ -1467,7 +1467,7 @@ OnHubInterruptComplete ( if (DataLength == 0 || Data == NULL) {
return EFI_SUCCESS;
}
-
+
//
// Scan which port has status change
// Bit 0 stands for hub itself, other bit stands for
@@ -1500,18 +1500,18 @@ RootHubEnumeration ( /*++
Routine Description:
-
+
This is USB RootHub enumerator
Arguments:
-
+
Event - Indicating which event is signaled
Context - actually it is a USB_IO_DEVICE
Returns:
-
+
VOID
-
+
--*/
{
USB_IO_CONTROLLER_DEVICE *HubController;
@@ -1565,7 +1565,7 @@ RootHubEnumeration ( );
if (IsPortConnect (HubPortStatus.PortStatus)) {
-
+
//
// There is something connected to this port
//
@@ -1602,8 +1602,8 @@ RootHubEnumeration ( // Process of identify device speed
//
Status = IdentifyDeviceSpeed (
- UsbBusDev,
- NewDevice,
+ UsbBusDev,
+ NewDevice,
Index
);
if (EFI_ERROR (Status)) {
@@ -1667,8 +1667,8 @@ RootHubEnumeration ( // Create an event to do hub enumeration
//
gBS->CreateEvent (
- EFI_EVENT_NOTIFY_SIGNAL,
- EFI_TPL_CALLBACK,
+ EVT_NOTIFY_SIGNAL,
+ TPL_CALLBACK,
HubEnumeration,
NewController,
&NewController->HubNotify
@@ -1727,11 +1727,11 @@ HubEnumeration ( /*++
Routine Description:
-
+
This is Usb Hub enumerator
Arguments:
-
+
Event - Indicating which event is signaled
Context - actually it is a USB_IO_DEVICE
@@ -2040,8 +2040,8 @@ HubEnumeration ( // Create an event to do hub enumeration
//
gBS->CreateEvent (
- EFI_EVENT_NOTIFY_SIGNAL,
- EFI_TPL_CALLBACK,
+ EVT_NOTIFY_SIGNAL,
+ TPL_CALLBACK,
HubEnumeration,
NewController,
&NewController->HubNotify
@@ -2213,7 +2213,7 @@ ParentPortReset ( UsbIoController - Indicating the Usb Controller Device.
ReConfigure - Do we need to reconfigure it.
RetryTimes - Retry Times when failed
-
+
Returns:
EFI_SUCCESS
EFI_DEVICE_ERROR
@@ -2305,7 +2305,7 @@ UsbPortReset ( if (IsHub (UsbIoController)) {
return EFI_INVALID_PARAMETER;
}
-
+
//
// Since at this time, this device has already been configured,
// it needs to be re-configured.
@@ -2329,7 +2329,7 @@ ResetRootPort ( UsbBusDev - Bus controller of the device.
PortNum - The given port to be reset.
RetryTimes - RetryTimes when failed
-
+
Returns:
EFI_SUCCESS
EFI_DEVICE_ERROR
@@ -2594,22 +2594,22 @@ UsbSetTransactionTranslator ( IN OUT USB_IO_DEVICE *Device
)
/*++
-
+
Routine Description:
-
+
Set Transaction Translator parameter
-
+
Arguments:
-
+
ParentHubController - Controller structure of the parent Hub device
ParentPort - Number of parent port
Device - Structure of the device
-
+
Returns:
-
+
EFI_SUCCESS Success
EFI_OUT_OF_RESOURCES Cannot allocate resources
-
+
--*/
{
USB_IO_CONTROLLER_DEVICE *AncestorHubController;
@@ -2650,19 +2650,19 @@ UsbUnsetTransactionTranslator ( USB_IO_DEVICE *Device
)
/*++
-
+
Routine Description:
-
+
Unset Transaction Translator parameter
-
+
Arguments:
-
+
Device - Structure of the device
-
+
Returns:
-
+
EFI_SUCCESS Success
-
+
--*/
{
if (Device->Translator) {
@@ -2681,22 +2681,22 @@ IdentifyDeviceSpeed ( UINT8 Index
)
/*++
-
+
Routine Description:
-
+
Identify speed of USB device
-
+
Arguments:
-
+
UsbBusDev - UsbBus controller structure of the device
NewDevice - Devcie controller structure
Index - Number of the port
-
+
Returns:
-
+
EFI_SUCCESS Success
EFI_NOT_FOUND Device release to CHC or can't be found
-
+
--*/
{
EFI_STATUS Status;
@@ -2707,7 +2707,7 @@ IdentifyDeviceSpeed ( Index,
(EFI_USB_PORT_STATUS *) &HubPortStatus
);
-
+
//
// Check device device
//
@@ -2717,7 +2717,7 @@ IdentifyDeviceSpeed ( //
if (HubPortStatus.PortStatus & USB_PORT_STAT_HIGH_SPEED) {
DEBUG ((gUSBDebugLevel, "High Speed Device attached to EHC\n"));
- NewDevice->DeviceSpeed = EFI_USB_SPEED_HIGH;
+ NewDevice->DeviceSpeed = EFI_USB_SPEED_HIGH;
} else {
Status = ReleasePortToCHC (UsbBusDev, Index);
if (EFI_ERROR (Status)) {
@@ -2733,13 +2733,13 @@ IdentifyDeviceSpeed ( //
if (HubPortStatus.PortStatus & USB_PORT_STAT_LOW_SPEED) {
DEBUG ((gUSBDebugLevel, "Low Speed Device attached to CHC\n"));
- NewDevice->DeviceSpeed = EFI_USB_SPEED_LOW;
+ NewDevice->DeviceSpeed = EFI_USB_SPEED_LOW;
} else {
DEBUG ((gUSBDebugLevel, "FULL Speed Device attached to CHC\n"));
- NewDevice->DeviceSpeed = EFI_USB_SPEED_FULL;
+ NewDevice->DeviceSpeed = EFI_USB_SPEED_FULL;
}
}
-
+
return EFI_SUCCESS;
}
@@ -2750,21 +2750,21 @@ ReleasePortToCHC ( UINT8 PortNum
)
/*++
-
+
Routine Description:
-
+
Set bit to release the port owner to CHC
-
+
Arguments:
-
+
UsbBusDev - UsbBus controller structure of the device
PortNum - Number of the port
-
+
Returns:
-
+
EFI_SUCCESS Success
EFI_DEVICE_ERROR Fail
-
+
--*/
{
EFI_STATUS Status;
@@ -2789,29 +2789,29 @@ UsbVirtualHcGetCapability ( OUT UINT8 *Is64BitCapable
)
/*++
-
+
Routine Description:
-
- Virtual interface to Retrieves the capablility of root hub ports
+
+ Virtual interface to Retrieves the capablility of root hub ports
for both Hc2 and Hc protocol.
-
+
Arguments:
-
+
UsbBusDev - A pointer to bus controller of the device.
MaxSpeed - A pointer to the number of the host controller.
PortNumber - A pointer to the number of the root hub ports.
- Is64BitCapable - A pointer to the flag for whether controller supports
+ Is64BitCapable - A pointer to the flag for whether controller supports
64-bit memory addressing.
-
+
Returns:
-
- EFI_SUCCESS
+
+ EFI_SUCCESS
The host controller capability were retrieved successfully.
- EFI_INVALID_PARAMETER
+ EFI_INVALID_PARAMETER
MaxSpeed or PortNumber or Is64BitCapable is NULL.
- EFI_DEVICE_ERROR
- An error was encountered while attempting to retrieve the capabilities.
-
+ EFI_DEVICE_ERROR
+ An error was encountered while attempting to retrieve the capabilities.
+
--*/
{
EFI_STATUS Status;
@@ -2844,59 +2844,59 @@ UsbVirtualHcReset ( IN UINT16 Attributes
)
/*++
-
+
Routine Description:
-
+
Virtual interface to provides software reset for the USB host controller
for both Hc2 and Hc protocol.
-
+
Arguments:
-
+
UsbBusDev - A pointer to bus controller of the device.
- Attributes - A bit mask of the reset operation to perform.
+ Attributes - A bit mask of the reset operation to perform.
See below for a list of the supported bit mask values.
-
+
#define EFI_USB_HC_RESET_GLOBAL 0x0001 // Hc2 and Hc
#define EFI_USB_HC_RESET_HOST_CONTROLLER 0x0002 // Hc2 and Hc
#define EFI_USB_HC_RESET_GLOBAL_WITH_DEBUG 0x0004 // Hc2
#define EFI_USB_HC_RESET_HOST_WITH_DEBUG 0x0008 // Hc2
- EFI_USB_HC_RESET_GLOBAL
+ EFI_USB_HC_RESET_GLOBAL
If this bit is set, a global reset signal will be sent to the USB bus.
- This resets all of the USB bus logic, including the USB host
+ This resets all of the USB bus logic, including the USB host
controller hardware and all the devices attached on the USB bus.
- EFI_USB_HC_RESET_HOST_CONTROLLER
- If this bit is set, the USB host controller hardware will be reset.
+ EFI_USB_HC_RESET_HOST_CONTROLLER
+ If this bit is set, the USB host controller hardware will be reset.
No reset signal will be sent to the USB bus.
EFI_USB_HC_RESET_GLOBAL_WITH_DEBUG
If this bit is set, a global reset signal will be sent to the USB bus.
- This resets all of the USB bus logic, including the USB host
- controller hardware and all the devices attached on the USB bus.
- If this is an EHCI controller and the debug port has configured, then
+ This resets all of the USB bus logic, including the USB host
+ controller hardware and all the devices attached on the USB bus.
+ If this is an EHCI controller and the debug port has configured, then
this is will still reset the host controller.
EFI_USB_HC_RESET_HOST_WITH_DEBUG
- If this bit is set, the USB host controller hardware will be reset.
+ If this bit is set, the USB host controller hardware will be reset.
If this is an EHCI controller and the debug port has been configured,
then this will still reset the host controller.
-
+
Returns:
-
- EFI_SUCCESS
+
+ EFI_SUCCESS
The reset operation succeeded.
- EFI_INVALID_PARAMETER
+ EFI_INVALID_PARAMETER
Attributes is not valid.
EFI_UNSUPPOURTED
The type of reset specified by Attributes is not currently supported by
the host controller hardware.
EFI_ACCESS_DENIED
- Reset operation is rejected due to the debug port being configured and
- active; only EFI_USB_HC_RESET_GLOBAL_WITH_DEBUG or
+ Reset operation is rejected due to the debug port being configured and
+ active; only EFI_USB_HC_RESET_GLOBAL_WITH_DEBUG or
EFI_USB_HC_RESET_HOST_WITH_DEBUG reset Atrributes can be used to
perform reset operation for this host controller.
- EFI_DEVICE_ERROR
- An error was encountered while attempting to perform
+ EFI_DEVICE_ERROR
+ An error was encountered while attempting to perform
the reset operation.
-
+
--*/
{
EFI_STATUS Status;
@@ -2925,36 +2925,36 @@ UsbVirtualHcGetState ( OUT EFI_USB_HC_STATE *State
)
/*++
-
+
Routine Description:
-
+
Virtual interface to retrieves current state of the USB host controller
for both Hc2 and Hc protocol.
-
+
Arguments:
-
+
UsbBusDev - A pointer to bus controller of the device.
- State - A pointer to the EFI_USB_HC_STATE data structure that
- indicates current state of the USB host controller.
+ State - A pointer to the EFI_USB_HC_STATE data structure that
+ indicates current state of the USB host controller.
Type EFI_USB_HC_STATE is defined below.
-
+
typedef enum {
EfiUsbHcStateHalt,
EfiUsbHcStateOperational,
EfiUsbHcStateSuspend,
EfiUsbHcStateMaximum
} EFI_USB_HC_STATE;
-
+
Returns:
-
- EFI_SUCCESS
+
+ EFI_SUCCESS
The state information of the host controller was returned in State.
- EFI_INVALID_PARAMETER
+ EFI_INVALID_PARAMETER
State is NULL.
- EFI_DEVICE_ERROR
- An error was encountered while attempting to retrieve the
- host controller's current state.
-
+ EFI_DEVICE_ERROR
+ An error was encountered while attempting to retrieve the
+ host controller's current state.
+
--*/
{
EFI_STATUS Status;
@@ -2983,27 +2983,27 @@ UsbVirtualHcSetState ( IN EFI_USB_HC_STATE State
)
/*++
-
+
Routine Description:
-
+
Virtual interface to sets the USB host controller to a specific state
for both Hc2 and Hc protocol.
-
+
Arguments:
-
+
UsbBusDev - A pointer to bus controller of the device.
State - Indicates the state of the host controller that will be set.
-
+
Returns:
-
- EFI_SUCCESS
- The USB host controller was successfully placed in the state
+
+ EFI_SUCCESS
+ The USB host controller was successfully placed in the state
specified by State.
- EFI_INVALID_PARAMETER
+ EFI_INVALID_PARAMETER
State is invalid.
- EFI_DEVICE_ERROR
- Failed to set the state specified by State due to device error.
-
+ EFI_DEVICE_ERROR
+ Failed to set the state specified by State due to device error.
+
--*/
{
EFI_STATUS Status;
@@ -3033,29 +3033,29 @@ UsbVirtualHcGetRootHubPortStatus ( OUT EFI_USB_PORT_STATUS *PortStatus
)
/*++
-
+
Routine Description:
-
+
Virtual interface to retrieves the current status of a USB root hub port
both for Hc2 and Hc protocol.
-
+
Arguments:
-
+
UsbBusDev - A pointer to bus controller of the device.
- PortNumber - Specifies the root hub port from which the status
- is to be retrieved. This value is zero-based. For example,
+ PortNumber - Specifies the root hub port from which the status
+ is to be retrieved. This value is zero-based. For example,
if a root hub has two ports, then the first port is numbered 0,
and the second port is numbered 1.
- PortStatus - A pointer to the current port status bits and
- port status change bits.
-
+ PortStatus - A pointer to the current port status bits and
+ port status change bits.
+
Returns:
-
- EFI_SUCCESS The status of the USB root hub port specified by PortNumber
+
+ 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_INVALID_PARAMETER PortNumber is invalid.
+ EFI_DEVICE_ERROR Can't read register
+
--*/
{
EFI_STATUS Status;
@@ -3087,29 +3087,29 @@ UsbVirtualHcSetRootHubPortFeature ( IN EFI_USB_PORT_FEATURE PortFeature
)
/*++
-
+
Routine Description:
Virual interface to sets a feature for the specified root hub port
for both Hc2 and Hc protocol.
-
+
Arguments:
-
+
UsbBusDev - A pointer to bus controller of the device.
- PortNumber - Specifies the root hub port whose feature
+ PortNumber - Specifies the root hub port whose feature
is requested to be set.
- PortFeature - Indicates the feature selector associated
- with the feature set request.
-
+ PortFeature - Indicates the feature selector associated
+ with the feature set request.
+
Returns:
-
- EFI_SUCCESS
- The feature specified by PortFeature was set for the
+
+ EFI_SUCCESS
+ The feature specified by PortFeature was set for the
USB root hub port specified by PortNumber.
- EFI_INVALID_PARAMETER
+ EFI_INVALID_PARAMETER
PortNumber is invalid or PortFeature is invalid.
EFI_DEVICE_ERROR
Can't read register
-
+
--*/
{
EFI_STATUS Status;
@@ -3141,30 +3141,30 @@ UsbVirtualHcClearRootHubPortFeature ( IN EFI_USB_PORT_FEATURE PortFeature
)
/*++
-
+
Routine Description:
-
+
Virtual interface to clears a feature for the specified root hub port
for both Hc2 and Hc protocol.
-
+
Arguments:
-
+
UsbBusDev - A pointer to bus controller of the device.
- PortNumber - Specifies the root hub port whose feature
+ PortNumber - Specifies the root hub port whose feature
is requested to be cleared.
- PortFeature - Indicates the feature selector associated with the
+ PortFeature - Indicates the feature selector associated with the
feature clear request.
-
+
Returns:
-
- EFI_SUCCESS
- The feature specified by PortFeature was cleared for the
+
+ EFI_SUCCESS
+ The feature specified by PortFeature was cleared for the
USB root hub port specified by PortNumber.
- EFI_INVALID_PARAMETER
+ EFI_INVALID_PARAMETER
PortNumber is invalid or PortFeature is invalid.
EFI_DEVICE_ERROR
Can't read register
-
+
--*/
{
EFI_STATUS Status;
@@ -3204,48 +3204,48 @@ UsbVirtualHcControlTransfer ( OUT UINT32 *TransferResult
)
/*++
-
+
Routine Description:
-
+
Virtual interface to submits control transfer to a target USB device
for both Hc2 and Hc protocol.
-
+
Arguments:
-
+
UsbBusDev - A pointer to bus controller of the device.
DeviceAddress - Represents the address of the target device on the USB,
which is assigned during USB enumeration.
DeviceSpeed - Indicates target device speed.
- MaximumPacketLength - Indicates the maximum packet size that the
- default control transfer endpoint is capable of
+ MaximumPacketLength - Indicates the maximum packet size that the
+ default control transfer endpoint is capable of
sending or receiving.
- Request - A pointer to the USB device request that will be sent
- to the USB device.
+ Request - A pointer to the USB device request that will be sent
+ to the USB device.
TransferDirection - Specifies the data direction for the transfer.
- There are three values available, DataIn, DataOut
+ There are three values available, DataIn, DataOut
and NoData.
- Data - A pointer to the buffer of data that will be transmitted
+ Data - A pointer to the buffer of data that will be transmitted
to USB device or received from USB device.
- DataLength - Indicates the size, in bytes, of the data buffer
+ DataLength - Indicates the size, in bytes, of the data buffer
specified by Data.
- TimeOut - Indicates the maximum time, in microseconds,
+ TimeOut - Indicates the maximum time, in microseconds,
which the transfer is allowed to complete.
Translator - A pointr to the transaction translator data.
- TransferResult - A pointer to the detailed result information generated
+ TransferResult - A pointer to the detailed result information generated
by this control transfer.
-
+
Returns:
-
- EFI_SUCCESS
+
+ EFI_SUCCESS
The control transfer was completed successfully.
- EFI_OUT_OF_RESOURCES
+ EFI_OUT_OF_RESOURCES
The control transfer could not be completed due to a lack of resources.
- EFI_INVALID_PARAMETER
+ EFI_INVALID_PARAMETER
Some parameters are invalid.
- EFI_TIMEOUT
+ EFI_TIMEOUT
The control transfer failed due to timeout.
- EFI_DEVICE_ERROR
- The control transfer failed due to host controller or device error.
+ EFI_DEVICE_ERROR
+ The control transfer failed due to host controller or device error.
Caller should check TranferResult for detailed error information.
--*/
@@ -3305,55 +3305,55 @@ UsbVirtualHcBulkTransfer ( OUT UINT32 *TransferResult
)
/*++
-
+
Routine Description:
-
+
Virtual interface to submits bulk transfer to a bulk endpoint of a USB device
both for Hc2 and Hc protocol.
-
+
Arguments:
-
+
UsbBusDev - A pointer to bus controller of the device.
DeviceAddress - Represents the address of the target device on the USB,
- which is assigned during USB enumeration.
- EndPointAddress - The combination of an endpoint number and an
- endpoint direction of the target USB device.
- Each endpoint address supports data transfer in
- one direction except the control endpoint
- (whose default endpoint address is 0).
- It is the caller's responsibility to make sure that
- the EndPointAddress represents a bulk endpoint.
+ which is assigned during USB enumeration.
+ EndPointAddress - The combination of an endpoint number and an
+ endpoint direction of the target USB device.
+ Each endpoint address supports data transfer in
+ one direction except the control endpoint
+ (whose default endpoint address is 0).
+ It is the caller's responsibility to make sure that
+ the EndPointAddress represents a bulk endpoint.
DeviceSpeed - Indicates device speed. The supported values are EFI_USB_SPEED_FULL
and EFI_USB_SPEED_HIGH.
MaximumPacketLength - Indicates the maximum packet size the target endpoint
- is capable of sending or receiving.
+ 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.
+ Data - Array of pointers to the buffers of data that will be transmitted
+ to USB device or received from USB device.
DataLength - When input, indicates the size, in bytes, of the data buffer
- specified by Data. When output, indicates the actually
- transferred data size.
- DataToggle - A pointer to the data toggle value. On input, it indicates
+ specified by Data. When output, indicates the actually
+ transferred data size.
+ DataToggle - A pointer to the data toggle value. On input, it indicates
the initial data toggle value the bulk transfer should adopt;
- on output, it is updated to indicate the data toggle value
- of the subsequent bulk transfer.
- Translator - A pointr to the transaction translator data.
- TimeOut - Indicates the maximum time, in microseconds, which the
- transfer is allowed to complete.
- TransferResult - A pointer to the detailed result information of the
+ on output, it is updated to indicate the data toggle value
+ of the subsequent bulk transfer.
+ Translator - A pointr to the transaction translator data.
+ TimeOut - Indicates the maximum time, in microseconds, which the
+ transfer is allowed to complete.
+ TransferResult - A pointer to the detailed result information of the
bulk transfer.
Returns:
-
- EFI_SUCCESS
+
+ EFI_SUCCESS
The bulk transfer was completed successfully.
- EFI_OUT_OF_RESOURCES
+ EFI_OUT_OF_RESOURCES
The bulk transfer could not be submitted due to lack of resource.
- EFI_INVALID_PARAMETER
+ EFI_INVALID_PARAMETER
Some parameters are invalid.
- EFI_TIMEOUT
+ EFI_TIMEOUT
The bulk transfer failed due to timeout.
- EFI_DEVICE_ERROR
+ EFI_DEVICE_ERROR
The bulk transfer failed due to host controller or device error.
Caller should check TranferResult for detailed error information.
@@ -3412,63 +3412,63 @@ UsbVirtualHcAsyncInterruptTransfer ( IN VOID *Context OPTIONAL
)
/*++
-
+
Routine Description:
-
- Virtual interface to submits an asynchronous interrupt transfer to an
+
+ Virtual interface to submits an asynchronous interrupt transfer to an
interrupt endpoint of a USB device for both Hc2 and Hc protocol.
-
+
Arguments:
-
+
UsbBusDev - A pointer to bus controller of the device.
DeviceAddress - Represents the address of the target device on the USB,
- which is assigned during USB enumeration.
- EndPointAddress - The combination of an endpoint number and an endpoint
- direction of the target USB device. Each endpoint address
- supports data transfer in one direction except the
- control endpoint (whose default endpoint address is 0).
- It is the caller's responsibility to make sure that
- the EndPointAddress represents an interrupt endpoint.
+ which is assigned during USB enumeration.
+ EndPointAddress - The combination of an endpoint number and an endpoint
+ direction of the target USB device. Each endpoint address
+ supports data transfer in one direction except the
+ control endpoint (whose default endpoint address is 0).
+ It is the caller's responsibility to make sure that
+ the EndPointAddress represents an interrupt endpoint.
DeviceSpeed - Indicates device speed.
MaximumPacketLength - Indicates the maximum packet size the target endpoint
- is capable of sending or receiving.
+ is capable of sending or receiving.
IsNewTransfer - If TRUE, an asynchronous interrupt pipe is built between
- the host and the target interrupt endpoint.
- If FALSE, the specified asynchronous interrupt pipe
- is canceled.
- DataToggle - A pointer to the data toggle value. On input, it is valid
- when IsNewTransfer is TRUE, and it indicates the initial
- data toggle value the asynchronous interrupt transfer
- should adopt.
- On output, it is valid when IsNewTransfer is FALSE,
- and it is updated to indicate the data toggle value of
- the subsequent asynchronous interrupt transfer.
- PollingInterval - Indicates the interval, in milliseconds, that the
- asynchronous interrupt transfer is polled.
- This parameter is required when IsNewTransfer is TRUE.
- DataLength - Indicates the length of data to be received at the
- rate specified by PollingInterval from the target
- asynchronous interrupt endpoint. This parameter
- is only required when IsNewTransfer is TRUE.
+ the host and the target interrupt endpoint.
+ If FALSE, the specified asynchronous interrupt pipe
+ is canceled.
+ DataToggle - A pointer to the data toggle value. On input, it is valid
+ when IsNewTransfer is TRUE, and it indicates the initial
+ data toggle value the asynchronous interrupt transfer
+ should adopt.
+ On output, it is valid when IsNewTransfer is FALSE,
+ and it is updated to indicate the data toggle value of
+ the subsequent asynchronous interrupt transfer.
+ PollingInterval - Indicates the interval, in milliseconds, that the
+ asynchronous interrupt transfer is polled.
+ This parameter is required when IsNewTransfer is TRUE.
+ DataLength - Indicates the length of data to be received at the
+ rate specified by PollingInterval from the target
+ asynchronous interrupt endpoint. This parameter
+ is only required when IsNewTransfer is TRUE.
Translator - A pointr to the transaction translator data.
- CallBackFunction - The Callback function.This function is called at the
- rate specified by PollingInterval.This parameter is
- only required when IsNewTransfer is TRUE.
+ CallBackFunction - The Callback function.This function is called at the
+ rate specified by PollingInterval.This parameter is
+ only required when IsNewTransfer is TRUE.
Context - The context that is passed to the CallBackFunction.
- This is an optional parameter and may be NULL.
-
+
Returns:
-
- EFI_SUCCESS
- The asynchronous interrupt transfer request has been successfully
+
+ EFI_SUCCESS
+ The asynchronous interrupt transfer request has been successfully
submitted or canceled.
- EFI_INVALID_PARAMETER
+ EFI_INVALID_PARAMETER
Some parameters are invalid.
- EFI_OUT_OF_RESOURCES
- The request could not be completed due to a lack of resources.
+ EFI_OUT_OF_RESOURCES
+ The request could not be completed due to a lack of resources.
EFI_DEVICE_ERROR
Can't read register
-
+
--*/
{
EFI_STATUS Status;
@@ -3527,58 +3527,58 @@ UsbVirtualHcSyncInterruptTransfer ( OUT UINT32 *TransferResult
)
/*++
-
+
Routine Description:
-
- Vitual interface to submits synchronous interrupt transfer to an interrupt endpoint
+
+ Vitual interface to submits synchronous interrupt transfer to an interrupt endpoint
of a USB device for both Hc2 and Hc protocol.
-
+
Arguments:
-
+
UsbBusDev - A pointer to bus controller of the device.
- DeviceAddress - Represents the address of the target device on the USB,
+ DeviceAddress - Represents the address of the target device on the USB,
which is assigned during USB enumeration.
- EndPointAddress - The combination of an endpoint number and an endpoint
- direction of the target USB device. Each endpoint
- address supports data transfer in one direction
- except the control endpoint (whose default
+ EndPointAddress - The combination of an endpoint number and an endpoint
+ direction of the target USB device. Each endpoint
+ address supports data transfer in one direction
+ except the control endpoint (whose default
endpoint address is 0). It is the caller's responsibility
- to make sure that the EndPointAddress represents
- an interrupt endpoint.
+ to make sure that the EndPointAddress represents
+ an interrupt endpoint.
DeviceSpeed - Indicates device speed.
- MaximumPacketLength - Indicates the maximum packet size the target endpoint
+ MaximumPacketLength - Indicates the maximum packet size the target endpoint
is capable of sending or receiving.
- Data - A pointer to the buffer of data that will be transmitted
+ Data - A pointer to the 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 specified
+ DataLength - On input, the size, in bytes, of the data buffer specified
by Data. On output, the number of bytes transferred.
DataToggle - A pointer to the data toggle value. On input, it indicates
- the initial data toggle value the synchronous interrupt
- transfer should adopt;
- on output, it is updated to indicate the data toggle value
- of the subsequent synchronous interrupt transfer.
- TimeOut - Indicates the maximum time, in microseconds, which the
+ the initial data toggle value the synchronous interrupt
+ transfer should adopt;
+ on output, it is updated to indicate the data toggle value
+ of the subsequent synchronous interrupt transfer.
+ TimeOut - Indicates the maximum time, in microseconds, which the
transfer is allowed to complete.
Translator - A pointr to the transaction translator data.
- TransferResult - A pointer to the detailed result information from
- the synchronous interrupt transfer.
+ TransferResult - A pointer to the detailed result information from
+ the synchronous interrupt transfer.
Returns:
-
- EFI_SUCCESS
+
+ EFI_SUCCESS
The synchronous interrupt transfer was completed successfully.
- EFI_OUT_OF_RESOURCES
- The synchronous interrupt transfer could not be submitted due
+ EFI_OUT_OF_RESOURCES
+ The synchronous interrupt transfer could not be submitted due
to lack of resource.
- EFI_INVALID_PARAMETER
+ EFI_INVALID_PARAMETER
Some parameters are invalid.
- EFI_TIMEOUT
+ EFI_TIMEOUT
The synchronous interrupt transfer failed due to timeout.
- EFI_DEVICE_ERROR
- The synchronous interrupt transfer failed due to host controller
- or device error. Caller should check TranferResult for detailed
- error information.
-
+ EFI_DEVICE_ERROR
+ The synchronous interrupt transfer failed due to host controller
+ or device error. Caller should check TranferResult for detailed
+ error information.
+
--*/
{
EFI_STATUS Status;
@@ -3634,34 +3634,34 @@ UsbVirtualHcIsochronousTransfer ( OUT UINT32 *TransferResult
)
/*++
-
+
Routine Description:
-
+
Virtual interface to submits isochronous transfer to a target USB device
for both Hc2 and Hc protocol.
-
+
Arguments:
-
+
UsbBusDev - A pointer to bus controller of the device.
DeviceAddress - Represents the address of the target device on the USB,
which is assigned during USB enumeration.
EndPointAddress - End point address
DeviceSpeed - Indicates device speed.
- MaximumPacketLength - Indicates the maximum packet size that the
- default control transfer endpoint is capable of
+ MaximumPacketLength - Indicates the maximum packet size that the
+ default control transfer 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
+ Data - Array of pointers to the buffers of data that will be
transmitted to USB device or received from USB device.
- DataLength - Indicates the size, in bytes, of the data buffer
+ DataLength - Indicates the size, in bytes, of the data buffer
specified by Data.
Translator - A pointr to the transaction translator data.
- TransferResult - A pointer to the detailed result information generated
- by this control transfer.
-
+ TransferResult - A pointer to the detailed result information generated
+ by this control transfer.
+
Returns:
-
- EFI_UNSUPPORTED
+
+ EFI_UNSUPPORTED
--*/
{
@@ -3684,34 +3684,34 @@ UsbVirtualHcAsyncIsochronousTransfer ( IN VOID *Context
)
/*++
-
+
Routine Description:
-
+
Vitual interface to submits Async isochronous transfer to a target USB device
for both Hc2 and Hc protocol.
-
+
Arguments:
-
+
UsbBusDev - A pointer to bus controller of the device.
DeviceAddress - Represents the address of the target device on the USB,
which is assigned during USB enumeration.
EndPointAddress - End point address
DeviceSpeed - Indicates device speed.
- MaximumPacketLength - Indicates the maximum packet size that the
- default control transfer endpoint is capable of
+ MaximumPacketLength - Indicates the maximum packet size that the
+ default control transfer 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
+ Data - Array of pointers to the buffers of data that will be transmitted
to USB device or received from USB device.
- DataLength - Indicates the size, in bytes, of the data buffer
+ DataLength - Indicates the size, in bytes, of the data buffer
specified by Data.
Translator - A pointr to the transaction translator data.
IsochronousCallBack - When the transfer complete, the call back function will be called
Context - Pass to the call back function as parameter
-
+
Returns:
-
- EFI_UNSUPPORTED
+
+ EFI_UNSUPPORTED
--*/
{
|