Reinitialize dfu_env_entities after flashing the 'SCRIPT' entity to
ensure that the potential changes to the 'dfu_alt_info' environment
variable are applied.
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
goto exit;
}
- ret = thor_handle();
- if (ret) {
- pr_err("THOR failed: %d\n", ret);
- ret = CMD_RET_FAILURE;
- goto exit;
- }
-
+ do {
+ ret = thor_handle();
+ if (ret == THOR_DFU_REINIT_NEEDED) {
+ dfu_free_entities();
+ ret = dfu_init_env_entities(interface, devstring);
+ }
+ if (ret) {
+ pr_err("THOR failed: %d\n", ret);
+ ret = CMD_RET_FAILURE;
+ goto exit;
+ }
+ } while (ret == 0);
exit:
g_dnl_unregister();
usb_gadget_release(controller_index);
#include <linux/usb/cdc.h>
#include <g_dnl.h>
#include <dfu.h>
+#include <thor.h>
#include "f_thor.h"
printf("%s: No data received!\n", __func__);
break;
}
+ if (dfu_reinit_needed)
+ return THOR_DFU_REINIT_NEEDED;
}
return 0;
#include <linux/usb/composite.h>
+#define THOR_DFU_REINIT_NEEDED 0xFFFFFFFE
+
int thor_handle(void);
int thor_init(void);
int thor_add(struct usb_configuration *c);