]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Include/Library/UefiUsbLib.h
MdePkg/BaseLib: Add CRC16-ANSI and CRC32c implementations
[mirror_edk2.git] / MdePkg / Include / Library / UefiUsbLib.h
index 31b441e6620ac3e7519e9c05ad94448b342c6e73..a8ab47aeff9bca17ad1719946d5cc930a3a713e6 100644 (file)
@@ -1,30 +1,22 @@
 /** @file\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
+  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
-\r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
+SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
 **/\r
 \r
-\r
 #ifndef __USB_DXE_LIB_H__\r
 #define __USB_DXE_LIB_H__\r
 \r
 #include <Protocol/UsbIo.h>\r
-#include <IndustryStandard/Usb.h>\r
 \r
 /**\r
   Get the descriptor of the specified USB HID interface.\r
 \r
-  Submit a USB get HID descriptor request for the USB device specified by UsbIo\r
-  and Interface and return the HID descriptor in HidDescriptor.\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
@@ -42,17 +34,16 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 EFI_STATUS\r
 EFIAPI\r
 UsbGetHidDescriptor (\r
-  IN  EFI_USB_IO_PROTOCOL        *UsbIo,\r
-  IN  UINT8                      Interface,\r
-  OUT EFI_USB_HID_DESCRIPTOR     *HidDescriptor\r
+  IN  EFI_USB_IO_PROTOCOL     *UsbIo,\r
+  IN  UINT8                   Interface,\r
+  OUT EFI_USB_HID_DESCRIPTOR  *HidDescriptor\r
   );\r
 \r
-\r
 /**\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
+  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
@@ -72,17 +63,17 @@ UsbGetHidDescriptor (
 EFI_STATUS\r
 EFIAPI\r
 UsbGetReportDescriptor (\r
-  IN  EFI_USB_IO_PROTOCOL     *UsbIo,\r
-  IN  UINT8                   Interface,\r
-  IN  UINT16                  DescriptorLength,\r
-  OUT UINT8                   *DescriptorBuffer\r
+  IN  EFI_USB_IO_PROTOCOL  *UsbIo,\r
+  IN  UINT8                Interface,\r
+  IN  UINT16               DescriptorLength,\r
+  OUT UINT8                *DescriptorBuffer\r
   );\r
 \r
 /**\r
   Get the HID protocol of the specified USB HID interface.\r
 \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
+  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
@@ -98,16 +89,16 @@ UsbGetReportDescriptor (
 EFI_STATUS\r
 EFIAPI\r
 UsbGetProtocolRequest (\r
-  IN EFI_USB_IO_PROTOCOL     *UsbIo,\r
-  IN UINT8                   Interface,\r
-  OUT UINT8                   *Protocol\r
+  IN EFI_USB_IO_PROTOCOL  *UsbIo,\r
+  IN UINT8                Interface,\r
+  OUT UINT8               *Protocol\r
   );\r
 \r
 /**\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
+  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 the USB I/O Protocol instance for the specific USB target.\r
@@ -122,9 +113,9 @@ UsbGetProtocolRequest (
 EFI_STATUS\r
 EFIAPI\r
 UsbSetProtocolRequest (\r
-  IN EFI_USB_IO_PROTOCOL     *UsbIo,\r
-  IN UINT8                   Interface,\r
-  IN UINT8                   Protocol\r
+  IN EFI_USB_IO_PROTOCOL  *UsbIo,\r
+  IN UINT8                Interface,\r
+  IN UINT8                Protocol\r
   );\r
 \r
 /**\r
@@ -147,10 +138,10 @@ UsbSetProtocolRequest (
 EFI_STATUS\r
 EFIAPI\r
 UsbSetIdleRequest (\r
-  IN EFI_USB_IO_PROTOCOL     *UsbIo,\r
-  IN UINT8                   Interface,\r
-  IN UINT8                   ReportId,\r
-  IN UINT8                   Duration\r
+  IN EFI_USB_IO_PROTOCOL  *UsbIo,\r
+  IN UINT8                Interface,\r
+  IN UINT8                ReportId,\r
+  IN UINT8                Duration\r
   );\r
 \r
 /**\r
@@ -174,10 +165,10 @@ UsbSetIdleRequest (
 EFI_STATUS\r
 EFIAPI\r
 UsbGetIdleRequest (\r
-  IN  EFI_USB_IO_PROTOCOL     *UsbIo,\r
-  IN  UINT8                   Interface,\r
-  IN  UINT8                   ReportId,\r
-  OUT UINT8                   *Duration\r
+  IN  EFI_USB_IO_PROTOCOL  *UsbIo,\r
+  IN  UINT8                Interface,\r
+  IN  UINT8                ReportId,\r
+  OUT UINT8                *Duration\r
   );\r
 \r
 /**\r
@@ -204,12 +195,12 @@ UsbGetIdleRequest (
 EFI_STATUS\r
 EFIAPI\r
 UsbSetReportRequest (\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
+  IN UINT8                *Report\r
   );\r
 \r
 /**\r
@@ -239,12 +230,12 @@ UsbSetReportRequest (
 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
-  OUT 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
@@ -276,12 +267,12 @@ UsbGetReportRequest (
 EFI_STATUS\r
 EFIAPI\r
 UsbGetDescriptor (\r
-  IN  EFI_USB_IO_PROTOCOL     *UsbIo,\r
-  IN  UINT16                  Value,\r
-  IN  UINT16                  Index,\r
-  IN  UINT16                  DescriptorLength,\r
-  OUT VOID                    *Descriptor,\r
-  OUT UINT32                  *Status\r
+  IN  EFI_USB_IO_PROTOCOL  *UsbIo,\r
+  IN  UINT16               Value,\r
+  IN  UINT16               Index,\r
+  IN  UINT16               DescriptorLength,\r
+  OUT VOID                 *Descriptor,\r
+  OUT UINT32               *Status\r
   );\r
 \r
 /**\r
@@ -310,12 +301,12 @@ UsbGetDescriptor (
 EFI_STATUS\r
 EFIAPI\r
 UsbSetDescriptor (\r
-  IN  EFI_USB_IO_PROTOCOL     *UsbIo,\r
-  IN  UINT16                  Value,\r
-  IN  UINT16                  Index,\r
-  IN  UINT16                  DescriptorLength,\r
-  IN  VOID                    *Descriptor,\r
-  OUT UINT32                  *Status\r
+  IN  EFI_USB_IO_PROTOCOL  *UsbIo,\r
+  IN  UINT16               Value,\r
+  IN  UINT16               Index,\r
+  IN  UINT16               DescriptorLength,\r
+  IN  VOID                 *Descriptor,\r
+  OUT UINT32               *Status\r
   );\r
 \r
 /**\r
@@ -342,10 +333,10 @@ UsbSetDescriptor (
 EFI_STATUS\r
 EFIAPI\r
 UsbGetInterface (\r
-  IN  EFI_USB_IO_PROTOCOL     *UsbIo,\r
-  IN  UINT16                  Interface,\r
-  OUT UINT16                  *AlternateSetting,\r
-  OUT UINT32                  *Status\r
+  IN  EFI_USB_IO_PROTOCOL  *UsbIo,\r
+  IN  UINT16               Interface,\r
+  OUT UINT16               *AlternateSetting,\r
+  OUT UINT32               *Status\r
   );\r
 \r
 /**\r
@@ -371,10 +362,10 @@ UsbGetInterface (
 EFI_STATUS\r
 EFIAPI\r
 UsbSetInterface (\r
-  IN  EFI_USB_IO_PROTOCOL     *UsbIo,\r
-  IN  UINT16                  Interface,\r
-  IN  UINT16                  AlternateSetting,\r
-  OUT UINT32                  *Status\r
+  IN  EFI_USB_IO_PROTOCOL  *UsbIo,\r
+  IN  UINT16               Interface,\r
+  IN  UINT16               AlternateSetting,\r
+  OUT UINT32               *Status\r
   );\r
 \r
 /**\r
@@ -400,9 +391,9 @@ UsbSetInterface (
 EFI_STATUS\r
 EFIAPI\r
 UsbGetConfiguration (\r
-  IN  EFI_USB_IO_PROTOCOL     *UsbIo,\r
-  OUT UINT16                  *ConfigurationValue,\r
-  OUT UINT32                  *Status\r
+  IN  EFI_USB_IO_PROTOCOL  *UsbIo,\r
+  OUT UINT16               *ConfigurationValue,\r
+  OUT UINT32               *Status\r
   );\r
 \r
 /**\r
@@ -427,9 +418,9 @@ UsbGetConfiguration (
 EFI_STATUS\r
 EFIAPI\r
 UsbSetConfiguration (\r
-  IN  EFI_USB_IO_PROTOCOL     *UsbIo,\r
-  IN  UINT16                  ConfigurationValue,\r
-  OUT UINT32                  *Status\r
+  IN  EFI_USB_IO_PROTOCOL  *UsbIo,\r
+  IN  UINT16               ConfigurationValue,\r
+  OUT UINT32               *Status\r
   );\r
 \r
 /**\r
@@ -458,11 +449,11 @@ UsbSetConfiguration (
 EFI_STATUS\r
 EFIAPI\r
 UsbSetFeature (\r
-  IN  EFI_USB_IO_PROTOCOL     *UsbIo,\r
-  IN  USB_TYPES_DEFINITION    Recipient,\r
-  IN  UINT16                  Value,\r
-  IN  UINT16                  Target,\r
-  OUT UINT32                  *Status\r
+  IN  EFI_USB_IO_PROTOCOL   *UsbIo,\r
+  IN  USB_TYPES_DEFINITION  Recipient,\r
+  IN  UINT16                Value,\r
+  IN  UINT16                Target,\r
+  OUT UINT32                *Status\r
   );\r
 \r
 /**\r
@@ -491,18 +482,18 @@ UsbSetFeature (
 EFI_STATUS\r
 EFIAPI\r
 UsbClearFeature (\r
-  IN  EFI_USB_IO_PROTOCOL     *UsbIo,\r
-  IN  USB_TYPES_DEFINITION    Recipient,\r
-  IN  UINT16                  Value,\r
-  IN  UINT16                  Target,\r
-  OUT UINT32                  *Status\r
+  IN  EFI_USB_IO_PROTOCOL   *UsbIo,\r
+  IN  USB_TYPES_DEFINITION  Recipient,\r
+  IN  UINT16                Value,\r
+  IN  UINT16                Target,\r
+  OUT UINT32                *Status\r
   );\r
 \r
 /**\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
+  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
@@ -525,11 +516,11 @@ UsbClearFeature (
 EFI_STATUS\r
 EFIAPI\r
 UsbGetStatus (\r
-  IN  EFI_USB_IO_PROTOCOL     *UsbIo,\r
-  IN  USB_TYPES_DEFINITION    Recipient,\r
-  IN  UINT16                  Target,\r
-  OUT UINT16                  *DeviceStatus,\r
-  OUT UINT32                  *Status\r
+  IN  EFI_USB_IO_PROTOCOL   *UsbIo,\r
+  IN  USB_TYPES_DEFINITION  Recipient,\r
+  IN  UINT16                Target,\r
+  OUT UINT16                *DeviceStatus,\r
+  OUT UINT32                *Status\r
   );\r
 \r
 /**\r
@@ -556,9 +547,9 @@ UsbGetStatus (
 EFI_STATUS\r
 EFIAPI\r
 UsbClearEndpointHalt (\r
-  IN  EFI_USB_IO_PROTOCOL     *UsbIo,\r
-  IN  UINT8                   Endpoint,\r
-  OUT UINT32                  *Status\r
+  IN  EFI_USB_IO_PROTOCOL  *UsbIo,\r
+  IN  UINT8                Endpoint,\r
+  OUT UINT32               *Status\r
   );\r
 \r
 #endif\r