diff options
Diffstat (limited to 'drivers/pci')
-rw-r--r-- | drivers/pci/iov.c | 15 |
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) | |||
706 | } | 706 | } |
707 | EXPORT_SYMBOL_GPL(pci_sriov_migration); | 707 | EXPORT_SYMBOL_GPL(pci_sriov_migration); |
708 | 708 | ||
709 | /** | ||
710 | * pci_num_vf - return number of VFs associated with a PF device_release_driver | ||
711 | * @dev: the PCI device | ||
712 | * | ||
713 | * Returns number of VFs, or 0 if SR-IOV is not enabled. | ||
714 | */ | ||
715 | int pci_num_vf(struct pci_dev *dev) | ||
716 | { | ||
717 | if (!dev || !dev->is_physfn) | ||
718 | return 0; | ||
719 | else | ||
720 | return dev->sriov->nr_virtfn; | ||
721 | } | ||
722 | EXPORT_SYMBOL_GPL(pci_num_vf); | ||
723 | |||
709 | static int ats_alloc_one(struct pci_dev *dev, int ps) | 724 | static int ats_alloc_one(struct pci_dev *dev, int ps) |
710 | { | 725 | { |
711 | int pos; | 726 | int pos; |