diff options
-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) |