/* Submit a USB get descriptor request for the USB device specified by UsbIo, Value, and Index, and return the descriptor in the buffer specified by Descriptor. The status of the transfer is returned in Status. If UsbIo is NULL, then ASSERT(). If Descriptor is NULL, then ASSERT(). If Status is NULL, then ASSERT(). */
EFI_STATUS EFIAPI UsbGetDescriptor(IN EFI_USB_IO_PROTOCOL *UsbIo, IN UINT16 Value, IN UINT16 Index, IN UINT16 DescriptorLength, OUT VOID *Descriptor, OUT UINT32 *Status)
/* Submit a USB get descriptor request for the USB device specified by UsbIo, Value, and Index, and return the descriptor in the buffer specified by Descriptor. The status of the transfer is returned in Status. If UsbIo is NULL, then ASSERT(). If Descriptor is NULL, then ASSERT(). If Status is NULL, then ASSERT(). */
EFI_STATUS EFIAPI UsbGetDescriptor(IN EFI_USB_IO_PROTOCOL *UsbIo, IN UINT16 Value, IN UINT16 Index, IN UINT16 DescriptorLength, OUT VOID *Descriptor, OUT UINT32 *Status)
{
  EFI_USB_DEVICE_REQUEST  DevReq;
  ASSERT (UsbIo != NULL);
  ASSERT (Descriptor != NULL);
  ASSERT (Status != NULL);
  ZeroMem (&DevReq, sizeof (EFI_USB_DEVICE_REQUEST));
  DevReq.RequestType = USB_DEV_GET_DESCRIPTOR_REQ_TYPE;
  DevReq.Request     = USB_REQ_GET_DESCRIPTOR;
  DevReq.Value       = Value;
  DevReq.Index       = Index;
  DevReq.Length      = DescriptorLength;
  return UsbIo->UsbControlTransfer (
                  UsbIo,
                  &DevReq,
                  EfiUsbDataIn,
                  PcdGet32 (PcdUsbTransferTimeoutValue),
                  Descriptor,
                  DescriptorLength,
                  Status
                  );
}