Back to home page

OSCL-LXR

 
 

    


0001 .. SPDX-License-Identifier: GPL-2.0-only
0002 
0003 =========================
0004 Driver-specific callbacks
0005 =========================
0006 
0007 The ``pldmfw`` module relies on the device driver for implementing device
0008 specific behavior using the following operations.
0009 
0010 ``.match_record``
0011 -----------------
0012 
0013 The ``.match_record`` operation is used to determine whether a given PLDM
0014 record matches the device being updated. This requires comparing the record
0015 descriptors in the record with information from the device. Many record
0016 descriptors are defined by the PLDM standard, but it is also allowed for
0017 devices to implement their own descriptors.
0018 
0019 The ``.match_record`` operation should return true if a given record matches
0020 the device.
0021 
0022 ``.send_package_data``
0023 ----------------------
0024 
0025 The ``.send_package_data`` operation is used to send the device-specific
0026 package data in a record to the device firmware. If the matching record
0027 provides package data, ``pldmfw`` will call the ``.send_package_data``
0028 function with a pointer to the package data and with the package data
0029 length. The device driver should send this data to firmware.
0030 
0031 ``.send_component_table``
0032 -------------------------
0033 
0034 The ``.send_component_table`` operation is used to forward component
0035 information to the device. It is called once for each applicable component,
0036 that is, for each component indicated by the matching record. The
0037 device driver should send the component information to the device firmware,
0038 and wait for a response. The provided transfer flag indicates whether this
0039 is the first, last, or a middle component, and is expected to be forwarded
0040 to firmware as part of the component table information. The driver should an
0041 error in the case when the firmware indicates that the component cannot be
0042 updated, or return zero if the component can be updated.
0043 
0044 ``.flash_component``
0045 --------------------
0046 
0047 The ``.flash_component`` operation is used to inform the device driver to
0048 flash a given component. The driver must perform any steps necessary to send
0049 the component data to the device.
0050 
0051 ``.finalize_update``
0052 --------------------
0053 
0054 The ``.finalize_update`` operation is used by the ``pldmfw`` library in
0055 order to allow the device driver to perform any remaining device specific
0056 logic needed to finish the update.