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