mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-06-25 23:13:26 +00:00
HV: remove pbdf from struct pci_vdev
pci_vdev contains a pointer to pdev, which stores pbdf, so there is no need to store a separate pbdf in vdev. Tracked-On: #2534 Signed-off-by: dongshen <dongsheng.x.zhang@intel.com> Reviewed-by: Eddie Dong <eddie.dong@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
parent
4d11985366
commit
8bc0e128a9
@ -67,13 +67,13 @@ static inline bool is_valid_bar(const struct pci_bar *bar)
|
|||||||
return (is_valid_bar_type(bar) && is_valid_bar_size(bar));
|
return (is_valid_bar_type(bar) && is_valid_bar_size(bar));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void partition_mode_pdev_init(struct pci_vdev *vdev)
|
static void partition_mode_pdev_init(struct pci_vdev *vdev, union pci_bdf pbdf)
|
||||||
{
|
{
|
||||||
struct pci_pdev *pdev_ref;
|
struct pci_pdev *pdev_ref;
|
||||||
uint32_t idx;
|
uint32_t idx;
|
||||||
struct pci_bar *pbar, *vbar;
|
struct pci_bar *pbar, *vbar;
|
||||||
|
|
||||||
pdev_ref = find_pci_pdev(vdev->pbdf);
|
pdev_ref = find_pci_pdev(pbdf);
|
||||||
if (pdev_ref != NULL) {
|
if (pdev_ref != NULL) {
|
||||||
vdev->pdev = pdev_ref;
|
vdev->pdev = pdev_ref;
|
||||||
|
|
||||||
@ -107,10 +107,9 @@ static int32_t partition_mode_vpci_init(const struct acrn_vm *vm)
|
|||||||
ptdev_config = vm_config->pci_ptdevs + i;
|
ptdev_config = vm_config->pci_ptdevs + i;
|
||||||
vdev->vpci = vpci;
|
vdev->vpci = vpci;
|
||||||
vdev->vbdf.value = ptdev_config->vbdf.value;
|
vdev->vbdf.value = ptdev_config->vbdf.value;
|
||||||
vdev->pbdf.value = ptdev_config->pbdf.value;
|
|
||||||
|
|
||||||
if (vdev->vbdf.value != 0U) {
|
if (vdev->vbdf.value != 0U) {
|
||||||
partition_mode_pdev_init(vdev);
|
partition_mode_pdev_init(vdev, ptdev_config->pbdf);
|
||||||
vdev->ops = &pci_ops_vdev_pt;
|
vdev->ops = &pci_ops_vdev_pt;
|
||||||
} else {
|
} else {
|
||||||
vdev->ops = &pci_ops_vdev_hostbridge;
|
vdev->ops = &pci_ops_vdev_hostbridge;
|
||||||
|
@ -91,9 +91,6 @@ struct pci_vdev {
|
|||||||
/* The bus/device/function triple of the virtual PCI device. */
|
/* The bus/device/function triple of the virtual PCI device. */
|
||||||
union pci_bdf vbdf;
|
union pci_bdf vbdf;
|
||||||
|
|
||||||
/* The bus/device/function triple of the physical PCI device. */
|
|
||||||
union pci_bdf pbdf;
|
|
||||||
|
|
||||||
struct pci_pdev *pdev;
|
struct pci_pdev *pdev;
|
||||||
|
|
||||||
union pci_cfgdata cfgdata;
|
union pci_cfgdata cfgdata;
|
||||||
|
Loading…
Reference in New Issue
Block a user