← Documents Documentation/PCI/endpoint/pci-endpoint.rst GitHub 원문 ↗

Linux 6.18.37 · PCI

PCI endpoint framework

PCI Endpoint Core의 EPC·EPF library 구조와 controller/function driver API, memory mapping 및 binding lifecycle을 설명합니다.

Source pathDocumentation/PCI/endpoint/pci-endpoint.rst
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.

1. 요약·해설

원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.

요약·해설

pci-endpoint.rst:1-259

Endpoint Core는 EPC controller library, EPF function library, configfs binding layer로 구성되며 controller driver가 hardware operation을 구현하고 function driver가 공통 API로 BAR·IRQ·RC mapping을 사용합니다.

EPC와 EPF device를 생성해 bind하고 function을 구성한 뒤 PCI link를 시작하며, link-up과 unbind notification이 양쪽 lifecycle을 연결합니다.

2. 영어 원문 전체

번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.

원문 전체 펼치기
1 .. SPDX-License-Identifier: GPL-2.0
2
3 :Author: Kishon Vijay Abraham I <[email protected]>
4
5 This document is a guide to use the PCI Endpoint Framework in order to create
6 endpoint controller driver, endpoint function driver, and using configfs
7 interface to bind the function driver to the controller driver.
8
9 Introduction
10 ============
11
12 Linux has a comprehensive PCI subsystem to support PCI controllers that
13 operates in Root Complex mode. The subsystem has capability to scan PCI bus,
14 assign memory resources and IRQ resources, load PCI driver (based on
15 vendor ID, device ID), support other services like hot-plug, power management,
16 advanced error reporting and virtual channels.
17
18 However the PCI controller IP integrated in some SoCs is capable of operating
19 either in Root Complex mode or Endpoint mode. PCI Endpoint Framework will
20 add endpoint mode support in Linux. This will help to run Linux in an
21 EP system which can have a wide variety of use cases from testing or
22 validation, co-processor accelerator, etc.
23
24 PCI Endpoint Core
25 =================
26
27 The PCI Endpoint Core layer comprises 3 components: the Endpoint Controller
28 library, the Endpoint Function library, and the configfs layer to bind the
29 endpoint function with the endpoint controller.
30
31 PCI Endpoint Controller(EPC) Library
32 ------------------------------------
33
34 The EPC library provides APIs to be used by the controller that can operate
35 in endpoint mode. It also provides APIs to be used by function driver/library
36 in order to implement a particular endpoint function.
37
38 APIs for the PCI controller Driver
39 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
40
41 This section lists the APIs that the PCI Endpoint core provides to be used
42 by the PCI controller driver.
43
44 * devm_pci_epc_create()/pci_epc_create()
45
46 The PCI controller driver should implement the following ops:
47
48 * write_header: ops to populate configuration space header
49 * set_bar: ops to configure the BAR
50 * clear_bar: ops to reset the BAR
51 * alloc_addr_space: ops to allocate in PCI controller address space
52 * free_addr_space: ops to free the allocated address space
53 * raise_irq: ops to raise a legacy, MSI or MSI-X interrupt
54 * start: ops to start the PCI link
55 * stop: ops to stop the PCI link
56
57 The PCI controller driver can then create a new EPC device by invoking
58 devm_pci_epc_create()/pci_epc_create().
59
60 * pci_epc_destroy()
61
62 The PCI controller driver can destroy the EPC device created by
63 pci_epc_create() using pci_epc_destroy().
64
65 * pci_epc_linkup()
66
67 In order to notify all the function devices that the EPC device to which
68 they are linked has established a link with the host, the PCI controller
69 driver should invoke pci_epc_linkup().
70
71 * pci_epc_mem_init()
72
73 Initialize the pci_epc_mem structure used for allocating EPC addr space.
74
75 * pci_epc_mem_exit()
76
77 Cleanup the pci_epc_mem structure allocated during pci_epc_mem_init().
78
79
80 EPC APIs for the PCI Endpoint Function Driver
81 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
82
83 This section lists the APIs that the PCI Endpoint core provides to be used
84 by the PCI endpoint function driver.
85
86 * pci_epc_write_header()
87
88 The PCI endpoint function driver should use pci_epc_write_header() to
89 write the standard configuration header to the endpoint controller.
90
91 * pci_epc_set_bar()
92
93 The PCI endpoint function driver should use pci_epc_set_bar() to configure
94 the Base Address Register in order for the host to assign PCI addr space.
95 Register space of the function driver is usually configured
96 using this API.
97
98 * pci_epc_clear_bar()
99
100 The PCI endpoint function driver should use pci_epc_clear_bar() to reset
101 the BAR.
102
103 * pci_epc_raise_irq()
104
105 The PCI endpoint function driver should use pci_epc_raise_irq() to raise
106 Legacy Interrupt, MSI or MSI-X Interrupt.
107
108 * pci_epc_mem_alloc_addr()
109
110 The PCI endpoint function driver should use pci_epc_mem_alloc_addr(), to
111 allocate memory address from EPC addr space which is required to access
112 RC's buffer
113
114 * pci_epc_mem_free_addr()
115
116 The PCI endpoint function driver should use pci_epc_mem_free_addr() to
117 free the memory space allocated using pci_epc_mem_alloc_addr().
118
119 * pci_epc_map_addr()
120
121 A PCI endpoint function driver should use pci_epc_map_addr() to map to a RC
122 PCI address the CPU address of local memory obtained with
123 pci_epc_mem_alloc_addr().
124
125 * pci_epc_unmap_addr()
126
127 A PCI endpoint function driver should use pci_epc_unmap_addr() to unmap the
128 CPU address of local memory mapped to a RC address with pci_epc_map_addr().
129
130 * pci_epc_mem_map()
131
132 A PCI endpoint controller may impose constraints on the RC PCI addresses that
133 can be mapped. The function pci_epc_mem_map() allows endpoint function
134 drivers to allocate and map controller memory while handling such
135 constraints. This function will determine the size of the memory that must be
136 allocated with pci_epc_mem_alloc_addr() for successfully mapping a RC PCI
137 address range. This function will also indicate the size of the PCI address
138 range that was actually mapped, which can be less than the requested size, as
139 well as the offset into the allocated memory to use for accessing the mapped
140 RC PCI address range.
141
142 * pci_epc_mem_unmap()
143
144 A PCI endpoint function driver can use pci_epc_mem_unmap() to unmap and free
145 controller memory that was allocated and mapped using pci_epc_mem_map().
146
147
148 Other EPC APIs
149 ~~~~~~~~~~~~~~
150
151 There are other APIs provided by the EPC library. These are used for binding
152 the EPF device with EPC device. pci-ep-cfs.c can be used as reference for
153 using these APIs.
154
155 * pci_epc_get()
156
157 Get a reference to the PCI endpoint controller based on the device name of
158 the controller.
159
160 * pci_epc_put()
161
162 Release the reference to the PCI endpoint controller obtained using
163 pci_epc_get()
164
165 * pci_epc_add_epf()
166
167 Add a PCI endpoint function to a PCI endpoint controller. A PCIe device
168 can have up to 8 functions according to the specification.
169
170 * pci_epc_remove_epf()
171
172 Remove the PCI endpoint function from PCI endpoint controller.
173
174 * pci_epc_start()
175
176 The PCI endpoint function driver should invoke pci_epc_start() once it
177 has configured the endpoint function and wants to start the PCI link.
178
179 * pci_epc_stop()
180
181 The PCI endpoint function driver should invoke pci_epc_stop() to stop
182 the PCI LINK.
183
184
185 PCI Endpoint Function(EPF) Library
186 ----------------------------------
187
188 The EPF library provides APIs to be used by the function driver and the EPC
189 library to provide endpoint mode functionality.
190
191 EPF APIs for the PCI Endpoint Function Driver
192 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
193
194 This section lists the APIs that the PCI Endpoint core provides to be used
195 by the PCI endpoint function driver.
196
197 * pci_epf_register_driver()
198
199 The PCI Endpoint Function driver should implement the following ops:
200 * bind: ops to perform when an EPC device has been bound to EPF device
201 * unbind: ops to perform when a binding has been lost between an EPC
202 device and EPF device
203 * add_cfs: optional ops to create function specific configfs
204 attributes
205
206 The PCI Function driver can then register the PCI EPF driver by using
207 pci_epf_register_driver().
208
209 * pci_epf_unregister_driver()
210
211 The PCI Function driver can unregister the PCI EPF driver by using
212 pci_epf_unregister_driver().
213
214 * pci_epf_alloc_space()
215
216 The PCI Function driver can allocate space for a particular BAR using
217 pci_epf_alloc_space().
218
219 * pci_epf_free_space()
220
221 The PCI Function driver can free the allocated space
222 (using pci_epf_alloc_space) by invoking pci_epf_free_space().
223
224 APIs for the PCI Endpoint Controller Library
225 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
226
227 This section lists the APIs that the PCI Endpoint core provides to be used
228 by the PCI endpoint controller library.
229
230 * pci_epf_linkup()
231
232 The PCI endpoint controller library invokes pci_epf_linkup() when the
233 EPC device has established the connection to the host.
234
235 Other EPF APIs
236 ~~~~~~~~~~~~~~
237
238 There are other APIs provided by the EPF library. These are used to notify
239 the function driver when the EPF device is bound to the EPC device.
240 pci-ep-cfs.c can be used as reference for using these APIs.
241
242 * pci_epf_create()
243
244 Create a new PCI EPF device by passing the name of the PCI EPF device.
245 This name will be used to bind the EPF device to a EPF driver.
246
247 * pci_epf_destroy()
248
249 Destroy the created PCI EPF device.
250
251 * pci_epf_bind()
252
253 pci_epf_bind() should be invoked when the EPF device has been bound to
254 an EPC device.
255
256 * pci_epf_unbind()
257
258 pci_epf_unbind() should be invoked when the binding between EPC device
259 and EPF device is lost.
260

