dfu: add CONFIG_DFU_NAME_MAX_SIZE configuration 59/275459/1
authorJaehoon Chung <jh80.chung@samsung.com>
Wed, 25 May 2022 04:48:46 +0000 (13:48 +0900)
committerJaehoon Chung <jh80.chung@samsung.com>
Wed, 25 May 2022 04:51:54 +0000 (13:51 +0900)
Add CONFIG_DFU_NAME_MAX_SIZE to change the proper size.
If name is longer than default size, it can do wrong behavior during updating
image. So it need to change the proper maximum size.

This patch is proviced the solution to change value with configuration.

Change-Id: I5c371eb749954b5cb699c04347d40d31fcf4a7d5
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
drivers/dfu/Kconfig
include/dfu.h

index b50547476cbd37e978f77e4716c835a56b724526..537f54881bfd6a8cc5aaf79ee86c3b6c9f13d14c 100644 (file)
@@ -112,5 +112,14 @@ config SYS_DFU_MAX_FILE_SIZE
          the buffer once we've been given the whole file.  Define
          this to the maximum filesize (in bytes) for the buffer.
          If undefined it defaults to the CONFIG_SYS_DFU_DATA_BUF_SIZE.
+
+config DFU_NAME_MAX_SIZE
+       int "Size of the name to be added in dfu entity"
+       default 32
+       depends on DFU
+       help
+         This value is used to maximum size. If name is longer than default size,
+         we need to change the proper maximum size.
+
 endif
 endmenu
index f6868982df70d6d6db9a61280f0b3aaaa972a8a1..449044be3152df72c77150b1bbf52a8624183d13 100644 (file)
@@ -99,7 +99,7 @@ struct virt_internal_data {
        int dev_num;
 };
 
-#define DFU_NAME_SIZE                  32
+#define DFU_NAME_SIZE                  CONFIG_DFU_NAME_MAX_SIZE
 #ifndef DFU_DEFAULT_POLL_TIMEOUT
 #define DFU_DEFAULT_POLL_TIMEOUT 0
 #endif