mirror of
https://git.proxmox.com/git/fwupd
synced 2025-08-08 14:06:43 +00:00
synaptics-rmi: Correctly set the payload length rather than hardcoding it
This commit is contained in:
parent
9a5f076b6b
commit
83fe59629d
@ -280,12 +280,15 @@ fu_synaptics_rmi_v7_device_write_partition (FuSynapticsRmiDevice *self,
|
|||||||
chunks = fu_chunk_array_new_from_bytes (bytes,
|
chunks = fu_chunk_array_new_from_bytes (bytes,
|
||||||
0x00, /* start addr */
|
0x00, /* start addr */
|
||||||
0x00, /* page_sz */
|
0x00, /* page_sz */
|
||||||
flash->payload_length);
|
(gsize) flash->payload_length *
|
||||||
|
(gsize) flash->block_size);
|
||||||
for (guint i = 0; i < chunks->len; i++) {
|
for (guint i = 0; i < chunks->len; i++) {
|
||||||
FuChunk *chk = g_ptr_array_index (chunks, i);
|
FuChunk *chk = g_ptr_array_index (chunks, i);
|
||||||
g_autoptr(GByteArray) req_trans_sz = g_byte_array_new ();
|
g_autoptr(GByteArray) req_trans_sz = g_byte_array_new ();
|
||||||
g_autoptr(GByteArray) req_cmd = g_byte_array_new ();
|
g_autoptr(GByteArray) req_cmd = g_byte_array_new ();
|
||||||
fu_byte_array_append_uint16 (req_trans_sz, chk->data_sz, G_LITTLE_ENDIAN);
|
fu_byte_array_append_uint16 (req_trans_sz,
|
||||||
|
chk->data_sz / flash->block_size,
|
||||||
|
G_LITTLE_ENDIAN);
|
||||||
if (!fu_synaptics_rmi_device_write (self,
|
if (!fu_synaptics_rmi_device_write (self,
|
||||||
f34->data_base + 0x3,
|
f34->data_base + 0x3,
|
||||||
req_trans_sz,
|
req_trans_sz,
|
||||||
|
Loading…
Reference in New Issue
Block a user