summaryrefslogtreecommitdiffstats
path: root/OvmfPkg/VirtioNetDxe
diff options
context:
space:
mode:
authorBrijesh Singh <brijesh.singh@amd.com>2017-08-23 06:57:17 -0400
committerLaszlo Ersek <lersek@redhat.com>2017-08-25 10:42:18 +0200
commitfc2c1543e51ee6fc8a2956594456eb4db5f0a3ca (patch)
tree9a26be6f83258a229da867a2c2714e221378e817 /OvmfPkg/VirtioNetDxe
parent0a78d754edc82ed0dae07c3d505b88fce8b5bd09 (diff)
downloadedk2-fc2c1543e51ee6fc8a2956594456eb4db5f0a3ca.tar.gz
edk2-fc2c1543e51ee6fc8a2956594456eb4db5f0a3ca.tar.bz2
edk2-fc2c1543e51ee6fc8a2956594456eb4db5f0a3ca.zip
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>
Diffstat (limited to 'OvmfPkg/VirtioNetDxe')
-rw-r--r--OvmfPkg/VirtioNetDxe/SnpInitialize.c9
-rw-r--r--OvmfPkg/VirtioNetDxe/SnpShutdown.c5
2 files changed, 8 insertions, 6 deletions
diff --git a/OvmfPkg/VirtioNetDxe/SnpInitialize.c b/OvmfPkg/VirtioNetDxe/SnpInitialize.c
index 430670a980..6d9b81a9f9 100644
--- a/OvmfPkg/VirtioNetDxe/SnpInitialize.c
+++ b/OvmfPkg/VirtioNetDxe/SnpInitialize.c
@@ -5,6 +5,7 @@
Copyright (C) 2013, Red Hat, Inc.
Copyright (c) 2006 - 2010, 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
@@ -73,7 +74,7 @@ VirtioNetInitRing (
if (QueueSize < 2) {
return EFI_UNSUPPORTED;
}
- Status = VirtioRingInit (QueueSize, Ring);
+ Status = VirtioRingInit (Dev->VirtIo, QueueSize, Ring);
if (EFI_ERROR (Status)) {
return Status;
}
@@ -103,7 +104,7 @@ VirtioNetInitRing (
return EFI_SUCCESS;
ReleaseQueue:
- VirtioRingUninit (Ring);
+ VirtioRingUninit (Dev->VirtIo, Ring);
return Status;
}
@@ -509,10 +510,10 @@ AbortDevice:
Dev->VirtIo->SetDeviceStatus (Dev->VirtIo, 0);
ReleaseTxRing:
- VirtioRingUninit (&Dev->TxRing);
+ VirtioRingUninit (Dev->VirtIo, &Dev->TxRing);
ReleaseRxRing:
- VirtioRingUninit (&Dev->RxRing);
+ VirtioRingUninit (Dev->VirtIo, &Dev->RxRing);
DeviceFailed:
//
diff --git a/OvmfPkg/VirtioNetDxe/SnpShutdown.c b/OvmfPkg/VirtioNetDxe/SnpShutdown.c
index 01409c0ce7..5e84191fbb 100644
--- a/OvmfPkg/VirtioNetDxe/SnpShutdown.c
+++ b/OvmfPkg/VirtioNetDxe/SnpShutdown.c
@@ -4,6 +4,7 @@
Copyright (C) 2013, Red Hat, Inc.
Copyright (c) 2006 - 2010, 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
@@ -66,8 +67,8 @@ VirtioNetShutdown (
Dev->VirtIo->SetDeviceStatus (Dev->VirtIo, 0);
VirtioNetShutdownRx (Dev);
VirtioNetShutdownTx (Dev);
- VirtioRingUninit (&Dev->TxRing);
- VirtioRingUninit (&Dev->RxRing);
+ VirtioRingUninit (Dev->VirtIo, &Dev->TxRing);
+ VirtioRingUninit (Dev->VirtIo, &Dev->RxRing);
Dev->Snm.State = EfiSimpleNetworkStarted;
Status = EFI_SUCCESS;