epf 387 drivers/pci/controller/pcie-cadence-ep.c struct pci_epf *epf; epf 395 drivers/pci/controller/pcie-cadence-ep.c list_for_each_entry(epf, &epc->pci_epf, list) epf 396 drivers/pci/controller/pcie-cadence-ep.c cfg |= BIT(epf->func_no); epf 493 drivers/pci/controller/pcie-rockchip-ep.c struct pci_epf *epf; epf 497 drivers/pci/controller/pcie-rockchip-ep.c list_for_each_entry(epf, &epc->pci_epf, list) epf 498 drivers/pci/controller/pcie-rockchip-ep.c cfg |= BIT(epf->func_no); epf 48 drivers/pci/endpoint/functions/pci-epf-test.c struct pci_epf *epf; epf 82 drivers/pci/endpoint/functions/pci-epf-test.c struct pci_epf *epf = epf_test->epf; epf 83 drivers/pci/endpoint/functions/pci-epf-test.c struct device *dev = &epf->dev; epf 84 drivers/pci/endpoint/functions/pci-epf-test.c struct pci_epc *epc = epf->epc; epf 96 drivers/pci/endpoint/functions/pci-epf-test.c ret = pci_epc_map_addr(epc, epf->func_no, src_phys_addr, reg->src_addr, epf 112 drivers/pci/endpoint/functions/pci-epf-test.c ret = pci_epc_map_addr(epc, epf->func_no, dst_phys_addr, reg->dst_addr, epf 122 drivers/pci/endpoint/functions/pci-epf-test.c pci_epc_unmap_addr(epc, epf->func_no, dst_phys_addr); epf 128 drivers/pci/endpoint/functions/pci-epf-test.c pci_epc_unmap_addr(epc, epf->func_no, src_phys_addr); epf 144 drivers/pci/endpoint/functions/pci-epf-test.c struct pci_epf *epf = epf_test->epf; epf 145 drivers/pci/endpoint/functions/pci-epf-test.c struct device *dev = &epf->dev; epf 146 drivers/pci/endpoint/functions/pci-epf-test.c struct pci_epc *epc = epf->epc; epf 158 drivers/pci/endpoint/functions/pci-epf-test.c ret = pci_epc_map_addr(epc, epf->func_no, phys_addr, reg->src_addr, epf 181 drivers/pci/endpoint/functions/pci-epf-test.c pci_epc_unmap_addr(epc, epf->func_no, phys_addr); epf 196 drivers/pci/endpoint/functions/pci-epf-test.c struct pci_epf *epf = epf_test->epf; epf 197 drivers/pci/endpoint/functions/pci-epf-test.c struct device *dev = &epf->dev; epf 198 drivers/pci/endpoint/functions/pci-epf-test.c struct pci_epc *epc = epf->epc; epf 210 drivers/pci/endpoint/functions/pci-epf-test.c ret = pci_epc_map_addr(epc, epf->func_no, phys_addr, reg->dst_addr, epf 238 drivers/pci/endpoint/functions/pci-epf-test.c pci_epc_unmap_addr(epc, epf->func_no, phys_addr); epf 250 drivers/pci/endpoint/functions/pci-epf-test.c struct pci_epf *epf = epf_test->epf; epf 251 drivers/pci/endpoint/functions/pci-epf-test.c struct device *dev = &epf->dev; epf 252 drivers/pci/endpoint/functions/pci-epf-test.c struct pci_epc *epc = epf->epc; epf 260 drivers/pci/endpoint/functions/pci-epf-test.c pci_epc_raise_irq(epc, epf->func_no, PCI_EPC_IRQ_LEGACY, 0); epf 263 drivers/pci/endpoint/functions/pci-epf-test.c pci_epc_raise_irq(epc, epf->func_no, PCI_EPC_IRQ_MSI, irq); epf 266 drivers/pci/endpoint/functions/pci-epf-test.c pci_epc_raise_irq(epc, epf->func_no, PCI_EPC_IRQ_MSIX, irq); epf 281 drivers/pci/endpoint/functions/pci-epf-test.c struct pci_epf *epf = epf_test->epf; epf 282 drivers/pci/endpoint/functions/pci-epf-test.c struct device *dev = &epf->dev; epf 283 drivers/pci/endpoint/functions/pci-epf-test.c struct pci_epc *epc = epf->epc; epf 301 drivers/pci/endpoint/functions/pci-epf-test.c pci_epc_raise_irq(epc, epf->func_no, PCI_EPC_IRQ_LEGACY, 0); epf 339 drivers/pci/endpoint/functions/pci-epf-test.c count = pci_epc_get_msi(epc, epf->func_no); epf 343 drivers/pci/endpoint/functions/pci-epf-test.c pci_epc_raise_irq(epc, epf->func_no, PCI_EPC_IRQ_MSI, epf 349 drivers/pci/endpoint/functions/pci-epf-test.c count = pci_epc_get_msix(epc, epf->func_no); epf 353 drivers/pci/endpoint/functions/pci-epf-test.c pci_epc_raise_irq(epc, epf->func_no, PCI_EPC_IRQ_MSIX, epf 363 drivers/pci/endpoint/functions/pci-epf-test.c static void pci_epf_test_linkup(struct pci_epf *epf) epf 365 drivers/pci/endpoint/functions/pci-epf-test.c struct pci_epf_test *epf_test = epf_get_drvdata(epf); epf 371 drivers/pci/endpoint/functions/pci-epf-test.c static void pci_epf_test_unbind(struct pci_epf *epf) epf 373 drivers/pci/endpoint/functions/pci-epf-test.c struct pci_epf_test *epf_test = epf_get_drvdata(epf); epf 374 drivers/pci/endpoint/functions/pci-epf-test.c struct pci_epc *epc = epf->epc; epf 381 drivers/pci/endpoint/functions/pci-epf-test.c epf_bar = &epf->bar[bar]; epf 384 drivers/pci/endpoint/functions/pci-epf-test.c pci_epc_clear_bar(epc, epf->func_no, epf_bar); epf 385 drivers/pci/endpoint/functions/pci-epf-test.c pci_epf_free_space(epf, epf_test->reg[bar], bar); epf 390 drivers/pci/endpoint/functions/pci-epf-test.c static int pci_epf_test_set_bar(struct pci_epf *epf) epf 395 drivers/pci/endpoint/functions/pci-epf-test.c struct pci_epc *epc = epf->epc; epf 396 drivers/pci/endpoint/functions/pci-epf-test.c struct device *dev = &epf->dev; epf 397 drivers/pci/endpoint/functions/pci-epf-test.c struct pci_epf_test *epf_test = epf_get_drvdata(epf); epf 404 drivers/pci/endpoint/functions/pci-epf-test.c epf_bar = &epf->bar[bar]; epf 415 drivers/pci/endpoint/functions/pci-epf-test.c ret = pci_epc_set_bar(epc, epf->func_no, epf_bar); epf 417 drivers/pci/endpoint/functions/pci-epf-test.c pci_epf_free_space(epf, epf_test->reg[bar], bar); epf 427 drivers/pci/endpoint/functions/pci-epf-test.c static int pci_epf_test_alloc_space(struct pci_epf *epf) epf 429 drivers/pci/endpoint/functions/pci-epf-test.c struct pci_epf_test *epf_test = epf_get_drvdata(epf); epf 430 drivers/pci/endpoint/functions/pci-epf-test.c struct device *dev = &epf->dev; epf 445 drivers/pci/endpoint/functions/pci-epf-test.c base = pci_epf_alloc_space(epf, test_reg_size, epf 454 drivers/pci/endpoint/functions/pci-epf-test.c epf_bar = &epf->bar[bar]; epf 463 drivers/pci/endpoint/functions/pci-epf-test.c base = pci_epf_alloc_space(epf, bar_size[bar], bar, epf 474 drivers/pci/endpoint/functions/pci-epf-test.c static void pci_epf_configure_bar(struct pci_epf *epf, epf 482 drivers/pci/endpoint/functions/pci-epf-test.c epf_bar = &epf->bar[i]; epf 491 drivers/pci/endpoint/functions/pci-epf-test.c static int pci_epf_test_bind(struct pci_epf *epf) epf 494 drivers/pci/endpoint/functions/pci-epf-test.c struct pci_epf_test *epf_test = epf_get_drvdata(epf); epf 495 drivers/pci/endpoint/functions/pci-epf-test.c struct pci_epf_header *header = epf->header; epf 498 drivers/pci/endpoint/functions/pci-epf-test.c struct pci_epc *epc = epf->epc; epf 499 drivers/pci/endpoint/functions/pci-epf-test.c struct device *dev = &epf->dev; epf 507 drivers/pci/endpoint/functions/pci-epf-test.c epc_features = pci_epc_get_features(epc, epf->func_no); epf 513 drivers/pci/endpoint/functions/pci-epf-test.c pci_epf_configure_bar(epf, epc_features); epf 519 drivers/pci/endpoint/functions/pci-epf-test.c ret = pci_epc_write_header(epc, epf->func_no, header); epf 525 drivers/pci/endpoint/functions/pci-epf-test.c ret = pci_epf_test_alloc_space(epf); epf 529 drivers/pci/endpoint/functions/pci-epf-test.c ret = pci_epf_test_set_bar(epf); epf 534 drivers/pci/endpoint/functions/pci-epf-test.c ret = pci_epc_set_msi(epc, epf->func_no, epf->msi_interrupts); epf 542 drivers/pci/endpoint/functions/pci-epf-test.c ret = pci_epc_set_msix(epc, epf->func_no, epf->msix_interrupts); epf 562 drivers/pci/endpoint/functions/pci-epf-test.c static int pci_epf_test_probe(struct pci_epf *epf) epf 565 drivers/pci/endpoint/functions/pci-epf-test.c struct device *dev = &epf->dev; epf 571 drivers/pci/endpoint/functions/pci-epf-test.c epf->header = &test_header; epf 572 drivers/pci/endpoint/functions/pci-epf-test.c epf_test->epf = epf; epf 576 drivers/pci/endpoint/functions/pci-epf-test.c epf_set_drvdata(epf, epf_test); epf 24 drivers/pci/endpoint/pci-ep-cfs.c struct pci_epf *epf; epf 96 drivers/pci/endpoint/pci-ep-cfs.c struct pci_epf *epf = epf_group->epf; epf 104 drivers/pci/endpoint/pci-ep-cfs.c epf->func_no = func_no; epf 106 drivers/pci/endpoint/pci-ep-cfs.c ret = pci_epc_add_epf(epc, epf); epf 110 drivers/pci/endpoint/pci-ep-cfs.c ret = pci_epf_bind(epf); epf 117 drivers/pci/endpoint/pci-ep-cfs.c pci_epc_remove_epf(epc, epf); epf 129 drivers/pci/endpoint/pci-ep-cfs.c struct pci_epf *epf; epf 136 drivers/pci/endpoint/pci-ep-cfs.c epf = epf_group->epf; epf 137 drivers/pci/endpoint/pci-ep-cfs.c clear_bit(epf->func_no, &epc_group->function_num_map); epf 138 drivers/pci/endpoint/pci-ep-cfs.c pci_epf_unbind(epf); epf 139 drivers/pci/endpoint/pci-ep-cfs.c pci_epc_remove_epf(epc, epf); epf 213 drivers/pci/endpoint/pci-ep-cfs.c struct pci_epf *epf = to_pci_epf_group(item)->epf; \ epf 214 drivers/pci/endpoint/pci-ep-cfs.c if (WARN_ON_ONCE(!epf->header)) \ epf 216 drivers/pci/endpoint/pci-ep-cfs.c return sprintf(page, "0x%04x\n", epf->header->_name); \ epf 225 drivers/pci/endpoint/pci-ep-cfs.c struct pci_epf *epf = to_pci_epf_group(item)->epf; \ epf 226 drivers/pci/endpoint/pci-ep-cfs.c if (WARN_ON_ONCE(!epf->header)) \ epf 231 drivers/pci/endpoint/pci-ep-cfs.c epf->header->_name = val; \ epf 241 drivers/pci/endpoint/pci-ep-cfs.c struct pci_epf *epf = to_pci_epf_group(item)->epf; \ epf 242 drivers/pci/endpoint/pci-ep-cfs.c if (WARN_ON_ONCE(!epf->header)) \ epf 247 drivers/pci/endpoint/pci-ep-cfs.c epf->header->_name = val; \ epf 257 drivers/pci/endpoint/pci-ep-cfs.c struct pci_epf *epf = to_pci_epf_group(item)->epf; \ epf 258 drivers/pci/endpoint/pci-ep-cfs.c if (WARN_ON_ONCE(!epf->header)) \ epf 263 drivers/pci/endpoint/pci-ep-cfs.c epf->header->_name = val; \ epf 277 drivers/pci/endpoint/pci-ep-cfs.c to_pci_epf_group(item)->epf->msi_interrupts = val; epf 286 drivers/pci/endpoint/pci-ep-cfs.c to_pci_epf_group(item)->epf->msi_interrupts); epf 299 drivers/pci/endpoint/pci-ep-cfs.c to_pci_epf_group(item)->epf->msix_interrupts = val; epf 308 drivers/pci/endpoint/pci-ep-cfs.c to_pci_epf_group(item)->epf->msix_interrupts); epf 377 drivers/pci/endpoint/pci-ep-cfs.c pci_epf_destroy(epf_group->epf); epf 395 drivers/pci/endpoint/pci-ep-cfs.c struct pci_epf *epf; epf 422 drivers/pci/endpoint/pci-ep-cfs.c epf = pci_epf_create(epf_name); epf 423 drivers/pci/endpoint/pci-ep-cfs.c if (IS_ERR(epf)) { epf 429 drivers/pci/endpoint/pci-ep-cfs.c epf_group->epf = epf; epf 488 drivers/pci/endpoint/pci-epc-core.c int pci_epc_add_epf(struct pci_epc *epc, struct pci_epf *epf) epf 492 drivers/pci/endpoint/pci-epc-core.c if (epf->epc) epf 498 drivers/pci/endpoint/pci-epc-core.c if (epf->func_no > epc->max_functions - 1) epf 501 drivers/pci/endpoint/pci-epc-core.c epf->epc = epc; epf 504 drivers/pci/endpoint/pci-epc-core.c list_add_tail(&epf->list, &epc->pci_epf); epf 518 drivers/pci/endpoint/pci-epc-core.c void pci_epc_remove_epf(struct pci_epc *epc, struct pci_epf *epf) epf 522 drivers/pci/endpoint/pci-epc-core.c if (!epc || IS_ERR(epc) || !epf) epf 526 drivers/pci/endpoint/pci-epc-core.c list_del(&epf->list); epf 527 drivers/pci/endpoint/pci-epc-core.c epf->epc = NULL; epf 543 drivers/pci/endpoint/pci-epc-core.c struct pci_epf *epf; epf 549 drivers/pci/endpoint/pci-epc-core.c list_for_each_entry(epf, &epc->pci_epf, list) epf 550 drivers/pci/endpoint/pci-epc-core.c pci_epf_linkup(epf); epf 32 drivers/pci/endpoint/pci-epf-core.c void pci_epf_linkup(struct pci_epf *epf) epf 34 drivers/pci/endpoint/pci-epf-core.c if (!epf->driver) { epf 35 drivers/pci/endpoint/pci-epf-core.c dev_WARN(&epf->dev, "epf device not bound to driver\n"); epf 39 drivers/pci/endpoint/pci-epf-core.c epf->driver->ops->linkup(epf); epf 51 drivers/pci/endpoint/pci-epf-core.c void pci_epf_unbind(struct pci_epf *epf) epf 53 drivers/pci/endpoint/pci-epf-core.c if (!epf->driver) { epf 54 drivers/pci/endpoint/pci-epf-core.c dev_WARN(&epf->dev, "epf device not bound to driver\n"); epf 58 drivers/pci/endpoint/pci-epf-core.c epf->driver->ops->unbind(epf); epf 59 drivers/pci/endpoint/pci-epf-core.c module_put(epf->driver->owner); epf 70 drivers/pci/endpoint/pci-epf-core.c int pci_epf_bind(struct pci_epf *epf) epf 72 drivers/pci/endpoint/pci-epf-core.c if (!epf->driver) { epf 73 drivers/pci/endpoint/pci-epf-core.c dev_WARN(&epf->dev, "epf device not bound to driver\n"); epf 77 drivers/pci/endpoint/pci-epf-core.c if (!try_module_get(epf->driver->owner)) epf 80 drivers/pci/endpoint/pci-epf-core.c return epf->driver->ops->bind(epf); epf 91 drivers/pci/endpoint/pci-epf-core.c void pci_epf_free_space(struct pci_epf *epf, void *addr, enum pci_barno bar) epf 93 drivers/pci/endpoint/pci-epf-core.c struct device *dev = epf->epc->dev.parent; epf 98 drivers/pci/endpoint/pci-epf-core.c dma_free_coherent(dev, epf->bar[bar].size, addr, epf 99 drivers/pci/endpoint/pci-epf-core.c epf->bar[bar].phys_addr); epf 101 drivers/pci/endpoint/pci-epf-core.c epf->bar[bar].phys_addr = 0; epf 102 drivers/pci/endpoint/pci-epf-core.c epf->bar[bar].size = 0; epf 103 drivers/pci/endpoint/pci-epf-core.c epf->bar[bar].barno = 0; epf 104 drivers/pci/endpoint/pci-epf-core.c epf->bar[bar].flags = 0; epf 116 drivers/pci/endpoint/pci-epf-core.c void *pci_epf_alloc_space(struct pci_epf *epf, size_t size, enum pci_barno bar, epf 120 drivers/pci/endpoint/pci-epf-core.c struct device *dev = epf->epc->dev.parent; epf 137 drivers/pci/endpoint/pci-epf-core.c epf->bar[bar].phys_addr = phys_addr; epf 138 drivers/pci/endpoint/pci-epf-core.c epf->bar[bar].size = size; epf 139 drivers/pci/endpoint/pci-epf-core.c epf->bar[bar].barno = bar; epf 140 drivers/pci/endpoint/pci-epf-core.c epf->bar[bar].flags |= upper_32_bits(size) ? epf 239 drivers/pci/endpoint/pci-epf-core.c void pci_epf_destroy(struct pci_epf *epf) epf 241 drivers/pci/endpoint/pci-epf-core.c device_unregister(&epf->dev); epf 256 drivers/pci/endpoint/pci-epf-core.c struct pci_epf *epf; epf 260 drivers/pci/endpoint/pci-epf-core.c epf = kzalloc(sizeof(*epf), GFP_KERNEL); epf 261 drivers/pci/endpoint/pci-epf-core.c if (!epf) epf 265 drivers/pci/endpoint/pci-epf-core.c epf->name = kstrndup(name, len, GFP_KERNEL); epf 266 drivers/pci/endpoint/pci-epf-core.c if (!epf->name) { epf 267 drivers/pci/endpoint/pci-epf-core.c kfree(epf); epf 271 drivers/pci/endpoint/pci-epf-core.c dev = &epf->dev; epf 288 drivers/pci/endpoint/pci-epf-core.c return epf; epf 293 drivers/pci/endpoint/pci-epf-core.c pci_epf_match_device(const struct pci_epf_device_id *id, struct pci_epf *epf) epf 295 drivers/pci/endpoint/pci-epf-core.c if (!id || !epf) epf 299 drivers/pci/endpoint/pci-epf-core.c if (strcmp(epf->name, id->name) == 0) epf 310 drivers/pci/endpoint/pci-epf-core.c struct pci_epf *epf = to_pci_epf(dev); epf 312 drivers/pci/endpoint/pci-epf-core.c kfree(epf->name); epf 313 drivers/pci/endpoint/pci-epf-core.c kfree(epf); epf 321 drivers/pci/endpoint/pci-epf-core.c pci_epf_match_id(const struct pci_epf_device_id *id, const struct pci_epf *epf) epf 324 drivers/pci/endpoint/pci-epf-core.c if (strcmp(epf->name, id->name) == 0) epf 334 drivers/pci/endpoint/pci-epf-core.c struct pci_epf *epf = to_pci_epf(dev); epf 338 drivers/pci/endpoint/pci-epf-core.c return pci_epf_match_id(driver->id_table, epf); epf 340 drivers/pci/endpoint/pci-epf-core.c return !strcmp(epf->name, drv->name); epf 345 drivers/pci/endpoint/pci-epf-core.c struct pci_epf *epf = to_pci_epf(dev); epf 351 drivers/pci/endpoint/pci-epf-core.c epf->driver = driver; epf 353 drivers/pci/endpoint/pci-epf-core.c return driver->probe(epf); epf 359 drivers/pci/endpoint/pci-epf-core.c struct pci_epf *epf = to_pci_epf(dev); epf 363 drivers/pci/endpoint/pci-epf-core.c ret = driver->remove(epf); epf 364 drivers/pci/endpoint/pci-epf-core.c epf->driver = NULL; epf 155 include/linux/pci-epc.h int pci_epc_add_epf(struct pci_epc *epc, struct pci_epf *epf); epf 157 include/linux/pci-epc.h void pci_epc_remove_epf(struct pci_epc *epc, struct pci_epf *epf); epf 62 include/linux/pci-epf.h int (*bind)(struct pci_epf *epf); epf 63 include/linux/pci-epf.h void (*unbind)(struct pci_epf *epf); epf 64 include/linux/pci-epf.h void (*linkup)(struct pci_epf *epf); epf 79 include/linux/pci-epf.h int (*probe)(struct pci_epf *epf); epf 80 include/linux/pci-epf.h int (*remove)(struct pci_epf *epf); epf 135 include/linux/pci-epf.h static inline void epf_set_drvdata(struct pci_epf *epf, void *data) epf 137 include/linux/pci-epf.h dev_set_drvdata(&epf->dev, data); epf 140 include/linux/pci-epf.h static inline void *epf_get_drvdata(struct pci_epf *epf) epf 142 include/linux/pci-epf.h return dev_get_drvdata(&epf->dev); epf 146 include/linux/pci-epf.h pci_epf_match_device(const struct pci_epf_device_id *id, struct pci_epf *epf); epf 148 include/linux/pci-epf.h void pci_epf_destroy(struct pci_epf *epf); epf 152 include/linux/pci-epf.h void *pci_epf_alloc_space(struct pci_epf *epf, size_t size, enum pci_barno bar, epf 154 include/linux/pci-epf.h void pci_epf_free_space(struct pci_epf *epf, void *addr, enum pci_barno bar); epf 155 include/linux/pci-epf.h int pci_epf_bind(struct pci_epf *epf); epf 156 include/linux/pci-epf.h void pci_epf_unbind(struct pci_epf *epf); epf 157 include/linux/pci-epf.h void pci_epf_linkup(struct pci_epf *epf);