Commit 60601d61 authored by howientc's avatar howientc Committed by Bernhard Nortmann
Browse files

fel: Improve file_upload() when no progress callback is passed



Until now, the function would always pass `true` as the "progress"
parameter to aw_write_buffer(). This has the potential drawback
of limiting the maximum USB transfer size.

By selectively passing `false` instead (with no progress function
active), we hint that aw_write_buffer() and subsequent routines
don't have to care about callbacks; so that usb_bulk_send() is
free to select a transfer size of AW_USB_MAX_BULK_SEND.
Reviewed-by: default avatarBernhard Nortmann <bernhard.nortmann@web.de>
parent 3b2e98b9
......@@ -1492,7 +1492,7 @@ static unsigned int file_upload(libusb_device_handle *handle, size_t count,
void *buf = load_file(argv[i * 2 + 1], &size);
if (size > 0) {
uint32_t offset = strtoul(argv[i * 2], NULL, 0);
aw_write_buffer(handle, buf, offset, size, true);
aw_write_buffer(handle, buf, offset, size, progress != NULL);
/* If we transferred a script, try to inform U-Boot about its address. */
if (get_image_type(buf, size) == IH_TYPE_SCRIPT)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment