From 7ac1b410ac9b66150170718a6f807ce52ffd8400 Mon Sep 17 00:00:00 2001 From: Stephen Warren Date: Wed, 11 Jun 2014 16:03:34 -0600 Subject: dfu: allow backend to specify a maximum buffer size CONFIG_SYS_DFU_DATA_BUF_SIZE may be large to allow for FAT/ext layouts to transfer large files. However, this means that individual write operations will take a long time. Allow backends to specify a maximum buffer size, so that each write operation is limited to a smaller data block. This prevents the DFU protocol from timing out when e.g. writing to SPI flash. I would guess that NAND might benefit from setting this value too, but I can't test that. Signed-off-by: Stephen Warren --- include/dfu.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include/dfu.h') diff --git a/include/dfu.h b/include/dfu.h index 21390aa9b7..d5562dcb37 100644 --- a/include/dfu.h +++ b/include/dfu.h @@ -91,6 +91,7 @@ struct dfu_entity { void *dev_private; enum dfu_device_type dev_type; enum dfu_layout layout; + unsigned long max_buf_size; union { struct mmc_internal_data mmc; @@ -138,7 +139,7 @@ void dfu_trigger_reset(void); int dfu_get_alt(char *name); bool dfu_reset(void); int dfu_init_env_entities(char *interface, char *devstr); -unsigned char *dfu_get_buf(void); +unsigned char *dfu_get_buf(struct dfu_entity *dfu); unsigned char *dfu_free_buf(void); unsigned long dfu_get_buf_size(void); -- cgit v1.2.3