+++ /dev/null
-/** @file\r
- EFI_USB_HC_PROTOCOL as defined in EFI 1.10.\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
-\r
- Module Name: UsbHostController.h\r
-\r
-**/\r
-\r
-#ifndef _USB_HOSTCONTROLLER_H_\r
-#define _USB_HOSTCONTROLLER_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
-typedef struct _EFI_USB_HC_PROTOCOL EFI_USB_HC_PROTOCOL;\r
-\r
-//\r
-// Protocol definitions\r
-//\r
-\r
-/** \r
- Provides software reset for the USB host controller.\r
- \r
- @param This A pointer to the EFI_USB_HC_PROTOCOL instance.\r
- @param Attributes A bit mask of the reset operation to perform.\r
- \r
- @retval EFI_SUCCESS The reset operation succeeded.\r
- @retval EFI_UNSUPPORTED The type of reset specified by Attributes is not currently supported\r
- by the host controller hardware. \r
- @retval EFI_INVALID_PARAMETER Attributes is not valid.\r
- @retval EFI_DEVICE_ERROR An error was encountered while attempting to perform the reset operation.\r
- \r
-**/\r
-typedef\r
-EFI_STATUS\r
-(EFIAPI *EFI_USB_HC_PROTOCOL_RESET) (\r
- IN EFI_USB_HC_PROTOCOL *This,\r
- IN UINT16 Attributes\r
- );\r
-\r
-/** \r
- Retrieves current state of the USB host controller.\r
- \r
- @param This A pointer to the EFI_USB_HC_PROTOCOL instance.\r
- @param State A pointer to the EFI_USB_HC_STATE data structure that\r
- indicates current state of the USB host controller. \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
- current state. \r
- \r
-**/\r
-typedef\r
-EFI_STATUS\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
-/** \r
- Sets the USB host controller to a specific state.\r
- \r
- @param This A pointer to the EFI_USB_HC_PROTOCOL instance.\r
- @param State Indicates the state of the host controller that will be set. \r
- \r
- @retval EFI_SUCCESS The USB host controller was successfully placed in the state specified by\r
- State. \r
- @retval EFI_INVALID_PARAMETER State is NULL.\r
- @retval EFI_DEVICE_ERROR Failed to set the state specified by State due to device error. \r
- \r
-**/\r
-typedef\r
-EFI_STATUS\r
-(EFIAPI *EFI_USB_HC_PROTOCOL_SET_STATE) (\r
- IN EFI_USB_HC_PROTOCOL *This,\r
- IN EFI_USB_HC_STATE State\r
- );\r
-\r
-/** \r
- Submits control transfer to a target USB device.\r
- \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 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 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 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
- by Data. On output, indicates the amount of data actually \r
- transferred. \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 generated by this \r
- control transfer.\r
- \r
- @retval EFI_SUCCESS The control transfer was completed successfully.\r
- @retval EFI_OUT_OF_RESOURCES The control transfer could not be completed due to a lack of resources. \r
- @retval EFI_INVALID_PARAMETER Some parameters are invalid.\r
- @retval EFI_TIMEOUT The control transfer failed due to timeout.\r
- @retval EFI_DEVICE_ERROR The control transfer failed due to host controller or device error.\r
- \r
-**/\r
-typedef\r
-EFI_STATUS\r
-(EFIAPI *EFI_USB_HC_PROTOCOL_CONTROL_TRANSFER) (\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
-/** \r
- Submits bulk transfer to a bulk endpoint of a USB device.\r
- \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 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
- device or received from USB device. \r
- @param DataLength On input, indicates the size, in bytes, of the data buffer specified\r
- by Data. On output, indicates the amount of data actually \r
- transferred. \r
- @param DataToggle A pointer to the data toggle value. \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 of the bulk transfer.\r
- \r
- @retval EFI_SUCCESS The bulk transfer was completed successfully.\r
- @retval EFI_OUT_OF_RESOURCES The bulk transfer could not be completed due to a lack of resources. \r
- @retval EFI_INVALID_PARAMETER Some parameters are invalid.\r
- @retval EFI_TIMEOUT The bulk transfer failed due to timeout.\r
- @retval EFI_DEVICE_ERROR The bulk transfer failed due to host controller or device error.\r
- \r
-**/\r
-typedef\r
-EFI_STATUS\r
-(EFIAPI *EFI_USB_HC_PROTOCOL_BULK_TRANSFER) (\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
-/** \r
- Submits an asynchronous interrupt transfer to an interrupt endpoint of a USB device.\r
- \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 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
- @param DataToggle A pointer to the data toggle value. \r
- @param PollingInterval Indicates the interval, in milliseconds, that the asynchronous\r
- interrupt transfer is polled. asynchronous interrupt pipe is canceled. \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
- @param Context The context that is passed to the CallBackFunction.\r
- \r
- @retval EFI_SUCCESS The asynchronous interrupt transfer request has been successfully\r
- submitted or canceled. \r
- @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources. \r
- @retval EFI_INVALID_PARAMETER Some parameters are invalid.\r
- @retval EFI_TIMEOUT The bulk transfer failed due to timeout.\r
- @retval EFI_DEVICE_ERROR The bulk transfer failed due to host controller or device error.\r
- \r
-**/\r
-typedef\r
-EFI_STATUS\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
- IN BOOLEAN IsSlowDevice,\r
- IN UINT8 MaxiumPacketLength,\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
-/** \r
- Submits synchronous interrupt transfer to an interrupt endpoint of a USB device.\r
- \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 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 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 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 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
- interrupt transfer.\r
- \r
- @retval EFI_SUCCESS The synchronous interrupt transfer was completed successfully.\r
- @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources. \r
- @retval EFI_INVALID_PARAMETER Some parameters are invalid.\r
- @retval EFI_TIMEOUT The synchronous interrupt transfer failed due to timeout.\r
- @retval EFI_DEVICE_ERROR The synchronous interrupt transfer failed due to host controller or device error.\r
- \r
-**/\r
-typedef\r
-EFI_STATUS\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
- 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
-/** \r
- Submits isochronous transfer to an isochronous endpoint of a USB device.\r
- \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 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
- 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 TransferResult A pointer to the detailed result information from the isochronous\r
- transfer.\r
- \r
- @retval EFI_SUCCESS The isochronous transfer was completed successfully.\r
- @retval EFI_OUT_OF_RESOURCES The isochronous could not be completed due to a lack of resources. \r
- @retval EFI_INVALID_PARAMETER Some parameters are invalid.\r
- @retval EFI_TIMEOUT The isochronous transfer failed due to timeout.\r
- @retval EFI_DEVICE_ERROR The isochronous transfer failed due to host controller or device error.\r
- \r
-**/\r
-typedef\r
-EFI_STATUS\r
-(EFIAPI *EFI_USB_HC_PROTOCOL_ISOCHRONOUS_TRANSFER) (\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
-/** \r
- Submits nonblocking isochronous transfer to an isochronous endpoint of a USB device.\r
- \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 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
- 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 Context Data passed to the IsochronousCallback function. This is\r
- an optional parameter and may be NULL.\r
- \r
- @retval EFI_SUCCESS The asynchronous isochronous transfer was completed successfully.\r
- @retval EFI_OUT_OF_RESOURCES The asynchronous isochronous could not be completed due to a lack of resources. \r
- @retval EFI_INVALID_PARAMETER Some parameters are invalid.\r
- \r
-**/\r
-typedef\r
-EFI_STATUS\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
- 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
-/** \r
- Retrieves the number of root hub ports.\r
- \r
- @param This A pointer to the EFI_USB_HC_PROTOCOL instance.\r
- @param PortNumber A pointer to the number of the root hub ports. \r
- \r
- @retval EFI_SUCCESS The port number was retrieved successfully.\r
- @retval EFI_DEVICE_ERROR An error was encountered while attempting to retrieve the port number.\r
- @retval EFI_INVALID_PARAMETER PortNumber is NULL.\r
- \r
-**/\r
-typedef\r
-EFI_STATUS\r
-(EFIAPI *EFI_USB_HC_PROTOCOL_GET_ROOTHUB_PORT_NUMBER) (\r
- IN EFI_USB_HC_PROTOCOL *This,\r
- OUT UINT8 *PortNumber\r
- );\r
-\r
-/** \r
- Retrieves the current status of a USB 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 retrieved.\r
- This value is zero based.\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
- was returned in PortStatus. \r
- @retval EFI_INVALID_PARAMETER PortNumber is invalid.\r
- \r
-**/\r
-typedef\r
-EFI_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
-\r
-/** \r
- Sets 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 retrieved.\r
- This value is zero based.\r
- @param PortFeature Indicates the feature selector associated with the feature set\r
- request.\r
- \r
- @retval EFI_SUCCESS The feature specified by PortFeature was set for the USB\r
- root hub port specified by PortNumber. \r
- @retval EFI_INVALID_PARAMETER PortNumber is invalid or PortFeature is invalid for this function.\r
- \r
-**/\r
-typedef\r
-EFI_STATUS\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
- );\r
-\r
-/** \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 PortFeature Indicates the feature selector associated with the feature clear\r
- request.\r
- \r
- @retval EFI_SUCCESS The feature specified by PortFeature was cleared for the USB\r
- root hub port specified by PortNumber. \r
- @retval EFI_INVALID_PARAMETER PortNumber is invalid or PortFeature is invalid for this function.\r
- \r
-**/\r
-typedef\r
-EFI_STATUS\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
-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_SET_STATE SetState;\r
- EFI_USB_HC_PROTOCOL_CONTROL_TRANSFER ControlTransfer;\r
- EFI_USB_HC_PROTOCOL_BULK_TRANSFER BulkTransfer;\r
- EFI_USB_HC_PROTOCOL_ASYNC_INTERRUPT_TRANSFER AsyncInterruptTransfer;\r
- EFI_USB_HC_PROTOCOL_SYNC_INTERRUPT_TRANSFER SyncInterruptTransfer;\r
- EFI_USB_HC_PROTOCOL_ISOCHRONOUS_TRANSFER IsochronousTransfer;\r
- EFI_USB_HC_PROTOCOL_ASYNC_ISOCHRONOUS_TRANSFER AsyncIsochronousTransfer;\r
- EFI_USB_HC_PROTOCOL_GET_ROOTHUB_PORT_NUMBER GetRootHubPortNumber;\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
- UINT16 MajorRevision;\r
- UINT16 MinorRevision;\r
-};\r
-\r
-extern EFI_GUID gEfiUsbHcProtocolGuid;\r
-\r
-#endif\r