From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-bn3nam01on0046.outbound.protection.outlook.com [104.47.33.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id F14BC21DF966D for ; Mon, 7 Aug 2017 04:57:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=TigpE5HBkEsakzh3H+Fym3APjqQqF962/XCtIivX0So=; b=rM3oFMI8TQmlgnijuaRI2urZx3Kb+SjBJhbtv0ASzeSC6JbenUNckX5QBliVlBe43Rmt5kLkXN2jh+2lhbdqmD8XOGoPYwL7Z962N390YxplBldF3pLd5lRawNqjlnAfVALHrMiB8bA0mLNOovbM1BTXbEqBMqa2tA7vY9BbUag= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=brijesh.singh@amd.com; Received: from brijesh-build-machine.amd.com (165.204.77.1) by SN1PR12MB0159.namprd12.prod.outlook.com (10.162.3.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.1.1320.16; Mon, 7 Aug 2017 11:59:24 +0000 From: Brijesh Singh To: edk2-devel@lists.01.org Cc: Brijesh Singh , Ard Biesheuvel , Jordan Justen , Tom Lendacky , Laszlo Ersek Date: Mon, 7 Aug 2017 07:58:50 -0400 Message-Id: <1502107139-412-6-git-send-email-brijesh.singh@amd.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1502107139-412-1-git-send-email-brijesh.singh@amd.com> References: <1502107139-412-1-git-send-email-brijesh.singh@amd.com> MIME-Version: 1.0 X-Originating-IP: [165.204.77.1] X-ClientProxiedBy: CY4PR04CA0033.namprd04.prod.outlook.com (10.172.133.19) To SN1PR12MB0159.namprd12.prod.outlook.com (10.162.3.146) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1daaa718-abe1-4e04-2009-08d4dd8bbfb8 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254152)(48565401081)(300000503095)(300135400095)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:SN1PR12MB0159; X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0159; 3:e1MPEf4Wu60+R8rvWcjXXj7LfmZ8/0jjVD9qTZzHtGJAcwknYH+D9FS57UtdjT+MDSDtrSnlkgux+My6RAnwxzCSrfpNp3kyJPIKPSRp6IoMYgaM3aE6/1lZvPq0w7uiAzD7gkGBzKQ5QWOd7gqHVyjZxd25QXTt0OZyfkI8TqeDLuo3RzxmYuzriNdUidla2RFM316/eKyow0h8nEFeXcqqkXqAnbQ0LnuzTNdtDlZWb+tCH2Fn48l1te4NsttV; 25:ARSbUBtxM1Gaj5dNVbXl+RAr/WbtpRFOBQBsXz8ma8Z/+veU4Lx3faWRhYxodre+P7wXKPk4JFZQnhTJt3Gh3ikt8u3dSm6GLZ+tqseA6n0pYXV2s7nACrWSHbbRKEomuTnfVJmLV44V1C3bSLsooK29jPJd6h16u+MqMQZ5cT0MxVopSC+5i6R7G8if29W+YN+d4Q/ZeC4qEz+NYQT+ZrtFm+fr5CluyQgC+h8XuAccNuqwC8i+DUdOOFNMJd7w3611kIu0rp38nZRXeqoSeChlwf6hTgE1ivFN43s/O2PpLVZE0sE+FCNujAZ7qjp4SdAQvbmvxYOoh45NorKVAQ==; 31:kVp3ylqdpLknVLwS558nkJhaYL/E/yjRB67JMSNgU4rr+2kpmFFEUx8OWyOwphesr79DVmWPy2gEiATYubYMezmNhIu2gyWPDSu+fvnwQKp02btFpDOyXDhQdEVt7+5fDdhUrDkeuWdyhpoMNlrDnt4xe75oo0GpzFMBIgSegZxig3cHTvG2CFOSM1Buf9FZDeD9ErdlCbWC+VrHlkUZHVg1xucr+SeCVxrzkIJpeqM= X-MS-TrafficTypeDiagnostic: SN1PR12MB0159: X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0159; 20:JwMQlkQwN5/anEpdnUe943lG7Q7Two6Pr90Ga5cvpDB115dHiz0h4WY8EPYVtRC/iHuT8tdC4XauY0BbT/tVsbFdF/V1Cx8GqZ6E6DrT4zp0uwfZPRFdotFwEXY6iyU9Ed+NrfhlanKp/BqfBrIKL/R0H52k9WgXvNSXK+Z7R+Qib3ASx6MOtQzjph5HuWqsIu+rXo/JygeLcKYmVjkb00iEnjTNf1DLpoww71VqQHevmKFnjL7Ct+5faFWGA+DDBLERWnxG2kL/NE6+nFSw6tKjq6G4Yyl80jbJq74gwcCjIbW+YXtwkS7ytctpHqxVL0AVs9WLGUlFpt6LkCwGhWorjvs1n0p+LD776zhXLpuZ342mC0xu+Znqp30xQ8YNASlC2ZmP6zFKa/aVmIXwqXTSn93V+ED+70Bjj3QPKmKq70QDNS4v0VS0RgR7og1zvRzzUEowjuCA/LOo/gF8FBfqVTkUWbdlTA43CWPoY2e+NAe5byPLgIDvjTGK7yM8; 4:NBmoja1AjTiCsx2d0XyFulhmExOu5OtopoYuhBnxgHPbyM0E99s1jACM8bgFfYA5KLvDznAmGDIrVdXSvvmd9qNwZCGINp4l6X/snM+bmwUhd+ZrVbi6392N0yLcsqUJoHGCbsNHzVeddqsySH6DIVYTE26V59V4XeleL+pCu0nlXwhRt4vGSCLIFm5eoQ2SF2jvS7cCQG0V6x6j3xURD01MHKmA+KmK4Q7hTRKzAaI3L+nUbUFOQ+CRHfpQyLQsui+SB/ItM4aVMhY4ScbA9BjcRJMBy9d9ERFXgjs/mGJeAlud+VZ0oaShH4hjTng5snRQzda42EnImw4eAMno5g== X-Exchange-Antispam-Report-Test: UriScan:(767451399110)(228905959029699); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(8121501046)(5005006)(100000703101)(100105400095)(93006095)(93001095)(10201501046)(3002001)(6055026)(6041248)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(20161123558100)(20161123560025)(20161123555025)(6072148)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:SN1PR12MB0159; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:SN1PR12MB0159; X-Forefront-PRVS: 0392679D18 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(7370300001)(6009001)(39400400002)(39850400002)(39450400003)(39410400002)(39840400002)(39860400002)(199003)(51234002)(189002)(3846002)(6116002)(5660300001)(81156014)(81166006)(54906002)(8676002)(68736007)(50466002)(53936002)(53416004)(106356001)(2950100002)(105586002)(2351001)(42186005)(575784001)(86362001)(6666003)(5003940100001)(36756003)(189998001)(33646002)(6916009)(97736004)(25786009)(2906002)(478600001)(110136004)(47776003)(38730400002)(76176999)(50986999)(66066001)(4326008)(2361001)(305945005)(50226002)(48376002)(7350300001)(101416001)(6486002)(7736002); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1PR12MB0159; H:brijesh-build-machine.amd.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN1PR12MB0159; 23:lgPKOSSTQBs4WJ7dv5ptrus338BoYydg0VBTgxbHO?= =?us-ascii?Q?PhcelQH7ca4FjV8N25nOi60ThRWOJkb9s6JkodQ9cVlM1P9x6O3fbMpmnkx0?= =?us-ascii?Q?K01/88Bc/2fzkvv/ypn5n2ID9y1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0r+NYyd92zzbip1e0iJKG3AWDxR38IE2u1XyuSRUo=; 7:a7PEqCusZ3ll0JjwVE1bZSQkmP/x17o3SuvQQAHtBgZmVezp1dvhbLb4fcrcOQ2zXQwKcwUcP1sd+EkO7beWwU5WO6SYEhR9GFuI+lfSD0wuoYenxp7qgQcRWNG2T9Jpwzq0ndRvkbA9De/7b2Bh9iNjH5SGeFEWf1JLfV3o4Vf6grLQcX3i6q5Mkz84BRq5obfClq0clLoAhcmJNq8YuEAtAWyOx4duOMfblS5qT+U= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0159; 20:bkgK0dpnPmHY2GLY8lH2MsthnDEOlPa3tgOdC2bBiy4f3plegkqDWJas8W0zhX0igFURfTTLjteSRhJngnSx+c7RmsScvRkAJ91UE6kWS3fjqNGuheAIRRiyWXdE79JicJmyKKG1dR5rO19M/zN0ONaRxn29KOjv/AQ2p3KcvOD/2EvmmeaCZnr8VqlA2LVI/ArMXdxXUFHKIXXLg1E75XaN7J7mTWKmYsrly/0ZjHGkgP9hTFgpPXl07tMC+ql9 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Aug 2017 11:59:24.8573 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR12MB0159 Subject: [PATCH v1 05/14] OvmfPkg/VirtioLib: Pass VirtIo instance in VringInit/Uinit() X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Aug 2017 11:57:11 -0000 Content-Type: text/plain Passing the VirtIo protocol instance will allow the vring to use VIRTIO_DEVICE_PROTOCOL.AllocateSharedPages () to allocate vring buffer. Cc: Ard Biesheuvel Cc: Jordan Justen Cc: Tom Lendacky Cc: Laszlo Ersek Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Brijesh Singh --- OvmfPkg/Include/Library/VirtioLib.h | 14 ++++++++++---- OvmfPkg/Library/VirtioLib/VirtioLib.c | 14 ++++++++++---- OvmfPkg/VirtioBlkDxe/VirtioBlk.c | 7 ++++--- OvmfPkg/VirtioGpuDxe/Commands.c | 7 ++++--- OvmfPkg/VirtioNetDxe/SnpInitialize.c | 9 +++++---- OvmfPkg/VirtioNetDxe/SnpShutdown.c | 5 +++-- OvmfPkg/VirtioRngDxe/VirtioRng.c | 7 ++++--- OvmfPkg/VirtioScsiDxe/VirtioScsi.c | 7 ++++--- 8 files changed, 44 insertions(+), 26 deletions(-) diff --git a/OvmfPkg/Include/Library/VirtioLib.h b/OvmfPkg/Include/Library/VirtioLib.h index fa82734f1852..610654225de7 100644 --- a/OvmfPkg/Include/Library/VirtioLib.h +++ b/OvmfPkg/Include/Library/VirtioLib.h @@ -35,6 +35,8 @@ - 1.1 Virtqueues, - 2.3 Virtqueue Configuration. + @param[in] VirtIo The virtio device which will use the ring. + @param[in] The number of descriptors to allocate for the virtio ring, as requested by the host. @@ -52,8 +54,9 @@ EFI_STATUS EFIAPI VirtioRingInit ( - IN UINT16 QueueSize, - OUT VRING *Ring + IN VIRTIO_DEVICE_PROTOCOL *VirtIo, + IN UINT16 QueueSize, + OUT VRING *Ring ); @@ -65,13 +68,16 @@ VirtioRingInit ( invoking this function: the VSTAT_DRIVER_OK bit must be clear in VhdrDeviceStatus. - @param[out] Ring The virtio ring to clean up. + @param[in] VirtIo The virtio device which will was using the ring. + + @param[out] Ring The virtio ring to clean up. **/ VOID EFIAPI VirtioRingUninit ( - IN OUT VRING *Ring + IN VIRTIO_DEVICE_PROTOCOL *VirtIo, + IN OUT VRING *Ring ); diff --git a/OvmfPkg/Library/VirtioLib/VirtioLib.c b/OvmfPkg/Library/VirtioLib/VirtioLib.c index f6b464b6cdf8..50e5ec28ea1b 100644 --- a/OvmfPkg/Library/VirtioLib/VirtioLib.c +++ b/OvmfPkg/Library/VirtioLib/VirtioLib.c @@ -37,6 +37,8 @@ - 1.1 Virtqueues, - 2.3 Virtqueue Configuration. + @param[in] VirtIo The virtio device which will use the ring. + @param[in] The number of descriptors to allocate for the virtio ring, as requested by the host. @@ -54,8 +56,9 @@ EFI_STATUS EFIAPI VirtioRingInit ( - IN UINT16 QueueSize, - OUT VRING *Ring + IN VIRTIO_DEVICE_PROTOCOL *VirtIo, + IN UINT16 QueueSize, + OUT VRING *Ring ) { UINTN RingSize; @@ -128,13 +131,16 @@ VirtioRingInit ( invoking this function: the VSTAT_DRIVER_OK bit must be clear in VhdrDeviceStatus. - @param[out] Ring The virtio ring to clean up. + @param[in] VirtIo The virtio device which will was using the ring. + + @param[out] Ring The virtio ring to clean up. **/ VOID EFIAPI VirtioRingUninit ( - IN OUT VRING *Ring + IN VIRTIO_DEVICE_PROTOCOL *VirtIo, + IN OUT VRING *Ring ) { FreePages (Ring->Base, Ring->NumPages); diff --git a/OvmfPkg/VirtioBlkDxe/VirtioBlk.c b/OvmfPkg/VirtioBlkDxe/VirtioBlk.c index 3ce72281c204..61b9cab4ff02 100644 --- a/OvmfPkg/VirtioBlkDxe/VirtioBlk.c +++ b/OvmfPkg/VirtioBlkDxe/VirtioBlk.c @@ -12,6 +12,7 @@ Copyright (C) 2012, Red Hat, Inc. Copyright (c) 2012 - 2016, Intel Corporation. All rights reserved.
+ Copyright (c) 2017, AMD Inc, All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this @@ -722,7 +723,7 @@ VirtioBlkInit ( goto Failed; } - Status = VirtioRingInit (QueueSize, &Dev->Ring); + Status = VirtioRingInit (Dev->VirtIo, QueueSize, &Dev->Ring); if (EFI_ERROR (Status)) { goto Failed; } @@ -811,7 +812,7 @@ VirtioBlkInit ( return EFI_SUCCESS; ReleaseQueue: - VirtioRingUninit (&Dev->Ring); + VirtioRingUninit (Dev->VirtIo, &Dev->Ring); Failed: // @@ -848,7 +849,7 @@ VirtioBlkUninit ( // Dev->VirtIo->SetDeviceStatus (Dev->VirtIo, 0); - VirtioRingUninit (&Dev->Ring); + VirtioRingUninit (Dev->VirtIo, &Dev->Ring); SetMem (&Dev->BlockIo, sizeof Dev->BlockIo, 0x00); SetMem (&Dev->BlockIoMedia, sizeof Dev->BlockIoMedia, 0x00); diff --git a/OvmfPkg/VirtioGpuDxe/Commands.c b/OvmfPkg/VirtioGpuDxe/Commands.c index 962087cfec97..c2e4d72feb67 100644 --- a/OvmfPkg/VirtioGpuDxe/Commands.c +++ b/OvmfPkg/VirtioGpuDxe/Commands.c @@ -3,6 +3,7 @@ VirtIo GPU initialization, and commands (primitives) for the GPU device. Copyright (C) 2016, Red Hat, Inc. + Copyright (c) 2017, AMD Inc, All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this @@ -127,7 +128,7 @@ VirtioGpuInit ( // // [...] population of virtqueues [...] // - Status = VirtioRingInit (QueueSize, &VgpuDev->Ring); + Status = VirtioRingInit (VgpuDev->VirtIo, QueueSize, &VgpuDev->Ring); if (EFI_ERROR (Status)) { goto Failed; } @@ -148,7 +149,7 @@ VirtioGpuInit ( return EFI_SUCCESS; ReleaseQueue: - VirtioRingUninit (&VgpuDev->Ring); + VirtioRingUninit (VgpuDev->VirtIo, &VgpuDev->Ring); Failed: // @@ -183,7 +184,7 @@ VirtioGpuUninit ( // configuration. // VgpuDev->VirtIo->SetDeviceStatus (VgpuDev->VirtIo, 0); - VirtioRingUninit (&VgpuDev->Ring); + VirtioRingUninit (VgpuDev->VirtIo, &VgpuDev->Ring); } /** diff --git a/OvmfPkg/VirtioNetDxe/SnpInitialize.c b/OvmfPkg/VirtioNetDxe/SnpInitialize.c index 430670a980f2..6d9b81a9f939 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.
+ Copyright (c) 2017, AMD Inc, All rights reserved.
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 01409c0ce714..5e84191fbbdd 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.
+ Copyright (c) 2017, AMD Inc, All rights reserved.
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; diff --git a/OvmfPkg/VirtioRngDxe/VirtioRng.c b/OvmfPkg/VirtioRngDxe/VirtioRng.c index 1a186d04082a..e20602ac7225 100644 --- a/OvmfPkg/VirtioRngDxe/VirtioRng.c +++ b/OvmfPkg/VirtioRngDxe/VirtioRng.c @@ -6,6 +6,7 @@ Copyright (C) 2012, Red Hat, Inc. Copyright (c) 2012 - 2014, Intel Corporation. All rights reserved.
+ Copyright (c) 2017, AMD Inc, All rights reserved.
This driver: @@ -275,7 +276,7 @@ VirtioRngInit ( goto Failed; } - Status = VirtioRingInit (QueueSize, &Dev->Ring); + Status = VirtioRingInit (Dev->VirtIo, QueueSize, &Dev->Ring); if (EFI_ERROR (Status)) { goto Failed; } @@ -331,7 +332,7 @@ VirtioRngInit ( return EFI_SUCCESS; ReleaseQueue: - VirtioRingUninit (&Dev->Ring); + VirtioRingUninit (Dev->VirtIo, &Dev->Ring); Failed: // @@ -358,7 +359,7 @@ VirtioRngUninit ( // the old comms area. // Dev->VirtIo->SetDeviceStatus (Dev->VirtIo, 0); - VirtioRingUninit (&Dev->Ring); + VirtioRingUninit (Dev->VirtIo, &Dev->Ring); } // diff --git a/OvmfPkg/VirtioScsiDxe/VirtioScsi.c b/OvmfPkg/VirtioScsiDxe/VirtioScsi.c index c080404330e5..c2f6f412ff40 100644 --- a/OvmfPkg/VirtioScsiDxe/VirtioScsi.c +++ b/OvmfPkg/VirtioScsiDxe/VirtioScsi.c @@ -27,6 +27,7 @@ Copyright (C) 2012, Red Hat, Inc. Copyright (c) 2012 - 2014, Intel Corporation. All rights reserved.
+ Copyright (c) 2017, AMD Inc, All rights reserved.
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); -- 2.7.4