[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC 3/3] virtio: Fix shared memory capability
From: |
Antonio Caggiano |
Subject: |
[RFC 3/3] virtio: Fix shared memory capability |
Date: |
Tue, 28 Sep 2021 15:15:48 +0200 |
Remove virtio_pci_shm_cap as virtio_pci_cap64 should be used instead.
Signed-off-by: Antonio Caggiano <antonio.caggiano@collabora.com>
---
hw/virtio/virtio-pci.c | 4 ++--
include/standard-headers/linux/virtio_pci.h | 7 -------
2 files changed, 2 insertions(+), 9 deletions(-)
diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c
index 9c7b8942c8..200f1e38ef 100644
--- a/hw/virtio/virtio-pci.c
+++ b/hw/virtio/virtio-pci.c
@@ -1166,7 +1166,7 @@ int virtio_pci_add_shm_cap(VirtIOPCIProxy *proxy,
uint8_t bar, uint64_t offset, uint64_t length,
uint8_t id)
{
- struct virtio_pci_shm_cap cap = {
+ struct virtio_pci_cap64 cap = {
.cap.cap_len = sizeof cap,
.cap.cfg_type = VIRTIO_PCI_CAP_SHARED_MEMORY_CFG,
};
@@ -1177,7 +1177,7 @@ int virtio_pci_add_shm_cap(VirtIOPCIProxy *proxy,
cap.length_hi = cpu_to_le32((length >> 32) & mask32);
cap.cap.offset = cpu_to_le32(offset & mask32);
cap.offset_hi = cpu_to_le32((offset >> 32) & mask32);
- cap.id = id;
+ cap.cap.id = id;
return virtio_pci_add_mem_cap(proxy, &cap.cap);
}
diff --git a/include/standard-headers/linux/virtio_pci.h
b/include/standard-headers/linux/virtio_pci.h
index 85d1420d29..db7a8e2fcb 100644
--- a/include/standard-headers/linux/virtio_pci.h
+++ b/include/standard-headers/linux/virtio_pci.h
@@ -172,13 +172,6 @@ struct virtio_pci_cfg_cap {
uint8_t pci_cfg_data[4]; /* Data for BAR access. */
};
-struct virtio_pci_shm_cap {
- struct virtio_pci_cap cap;
- uint32_t offset_hi; /* Most sig 32 bits of offset */
- uint32_t length_hi; /* Most sig 32 bits of length */
- uint8_t id; /* To distinguish shm chunks */
-};
-
/* Macro versions of offsets for the Old Timers! */
#define VIRTIO_PCI_CAP_VNDR 0
#define VIRTIO_PCI_CAP_NEXT 1
--
2.30.2