diff options
author | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-05-30 19:16:45 -0400 |
---|---|---|
committer | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-05-30 19:16:45 -0400 |
commit | ada47b5fe13d89735805b566185f4885f5a3f750 (patch) | |
tree | 644b88f8a71896307d71438e9b3af49126ffb22b /drivers/pci/iov.c | |
parent | 43e98717ad40a4ae64545b5ba047c7b86aa44f4f (diff) | |
parent | 3280f21d43ee541f97f8cda5792150d2dbec20d5 (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.c | 18 |
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 | } |
707 | EXPORT_SYMBOL_GPL(pci_sriov_migration); | 708 | EXPORT_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 | */ | ||
716 | int 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 | } | ||
723 | EXPORT_SYMBOL_GPL(pci_num_vf); | ||
724 | |||
709 | static int ats_alloc_one(struct pci_dev *dev, int ps) | 725 | static int ats_alloc_one(struct pci_dev *dev, int ps) |
710 | { | 726 | { |
711 | int pos; | 727 | int pos; |