/* Return the configuration descriptor of the current active configuration. */
EFI_STATUS EFIAPI UsbIoGetActiveConfigDescriptor(IN EFI_USB_IO_PROTOCOL *This, OUT EFI_USB_CONFIG_DESCRIPTOR *Descriptor)
/* Return the configuration descriptor of the current active configuration. */
EFI_STATUS EFIAPI UsbIoGetActiveConfigDescriptor(IN EFI_USB_IO_PROTOCOL *This, OUT EFI_USB_CONFIG_DESCRIPTOR *Descriptor)
{
  USB_DEVICE     *Dev;
  USB_INTERFACE  *UsbIf;
  EFI_STATUS     Status;
  EFI_TPL        OldTpl;
  if (Descriptor == NULL) {
    return EFI_INVALID_PARAMETER;
  }
  Status = EFI_SUCCESS;
  OldTpl = gBS->RaiseTPL (USB_BUS_TPL);
  UsbIf = USB_INTERFACE_FROM_USBIO (This);
  Dev   = UsbIf->Device;
  if (Dev->ActiveConfig == NULL) {
    Status = EFI_NOT_FOUND;
    goto ON_EXIT;
  }
  CopyMem (Descriptor, &(Dev->ActiveConfig->Desc), sizeof (EFI_USB_CONFIG_DESCRIPTOR));
ON_EXIT:
  gBS->RestoreTPL (OldTpl);
  return Status;
}