/** @file\r
- Common Dxe Libarary for USB.\r
+ Provides most USB APIs to support the Hid requests defined in USB Hid 1.1 spec\r
+ and the standard requests defined in USB 1.1 spec.\r
\r
- Copyright (c) 2006 - 2008, Intel Corporation<BR>\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
+Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
+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
+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
**/\r
\r
\r
#include <Protocol/UsbIo.h>\r
\r
-///\r
-/// define the timeout time as 3ms\r
-///\r
-#define TIMEOUT_VALUE 3 * 1000\r
-\r
/**\r
- Get Hid Descriptor.\r
+ Get the descriptor of the specified USB HID interface.\r
+\r
+ Submit a UsbGetHidDescriptor() request for the USB device specified by UsbIo\r
+ and Interface, and return the HID descriptor in HidDescriptor.\r
+ If UsbIo is NULL, then ASSERT().\r
+ If HidDescriptor is NULL, then ASSERT().\r
\r
- @param UsbIo A pointer to EFI_USB_IO_PROTOCOL.\r
- @param InterfaceNum Hid interface number.\r
- @param HidDescriptor Caller allocated buffer to store Usb hid descriptor if\r
- successfully returned.\r
+ @param UsbIo A pointer to the USB I/O Protocol instance for the specific USB target.\r
+ @param Interface The index of the HID interface on the USB target.\r
+ @param HidDescriptor Pointer to the USB HID descriptor that was retrieved from\r
+ the specified USB target and interface. Type EFI_USB_HID_DESCRIPTOR\r
+ is defined in the MDE Package Industry Standard include file Usb.h.\r
\r
- @return Status of getting HID descriptor through USB I/O\r
- protocol's UsbControlTransfer().\r
+ @retval EFI_SUCCESS The request executed successfully.\r
+ @retval EFI_TIMEOUT A timeout occurred executing the request.\r
+ @retval EFI_DEVICE_ERROR The request failed due to a device error.\r
\r
**/\r
EFI_STATUS\r
EFIAPI\r
UsbGetHidDescriptor (\r
IN EFI_USB_IO_PROTOCOL *UsbIo,\r
- IN UINT8 InterfaceNum,\r
+ IN UINT8 Interface,\r
OUT EFI_USB_HID_DESCRIPTOR *HidDescriptor\r
);\r
\r
\r
/**\r
- get Report Class descriptor.\r
+ Get the report descriptor of the specified USB HID interface.\r
+\r
+ Submit a USB get HID report descriptor request for the USB device specified by\r
+ UsbIo and Interface, and return the report descriptor in DescriptorBuffer.\r
+ If UsbIo is NULL, then ASSERT().\r
+ If DescriptorBuffer is NULL, then ASSERT().\r
\r
- @param UsbIo A pointer to EFI_USB_IO_PROTOCOL.\r
- @param InterfaceNum Report interface number.\r
- @param DescriptorSize Length of DescriptorBuffer.\r
- @param DescriptorBuffer Caller allocated buffer to store Usb report descriptor\r
- if successfully returned.\r
+ @param UsbIo A pointer to the USB I/O Protocol instance for the specific USB target.\r
+ @param Interface The index of the report interface on the USB target.\r
+ @param DescriptorLength The size, in bytes, of DescriptorBuffer.\r
+ @param DescriptorBuffer A pointer to the buffer to store the report class descriptor.\r
\r
- @return Status of getting Report Class descriptor through USB\r
- I/O protocol's UsbControlTransfer().\r
+ @retval EFI_SUCCESS The request executed successfully.\r
+ @retval EFI_OUT_OF_RESOURCES The request could not be completed because the\r
+ buffer specified by DescriptorLength and DescriptorBuffer\r
+ is not large enough to hold the result of the request.\r
+ @retval EFI_TIMEOUT A timeout occurred executing the request.\r
+ @retval EFI_DEVICE_ERROR The request failed due to a device error.\r
\r
**/\r
EFI_STATUS\r
EFIAPI\r
UsbGetReportDescriptor (\r
IN EFI_USB_IO_PROTOCOL *UsbIo,\r
- IN UINT8 InterfaceNum,\r
- IN UINT16 DescriptorSize,\r
+ IN UINT8 Interface,\r
+ IN UINT16 DescriptorLength,\r
OUT UINT8 *DescriptorBuffer\r
);\r
\r
/**\r
- Get Hid Protocol Request.\r
+ Get the HID protocol of the specified USB HID interface.\r
\r
- @param UsbIo A pointer to EFI_USB_IO_PROTOCOL.\r
- @param Interface Which interface the caller wants to get protocol.\r
- @param Protocol Protocol value returned.\r
+ Submit a USB get HID protocol request for the USB device specified by UsbIo\r
+ and Interface, and return the protocol retrieved in Protocol.\r
+ If UsbIo is NULL, then ASSERT().\r
+ If Protocol is NULL, then ASSERT().\r
\r
- @return Status of getting Protocol Request through USB I/O\r
- protocol's UsbControlTransfer().\r
+ @param UsbIo A pointer to the USB I/O Protocol instance for the specific USB target.\r
+ @param Interface The index of the report interface on the USB target.\r
+ @param Protocol A pointer to the protocol for the specified USB target.\r
+\r
+ @retval EFI_SUCCESS The request executed successfully.\r
+ @retval EFI_TIMEOUT A timeout occurred executing the request.\r
+ @retval EFI_DEVICE_ERROR The request failed due to a device error.\r
\r
**/\r
EFI_STATUS\r
UsbGetProtocolRequest (\r
IN EFI_USB_IO_PROTOCOL *UsbIo,\r
IN UINT8 Interface,\r
- IN UINT8 *Protocol\r
+ OUT UINT8 *Protocol\r
);\r
\r
/**\r
- Set Hid Protocol Request.\r
+ Set the HID protocol of the specified USB HID interface.\r
+\r
+ Submit a USB set HID protocol request for the USB device specified by UsbIo\r
+ and Interface, and set the protocol to the value specified by Protocol.\r
+ If UsbIo is NULL, then ASSERT().\r
\r
- @param UsbIo A pointer to EFI_USB_IO_PROTOCOL.\r
- @param Interface Which interface the caller wants to set protocol.\r
- @param Protocol Protocol value the caller wants to set.\r
+ @param UsbIo A pointer to the USB I/O Protocol instance for the specific USB target.\r
+ @param Interface The index of the report interface on the USB target.\r
+ @param Protocol The protocol value to set for the specified USB target.\r
\r
- @return Status of setting Protocol Request through USB I/O\r
- protocol's UsbControlTransfer().\r
+ @retval EFI_SUCCESS The request executed successfully.\r
+ @retval EFI_TIMEOUT A timeout occurred executing the request.\r
+ @retval EFI_DEVICE_ERROR The request failed due to a device error.\r
\r
**/\r
EFI_STATUS\r
);\r
\r
/**\r
- Set Idel request.\r
+ Set the idle rate of the specified USB HID report.\r
+\r
+ Submit a USB set HID report idle request for the USB device specified by UsbIo,\r
+ Interface, and ReportId, and set the idle rate to the value specified by Duration.\r
+ If UsbIo is NULL, then ASSERT().\r
\r
- @param UsbIo A pointer to EFI_USB_IO_PROTOCOL.\r
- @param Interface Which interface the caller wants to set.\r
- @param ReportId Which report the caller wants to set.\r
- @param Duration Idle rate the caller wants to set.\r
+ @param UsbIo A pointer to the USB I/O Protocol instance for the specific USB target.\r
+ @param Interface The index of the report interface on the USB target.\r
+ @param ReportId The identifier of the report to retrieve.\r
+ @param Duration The idle rate to set for the specified USB target.\r
\r
- @return Status of setting IDLE Request through USB I/O\r
- protocol's UsbControlTransfer().\r
+ @retval EFI_SUCCESS The request executed successfully.\r
+ @retval EFI_TIMEOUT A timeout occurred executing the request.\r
+ @retval EFI_DEVICE_ERROR The request failed due to a device error.\r
\r
**/\r
EFI_STATUS\r
);\r
\r
/**\r
- Get Idel request.\r
+ Get the idle rate of the specified USB HID report.\r
\r
- @param UsbIo A pointer to EFI_USB_IO_PROTOCOL.\r
- @param Interface Which interface the caller wants to get.\r
- @param ReportId Which report the caller wants to get.\r
- @param Duration Idle rate the caller wants to get.\r
+ Submit a USB get HID report idle request for the USB device specified by UsbIo,\r
+ Interface, and ReportId, and return the ide rate in Duration.\r
+ If UsbIo is NULL, then ASSERT().\r
+ If Duration is NULL, then ASSERT().\r
\r
- @return Status of getting IDLE Request through USB I/O\r
- protocol's UsbControlTransfer().\r
+ @param UsbIo A pointer to the USB I/O Protocol instance for the specific USB target.\r
+ @param Interface The index of the report interface on the USB target.\r
+ @param ReportId The identifier of the report to retrieve.\r
+ @param Duration A pointer to the idle rate retrieved from the specified USB target.\r
+\r
+ @retval EFI_SUCCESS The request executed successfully.\r
+ @retval EFI_TIMEOUT A timeout occurred executing the request.\r
+ @retval EFI_DEVICE_ERROR The request failed due to a device error.\r
\r
**/\r
EFI_STATUS\r
);\r
\r
/**\r
- Hid Set Report request.\r
+ Set the report descriptor of the specified USB HID interface.\r
+\r
+ Submit a USB set HID report request for the USB device specified by UsbIo,\r
+ Interface, ReportId, and ReportType, and set the report descriptor using the\r
+ buffer specified by ReportLength and Report.\r
+ If UsbIo is NULL, then ASSERT().\r
+ If Report is NULL, then ASSERT().\r
\r
- @param UsbIo A pointer to EFI_USB_IO_PROTOCOL.\r
- @param Interface Which interface the caller wants to set.\r
- @param ReportId Which report the caller wants to set.\r
- @param ReportType Type of report.\r
- @param ReportLen Length of report descriptor.\r
- @param Report Report Descriptor buffer.\r
+ @param UsbIo A pointer to the USB I/O Protocol instance for the specific USB target.\r
+ @param Interface The index of the report interface on the USB target.\r
+ @param ReportId The identifier of the report to retrieve.\r
+ @param ReportType The type of report to retrieve.\r
+ @param ReportLength The size, in bytes, of Report.\r
+ @param Report A pointer to the report descriptor buffer to set.\r
\r
- @return Status of setting Report Request through USB I/O\r
- protocol's UsbControlTransfer().\r
+ @retval EFI_SUCCESS The request executed successfully.\r
+ @retval EFI_TIMEOUT A timeout occurred executing the request.\r
+ @retval EFI_DEVICE_ERROR The request failed due to a device error.\r
\r
**/\r
EFI_STATUS\r
);\r
\r
/**\r
- Hid Set Report request.\r
-\r
- @param UsbIo A pointer to EFI_USB_IO_PROTOCOL.\r
- @param Interface Which interface the caller wants to set.\r
- @param ReportId Which report the caller wants to set.\r
- @param ReportType Type of report.\r
- @param ReportLen Length of report descriptor.\r
- @param Report Caller allocated buffer to store Report Descriptor.\r
-\r
- @return Status of getting Report Request through USB I/O\r
- protocol's UsbControlTransfer().\r
+ Get the report descriptor of the specified USB HID interface.\r
+\r
+ Submit a USB get HID report request for the USB device specified by UsbIo,\r
+ Interface, ReportId, and ReportType, and return the report in the buffer\r
+ specified by Report.\r
+ If UsbIo is NULL, then ASSERT().\r
+ If Report is NULL, then ASSERT().\r
+\r
+ @param UsbIo A pointer to the USB I/O Protocol instance for the specific USB target.\r
+ @param Interface The index of the report interface on the USB target.\r
+ @param ReportId The identifier of the report to retrieve.\r
+ @param ReportType The type of report to retrieve.\r
+ @param ReportLength The size, in bytes, of Report.\r
+ @param Report A pointer to the buffer to store the report descriptor.\r
+\r
+ @retval EFI_SUCCESS The request executed successfully.\r
+ @retval EFI_OUT_OF_RESOURCES The request could not be completed because the\r
+ buffer specified by ReportLength and Report is not\r
+ large enough to hold the result of the request.\r
+ @retval EFI_TIMEOUT A timeout occurred executing the request.\r
+ @retval EFI_DEVICE_ERROR The request failed due to a device error.\r
\r
**/\r
EFI_STATUS\r
EFIAPI\r
UsbGetReportRequest (\r
- IN EFI_USB_IO_PROTOCOL *UsbIo,\r
- IN UINT8 Interface,\r
- IN UINT8 ReportId,\r
- IN UINT8 ReportType,\r
- IN UINT16 ReportLen,\r
- IN UINT8 *Report\r
+ IN EFI_USB_IO_PROTOCOL *UsbIo,\r
+ IN UINT8 Interface,\r
+ IN UINT8 ReportId,\r
+ IN UINT8 ReportType,\r
+ IN UINT16 ReportLen,\r
+ OUT UINT8 *Report\r
);\r
\r
/**\r
- Usb Get Descriptor.\r
-\r
- @param UsbIo A pointer to EFI_USB_IO_PROTOCOL.\r
- @param Value Device Request Value.\r
- @param Index Device Request Index.\r
- @param DescriptorLength Descriptor Length.\r
- @param Descriptor Descriptor buffer to contain result.\r
- @param Status Transfer Status.\r
-\r
- @retval EFI_INVALID_PARAMETER Parameter is error.\r
- @retval EFI_SUCCESS Success.\r
- @retval EFI_TIMEOUT Device has no response.\r
+ Get the descriptor of the specified USB device.\r
+\r
+ Submit a USB get descriptor request for the USB device specified by UsbIo, Value,\r
+ and Index, and return the descriptor in the buffer specified by Descriptor.\r
+ The status of the transfer is returned in Status.\r
+ If UsbIo is NULL, then ASSERT().\r
+ If Descriptor is NULL, then ASSERT().\r
+ If Status is NULL, then ASSERT().\r
+\r
+ @param UsbIo A pointer to the USB I/O Protocol instance for the specific USB target.\r
+ @param Value The device request value.\r
+ @param Index The device request index.\r
+ @param DescriptorLength The size, in bytes, of Descriptor.\r
+ @param Descriptor A pointer to the descriptor buffer to get.\r
+ @param Status A pointer to the status of the transfer.\r
+\r
+ @retval EFI_SUCCESS The request executed successfully.\r
+ @retval EFI_OUT_OF_RESOURCES The request could not be completed because the\r
+ buffer specified by DescriptorLength and Descriptor\r
+ is not large enough to hold the result of the request.\r
+ @retval EFI_TIMEOUT A timeout occurred executing the request.\r
+ @retval EFI_DEVICE_ERROR The request failed due to a device error. The transfer\r
+ status is returned in Status.\r
\r
**/\r
EFI_STATUS\r
);\r
\r
/**\r
- Usb Set Descriptor.\r
-\r
- @param UsbIo A pointer to EFI_USB_IO_PROTOCOL.\r
- @param Value Device Request Value.\r
- @param Index Device Request Index.\r
- @param DescriptorLength Descriptor Length.\r
- @param Descriptor Descriptor buffer to set.\r
- @param Status Transfer Status.\r
-\r
- @retval EFI_INVALID_PARAMETER Parameter is error.\r
- @retval EFI_SUCCESS Success.\r
- @retval EFI_TIMEOUT Device has no response.\r
+ Set the descriptor of the specified USB device.\r
+\r
+ Submit a USB set descriptor request for the USB device specified by UsbIo,\r
+ Value, and Index, and set the descriptor using the buffer specified by DesriptorLength\r
+ and Descriptor. The status of the transfer is returned in Status.\r
+ If UsbIo is NULL, then ASSERT().\r
+ If Descriptor is NULL, then ASSERT().\r
+ If Status is NULL, then ASSERT().\r
+\r
+ @param UsbIo A pointer to the USB I/O Protocol instance for the specific USB target.\r
+ @param Value The device request value.\r
+ @param Index The device request index.\r
+ @param DescriptorLength The size, in bytes, of Descriptor.\r
+ @param Descriptor A pointer to the descriptor buffer to set.\r
+ @param Status A pointer to the status of the transfer.\r
+\r
+ @retval EFI_SUCCESS The request executed successfully.\r
+ @retval EFI_TIMEOUT A timeout occurred executing the request.\r
+ @retval EFI_DEVICE_ERROR The request failed due to a device error.\r
+ The transfer status is returned in Status.\r
\r
**/\r
EFI_STATUS\r
);\r
\r
/**\r
- Usb Get Device Interface.\r
+ Get the interface setting of the specified USB device.\r
+\r
+ Submit a USB get interface request for the USB device specified by UsbIo,\r
+ and Interface, and place the result in the buffer specified by AlternateSetting.\r
+ The status of the transfer is returned in Status.\r
+ If UsbIo is NULL, then ASSERT().\r
+ If AlternateSetting is NULL, then ASSERT().\r
+ If Status is NULL, then ASSERT().\r
\r
- @param UsbIo A pointer to EFI_USB_IO_PROTOCOL.\r
- @param Index Interface index value.\r
- @param AltSetting Alternate setting.\r
- @param Status Trasnsfer status.\r
+ @param UsbIo A pointer to the USB I/O Protocol instance for the specific USB target.\r
+ @param Interface The interface index value.\r
+ @param AlternateSetting A pointer to the alternate setting to be retrieved.\r
+ @param Status A pointer to the status of the transfer.\r
\r
- @retval EFI_INVALID_PARAMETER Parameter is error.\r
- @retval EFI_SUCCESS Success.\r
- @retval EFI_TIMEOUT Device has no response.\r
+ @retval EFI_SUCCESS The request executed successfully.\r
+ @retval EFI_TIMEOUT A timeout occurred executing the request.\r
+ @retval EFI_DEVICE_ERROR The request failed due to a device error.\r
+ The transfer status is returned in Status.\r
\r
**/\r
EFI_STATUS\r
EFIAPI\r
UsbGetInterface (\r
IN EFI_USB_IO_PROTOCOL *UsbIo,\r
- IN UINT16 Index,\r
- OUT UINT8 *AltSetting,\r
+ IN UINT16 Interface,\r
+ OUT UINT16 *AlternateSetting,\r
OUT UINT32 *Status\r
);\r
\r
/**\r
- Usb Set Device Interface.\r
+ Set the interface setting of the specified USB device.\r
\r
- @param UsbIo A pointer to EFI_USB_IO_PROTOCOL.\r
- @param InterfaceNo Interface Number.\r
- @param AltSetting Alternate setting.\r
- @param Status Trasnsfer status.\r
+ Submit a USB set interface request for the USB device specified by UsbIo, and\r
+ Interface, and set the alternate setting to the value specified by AlternateSetting.\r
+ The status of the transfer is returned in Status.\r
+ If UsbIo is NULL, then ASSERT().\r
+ If Status is NULL, then ASSERT().\r
\r
- @retval EFI_INVALID_PARAMETER Parameter is error.\r
- @retval EFI_SUCCESS Success.\r
- @retval EFI_TIMEOUT Device has no response.\r
+ @param UsbIo A pointer to the USB I/O Protocol instance for the specific USB target.\r
+ @param Interface The interface index value.\r
+ @param AlternateSetting The alternate setting to be set.\r
+ @param Status A pointer to the status of the transfer.\r
+\r
+ @retval EFI_SUCCESS The request executed successfully.\r
+ @retval EFI_TIMEOUT A timeout occurred executing the request.\r
+ @retval EFI_SUCCESS The request failed due to a device error.\r
+ The transfer status is returned in Status.\r
\r
**/\r
EFI_STATUS\r
EFIAPI\r
UsbSetInterface (\r
IN EFI_USB_IO_PROTOCOL *UsbIo,\r
- IN UINT16 InterfaceNo,\r
- IN UINT16 AltSetting,\r
+ IN UINT16 Interface,\r
+ IN UINT16 AlternateSetting,\r
OUT UINT32 *Status\r
);\r
\r
/**\r
- Usb Get Device Configuration.\r
+ Get the device configuration.\r
+\r
+ Submit a USB get configuration request for the USB device specified by UsbIo\r
+ and place the result in the buffer specified by ConfigurationValue. The status\r
+ of the transfer is returned in Status.\r
+ If UsbIo is NULL, then ASSERT().\r
+ If ConfigurationValue is NULL, then ASSERT().\r
+ If Status is NULL, then ASSERT().\r
\r
- @param UsbIo A pointer to EFI_USB_IO_PROTOCOL.\r
- @param ConfigValue Config Value.\r
- @param Status Transfer Status.\r
+ @param UsbIo A pointer to the USB I/O Protocol instance for the specific USB target.\r
+ @param ConfigurationValue A pointer to the device configuration to be retrieved.\r
+ @param Status A pointer to the status of the transfer.\r
\r
- @retval EFI_INVALID_PARAMETER Parameter is error.\r
- @retval EFI_SUCCESS Success.\r
- @retval EFI_TIMEOUT Device has no response.\r
+ @retval EFI_SUCCESS The request executed successfully.\r
+ @retval EFI_TIMEOUT A timeout occurred executing the request.\r
+ @retval EFI_DEVICE_ERROR The request failed due to a device error.\r
+ The transfer status is returned in Status.\r
\r
**/\r
EFI_STATUS\r
EFIAPI\r
UsbGetConfiguration (\r
IN EFI_USB_IO_PROTOCOL *UsbIo,\r
- OUT UINT8 *ConfigValue,\r
+ OUT UINT16 *ConfigurationValue,\r
OUT UINT32 *Status\r
);\r
\r
/**\r
- Usb Set Device Configuration.\r
+ Set the device configuration.\r
\r
- @param UsbIo A pointer to EFI_USB_IO_PROTOCOL.\r
- @param Value Configuration Value to set.\r
- @param Status Transfer status.\r
+ Submit a USB set configuration request for the USB device specified by UsbIo\r
+ and set the device configuration to the value specified by ConfigurationValue.\r
+ The status of the transfer is returned in Status.\r
+ If UsbIo is NULL, then ASSERT().\r
+ If Status is NULL, then ASSERT().\r
\r
- @retval EFI_INVALID_PARAMETER Parameter is error.\r
- @retval EFI_SUCCESS Success.\r
- @retval EFI_TIMEOUT Device has no response.\r
+ @param UsbIo A pointer to the USB I/O Protocol instance for the specific USB target.\r
+ @param ConfigurationValue The device configuration value to be set.\r
+ @param Status A pointer to the status of the transfer.\r
+\r
+ @retval EFI_SUCCESS The request executed successfully.\r
+ @retval EFI_TIMEOUT A timeout occurred executing the request.\r
+ @retval EFI_DEVICE_ERROR The request failed due to a device error.\r
+ The transfer status is returned in Status.\r
\r
**/\r
EFI_STATUS\r
EFIAPI\r
UsbSetConfiguration (\r
IN EFI_USB_IO_PROTOCOL *UsbIo,\r
- IN UINT16 Value,\r
+ IN UINT16 ConfigurationValue,\r
OUT UINT32 *Status\r
);\r
\r
/**\r
- Usb Set Device Feature.\r
-\r
- @param UsbIo A pointer to EFI_USB_IO_PROTOCOL.\r
- @param Recipient Interface/Device/Endpoint.\r
- @param Value Request value.\r
- @param Target Request Index.\r
- @param Status Transfer status.\r
-\r
- @retval EFI_INVALID_PARAMETER Parameter is error.\r
- @retval EFI_SUCCESS Success.\r
- @retval EFI_TIMEOUT Device has no response.\r
+ Set the specified feature of the specified device.\r
+\r
+ Submit a USB set device feature request for the USB device specified by UsbIo,\r
+ Recipient, and Target to the value specified by Value. The status of the\r
+ transfer is returned in Status.\r
+ If UsbIo is NULL, then ASSERT().\r
+ If Status is NULL, then ASSERT().\r
+\r
+ @param UsbIo A pointer to the USB I/O Protocol instance for the specific USB target.\r
+ @param Recipient The USB data recipient type (i.e. Device, Interface, Endpoint).\r
+ Type USB_TYPES_DEFINITION is defined in the MDE Package Industry\r
+ Standard include file Usb.h.\r
+ @param Value The value of the feature to be set.\r
+ @param Target The index of the device to be set.\r
+ @param Status A pointer to the status of the transfer.\r
+\r
+ @retval EFI_SUCCESS The request executed successfully.\r
+ @retval EFI_TIMEOUT A timeout occurred executing the request.\r
+ @retval EFI_DEVICE_ERROR The request failed due to a device error.\r
+ The transfer status is returned in Status.\r
\r
**/\r
EFI_STATUS\r
EFIAPI\r
UsbSetFeature (\r
IN EFI_USB_IO_PROTOCOL *UsbIo,\r
- IN UINTN Recipient,\r
+ IN USB_TYPES_DEFINITION Recipient,\r
IN UINT16 Value,\r
IN UINT16 Target,\r
OUT UINT32 *Status\r
);\r
\r
/**\r
- Usb Clear Device Feature.\r
-\r
- @param UsbIo A pointer to EFI_USB_IO_PROTOCOL.\r
- @param Recipient Interface/Device/Endpoint.\r
- @param Value Request value.\r
- @param Target Request Index.\r
- @param Status Transfer status.\r
-\r
- @retval EFI_INVALID_PARAMETER Parameter is error.\r
- @retval EFI_SUCCESS Success.\r
- @retval EFI_TIMEOUT Device has no response.\r
+ Clear the specified feature of the specified device.\r
+\r
+ Submit a USB clear device feature request for the USB device specified by UsbIo,\r
+ Recipient, and Target to the value specified by Value. The status of the transfer\r
+ is returned in Status.\r
+ If UsbIo is NULL, then ASSERT().\r
+ If Status is NULL, then ASSERT().\r
+\r
+ @param UsbIo A pointer to the USB I/O Protocol instance for the specific USB target.\r
+ @param Recipient The USB data recipient type (i.e. Device, Interface, Endpoint).\r
+ Type USB_TYPES_DEFINITION is defined in the MDE Package Industry Standard\r
+ include file Usb.h.\r
+ @param Value The value of the feature to be cleared.\r
+ @param Target The index of the device to be cleared.\r
+ @param Status A pointer to the status of the transfer.\r
+\r
+ @retval EFI_SUCCESS The request executed successfully.\r
+ @retval EFI_TIMEOUT A timeout occurred executing the request.\r
+ @retval EFI_DEVICE_ERROR The request failed due to a device error.\r
+ The transfer status is returned in Status.\r
\r
**/\r
EFI_STATUS\r
EFIAPI\r
UsbClearFeature (\r
IN EFI_USB_IO_PROTOCOL *UsbIo,\r
- IN UINTN Recipient,\r
+ IN USB_TYPES_DEFINITION Recipient,\r
IN UINT16 Value,\r
IN UINT16 Target,\r
OUT UINT32 *Status\r
);\r
\r
/**\r
- Usb Get Device Status.\r
-\r
- @param UsbIo A pointer to EFI_USB_IO_PROTOCOL.\r
- @param Recipient Interface/Device/Endpoint.\r
- @param Target Request index.\r
- @param DevStatus Device status.\r
- @param Status Transfer status.\r
-\r
- @retval EFI_INVALID_PARAMETER Parameter is error.\r
- @retval EFI_SUCCESS Success.\r
- @retval EFI_TIMEOUT Device has no response.\r
+ Get the status of the specified device.\r
+\r
+ Submit a USB device get status request for the USB device specified by UsbIo,\r
+ Recipient, and Target, and place the result in the buffer specified by DeviceStatus.\r
+ The status of the transfer is returned in Status.\r
+ If UsbIo is NULL, then ASSERT().\r
+ If DeviceStatus is NULL, then ASSERT().\r
+ If Status is NULL, then ASSERT().\r
+\r
+ @param UsbIo A pointer to the USB I/O Protocol instance for the specific USB target.\r
+ @param Recipient The USB data recipient type (i.e. Device, Interface, Endpoint).\r
+ Type USB_TYPES_DEFINITION is defined in the MDE Package Industry Standard\r
+ include file Usb.h.\r
+ @param Target The index of the device to be get the status of.\r
+ @param DeviceStatus A pointer to the device status to be retrieved.\r
+ @param Status A pointer to the status of the transfer.\r
+\r
+ @retval EFI_SUCCESS The request executed successfully.\r
+ @retval EFI_TIMEOUT A timeout occurred executing the request.\r
+ @retval EFI_DEVICE_ERROR The request failed due to a device error.\r
+ The transfer status is returned in Status.\r
\r
**/\r
EFI_STATUS\r
EFIAPI\r
UsbGetStatus (\r
IN EFI_USB_IO_PROTOCOL *UsbIo,\r
- IN UINTN Recipient,\r
+ IN USB_TYPES_DEFINITION Recipient,\r
IN UINT16 Target,\r
- OUT UINT16 *DevStatus,\r
+ OUT UINT16 *DeviceStatus,\r
OUT UINT32 *Status\r
);\r
\r
/**\r
- Clear endpoint stall.\r
+ Clear halt feature of the specified usb endpoint.\r
+\r
+ Retrieve the USB endpoint descriptor specified by UsbIo and EndPoint.\r
+ If the USB endpoint descriptor can not be retrieved, then return EFI_NOT_FOUND.\r
+ If the endpoint descriptor is found, then clear the halt feature of this USB endpoint.\r
+ The status of the transfer is returned in Status.\r
+ If UsbIo is NULL, then ASSERT().\r
+ If Status is NULL, then ASSERT().\r
\r
- @param UsbIo A pointer to EFI_USB_IO_PROTOCOL.\r
- @param EndpointNo Endpoint Number.\r
- @param Status Transfer Status.\r
+ @param UsbIo A pointer to the USB I/O Protocol instance for the specific USB target.\r
+ @param Endpoint The endpoint address.\r
+ @param Status A pointer to the status of the transfer.\r
\r
- @retval EFI_NOT_FOUND Can't find the Endpoint.\r
- @retval EFI_DEVICE_ERROR Hardware error.\r
- @retval EFI_SUCCESS Success.\r
+ @retval EFI_SUCCESS The request executed successfully.\r
+ @retval EFI_TIMEOUT A timeout occurred executing the request.\r
+ @retval EFI_DEVICE_ERROR The request failed due to a device error.\r
+ The transfer status is returned in Status.\r
+ @retval EFI_NOT_FOUND The specified USB endpoint descriptor can not be found\r
\r
**/\r
EFI_STATUS\r
EFIAPI\r
UsbClearEndpointHalt (\r
IN EFI_USB_IO_PROTOCOL *UsbIo,\r
- IN UINT8 EndpointNo,\r
+ IN UINT8 Endpoint,\r
OUT UINT32 *Status\r
);\r
\r