[Droid Eris Android Development] bftb0:
[SIZE=+2]A Quick Note about USB[/SIZE]

I note that a number of people are attempting to "force their computer to use such-and-such a driver". (Windows boxen.)

Let me just say that that's not the way that USB works; there is nothing you can do with drivers on the PC which will "force" the phone to launch a different endpoint or interface on the phone. If you can get ADB to communicate with your phone correctly with the regular phone OS booted (and "Debugging On"), and you can also communicate using fastboot (e.g. "fastboot devices" returns your device serial number with the phone in FASTBOOT-USB mode), then your drivers are set up correctly - there is nothing further you should be doing - or can do - with your drivers (except perhaps to screw up your machine).

All USB client devices use a unique set of four bytes of data to identify themselves - the "Vendor:Product" combination.

Here's what the Eris looks like in different scenarios.

#1) Condition: Booted Leak-V1, debugging ON, SD export off
#2) Condition: Booted Leak-V1, debugging OFF, SD export off
#3) Condition: Booted Leak-V1, debugging OFF, SD export ON
#4) Condition: Booted Leak-V1, debugging ON, SD export ON
#5) Condition: FASTBOOT-USB Mode
#6) Condition: HBOOT MODE
#7) Condition: Leak-V1 recovery boot
#8) Condition: RUU/OEM-78 Mode
#9) Condition: Amon_RA recovery boot (no USB-MS)
#10) Condition: Amon_RA recovery boot (with USB-MS)

COND [COLOR=green][B]VEND:PROD[/B][/COLOR] #INT MANUF. PRODUCT CLASS:SUBCLASS:PROTO:INTERFACE(Endpoints)

1 0bb4:0c98 2 HTC	Android Phone 8:6:80:4(0x01,0x81), 255:66:1:5(0x02,0x82)
2 0bb4:0ff9 1 HTC	Android Phone 8:6:80:4(x01,x81)
3 0bb4:0ff9 1 HTC	Android Phone 8:6:80:4(x01,x81)
4 0bb4:0c98 2 HTC	Android Phone 8:6:80:4(x01,x81), 255:66:1:5(x02,x82)
5 0bb4:0fff 1 htc, Inc	Android 1.0 255:66:3:0(x01,x81)
6 0bb4:0fff 1 -	- 255:66:3:0(x01,x81)
7 0bb4:0ff9 1 HTC	Android Phone 8:6:80:4(x01,x81)
8 0bb4:0fff 1 htc, Inc	Android 1.0 255:66:3:0(x01,x81)
9 0bb4:0c98 2 HTC	Android Phone 8:6:80:4(x01,x81), 255:66:1:5(x02,x82)
10 0bb4:0c98 2 HTC	Android Phone 8:6:80:4(x01,x81), 255:66:1:5(x02,x82)

Key (Class:Subclass:Protocol:Interface):

8:6:80:4() : Mass Storage:SCSI:Bulk (Zip):Mass Storage
255:66:1:5() : Vendor Specific Class:66:1:5 ADB
255:66:3:0() : Vendor Specific Class:66:3:0

What happens on a Windows computer when a USB device is plugged in, is that the Windows host will eventually see the Vendor:Product code advertised by the USB device, and it will attempt to match that Vendor:Product identifier to a specific driver already on the machine. This happens while the USB hub is negotiating with the client device to assign it a "USB address" on the bus. If that match is successful, subsequent transactions involving that "device" will be handled by the driver for that device.

Also, a single (physical) USB "device" can support multiple functions - for example, many people have a USB printer/scanner/fax machine that also have SD card readers; these are separate "Endpoints" within the device. The USB device "describes" these endpoints using standard "class" identifiers, and a generic (Windows) driver that supports that "class" can be used to match up these endpoints with drivers if: (a) there is no specific driver available which matches the Vendor:Product identifier of the USB device, or (b) the OEM-provided driver elects to not provide a service for that particular endpoint (so that a MS-Windows driver can do the job better).

Note that no matter the phone state, we always see a Vendor ID of 0x0bb4 ( = HTC); so, we can ignore that.

As for "Product ID" with the Eris we see three values:

x0ff9 Generic Mass Storage (only)
x0c98 ADBD is running on the phone (aka "Debugging On", aka "Composite Device")
x0fff All Bootloader modes: HBOOT, FASTBOOT, and RUU (or "oem-78")

This explains why there can be several different drivers for the Eris - depending on which "mode" the phone is in. When drivers are correctly installed on the PC, windows "steers traffic" to and from those drivers based upon what Vendor:Product & Endpoint identities the device advertises when it comes alive on the USB bus - or changes it's state. You can load any driver you want into Windows - but if the USB device never advertises the right set of identifiers & endpoints, that driver will never get used.

But, the point of this post is* that if you have your PC working correctly with ADB and fastboot under normal circumstances, that is all you can possibly do - nothing more.. You can not "load a driver to force the Eris to go into a different mode" - that simply doesn't happen.

bftb0

* A related point is that even if you can not win a "race", if the ADBD daemon on the phone even momentarily comes alive, USB transactions should be seen on the bus which advertise the 0bb4:0c98 identity. I've spent some time sniffing the USB bus during recovery (leak-V1) boots, and I have yet to even see the ADB Composite device (0bb4:0c98) advertised even once.

I'm using Wireshark 1.2.9 and libpcap 1.1.1 along with the "usbmon" kernel module on Ubuntu 8.0.4 to do this.