]> git.proxmox.com Git - mirror_edk2.git/blobdiff - EdkModulePkg/Library/EdkUsbLib/hid.c
Retiring the ANT/JAVA build and removing the older EDK II packages that required...
[mirror_edk2.git] / EdkModulePkg / Library / EdkUsbLib / hid.c
diff --git a/EdkModulePkg/Library/EdkUsbLib/hid.c b/EdkModulePkg/Library/EdkUsbLib/hid.c
deleted file mode 100644 (file)
index edf9a94..0000000
+++ /dev/null
@@ -1,459 +0,0 @@
-/*++\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:\r
-\r
-    hid.c\r
-\r
-  Abstract:\r
-\r
-    HID class request\r
-\r
-  Revision History\r
-\r
---*/\r
-\r
-//\r
-// Function to get HID descriptor\r
-//\r
-EFI_STATUS\r
-UsbGetHidDescriptor (\r
-  IN  EFI_USB_IO_PROTOCOL        *UsbIo,\r
-  IN  UINT8                      InterfaceNum,\r
-  OUT EFI_USB_HID_DESCRIPTOR     *HidDescriptor\r
-  )\r
-/*++\r
-\r
-  Routine Description:\r
-    Get Hid Descriptor\r
-\r
-  Arguments:\r
-    UsbIo             -   EFI_USB_IO_PROTOCOL\r
-    InterfaceNum      -   Hid interface number\r
-    HidDescriptor     -   Caller allocated buffer to store Usb hid descriptor\r
-                          if successfully returned.\r
-\r
-  Returns:\r
-    EFI_SUCCESS\r
-    EFI_DEVICE_ERROR\r
-    EFI_TIMEOUT\r
-\r
---*/\r
-{\r
-  UINT32                  Status;\r
-  EFI_STATUS              Result;\r
-  EFI_USB_DEVICE_REQUEST  Request;\r
-\r
-  Request.RequestType = 0x81;\r
-  Request.Request     = 0x06;\r
-  Request.Value       = (UINT16) (0x21 << 8);\r
-  Request.Index       = InterfaceNum;\r
-  Request.Length      = sizeof (EFI_USB_HID_DESCRIPTOR);\r
-\r
-  Result = UsbIo->UsbControlTransfer (\r
-                    UsbIo,\r
-                    &Request,\r
-                    EfiUsbDataIn,\r
-                    TIMEOUT_VALUE,\r
-                    HidDescriptor,\r
-                    sizeof (EFI_USB_HID_DESCRIPTOR),\r
-                    &Status\r
-                    );\r
-\r
-  return Result;\r
-\r
-}\r
-//\r
-// Function to get Report Class descriptor\r
-//\r
-EFI_STATUS\r
-UsbGetReportDescriptor (\r
-  IN  EFI_USB_IO_PROTOCOL     *UsbIo,\r
-  IN  UINT8                   InterfaceNum,\r
-  IN  UINT16                  DescriptorSize,\r
-  OUT UINT8                   *DescriptorBuffer\r
-  )\r
-/*++\r
-\r
-  Routine Description:\r
-    get Report Class descriptor\r
-\r
-  Arguments:\r
-    UsbIo             -   EFI_USB_IO_PROTOCOL.\r
-    InterfaceNum      -   Report interface number.\r
-    DescriptorSize    -   Length of DescriptorBuffer.\r
-    DescriptorBuffer  -   Caller allocated buffer to store Usb report descriptor\r
-                          if successfully returned.\r
-\r
-  Returns:\r
-    EFI_SUCCESS\r
-    EFI_DEVICE_ERROR\r
-    EFI_TIMEOUT\r
-\r
---*/\r
-{\r
-  UINT32                  Status;\r
-  EFI_STATUS              Result;\r
-  EFI_USB_DEVICE_REQUEST  Request;\r
-\r
-  //\r
-  // Fill Device request packet\r
-  //\r
-  Request.RequestType = 0x81;\r
-  Request.Request     = 0x06;\r
-  Request.Value       = (UINT16) (0x22 << 8);\r
-  Request.Index       = InterfaceNum;\r
-  Request.Length      = DescriptorSize;\r
-\r
-  Result = UsbIo->UsbControlTransfer (\r
-                    UsbIo,\r
-                    &Request,\r
-                    EfiUsbDataIn,\r
-                    TIMEOUT_VALUE,\r
-                    DescriptorBuffer,\r
-                    DescriptorSize,\r
-                    &Status\r
-                    );\r
-\r
-  return Result;\r
-\r
-}\r
-//\r
-// Following are HID class request\r
-//\r
-EFI_STATUS\r
-UsbGetProtocolRequest (\r
-  IN EFI_USB_IO_PROTOCOL     *UsbIo,\r
-  IN UINT8                   Interface,\r
-  IN UINT8                   *Protocol\r
-  )\r
-/*++\r
-\r
-  Routine Description:\r
-    Get Hid Protocol Request\r
-\r
-  Arguments:\r
-    UsbIo             -   EFI_USB_IO_PROTOCOL\r
-    Interface         -   Which interface the caller wants to get protocol\r
-    Protocol          -   Protocol value returned.\r
-\r
-  Returns:\r
-    EFI_SUCCESS\r
-    EFI_DEVICE_ERROR\r
-    EFI_TIMEOUT\r
-\r
---*/\r
-{\r
-  UINT32                  Status;\r
-  EFI_STATUS              Result;\r
-  EFI_USB_DEVICE_REQUEST  Request;\r
-\r
-  //\r
-  // Fill Device request packet\r
-  //\r
-  Request.RequestType = 0xa1;\r
-  //\r
-  // 10100001b;\r
-  //\r
-  Request.Request = EFI_USB_GET_PROTOCOL_REQUEST;\r
-  Request.Value   = 0;\r
-  Request.Index   = Interface;\r
-  Request.Length  = 1;\r
-\r
-  Result = UsbIo->UsbControlTransfer (\r
-                    UsbIo,\r
-                    &Request,\r
-                    EfiUsbDataIn,\r
-                    TIMEOUT_VALUE,\r
-                    Protocol,\r
-                    sizeof (UINT8),\r
-                    &Status\r
-                    );\r
-\r
-  return Result;\r
-}\r
-\r
-\r
-EFI_STATUS\r
-UsbSetProtocolRequest (\r
-  IN EFI_USB_IO_PROTOCOL     *UsbIo,\r
-  IN UINT8                   Interface,\r
-  IN UINT8                   Protocol\r
-  )\r
-/*++\r
-\r
-  Routine Description:\r
-    Set Hid Protocol Request\r
-\r
-  Arguments:\r
-    UsbIo             -   EFI_USB_IO_PROTOCOL\r
-    Interface         -   Which interface the caller wants to set protocol\r
-    Protocol          -   Protocol value the caller wants to set.\r
-\r
-  Returns:\r
-    EFI_SUCCESS\r
-    EFI_DEVICE_ERROR\r
-    EFI_TIMEOUT\r
-\r
---*/\r
-{\r
-  UINT32                  Status;\r
-  EFI_STATUS              Result;\r
-  EFI_USB_DEVICE_REQUEST  Request;\r
-\r
-  //\r
-  // Fill Device request packet\r
-  //\r
-  Request.RequestType = 0x21;\r
-  //\r
-  // 00100001b;\r
-  //\r
-  Request.Request = EFI_USB_SET_PROTOCOL_REQUEST;\r
-  Request.Value   = Protocol;\r
-  Request.Index   = Interface;\r
-  Request.Length  = 0;\r
-\r
-  Result = UsbIo->UsbControlTransfer (\r
-                    UsbIo,\r
-                    &Request,\r
-                    EfiUsbNoData,\r
-                    TIMEOUT_VALUE,\r
-                    NULL,\r
-                    0,\r
-                    &Status\r
-                    );\r
-  return Result;\r
-}\r
-\r
-\r
-EFI_STATUS\r
-UsbSetIdleRequest (\r
-  IN EFI_USB_IO_PROTOCOL     *UsbIo,\r
-  IN UINT8                   Interface,\r
-  IN UINT8                   ReportId,\r
-  IN UINT8                   Duration\r
-  )\r
-/*++\r
-\r
-  Routine Description:\r
-    Set Idel request.\r
-\r
-  Arguments:\r
-    UsbIo             -   EFI_USB_IO_PROTOCOL\r
-    Interface         -   Which interface the caller wants to set.\r
-    ReportId          -   Which report the caller wants to set.\r
-    Duration          -   Idle rate the caller wants to set.\r
-\r
-  Returns:\r
-    EFI_SUCCESS\r
-    EFI_DEVICE_ERROR\r
-    EFI_TIMEOUT\r
-\r
---*/\r
-{\r
-  UINT32                  Status;\r
-  EFI_STATUS              Result;\r
-  EFI_USB_DEVICE_REQUEST  Request;\r
-\r
-  //\r
-  // Fill Device request packet\r
-  //\r
-  Request.RequestType = 0x21;\r
-  //\r
-  // 00100001b;\r
-  //\r
-  Request.Request = EFI_USB_SET_IDLE_REQUEST;\r
-  Request.Value   = (UINT16) ((Duration << 8) | ReportId);\r
-  Request.Index   = Interface;\r
-  Request.Length  = 0;\r
-\r
-  Result = UsbIo->UsbControlTransfer (\r
-                    UsbIo,\r
-                    &Request,\r
-                    EfiUsbNoData,\r
-                    TIMEOUT_VALUE,\r
-                    NULL,\r
-                    0,\r
-                    &Status\r
-                    );\r
-  return Result;\r
-}\r
-\r
-EFI_STATUS\r
-UsbGetIdleRequest (\r
-  IN  EFI_USB_IO_PROTOCOL     *UsbIo,\r
-  IN  UINT8                   Interface,\r
-  IN  UINT8                   ReportId,\r
-  OUT UINT8                   *Duration\r
-  )\r
-/*++\r
-\r
-  Routine Description:\r
-    Get Idel request.\r
-\r
-  Arguments:\r
-    UsbIo             -   EFI_USB_IO_PROTOCOL\r
-    Interface         -   Which interface the caller wants to get.\r
-    ReportId          -   Which report the caller wants to get.\r
-    Duration          -   Idle rate the caller wants to get.\r
-\r
-  Returns:\r
-    EFI_SUCCESS\r
-    EFI_DEVICE_ERROR\r
-    EFI_TIMEOUT\r
-\r
---*/\r
-{\r
-  UINT32                  Status;\r
-  EFI_STATUS              Result;\r
-  EFI_USB_DEVICE_REQUEST  Request;\r
-\r
-  //\r
-  // Fill Device request packet\r
-  //\r
-  Request.RequestType = 0xa1;\r
-  //\r
-  // 10100001b;\r
-  //\r
-  Request.Request = EFI_USB_GET_IDLE_REQUEST;\r
-  Request.Value   = ReportId;\r
-  Request.Index   = Interface;\r
-  Request.Length  = 1;\r
-\r
-  Result = UsbIo->UsbControlTransfer (\r
-                    UsbIo,\r
-                    &Request,\r
-                    EfiUsbDataIn,\r
-                    TIMEOUT_VALUE,\r
-                    Duration,\r
-                    1,\r
-                    &Status\r
-                    );\r
-\r
-  return Result;\r
-}\r
-\r
-\r
-EFI_STATUS\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
-  )\r
-/*++\r
-\r
-  Routine Description:\r
-    Hid Set Report request.\r
-\r
-  Arguments:\r
-    UsbIo             -   EFI_USB_IO_PROTOCOL\r
-    Interface         -   Which interface the caller wants to set.\r
-    ReportId          -   Which report the caller wants to set.\r
-    ReportType        -   Type of report.\r
-    ReportLen         -   Length of report descriptor.\r
-    Report            -   Report Descriptor buffer.\r
-\r
-  Returns:\r
-    EFI_SUCCESS\r
-    EFI_DEVICE_ERROR\r
-    EFI_TIMEOUT\r
-\r
---*/\r
-{\r
-  UINT32                  Status;\r
-  EFI_STATUS              Result;\r
-  EFI_USB_DEVICE_REQUEST  Request;\r
-\r
-  //\r
-  // Fill Device request packet\r
-  //\r
-  Request.RequestType = 0x21;\r
-  //\r
-  // 00100001b;\r
-  //\r
-  Request.Request = EFI_USB_SET_REPORT_REQUEST;\r
-  Request.Value   = (UINT16) ((ReportType << 8) | ReportId);\r
-  Request.Index   = Interface;\r
-  Request.Length  = ReportLen;\r
-\r
-  Result = UsbIo->UsbControlTransfer (\r
-                    UsbIo,\r
-                    &Request,\r
-                    EfiUsbDataOut,\r
-                    TIMEOUT_VALUE,\r
-                    Report,\r
-                    ReportLen,\r
-                    &Status\r
-                    );\r
-\r
-  return Result;\r
-}\r
-\r
-EFI_STATUS\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
-  )\r
-/*++\r
-\r
-  Routine Description:\r
-    Hid Set Report request.\r
-\r
-  Arguments:\r
-    UsbIo             -   EFI_USB_IO_PROTOCOL\r
-    Interface         -   Which interface the caller wants to set.\r
-    ReportId          -   Which report the caller wants to set.\r
-    ReportType        -   Type of report.\r
-    ReportLen         -   Length of report descriptor.\r
-    Report            -   Caller allocated buffer to store Report Descriptor.\r
-\r
-  Returns:\r
-    EFI_SUCCESS\r
-    EFI_DEVICE_ERROR\r
-    EFI_TIMEOUT\r
-\r
---*/\r
-{\r
-  UINT32                  Status;\r
-  EFI_STATUS              Result;\r
-  EFI_USB_DEVICE_REQUEST  Request;\r
-\r
-  //\r
-  // Fill Device request packet\r
-  //\r
-  Request.RequestType = 0xa1;\r
-  //\r
-  // 10100001b;\r
-  //\r
-  Request.Request = EFI_USB_GET_REPORT_REQUEST;\r
-  Request.Value   = (UINT16) ((ReportType << 8) | ReportId);\r
-  Request.Index   = Interface;\r
-  Request.Length  = ReportLen;\r
-\r
-  Result = UsbIo->UsbControlTransfer (\r
-                    UsbIo,\r
-                    &Request,\r
-                    EfiUsbDataIn,\r
-                    TIMEOUT_VALUE,\r
-                    Report,\r
-                    ReportLen,\r
-                    &Status\r
-                    );\r
-\r
-  return Result;\r
-}\r