Lines Matching refs:pdn
230 static int pnv_eeh_find_cap(struct pci_dn *pdn, int cap)
236 if (!pdn)
240 pnv_pci_cfg_read(pdn, PCI_STATUS, 2, &status);
245 pnv_pci_cfg_read(pdn, pos, 1, &pos);
250 pnv_pci_cfg_read(pdn, pos + PCI_CAP_LIST_ID, 1, &id);
265 static int pnv_eeh_find_ecap(struct pci_dn *pdn, int cap)
267 struct eeh_dev *edev = pdn_to_eeh_dev(pdn);
273 if (pnv_pci_cfg_read(pdn, pos, 4, &header) != PCIBIOS_SUCCESSFUL)
286 if (pnv_pci_cfg_read(pdn, pos, 4, &header) != PCIBIOS_SUCCESSFUL)
323 struct pci_dn *pdn = pci_get_pdn(pdev);
324 struct pci_controller *hose = pdn->phb;
326 struct eeh_dev *edev = pdn_to_eeh_dev(pdn);
330 int config_addr = (pdn->busno << 8) | (pdn->devfn);
357 edev->pcix_cap = pnv_eeh_find_cap(pdn, PCI_CAP_ID_PCIX);
358 edev->pcie_cap = pnv_eeh_find_cap(pdn, PCI_CAP_ID_EXP);
359 edev->af_cap = pnv_eeh_find_cap(pdn, PCI_CAP_ID_AF);
360 edev->aer_cap = pnv_eeh_find_ecap(pdn, PCI_EXT_CAP_ID_ERR);
364 pnv_pci_cfg_read(pdn, edev->pcie_cap + PCI_EXP_FLAGS,
403 if ((pdn->vendor_id == PCI_VENDOR_ID_BROADCOM &&
404 pdn->device_id == 0x1656) ||
405 (pdn->vendor_id == PCI_VENDOR_ID_BROADCOM &&
406 pdn->device_id == 0x1657) ||
407 (pdn->vendor_id == PCI_VENDOR_ID_BROADCOM &&
408 pdn->device_id == 0x168a) ||
409 (pdn->vendor_id == PCI_VENDOR_ID_BROADCOM &&
410 pdn->device_id == 0x168e))
421 pdn->busno);
803 struct pci_dn *pdn = pci_get_pdn_by_devfn(dev->bus, dev->devfn);
804 struct eeh_dev *edev = pdn_to_eeh_dev(pdn);
908 static void pnv_eeh_wait_for_pending(struct pci_dn *pdn, const char *type,
911 struct eeh_dev *edev = pdn->edev;
925 pdn->phb->global_number, pdn->busno,
926 PCI_SLOT(pdn->devfn), PCI_FUNC(pdn->devfn));
929 static int pnv_eeh_do_flr(struct pci_dn *pdn, int option)
931 struct eeh_dev *edev = pdn_to_eeh_dev(pdn);
944 pnv_eeh_wait_for_pending(pdn, "",
967 static int pnv_eeh_do_af_flr(struct pci_dn *pdn, int option)
969 struct eeh_dev *edev = pdn_to_eeh_dev(pdn);
987 pnv_eeh_wait_for_pending(pdn, "AF",
1006 struct pci_dn *pdn;
1011 pdn = eeh_dev_to_pdn(edev);
1012 if (!pdn)
1015 ret = pnv_eeh_do_flr(pdn, option);
1019 return pnv_eeh_do_af_flr(pdn, option);
1208 static inline bool pnv_eeh_cfg_blocked(struct pci_dn *pdn)
1210 struct eeh_dev *edev = pdn_to_eeh_dev(pdn);
1232 struct pci_dn *pdn = eeh_dev_to_pdn(edev);
1234 if (!pdn)
1237 if (pnv_eeh_cfg_blocked(pdn)) {
1242 return pnv_pci_cfg_read(pdn, where, size, val);
1248 struct pci_dn *pdn = eeh_dev_to_pdn(edev);
1250 if (!pdn)
1253 if (pnv_eeh_cfg_blocked(pdn))
1256 return pnv_pci_cfg_write(pdn, where, size, val);
1646 struct pci_dn *pdn = pci_get_pdn(pdev);
1656 pdn->mps = pcie_get_mps(pdev);