From patchwork Mon Mar 14 12:53:19 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laszlo Ersek X-Patchwork-Id: 63811 Delivered-To: patch@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp17982lbc; Mon, 14 Mar 2016 05:53:45 -0700 (PDT) X-Received: by 10.67.3.67 with SMTP id bu3mr35844189pad.39.1457960024077; Mon, 14 Mar 2016 05:53:44 -0700 (PDT) Return-Path: Received: from ml01.01.org (ml01.01.org. [2001:19d0:306:5::1]) by mx.google.com with ESMTPS id l9si17237261pfb.158.2016.03.14.05.53.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 14 Mar 2016 05:53:44 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) client-ip=2001:19d0:306:5::1; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 6D8861A1F96; Mon, 14 Mar 2016 05:54:01 -0700 (PDT) X-Original-To: edk2-devel@ml01.01.org Delivered-To: edk2-devel@ml01.01.org Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id B67E31A1E63 for ; Mon, 14 Mar 2016 05:54:00 -0700 (PDT) Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id 86756804EE; Mon, 14 Mar 2016 12:53:42 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-113-101.phx2.redhat.com [10.3.113.101]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u2ECraIH012537; Mon, 14 Mar 2016 08:53:41 -0400 From: Laszlo Ersek To: edk2-devel@ml01.01.org Date: Mon, 14 Mar 2016 13:53:19 +0100 Message-Id: <1457960012-29481-3-git-send-email-lersek@redhat.com> In-Reply-To: <1457960012-29481-1-git-send-email-lersek@redhat.com> References: <56E6B2D9.5010507@redhat.com> <1457960012-29481-1-git-send-email-lersek@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 Cc: Jordan Justen , Ard Biesheuvel Subject: [edk2] [wave 3 PATCH 02/15] OvmfPkg: VIRTIO_DEVICE_PROTOCOL: remove GetQueueAddress() member X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" This function was never consumed by drivers, and the current prototype is unsupportable with virtio-1.0. Remove the function from the protocol definition, and drop the current (unused) implementations. Cc: Ard Biesheuvel Cc: Jordan Justen Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek --- OvmfPkg/Include/Protocol/VirtioDevice.h | 22 -------------------- OvmfPkg/Library/VirtioMmioDeviceLib/VirtioMmioDevice.h | 7 ------- OvmfPkg/VirtioPciDeviceDxe/VirtioPciDevice.h | 7 ------- OvmfPkg/Library/VirtioMmioDeviceLib/VirtioMmioDevice.c | 1 - OvmfPkg/Library/VirtioMmioDeviceLib/VirtioMmioDeviceFunctions.c | 20 ------------------ OvmfPkg/VirtioPciDeviceDxe/VirtioPciDevice.c | 1 - OvmfPkg/VirtioPciDeviceDxe/VirtioPciFunctions.c | 19 ----------------- 7 files changed, 77 deletions(-) -- 1.8.3.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel diff --git a/OvmfPkg/Include/Protocol/VirtioDevice.h b/OvmfPkg/Include/Protocol/VirtioDevice.h index 15750f450cb2..f8afa7120a4c 100644 --- a/OvmfPkg/Include/Protocol/VirtioDevice.h +++ b/OvmfPkg/Include/Protocol/VirtioDevice.h @@ -123,35 +123,14 @@ typedef EFI_STATUS (EFIAPI *VIRTIO_SET_GUEST_FEATURES) ( IN VIRTIO_DEVICE_PROTOCOL *This, IN UINT64 Features ); /** - Read the queue address field from the Virtio Header. - - QueueAddress is the address of the virtqueue divided by 4096. - - @param[in] This This instance of VIRTIO_DEVICE_PROTOCOL - - @param[out] QueueAddress The 32-bit queue address field. - - @retval EFI_SUCCESS The data was read successfully. - @retval EFI_UNSUPPORTED The underlying IO device doesn't support the - provided address offset and read size. - @retval EFI_INVALID_PARAMETER QueueAddress is NULL -**/ -typedef -EFI_STATUS -(EFIAPI *VIRTIO_GET_QUEUE_ADDRESS) ( - IN VIRTIO_DEVICE_PROTOCOL *This, - OUT UINT32 *QueueAddress - ); - -/** Write the queue address field in the Virtio Header. The parameter Address must be the base address of the virtqueue divided by 4096. @param[in] This This instance of VIRTIO_DEVICE_PROTOCOL @@ -352,15 +331,14 @@ struct _VIRTIO_DEVICE_PROTOCOL { UINT32 Revision; /// From the Virtio Spec INT32 SubSystemDeviceId; VIRTIO_GET_DEVICE_FEATURES GetDeviceFeatures; VIRTIO_SET_GUEST_FEATURES SetGuestFeatures; - VIRTIO_GET_QUEUE_ADDRESS GetQueueAddress; VIRTIO_SET_QUEUE_ADDRESS SetQueueAddress; VIRTIO_SET_QUEUE_SEL SetQueueSel; VIRTIO_SET_QUEUE_NOTIFY SetQueueNotify; VIRTIO_SET_QUEUE_ALIGN SetQueueAlign; diff --git a/OvmfPkg/Library/VirtioMmioDeviceLib/VirtioMmioDevice.h b/OvmfPkg/Library/VirtioMmioDeviceLib/VirtioMmioDevice.h index d445c3dc197d..3b1e90ba9f3b 100644 --- a/OvmfPkg/Library/VirtioMmioDeviceLib/VirtioMmioDevice.h +++ b/OvmfPkg/Library/VirtioMmioDeviceLib/VirtioMmioDevice.h @@ -66,21 +66,14 @@ EFIAPI VirtioMmioGetDeviceFeatures ( IN VIRTIO_DEVICE_PROTOCOL *This, OUT UINT64 *DeviceFeatures ); EFI_STATUS EFIAPI -VirtioMmioGetQueueAddress ( - IN VIRTIO_DEVICE_PROTOCOL *This, - OUT UINT32 *QueueAddress - ); - -EFI_STATUS -EFIAPI VirtioMmioGetQueueSize ( IN VIRTIO_DEVICE_PROTOCOL *This, OUT UINT16 *QueueNumMax ); EFI_STATUS EFIAPI diff --git a/OvmfPkg/VirtioPciDeviceDxe/VirtioPciDevice.h b/OvmfPkg/VirtioPciDeviceDxe/VirtioPciDevice.h index 812061dc0c25..95f82611e295 100644 --- a/OvmfPkg/VirtioPciDeviceDxe/VirtioPciDevice.h +++ b/OvmfPkg/VirtioPciDeviceDxe/VirtioPciDevice.h @@ -84,21 +84,14 @@ EFIAPI VirtioPciGetDeviceFeatures ( IN VIRTIO_DEVICE_PROTOCOL *This, OUT UINT64 *DeviceFeatures ); EFI_STATUS EFIAPI -VirtioPciGetQueueAddress ( - IN VIRTIO_DEVICE_PROTOCOL *This, - OUT UINT32 *QueueAddress - ); - -EFI_STATUS -EFIAPI VirtioPciGetQueueSize ( IN VIRTIO_DEVICE_PROTOCOL *This, OUT UINT16 *QueueNumMax ); EFI_STATUS EFIAPI diff --git a/OvmfPkg/Library/VirtioMmioDeviceLib/VirtioMmioDevice.c b/OvmfPkg/Library/VirtioMmioDeviceLib/VirtioMmioDevice.c index 4af9dd0ac296..b1d443ea7007 100644 --- a/OvmfPkg/Library/VirtioMmioDeviceLib/VirtioMmioDevice.c +++ b/OvmfPkg/Library/VirtioMmioDeviceLib/VirtioMmioDevice.c @@ -21,15 +21,14 @@ #include "VirtioMmioDevice.h" static VIRTIO_DEVICE_PROTOCOL mMmioDeviceProtocolTemplate = { 0, // Revision 0, // SubSystemDeviceId VirtioMmioGetDeviceFeatures, // GetDeviceFeatures VirtioMmioSetGuestFeatures, // SetGuestFeatures - VirtioMmioGetQueueAddress, // GetQueueAddress VirtioMmioSetQueueAddress, // SetQueueAddress VirtioMmioSetQueueSel, // SetQueueSel VirtioMmioSetQueueNotify, // SetQueueNotify VirtioMmioSetQueueAlignment, // SetQueueAlign VirtioMmioSetPageSize, // SetPageSize VirtioMmioGetQueueSize, // GetQueueNumMax VirtioMmioSetQueueSize, // SetQueueNum diff --git a/OvmfPkg/Library/VirtioMmioDeviceLib/VirtioMmioDeviceFunctions.c b/OvmfPkg/Library/VirtioMmioDeviceLib/VirtioMmioDeviceFunctions.c index 4b7d29328362..2cd293ab88d9 100644 --- a/OvmfPkg/Library/VirtioMmioDeviceLib/VirtioMmioDeviceFunctions.c +++ b/OvmfPkg/Library/VirtioMmioDeviceLib/VirtioMmioDeviceFunctions.c @@ -36,34 +36,14 @@ VirtioMmioGetDeviceFeatures ( *DeviceFeatures = VIRTIO_CFG_READ (Device, VIRTIO_MMIO_OFFSET_HOST_FEATURES); return EFI_SUCCESS; } EFI_STATUS EFIAPI -VirtioMmioGetQueueAddress ( - IN VIRTIO_DEVICE_PROTOCOL *This, - OUT UINT32 *QueueAddress - ) -{ - VIRTIO_MMIO_DEVICE *Device; - - if (QueueAddress == NULL) { - return EFI_INVALID_PARAMETER; - } - - Device = VIRTIO_MMIO_DEVICE_FROM_VIRTIO_DEVICE (This); - - *QueueAddress = VIRTIO_CFG_READ (Device, VIRTIO_MMIO_OFFSET_QUEUE_PFN); - - return EFI_SUCCESS; -} - -EFI_STATUS -EFIAPI VirtioMmioGetQueueSize ( IN VIRTIO_DEVICE_PROTOCOL *This, OUT UINT16 *QueueNumMax ) { VIRTIO_MMIO_DEVICE *Device; diff --git a/OvmfPkg/VirtioPciDeviceDxe/VirtioPciDevice.c b/OvmfPkg/VirtioPciDeviceDxe/VirtioPciDevice.c index 2647bd39189b..25b06fcfd5ae 100644 --- a/OvmfPkg/VirtioPciDeviceDxe/VirtioPciDevice.c +++ b/OvmfPkg/VirtioPciDeviceDxe/VirtioPciDevice.c @@ -26,15 +26,14 @@ #include "VirtioPciDevice.h" STATIC VIRTIO_DEVICE_PROTOCOL mDeviceProtocolTemplate = { 0, // Revision 0, // SubSystemDeviceId VirtioPciGetDeviceFeatures, // GetDeviceFeatures VirtioPciSetGuestFeatures, // SetGuestFeatures - VirtioPciGetQueueAddress, // GetQueueAddress VirtioPciSetQueueAddress, // SetQueueAddress VirtioPciSetQueueSel, // SetQueueSel VirtioPciSetQueueNotify, // SetQueueNotify VirtioPciSetQueueAlignment, // SetQueueAlignment VirtioPciSetPageSize, // SetPageSize VirtioPciGetQueueSize, // GetQueueNumMax VirtioPciSetQueueSize, // SetQueueNum diff --git a/OvmfPkg/VirtioPciDeviceDxe/VirtioPciFunctions.c b/OvmfPkg/VirtioPciDeviceDxe/VirtioPciFunctions.c index d8d30f9af63d..4ba37a2d1ceb 100644 --- a/OvmfPkg/VirtioPciDeviceDxe/VirtioPciFunctions.c +++ b/OvmfPkg/VirtioPciDeviceDxe/VirtioPciFunctions.c @@ -120,33 +120,14 @@ VirtioPciGetDeviceFeatures ( *DeviceFeatures = Features32; } return Status; } EFI_STATUS EFIAPI -VirtioPciGetQueueAddress ( - IN VIRTIO_DEVICE_PROTOCOL *This, - OUT UINT32 *QueueAddress - ) -{ - VIRTIO_PCI_DEVICE *Dev; - - if (QueueAddress == NULL) { - return EFI_INVALID_PARAMETER; - } - - Dev = VIRTIO_PCI_DEVICE_FROM_VIRTIO_DEVICE (This); - - return VirtioPciIoRead (Dev, VIRTIO_PCI_OFFSET_QUEUE_ADDRESS, sizeof (UINT32), - sizeof (UINT32), QueueAddress); -} - -EFI_STATUS -EFIAPI VirtioPciGetQueueSize ( IN VIRTIO_DEVICE_PROTOCOL *This, OUT UINT16 *QueueNumMax ) { VIRTIO_PCI_DEVICE *Dev;