aboutsummaryrefslogtreecommitdiff
path: root/drivers/pci/iov.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2009-09-08 14:49:32 +1000
committerDave Airlie <airlied@redhat.com>2009-09-08 14:49:32 +1000
commitcc84ef3fd20ef6dfe5fbc4778e7017d015b3bf7d (patch)
treece46a55f673cd2e669e9ccf625e6101a52138624 /drivers/pci/iov.c
parentc746e205f2fb6f74b4a622382607f065eca5eb49 (diff)
parent3ff323f89075624b6891e7c428edb8e8a35be13c (diff)
Merge remote branch 'origin/master' of ../linux-2.6 into drm-next
This was a non-trivial merge with some patches sent to Linus in drm-fixes. Conflicts: drivers/gpu/drm/radeon/r300.c drivers/gpu/drm/radeon/radeon_asic.h drivers/gpu/drm/radeon/rs600.c drivers/gpu/drm/radeon/rs690.c drivers/gpu/drm/radeon/rv515.c
Diffstat (limited to 'drivers/pci/iov.c')
-rw-r--r--drivers/pci/iov.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/drivers/pci/iov.c b/drivers/pci/iov.c
index e3a87210e94..e03fe98f061 100644
--- a/drivers/pci/iov.c
+++ b/drivers/pci/iov.c
@@ -598,6 +598,29 @@ int pci_iov_resource_bar(struct pci_dev *dev, int resno,
}
/**
+ * pci_sriov_resource_alignment - get resource alignment for VF BAR
+ * @dev: the PCI device
+ * @resno: the resource number
+ *
+ * Returns the alignment of the VF BAR found in the SR-IOV capability.
+ * This is not the same as the resource size which is defined as
+ * the VF BAR size multiplied by the number of VFs. The alignment
+ * is just the VF BAR size.
+ */
+int pci_sriov_resource_alignment(struct pci_dev *dev, int resno)
+{
+ struct resource tmp;
+ enum pci_bar_type type;
+ int reg = pci_iov_resource_bar(dev, resno, &type);
+
+ if (!reg)
+ return 0;
+
+ __pci_read_base(dev, type, &tmp, reg);
+ return resource_alignment(&tmp);
+}
+
+/**
* pci_restore_iov_state - restore the state of the IOV capability
* @dev: the PCI device
*/