diff options
author | Gabe Black <gabe.black@ni.com> | 2009-10-06 11:45:19 -0400 |
---|---|---|
committer | Jesse Barnes <jbarnes@virtuousgeek.org> | 2009-11-04 16:06:36 -0500 |
commit | bc577d2bb98cc44371287fce3e892d26ad4050a8 (patch) | |
tree | 801ff1dbf10301bda75879141482eb226192e280 | |
parent | 0584396157ad2d008e2cc76b4ed6254151183a25 (diff) |
PCI: populate subsystem vendor and device IDs for PCI bridges
Change to populate the subsystem vendor and subsytem device IDs for
PCI-PCI bridges that implement the PCI Subsystem Vendor ID capability.
Previously bridges left subsystem vendor IDs unpopulated.
Signed-off-by: Gabe Black <gabe.black@ni.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
-rw-r--r-- | drivers/pci/probe.c | 6 | ||||
-rw-r--r-- | include/linux/pci_regs.h | 5 |
2 files changed, 11 insertions, 0 deletions
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c index 118463befef0..4842b09b7f3c 100644 --- a/drivers/pci/probe.c +++ b/drivers/pci/probe.c | |||
@@ -730,6 +730,7 @@ int pci_setup_device(struct pci_dev *dev) | |||
730 | u32 class; | 730 | u32 class; |
731 | u8 hdr_type; | 731 | u8 hdr_type; |
732 | struct pci_slot *slot; | 732 | struct pci_slot *slot; |
733 | int pos = 0; | ||
733 | 734 | ||
734 | if (pci_read_config_byte(dev, PCI_HEADER_TYPE, &hdr_type)) | 735 | if (pci_read_config_byte(dev, PCI_HEADER_TYPE, &hdr_type)) |
735 | return -EIO; | 736 | return -EIO; |
@@ -822,6 +823,11 @@ int pci_setup_device(struct pci_dev *dev) | |||
822 | dev->transparent = ((dev->class & 0xff) == 1); | 823 | dev->transparent = ((dev->class & 0xff) == 1); |
823 | pci_read_bases(dev, 2, PCI_ROM_ADDRESS1); | 824 | pci_read_bases(dev, 2, PCI_ROM_ADDRESS1); |
824 | set_pcie_hotplug_bridge(dev); | 825 | set_pcie_hotplug_bridge(dev); |
826 | pos = pci_find_capability(dev, PCI_CAP_ID_SSVID); | ||
827 | if (pos) { | ||
828 | pci_read_config_word(dev, pos + PCI_SSVID_VENDOR_ID, &dev->subsystem_vendor); | ||
829 | pci_read_config_word(dev, pos + PCI_SSVID_DEVICE_ID, &dev->subsystem_device); | ||
830 | } | ||
825 | break; | 831 | break; |
826 | 832 | ||
827 | case PCI_HEADER_TYPE_CARDBUS: /* CardBus bridge header */ | 833 | case PCI_HEADER_TYPE_CARDBUS: /* CardBus bridge header */ |
diff --git a/include/linux/pci_regs.h b/include/linux/pci_regs.h index d798770f08cd..9f2ad0aa3c39 100644 --- a/include/linux/pci_regs.h +++ b/include/linux/pci_regs.h | |||
@@ -365,6 +365,11 @@ | |||
365 | #define PCI_X_STATUS_266MHZ 0x40000000 /* 266 MHz capable */ | 365 | #define PCI_X_STATUS_266MHZ 0x40000000 /* 266 MHz capable */ |
366 | #define PCI_X_STATUS_533MHZ 0x80000000 /* 533 MHz capable */ | 366 | #define PCI_X_STATUS_533MHZ 0x80000000 /* 533 MHz capable */ |
367 | 367 | ||
368 | /* PCI Bridge Subsystem ID registers */ | ||
369 | |||
370 | #define PCI_SSVID_VENDOR_ID 4 /* PCI-Bridge subsystem vendor id register */ | ||
371 | #define PCI_SSVID_DEVICE_ID 6 /* PCI-Bridge subsystem device id register */ | ||
372 | |||
368 | /* PCI Express capability registers */ | 373 | /* PCI Express capability registers */ |
369 | 374 | ||
370 | #define PCI_EXP_FLAGS 2 /* Capabilities register */ | 375 | #define PCI_EXP_FLAGS 2 /* Capabilities register */ |