On Wed, May 04, 2011 at 01:05:20AM +0000, Stuart Henderson wrote: > On 2011-05-03, Markus Bergkvist <markus.bergkv...@telia.com> wrote: > > On 05/03/11 22:13, Stuart Henderson wrote: > >> vovka<net.vlad<at> gmail.com> writes: > >>> On Sat, Apr 30, 2011 at 18:08, Erik Mugele<ejm<at> teuton.org> wrote: > >>>> The following patch against -current enables the Samsung Galaxy S > >>>> Android device (Samsung Captivate with AT&T) to be be used for USB > >>>> tethering. > >>> Erik, great work and great patch... I, too, have a Samsung Galaxy S. > >>> Your patch did not apply correctly, so here is my version of it.I've also > >>> attached a diff of "usbdevs.h" . > >> > >> Please pkg_add usbutil, then identify the relevant /dev/usbX controller > >> device (from "usbdevs -v" output), run "usbctl -f /dev/usbX", and include > >> the output. If other people with different Android phones that support > >> this mode of tethering could do the same, we may be able to identify > >> a suitable class id we can match on instead. > >> > >> > > > > Is this sufficient? > > hmm, not sure.. from what I was reading there should be some > communications device class interface showing up and here's there's > just mass-storage. is there some different mode you need to select > on the phone to use tethering? (I haven't used any android phone).
Yes. You have to enable tethering mode as needed on the USB port. For the record, my device is running Android 2.2 (Froyo). With tethering mode DISABLED the device presents one product ID. This is where the mass-storage device shows up. As I originally mentioned there is also a umodem device at this point that is usable with PPP (this is not tethering mode in the Android sense where the Android device acts as a NATing router and dishes out IP address via DHCP). When tethering mode is enabled the device presents a different product ID which is currently undefined in usbdevs so it shows up as ugen. The patch I originally posted at the beginning of this thread defines the ID and enables the device to work with urndis. As a side note, when tethering mode is enabled, the umass and umodem devices are detached. Here is my output from "usbctl -a 4 -f /dev/usb0" with tethering mode enabled. The Android device is plugged into usb0, port 1, addr 4 according to "usbdevs -v". I'll also include an output from usbctl with tethering mode disabled at the end. DEVICE addr 4 DEVICE descriptor: bLength=18 bDescriptorType=device(1) bcdUSB=2.00 bDeviceClass=2 bDeviceSubClass=0 bDeviceProtocol=0 bMaxPacketSize=64 idVendor=0x04e8 idProduct=0x6881 bcdDevice=400 iManufacturer=1(SAMSUNG) iProduct=2(SAMSUNG_Android) iSerialNumber=3(I897aaf720ed) bNumConfigurations=1 CONFIGURATION descriptor 0: bLength=9 bDescriptorType=config(2) wTotalLength=67 bNumInterface=2 bConfigurationValue=6 iConfiguration=0() bmAttributes=c0 bMaxPower=96 mA INTERFACE descriptor 0: bLength=9 bDescriptorType=interface(4) bInterfaceNumber=0 bAlternateSetting=0 bNumEndpoints=1 bInterfaceClass=2 bInterfaceSubClass=2 bInterfaceProtocol=255 iInterface=9(RNDIS Communications Control) CDC INTERFACE descriptor: bLength=5 bDescriptorType=cs_interface(36) bDescriptorSubtype=header bcdCDC=1.10 CDC INTERFACE descriptor: bLength=5 bDescriptorType=cs_interface(36) bDescriptorSubtype=Call_Management bmCapabilities=0x0 bDataInterface=1 CDC INTERFACE descriptor: bLength=4 bDescriptorType=cs_interface(36) bDescriptorSubtype=Abstract_Control_Model bmCapabilities=0x0 CDC INTERFACE descriptor: bLength=5 bDescriptorType=cs_interface(36) bDescriptorSubtype=union bMasterInterface=0 bSlaveInterface0=1 ENDPOINT descriptor: bLength=7 bDescriptorType=endpoint(5) bEndpointAddress=9-in bmAttributes=interrupt wMaxPacketSize=8 bInterval=9 INTERFACE descriptor 1: bLength=9 bDescriptorType=interface(4) bInterfaceNumber=1 bAlternateSetting=0 bNumEndpoints=2 bInterfaceClass=10 bInterfaceSubClass=0 bInterfaceProtocol=0 iInterface=10(RNDIS Ethernet Data) ENDPOINT descriptor: bLength=7 bDescriptorType=endpoint(5) bEndpointAddress=14-in bmAttributes=bulk wMaxPacketSize=512 bInterval=0 ENDPOINT descriptor: bLength=7 bDescriptorType=endpoint(5) bEndpointAddress=13-out bmAttributes=bulk wMaxPacketSize=512 bInterval=0 current configuration 6 ---------- ----------snip--------- For completeness sake, here is the same command with tethering mode disabled. DEVICE addr 4 DEVICE descriptor: bLength=18 bDescriptorType=device(1) bcdUSB=2.00 bDeviceClass=2 bDeviceSubClass=0 bDeviceProtocol=0 bMaxPacketSize=64 idVendor=0x04e8 idProduct=0x681c bcdDevice=400 iManufacturer=1(SAMSUNG) iProduct=2(SAMSUNG_Android) iSerialNumber=3(I897aaf720ed) bNumConfigurations=1 CONFIGURATION descriptor 0: bLength=9 bDescriptorType=config(2) wTotalLength=113 bNumInterface=4 bConfigurationValue=3 iConfiguration=0() bmAttributes=c0 bMaxPower=96 mA INTERFACE descriptor 0: bLength=9 bDescriptorType=interface(4) bInterfaceNumber=0 bAlternateSetting=0 bNumEndpoints=1 bInterfaceClass=2 bInterfaceSubClass=2 bInterfaceProtocol=1 iInterface=4(CDC Abstract Control Model (ACM)) CDC INTERFACE descriptor: bLength=5 bDescriptorType=cs_interface(36) bDescriptorSubtype=header bcdCDC=1.10 CDC INTERFACE descriptor: bLength=5 bDescriptorType=cs_interface(36) bDescriptorSubtype=Call_Management bmCapabilities=0x0 bDataInterface=1 CDC INTERFACE descriptor: bLength=4 bDescriptorType=cs_interface(36) bDescriptorSubtype=Abstract_Control_Model bmCapabilities=0x2 CDC INTERFACE descriptor: bLength=5 bDescriptorType=cs_interface(36) bDescriptorSubtype=union bMasterInterface=0 bSlaveInterface0=1 ENDPOINT descriptor: bLength=7 bDescriptorType=endpoint(5) bEndpointAddress=3-in bmAttributes=interrupt wMaxPacketSize=10 bInterval=9 INTERFACE descriptor 1: bLength=9 bDescriptorType=interface(4) bInterfaceNumber=1 bAlternateSetting=0 bNumEndpoints=2 bInterfaceClass=10 bInterfaceSubClass=0 bInterfaceProtocol=0 iInterface=5(CDC ACM Data) ENDPOINT descriptor: bLength=7 bDescriptorType=endpoint(5) bEndpointAddress=2-in bmAttributes=bulk wMaxPacketSize=512 bInterval=0 ENDPOINT descriptor: bLength=7 bDescriptorType=endpoint(5) bEndpointAddress=1-out bmAttributes=bulk wMaxPacketSize=512 bInterval=0 INTERFACE descriptor 2: bLength=9 bDescriptorType=interface(4) bInterfaceNumber=2 bAlternateSetting=0 bNumEndpoints=2 bInterfaceClass=8 bInterfaceSubClass=6 bInterfaceProtocol=80 iInterface=6(Android UMS) ENDPOINT descriptor: bLength=7 bDescriptorType=endpoint(5) bEndpointAddress=5-in bmAttributes=bulk wMaxPacketSize=512 bInterval=0 ENDPOINT descriptor: bLength=7 bDescriptorType=endpoint(5) bEndpointAddress=4-out bmAttributes=bulk wMaxPacketSize=512 bInterval=1 INTERFACE descriptor 3: bLength=9 bDescriptorType=interface(4) bInterfaceNumber=3 bAlternateSetting=0 bNumEndpoints=2 bInterfaceClass=255 bInterfaceSubClass=66 bInterfaceProtocol=1 iInterface=7(S3C6410 Android ADB) ENDPOINT descriptor: bLength=7 bDescriptorType=endpoint(5) bEndpointAddress=8-in bmAttributes=bulk wMaxPacketSize=512 bInterval=0 ENDPOINT descriptor: bLength=7 bDescriptorType=endpoint(5) bEndpointAddress=7-out bmAttributes=bulk wMaxPacketSize=512 bInterval=0 current configuration 3 ---------- Erik