diff options
author | Amaury Pouly <amaury.pouly@gmail.com> | 2013-06-18 14:59:13 +0200 |
---|---|---|
committer | Amaury Pouly <amaury.pouly@gmail.com> | 2013-06-18 14:59:13 +0200 |
commit | 87b84c07d722d6f1fcb8a5d1d7e8549cf17bb8f4 (patch) | |
tree | b0b8c74bb757abc47a19038c815e5196d31048ff | |
parent | 9c965c88b4a0aeb69b3523af8ce7c83e284022f9 (diff) | |
download | rockbox-87b84c07d722d6f1fcb8a5d1d7e8549cf17bb8f4.tar.gz rockbox-87b84c07d722d6f1fcb8a5d1d7e8549cf17bb8f4.zip |
sbtools: fix sbloader (allow transfer size override)
Change-Id: Id6d3188b7f837726c29845f01b0b1588acf40407
-rw-r--r-- | utils/imxtools/sbtools/sbloader.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/utils/imxtools/sbtools/sbloader.c b/utils/imxtools/sbtools/sbloader.c index 01b9fe6c01..91c01785f9 100644 --- a/utils/imxtools/sbtools/sbloader.c +++ b/utils/imxtools/sbtools/sbloader.c | |||
@@ -311,7 +311,7 @@ static int probe_hid_xfer_size(libusb_device_handle *dev) | |||
311 | sizeof(buffer), 1000); | 311 | sizeof(buffer), 1000); |
312 | if(ret <= 0) | 312 | if(ret <= 0) |
313 | goto Lerr; | 313 | goto Lerr; |
314 | /* this is not a real parse, since the HID descriptor of the device is | 314 | /* this is not a real parser, since the HID descriptor of the device is |
315 | * is mostly trivial, we assume that all reports are made up of one item | 315 | * is mostly trivial, we assume that all reports are made up of one item |
316 | * and simply compute the maximum of report size * report count */ | 316 | * and simply compute the maximum of report size * report count */ |
317 | int xfer_size = 0; | 317 | int xfer_size = 0; |
@@ -364,6 +364,7 @@ int main(int argc, char **argv) | |||
364 | .dev_type = PROBE_DEVICE}; | 364 | .dev_type = PROBE_DEVICE}; |
365 | int usb_bus = -1; | 365 | int usb_bus = -1; |
366 | int usb_dev = -1; | 366 | int usb_dev = -1; |
367 | int force_xfer_size = 0; | ||
367 | /* parse command line */ | 368 | /* parse command line */ |
368 | while(1) | 369 | while(1) |
369 | { | 370 | { |
@@ -390,7 +391,7 @@ int main(int argc, char **argv) | |||
390 | case 'x': | 391 | case 'x': |
391 | { | 392 | { |
392 | char *end; | 393 | char *end; |
393 | di.xfer_size = strtoul(optarg, &end, 0); | 394 | force_xfer_size = strtoul(optarg, &end, 0); |
394 | if(*end) | 395 | if(*end) |
395 | { | 396 | { |
396 | printf("Invalid transfer size!\n"); | 397 | printf("Invalid transfer size!\n"); |
@@ -506,6 +507,8 @@ int main(int argc, char **argv) | |||
506 | dev_type = g_dev_info[db_idx].dev_type; | 507 | dev_type = g_dev_info[db_idx].dev_type; |
507 | xfer_size = g_dev_info[db_idx].xfer_size; | 508 | xfer_size = g_dev_info[db_idx].xfer_size; |
508 | } | 509 | } |
510 | if(force_xfer_size > 0) | ||
511 | xfer_size = force_xfer_size; | ||
509 | if(dev_type == PROBE_DEVICE) | 512 | if(dev_type == PROBE_DEVICE) |
510 | dev_type = probe_protocol(dev); | 513 | dev_type = probe_protocol(dev); |
511 | if(xfer_size == 0) | 514 | if(xfer_size == 0) |