aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/pci.c
diff options
context:
space:
mode:
authorYu Zhao <yu.zhao@intel.com>2009-03-19 23:25:11 -0400
committerJesse Barnes <jbarnes@virtuousgeek.org>2009-03-20 13:48:22 -0400
commitd1b054da8f599905f3c18a218961dcf17f9d5f13 (patch)
tree99b62e6771c3b73142dd0622463bed0e19724342 /drivers/pci/pci.c
parent8293b0f629095efbe7c7e3f9b437f8c040c19eb5 (diff)
PCI: initialize and release SR-IOV capability
If a device has the SR-IOV capability, initialize it (set the ARI Capable Hierarchy in the lowest numbered PF if necessary; calculate the System Page Size for the VF MMIO, probe the VF Offset, Stride and BARs). A lock for the VF bus allocation is also initialized if a PF is the lowest numbered PF. Reviewed-by: Matthew Wilcox <willy@linux.intel.com> Signed-off-by: Yu Zhao <yu.zhao@intel.com> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'drivers/pci/pci.c')
-rw-r--r--drivers/pci/pci.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index a35a8b2ba631..2b3201ec2b05 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -2360,12 +2360,19 @@ int pci_select_bars(struct pci_dev *dev, unsigned long flags)
2360 */ 2360 */
2361int pci_resource_bar(struct pci_dev *dev, int resno, enum pci_bar_type *type) 2361int pci_resource_bar(struct pci_dev *dev, int resno, enum pci_bar_type *type)
2362{ 2362{
2363 int reg;
2364
2363 if (resno < PCI_ROM_RESOURCE) { 2365 if (resno < PCI_ROM_RESOURCE) {
2364 *type = pci_bar_unknown; 2366 *type = pci_bar_unknown;
2365 return PCI_BASE_ADDRESS_0 + 4 * resno; 2367 return PCI_BASE_ADDRESS_0 + 4 * resno;
2366 } else if (resno == PCI_ROM_RESOURCE) { 2368 } else if (resno == PCI_ROM_RESOURCE) {
2367 *type = pci_bar_mem32; 2369 *type = pci_bar_mem32;
2368 return dev->rom_base_reg; 2370 return dev->rom_base_reg;
2371 } else if (resno < PCI_BRIDGE_RESOURCES) {
2372 /* device specific resource */
2373 reg = pci_iov_resource_bar(dev, resno, type);
2374 if (reg)
2375 return reg;
2369 } 2376 }
2370 2377
2371 dev_err(&dev->dev, "BAR: invalid resource #%d\n", resno); 2378 dev_err(&dev->dev, "BAR: invalid resource #%d\n", resno);