]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - include/linux/pci.h
intel-iommu: use physfn to search drhd for VF
[karo-tx-linux.git] / include / linux / pci.h
index a788fa12ff310b7831587ebc4565e01d5e76d726..a327322a33abef0b74967f5bd0a82962d74e9ab5 100644 (file)
@@ -334,6 +334,16 @@ struct pci_dev {
 #endif
 };
 
+static inline struct pci_dev *pci_physfn(struct pci_dev *dev)
+{
+#ifdef CONFIG_PCI_IOV
+       if (dev->is_virtfn)
+               dev = dev->physfn;
+#endif
+
+       return dev;
+}
+
 extern struct pci_dev *alloc_pci_dev(void);
 
 #define pci_dev_b(n) list_entry(n, struct pci_dev, bus_list)