hv: vpci: add each vdev_ops for each emulated PCI device

Add a field (vdev_ops) in struct acrn_vm_pci_dev_config to configure a PCI CFG
operation for an emulated PCI device. Use pci_pt_dev_ops for PCI_DEV_TYPE_PTDEV
by default if there's no such configure.

Tracked-On: #3475
Signed-off-by: Li, Fei1 <fei1.li@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
Li, Fei1
2019-08-07 23:29:18 +08:00
committed by ACRN System Integration
parent ff54fa2325
commit 4c8e60f1d0
6 changed files with 14 additions and 14 deletions

View File

@@ -7,6 +7,7 @@
#include <vm_config.h>
#include <pci.h>
#include <pci_dev.h>
#include <vpci.h>
/*
* In theory, emulated PCI device doesn't need to bind to physical PCI device.
@@ -19,6 +20,7 @@ struct acrn_vm_pci_dev_config sos_pci_devs[CONFIG_MAX_PCI_DEV_NUM] = {
.emu_type = PCI_DEV_TYPE_HVEMUL,
.vbdf.bits = {.b = 0x00U, .d = 0x00U, .f = 0x00U},
.pbdf.bits = {.b = 0x00U, .d = 0x00U, .f = 0x00U},
.vdev_ops = &vhostbridge_ops,
},
};