Driver-specific callbacks¶
Thepldmfw module relies on the device driver for implementing devicespecific behavior using the following operations.
.match_record¶
The.match_record operation is used to determine whether a given PLDMrecord matches the device being updated. This requires comparing the recorddescriptors in the record with information from the device. Many recorddescriptors are defined by the PLDM standard, but it is also allowed fordevices to implement their own descriptors.
The.match_record operation should return true if a given record matchesthe device.
.send_package_data¶
The.send_package_data operation is used to send the device-specificpackage data in a record to the device firmware. If the matching recordprovides package data,pldmfw will call the.send_package_datafunction with a pointer to the package data and with the package datalength. The device driver should send this data to firmware.
.send_component_table¶
The.send_component_table operation is used to forward componentinformation to the device. It is called once for each applicable component,that is, for each component indicated by the matching record. Thedevice driver should send the component information to the device firmware,and wait for a response. The provided transfer flag indicates whether thisis the first, last, or a middle component, and is expected to be forwardedto firmware as part of the component table information. The driver should anerror in the case when the firmware indicates that the component cannot beupdated, or return zero if the component can be updated.
.flash_component¶
The.flash_component operation is used to inform the device driver toflash a given component. The driver must perform any steps necessary to sendthe component data to the device.
.finalize_update¶
The.finalize_update operation is used by thepldmfw library inorder to allow the device driver to perform any remaining device specificlogic needed to finish the update.