mirror of
https://git.proxmox.com/git/fwupd
synced 2025-08-09 15:23:48 +00:00
dfu: Support download of large DFU firmware
The nr_chunks is defined as an unsigned short, the max value is 65536. Assume the transfer_size reported by device is 4096, the maximum size of DFU firmware supported is 65536 * 4096 = 256MB. To support larger DFU firmware, we can change the guint16 to guint32.
This commit is contained in:
parent
c0fcd64b4a
commit
783bc5c8a8
@ -1106,7 +1106,7 @@ dfu_target_download_element_dfu (DfuTarget *target,
|
|||||||
{
|
{
|
||||||
DfuTargetPrivate *priv = GET_PRIVATE (target);
|
DfuTargetPrivate *priv = GET_PRIVATE (target);
|
||||||
GBytes *bytes;
|
GBytes *bytes;
|
||||||
guint16 nr_chunks;
|
guint32 nr_chunks;
|
||||||
guint16 transfer_size = dfu_device_get_transfer_size (priv->device);
|
guint16 transfer_size = dfu_device_get_transfer_size (priv->device);
|
||||||
|
|
||||||
/* round up as we have to transfer incomplete blocks */
|
/* round up as we have to transfer incomplete blocks */
|
||||||
@ -1121,7 +1121,7 @@ dfu_target_download_element_dfu (DfuTarget *target,
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
dfu_target_set_action (target, FWUPD_STATUS_DEVICE_WRITE);
|
dfu_target_set_action (target, FWUPD_STATUS_DEVICE_WRITE);
|
||||||
for (guint16 i = 0; i < nr_chunks + 1; i++) {
|
for (guint32 i = 0; i < nr_chunks + 1; i++) {
|
||||||
gsize length;
|
gsize length;
|
||||||
guint32 offset;
|
guint32 offset;
|
||||||
g_autoptr(GBytes) bytes_tmp = NULL;
|
g_autoptr(GBytes) bytes_tmp = NULL;
|
||||||
|
Loading…
Reference in New Issue
Block a user