3. 한국어 전문 번역

영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.

문서 목적

1-8

저자는 Kishon Vijay Abraham I입니다. 이 문서는 PCI Endpoint Framework로 endpoint controller driver와 endpoint function driver를 만들고, configfs interface로 function driver를 controller driver에 bind하는 방법을 안내합니다.

.. SPDX-License-Identifier: GPL-2.0

:Author: Kishon Vijay Abraham I <[email protected]>

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.

Root Complex와 endpoint mode

9-23

Linux PCI subsystem은 Root Complex mode로 동작하는 PCI controller를 폭넓게 지원합니다. PCI bus scan, memory·IRQ resource 할당, vendor ID·device ID 기반 driver load, hotplug, power management, advanced error reporting, virtual channel 등의 기능이 있습니다.

일부 SoC의 PCI controller IP는 Root Complex mode와 Endpoint mode 중 하나로 동작할 수 있습니다. PCI Endpoint Framework는 Linux에 endpoint mode를 추가해 test·validation이나 co-processor accelerator 등 다양한 EP system use case를 지원합니다.

PCI controller mode
ModeLinux 역할
Root ComplexBus scan, resource 할당, PCI driver와 service 관리
EndpointHost에 function을 제공하는 EP system

동일한 controller IP가 맡을 수 있는 역할입니다.

