tirsdag den 25. maj 2010

HTC Internet sharing and linux (gentoo)

As previous mentioned, I have a HTC Tattoo, and now that I've gotten familiar to it, I really like it.

Now, on topic:
The HTC Tattoo offers a "Internet sharing" option when it is connected to a computer via USB.
The driver installation on Windows sucks (at least on Danish windows installs - as it fails without installing the drivers), however, under linux, all you need is a couple a modules, and you're ready to go.

Here's the dmesg output when I connect the phone:
[101272.454938] hub 1-6:1.0: state 7 ports 4 chg 0000 evt 0002
[101272.455227] hub 1-6:1.0: port 1, status 0101, change 0001, 12 Mb/s
[101272.559111] hub 1-6:1.0: debounce: port 1: total 100ms stable 100ms status 0x101
[101272.570240] hub 1-6:1.0: port 1 not reset yet, waiting 10ms
[101272.632287] usb 1-6.1: new high speed USB device using ehci_hcd and address 18
[101272.644235] hub 1-6:1.0: port 1 not reset yet, waiting 10ms
[101272.725235] usb 1-6.1: default language 0x0409
[101272.731235] usb 1-6.1: udev 18, busnum 1, minor = 17
[101272.731241] usb 1-6.1: New USB device found, idVendor=0bb4, idProduct=0c01
[101272.731246] usb 1-6.1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[101272.731252] usb 1-6.1: Product: Android Phone
[101272.731257] usb 1-6.1: Manufacturer: HTC
[101272.731261] usb 1-6.1: SerialNumber: SH9CVLG00376
[101272.731390] usb 1-6.1: uevent
[101272.731423] usb 1-6.1: usb_probe_device
[101272.731430] usb 1-6.1: configuration #1 chosen from 1 choice
[101272.733488] usb 1-6.1: adding 1-6.1:1.0 (config #1, interface 0)
[101272.735621] usb 1-6.1:1.0: uevent
[101272.735661] usb-storage 1-6.1:1.0: usb_probe_interface
[101272.735672] usb-storage 1-6.1:1.0: usb_probe_interface - got id
[101272.735760] scsi9 : SCSI emulation for USB Mass Storage devices
[101272.735924] drivers/usb/core/inode.c: creating file '018'
[101272.735963] usb-storage: device found at 18
[101272.735966] usb-storage: waiting for device to settle before scanning
[101272.759587] usb 1-6.1: uevent
[101275.271385] hub 1-6:1.0: state 7 ports 4 chg 0000 evt 0002
[101275.271598] hub 1-6:1.0: port 1, status 0101, change 0001, 12 Mb/s
[101275.271605] usb 1-6.1: USB disconnect, address 18
[101275.271610] usb 1-6.1: unregistering device
[101275.271615] usb 1-6.1: usb_disable_device nuking all URBs
[101275.271624] usb 1-6.1: unregistering interface 1-6.1:1.0
[101275.274280] usb 1-6.1:1.0: uevent
[101275.274530] usb 1-6.1: uevent
[101275.379244] hub 1-6:1.0: debounce: port 1: total 100ms stable 100ms status 0x101
[101275.390236] hub 1-6:1.0: port 1 not reset yet, waiting 10ms
[101275.452284] usb 1-6.1: new high speed USB device using ehci_hcd and address 19
[101275.464233] hub 1-6:1.0: port 1 not reset yet, waiting 10ms
[101275.543241] usb 1-6.1: skipped 4 descriptors after interface
[101275.545238] usb 1-6.1: default language 0x0409
[101275.551238] usb 1-6.1: udev 19, busnum 1, minor = 18
[101275.551243] usb 1-6.1: New USB device found, idVendor=0bb4, idProduct=0ffe
[101275.551249] usb 1-6.1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[101275.551255] usb 1-6.1: Product: Android Phone
[101275.551259] usb 1-6.1: Manufacturer: HTC
[101275.551263] usb 1-6.1: SerialNumber: SH9CVLG00376
[101275.551383] usb 1-6.1: uevent
[101275.551418] usb 1-6.1: usb_probe_device
[101275.551425] usb 1-6.1: configuration #1 chosen from 1 choice
[101275.553481] usb 1-6.1: adding 1-6.1:1.0 (config #1, interface 0)
[101275.553898] usb 1-6.1: uevent
[101275.555614] usb 1-6.1:1.0: uevent
[101275.555660] usbserial_generic 1-6.1:1.0: usb_probe_interface
[101275.555666] usbserial_generic 1-6.1:1.0: usb_probe_interface - got id
[101275.555687] rndis_host 1-6.1:1.0: usb_probe_interface
[101275.555692] rndis_host 1-6.1:1.0: usb_probe_interface - got id
[101275.569291] usb0: register 'rndis_host' at usb-0000:00:1d.7-6.1, RNDIS device, fa:6a:94:9d:b9:49
[101275.569324] usb 1-6.1: adding 1-6.1:1.1 (config #1, interface 1)
[101275.570622] usb 1-6.1:1.1: uevent
[101275.570691] drivers/usb/core/inode.c: creating file '019'
[101276.342616] usb 1-6.1: link qh32-0001/f6435900 start 11 [2/0 us]
and lsusb has this to say:
Bus 001 Device 019: ID 0bb4:0ffe High Tech Computer Corp.
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 2 Communications
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 64
idVendor 0x0bb4 High Tech Computer Corp.
idProduct 0x0ffe
bcdDevice 1.00
iManufacturer 3 HTC
iProduct 2 Android Phone
iSerial 1 SH9CVLG00376
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 67
bNumInterfaces 2
bConfigurationValue 1
iConfiguration 0
bmAttributes 0x80
(Bus Powered)
MaxPower 256mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 1
bInterfaceClass 2 Communications
bInterfaceSubClass 2 Abstract (modem)
bInterfaceProtocol 255 Vendor Specific (MSFT RNDIS?)
iInterface 6 HTC Ethernet Sharing
CDC Header:
bcdCDC 1.10
CDC Call Management:
bmCapabilities 0x00
bDataInterface 1
CDC ACM:
bmCapabilities 0x00
CDC Union:
bMasterInterface 0
bSlaveInterface 1
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x83 EP 3 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 9
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 1
bAlternateSetting 0
bNumEndpoints 2
bInterfaceClass 10 CDC Data
bInterfaceSubClass 0 Unused
bInterfaceProtocol 0
iInterface 6 HTC Ethernet Sharing
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x03 EP 3 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x84 EP 4 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 0
Device Qualifier (for other device speed):
bLength 10
bDescriptorType 6
bcdUSB 2.00
bDeviceClass 0 (Defined at Interface level)
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 64
bNumConfigurations 1
Device Status: 0x0000
(Bus Powered)
For this to work, I have enabled the following modules in my kernel:
rndis_host
cdc_ether (with rndis support)
usbnet

These are found under:

  • Device Drivers --->
    • Network device support --->
      • USB Network Adapters --->
        • Multi-purpose USB Networking Framework
        • Host for RNDIS and ActiveSync devices (EXPERIMENTAL)
    • USB support --->
      • USB Gadget Support --->
        • Ethernet Gadget (with CDC Ethernet support)
        • [*] RNDIS support

Next, you'll just need to create a symlink from net.lo to net.usb0 in /etc/init.d/
cd /etc/init.d/
ln -s net.lo net.usb0
This will get the device working under gentoo at least.

Ingen kommentarer:

Send en kommentar