Lines Matching defs:pdev
38 #define IS_GFX_DEVICE(pdev) ((pdev->class >> 16) == PCI_BASE_CLASS_DISPLAY)
39 #define IS_USB_DEVICE(pdev) ((pdev->class >> 8) == PCI_CLASS_SERIAL_USB)
40 #define IS_ISA_DEVICE(pdev) ((pdev->class >> 8) == PCI_CLASS_BRIDGE_ISA)
41 #define IS_AZALIA(pdev) ((pdev)->vendor == 0x8086 && (pdev)->device == 0x3a3e)
643 struct pci_dev *pdev, *pbridge;
648 pdev = to_pci_dev(dev);
652 pbridge->subordinate->number <= pdev->bus->number &&
653 pbridge->subordinate->busn_res.end >= pdev->bus->number)
659 static bool quirk_ioat_snb_local_iommu(struct pci_dev *pdev)
670 rc = pci_bus_read_config_dword(pdev->bus, PCI_DEVFN(0, 0), 0xb0, &vtbar);
673 dev_info(&pdev->dev, "failed to run vt-d quirk\n");
679 drhd = dmar_find_matched_drhd_unit(pdev);
695 struct pci_dev *pdev = to_pci_dev(dev);
697 if (pdev->vendor == PCI_VENDOR_ID_INTEL &&
698 pdev->device == PCI_DEVICE_ID_INTEL_IOAT_SNB &&
699 quirk_ioat_snb_local_iommu(pdev))
709 struct pci_dev *pdev = NULL;
721 pdev = pci_real_dma_dev(to_pci_dev(dev));
725 pf_pdev = pci_physfn(pdev);
727 segment = pci_domain_nr(pdev->bus);
733 if (pdev && segment != drhd->segment)
743 if (pdev && pdev->is_virtfn)
757 if (pdev && drhd->include_all) {
760 *bus = pdev->bus->number;
761 *devfn = pdev->devfn;
1398 static bool dev_needs_extra_dtlb_flush(struct pci_dev *pdev)
1400 if (pdev->vendor != PCI_VENDOR_ID_INTEL)
1403 if ((pdev->device & 0xfffc) != BUGGY_QAT_DEVID_MASK)
1411 struct pci_dev *pdev;
1416 pdev = to_pci_dev(info->dev);
1423 if (info->pasid_supported && !pci_enable_pasid(pdev, info->pasid_supported & ~1))
1426 if (info->ats_supported && pci_ats_page_aligned(pdev) &&
1427 !pci_enable_ats(pdev, VTD_PAGE_SHIFT)) {
1435 struct pci_dev *pdev;
1440 pdev = to_pci_dev(info->dev);
1443 pci_disable_ats(pdev);
1449 pci_disable_pasid(pdev);
2073 static int domain_context_mapping_cb(struct pci_dev *pdev,
2515 struct pci_dev *pdev;
2520 pdev = to_pci_dev(dev);
2521 if (IS_USB_DEVICE(pdev) || IS_GFX_DEVICE(pdev))
2541 struct pci_dev *pdev = to_pci_dev(dev);
2543 if ((iommu_identity_mapping & IDENTMAP_AZALIA) && IS_AZALIA(pdev))
2546 if ((iommu_identity_mapping & IDENTMAP_GFX) && IS_GFX_DEVICE(pdev))
3696 struct pci_dev *pdev = NULL;
3698 for_each_pci_dev(pdev)
3699 if (pdev->external_facing) {
3700 pci_dev_put(pdev);
3912 static int domain_context_clear_one_cb(struct pci_dev *pdev, u16 alias, void *opaque)
4346 struct pci_dev *pdev = dev_is_pci(dev) ? to_pci_dev(dev) : NULL;
4361 info->bus = pdev->bus->number;
4362 info->devfn = pdev->devfn;
4363 info->segment = pci_domain_nr(pdev->bus);
4374 pci_ats_supported(pdev) &&
4375 dmar_ats_supported(pdev, iommu)) {
4377 info->dtlb_extra_inval = dev_needs_extra_dtlb_flush(pdev);
4387 info->pfsid = pci_dev_id(pci_physfn(pdev));
4388 info->ats_qdep = pci_ats_queue_depth(pdev);
4392 int features = pci_pasid_features(pdev);
4399 pci_pri_supported(pdev))
4475 struct pci_dev *pdev = to_pci_dev(device);
4477 if ((pdev->class >> 8) == PCI_CLASS_BRIDGE_ISA) {
4539 struct pci_dev *pdev = dev_is_pci(dev) ? to_pci_dev(dev) : NULL;
4544 if (!pdev || !info || !info->ats_enabled || !info->pri_supported)
4555 if (info->pasid_enabled && !pci_prg_resp_pasid_required(pdev))
4558 ret = pci_reset_pri(pdev);
4570 ret = pci_enable_pri(pdev, PRQ_DEPTH);
4657 static bool risky_device(struct pci_dev *pdev)
4659 if (pdev->untrusted) {
4660 pci_info(pdev,
4662 pdev->vendor, pdev->device);
4663 pci_info(pdev, "Please check with your BIOS/Platform vendor about this\n");
4955 struct pci_dev *pdev;
4959 pdev = pci_get_device(PCI_VENDOR_ID_INTEL, 0x3a3e, NULL);
4960 if (!pdev)
4963 if (risky_device(pdev)) {
4964 pci_dev_put(pdev);
4968 pci_dev_put(pdev);
4973 pdev = pci_get_device(PCI_VENDOR_ID_INTEL, 0x342e, NULL);
4974 if (!pdev)
4977 if (risky_device(pdev)) {
4978 pci_dev_put(pdev);
4982 if (pci_read_config_dword(pdev, 0x188, &vtisochctrl)) {
4983 pci_dev_put(pdev);
4987 pci_dev_put(pdev);