aboutsummaryrefslogtreecommitdiff
path: root/include/hw/virtio
diff options
context:
space:
mode:
authorLongpeng <longpeng2@huawei.com>2022-12-15 21:49:40 +0800
committerMichael S. Tsirkin <mst@redhat.com>2022-12-21 06:35:28 -0500
commit22733245406a3d4e5428032172fdf041a48ac23d (patch)
tree9bee81275cc5fd4525ef813599f38e47f2bfc0b5 /include/hw/virtio
parentee1c08bd732283aa15e5b6fa840511b7c9c18006 (diff)
downloadqemu-22733245406a3d4e5428032172fdf041a48ac23d.zip
qemu-22733245406a3d4e5428032172fdf041a48ac23d.tar.gz
qemu-22733245406a3d4e5428032172fdf041a48ac23d.tar.bz2
virtio: get class_id and pci device id by the virtio id
Add helpers to get the "Transitional PCI Device ID" and "class_id" of the device specified by the "Virtio Device ID". These helpers will be used to build the generic vDPA device later. Acked-by: Jason Wang <jasowang@redhat.com> Signed-off-by: Longpeng <longpeng2@huawei.com> Message-Id: <20221215134944.2809-2-longpeng2@huawei.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'include/hw/virtio')
-rw-r--r--include/hw/virtio/virtio-pci.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/hw/virtio/virtio-pci.h b/include/hw/virtio/virtio-pci.h
index 938799e..24fba16 100644
--- a/include/hw/virtio/virtio-pci.h
+++ b/include/hw/virtio/virtio-pci.h
@@ -151,6 +151,8 @@ struct VirtIOPCIProxy {
bool disable_modern;
bool ignore_backend_features;
OnOffAuto disable_legacy;
+ /* Transitional device id */
+ uint16_t trans_devid;
uint32_t class_code;
uint32_t nvectors;
uint32_t dfselect;
@@ -184,6 +186,9 @@ static inline void virtio_pci_disable_modern(VirtIOPCIProxy *proxy)
proxy->disable_modern = true;
}
+uint16_t virtio_pci_get_trans_devid(uint16_t device_id);
+uint16_t virtio_pci_get_class_id(uint16_t device_id);
+
/*
* virtio-input-pci: This extends VirtioPCIProxy.
*/