Introduction
============

Linux 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.

However 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.

Endpoint Core와 EPC library

24-37

PCI Endpoint Core layer는 Endpoint Controller(`EPC`) library, Endpoint Function(`EPF`) library, EPF를 EPC에 bind하는 configfs layer의 세 component로 구성됩니다.

EPC library는 endpoint mode로 동작하는 controller driver가 사용할 API와 특정 endpoint function을 구현하는 function driver/library가 사용할 API를 제공합니다.

PCI Endpoint Core
EPC libraryEndpoint controller driver
EPF libraryEndpoint function driver
configfsEPF ↔ EPC binding

Configfs가 EPF device와 EPC device의 binding을 구성합니다.

PCI Endpoint Core
=================

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.

PCI Endpoint Controller(EPC) Library
------------------------------------

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.

PCI controller driver용 EPC API

38-79

PCI Endpoint Core가 PCI controller driver에 제공하는 API입니다.

EPC controller operations
Operation동작
write_headerConfiguration space header 채우기
set_barBAR 구성
clear_barBAR reset
alloc_addr_spacePCI controller address space 할당
free_addr_space할당한 address space 해제
raise_irqLegacy, MSI 또는 MSI-X interrupt 발생
startPCI link 시작
stopPCI link 중지

`devm_pci_epc_create()` 또는 `pci_epc_create()`에 제공할 operation입니다.

