Message ID | 1412103942-28331-2-git-send-email-eric.nelson@boundarydevices.com |
---|---|
State | Accepted |
Delegated to: | Ćukasz Majewski |
Headers | show |
On 14-09-30 12:05 PM, Eric Nelson wrote: > Current Android Fastboot seems to use 'max-download-size' instead > of 'downloadsize' variable to indicate the maximum size of sparse > segments. > > See function get_target_sparse_limit() in file fastboot/fastboot.c > in the AOSP: > https://android.googlesource.com/platform/system/core/+/master > > Signed-off-by: Eric Nelson <eric.nelson@boundarydevices.com> > --- > drivers/usb/gadget/f_fastboot.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/usb/gadget/f_fastboot.c b/drivers/usb/gadget/f_fastboot.c > index 38c0965..f970f89 100644 > --- a/drivers/usb/gadget/f_fastboot.c > +++ b/drivers/usb/gadget/f_fastboot.c > @@ -351,7 +351,8 @@ static void cb_getvar(struct usb_ep *ep, struct usb_request *req) > strncat(response, FASTBOOT_VERSION, chars_left); > } else if (!strcmp_l1("bootloader-version", cmd)) { > strncat(response, U_BOOT_VERSION, chars_left); > - } else if (!strcmp_l1("downloadsize", cmd)) { > + } else if (!strcmp_l1("downloadsize", cmd) || > + !strcmp_l1("max-download-size", cmd)) { > char str_num[12]; > > sprintf(str_num, "%08x", CONFIG_USB_FASTBOOT_BUF_SIZE); > (the host version of fastboot that I'm using requires this change!) Tested-by: Steve Rae <srae@broadcom.com>
On Wednesday, October 01, 2014 at 10:38:57 PM, Steve Rae wrote: > On 14-09-30 12:05 PM, Eric Nelson wrote: > > Current Android Fastboot seems to use 'max-download-size' instead > > of 'downloadsize' variable to indicate the maximum size of sparse > > segments. > > > > See function get_target_sparse_limit() in file fastboot/fastboot.c > > > > in the AOSP: > > https://android.googlesource.com/platform/system/core/+/master > > > > Signed-off-by: Eric Nelson <eric.nelson@boundarydevices.com> > > --- > > > > drivers/usb/gadget/f_fastboot.c | 3 ++- > > 1 file changed, 2 insertions(+), 1 deletion(-) > > > > diff --git a/drivers/usb/gadget/f_fastboot.c > > b/drivers/usb/gadget/f_fastboot.c index 38c0965..f970f89 100644 > > --- a/drivers/usb/gadget/f_fastboot.c > > +++ b/drivers/usb/gadget/f_fastboot.c > > @@ -351,7 +351,8 @@ static void cb_getvar(struct usb_ep *ep, struct > > usb_request *req) > > > > strncat(response, FASTBOOT_VERSION, chars_left); > > > > } else if (!strcmp_l1("bootloader-version", cmd)) { > > > > strncat(response, U_BOOT_VERSION, chars_left); > > > > - } else if (!strcmp_l1("downloadsize", cmd)) { > > + } else if (!strcmp_l1("downloadsize", cmd) || > > + !strcmp_l1("max-download-size", cmd)) { > > > > char str_num[12]; > > > > sprintf(str_num, "%08x", CONFIG_USB_FASTBOOT_BUF_SIZE); > > (the host version of fastboot that I'm using requires this change!) > Tested-by: Steve Rae <srae@broadcom.com> Wow, so the previous code that was accepted was broken ? Did you know about that breakage ? Best regards, Marek Vasut
On 14-10-01 07:37 PM, Marek Vasut wrote: > On Wednesday, October 01, 2014 at 10:38:57 PM, Steve Rae wrote: >> On 14-09-30 12:05 PM, Eric Nelson wrote: >>> Current Android Fastboot seems to use 'max-download-size' instead >>> of 'downloadsize' variable to indicate the maximum size of sparse >>> segments. >>> >>> See function get_target_sparse_limit() in file fastboot/fastboot.c >>> >>> in the AOSP: >>> https://android.googlesource.com/platform/system/core/+/master >>> >>> Signed-off-by: Eric Nelson <eric.nelson@boundarydevices.com> >>> --- >>> >>> drivers/usb/gadget/f_fastboot.c | 3 ++- >>> 1 file changed, 2 insertions(+), 1 deletion(-) >>> >>> diff --git a/drivers/usb/gadget/f_fastboot.c >>> b/drivers/usb/gadget/f_fastboot.c index 38c0965..f970f89 100644 >>> --- a/drivers/usb/gadget/f_fastboot.c >>> +++ b/drivers/usb/gadget/f_fastboot.c >>> @@ -351,7 +351,8 @@ static void cb_getvar(struct usb_ep *ep, struct >>> usb_request *req) >>> >>> strncat(response, FASTBOOT_VERSION, chars_left); >>> >>> } else if (!strcmp_l1("bootloader-version", cmd)) { >>> >>> strncat(response, U_BOOT_VERSION, chars_left); >>> >>> - } else if (!strcmp_l1("downloadsize", cmd)) { >>> + } else if (!strcmp_l1("downloadsize", cmd) || >>> + !strcmp_l1("max-download-size", cmd)) { >>> >>> char str_num[12]; >>> >>> sprintf(str_num, "%08x", CONFIG_USB_FASTBOOT_BUF_SIZE); >> >> (the host version of fastboot that I'm using requires this change!) >> Tested-by: Steve Rae <srae@broadcom.com> > > Wow, so the previous code that was accepted was broken ? Did you know about that > breakage ? It wasn't broken; let me try to clarify.... It seems that different host versions of "fastboot" use either "downloadsize" or "max-download-size" (I am not certain about the history...) The original code has "downloadsize", and with the host version of fastboot that I am testing with (which uses "max-download-size"), this reports as "unknown variable" - however, the download still occurs successfully (there must be some default size that it is using...) Therefore, it isn't broken (for me). However, Eric has reported that for his host version of fastboot, that it stops! So his changes (1/3 and 2/3) are required for his host version of fastboot (and they work properly with my version) Hope that clarifies it, Thanks, Steve PS. none of these host versions of fastboot have any version identification -- so it is really difficult to determine what "host version" we are actually talking about.... > > Best regards, > Marek Vasut >
diff --git a/drivers/usb/gadget/f_fastboot.c b/drivers/usb/gadget/f_fastboot.c index 38c0965..f970f89 100644 --- a/drivers/usb/gadget/f_fastboot.c +++ b/drivers/usb/gadget/f_fastboot.c @@ -351,7 +351,8 @@ static void cb_getvar(struct usb_ep *ep, struct usb_request *req) strncat(response, FASTBOOT_VERSION, chars_left); } else if (!strcmp_l1("bootloader-version", cmd)) { strncat(response, U_BOOT_VERSION, chars_left); - } else if (!strcmp_l1("downloadsize", cmd)) { + } else if (!strcmp_l1("downloadsize", cmd) || + !strcmp_l1("max-download-size", cmd)) { char str_num[12]; sprintf(str_num, "%08x", CONFIG_USB_FASTBOOT_BUF_SIZE);
Current Android Fastboot seems to use 'max-download-size' instead of 'downloadsize' variable to indicate the maximum size of sparse segments. See function get_target_sparse_limit() in file fastboot/fastboot.c in the AOSP: https://android.googlesource.com/platform/system/core/+/master Signed-off-by: Eric Nelson <eric.nelson@boundarydevices.com> --- drivers/usb/gadget/f_fastboot.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)