OvmfPkg/VirtioLib: take VirtIo instance in VirtioRingInit/VirtioRingUninit
Passing the VirtIo protocol instance will allow the vring to use VIRTIO_DEVICE_PROTOCOL.AllocateSharedPages () to allocate vring buffer. Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Tom Lendacky <thomas.lendacky@amd.com> Cc: Laszlo Ersek <lersek@redhat.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Brijesh Singh <brijesh.singh@amd.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Regression-tested-by: Laszlo Ersek <lersek@redhat.com>
This commit is contained in:
committed by
Laszlo Ersek
parent
0a78d754ed
commit
fc2c1543e5
@@ -27,6 +27,7 @@
|
||||
|
||||
Copyright (C) 2012, Red Hat, Inc.
|
||||
Copyright (c) 2012 - 2014, Intel Corporation. All rights reserved.<BR>
|
||||
Copyright (c) 2017, AMD Inc, All rights reserved.<BR>
|
||||
|
||||
This program and the accompanying materials are licensed and made available
|
||||
under the terms and conditions of the BSD License which accompanies this
|
||||
@@ -832,7 +833,7 @@ VirtioScsiInit (
|
||||
goto Failed;
|
||||
}
|
||||
|
||||
Status = VirtioRingInit (QueueSize, &Dev->Ring);
|
||||
Status = VirtioRingInit (Dev->VirtIo, QueueSize, &Dev->Ring);
|
||||
if (EFI_ERROR (Status)) {
|
||||
goto Failed;
|
||||
}
|
||||
@@ -926,7 +927,7 @@ VirtioScsiInit (
|
||||
return EFI_SUCCESS;
|
||||
|
||||
ReleaseQueue:
|
||||
VirtioRingUninit (&Dev->Ring);
|
||||
VirtioRingUninit (Dev->VirtIo, &Dev->Ring);
|
||||
|
||||
Failed:
|
||||
//
|
||||
@@ -964,7 +965,7 @@ VirtioScsiUninit (
|
||||
Dev->MaxLun = 0;
|
||||
Dev->MaxSectors = 0;
|
||||
|
||||
VirtioRingUninit (&Dev->Ring);
|
||||
VirtioRingUninit (Dev->VirtIo, &Dev->Ring);
|
||||
|
||||
SetMem (&Dev->PassThru, sizeof Dev->PassThru, 0x00);
|
||||
SetMem (&Dev->PassThruMode, sizeof Dev->PassThruMode, 0x00);
|
||||
|
Reference in New Issue
Block a user