Controller lifecycle API
API역할
devm_pci_epc_create() / pci_epc_create()새 EPC device 생성
pci_epc_destroy()`pci_epc_create()`로 만든 EPC device 제거
pci_epc_linkup()Host link가 성립했음을 연결된 모든 function device에 알림
pci_epc_mem_init()EPC address space 할당용 `pci_epc_mem` 초기화
pci_epc_mem_exit()`pci_epc_mem` 정리

EPC device와 address allocator의 수명 및 link notification을 관리합니다.

APIs for the PCI controller Driver
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

This section lists the APIs that the PCI Endpoint core provides to be used
by the PCI controller driver.

* 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().

* pci_epc_destroy()

   The PCI controller driver can destroy the EPC device created by
   pci_epc_create() using pci_epc_destroy().

* 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().

* pci_epc_mem_init()

   Initialize the pci_epc_mem structure used for allocating EPC addr space.

* pci_epc_mem_exit()

   Cleanup the pci_epc_mem structure allocated during pci_epc_mem_init().

EPF driver가 사용하는 EPC API

80-147

PCI endpoint function driver는 아래 EPC API로 configuration header, BAR, interrupt와 RC memory mapping을 제어합니다.

EPF-facing EPC APIs
API동작
pci_epc_write_header()표준 configuration header를 endpoint controller에 기록
pci_epc_set_bar()Host가 PCI address space를 할당하도록 BAR 구성; 일반적으로 function register space에 사용
pci_epc_clear_bar()BAR reset
pci_epc_raise_irq()Legacy, MSI 또는 MSI-X interrupt 발생
pci_epc_mem_alloc_addr()RC buffer 접근에 필요한 EPC address space memory 할당
pci_epc_mem_free_addr()`pci_epc_mem_alloc_addr()`가 할당한 memory 해제
pci_epc_map_addr()할당한 local memory CPU address를 RC PCI address에 mapping
pci_epc_unmap_addr()`pci_epc_map_addr()` mapping 해제

Function driver가 endpoint controller resource를 사용하는 방법입니다.

일부 endpoint controller는 mapping 가능한 RC PCI address에 제약을 둡니다. `pci_epc_mem_map()`은 이 제약을 처리하면서 controller memory를 할당하고 mapping합니다.

`pci_epc_mem_map()`은 RC PCI address range를 mapping하는 데 필요한 allocation size, 실제 mapping된 PCI range 크기, mapping 접근에 사용할 allocated memory 내부 offset을 반환합니다. 실제 mapping 크기는 요청보다 작을 수 있습니다.

`pci_epc_mem_unmap()`은 `pci_epc_mem_map()`으로 할당하고 mapping한 controller memory의 mapping을 해제하고 memory를 반환합니다.

RC memory mapping
Requested RC PCI rangepci_epc_mem_map()Allocate EPC memoryMap supported rangeReturn mapped size + offset
Mapped controller memorypci_epc_mem_unmap()Unmap + free

Controller 제약이 있으면 통합 API가 allocation 크기와 offset을 계산합니다.

EPC APIs for the PCI Endpoint Function Driver
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

This section lists the APIs that the PCI Endpoint core provides to be used
by the PCI endpoint function driver.

* 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.

* pci_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.

* pci_epc_clear_bar()

   The PCI endpoint function driver should use pci_epc_clear_bar() to reset
   the BAR.

* pci_epc_raise_irq()

   The PCI endpoint function driver should use pci_epc_raise_irq() to raise
   Legacy Interrupt, MSI or MSI-X Interrupt.

* 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

* 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().

* 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().

* 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().

* pci_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.

* 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().

기타 EPC binding API

148-184

EPC library의 나머지 API는 EPF device를 EPC device에 bind할 때 사용하며 `pci-ep-cfs.c`가 참고 구현입니다.

EPC binding and link APIs
API동작
pci_epc_get()Controller device name으로 EPC reference 획득
pci_epc_put()`pci_epc_get()` reference 반환
pci_epc_add_epf()EPC에 EPF 추가; PCIe specification상 device당 최대 function 8개
pci_epc_remove_epf()EPC에서 EPF 제거
pci_epc_start()Function 설정 후 PCI link 시작
pci_epc_stop()PCI link 중지

