|
@@ -973,6 +973,8 @@ void set_pcie_port_type(struct pci_dev *pdev)
|
|
{
|
|
{
|
|
int pos;
|
|
int pos;
|
|
u16 reg16;
|
|
u16 reg16;
|
|
|
|
+ int type;
|
|
|
|
+ struct pci_dev *parent;
|
|
|
|
|
|
pos = pci_find_capability(pdev, PCI_CAP_ID_EXP);
|
|
pos = pci_find_capability(pdev, PCI_CAP_ID_EXP);
|
|
if (!pos)
|
|
if (!pos)
|
|
@@ -982,6 +984,22 @@ void set_pcie_port_type(struct pci_dev *pdev)
|
|
pdev->pcie_flags_reg = reg16;
|
|
pdev->pcie_flags_reg = reg16;
|
|
pci_read_config_word(pdev, pos + PCI_EXP_DEVCAP, ®16);
|
|
pci_read_config_word(pdev, pos + PCI_EXP_DEVCAP, ®16);
|
|
pdev->pcie_mpss = reg16 & PCI_EXP_DEVCAP_PAYLOAD;
|
|
pdev->pcie_mpss = reg16 & PCI_EXP_DEVCAP_PAYLOAD;
|
|
|
|
+
|
|
|
|
+ /*
|
|
|
|
+ * A Root Port is always the upstream end of a Link. No PCIe
|
|
|
|
+ * component has two Links. Two Links are connected by a Switch
|
|
|
|
+ * that has a Port on each Link and internal logic to connect the
|
|
|
|
+ * two Ports.
|
|
|
|
+ */
|
|
|
|
+ type = pci_pcie_type(pdev);
|
|
|
|
+ if (type == PCI_EXP_TYPE_ROOT_PORT)
|
|
|
|
+ pdev->has_secondary_link = 1;
|
|
|
|
+ else if (type == PCI_EXP_TYPE_UPSTREAM ||
|
|
|
|
+ type == PCI_EXP_TYPE_DOWNSTREAM) {
|
|
|
|
+ parent = pci_upstream_bridge(pdev);
|
|
|
|
+ if (!parent->has_secondary_link)
|
|
|
|
+ pdev->has_secondary_link = 1;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
void set_pcie_hotplug_bridge(struct pci_dev *pdev)
|
|
void set_pcie_hotplug_bridge(struct pci_dev *pdev)
|