Lines Matching refs:pdn

530 	struct pci_dn *pdn = pci_get_pdn(dev);  in pnv_ioda_get_pe()  local
532 if (!pdn) in pnv_ioda_get_pe()
534 if (pdn->pe_number == IODA_INVALID_PE) in pnv_ioda_get_pe()
536 return &phb->ioda.pe_array[pdn->pe_number]; in pnv_ioda_get_pe()
628 struct pci_dn *pdn = pci_get_pdn(pdev); in pnv_ioda_set_peltv() local
631 if (pdn && pdn->pe_number != IODA_INVALID_PE) { in pnv_ioda_set_peltv()
632 parent = &phb->ioda.pe_array[pdn->pe_number]; in pnv_ioda_set_peltv()
695 struct pci_dn *pdn = pci_get_pdn(parent); in pnv_ioda_deconfigure_pe() local
696 if (pdn && pdn->pe_number != IODA_INVALID_PE) { in pnv_ioda_deconfigure_pe()
697 rc = opal_pci_set_peltv(phb->opal_id, pdn->pe_number, in pnv_ioda_deconfigure_pe()
857 struct pci_dn *pdn = pci_get_pdn(dev); in pnv_pci_vf_resource_shift() local
874 num_vfs = pdn->num_vfs; in pnv_pci_vf_resource_shift()
932 struct pci_dn *pdn = pci_get_pdn(dev);
936 if (!pdn) {
941 if (pdn->pe_number != IODA_INVALID_PE)
964 pdn->pcidev = dev;
965 pdn->pe_number = pe_num;
970 pe->rid = dev->bus->number << 8 | pdn->devfn;
978 pdn->pe_number = IODA_INVALID_PE;
1003 struct pci_dn *pdn = pci_get_pdn(dev); in pnv_ioda_setup_same_PE() local
1005 if (pdn == NULL) { in pnv_ioda_setup_same_PE()
1010 pdn->pe_number = pe->pe_number; in pnv_ioda_setup_same_PE()
1132 struct pci_dn *pdn; in pnv_pci_vf_release_m64() local
1138 pdn = pci_get_pdn(pdev); in pnv_pci_vf_release_m64()
1142 if (pdn->m64_wins[i][j] == IODA_INVALID_M64) in pnv_pci_vf_release_m64()
1145 OPAL_M64_WINDOW_TYPE, pdn->m64_wins[i][j], 0); in pnv_pci_vf_release_m64()
1146 clear_bit(pdn->m64_wins[i][j], &phb->ioda.m64_bar_alloc); in pnv_pci_vf_release_m64()
1147 pdn->m64_wins[i][j] = IODA_INVALID_M64; in pnv_pci_vf_release_m64()
1158 struct pci_dn *pdn; in pnv_pci_vf_assign_m64() local
1172 pdn = pci_get_pdn(pdev); in pnv_pci_vf_assign_m64()
1178 pdn->m64_wins[i][j] = IODA_INVALID_M64; in pnv_pci_vf_assign_m64()
1180 if (pdn->m64_per_iov == M64_PER_IOV) { in pnv_pci_vf_assign_m64()
1183 roundup_pow_of_two(num_vfs) / pdn->m64_per_iov; in pnv_pci_vf_assign_m64()
1206 pdn->m64_wins[i][j] = win; in pnv_pci_vf_assign_m64()
1208 if (pdn->m64_per_iov == M64_PER_IOV) { in pnv_pci_vf_assign_m64()
1219 if (pdn->m64_per_iov == M64_PER_IOV) { in pnv_pci_vf_assign_m64()
1220 pe_num = pdn->offset + j; in pnv_pci_vf_assign_m64()
1223 pdn->m64_wins[i][j], 0); in pnv_pci_vf_assign_m64()
1228 pdn->m64_wins[i][j], in pnv_pci_vf_assign_m64()
1240 if (pdn->m64_per_iov == M64_PER_IOV) in pnv_pci_vf_assign_m64()
1242 OPAL_M64_WINDOW_TYPE, pdn->m64_wins[i][j], 2); in pnv_pci_vf_assign_m64()
1245 OPAL_M64_WINDOW_TYPE, pdn->m64_wins[i][j], 1); in pnv_pci_vf_assign_m64()
1290 struct pci_dn *pdn; in pnv_ioda_release_vf_PE() local
1297 pdn = pci_get_pdn(pdev); in pnv_ioda_release_vf_PE()
1302 if (pdn->m64_per_iov == M64_PER_IOV && num_vfs > M64_PER_IOV) { in pnv_ioda_release_vf_PE()
1307 vf_per_group = roundup_pow_of_two(num_vfs) / pdn->m64_per_iov; in pnv_ioda_release_vf_PE()
1320 pdn->offset + vf_index, in pnv_ioda_release_vf_PE()
1321 pdn->offset + vf_index1, in pnv_ioda_release_vf_PE()
1327 pdn->offset + vf_index1, rc); in pnv_ioda_release_vf_PE()
1353 struct pci_dn *pdn; in pnv_pci_sriov_disable() local
1360 pdn = pci_get_pdn(pdev); in pnv_pci_sriov_disable()
1362 num_vfs = pdn->num_vfs; in pnv_pci_sriov_disable()
1368 if (pdn->m64_per_iov == 1) in pnv_pci_sriov_disable()
1369 pnv_pci_vf_resource_shift(pdev, -pdn->offset); in pnv_pci_sriov_disable()
1375 bitmap_clear(phb->ioda.pe_alloc, pdn->offset, num_vfs); in pnv_pci_sriov_disable()
1376 pdn->offset = 0; in pnv_pci_sriov_disable()
1390 struct pci_dn *pdn; in pnv_ioda_setup_vf_PE() local
1396 pdn = pci_get_pdn(pdev); in pnv_ioda_setup_vf_PE()
1403 pe_num = pdn->offset + vf_index; in pnv_ioda_setup_vf_PE()
1437 if (pdn->m64_per_iov == M64_PER_IOV && num_vfs > M64_PER_IOV) { in pnv_ioda_setup_vf_PE()
1442 vf_per_group = roundup_pow_of_two(num_vfs) / pdn->m64_per_iov; in pnv_ioda_setup_vf_PE()
1455 pdn->offset + vf_index, in pnv_ioda_setup_vf_PE()
1456 pdn->offset + vf_index1, in pnv_ioda_setup_vf_PE()
1462 pdn->offset + vf_index1, rc); in pnv_ioda_setup_vf_PE()
1474 struct pci_dn *pdn; in pnv_pci_sriov_enable() local
1480 pdn = pci_get_pdn(pdev); in pnv_pci_sriov_enable()
1485 pdn->offset = bitmap_find_next_zero_area( in pnv_pci_sriov_enable()
1488 if (pdn->offset >= phb->ioda.total_pe) { in pnv_pci_sriov_enable()
1491 pdn->offset = 0; in pnv_pci_sriov_enable()
1494 bitmap_set(phb->ioda.pe_alloc, pdn->offset, num_vfs); in pnv_pci_sriov_enable()
1495 pdn->num_vfs = num_vfs; in pnv_pci_sriov_enable()
1510 if (pdn->m64_per_iov == 1) { in pnv_pci_sriov_enable()
1511 ret = pnv_pci_vf_resource_shift(pdev, pdn->offset); in pnv_pci_sriov_enable()
1523 bitmap_clear(phb->ioda.pe_alloc, pdn->offset, num_vfs); in pnv_pci_sriov_enable()
1524 pdn->offset = 0; in pnv_pci_sriov_enable()
1550 struct pci_dn *pdn = pci_get_pdn(pdev); in pnv_pci_ioda_dma_dev_setup() local
1558 if (!pdn || pdn->pe_number == IODA_INVALID_PE) in pnv_pci_ioda_dma_dev_setup()
1561 pe = &phb->ioda.pe_array[pdn->pe_number]; in pnv_pci_ioda_dma_dev_setup()
1577 struct pci_dn *pdn = pci_get_pdn(pdev); in pnv_pci_ioda_dma_set_mask() local
1582 if (WARN_ON(!pdn || pdn->pe_number == IODA_INVALID_PE)) in pnv_pci_ioda_dma_set_mask()
1585 pe = &phb->ioda.pe_array[pdn->pe_number]; in pnv_pci_ioda_dma_set_mask()
1606 struct pci_dn *pdn = pci_get_pdn(pdev); in pnv_pci_ioda_dma_get_required_mask() local
1610 if (WARN_ON(!pdn || pdn->pe_number == IODA_INVALID_PE)) in pnv_pci_ioda_dma_get_required_mask()
1613 pe = &phb->ioda.pe_array[pdn->pe_number]; in pnv_pci_ioda_dma_get_required_mask()
2742 struct pci_dn *pdn; in pnv_pci_ioda_fixup_iov_resources() local
2751 pdn = pci_get_pdn(pdev); in pnv_pci_ioda_fixup_iov_resources()
2752 pdn->vfs_expanded = 0; in pnv_pci_ioda_fixup_iov_resources()
2755 pdn->m64_per_iov = 1; in pnv_pci_ioda_fixup_iov_resources()
2774 pdn->m64_per_iov = M64_PER_IOV; in pnv_pci_ioda_fixup_iov_resources()
2797 pdn->vfs_expanded = mul; in pnv_pci_ioda_fixup_iov_resources()
2982 struct pci_dn *pdn = pci_get_pdn(pdev); in pnv_pci_iov_resource_alignment() local
2990 if (pdn->vfs_expanded) in pnv_pci_iov_resource_alignment()
2991 return pdn->vfs_expanded * align; in pnv_pci_iov_resource_alignment()
3004 struct pci_dn *pdn; in pnv_pci_enable_device_hook() local
3014 pdn = pci_get_pdn(dev); in pnv_pci_enable_device_hook()
3015 if (!pdn || pdn->pe_number == IODA_INVALID_PE) in pnv_pci_enable_device_hook()