eclair snapshot
diff --git a/fastboot/fastboot.c b/fastboot/fastboot.c
index 850e10b..c81222a 100644
--- a/fastboot/fastboot.c
+++ b/fastboot/fastboot.c
@@ -147,9 +147,11 @@
int match_fastboot(usb_ifc_info *info)
{
if(!(vendor_id && (info->dev_vendor == vendor_id)) &&
- (info->dev_vendor != 0x18d1) &&
+ (info->dev_vendor != 0x18d1) && // Google
(info->dev_vendor != 0x0451) &&
- (info->dev_vendor != 0x0bb4)) return -1;
+ (info->dev_vendor != 0x22b8) && // Motorola
+ (info->dev_vendor != 0x0bb4)) // HTC
+ return -1;
if(info->ifc_class != 0xff) return -1;
if(info->ifc_subclass != 0x42) return -1;
if(info->ifc_protocol != 0x03) return -1;
diff --git a/fastboot/usb_linux.c b/fastboot/usb_linux.c
index 06c62b8..3b40ba7 100644
--- a/fastboot/usb_linux.c
+++ b/fastboot/usb_linux.c
@@ -51,7 +51,9 @@
#include "usb.h"
-#if TRACE_USB
+#define MAX_RETRIES 5
+
+#ifdef TRACE_USB
#define DBG1(x...) fprintf(stderr, x)
#define DBG(x...) fprintf(stderr, x)
#else
@@ -303,7 +305,7 @@
unsigned char *data = (unsigned char*) _data;
unsigned count = 0;
struct usbdevfs_bulktransfer bulk;
- int n;
+ int n, retry;
if(h->ep_in == 0) {
return -1;
@@ -316,16 +318,20 @@
bulk.len = xfer;
bulk.data = data;
bulk.timeout = 0;
-
- DBG("[ usb read %d fd = %d], fname=%s\n", xfer, h->desc, h->fname);
- n = ioctl(h->desc, USBDEVFS_BULK, &bulk);
- DBG("[ usb read %d ] = %d, fname=%s\n", xfer, n, h->fname);
+ retry = 0;
- if(n < 0) {
- DBG1("ERROR: n = %d, errno = %d (%s)\n",
- n, errno, strerror(errno));
- return -1;
+ do{
+ DBG("[ usb read %d fd = %d], fname=%s\n", xfer, h->desc, h->fname);
+ n = ioctl(h->desc, USBDEVFS_BULK, &bulk);
+ DBG("[ usb read %d ] = %d, fname=%s, Retry %d \n", xfer, n, h->fname, retry);
+
+ if( n < 0 ) {
+ DBG1("ERROR: n = %d, errno = %d (%s)\n",n, errno, strerror(errno));
+ if ( ++retry > MAX_RETRIES ) return -1;
+ sleep( 1 );
+ }
}
+ while( n < 0 );
count += n;
len -= n;
diff --git a/fastboot/util_osx.c b/fastboot/util_osx.c
index 068241c..b43e316 100644
--- a/fastboot/util_osx.c
+++ b/fastboot/util_osx.c
@@ -26,7 +26,6 @@
* SUCH DAMAGE.
*/
-#include <utils/executablepath.h>
#import <Carbon/Carbon.h>
#include <unistd.h>