€•¡ÈŒsphinx.addnodes”Œdocument”“”)�”}”(Œ rawsource”Œ”Œchildren”]”(Œ translations”Œ LanguagesNode”“”)�”}”(hhh]”(hŒ pending_xref”“”)�”}”(hhh]”Œdocutils.nodes”ŒText”“”ŒChinese (Simplified)”…”�”}”Œparent”hsbaŒ attributes”}”(Œids”]”Œclasses”]”Œnames”]”Œdupnames”]”Œbackrefs”]”Œ refdomain”Œstd”Œreftype”Œdoc”Œ reftarget”Œ-/translations/zh_CN/PCI/endpoint/pci-endpoint”Œmodname”NŒ classname”NŒ refexplicit”ˆuŒtagname”hhh ubh)�”}”(hhh]”hŒChinese (Traditional)”…”�”}”hh2sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ-/translations/zh_TW/PCI/endpoint/pci-endpoint”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)�”}”(hhh]”hŒItalian”…”�”}”hhFsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ-/translations/it_IT/PCI/endpoint/pci-endpoint”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)�”}”(hhh]”hŒJapanese”…”�”}”hhZsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ-/translations/ja_JP/PCI/endpoint/pci-endpoint”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)�”}”(hhh]”hŒKorean”…”�”}”hhnsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ-/translations/ko_KR/PCI/endpoint/pci-endpoint”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)�”}”(hhh]”hŒPortuguese (Brazilian)”…”�”}”hh‚sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ-/translations/pt_BR/PCI/endpoint/pci-endpoint”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)�”}”(hhh]”hŒSpanish”…”�”}”hh–sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ-/translations/sp_SP/PCI/endpoint/pci-endpoint”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubeh}”(h]”h ]”h"]”h$]”h&]”Œcurrent_language”ŒEnglish”uh1h hhŒ _document”hŒsource”NŒline”NubhŒcomment”“”)�”}”(hŒ SPDX-License-Identifier: GPL-2.0”h]”hŒ SPDX-License-Identifier: GPL-2.0”…”�”}”hh·sbah}”(h]”h ]”h"]”h$]”h&]”Œ xml:space”Œpreserve”uh1hµhhh²hh³ŒG/var/lib/git/docbuild/linux/Documentation/PCI/endpoint/pci-endpoint.rst”h´KubhŒ paragraph”“”)�”}”(hŒÖThis document is a guide to use the PCI Endpoint Framework in order to create endpoint controller driver, endpoint function driver, and using configfs interface to bind the function driver to the controller driver.”h]”hŒÖThis document is a guide to use the PCI Endpoint Framework in order to create endpoint controller driver, endpoint function driver, and using configfs interface to bind the function driver to the controller driver.”…”�”}”(hhÊh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈh³hÇh´Khhh²hubhŒsection”“”)�”}”(hhh]”(hŒtitle”“”)�”}”(hŒ Introduction”h]”hŒ Introduction”…”�”}”(hhßh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝhhÚh²hh³hÇh´K ubhÉ)�”}”(hXWLinux has a comprehensive PCI subsystem to support PCI controllers that operates in Root Complex mode. The subsystem has capability to scan PCI bus, assign memory resources and IRQ resources, load PCI driver (based on vendor ID, device ID), support other services like hot-plug, power management, advanced error reporting and virtual channels.”h]”hXWLinux has a comprehensive PCI subsystem to support PCI controllers that operates in Root Complex mode. The subsystem has capability to scan PCI bus, assign memory resources and IRQ resources, load PCI driver (based on vendor ID, device ID), support other services like hot-plug, power management, advanced error reporting and virtual channels.”…”�”}”(hhíh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈh³hÇh´K hhÚh²hubhÉ)�”}”(hXMHowever the PCI controller IP integrated in some SoCs is capable of operating either in Root Complex mode or Endpoint mode. PCI Endpoint Framework will add endpoint mode support in Linux. This will help to run Linux in an EP system which can have a wide variety of use cases from testing or validation, co-processor accelerator, etc.”h]”hXMHowever the PCI controller IP integrated in some SoCs is capable of operating either in Root Complex mode or Endpoint mode. PCI Endpoint Framework will add endpoint mode support in Linux. This will help to run Linux in an EP system which can have a wide variety of use cases from testing or validation, co-processor accelerator, etc.”…”�”}”(hhûh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈh³hÇh´KhhÚh²hubeh}”(h]”Œ introduction”ah ]”h"]”Œ introduction”ah$]”h&]”uh1hØhhh²hh³hÇh´K ubhÙ)�”}”(hhh]”(hÞ)�”}”(hŒPCI Endpoint Core”h]”hŒPCI Endpoint Core”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝhjh²hh³hÇh´KubhÉ)�”}”(hŒÆThe PCI Endpoint Core layer comprises 3 components: the Endpoint Controller library, the Endpoint Function library, and the configfs layer to bind the endpoint function with the endpoint controller.”h]”hŒÆThe PCI Endpoint Core layer comprises 3 components: the Endpoint Controller library, the Endpoint Function library, and the configfs layer to bind the endpoint function with the endpoint controller.”…”�”}”(hj"h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈh³hÇh´Khjh²hubhÙ)�”}”(hhh]”(hÞ)�”}”(hŒ$PCI Endpoint Controller(EPC) Library”h]”hŒ$PCI Endpoint Controller(EPC) Library”…”�”}”(hj3h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝhj0h²hh³hÇh´K ubhÉ)�”}”(hŒÏThe EPC library provides APIs to be used by the controller that can operate in endpoint mode. It also provides APIs to be used by function driver/library in order to implement a particular endpoint function.”h]”hŒÏThe EPC library provides APIs to be used by the controller that can operate in endpoint mode. It also provides APIs to be used by function driver/library in order to implement a particular endpoint function.”…”�”}”(hjAh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈh³hÇh´K"hj0h²hubhÙ)�”}”(hhh]”(hÞ)�”}”(hŒ"APIs for the PCI controller Driver”h]”hŒ"APIs for the PCI controller Driver”…”�”}”(hjRh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝhjOh²hh³hÇh´K'ubhÉ)�”}”(hŒhThis section lists the APIs that the PCI Endpoint core provides to be used by the PCI controller driver.”h]”hŒhThis section lists the APIs that the PCI Endpoint core provides to be used by the PCI controller driver.”…”�”}”(hj`h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈh³hÇh´K)hjOh²hubhŒ bullet_list”“”)�”}”(hhh]”(hŒ list_item”“”)�”}”(hX‘devm_pci_epc_create()/pci_epc_create() The PCI controller driver should implement the following ops: * write_header: ops to populate configuration space header * set_bar: ops to configure the BAR * clear_bar: ops to reset the BAR * alloc_addr_space: ops to allocate in PCI controller address space * free_addr_space: ops to free the allocated address space * raise_irq: ops to raise a legacy, MSI or MSI-X interrupt * start: ops to start the PCI link * stop: ops to stop the PCI link The PCI controller driver can then create a new EPC device by invoking devm_pci_epc_create()/pci_epc_create(). ”h]”(hÉ)�”}”(hŒ&devm_pci_epc_create()/pci_epc_create()”h]”hŒ&devm_pci_epc_create()/pci_epc_create()”…”�”}”(hjyh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈh³hÇh´K,hjuubhŒ block_quote”“”)�”}”(hX^The PCI controller driver should implement the following ops: * write_header: ops to populate configuration space header * set_bar: ops to configure the BAR * clear_bar: ops to reset the BAR * alloc_addr_space: ops to allocate in PCI controller address space * free_addr_space: ops to free the allocated address space * raise_irq: ops to raise a legacy, MSI or MSI-X interrupt * start: ops to start the PCI link * stop: ops to stop the PCI link The PCI controller driver can then create a new EPC device by invoking devm_pci_epc_create()/pci_epc_create(). ”h]”(hÉ)�”}”(hŒ=The PCI controller driver should implement the following ops:”h]”hŒ=The PCI controller driver should implement the following ops:”…”�”}”(hj�h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈh³hÇh´K.hj‰ubjˆ)�”}”(hX* write_header: ops to populate configuration space header * set_bar: ops to configure the BAR * clear_bar: ops to reset the BAR * alloc_addr_space: ops to allocate in PCI controller address space * free_addr_space: ops to free the allocated address space * raise_irq: ops to raise a legacy, MSI or MSI-X interrupt * start: ops to start the PCI link * stop: ops to stop the PCI link ”h]”jo)�”}”(hhh]”(jt)�”}”(hŒ8write_header: ops to populate configuration space header”h]”hÉ)�”}”(hj¤h]”hŒ8write_header: ops to populate configuration space header”…”�”}”(hj¦h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈh³hÇh´K0hj¢ubah}”(h]”h ]”h"]”h$]”h&]”uh1jshjŸubjt)�”}”(hŒ!set_bar: ops to configure the BAR”h]”hÉ)�”}”(hj»h]”hŒ!set_bar: ops to configure the BAR”…”�”}”(hj½h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈh³hÇh´K1hj¹ubah}”(h]”h ]”h"]”h$]”h&]”uh1jshjŸubjt)�”}”(hŒclear_bar: ops to reset the BAR”h]”hÉ)�”}”(hjÒh]”hŒclear_bar: ops to reset the BAR”…”�”}”(hjÔh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈh³hÇh´K2hjÐubah}”(h]”h ]”h"]”h$]”h&]”uh1jshjŸubjt)�”}”(hŒAalloc_addr_space: ops to allocate in PCI controller address space”h]”hÉ)�”}”(hjéh]”hŒAalloc_addr_space: ops to allocate in PCI controller address space”…”�”}”(hjëh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈh³hÇh´K3hjçubah}”(h]”h ]”h"]”h$]”h&]”uh1jshjŸubjt)�”}”(hŒ8free_addr_space: ops to free the allocated address space”h]”hÉ)�”}”(hjh]”hŒ8free_addr_space: ops to free the allocated address space”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈh³hÇh´K4hjþubah}”(h]”h ]”h"]”h$]”h&]”uh1jshjŸubjt)�”}”(hŒ8raise_irq: ops to raise a legacy, MSI or MSI-X interrupt”h]”hÉ)�”}”(hjh]”hŒ8raise_irq: ops to raise a legacy, MSI or MSI-X interrupt”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈh³hÇh´K5hjubah}”(h]”h ]”h"]”h$]”h&]”uh1jshjŸubjt)�”}”(hŒ start: ops to start the PCI link”h]”hÉ)�”}”(hj.h]”hŒ start: ops to start the PCI link”…”�”}”(hj0h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈh³hÇh´K6hj,ubah}”(h]”h ]”h"]”h$]”h&]”uh1jshjŸubjt)�”}”(hŒstop: ops to stop the PCI link ”h]”hÉ)�”}”(hŒstop: ops to stop the PCI link”h]”hŒstop: ops to stop the PCI link”…”�”}”(hjGh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈh³hÇh´K7hjCubah}”(h]”h ]”h"]”h$]”h&]”uh1jshjŸubeh}”(h]”h ]”h"]”h$]”h&]”Œbullet”Œ*”uh1jnh³hÇh´K0hj›ubah}”(h]”h ]”h"]”h$]”h&]”uh1j‡h³hÇh´K0hj‰ubhÉ)�”}”(hŒnThe PCI controller driver can then create a new EPC device by invoking devm_pci_epc_create()/pci_epc_create().”h]”hŒnThe PCI controller driver can then create a new EPC device by invoking devm_pci_epc_create()/pci_epc_create().”…”�”}”(hjih²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈh³hÇh´K9hj‰ubeh}”(h]”h ]”h"]”h$]”h&]”uh1j‡h³hÇh´K.hjuubeh}”(h]”h ]”h"]”h$]”h&]”uh1jshjph²hh³hÇh´Nubjt)�”}”(hŒpci_epc_destroy() The PCI controller driver can destroy the EPC device created by pci_epc_create() using pci_epc_destroy(). ”h]”(hÉ)�”}”(hŒpci_epc_destroy()”h]”hŒpci_epc_destroy()”…”�”}”(hj‡h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈh³hÇh´Khj•ubah}”(h]”h ]”h"]”h$]”h&]”uh1j‡h³hÇh´K>hjƒubeh}”(h]”h ]”h"]”h$]”h&]”uh1jshjph²hh³hÇh´Nubjt)�”}”(hŒÎpci_epc_linkup() In order to notify all the function devices that the EPC device to which they are linked has established a link with the host, the PCI controller driver should invoke pci_epc_linkup(). ”h]”(hÉ)�”}”(hŒpci_epc_linkup()”h]”hŒpci_epc_linkup()”…”�”}”(hj·h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈh³hÇh´KAhj³ubjˆ)�”}”(hŒ¹In order to notify all the function devices that the EPC device to which they are linked has established a link with the host, the PCI controller driver should invoke pci_epc_linkup(). ”h]”hÉ)�”}”(hŒ¸In order to notify all the function devices that the EPC device to which they are linked has established a link with the host, the PCI controller driver should invoke pci_epc_linkup().”h]”hŒ¸In order to notify all the function devices that the EPC device to which they are linked has established a link with the host, the PCI controller driver should invoke pci_epc_linkup().”…”�”}”(hjÉh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈh³hÇh´KChjÅubah}”(h]”h ]”h"]”h$]”h&]”uh1j‡h³hÇh´KChj³ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jshjph²hh³hÇh´Nubjt)�”}”(hŒ^pci_epc_mem_init() Initialize the pci_epc_mem structure used for allocating EPC addr space. ”h]”(hÉ)�”}”(hŒpci_epc_mem_init()”h]”hŒpci_epc_mem_init()”…”�”}”(hjçh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈh³hÇh´KGhjãubjˆ)�”}”(hŒIInitialize the pci_epc_mem structure used for allocating EPC addr space. ”h]”hÉ)�”}”(hŒHInitialize the pci_epc_mem structure used for allocating EPC addr space.”h]”hŒHInitialize the pci_epc_mem structure used for allocating EPC addr space.”…”�”}”(hjùh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈh³hÇh´KIhjõubah}”(h]”h ]”h"]”h$]”h&]”uh1j‡h³hÇh´KIhjãubeh}”(h]”h ]”h"]”h$]”h&]”uh1jshjph²hh³hÇh´Nubjt)�”}”(hŒ]pci_epc_mem_exit() Cleanup the pci_epc_mem structure allocated during pci_epc_mem_init(). ”h]”(hÉ)�”}”(hŒpci_epc_mem_exit()”h]”hŒpci_epc_mem_exit()”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈh³hÇh´KKhjubjˆ)�”}”(hŒHCleanup the pci_epc_mem structure allocated during pci_epc_mem_init(). ”h]”hÉ)�”}”(hŒFCleanup the pci_epc_mem structure allocated during pci_epc_mem_init().”h]”hŒFCleanup the pci_epc_mem structure allocated during pci_epc_mem_init().”…”�”}”(hj)h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈh³hÇh´KMhj%ubah}”(h]”h ]”h"]”h$]”h&]”uh1j‡h³hÇh´KMhjubeh}”(h]”h ]”h"]”h$]”h&]”uh1jshjph²hh³hÇh´Nubeh}”(h]”h ]”h"]”h$]”h&]”jajbuh1jnh³hÇh´K,hjOh²hubeh}”(h]”Œ"apis-for-the-pci-controller-driver”ah ]”h"]”Œ"apis for the pci controller driver”ah$]”h&]”uh1hØhj0h²hh³hÇh´K'ubhÙ)�”}”(hhh]”(hÞ)�”}”(hŒ-EPC APIs for the PCI Endpoint Function Driver”h]”hŒ-EPC APIs for the PCI Endpoint Function Driver”…”�”}”(hjTh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝhjQh²hh³hÇh´KQubhÉ)�”}”(hŒoThis section lists the APIs that the PCI Endpoint core provides to be used by the PCI endpoint function driver.”h]”hŒoThis section lists the APIs that the PCI Endpoint core provides to be used by the PCI endpoint function driver.”…”�”}”(hjbh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈh³hÇh´KShjQh²hubjo)�”}”(hhh]”(jt)�”}”(hŒ¤pci_epc_write_header() The PCI endpoint function driver should use pci_epc_write_header() to write the standard configuration header to the endpoint controller. ”h]”(hÉ)�”}”(hŒpci_epc_write_header()”h]”hŒpci_epc_write_header()”…”�”}”(hjwh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈh³hÇh´KVhjsubjˆ)�”}”(hŒŠThe PCI endpoint function driver should use pci_epc_write_header() to write the standard configuration header to the endpoint controller. ”h]”hÉ)�”}”(hŒ‰The PCI endpoint function driver should use pci_epc_write_header() to write the standard configuration header to the endpoint controller.”h]”hŒ‰The PCI endpoint function driver should use pci_epc_write_header() to write the standard configuration header to the endpoint controller.”…”�”}”(hj‰h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈh³hÇh´KXhj…ubah}”(h]”h ]”h"]”h$]”h&]”uh1j‡h³hÇh´KXhjsubeh}”(h]”h ]”h"]”h$]”h&]”uh1jshjph²hh³hÇh´Nubjt)�”}”(hXDpci_epc_set_bar() The PCI endpoint function driver should use pci_epc_set_bar() to configure the Base Address Register in order for the host to assign PCI addr space. Register space of the function driver is usually configured using this API. Some endpoint controllers also support calling pci_epc_set_bar() again for the same BAR (without calling pci_epc_clear_bar()) to update inbound address translations after the host has programmed the BAR base address. Endpoint function drivers can check this capability via the dynamic_inbound_mapping EPC feature bit. When pci_epf_bar.num_submap is non-zero, the endpoint function driver is requesting BAR subrange mapping using pci_epf_bar.submap. This requires the EPC to advertise support via the subrange_mapping EPC feature bit. When an EPF driver wants to make use of the inbound subrange mapping feature, it requires that the BAR base address has been programmed by the host during enumeration. Thus, it needs to call pci_epc_set_bar() twice for the same BAR (requires dynamic_inbound_mapping): first with num_submap set to zero and configuring the BAR size, then after the PCIe link is up and the host enumerates the endpoint and programs the BAR base address, again with num_submap set to non-zero value. Note that when making use of the inbound subrange mapping feature, the EPF driver must not call pci_epc_clear_bar() between the two pci_epc_set_bar() calls, because clearing the BAR can clear/disable the BAR register or BAR decode on the endpoint while the host still expects the assigned BAR address to remain valid. ”h]”(hÉ)�”}”(hŒpci_epc_set_bar()”h]”hŒpci_epc_set_bar()”…”�”}”(hj§h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈh³hÇh´K[hj£ubjˆ)�”}”(hXThe PCI endpoint function driver should use pci_epc_set_bar() to configure the Base Address Register in order for the host to assign PCI addr space. Register space of the function driver is usually configured using this API. Some endpoint controllers also support calling pci_epc_set_bar() again for the same BAR (without calling pci_epc_clear_bar()) to update inbound address translations after the host has programmed the BAR base address. Endpoint function drivers can check this capability via the dynamic_inbound_mapping EPC feature bit. When pci_epf_bar.num_submap is non-zero, the endpoint function driver is requesting BAR subrange mapping using pci_epf_bar.submap. This requires the EPC to advertise support via the subrange_mapping EPC feature bit. When an EPF driver wants to make use of the inbound subrange mapping feature, it requires that the BAR base address has been programmed by the host during enumeration. Thus, it needs to call pci_epc_set_bar() twice for the same BAR (requires dynamic_inbound_mapping): first with num_submap set to zero and configuring the BAR size, then after the PCIe link is up and the host enumerates the endpoint and programs the BAR base address, again with num_submap set to non-zero value. Note that when making use of the inbound subrange mapping feature, the EPF driver must not call pci_epc_clear_bar() between the two pci_epc_set_bar() calls, because clearing the BAR can clear/disable the BAR register or BAR decode on the endpoint while the host still expects the assigned BAR address to remain valid. ”h]”(hÉ)�”}”(hŒàThe PCI endpoint function driver should use pci_epc_set_bar() to configure the Base Address Register in order for the host to assign PCI addr space. Register space of the function driver is usually configured using this API.”h]”hŒàThe PCI endpoint function driver should use pci_epc_set_bar() to configure the Base Address Register in order for the host to assign PCI addr space. Register space of the function driver is usually configured using this API.”…”�”}”(hj¹h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈh³hÇh´K]hjµubhÉ)�”}”(hX=Some endpoint controllers also support calling pci_epc_set_bar() again for the same BAR (without calling pci_epc_clear_bar()) to update inbound address translations after the host has programmed the BAR base address. Endpoint function drivers can check this capability via the dynamic_inbound_mapping EPC feature bit.”h]”hX=Some endpoint controllers also support calling pci_epc_set_bar() again for the same BAR (without calling pci_epc_clear_bar()) to update inbound address translations after the host has programmed the BAR base address. Endpoint function drivers can check this capability via the dynamic_inbound_mapping EPC feature bit.”…”�”}”(hjÇh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈh³hÇh´KbhjµubhÉ)�”}”(hŒ×When pci_epf_bar.num_submap is non-zero, the endpoint function driver is requesting BAR subrange mapping using pci_epf_bar.submap. This requires the EPC to advertise support via the subrange_mapping EPC feature bit.”h]”hŒ×When pci_epf_bar.num_submap is non-zero, the endpoint function driver is requesting BAR subrange mapping using pci_epf_bar.submap. This requires the EPC to advertise support via the subrange_mapping EPC feature bit.”…”�”}”(hjÕh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈh³hÇh´KhhjµubhÉ)�”}”(hXßWhen an EPF driver wants to make use of the inbound subrange mapping feature, it requires that the BAR base address has been programmed by the host during enumeration. Thus, it needs to call pci_epc_set_bar() twice for the same BAR (requires dynamic_inbound_mapping): first with num_submap set to zero and configuring the BAR size, then after the PCIe link is up and the host enumerates the endpoint and programs the BAR base address, again with num_submap set to non-zero value.”h]”hXßWhen an EPF driver wants to make use of the inbound subrange mapping feature, it requires that the BAR base address has been programmed by the host during enumeration. Thus, it needs to call pci_epc_set_bar() twice for the same BAR (requires dynamic_inbound_mapping): first with num_submap set to zero and configuring the BAR size, then after the PCIe link is up and the host enumerates the endpoint and programs the BAR base address, again with num_submap set to non-zero value.”…”�”}”(hjãh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈh³hÇh´KlhjµubhÉ)�”}”(hX=Note that when making use of the inbound subrange mapping feature, the EPF driver must not call pci_epc_clear_bar() between the two pci_epc_set_bar() calls, because clearing the BAR can clear/disable the BAR register or BAR decode on the endpoint while the host still expects the assigned BAR address to remain valid.”h]”hX=Note that when making use of the inbound subrange mapping feature, the EPF driver must not call pci_epc_clear_bar() between the two pci_epc_set_bar() calls, because clearing the BAR can clear/disable the BAR register or BAR decode on the endpoint while the host still expects the assigned BAR address to remain valid.”…”�”}”(hjñh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈh³hÇh´Kthjµubeh}”(h]”h ]”h"]”h$]”h&]”uh1j‡h³hÇh´K]hj£ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jshjph²hh³hÇh´Nubjt)�”}”(hŒipci_epc_clear_bar() The PCI endpoint function driver should use pci_epc_clear_bar() to reset the BAR. ”h]”(hÉ)�”}”(hŒpci_epc_clear_bar()”h]”hŒpci_epc_clear_bar()”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈh³hÇh´Kzhj ubjˆ)�”}”(hŒRThe PCI endpoint function driver should use pci_epc_clear_bar() to reset the BAR. ”h]”hÉ)�”}”(hŒQThe PCI endpoint function driver should use pci_epc_clear_bar() to reset the BAR.”h]”hŒQThe PCI endpoint function driver should use pci_epc_clear_bar() to reset the BAR.”…”�”}”(hj!h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈh³hÇh´K|hjubah}”(h]”h ]”h"]”h$]”h&]”uh1j‡h³hÇh´K|hj ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jshjph²hh³hÇh´Nubjt)�”}”(hŒŠpci_epc_raise_irq() The PCI endpoint function driver should use pci_epc_raise_irq() to raise Legacy Interrupt, MSI or MSI-X Interrupt. ”h]”(hÉ)�”}”(hŒpci_epc_raise_irq()”h]”hŒpci_epc_raise_irq()”…”�”}”(hj?h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈh³hÇh´Khj;ubjˆ)�”}”(hŒsThe PCI endpoint function driver should use pci_epc_raise_irq() to raise Legacy Interrupt, MSI or MSI-X Interrupt. ”h]”hÉ)�”}”(hŒrThe PCI endpoint function driver should use pci_epc_raise_irq() to raise Legacy Interrupt, MSI or MSI-X Interrupt.”h]”hŒrThe PCI endpoint function driver should use pci_epc_raise_irq() to raise Legacy Interrupt, MSI or MSI-X Interrupt.”…”�”}”(hjQh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈh³hÇh´K�hjMubah}”(h]”h ]”h"]”h$]”h&]”uh1j‡h³hÇh´K�hj;ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jshjph²hh³hÇh´Nubjt)�”}”(hŒºpci_epc_mem_alloc_addr() The PCI endpoint function driver should use pci_epc_mem_alloc_addr(), to allocate memory address from EPC addr space which is required to access RC's buffer ”h]”(hÉ)�”}”(hŒpci_epc_mem_alloc_addr()”h]”hŒpci_epc_mem_alloc_addr()”…”�”}”(hjoh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈh³hÇh´K„hjkubjˆ)�”}”(hŒ�The PCI endpoint function driver should use pci_epc_mem_alloc_addr(), to allocate memory address from EPC addr space which is required to access RC's buffer ”h]”hÉ)�”}”(hŒœThe PCI endpoint function driver should use pci_epc_mem_alloc_addr(), to allocate memory address from EPC addr space which is required to access RC's buffer”h]”hŒžThe PCI endpoint function driver should use pci_epc_mem_alloc_addr(), to allocate memory address from EPC addr space which is required to access RC’s buffer”…”�”}”(hj�h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈh³hÇh´K†hj}ubah}”(h]”h ]”h"]”h$]”h&]”uh1j‡h³hÇh´K†hjkubeh}”(h]”h ]”h"]”h$]”h&]”uh1jshjph²hh³hÇh´Nubjt)�”}”(hŒ¢pci_epc_mem_free_addr() The PCI endpoint function driver should use pci_epc_mem_free_addr() to free the memory space allocated using pci_epc_mem_alloc_addr(). ”h]”(hÉ)�”}”(hŒpci_epc_mem_free_addr()”h]”hŒpci_epc_mem_free_addr()”…”�”}”(hjŸh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈh³hÇh´KŠhj›ubjˆ)�”}”(hŒ‡The PCI endpoint function driver should use pci_epc_mem_free_addr() to free the memory space allocated using pci_epc_mem_alloc_addr(). ”h]”hÉ)�”}”(hŒ†The PCI endpoint function driver should use pci_epc_mem_free_addr() to free the memory space allocated using pci_epc_mem_alloc_addr().”h]”hŒ†The PCI endpoint function driver should use pci_epc_mem_free_addr() to free the memory space allocated using pci_epc_mem_alloc_addr().”…”�”}”(hj±h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈh³hÇh´KŒhj­ubah}”(h]”h ]”h"]”h$]”h&]”uh1j‡h³hÇh´KŒhj›ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jshjph²hh³hÇh´Nubjt)�”}”(hŒ´pci_epc_map_addr() A PCI endpoint function driver should use pci_epc_map_addr() to map to a RC PCI address the CPU address of local memory obtained with pci_epc_mem_alloc_addr(). ”h]”(hÉ)�”}”(hŒpci_epc_map_addr()”h]”hŒpci_epc_map_addr()”…”�”}”(hjÏh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈh³hÇh´K�hjËubhÉ)�”}”(hŒŸA PCI endpoint function driver should use pci_epc_map_addr() to map to a RC PCI address the CPU address of local memory obtained with pci_epc_mem_alloc_addr().”h]”hŒŸA PCI endpoint function driver should use pci_epc_map_addr() to map to a RC PCI address the CPU address of local memory obtained with pci_epc_mem_alloc_addr().”…”�”}”(hjÝh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈh³hÇh´K‘hjËubeh}”(h]”h ]”h"]”h$]”h&]”uh1jshjph²hh³hÇh´Nubjt)�”}”(hŒ®pci_epc_unmap_addr() A PCI endpoint function driver should use pci_epc_unmap_addr() to unmap the CPU address of local memory mapped to a RC address with pci_epc_map_addr(). ”h]”(hÉ)�”}”(hŒpci_epc_unmap_addr()”h]”hŒpci_epc_unmap_addr()”…”�”}”(hjõh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈh³hÇh´K•hjñubhÉ)�”}”(hŒ—A PCI endpoint function driver should use pci_epc_unmap_addr() to unmap the CPU address of local memory mapped to a RC address with pci_epc_map_addr().”h]”hŒ—A PCI endpoint function driver should use pci_epc_unmap_addr() to unmap the CPU address of local memory mapped to a RC address with pci_epc_map_addr().”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈh³hÇh´K—hjñubeh}”(h]”h ]”h"]”h$]”h&]”uh1jshjph²hh³hÇh´Nubjt)�”}”(hXpci_epc_mem_map() A PCI endpoint controller may impose constraints on the RC PCI addresses that can be mapped. The function pci_epc_mem_map() allows endpoint function drivers to allocate and map controller memory while handling such constraints. This function will determine the size of the memory that must be allocated with pci_epc_mem_alloc_addr() for successfully mapping a RC PCI address range. This function will also indicate the size of the PCI address range that was actually mapped, which can be less than the requested size, as well as the offset into the allocated memory to use for accessing the mapped RC PCI address range. ”h]”(hÉ)�”}”(hŒpci_epc_mem_map()”h]”hŒpci_epc_mem_map()”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈh³hÇh´KšhjubhÉ)�”}”(hXkA PCI endpoint controller may impose constraints on the RC PCI addresses that can be mapped. The function pci_epc_mem_map() allows endpoint function drivers to allocate and map controller memory while handling such constraints. This function will determine the size of the memory that must be allocated with pci_epc_mem_alloc_addr() for successfully mapping a RC PCI address range. This function will also indicate the size of the PCI address range that was actually mapped, which can be less than the requested size, as well as the offset into the allocated memory to use for accessing the mapped RC PCI address range.”h]”hXkA PCI endpoint controller may impose constraints on the RC PCI addresses that can be mapped. The function pci_epc_mem_map() allows endpoint function drivers to allocate and map controller memory while handling such constraints. This function will determine the size of the memory that must be allocated with pci_epc_mem_alloc_addr() for successfully mapping a RC PCI address range. This function will also indicate the size of the PCI address range that was actually mapped, which can be less than the requested size, as well as the offset into the allocated memory to use for accessing the mapped RC PCI address range.”…”�”}”(hj)h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈh³hÇh´Kœhjubeh}”(h]”h ]”h"]”h$]”h&]”uh1jshjph²hh³hÇh´Nubjt)�”}”(hŒ¬pci_epc_mem_unmap() A PCI endpoint function driver can use pci_epc_mem_unmap() to unmap and free controller memory that was allocated and mapped using pci_epc_mem_map(). ”h]”(hÉ)�”}”(hŒpci_epc_mem_unmap()”h]”hŒpci_epc_mem_unmap()”…”�”}”(hjAh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈh³hÇh´K¦hj=ubhÉ)�”}”(hŒ•A PCI endpoint function driver can use pci_epc_mem_unmap() to unmap and free controller memory that was allocated and mapped using pci_epc_mem_map().”h]”hŒ•A PCI endpoint function driver can use pci_epc_mem_unmap() to unmap and free controller memory that was allocated and mapped using pci_epc_mem_map().”…”�”}”(hjOh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈh³hÇh´K¨hj=ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jshjph²hh³hÇh´Nubeh}”(h]”h ]”h"]”h$]”h&]”jajbuh1jnh³hÇh´KVhjQh²hubeh}”(h]”Œ-epc-apis-for-the-pci-endpoint-function-driver”ah ]”h"]”Œ-epc apis for the pci endpoint function driver”ah$]”h&]”uh1hØhj0h²hh³hÇh´KQubhÙ)�”}”(hhh]”(hÞ)�”}”(hŒOther EPC APIs”h]”hŒOther EPC APIs”…”�”}”(hjth²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝhjqh²hh³hÇh´K­ubhÉ)�”}”(hŒ¨There are other APIs provided by the EPC library. These are used for binding the EPF device with EPC device. pci-ep-cfs.c can be used as reference for using these APIs.”h]”hŒ¨There are other APIs provided by the EPC library. These are used for binding the EPF device with EPC device. pci-ep-cfs.c can be used as reference for using these APIs.”…”�”}”(hj‚h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈh³hÇh´K¯hjqh²hubjo)�”}”(hhh]”(jt)�”}”(hŒlpci_epc_get() Get a reference to the PCI endpoint controller based on the device name of the controller. ”h]”(hÉ)�”}”(hŒ pci_epc_get()”h]”hŒ pci_epc_get()”…”�”}”(hj—h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈh³hÇh´K³hj“ubjˆ)�”}”(hŒ[Get a reference to the PCI endpoint controller based on the device name of the controller. ”h]”hÉ)�”}”(hŒZGet a reference to the PCI endpoint controller based on the device name of the controller.”h]”hŒZGet a reference to the PCI endpoint controller based on the device name of the controller.”…”�”}”(hj©h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈh³hÇh´Kµhj¥ubah}”(h]”h ]”h"]”h$]”h&]”uh1j‡h³hÇh´Kµhj“ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jshj�h²hh³hÇh´Nubjt)�”}”(hŒcpci_epc_put() Release the reference to the PCI endpoint controller obtained using pci_epc_get() ”h]”(hÉ)�”}”(hŒ pci_epc_put()”h]”hŒ pci_epc_put()”…”�”}”(hjÇh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈh³hÇh´K¸hjÃubjˆ)�”}”(hŒRRelease the reference to the PCI endpoint controller obtained using pci_epc_get() ”h]”hÉ)�”}”(hŒQRelease the reference to the PCI endpoint controller obtained using pci_epc_get()”h]”hŒQRelease the reference to the PCI endpoint controller obtained using pci_epc_get()”…”�”}”(hjÙh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈh³hÇh´KºhjÕubah}”(h]”h ]”h"]”h$]”h&]”uh1j‡h³hÇh´KºhjÃubeh}”(h]”h ]”h"]”h$]”h&]”uh1jshj�h²hh³hÇh´Nubjt)�”}”(hŒ˜pci_epc_add_epf() Add a PCI endpoint function to a PCI endpoint controller. A PCIe device can have up to 8 functions according to the specification. ”h]”(hÉ)�”}”(hŒpci_epc_add_epf()”h]”hŒpci_epc_add_epf()”…”�”}”(hj÷h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈh³hÇh´K½hjóubjˆ)�”}”(hŒƒAdd a PCI endpoint function to a PCI endpoint controller. A PCIe device can have up to 8 functions according to the specification. ”h]”hÉ)�”}”(hŒ‚Add a PCI endpoint function to a PCI endpoint controller. A PCIe device can have up to 8 functions according to the specification.”h]”hŒ‚Add a PCI endpoint function to a PCI endpoint controller. A PCIe device can have up to 8 functions according to the specification.”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈh³hÇh´K¿hjubah}”(h]”h ]”h"]”h$]”h&]”uh1j‡h³hÇh´K¿hjóubeh}”(h]”h ]”h"]”h$]”h&]”uh1jshj�h²hh³hÇh´Nubjt)�”}”(hŒVpci_epc_remove_epf() Remove the PCI endpoint function from PCI endpoint controller. ”h]”(hÉ)�”}”(hŒpci_epc_remove_epf()”h]”hŒpci_epc_remove_epf()”…”�”}”(hj'h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈh³hÇh´KÂhj#ubjˆ)�”}”(hŒ?Remove the PCI endpoint function from PCI endpoint controller. ”h]”hÉ)�”}”(hŒ>Remove the PCI endpoint function from PCI endpoint controller.”h]”hŒ>Remove the PCI endpoint function from PCI endpoint controller.”…”�”}”(hj9h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈh³hÇh´KÄhj5ubah}”(h]”h ]”h"]”h$]”h&]”uh1j‡h³hÇh´KÄhj#ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jshj�h²hh³hÇh´Nubjt)�”}”(hŒ pci_epc_start() The PCI endpoint function driver should invoke pci_epc_start() once it has configured the endpoint function and wants to start the PCI link. ”h]”(hÉ)�”}”(hŒpci_epc_start()”h]”hŒpci_epc_start()”…”�”}”(hjWh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈh³hÇh´KÆhjSubjˆ)�”}”(hŒ�The PCI endpoint function driver should invoke pci_epc_start() once it has configured the endpoint function and wants to start the PCI link. ”h]”hÉ)�”}”(hŒŒThe PCI endpoint function driver should invoke pci_epc_start() once it has configured the endpoint function and wants to start the PCI link.”h]”hŒŒThe PCI endpoint function driver should invoke pci_epc_start() once it has configured the endpoint function and wants to start the PCI link.”…”�”}”(hjih²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈh³hÇh´KÈhjeubah}”(h]”h ]”h"]”h$]”h&]”uh1j‡h³hÇh´KÈhjSubeh}”(h]”h ]”h"]”h$]”h&]”uh1jshj�h²hh³hÇh´Nubjt)�”}”(hŒgpci_epc_stop() The PCI endpoint function driver should invoke pci_epc_stop() to stop the PCI LINK. ”h]”(hÉ)�”}”(hŒpci_epc_stop()”h]”hŒpci_epc_stop()”…”�”}”(hj‡h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈh³hÇh´KËhjƒubjˆ)�”}”(hŒUThe PCI endpoint function driver should invoke pci_epc_stop() to stop the PCI LINK. ”h]”hÉ)�”}”(hŒSThe PCI endpoint function driver should invoke pci_epc_stop() to stop the PCI LINK.”h]”hŒSThe PCI endpoint function driver should invoke pci_epc_stop() to stop the PCI LINK.”…”�”}”(hj™h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈh³hÇh´KÍhj•ubah}”(h]”h ]”h"]”h$]”h&]”uh1j‡h³hÇh´KÍhjƒubeh}”(h]”h ]”h"]”h$]”h&]”uh1jshj�h²hh³hÇh´Nubeh}”(h]”h ]”h"]”h$]”h&]”jajbuh1jnh³hÇh´K³hjqh²hubeh}”(h]”Œother-epc-apis”ah ]”h"]”Œother epc apis”ah$]”h&]”uh1hØhj0h²hh³hÇh´K­ubeh}”(h]”Œ#pci-endpoint-controller-epc-library”ah ]”h"]”Œ$pci endpoint controller(epc) library”ah$]”h&]”uh1hØhjh²hh³hÇh´K ubhÙ)�”}”(hhh]”(hÞ)�”}”(hŒ"PCI Endpoint Function(EPF) Library”h]”hŒ"PCI Endpoint Function(EPF) Library”…”�”}”(hjÌh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝhjÉh²hh³hÇh´KÒubhÉ)�”}”(hŒ{The EPF library provides APIs to be used by the function driver and the EPC library to provide endpoint mode functionality.”h]”hŒ{The EPF library provides APIs to be used by the function driver and the EPC library to provide endpoint mode functionality.”…”�”}”(hjÚh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈh³hÇh´KÔhjÉh²hubhÙ)�”}”(hhh]”(hÞ)�”}”(hŒ-EPF APIs for the PCI Endpoint Function Driver”h]”hŒ-EPF APIs for the PCI Endpoint Function Driver”…”�”}”(hjëh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝhjèh²hh³hÇh´KØubhÉ)�”}”(hŒoThis section lists the APIs that the PCI Endpoint core provides to be used by the PCI endpoint function driver.”h]”hŒoThis section lists the APIs that the PCI Endpoint core provides to be used by the PCI endpoint function driver.”…”�”}”(hjùh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈh³hÇh´KÚhjèh²hubjo)�”}”(hhh]”(jt)�”}”(hXÔpci_epf_register_driver() The PCI Endpoint Function driver should implement the following ops: * bind: ops to perform when an EPC device has been bound to EPF device * unbind: ops to perform when a binding has been lost between an EPC device and EPF device * add_cfs: optional ops to create function specific configfs attributes The PCI Function driver can then register the PCI EPF driver by using pci_epf_register_driver(). ”h]”(hÉ)�”}”(hŒpci_epf_register_driver()”h]”hŒpci_epf_register_driver()”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈh³hÇh´KÝhj ubjˆ)�”}”(hXQThe PCI Endpoint Function driver should implement the following ops: * bind: ops to perform when an EPC device has been bound to EPF device * unbind: ops to perform when a binding has been lost between an EPC device and EPF device * add_cfs: optional ops to create function specific configfs attributes ”h]”hŒdefinition_list”“”)�”}”(hhh]”hŒdefinition_list_item”“”)�”}”(hX3The PCI Endpoint Function driver should implement the following ops: * bind: ops to perform when an EPC device has been bound to EPF device * unbind: ops to perform when a binding has been lost between an EPC device and EPF device * add_cfs: optional ops to create function specific configfs attributes ”h]”(hŒterm”“”)�”}”(hŒDThe PCI Endpoint Function driver should implement the following ops:”h]”hŒDThe PCI Endpoint Function driver should implement the following ops:”…”�”}”(hj-h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j+h³hÇh´Kähj'ubhŒ definition”“”)�”}”(hhh]”jo)�”}”(hhh]”(jt)�”}”(hŒDbind: ops to perform when an EPC device has been bound to EPF device”h]”hÉ)�”}”(hjEh]”hŒDbind: ops to perform when an EPC device has been bound to EPF device”…”�”}”(hjGh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈh³hÇh´KàhjCubah}”(h]”h ]”h"]”h$]”h&]”uh1jshj@ubjt)�”}”(hŒXunbind: ops to perform when a binding has been lost between an EPC device and EPF device”h]”hÉ)�”}”(hŒXunbind: ops to perform when a binding has been lost between an EPC device and EPF device”h]”hŒXunbind: ops to perform when a binding has been lost between an EPC device and EPF device”…”�”}”(hj^h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈh³hÇh´KáhjZubah}”(h]”h ]”h"]”h$]”h&]”uh1jshj@ubjt)�”}”(hŒFadd_cfs: optional ops to create function specific configfs attributes ”h]”hÉ)�”}”(hŒEadd_cfs: optional ops to create function specific configfs attributes”h]”hŒEadd_cfs: optional ops to create function specific configfs attributes”…”�”}”(hjvh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈh³hÇh´Kãhjrubah}”(h]”h ]”h"]”h$]”h&]”uh1jshj@ubeh}”(h]”h ]”h"]”h$]”h&]”jajbuh1jnh³hÇh´Kàhj=ubah}”(h]”h ]”h"]”h$]”h&]”uh1j;hj'ubeh}”(h]”h ]”h"]”h$]”h&]”uh1j%h³hÇh´Kähj"ubah}”(h]”h ]”h"]”h$]”h&]”uh1j hjubah}”(h]”h ]”h"]”h$]”h&]”uh1j‡h³hÇh´Kßhj ubhÉ)�”}”(hŒ`The PCI Function driver can then register the PCI EPF driver by using pci_epf_register_driver().”h]”hŒ`The PCI Function driver can then register the PCI EPF driver by using pci_epf_register_driver().”…”�”}”(hj¨h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈh³hÇh´Kæhj ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jshjh²hh³hÇh´Nubjt)�”}”(hŒ}pci_epf_unregister_driver() The PCI Function driver can unregister the PCI EPF driver by using pci_epf_unregister_driver(). ”h]”(hÉ)�”}”(hŒpci_epf_unregister_driver()”h]”hŒpci_epf_unregister_driver()”…”�”}”(hjÀh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈh³hÇh´Kéhj¼ubhÉ)�”}”(hŒ_The PCI Function driver can unregister the PCI EPF driver by using pci_epf_unregister_driver().”h]”hŒ_The PCI Function driver can unregister the PCI EPF driver by using pci_epf_unregister_driver().”…”�”}”(hjÎh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈh³hÇh´Këhj¼ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jshjh²hh³hÇh´Nubjt)�”}”(hŒtpci_epf_alloc_space() The PCI Function driver can allocate space for a particular BAR using pci_epf_alloc_space(). ”h]”(hÉ)�”}”(hŒpci_epf_alloc_space()”h]”hŒpci_epf_alloc_space()”…”�”}”(hjæh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈh³hÇh´KîhjâubhÉ)�”}”(hŒ\The PCI Function driver can allocate space for a particular BAR using pci_epf_alloc_space().”h]”hŒ\The PCI Function driver can allocate space for a particular BAR using pci_epf_alloc_space().”…”�”}”(hjôh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈh³hÇh´Kðhjâubeh}”(h]”h ]”h"]”h$]”h&]”uh1jshjh²hh³hÇh´Nubjt)�”}”(hŒ‰pci_epf_free_space() The PCI Function driver can free the allocated space (using pci_epf_alloc_space) by invoking pci_epf_free_space(). ”h]”(hÉ)�”}”(hŒpci_epf_free_space()”h]”hŒpci_epf_free_space()”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈh³hÇh´KóhjubhÉ)�”}”(hŒrThe PCI Function driver can free the allocated space (using pci_epf_alloc_space) by invoking pci_epf_free_space().”h]”hŒrThe PCI Function driver can free the allocated space (using pci_epf_alloc_space) by invoking pci_epf_free_space().”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈh³hÇh´Kõhjubeh}”(h]”h ]”h"]”h$]”h&]”uh1jshjh²hh³hÇh´Nubeh}”(h]”h ]”h"]”h$]”h&]”jajbuh1jnh³hÇh´KÝhjèh²hubeh}”(h]”Œ-epf-apis-for-the-pci-endpoint-function-driver”ah ]”h"]”Œ-epf apis for the pci endpoint function driver”ah$]”h&]”uh1hØhjÉh²hh³hÇh´KØubhÙ)�”}”(hhh]”(hÞ)�”}”(hŒ,APIs for the PCI Endpoint Controller Library”h]”hŒ,APIs for the PCI Endpoint Controller Library”…”�”}”(hj?h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝhj<h²hh³hÇh´KùubhÉ)�”}”(hŒrThis section lists the APIs that the PCI Endpoint core provides to be used by the PCI endpoint controller library.”h]”hŒrThis section lists the APIs that the PCI Endpoint core provides to be used by the PCI endpoint controller library.”…”�”}”(hjMh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈh³hÇh´Kûhj<h²hubjo)�”}”(hhh]”jt)�”}”(hŒ‘pci_epf_linkup() The PCI endpoint controller library invokes pci_epf_linkup() when the EPC device has established the connection to the host. ”h]”(hÉ)�”}”(hŒpci_epf_linkup()”h]”hŒpci_epf_linkup()”…”�”}”(hjbh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈh³hÇh´Kþhj^ubjˆ)�”}”(hŒ}The PCI endpoint controller library invokes pci_epf_linkup() when the EPC device has established the connection to the host. ”h]”hÉ)�”}”(hŒ|The PCI endpoint controller library invokes pci_epf_linkup() when the EPC device has established the connection to the host.”h]”hŒ|The PCI endpoint controller library invokes pci_epf_linkup() when the EPC device has established the connection to the host.”…”�”}”(hjth²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈh³hÇh´Mhjpubah}”(h]”h ]”h"]”h$]”h&]”uh1j‡h³hÇh´Mhj^ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jshj[h²hh³hÇh´Nubah}”(h]”h ]”h"]”h$]”h&]”jajbuh1jnh³hÇh´Kþhj<h²hubeh}”(h]”Œ,apis-for-the-pci-endpoint-controller-library”ah ]”h"]”Œ,apis for the pci endpoint controller library”ah$]”h&]”uh1hØhjÉh²hh³hÇh´KùubhÙ)�”}”(hhh]”(hÞ)�”}”(hŒOther EPF APIs”h]”hŒOther EPF APIs”…”�”}”(hjŸh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝhjœh²hh³hÇh´MubhÉ)�”}”(hŒÊThere are other APIs provided by the EPF library. These are used to notify the function driver when the EPF device is bound to the EPC device. pci-ep-cfs.c can be used as reference for using these APIs.”h]”hŒÊThere are other APIs provided by the EPF library. These are used to notify the function driver when the EPF device is bound to the EPC device. pci-ep-cfs.c can be used as reference for using these APIs.”…”�”}”(hj­h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈh³hÇh´Mhjœh²hubjo)�”}”(hhh]”(jt)�”}”(hŒšpci_epf_create() Create a new PCI EPF device by passing the name of the PCI EPF device. This name will be used to bind the EPF device to a EPF driver. ”h]”(hÉ)�”}”(hŒpci_epf_create()”h]”hŒpci_epf_create()”…”�”}”(hjÂh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈh³hÇh´M hj¾ubjˆ)�”}”(hŒ†Create a new PCI EPF device by passing the name of the PCI EPF device. This name will be used to bind the EPF device to a EPF driver. ”h]”hÉ)�”}”(hŒ…Create a new PCI EPF device by passing the name of the PCI EPF device. This name will be used to bind the EPF device to a EPF driver.”h]”hŒ…Create a new PCI EPF device by passing the name of the PCI EPF device. This name will be used to bind the EPF device to a EPF driver.”…”�”}”(hjÔh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈh³hÇh´M hjÐubah}”(h]”h ]”h"]”h$]”h&]”uh1j‡h³hÇh´M hj¾ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jshj»h²hh³hÇh´Nubjt)�”}”(hŒ8pci_epf_destroy() Destroy the created PCI EPF device. ”h]”(hÉ)�”}”(hŒpci_epf_destroy()”h]”hŒpci_epf_destroy()”…”�”}”(hjòh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈh³hÇh´Mhjîubjˆ)�”}”(hŒ$Destroy the created PCI EPF device. ”h]”hÉ)�”}”(hŒ#Destroy the created PCI EPF device.”h]”hŒ#Destroy the created PCI EPF device.”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈh³hÇh´Mhj ubah}”(h]”h ]”h"]”h$]”h&]”uh1j‡h³hÇh´Mhjîubeh}”(h]”h ]”h"]”h$]”h&]”uh1jshj»h²hh³hÇh´Nubjt)�”}”(hŒhpci_epf_bind() pci_epf_bind() should be invoked when the EPF device has been bound to an EPC device. ”h]”(hÉ)�”}”(hŒpci_epf_bind()”h]”hŒpci_epf_bind()”…”�”}”(hj" h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈh³hÇh´Mhj ubjˆ)�”}”(hŒVpci_epf_bind() should be invoked when the EPF device has been bound to an EPC device. ”h]”hÉ)�”}”(hŒUpci_epf_bind() should be invoked when the EPF device has been bound to an EPC device.”h]”hŒUpci_epf_bind() should be invoked when the EPF device has been bound to an EPC device.”…”�”}”(hj4 h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈh³hÇh´Mhj0 ubah}”(h]”h ]”h"]”h$]”h&]”uh1j‡h³hÇh´Mhj ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jshj»h²hh³hÇh´Nubjt)�”}”(hŒrpci_epf_unbind() pci_epf_unbind() should be invoked when the binding between EPC device and EPF device is lost.”h]”(hÉ)�”}”(hŒpci_epf_unbind()”h]”hŒpci_epf_unbind()”…”�”}”(hjR h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈh³hÇh´MhjN ubjˆ)�”}”(hŒ^pci_epf_unbind() should be invoked when the binding between EPC device and EPF device is lost.”h]”hÉ)�”}”(hŒ^pci_epf_unbind() should be invoked when the binding between EPC device and EPF device is lost.”h]”hŒ^pci_epf_unbind() should be invoked when the binding between EPC device and EPF device is lost.”…”�”}”(hjd h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈh³hÇh´Mhj` ubah}”(h]”h ]”h"]”h$]”h&]”uh1j‡h³hÇh´MhjN ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jshj»h²hh³hÇh´Nubeh}”(h]”h ]”h"]”h$]”h&]”jajbuh1jnh³hÇh´M hjœh²hubeh}”(h]”Œother-epf-apis”ah ]”h"]”Œother epf apis”ah$]”h&]”uh1hØhjÉh²hh³hÇh´Mubeh}”(h]”Œ!pci-endpoint-function-epf-library”ah ]”h"]”Œ"pci endpoint function(epf) library”ah$]”h&]”uh1hØhjh²hh³hÇh´KÒubeh}”(h]”Œpci-endpoint-core”ah ]”h"]”Œpci endpoint core”ah$]”h&]”uh1hØhhh²hh³hÇh´Kubeh}”(h]”h ]”h"]”h$]”h&]”Œsource”hÇuh1hŒcurrent_source”NŒ current_line”NŒsettings”Œdocutils.frontend”ŒValues”“”)�”}”(hÝNŒ generator”NŒ datestamp”NŒ source_link”NŒ source_url”NŒ toc_backlinks”Œentry”Œfootnote_backlinks”KŒ sectnum_xform”KŒstrip_comments”NŒstrip_elements_with_classes”NŒ strip_classes”NŒ report_level”KŒ halt_level”KŒexit_status_level”KŒdebug”NŒwarning_stream”NŒ traceback”ˆŒinput_encoding”Œ utf-8-sig”Œinput_encoding_error_handler”Œstrict”Œoutput_encoding”Œutf-8”Œoutput_encoding_error_handler”j¿ Œerror_encoding”Œutf-8”Œerror_encoding_error_handler”Œbackslashreplace”Œ language_code”Œen”Œrecord_dependencies”NŒconfig”NŒ id_prefix”hŒauto_id_prefix”Œid”Œ dump_settings”NŒdump_internals”NŒdump_transforms”NŒdump_pseudo_xml”NŒexpose_internals”NŒstrict_visitor”NŒ_disable_config”NŒ_source”hÇŒ _destination”NŒ _config_files”]”Œ7/var/lib/git/docbuild/linux/Documentation/docutils.conf”aŒfile_insertion_enabled”ˆŒ raw_enabled”KŒline_length_limit”M'Œpep_references”NŒ pep_base_url”Œhttps://peps.python.org/”Œpep_file_url_template”Œpep-%04d”Œrfc_references”NŒ rfc_base_url”Œ&https://datatracker.ietf.org/doc/html/”Œ tab_width”KŒtrim_footnote_reference_space”‰Œsyntax_highlight”Œlong”Œ smart_quotes”ˆŒsmartquotes_locales”]”Œcharacter_level_inline_markup”‰Œdoctitle_xform”‰Œ docinfo_xform”KŒsectsubtitle_xform”‰Œ image_loading”Œlink”Œembed_stylesheet”‰Œcloak_email_addresses”ˆŒsection_self_link”‰Œenv”NubŒreporter”NŒindirect_targets”]”Œsubstitution_defs”}”Œsubstitution_names”}”Œrefnames”}”Œrefids”}”Œnameids”}”(jj j™ j– jÆjÃjNjKjnjkj¾j»j‘ jŽ j9j6j™j–j‰ j† uŒ nametypes”}”(j‰j™ ‰jƉjN‰jn‰j¾‰j‘ ‰j9‰j™‰j‰ ‰uh}”(j hÚj– jjÃj0jKjOjkjQj»jqjŽ jÉj6jèj–j<j† jœuŒ footnote_refs”}”Œ citation_refs”}”Œ autofootnotes”]”Œautofootnote_refs”]”Œsymbol_footnotes”]”Œsymbol_footnote_refs”]”Œ footnotes”]”Œ citations”]”Œautofootnote_start”KŒsymbol_footnote_start”KŒ id_counter”Œ collections”ŒCounter”“”}”…”R”Œparse_messages”]”Œtransform_messages”]”Œ transformer”NŒ include_log”]”Œ decoration”Nh²hub.