Lines Matching refs:pdn

552 	struct pci_dn *pdn = pci_get_pdn(dev);  in pnv_ioda_get_pe()  local
554 if (!pdn) in pnv_ioda_get_pe()
556 if (pdn->pe_number == IODA_INVALID_PE) in pnv_ioda_get_pe()
558 return &phb->ioda.pe_array[pdn->pe_number]; in pnv_ioda_get_pe()
650 struct pci_dn *pdn = pci_get_pdn(pdev); in pnv_ioda_set_peltv() local
653 if (pdn && pdn->pe_number != IODA_INVALID_PE) { in pnv_ioda_set_peltv()
654 parent = &phb->ioda.pe_array[pdn->pe_number]; in pnv_ioda_set_peltv()
717 struct pci_dn *pdn = pci_get_pdn(parent); in pnv_ioda_deconfigure_pe() local
718 if (pdn && pdn->pe_number != IODA_INVALID_PE) { in pnv_ioda_deconfigure_pe()
719 rc = opal_pci_set_peltv(phb->opal_id, pdn->pe_number, in pnv_ioda_deconfigure_pe()
879 struct pci_dn *pdn = pci_get_pdn(dev); in pnv_pci_vf_resource_shift() local
896 num_vfs = pdn->num_vfs; in pnv_pci_vf_resource_shift()
953 struct pci_dn *pdn = pci_get_pdn(dev);
957 if (!pdn) {
962 if (pdn->pe_number != IODA_INVALID_PE)
985 pdn->pcidev = dev;
986 pdn->pe_number = pe_num;
991 pe->rid = dev->bus->number << 8 | pdn->devfn;
999 pdn->pe_number = IODA_INVALID_PE;
1024 struct pci_dn *pdn = pci_get_pdn(dev); in pnv_ioda_setup_same_PE() local
1026 if (pdn == NULL) { in pnv_ioda_setup_same_PE()
1031 pdn->pe_number = pe->pe_number; in pnv_ioda_setup_same_PE()
1157 struct pci_dn *pdn; in pnv_pci_vf_release_m64() local
1163 pdn = pci_get_pdn(pdev); in pnv_pci_vf_release_m64()
1167 if (pdn->m64_wins[i][j] == IODA_INVALID_M64) in pnv_pci_vf_release_m64()
1170 OPAL_M64_WINDOW_TYPE, pdn->m64_wins[i][j], 0); in pnv_pci_vf_release_m64()
1171 clear_bit(pdn->m64_wins[i][j], &phb->ioda.m64_bar_alloc); in pnv_pci_vf_release_m64()
1172 pdn->m64_wins[i][j] = IODA_INVALID_M64; in pnv_pci_vf_release_m64()
1183 struct pci_dn *pdn; in pnv_pci_vf_assign_m64() local
1197 pdn = pci_get_pdn(pdev); in pnv_pci_vf_assign_m64()
1203 pdn->m64_wins[i][j] = IODA_INVALID_M64; in pnv_pci_vf_assign_m64()
1205 if (pdn->m64_per_iov == M64_PER_IOV) { in pnv_pci_vf_assign_m64()
1208 roundup_pow_of_two(num_vfs) / pdn->m64_per_iov; in pnv_pci_vf_assign_m64()
1231 pdn->m64_wins[i][j] = win; in pnv_pci_vf_assign_m64()
1233 if (pdn->m64_per_iov == M64_PER_IOV) { in pnv_pci_vf_assign_m64()
1244 if (pdn->m64_per_iov == M64_PER_IOV) { in pnv_pci_vf_assign_m64()
1245 pe_num = pdn->offset + j; in pnv_pci_vf_assign_m64()
1248 pdn->m64_wins[i][j], 0); in pnv_pci_vf_assign_m64()
1253 pdn->m64_wins[i][j], in pnv_pci_vf_assign_m64()
1265 if (pdn->m64_per_iov == M64_PER_IOV) in pnv_pci_vf_assign_m64()
1267 OPAL_M64_WINDOW_TYPE, pdn->m64_wins[i][j], 2); in pnv_pci_vf_assign_m64()
1270 OPAL_M64_WINDOW_TYPE, pdn->m64_wins[i][j], 1); in pnv_pci_vf_assign_m64()
1324 struct pci_dn *pdn; in pnv_ioda_release_vf_PE() local
1331 pdn = pci_get_pdn(pdev); in pnv_ioda_release_vf_PE()
1336 if (pdn->m64_per_iov == M64_PER_IOV && num_vfs > M64_PER_IOV) { in pnv_ioda_release_vf_PE()
1341 vf_per_group = roundup_pow_of_two(num_vfs) / pdn->m64_per_iov; in pnv_ioda_release_vf_PE()
1354 pdn->offset + vf_index, in pnv_ioda_release_vf_PE()
1355 pdn->offset + vf_index1, in pnv_ioda_release_vf_PE()
1361 pdn->offset + vf_index1, rc); in pnv_ioda_release_vf_PE()
1387 struct pci_dn *pdn; in pnv_pci_sriov_disable() local
1394 pdn = pci_get_pdn(pdev); in pnv_pci_sriov_disable()
1396 num_vfs = pdn->num_vfs; in pnv_pci_sriov_disable()
1402 if (pdn->m64_per_iov == 1) in pnv_pci_sriov_disable()
1403 pnv_pci_vf_resource_shift(pdev, -pdn->offset); in pnv_pci_sriov_disable()
1409 bitmap_clear(phb->ioda.pe_alloc, pdn->offset, num_vfs); in pnv_pci_sriov_disable()
1410 pdn->offset = 0; in pnv_pci_sriov_disable()
1424 struct pci_dn *pdn; in pnv_ioda_setup_vf_PE() local
1430 pdn = pci_get_pdn(pdev); in pnv_ioda_setup_vf_PE()
1437 pe_num = pdn->offset + vf_index; in pnv_ioda_setup_vf_PE()
1475 if (pdn->m64_per_iov == M64_PER_IOV && num_vfs > M64_PER_IOV) { in pnv_ioda_setup_vf_PE()
1480 vf_per_group = roundup_pow_of_two(num_vfs) / pdn->m64_per_iov; in pnv_ioda_setup_vf_PE()
1493 pdn->offset + vf_index, in pnv_ioda_setup_vf_PE()
1494 pdn->offset + vf_index1, in pnv_ioda_setup_vf_PE()
1500 pdn->offset + vf_index1, rc); in pnv_ioda_setup_vf_PE()
1512 struct pci_dn *pdn; in pnv_pci_sriov_enable() local
1518 pdn = pci_get_pdn(pdev); in pnv_pci_sriov_enable()
1523 pdn->offset = bitmap_find_next_zero_area( in pnv_pci_sriov_enable()
1526 if (pdn->offset >= phb->ioda.total_pe) { in pnv_pci_sriov_enable()
1529 pdn->offset = 0; in pnv_pci_sriov_enable()
1532 bitmap_set(phb->ioda.pe_alloc, pdn->offset, num_vfs); in pnv_pci_sriov_enable()
1533 pdn->num_vfs = num_vfs; in pnv_pci_sriov_enable()
1548 if (pdn->m64_per_iov == 1) { in pnv_pci_sriov_enable()
1549 ret = pnv_pci_vf_resource_shift(pdev, pdn->offset); in pnv_pci_sriov_enable()
1561 bitmap_clear(phb->ioda.pe_alloc, pdn->offset, num_vfs); in pnv_pci_sriov_enable()
1562 pdn->offset = 0; in pnv_pci_sriov_enable()
1588 struct pci_dn *pdn = pci_get_pdn(pdev); in pnv_pci_ioda_dma_dev_setup() local
1596 if (!pdn || pdn->pe_number == IODA_INVALID_PE) in pnv_pci_ioda_dma_dev_setup()
1599 pe = &phb->ioda.pe_array[pdn->pe_number]; in pnv_pci_ioda_dma_dev_setup()
1607 struct pci_dn *pdn = pci_get_pdn(pdev); in pnv_pci_ioda_dma_set_mask() local
1612 if (WARN_ON(!pdn || pdn->pe_number == IODA_INVALID_PE)) in pnv_pci_ioda_dma_set_mask()
1615 pe = &phb->ioda.pe_array[pdn->pe_number]; in pnv_pci_ioda_dma_set_mask()
1637 struct pci_dn *pdn = pci_get_pdn(pdev); in pnv_pci_ioda_dma_get_required_mask() local
1641 if (WARN_ON(!pdn || pdn->pe_number == IODA_INVALID_PE)) in pnv_pci_ioda_dma_get_required_mask()
1644 pe = &phb->ioda.pe_array[pdn->pe_number]; in pnv_pci_ioda_dma_get_required_mask()
2360 struct pci_dn *pdn; in pnv_pci_ioda_fixup_iov_resources() local
2369 pdn = pci_get_pdn(pdev); in pnv_pci_ioda_fixup_iov_resources()
2370 pdn->vfs_expanded = 0; in pnv_pci_ioda_fixup_iov_resources()
2373 pdn->m64_per_iov = 1; in pnv_pci_ioda_fixup_iov_resources()
2392 pdn->m64_per_iov = M64_PER_IOV; in pnv_pci_ioda_fixup_iov_resources()
2415 pdn->vfs_expanded = mul; in pnv_pci_ioda_fixup_iov_resources()
2600 struct pci_dn *pdn = pci_get_pdn(pdev); in pnv_pci_iov_resource_alignment() local
2608 if (pdn->vfs_expanded) in pnv_pci_iov_resource_alignment()
2609 return pdn->vfs_expanded * align; in pnv_pci_iov_resource_alignment()
2622 struct pci_dn *pdn; in pnv_pci_enable_device_hook() local
2632 pdn = pci_get_pdn(dev); in pnv_pci_enable_device_hook()
2633 if (!pdn || pdn->pe_number == IODA_INVALID_PE) in pnv_pci_enable_device_hook()