/* Read the Virtio Filesystem device configuration structure in full. */
STATIC EFI_STATUS VirtioFsReadConfig(IN VIRTIO_DEVICE_PROTOCOL *Virtio, OUT VIRTIO_FS_CONFIG *Config)
/* Read the Virtio Filesystem device configuration structure in full. */
STATIC EFI_STATUS VirtioFsReadConfig(IN VIRTIO_DEVICE_PROTOCOL *Virtio, OUT VIRTIO_FS_CONFIG *Config)
{
  UINTN       Idx;
  EFI_STATUS  Status;
  for (Idx = 0; Idx < VIRTIO_FS_TAG_BYTES; Idx++) {
    Status = Virtio->ReadDevice (
                       Virtio,
                       OFFSET_OF (VIRTIO_FS_CONFIG, Tag[Idx]),
                       sizeof Config->Tag[Idx],
                       sizeof Config->Tag[Idx],
                       &Config->Tag[Idx]
                       );
    if (EFI_ERROR (Status)) {
      return Status;
    }
  }
  Status = Virtio->ReadDevice (
                     Virtio,
                     OFFSET_OF (VIRTIO_FS_CONFIG, NumReqQueues),
                     sizeof Config->NumReqQueues,
                     sizeof Config->NumReqQueues,
                     &Config->NumReqQueues
                     );
  return Status;
}