Change in osmo-asf4-dfu[master]: set initial DFU state to ERROR if application is corrupt

2019-02-14 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/12914 )

Change subject: set initial DFU state to ERROR if application is corrupt
..

set initial DFU state to ERROR if application is corrupt

as specified in DFU standard

Change-Id: Icd503a2d19f829eb43a83c28b526b73d595640f0
---
M usb/class/dfu/device/dfudf.c
M usb_dfu_main.c
2 files changed, 3 insertions(+), 1 deletion(-)

Approvals:
  Jenkins Builder: Verified
  Harald Welte: Looks good to me, approved



diff --git a/usb/class/dfu/device/dfudf.c b/usb/class/dfu/device/dfudf.c
index 8232979..223999a 100644
--- a/usb/class/dfu/device/dfudf.c
+++ b/usb/class/dfu/device/dfudf.c
@@ -306,7 +306,6 @@
usbdc_register_function(&_dfudf);
usbdc_register_handler(USBDC_HDL_REQ, _req_h);

-   // TODO check if firmware is corrupted and set dfuERROR state if it is
return ERR_NONE;
 }

diff --git a/usb_dfu_main.c b/usb_dfu_main.c
index 81b02f8..7fd54d3 100644
--- a/usb_dfu_main.c
+++ b/usb_dfu_main.c
@@ -101,6 +101,9 @@
if (!check_force_dfu() && check_application()) { // application is valid
start_application(); // start application
} else {
+   if (!check_application()) { // if the application is corrupted 
the start DFU start should be dfuERROR
+   dfu_state = USB_DFU_STATE_DFU_ERROR;
+   }
usb_dfu(); // start DFU bootloader
}
 }

--
To view, visit https://gerrit.osmocom.org/12914
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-asf4-dfu
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Icd503a2d19f829eb43a83c28b526b73d595640f0
Gerrit-Change-Number: 12914
Gerrit-PatchSet: 1
Gerrit-Owner: Kévin Redon 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)


Change in osmo-asf4-dfu[master]: set initial DFU state to ERROR if application is corrupt

2019-02-14 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/12914 )

Change subject: set initial DFU state to ERROR if application is corrupt
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/12914
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-asf4-dfu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Icd503a2d19f829eb43a83c28b526b73d595640f0
Gerrit-Change-Number: 12914
Gerrit-PatchSet: 1
Gerrit-Owner: Kévin Redon 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Comment-Date: Thu, 14 Feb 2019 21:43:40 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-asf4-dfu[master]: set initial DFU state to ERROR if application is corrupt

2019-02-14 Thread Kévin Redon
Kévin Redon has uploaded this change for review. ( 
https://gerrit.osmocom.org/12914


Change subject: set initial DFU state to ERROR if application is corrupt
..

set initial DFU state to ERROR if application is corrupt

as specified in DFU standard

Change-Id: Icd503a2d19f829eb43a83c28b526b73d595640f0
---
M usb/class/dfu/device/dfudf.c
M usb_dfu_main.c
2 files changed, 3 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-asf4-dfu refs/changes/14/12914/1

diff --git a/usb/class/dfu/device/dfudf.c b/usb/class/dfu/device/dfudf.c
index 8232979..223999a 100644
--- a/usb/class/dfu/device/dfudf.c
+++ b/usb/class/dfu/device/dfudf.c
@@ -306,7 +306,6 @@
usbdc_register_function(&_dfudf);
usbdc_register_handler(USBDC_HDL_REQ, _req_h);

-   // TODO check if firmware is corrupted and set dfuERROR state if it is
return ERR_NONE;
 }

diff --git a/usb_dfu_main.c b/usb_dfu_main.c
index 81b02f8..7fd54d3 100644
--- a/usb_dfu_main.c
+++ b/usb_dfu_main.c
@@ -101,6 +101,9 @@
if (!check_force_dfu() && check_application()) { // application is valid
start_application(); // start application
} else {
+   if (!check_application()) { // if the application is corrupted 
the start DFU start should be dfuERROR
+   dfu_state = USB_DFU_STATE_DFU_ERROR;
+   }
usb_dfu(); // start DFU bootloader
}
 }

--
To view, visit https://gerrit.osmocom.org/12914
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-asf4-dfu
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Icd503a2d19f829eb43a83c28b526b73d595640f0
Gerrit-Change-Number: 12914
Gerrit-PatchSet: 1
Gerrit-Owner: Kévin Redon