diff --git a/hypervisor/include/dm/vpci.h b/hypervisor/include/dm/vpci.h index 772c09ff4..2aea1bd84 100644 --- a/hypervisor/include/dm/vpci.h +++ b/hypervisor/include/dm/vpci.h @@ -64,6 +64,14 @@ union pci_cfgdata { uint32_t data_32[(PCI_REGMAX + 1U) >> 4U]; }; +struct pci_vdev; +struct pci_vdev_ops { + void (*init_vdev)(struct pci_vdev *vdev); + void (*deinit_vdev)(struct pci_vdev *vdev); + int32_t (*write_vdev_cfg)(struct pci_vdev *vdev, uint32_t offset, uint32_t bytes, uint32_t val); + int32_t (*read_vdev_cfg)(struct pci_vdev *vdev, uint32_t offset, uint32_t bytes, uint32_t *val); +}; + struct pci_vdev { const struct acrn_vpci *vpci; /* The bus/device/function triple of the virtual PCI device. */ @@ -85,6 +93,9 @@ struct pci_vdev { /* Pointer to corresponding PCI PT device's vm_config */ struct acrn_vm_pci_ptdev_config *ptdev_config; + + /* Pointer to corressponding operations */ + struct pci_vdev_ops *vdev_ops; }; struct pci_addr_info {