/* Submit a USB get HID report descriptor request for the USB device specified by UsbIo and Interface and return the report descriptor in DescriptorBuffer. If UsbIo is NULL, then ASSERT(). If DescriptorBuffer is NULL, then ASSERT(). */
EFI_STATUS EFIAPI UsbGetReportDescriptor(IN EFI_USB_IO_PROTOCOL *UsbIo, IN UINT8 Interface, IN UINT16 DescriptorLength, OUT UINT8 *DescriptorBuffer)
/* Submit a USB get HID report descriptor request for the USB device specified by UsbIo and Interface and return the report descriptor in DescriptorBuffer. If UsbIo is NULL, then ASSERT(). If DescriptorBuffer is NULL, then ASSERT(). */
EFI_STATUS EFIAPI UsbGetReportDescriptor(IN EFI_USB_IO_PROTOCOL *UsbIo, IN UINT8 Interface, IN UINT16 DescriptorLength, OUT UINT8 *DescriptorBuffer)
{
  UINT32                  Status;
  EFI_STATUS              Result;
  EFI_USB_DEVICE_REQUEST  Request;
  ASSERT (UsbIo != NULL);
  ASSERT (DescriptorBuffer != NULL);
  Request.RequestType = USB_HID_GET_DESCRIPTOR_REQ_TYPE;
  Request.Request     = USB_REQ_GET_DESCRIPTOR;
  Request.Value       = (UINT16)(USB_DESC_TYPE_REPORT << 8);
  Request.Index       = Interface;
  Request.Length      = DescriptorLength;
  Result = UsbIo->UsbControlTransfer (
                    UsbIo,
                    &Request,
                    EfiUsbDataIn,
                    PcdGet32 (PcdUsbTransferTimeoutValue),
                    DescriptorBuffer,
                    DescriptorLength,
                    &Status
                    );
  return Result;
}