요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
.. SPDX-License-Identifier: GPL-2.0-only
=========================
Driver-specific callbacks
=========================
The ``pldmfw`` module relies on the device driver for implementing device
specific behavior using the following operations.
``.match_record``
-----------------
The ``.match_record`` operation is used to determine whether a given PLDM
record matches the device being updated. This requires comparing the record
descriptors in the record with information from the device. Many record
descriptors are defined by the PLDM standard, but it is also allowed for
devices to implement their own descriptors.
The ``.match_record`` operation should return true if a given record matches
the device.
``.send_package_data``
----------------------
The ``.send_package_data`` operation is used to send the device-specific
package data in a record to the device firmware. If the matching record
provides package data, ``pldmfw`` will call the ``.send_package_data``
function with a pointer to the package data and with the package data
length. The device driver should send this data to firmware.
``.send_component_table``
-------------------------
The ``.send_component_table`` operation is used to forward component
information to the device. It is called once for each applicable component,
that is, for each component indicated by the matching record. The
device driver should send the component information to the device firmware,
and wait for a response. The provided transfer flag indicates whether this
is the first, last, or a middle component, and is expected to be forwarded
to firmware as part of the component table information. The driver should an
error in the case when the firmware indicates that the component cannot be
updated, or return zero if the component can be updated.
``.flash_component``
--------------------
The ``.flash_component`` operation is used to inform the device driver to
flash a given component. The driver must perform any steps necessary to send
the component data to the device.
``.finalize_update``
--------------------
The ``.finalize_update`` operation is used by the ``pldmfw`` library in
order to allow the device driver to perform any remaining device specific
logic needed to finish the update.
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
device record 일치 판정
1-20`pldmfw` module은 PLDM firmware package의 공통 parsing과 update 순서를 담당하고, 실제 device별 동작은 device driver가 operation table로 구현합니다.
`.match_record` operation은 package 안의 특정 PLDM record가 현재 update하려는 device와 일치하는지 판정합니다. driver는 record descriptor들을 PCI vendor/device 정보 같은 실제 device 정보와 비교합니다. 많은 descriptor type은 PLDM standard가 정의하지만, device가 자체 descriptor를 정의하는 것도 허용됩니다.
주어진 record가 device와 일치하면 `.match_record`는 true를 반환합니다. library는 여러 record를 순서대로 검사하며 첫 번째로 일치한 record를 update에 사용합니다.
표준 또는 vendor-specific descriptor를 실제 device 정보와 비교합니다.
.. SPDX-License-Identifier: GPL-2.0-only
=========================
Driver-specific callbacks
=========================
The ``pldmfw`` module relies on the device driver for implementing device
specific behavior using the following operations.
``.match_record``
-----------------
The ``.match_record`` operation is used to determine whether a given PLDM
record matches the device being updated. This requires comparing the record
descriptors in the record with information from the device. Many record
descriptors are defined by the PLDM standard, but it is also allowed for
devices to implement their own descriptors.
The ``.match_record`` operation should return true if a given record matches
the device.
device-specific package data 전송
21-29`.send_package_data` operation은 일치한 record에 포함된 device-specific package data를 device firmware로 보냅니다. record가 package data를 제공할 때 `pldmfw`는 data pointer와 data length를 인자로 이 callback을 호출합니다.
callback을 구현한 device driver는 전달받은 byte sequence를 해당 firmware transport와 protocol에 맞춰 전송해야 합니다.
``.send_package_data``
----------------------
The ``.send_package_data`` operation is used to send the device-specific
package data in a record to the device firmware. If the matching record
provides package data, ``pldmfw`` will call the ``.send_package_data``
function with a pointer to the package data and with the package data
length. The device driver should send this data to firmware.
component table 협상
30-42`.send_component_table` operation은 적용 가능한 component 정보를 device로 전달합니다. matching record가 가리키는 component마다 한 번씩 호출되며, driver는 component 정보를 firmware에 보내고 응답을 기다립니다.
함께 전달되는 transfer flag는 현재 component가 sequence의 first, middle, last 가운데 어디에 해당하는지 나타냅니다. driver는 이 flag를 component table 정보의 일부로 firmware에 그대로 전달해야 합니다.
firmware가 component를 update할 수 없다고 응답하면 driver는 error를 반환해야 합니다. update 가능하다고 확인되면 zero를 반환합니다. 어느 한 component라도 부적합하면 전체 update가 취소됩니다.
적용 대상 component 각각을 firmware와 사전 협상합니다.
``.send_component_table``
-------------------------
The ``.send_component_table`` operation is used to forward component
information to the device. It is called once for each applicable component,
that is, for each component indicated by the matching record. The
device driver should send the component information to the device firmware,
and wait for a response. The provided transfer flag indicates whether this
is the first, last, or a middle component, and is expected to be forwarded
to firmware as part of the component table information. The driver should an
error in the case when the firmware indicates that the component cannot be
updated, or return zero if the component can be updated.
component image programming
43-49`.flash_component` operation은 특정 component를 실제로 flash하라고 device driver에 요청합니다. driver는 component binary data를 device로 보내고 programming을 수행하는 데 필요한 모든 transport·protocol 단계를 실행해야 합니다.
``.flash_component``
--------------------
The ``.flash_component`` operation is used to inform the device driver to
flash a given component. The driver must perform any steps necessary to send
the component data to the device.
update 마무리
50-56`.finalize_update` operation은 모든 component programming 뒤에 남은 device-specific 마무리 동작을 수행할 기회를 제공합니다. `pldmfw` library가 이 callback을 호출하면 driver는 activation 준비, metadata commit, reset 요청처럼 해당 device가 update를 끝내는 데 필요한 logic을 실행합니다.
공통 component programming 이후 device 고유 절차로 update를 확정합니다.
``.finalize_update``
--------------------
The ``.finalize_update`` operation is used by the ``pldmfw`` library in
order to allow the device driver to perform any remaining device specific
logic needed to finish the update.
요약과 해설
driver-ops.rst:1-56`pldmfw`가 공통 update 순서를 실행하는 동안 device driver는 다섯 callback으로 record 일치 판정, package data 전송, component 적합성 협상, image programming, 최종 처리를 구현합니다.