Lines Matching refs:pdn

46 static void pseries_eeh_init_edev(struct pci_dn *pdn);
50 struct pci_dn *pdn = pci_get_pdn(pdev);
58 pdn->device_id = pdev->device;
59 pdn->vendor_id = pdev->vendor;
60 pdn->class_code = pdev->class;
66 pdn->last_allow_rc = 0;
69 pseries_eeh_init_edev(pdn);
77 struct eeh_dev *edev = pdn_to_eeh_dev(pdn);
79 edev->pe_config_addr = (pdn->busno << 16) | (pdn->devfn << 8);
90 * @pdn: pci_dn of the input device
101 static int pseries_eeh_get_pe_config_addr(struct pci_dn *pdn)
103 int config_addr = rtas_config_addr(pdn->busno, pdn->devfn, 0);
104 struct pci_controller *phb = pdn->phb;
248 static int pseries_eeh_cap_start(struct pci_dn *pdn)
252 if (!pdn)
255 rtas_pci_dn_read_config(pdn, PCI_STATUS, 2, &status);
263 static int pseries_eeh_find_cap(struct pci_dn *pdn, int cap)
265 int pos = pseries_eeh_cap_start(pdn);
273 rtas_pci_dn_read_config(pdn, pos, 1, &pos);
277 rtas_pci_dn_read_config(pdn, pos + PCI_CAP_LIST_ID, 1, &id);
288 static int pseries_eeh_find_ecap(struct pci_dn *pdn, int cap)
290 struct eeh_dev *edev = pdn_to_eeh_dev(pdn);
297 if (rtas_pci_dn_read_config(pdn, pos, 4, &header) != PCIBIOS_SUCCESSFUL)
310 if (rtas_pci_dn_read_config(pdn, pos, 4, &header) != PCIBIOS_SUCCESSFUL)
328 struct pci_dn *pdn = eeh_dev_to_pdn(edev);
336 pdn = pci_get_pdn(edev->physfn);
338 pdn = pdn ? pdn->parent : NULL;
339 while (pdn) {
341 parent = pdn_to_eeh_dev(pdn);
348 pdn = pdn->parent;
357 * @pdn: PCI device node
364 static void pseries_eeh_init_edev(struct pci_dn *pdn)
375 * Find the eeh_dev for this pdn. The storage for the eeh_dev was
380 edev = pdn_to_eeh_dev(pdn);
394 if (!pdn->vendor_id || !pdn->device_id || !pdn->class_code)
398 if ((pdn->class_code >> 8) == PCI_CLASS_BRIDGE_ISA)
408 edev->pcix_cap = pseries_eeh_find_cap(pdn, PCI_CAP_ID_PCIX);
409 edev->pcie_cap = pseries_eeh_find_cap(pdn, PCI_CAP_ID_EXP);
410 edev->aer_cap = pseries_eeh_find_ecap(pdn, PCI_EXT_CAP_ID_ERR);
412 if ((pdn->class_code >> 8) == PCI_CLASS_BRIDGE_PCI) {
415 rtas_pci_dn_read_config(pdn, edev->pcie_cap + PCI_EXP_FLAGS,
426 ret = pseries_eeh_get_pe_config_addr(pdn);
434 pe.phb = pdn->phb;
462 struct pci_dn *pdn;
464 pdn = pci_get_pdn_by_devfn(pdev->bus, pdev->devfn);
465 if (!pdn)
472 edev = pdn_to_eeh_dev(pdn);
481 * @pdn: PCI device node
487 void pseries_eeh_init_edev_recursive(struct pci_dn *pdn)
491 if (!pdn)
494 list_for_each_entry(n, &pdn->child_list, list)
497 pseries_eeh_init_edev(pdn);
677 struct pci_dn *pdn = eeh_dev_to_pdn(edev);
679 return rtas_pci_dn_read_config(pdn, where, size, val);
693 struct pci_dn *pdn = eeh_dev_to_pdn(edev);
695 return rtas_pci_dn_write_config(pdn, where, size, val);
699 static int pseries_send_allow_unfreeze(struct pci_dn *pdn, u16 *vf_pe_array, int cur_vfs)
705 addr = rtas_config_addr(pdn->busno, pdn->devfn, 0);
706 buid = pdn->phb->buid;
718 pdn->phb->global_number, addr, rc);
725 struct pci_dn *pdn, *tmp, *parent, *physfn_pdn;
734 pdn = eeh_dev_to_pdn(edev);
735 parent = pdn->parent;
738 cpu_to_be16(pdn->pe_num_map[vf_index]);
739 rc = pseries_send_allow_unfreeze(pdn, vf_pe_array,
741 pdn->last_allow_rc = rc;
743 list_for_each_entry_safe(pdn, tmp,
750 if (pdn->busno != bus ||
751 pdn->devfn != devfn)
753 pdn->last_allow_rc = rc;
757 pdn = pci_get_pdn(edev->pdev);
764 pdn->last_allow_rc = rc;
814 struct pci_dn *pdn;
866 pdn = list_first_entry(&PCI_DN(phb->dn)->child_list, struct pci_dn, list);
867 config_addr = pseries_eeh_get_pe_config_addr(pdn);