Lines Matching refs:devfn
57 static int setup_hwdom_device(u8 devfn, struct pci_dev *);
1326 u8 bus, u8 devfn, const struct pci_dev *pdev) in domain_context_mapping_one() argument
1339 context = &context_entries[devfn]; in domain_context_mapping_one()
1354 seg, bus, PCI_SLOT(devfn), PCI_FUNC(devfn), in domain_context_mapping_one()
1369 seg, bus, PCI_SLOT(devfn), PCI_FUNC(devfn)); in domain_context_mapping_one()
1377 seg, bus, PCI_SLOT(devfn), PCI_FUNC(devfn), in domain_context_mapping_one()
1447 rc = iommu_flush_context_device(iommu, 0, PCI_BDF2(bus, devfn), in domain_context_mapping_one()
1471 rc = me_wifi_quirk(domain, bus, devfn, MAP_ME_PHANTOM_FUNC); in domain_context_mapping_one()
1476 static int domain_context_mapping(struct domain *domain, u8 devfn, in domain_context_mapping() argument
1495 PCI_SLOT(devfn), PCI_FUNC(devfn)); in domain_context_mapping()
1509 PCI_SLOT(devfn), PCI_FUNC(devfn)); in domain_context_mapping()
1510 ret = domain_context_mapping_one(domain, drhd->iommu, bus, devfn, in domain_context_mapping()
1512 if ( !ret && devfn == pdev->devfn && ats_device(pdev, drhd) > 0 ) in domain_context_mapping()
1521 PCI_SLOT(devfn), PCI_FUNC(devfn)); in domain_context_mapping()
1523 ret = domain_context_mapping_one(domain, drhd->iommu, bus, devfn, in domain_context_mapping()
1528 if ( find_upstream_bridge(seg, &bus, &devfn, &secbus) < 1 ) in domain_context_mapping()
1531 ret = domain_context_mapping_one(domain, drhd->iommu, bus, devfn, in domain_context_mapping()
1532 pci_get_pdev(seg, bus, devfn)); in domain_context_mapping()
1539 if ( !ret && pdev_type(seg, bus, devfn) == DEV_TYPE_PCIe2PCI_BRIDGE && in domain_context_mapping()
1540 (secbus != pdev->bus || pdev->devfn != 0) ) in domain_context_mapping()
1549 seg, bus, PCI_SLOT(devfn), PCI_FUNC(devfn)); in domain_context_mapping()
1554 if ( !ret && devfn == pdev->devfn ) in domain_context_mapping()
1563 u8 bus, u8 devfn) in domain_context_unmap_one() argument
1575 context = &context_entries[devfn]; in domain_context_unmap_one()
1597 PCI_BDF2(bus, devfn), in domain_context_unmap_one()
1621 rc = me_wifi_quirk(domain, bus, devfn, UNMAP_ME_PHANTOM_FUNC); in domain_context_unmap_one()
1626 static int domain_context_unmap(struct domain *domain, u8 devfn, in domain_context_unmap() argument
1646 PCI_SLOT(devfn), PCI_FUNC(devfn)); in domain_context_unmap()
1660 PCI_SLOT(devfn), PCI_FUNC(devfn)); in domain_context_unmap()
1661 ret = domain_context_unmap_one(domain, iommu, bus, devfn); in domain_context_unmap()
1662 if ( !ret && devfn == pdev->devfn && ats_device(pdev, drhd) > 0 ) in domain_context_unmap()
1670 domain->domain_id, seg, bus, PCI_SLOT(devfn), PCI_FUNC(devfn)); in domain_context_unmap()
1671 ret = domain_context_unmap_one(domain, iommu, bus, devfn); in domain_context_unmap()
1676 tmp_devfn = devfn; in domain_context_unmap()
1697 seg, bus, PCI_SLOT(devfn), PCI_FUNC(devfn)); in domain_context_unmap()
1708 if ( pdev->seg == seg && pdev->bus == bus && pdev->devfn == devfn ) in domain_context_unmap()
1969 static int intel_iommu_add_device(u8 devfn, struct pci_dev *pdev) in intel_iommu_add_device() argument
1980 ret = domain_context_mapping(pdev->domain, devfn, pdev); in intel_iommu_add_device()
1992 PCI_DEVFN2(bdf) == devfn ) in intel_iommu_add_device()
2025 static int intel_iommu_remove_device(u8 devfn, struct pci_dev *pdev) in intel_iommu_remove_device() argument
2038 PCI_DEVFN2(bdf) != devfn ) in intel_iommu_remove_device()
2048 return domain_context_unmap(pdev->domain, devfn, pdev); in intel_iommu_remove_device()
2051 static int __hwdom_init setup_hwdom_device(u8 devfn, struct pci_dev *pdev) in setup_hwdom_device() argument
2053 return domain_context_mapping(pdev->domain, devfn, pdev); in setup_hwdom_device()
2337 u8 devfn, struct pci_dev *pdev) in reassign_device_ownership() argument
2363 PCI_DEVFN2(bdf) == devfn ) in reassign_device_ownership()
2375 ret = domain_context_unmap(source, devfn, pdev); in reassign_device_ownership()
2382 ret = domain_context_mapping(target, devfn, pdev); in reassign_device_ownership()
2391 if ( devfn == pdev->devfn ) in reassign_device_ownership()
2404 struct domain *d, u8 devfn, struct pci_dev *pdev, u32 flag) in intel_iommu_assign_device() argument
2431 PCI_DEVFN2(bdf) == devfn && in intel_iommu_assign_device()
2441 seg, bus, PCI_SLOT(devfn), PCI_FUNC(devfn), in intel_iommu_assign_device()
2448 ret = reassign_device_ownership(hardware_domain, d, devfn, pdev); in intel_iommu_assign_device()
2457 PCI_DEVFN2(bdf) == devfn ) in intel_iommu_assign_device()
2462 reassign_device_ownership(d, hardware_domain, devfn, pdev); in intel_iommu_assign_device()
2475 static int intel_iommu_group_id(u16 seg, u8 bus, u8 devfn) in intel_iommu_group_id() argument
2478 if ( find_upstream_bridge(seg, &bus, &devfn, &secbus) < 0 ) in intel_iommu_group_id()
2481 return PCI_BDF2(bus, devfn); in intel_iommu_group_id()