aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/iov.c
diff options
context:
space:
mode:
authorAndrea Bastoni <bastoni@cs.unc.edu>2010-05-30 19:16:45 -0400
committerAndrea Bastoni <bastoni@cs.unc.edu>2010-05-30 19:16:45 -0400
commitada47b5fe13d89735805b566185f4885f5a3f750 (patch)
tree644b88f8a71896307d71438e9b3af49126ffb22b /drivers/pci/iov.c
parent43e98717ad40a4ae64545b5ba047c7b86aa44f4f (diff)
parent3280f21d43ee541f97f8cda5792150d2dbec20d5 (diff)
Merge branch 'wip-2.6.34' into old-private-masterarchived-private-master
Diffstat (limited to 'drivers/pci/iov.c')
-rw-r--r--drivers/pci/iov.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/drivers/pci/iov.c b/drivers/pci/iov.c
index e03fe98f0619..ce6a3666b3d9 100644
--- a/drivers/pci/iov.c
+++ b/drivers/pci/iov.c
@@ -9,6 +9,7 @@
9 */ 9 */
10 10
11#include <linux/pci.h> 11#include <linux/pci.h>
12#include <linux/slab.h>
12#include <linux/mutex.h> 13#include <linux/mutex.h>
13#include <linux/string.h> 14#include <linux/string.h>
14#include <linux/delay.h> 15#include <linux/delay.h>
@@ -555,7 +556,7 @@ int pci_iov_init(struct pci_dev *dev)
555{ 556{
556 int pos; 557 int pos;
557 558
558 if (!dev->is_pcie) 559 if (!pci_is_pcie(dev))
559 return -ENODEV; 560 return -ENODEV;
560 561
561 pos = pci_find_ext_capability(dev, PCI_EXT_CAP_ID_SRIOV); 562 pos = pci_find_ext_capability(dev, PCI_EXT_CAP_ID_SRIOV);
@@ -706,6 +707,21 @@ irqreturn_t pci_sriov_migration(struct pci_dev *dev)
706} 707}
707EXPORT_SYMBOL_GPL(pci_sriov_migration); 708EXPORT_SYMBOL_GPL(pci_sriov_migration);
708 709
710/**
711 * pci_num_vf - return number of VFs associated with a PF device_release_driver
712 * @dev: the PCI device
713 *
714 * Returns number of VFs, or 0 if SR-IOV is not enabled.
715 */
716int pci_num_vf(struct pci_dev *dev)
717{
718 if (!dev || !dev->is_physfn)
719 return 0;
720 else
721 return dev->sriov->nr_virtfn;
722}
723EXPORT_SYMBOL_GPL(pci_num_vf);
724
709static int ats_alloc_one(struct pci_dev *dev, int ps) 725static int ats_alloc_one(struct pci_dev *dev, int ps)
710{ 726{
711 int pos; 727 int pos;