summaryrefslogtreecommitdiffstats
path: root/drivers/pci/iov.c
diff options
context:
space:
mode:
authorDavid Woodhouse <David.Woodhouse@intel.com>2010-04-09 16:17:41 +0200
committerDavid Woodhouse <David.Woodhouse@intel.com>2010-04-09 16:21:12 +0200
commit87d8a69709d971913e6cc7210450fcb8be963667 (patch)
tree4f8eb95c588f7df84554dcf97d67540664333a7b /drivers/pci/iov.c
parentintel-iommu: Fix section mismatch dmar_ir_support() uses dmar_tbl. (diff)
parentLinux 2.6.34-rc3 (diff)
downloadlinux-87d8a69709d971913e6cc7210450fcb8be963667.tar.xz
linux-87d8a69709d971913e6cc7210450fcb8be963667.zip
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
Diffstat (limited to 'drivers/pci/iov.c')
-rw-r--r--drivers/pci/iov.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/pci/iov.c b/drivers/pci/iov.c
index b2a448e19fe6..3e5ab2bf6a5c 100644
--- a/drivers/pci/iov.c
+++ b/drivers/pci/iov.c
@@ -706,6 +706,21 @@ irqreturn_t pci_sriov_migration(struct pci_dev *dev)
}
EXPORT_SYMBOL_GPL(pci_sriov_migration);
+/**
+ * pci_num_vf - return number of VFs associated with a PF device_release_driver
+ * @dev: the PCI device
+ *
+ * Returns number of VFs, or 0 if SR-IOV is not enabled.
+ */
+int pci_num_vf(struct pci_dev *dev)
+{
+ if (!dev || !dev->is_physfn)
+ return 0;
+ else
+ return dev->sriov->nr_virtfn;
+}
+EXPORT_SYMBOL_GPL(pci_num_vf);
+
static int ats_alloc_one(struct pci_dev *dev, int ps)
{
int pos;