mirror of
https://git.proxmox.com/git/fwupd
synced 2025-08-16 00:45:53 +00:00
libdfu: Fix uploading from DfuSe devices
This commit is contained in:
parent
fa522907e9
commit
cbdeca25e2
@ -951,6 +951,9 @@ dfu_target_upload_element (DfuTarget *target,
|
|||||||
(guint) offset);
|
(guint) offset);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
g_debug ("using sector %u for read of %x",
|
||||||
|
dfu_sector_get_id (sector),
|
||||||
|
offset);
|
||||||
if (!dfu_sector_has_cap (sector, DFU_SECTOR_CAP_READABLE)) {
|
if (!dfu_sector_has_cap (sector, DFU_SECTOR_CAP_READABLE)) {
|
||||||
g_set_error (error,
|
g_set_error (error,
|
||||||
DFU_ERROR,
|
DFU_ERROR,
|
||||||
@ -970,6 +973,10 @@ dfu_target_upload_element (DfuTarget *target,
|
|||||||
return NULL;
|
return NULL;
|
||||||
last_sector_id = dfu_sector_get_id (sector);
|
last_sector_id = dfu_sector_get_id (sector);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* abort back to IDLE */
|
||||||
|
if (!dfu_device_abort (priv->device, cancellable, error))
|
||||||
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* read chunk of data */
|
/* read chunk of data */
|
||||||
@ -1005,6 +1012,12 @@ dfu_target_upload_element (DfuTarget *target,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* abort back to IDLE */
|
||||||
|
if (dfu_device_has_dfuse_support (priv->device)) {
|
||||||
|
if (!dfu_device_abort (priv->device, cancellable, error))
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
/* check final size */
|
/* check final size */
|
||||||
if (expected_size > 0) {
|
if (expected_size > 0) {
|
||||||
if (total_size != expected_size) {
|
if (total_size != expected_size) {
|
||||||
|
Loading…
Reference in New Issue
Block a user