Skip to content

Commit c2d25aa

Browse files
fyin1acrnsi
authored andcommitted
pci_vdev: add pci_vdev_ops to pci_vdev
It will be used to define pci vdev own ops. And high level API will call this ops intead of invoking device specific functions directly. Tracked-On: #3241 Signed-off-by: Yin Fengwei <fengwei.yin@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
1 parent 7a3ea2a commit c2d25aa

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

hypervisor/include/dm/vpci.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,14 @@ union pci_cfgdata {
6464
uint32_t data_32[(PCI_REGMAX + 1U) >> 4U];
6565
};
6666

67+
struct pci_vdev;
68+
struct pci_vdev_ops {
69+
void (*init_vdev)(struct pci_vdev *vdev);
70+
void (*deinit_vdev)(struct pci_vdev *vdev);
71+
int32_t (*write_vdev_cfg)(struct pci_vdev *vdev, uint32_t offset, uint32_t bytes, uint32_t val);
72+
int32_t (*read_vdev_cfg)(struct pci_vdev *vdev, uint32_t offset, uint32_t bytes, uint32_t *val);
73+
};
74+
6775
struct pci_vdev {
6876
const struct acrn_vpci *vpci;
6977
/* The bus/device/function triple of the virtual PCI device. */
@@ -85,6 +93,9 @@ struct pci_vdev {
8593

8694
/* Pointer to corresponding PCI PT device's vm_config */
8795
struct acrn_vm_pci_ptdev_config *ptdev_config;
96+
97+
/* Pointer to corressponding operations */
98+
struct pci_vdev_ops *vdev_ops;
8899
};
89100

90101
struct pci_addr_info {

0 commit comments

Comments
 (0)