Controller reference, function binding과 link 상태를 관리합니다.

Other EPC APIs
~~~~~~~~~~~~~~

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.

* pci_epc_get()

   Get a reference to the PCI endpoint controller based on the device name of
   the controller.

* pci_epc_put()

   Release the reference to the PCI endpoint controller obtained using
   pci_epc_get()

* 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.

* pci_epc_remove_epf()

   Remove the PCI endpoint function from PCI endpoint controller.

* 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.

* pci_epc_stop()

   The PCI endpoint function driver should invoke pci_epc_stop() to stop
   the PCI LINK.

EPF library

185-190

EPF library는 function driver와 EPC library가 endpoint mode 기능을 제공할 때 사용할 API를 제공합니다.

PCI Endpoint Function(EPF) Library
----------------------------------

The EPF library provides APIs to be used by the function driver and the EPC
library to provide endpoint mode functionality.

Endpoint function driver용 EPF API

191-223

EPF driver는 `pci_epf_register_driver()`로 등록하며 다음 operation을 구현합니다.

EPF driver operations
Operation동작
bindEPC device가 EPF device에 bind될 때 실행
unbindEPC와 EPF binding이 사라질 때 실행
add_cfs선택 사항; function-specific configfs attribute 생성

EPC binding과 function-specific configfs attribute를 처리합니다.

`pci_epf_unregister_driver()`는 EPF driver 등록을 해제합니다.

`pci_epf_alloc_space()`는 특정 BAR용 space를 할당하고 `pci_epf_free_space()`는 그 space를 해제합니다.

EPF APIs for the PCI Endpoint Function Driver
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

This section lists the APIs that the PCI Endpoint core provides to be used
by the PCI endpoint function driver.

* 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().

* pci_epf_unregister_driver()

  The PCI Function driver can unregister the PCI EPF driver by using
  pci_epf_unregister_driver().

* pci_epf_alloc_space()

  The PCI Function driver can allocate space for a particular BAR using
  pci_epf_alloc_space().

* pci_epf_free_space()

  The PCI Function driver can free the allocated space
  (using pci_epf_alloc_space) by invoking pci_epf_free_space().

EPC library의 EPF link notification

224-234

EPC device가 host와 connection을 맺으면 PCI endpoint controller library가 `pci_epf_linkup()`을 호출해 function 측에 link-up을 알립니다.

APIs for the PCI Endpoint Controller Library
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

This section lists the APIs that the PCI Endpoint core provides to be used
by the PCI endpoint controller library.

* pci_epf_linkup()

   The PCI endpoint controller library invokes pci_epf_linkup() when the
   EPC device has established the connection to the host.

기타 EPF device API

235-259

다른 EPF library API는 EPF device가 EPC device에 bind되거나 unbind될 때 function driver에 알리는 데 사용하며 `pci-ep-cfs.c`가 참고 구현입니다.

EPF device lifecycle
API동작
pci_epf_create()EPF device name으로 새 device 생성; name을 EPF driver binding에 사용
pci_epf_destroy()생성한 EPF device 제거
pci_epf_bind()EPF device가 EPC device에 bind될 때 호출
pci_epf_unbind()EPC와 EPF binding이 사라질 때 호출

EPF device 생성과 binding notification을 관리합니다.

Endpoint lifecycle
pci_epc_create + pci_epf_createpci_epc_add_epf / pci_epf_bindConfigure header·BARpci_epc_startpci_epc_linkup / pci_epf_linkup
pci_epc_stoppci_epf_unbindpci_epc_remove_epfdestroy devices

Controller와 function을 생성·bind하고 link를 시작한 뒤 역순으로 해제합니다.

Other EPF APIs
~~~~~~~~~~~~~~

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.

* 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.

* pci_epf_destroy()

   Destroy the created PCI EPF device.

* pci_epf_bind()

   pci_epf_bind() should be invoked when the EPF device has been bound to
   an EPC device.

* pci_epf_unbind()

   pci_epf_unbind() should be invoked when the binding between EPC device
   and EPF device is lost.