/** @file\r
EFI_USB_HC_PROTOCOL as defined in EFI 1.10.\r
\r
- Copyright (c) 2006, Intel Corporation \r
+ The USB Host Controller Protocol is used by code, typically USB bus drivers, \r
+ running in the EFI boot services environment, to perform data transactions \r
+ over a USB bus. In addition, it provides an abstraction for the root hub of the USB bus.\r
+\r
+ Copyright (c) 2006 - 2008, 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
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: UsbHostController.h\r
-\r
**/\r
\r
#ifndef _USB_HOSTCONTROLLER_H_\r
#define _USB_HOSTCONTROLLER_H_\r
\r
+#include <Protocol/Usb2HostController.h>\r
+\r
#define EFI_USB_HC_PROTOCOL_GUID \\r
{ \\r
0xf5089266, 0x1aa0, 0x4953, {0x97, 0xd8, 0x56, 0x2f, 0x8a, 0x73, 0xb5, 0x19 } \\r
}\r
\r
-//\r
-// Forward reference for pure ANSI compatability\r
-//\r
+///\r
+/// Forward reference for pure ANSI compatability\r
+///\r
typedef struct _EFI_USB_HC_PROTOCOL EFI_USB_HC_PROTOCOL;\r
\r
//\r
**/\r
typedef\r
EFI_STATUS\r
-(EFIAPI *EFI_USB_HC_PROTOCOL_RESET) (\r
+(EFIAPI *EFI_USB_HC_PROTOCOL_RESET)(\r
IN EFI_USB_HC_PROTOCOL *This,\r
IN UINT16 Attributes\r
);\r
\r
@retval EFI_SUCCESS The state information of the host controller was returned in State.\r
@retval EFI_INVALID_PARAMETER State is NULL.\r
- @retval EFI_DEVICE_ERROR An error was encountered while attempting to retrieve the host controller¡¯s\r
+ @retval EFI_DEVICE_ERROR An error was encountered while attempting to retrieve the host controller's\r
current state. \r
\r
**/\r
typedef\r
EFI_STATUS\r
-(EFIAPI *EFI_USB_HC_PROTOCOL_GET_STATE) (\r
+(EFIAPI *EFI_USB_HC_PROTOCOL_GET_STATE)(\r
IN EFI_USB_HC_PROTOCOL *This,\r
OUT EFI_USB_HC_STATE *State\r
);\r
**/\r
typedef\r
EFI_STATUS\r
-(EFIAPI *EFI_USB_HC_PROTOCOL_SET_STATE) (\r
+(EFIAPI *EFI_USB_HC_PROTOCOL_SET_STATE)(\r
IN EFI_USB_HC_PROTOCOL *This,\r
IN EFI_USB_HC_STATE State\r
);\r
transfer endpoint is capable of sending or receiving. \r
@param Request A pointer to the USB device request that will be sent to the USB\r
device.\r
- @param TransferDirection Specifies the data direction for the transfer. \r
+ @param TransferDirection Specifies the data direction for the transfer. There are three \r
+ values available, EfiUsbDataIn, EfiUsbDataOut and EfiUsbNoData.\r
@param Data A pointer to the buffer of data that will be transmitted to USB \r
device or received from USB device. \r
@param DataLength On input, indicates the size, in bytes, of the data buffer specified\r
**/\r
typedef\r
EFI_STATUS\r
-(EFIAPI *EFI_USB_HC_PROTOCOL_CONTROL_TRANSFER) (\r
+(EFIAPI *EFI_USB_HC_PROTOCOL_CONTROL_TRANSFER)(\r
IN EFI_USB_HC_PROTOCOL *This,\r
IN UINT8 DeviceAddress,\r
IN BOOLEAN IsSlowDevice,\r
@param This A pointer to the EFI_USB_HC_PROTOCOL instance.\r
@param DeviceAddress Represents the address of the target device on the USB, which is\r
assigned during USB enumeration. \r
- @param EndPointAddress The combination of an endpoint number and an endpoint\r
- direction of the target USB device. \r
+ @param 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 control \r
+ endpoint (whose default endpoint address is 0). It is the \r
+ caller's responsibility to make sure that the EndPointAddress \r
+ represents a bulk endpoint. \r
@param MaximumPacketLength Indicates the maximum packet size that the default control \r
transfer endpoint is capable of sending or receiving. \r
@param Data A pointer to the buffer of data that will be transmitted to USB \r
**/\r
typedef\r
EFI_STATUS\r
-(EFIAPI *EFI_USB_HC_PROTOCOL_BULK_TRANSFER) (\r
+(EFIAPI *EFI_USB_HC_PROTOCOL_BULK_TRANSFER)(\r
IN EFI_USB_HC_PROTOCOL *This,\r
IN UINT8 DeviceAddress,\r
IN UINT8 EndPointAddress,\r
@param DeviceAddress Represents the address of the target device on the USB, which is\r
assigned during USB enumeration. \r
@param EndPointAddress The combination of an endpoint number and an endpoint\r
- direction of the target USB device. \r
+ direction of the target USB device. Each endpoint address\r
+ supports data transfer in one direction except the control\r
+ endpoint (whose default endpoint address is zero). It is the\r
+ caller's responsibility to make sure that the\r
+ EndPointAddress represents an interrupt endpoint. \r
@param IsSlowDevice Indicates whether the target device is slow device or full-speed\r
device. \r
@param MaximumPacketLength Indicates the maximum packet size that the default control \r
transfer endpoint is capable of sending or receiving. \r
@param IsNewTransfer If TRUE, an asynchronous interrupt pipe is built between the host \r
- and the target interrupt endpoint. If FALSE, the specified \r
- \r
- @param DataToggle A pointer to the data toggle value. \r
+ and the target interrupt endpoint. If FALSE, the specified asynchronous \r
+ interrupt pipe is canceled. If TRUE, and an interrupt transfer exists \r
+ for the target end point, then EFI_INVALID_PARAMETER is returned. \r
+ @param DataToggle A pointer to the data toggle value. On input, it is valid when \r
+ IsNewTransfer is TRUE, and it indicates the initial data toggle \r
+ value the asynchronous interrupt transfer should adopt. On output, \r
+ it is valid when IsNewTransfer is FALSE, and it is updated to indicate \r
+ the data toggle value of the subsequent asynchronous interrupt transfer. \r
@param PollingInterval Indicates the interval, in milliseconds, that the asynchronous\r
- interrupt transfer is polled. asynchronous interrupt pipe is canceled. \r
+ interrupt transfer is polled. \r
@param DataLength Indicates the length of data to be received at the rate specified by\r
PollingInterval from the target asynchronous interrupt \r
- endpoint. \r
- @param CallBackFunction The Callback function. \r
+ endpoint. This parameter is only required when IsNewTransfer is TRUE. \r
+ @param CallBackFunction The Callback function. This function is called at the rate specified by \r
+ PollingInterval. This parameter is only required when IsNewTransfer is TRUE. \r
@param Context The context that is passed to the CallBackFunction.\r
\r
@retval EFI_SUCCESS The asynchronous interrupt transfer request has been successfully\r
**/\r
typedef\r
EFI_STATUS\r
-(EFIAPI *EFI_USB_HC_PROTOCOL_ASYNC_INTERRUPT_TRANSFER) (\r
+(EFIAPI *EFI_USB_HC_PROTOCOL_ASYNC_INTERRUPT_TRANSFER)(\r
IN EFI_USB_HC_PROTOCOL *This,\r
IN UINT8 DeviceAddress,\r
IN UINT8 EndPointAddress,\r
@param DeviceAddress Represents the address of the target device on the USB, which is\r
assigned during USB enumeration. \r
@param EndPointAddress The combination of an endpoint number and an endpoint\r
- direction of the target USB device. \r
+ direction of the target USB device. Each endpoint address\r
+ supports data transfer in one direction except the control\r
+ endpoint (whose default endpoint address is zero). It is the\r
+ caller's responsibility to make sure that the\r
+ EndPointAddress represents an interrupt endpoint. \r
@param IsSlowDevice Indicates whether the target device is slow device or full-speed\r
device. \r
@param MaximumPacketLength Indicates the maximum packet size that the default control \r
device or received from USB device. asynchronous interrupt pipe is canceled. \r
@param DataLength On input, the size, in bytes, of the data buffer specified by Data.\r
On output, the number of bytes transferred. \r
- @param DataToggle A pointer to the data toggle value. \r
+ @param DataToggle A pointer to the data toggle value. On input, it indicates the initial \r
+ data toggle value the synchronous interrupt transfer should adopt; \r
+ on output, it is updated to indicate the data toggle value of the \r
+ subsequent synchronous interrupt transfer. \r
@param TimeOut Indicates the maximum time, in milliseconds, which the transfer \r
is allowed to complete. \r
@param TransferResult A pointer to the detailed result information from the synchronous\r
**/\r
typedef\r
EFI_STATUS\r
-(EFIAPI *EFI_USB_HC_PROTOCOL_SYNC_INTERRUPT_TRANSFER) (\r
+(EFIAPI *EFI_USB_HC_PROTOCOL_SYNC_INTERRUPT_TRANSFER)(\r
IN EFI_USB_HC_PROTOCOL *This,\r
IN UINT8 DeviceAddress,\r
IN UINT8 EndPointAddress,\r
@param DeviceAddress Represents the address of the target device on the USB, which is\r
assigned during USB enumeration. \r
@param EndPointAddress The combination of an endpoint number and an endpoint\r
- direction of the target USB device. \r
+ direction of the target USB device. Each endpoint address\r
+ supports data transfer in one direction except the control\r
+ endpoint (whose default endpoint address is 0). It is the caller's\r
+ responsibility to make sure that the EndPointAddress\r
+ represents an isochronous endpoint. \r
@param MaximumPacketLength Indicates the maximum packet size that the default control \r
transfer endpoint is capable of sending or receiving. \r
@param Data A pointer to the buffer of data that will be transmitted to USB\r
**/\r
typedef\r
EFI_STATUS\r
-(EFIAPI *EFI_USB_HC_PROTOCOL_ISOCHRONOUS_TRANSFER) (\r
+(EFIAPI *EFI_USB_HC_PROTOCOL_ISOCHRONOUS_TRANSFER)(\r
IN EFI_USB_HC_PROTOCOL *This,\r
IN UINT8 DeviceAddress,\r
IN UINT8 EndPointAddress,\r
@param DeviceAddress Represents the address of the target device on the USB, which is\r
assigned during USB enumeration. \r
@param EndPointAddress The combination of an endpoint number and an endpoint\r
- direction of the target USB device. \r
+ direction of the target USB device. Each endpoint address\r
+ supports data transfer in one direction except the control\r
+ endpoint (whose default endpoint address is zero). It is the\r
+ caller's responsibility to make sure that the\r
+ EndPointAddress represents an isochronous endpoint. \r
@param MaximumPacketLength Indicates the maximum packet size that the default control \r
- transfer endpoint is capable of sending or receiving. \r
+ transfer endpoint is capable of sending or receiving. For isochronous \r
+ endpoints, this value is used to reserve the bus time in the schedule, \r
+ required for the perframe data payloads. The pipe may, on an ongoing basis,\r
+ actually use less bandwidth than that reserved. \r
@param Data A pointer to the buffer of data that will be transmitted to USB\r
device or received from USB device. asynchronous interrupt pipe is canceled. \r
@param DataLength Specifies the length, in bytes, of the data to be sent to or received\r
from the USB device. \r
- @param IsochronousCallback The Callback function.\r
+ @param IsochronousCallback The Callback function.This function is called if the requested\r
+ isochronous transfer is completed.\r
@param Context Data passed to the IsochronousCallback function. This is\r
an optional parameter and may be NULL.\r
\r
**/\r
typedef\r
EFI_STATUS\r
-(EFIAPI *EFI_USB_HC_PROTOCOL_ASYNC_ISOCHRONOUS_TRANSFER) (\r
+(EFIAPI *EFI_USB_HC_PROTOCOL_ASYNC_ISOCHRONOUS_TRANSFER)(\r
IN EFI_USB_HC_PROTOCOL *This,\r
IN UINT8 DeviceAddress,\r
IN UINT8 EndPointAddress,\r
**/\r
typedef\r
EFI_STATUS\r
-(EFIAPI *EFI_USB_HC_PROTOCOL_GET_ROOTHUB_PORT_NUMBER) (\r
+(EFIAPI *EFI_USB_HC_PROTOCOL_GET_ROOTHUB_PORT_NUMBER)(\r
IN EFI_USB_HC_PROTOCOL *This,\r
OUT UINT8 *PortNumber\r
);\r
\r
@param This A pointer to the EFI_USB_HC_PROTOCOL instance.\r
@param PortNumber Specifies the root hub port from which the status is to be retrieved.\r
- This value is zero based.\r
+ This value is zero based. For example, if a root hub has two ports,\r
+ then the first port is numbered 0, and the second port is\r
+ numbered 1.\r
@param PortStatus A pointer to the current port status bits and port status change bits. \r
\r
@retval EFI_SUCCESS The status of the USB root hub port specified by PortNumber\r
**/\r
typedef\r
EFI_STATUS\r
-(EFIAPI *EFI_USB_HC_PROTOCOL_GET_ROOTHUB_PORT_STATUS) (\r
+(EFIAPI *EFI_USB_HC_PROTOCOL_GET_ROOTHUB_PORT_STATUS)(\r
IN EFI_USB_HC_PROTOCOL *This,\r
IN UINT8 PortNumber,\r
OUT EFI_USB_PORT_STATUS *PortStatus\r
\r
@param This A pointer to the EFI_USB_HC_PROTOCOL instance.\r
@param PortNumber Specifies the root hub port from which the status is to be retrieved.\r
- This value is zero based.\r
+ This value is zero based. For example, if a root hub has two ports,\r
+ then the first port is numbered 0, and the second port is\r
+ numbered 1.\r
@param PortFeature Indicates the feature selector associated with the feature set\r
request.\r
\r
**/\r
typedef\r
EFI_STATUS\r
-(EFIAPI *EFI_USB_HC_PROTOCOL_SET_ROOTHUB_PORT_FEATURE) (\r
+(EFIAPI *EFI_USB_HC_PROTOCOL_SET_ROOTHUB_PORT_FEATURE)(\r
IN EFI_USB_HC_PROTOCOL *This,\r
IN UINT8 PortNumber,\r
IN EFI_USB_PORT_FEATURE PortFeature\r
Clears a feature for the specified root hub port.\r
\r
@param This A pointer to the EFI_USB_HC_PROTOCOL instance.\r
- @param PortNumber Specifies the root hub port from which the status is to be cleared.\r
- This value is zero based.\r
+ @param PortNumber Specifies the root hub port from which the status is to be retrieved.\r
+ This value is zero based. For example, if a root hub has two ports,\r
+ then the first port is numbered 0, and the second port is\r
+ numbered 1.\r
@param PortFeature Indicates the feature selector associated with the feature clear\r
request.\r
\r
**/\r
typedef\r
EFI_STATUS\r
-(EFIAPI *EFI_USB_HC_PROTOCOL_CLEAR_ROOTHUB_PORT_FEATURE) (\r
+(EFIAPI *EFI_USB_HC_PROTOCOL_CLEAR_ROOTHUB_PORT_FEATURE)(\r
IN EFI_USB_HC_PROTOCOL *This,\r
IN UINT8 PortNumber,\r
IN EFI_USB_PORT_FEATURE PortFeature\r
);\r
\r
+\r
+///\r
+/// The EFI_USB_HC_PROTOCOL provides USB host controller management, basic data transactions\r
+/// over a USB bus, and USB root hub access. A device driver that wishes to manage a USB bus in a\r
+/// system retrieves the EFI_USB_HC_PROTOCOL instance that is associated with the USB bus to be\r
+/// managed. A device handle for a USB host controller will minimally contain an\r
+/// EFI_DEVICE_PATH_PROTOCOL instance, and an EFI_USB_HC_PROTOCOL instance. \r
+///\r
struct _EFI_USB_HC_PROTOCOL {\r
EFI_USB_HC_PROTOCOL_RESET Reset;\r
EFI_USB_HC_PROTOCOL_GET_STATE GetState;\r
EFI_USB_HC_PROTOCOL_GET_ROOTHUB_PORT_STATUS GetRootHubPortStatus;\r
EFI_USB_HC_PROTOCOL_SET_ROOTHUB_PORT_FEATURE SetRootHubPortFeature;\r
EFI_USB_HC_PROTOCOL_CLEAR_ROOTHUB_PORT_FEATURE ClearRootHubPortFeature;\r
+ ///\r
+ /// The major revision number of the USB host controller. The revision information \r
+ /// indicates the release of the Universal Serial Bus Specification with which the \r
+ /// host controller is compliant.\r
+ /// \r
UINT16 MajorRevision;\r
+ ///\r
+ /// The minor revision number of the USB host controller. The revision information \r
+ /// indicates the release of the Universal Serial Bus Specification with which the \r
+ /// host controller is compliant. \r
+ /// \r
UINT16 MinorRevision;\r
};\r
\r