Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

PCI: endpoint: Update documentation

Document the new functions pci_epc_mem_map() and pci_epc_mem_unmap().
Also add the documentation for the functions pci_epc_map_addr() and
pci_epc_unmap_addr() that were missing.

Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
Reviewed-by: Niklas Cassel <cassel@kernel.org>
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Link: https://lore.kernel.org/r/20241012113246.95634-5-dlemoal@kernel.org
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>

authored by

Damien Le Moal and committed by
Manivannan Sadhasivam
6067ccf3 ce1dfe6d

+29
+29
Documentation/PCI/endpoint/pci-endpoint.rst
··· 117 117 The PCI endpoint function driver should use pci_epc_mem_free_addr() to 118 118 free the memory space allocated using pci_epc_mem_alloc_addr(). 119 119 120 + * pci_epc_map_addr() 121 + 122 + A PCI endpoint function driver should use pci_epc_map_addr() to map to a RC 123 + PCI address the CPU address of local memory obtained with 124 + pci_epc_mem_alloc_addr(). 125 + 126 + * pci_epc_unmap_addr() 127 + 128 + A PCI endpoint function driver should use pci_epc_unmap_addr() to unmap the 129 + CPU address of local memory mapped to a RC address with pci_epc_map_addr(). 130 + 131 + * pci_epc_mem_map() 132 + 133 + A PCI endpoint controller may impose constraints on the RC PCI addresses that 134 + can be mapped. The function pci_epc_mem_map() allows endpoint function 135 + drivers to allocate and map controller memory while handling such 136 + constraints. This function will determine the size of the memory that must be 137 + allocated with pci_epc_mem_alloc_addr() for successfully mapping a RC PCI 138 + address range. This function will also indicate the size of the PCI address 139 + range that was actually mapped, which can be less than the requested size, as 140 + well as the offset into the allocated memory to use for accessing the mapped 141 + RC PCI address range. 142 + 143 + * pci_epc_mem_unmap() 144 + 145 + A PCI endpoint function driver can use pci_epc_mem_unmap() to unmap and free 146 + controller memory that was allocated and mapped using pci_epc_mem_map(). 147 + 148 + 120 149 Other EPC APIs 121 150 ~~~~~~~~~~~~~~ 122 151