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.
Acked-by: Eddie Dong
@@ -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 {
