lynxis lazus has uploaded this change for review.

View Change

dfu: MANIFEST_SYNC: stay in MANIFEST_SYNC when manifestationIntolerant & completed

In theory a device which is manifestintolerant and completed the manifestation should
not reach MANIFEST_SYNC again.

Remove the state transistion to WAIT-RESET and stay in the current state and
wait for the main loop to change the state is safer.

Change-Id: I8c34a18e2336731126a8c01070d86e2547578e3d
---
M usb/class/dfu/device/dfudf.c
1 file changed, 6 insertions(+), 4 deletions(-)

git pull ssh://gerrit.osmocom.org:29418/osmo-asf4-dfu refs/changes/75/42175/1
diff --git a/usb/class/dfu/device/dfudf.c b/usb/class/dfu/device/dfudf.c
index 0f5ec0e..7b13cc3 100644
--- a/usb/class/dfu/device/dfudf.c
+++ b/usb/class/dfu/device/dfudf.c
@@ -183,10 +183,12 @@
case USB_DFU_STATE_DFU_MANIFEST_SYNC:
if (!dfu_manifestation_complete) {
dfu_state = USB_DFU_STATE_DFU_MANIFEST; // go to manifest mode
- } else if (usb_dfu_func_desc->bmAttributes & USB_DFU_ATTRIBUTES_MANIFEST_TOLERANT) {
- dfu_state = USB_DFU_STATE_DFU_IDLE; // go back to idle mode
- } else { // this should not happen (after manifestation the state should be dfuMANIFEST-WAIT-RESET if we are not manifest tolerant)
- dfu_state = USB_DFU_STATE_DFU_MANIFEST_WAIT_RESET; // wait for reset
+ } else {
+ /* manifestation complete */
+ if (usb_dfu_func_desc->bmAttributes & USB_DFU_ATTRIBUTES_MANIFEST_TOLERANT) {
+ dfu_state = USB_DFU_STATE_DFU_IDLE; // go back to idle mode
+ }
+ /* otherwise stay in MANIFEST_SYNC */
}
break;
default:

To view, visit change 42175. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: newchange
Gerrit-Project: osmo-asf4-dfu
Gerrit-Branch: master
Gerrit-Change-Id: I8c34a18e2336731126a8c01070d86e2547578e3d
Gerrit-Change-Number: 42175
Gerrit-PatchSet: 1
Gerrit-Owner: lynxis lazus <lynxis@fe80.eu>