if ( !iommu_enabled || !hd->platform_ops )
return 0;
- rc = hd->platform_ops->add_device(pdev->devfn, pdev);
+ rc = hd->platform_ops->add_device(pdev->devfn, pci_to_dev(pdev));
if ( rc || !pdev->phantom_stride )
return rc;
devfn += pdev->phantom_stride;
if ( PCI_SLOT(devfn) != PCI_SLOT(pdev->devfn) )
return 0;
- rc = hd->platform_ops->add_device(devfn, pdev);
+ rc = hd->platform_ops->add_device(devfn, pci_to_dev(pdev));
if ( rc )
printk(XENLOG_WARNING "IOMMU: add %04x:%02x:%02x.%u failed (%d)\n",
pdev->seg, pdev->bus, PCI_SLOT(devfn), PCI_FUNC(devfn), rc);
!hd->platform_ops->enable_device )
return 0;
- return hd->platform_ops->enable_device(pdev);
+ return hd->platform_ops->enable_device(pci_to_dev(pdev));
}
int iommu_remove_device(struct pci_dev *pdev)
devfn += pdev->phantom_stride;
if ( PCI_SLOT(devfn) != PCI_SLOT(pdev->devfn) )
break;
- rc = hd->platform_ops->remove_device(devfn, pdev);
+ rc = hd->platform_ops->remove_device(devfn, pci_to_dev(pdev));
if ( !rc )
continue;
return rc;
}
- return hd->platform_ops->remove_device(pdev->devfn, pdev);
+ return hd->platform_ops->remove_device(pdev->devfn, pci_to_dev(pdev));
}
/*
pdev->fault.count = 0;
- if ( (rc = hd->platform_ops->assign_device(d, devfn, pdev)) )
+ if ( (rc = hd->platform_ops->assign_device(d, devfn, pci_to_dev(pdev))) )
goto done;
for ( ; pdev->phantom_stride; rc = 0 )
devfn += pdev->phantom_stride;
if ( PCI_SLOT(devfn) != PCI_SLOT(pdev->devfn) )
break;
- rc = hd->platform_ops->assign_device(d, devfn, pdev);
+ rc = hd->platform_ops->assign_device(d, devfn, pci_to_dev(pdev));
if ( rc )
printk(XENLOG_G_WARNING "d%d: assign %04x:%02x:%02x.%u failed (%d)\n",
d->domain_id, seg, bus, PCI_SLOT(devfn), PCI_FUNC(devfn),
devfn += pdev->phantom_stride;
if ( PCI_SLOT(devfn) != PCI_SLOT(pdev->devfn) )
break;
- ret = hd->platform_ops->reassign_device(d, hardware_domain, devfn, pdev);
+ ret = hd->platform_ops->reassign_device(d, hardware_domain, devfn,
+ pci_to_dev(pdev));
if ( !ret )
continue;
}
devfn = pdev->devfn;
- ret = hd->platform_ops->reassign_device(d, hardware_domain, devfn, pdev);
+ ret = hd->platform_ops->reassign_device(d, hardware_domain, devfn,
+ pci_to_dev(pdev));
if ( ret )
{
dprintk(XENLOG_G_ERR,
struct iommu_ops {
int (*init)(struct domain *d);
void (*hwdom_init)(struct domain *d);
-#ifdef HAS_PCI
- int (*add_device)(u8 devfn, struct pci_dev *);
- int (*enable_device)(struct pci_dev *pdev);
- int (*remove_device)(u8 devfn, struct pci_dev *);
- int (*assign_device)(struct domain *, u8 devfn, struct pci_dev *);
+ int (*add_device)(u8 devfn, device_t *dev);
+ int (*enable_device)(device_t *dev);
+ int (*remove_device)(u8 devfn, device_t *dev);
+ int (*assign_device)(struct domain *, u8 devfn, device_t *dev);
int (*reassign_device)(struct domain *s, struct domain *t,
- u8 devfn, struct pci_dev *);
+ u8 devfn, device_t *dev);
+#ifdef HAS_PCI
int (*get_device_group_id)(u16 seg, u8 bus, u8 devfn);
int (*update_ire_from_msi)(struct msi_desc *msi_desc, struct msi_msg *msg);
void (*read_msi_from_ire)(struct msi_desc *msi_desc, struct msi_msg *msg);
#endif /* HAS_PCI */
-#ifdef HAS_DEVICE_TREE
- int (*assign_dt_device)(struct domain *d, const struct dt_device_node *dev);
- int (*reassign_dt_device)(struct domain *s, struct domain *t,
- const struct dt_device_node *dev);
-#endif
void (*teardown)(struct domain *d);
int (*map_page)(struct domain *d, unsigned long gfn, unsigned long mfn,