Certain sections of the device flash, containing settings or device identifying information, may be set by the OEM.
This patch introduce the ability for users to decide whether these sections should be overwritten with data from the image or retained from the factory settings. The new option, DEVLINK_FLASH_OVERWRITE_FROM_FACTORY_SETTINGS, is intended to be used alongside DEVLINK_FLASH_OVERWRITE_IDENTIFIERS and/or DEVLINK_FLASH_OVERWRITE_SETTINGS. This combination allows restoration of data such as MAC addresses set by the OEM manufacturer, rather than using those found in the image. Reviewed-by: Aleksandr Loktionov <[email protected]> Signed-off-by: Konrad Knitter <[email protected]> --- Documentation/networking/devlink/devlink-flash.rst | 3 +++ include/uapi/linux/devlink.h | 2 ++ 2 files changed, 5 insertions(+) diff --git a/Documentation/networking/devlink/devlink-flash.rst b/Documentation/networking/devlink/devlink-flash.rst index 603e732f00cc..7b04fcb95279 100644 --- a/Documentation/networking/devlink/devlink-flash.rst +++ b/Documentation/networking/devlink/devlink-flash.rst @@ -36,6 +36,9 @@ This mask indicates the set of sections which are allowed to be overwritten. components being updated with the identifiers found in the provided image. This includes MAC addresses, serial IDs, and similar device identifiers. + * - ``DEVLINK_FLASH_OVERWRITE_FROM_FACTORY_SETTINGS`` + - Indicates that device shall overwrite settings and identifiers from + factory settings section instead of provided image. Multiple overwrite bits may be combined and requested together. If no bits are provided, it is expected that the device only update firmware binaries diff --git a/include/uapi/linux/devlink.h b/include/uapi/linux/devlink.h index a5ee0f13740a..b7c4b367df64 100644 --- a/include/uapi/linux/devlink.h +++ b/include/uapi/linux/devlink.h @@ -270,6 +270,7 @@ enum { enum devlink_flash_overwrite { DEVLINK_FLASH_OVERWRITE_SETTINGS_BIT, DEVLINK_FLASH_OVERWRITE_IDENTIFIERS_BIT, + DEVLINK_FLASH_OVERWRITE_FROM_FACTORY_SETTINGS_BIT, __DEVLINK_FLASH_OVERWRITE_MAX_BIT, DEVLINK_FLASH_OVERWRITE_MAX_BIT = __DEVLINK_FLASH_OVERWRITE_MAX_BIT - 1 @@ -277,6 +278,7 @@ enum devlink_flash_overwrite { #define DEVLINK_FLASH_OVERWRITE_SETTINGS _BITUL(DEVLINK_FLASH_OVERWRITE_SETTINGS_BIT) #define DEVLINK_FLASH_OVERWRITE_IDENTIFIERS _BITUL(DEVLINK_FLASH_OVERWRITE_IDENTIFIERS_BIT) +#define DEVLINK_FLASH_OVERWRITE_FROM_FACTORY_SETTINGS _BITUL(DEVLINK_FLASH_OVERWRITE_FROM_FACTORY_SETTINGS_BIT) #define DEVLINK_SUPPORTED_FLASH_OVERWRITE_SECTIONS \ (_BITUL(__DEVLINK_FLASH_OVERWRITE_MAX_BIT) - 1) -- 2.38.1
