The following patch against -current enables the Samsung Galaxy S
Android device (Samsung Captivate with AT&T) to be be used for USB
tethering.

With or without this patch, the device can still act as a modem and
can be used with PPP.  With this patch, the device can be used as an IP
router over USB the same way that the Mobile AP mode works.

A new USB device shows up when "USB tethering" is enabled on the
Galaxy S.

I was able to obtain an IP address via DHCP from the Galaxy S and ping
the device.


Dmesg snippet without the patch...

umodem0 at uhub0 port 1 configuration 3 interface 0 "SAMSUNG SAMSUNG_Android" 
rev 2.00/4.00 addr 4
umodem0: data interface 1, has no CM over data, has no break
umodem0: status change notification available
ucom0 at umodem0
umass1 at uhub0 port 1 configuration 3 interface 2 "SAMSUNG SAMSUNG_Android" 
rev 2.00/4.00 addr 4
umass1: using SCSI over Bulk-Only
scsibus4 at umass1: 2 targets, initiator 0
sd3 at scsibus4 targ 1 lun 0: <SAMSUNG, SGH-I897, 0000> SCSI2 0/direct removable
sd4 at scsibus4 targ 1 lun 1: <SAMSUNG, SGH-I897 Card, 0000> SCSI2 0/direct 
removable
ugen0 at uhub0 port 1 configuration 3 "SAMSUNG SAMSUNG_Android" rev 2.00/4.00 
addr 4


Full dmesg with patch applied and USB tethering enabled on the device
after the patch.


Index: if_urndis.c
===================================================================
RCS file: /cvs/src/sys/dev/usb/if_urndis.c,v
retrieving revision 1.29
diff -u -r1.29 if_urndis.c
--- if_urndis.c 25 Jan 2011 20:03:35 -0000      1.29
+++ if_urndis.c 30 Apr 2011 19:02:43 -0000
@@ -135,7 +135,8 @@
  * Supported devices that we can't match by class IDs.
  */
 static const struct usb_devno urndis_devs[] = {
-       { USB_VENDOR_HTC,       USB_PRODUCT_HTC_ANDROID }
+       { USB_VENDOR_HTC,       USB_PRODUCT_HTC_ANDROID },
+       { USB_VENDOR_SAMSUNG2,  USB_PRODUCT_SAMSUNG2_ANDROID }
 };
 
 usbd_status
Index: usbdevs
===================================================================
RCS file: /cvs/src/sys/dev/usb/usbdevs,v
retrieving revision 1.544
diff -u -r1.544 usbdevs
--- usbdevs     24 Apr 2011 02:55:50 -0000      1.544
+++ usbdevs     30 Apr 2011 19:02:50 -0000
@@ -3269,6 +3269,7 @@
 /* Samsung products */
 product SAMSUNG2 RT2870_1      0x2018  RT2870
 product SAMSUNG2 I330          0x8001  I330
+product SAMSUNG2 ANDROID       0x6881  Android Phone USB Tethering
 product SAMSUNG SWL2100W       0xa000  SWL-2100U
 
 /* ScanLogic products */




OpenBSD 4.9-current (GENERIC.MP) #2: Sat Apr 30 11:54:35 MDT 2011
    r...@urban.teuton.org:/usr/src/sys/arch/i386/compile/GENERIC.MP
cpu0: Intel(R) Atom(TM) CPU N450 @ 1.66GHz ("GenuineIntel" 686-class) 1.67 GHz
cpu0: 
FPU,V86,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,SBF,SSE3,MWAIT,DS-CPL,EST,TM2,SSSE3,CX16,xTPR,PDCM,MOVBE
real mem  = 1062588416 (1013MB)
avail mem = 1035034624 (987MB)
mainbus0 at root
bios0 at mainbus0: AT/286+ BIOS, date 11/20/09, BIOS32 rev. 0 @ 0xfdc60, SMBIOS 
rev. 2.5 @ 0xdc010 (21 entries)
bios0: vendor TOSHIBA version "V1.10" date 11/20/2009
bios0: TOSHIBA TOSHIBA NB305
acpi0 at bios0: rev 2
acpi0: sleep states S0 S3 S4 S5
acpi0: tables DSDT FACP TCPA HPET MCFG SLIC APIC BOOT SSDT SSDT SSDT
acpi0: wakeup devices EXP1(S4) EXP2(S4) PXS3(S4) EXP4(S4) PCIB(S3) USB1(S3) 
USB2(S0) USB3(S3) USB4(S0) EUSB(S3)
acpitimer0 at acpi0: 3579545 Hz, 24 bits
acpihpet0 at acpi0: 14318179 Hz
acpimcfg0 at acpi0 addr 0xe0000000, bus 0-255
acpimadt0 at acpi0 addr 0xfee00000: PC-AT compat
cpu0 at mainbus0: apid 0 (boot processor)
cpu0: apic clock running at 166MHz
cpu1 at mainbus0: apid 1 (application processor)
cpu1: Intel(R) Atom(TM) CPU N450 @ 1.66GHz ("GenuineIntel" 686-class) 1.67 GHz
cpu1: 
FPU,V86,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,SBF,SSE3,MWAIT,DS-CPL,EST,TM2,SSSE3,CX16,xTPR,PDCM,MOVBE
ioapic0 at mainbus0: apid 2 pa 0xfec00000, version 20, 24 pins
acpiprt0 at acpi0: bus 0 (PCI0)
acpiprt1 at acpi0: bus 5 (EXP1)
acpiprt2 at acpi0: bus 7 (EXP2)
acpiprt3 at acpi0: bus 9 (EXP3)
acpiprt4 at acpi0: bus -1 (EXP4)
acpiprt5 at acpi0: bus 17 (PCIB)
acpiec0 at acpi0
acpicpu0 at acpi0: C3, C2, C1, PSS
acpicpu1 at acpi0: C3, C2, C1, PSS
acpiac0 at acpi0: AC unit online
acpibat0 at acpi0: BAT1 model "PA3785U-1BRS" serial 41167 type Li-Ion oem "Dell"
acpibtn0 at acpi0: LID0
acpibtn1 at acpi0: PWRB
acpivideo0 at acpi0: IGD0
acpivout0 at acpivideo0: LCD_
bios0: ROM list: 0xc0000/0xda00! 0xce000/0x1000 0xdc000/0x4000!
cpu0: Enhanced SpeedStep 1663 MHz: speeds: 1667, 1333, 1000 MHz
pci0 at mainbus0 bus 0: configuration mode 1 (bios)
bridge mem address conflict 0xf0500000/0x100000
pchb0 at pci0 dev 0 function 0 "Intel Pineview DMI" rev 0x00
vga1 at pci0 dev 2 function 0 "Intel Pineview Video" rev 0x00
wsdisplay0 at vga1 mux 1: console (80x25, vt100 emulation)
wsdisplay0: screen 1-5 added (80x25, vt100 emulation)
intagp0 at vga1
agp0 at intagp0: aperture at 0xd0000000, size 0x10000000
inteldrm0 at vga1: apic 2 int 16
drm0 at inteldrm0
"Intel Pineview Video" rev 0x00 at pci0 dev 2 function 1 not configured
azalia0 at pci0 dev 27 function 0 "Intel 82801GB HD Audio" rev 0x02: apic 2 int 
22
azalia0: codecs: Realtek ALC272
audio0 at azalia0
ppb0 at pci0 dev 28 function 0 "Intel 82801GB PCIE" rev 0x02: apic 2 int 16
pci1 at ppb0 bus 5
ppb1 at pci0 dev 28 function 1 "Intel 82801GB PCIE" rev 0x02: apic 2 int 17
pci2 at ppb1 bus 7
athn0 at pci2 dev 0 function 0 "Atheros AR9285" rev 0x01: apic 2 int 17
athn0: AR9285 rev 2 (1T1R), ROM rev 13, address 00:26:4d:01:33:e3
ppb2 at pci0 dev 28 function 2 "Intel 82801GB PCIE" rev 0x02: apic 2 int 18
pci3 at ppb2 bus 9
mem address conflict 0xf0520000/0x1000
mem address conflict 0xf0510000/0x10000
re0 at pci3 dev 0 function 0 "Realtek 8101E" rev 0x02: RTL8102EL (0x2480), apic 
2 int 18, address 00:26:22:f7:4f:e5
rlphy0 at re0 phy 7: RTL8201L 10/100 PHY, rev. 1
uhci0 at pci0 dev 29 function 0 "Intel 82801GB USB" rev 0x02: apic 2 int 23
uhci1 at pci0 dev 29 function 1 "Intel 82801GB USB" rev 0x02: apic 2 int 19
uhci2 at pci0 dev 29 function 2 "Intel 82801GB USB" rev 0x02: apic 2 int 18
uhci3 at pci0 dev 29 function 3 "Intel 82801GB USB" rev 0x02: apic 2 int 16
ehci0 at pci0 dev 29 function 7 "Intel 82801GB USB" rev 0x02: apic 2 int 23
usb0 at ehci0: USB revision 2.0
uhub0 at usb0 "Intel EHCI root hub" rev 2.00/1.00 addr 1
ppb3 at pci0 dev 30 function 0 "Intel 82801BAM Hub-to-PCI" rev 0xe2
pci4 at ppb3 bus 17
pcib0 at pci0 dev 31 function 0 "Intel Tigerpoint LPC" rev 0x02
ahci0 at pci0 dev 31 function 2 "Intel 82801GR AHCI" rev 0x02: apic 2 int 19, 
AHCI 1.1
ahci0: PHY offline on port 1
ahci0: PHY offline on port 2
ahci0: PHY offline on port 3
scsibus0 at ahci0: 32 targets
sd0 at scsibus0 targ 0 lun 0: <ATA, TOSHIBA MK2555GS, FG00> SCSI3 0/direct 
fixed naa.50000392268087f8
sd0: 238475MB, 512 bytes/sec, 488397168 sec total
ichiic0 at pci0 dev 31 function 3 "Intel 82801GB SMBus" rev 0x02: apic 2 int 19
iic0 at ichiic0
spdmem0 at iic0 addr 0x50: 1GB DDR2 SDRAM non-parity PC2-6400CL5 SO-DIMM
usb1 at uhci0: USB revision 1.0
uhub1 at usb1 "Intel UHCI root hub" rev 1.00/1.00 addr 1
usb2 at uhci1: USB revision 1.0
uhub2 at usb2 "Intel UHCI root hub" rev 1.00/1.00 addr 1
usb3 at uhci2: USB revision 1.0
uhub3 at usb3 "Intel UHCI root hub" rev 1.00/1.00 addr 1
usb4 at uhci3: USB revision 1.0
uhub4 at usb4 "Intel UHCI root hub" rev 1.00/1.00 addr 1
isa0 at pcib0
isadma0 at isa0
pckbc0 at isa0 port 0x60/5
pckbd0 at pckbc0 (kbd slot)
pckbc0: using irq 1 for kbd slot
wskbd0 at pckbd0: console keyboard, using wsdisplay0
pms0 at pckbc0 (aux slot)
pckbc0: using irq 12 for aux slot
wsmouse0 at pms0 mux 0
pcppi0 at isa0 port 0x61
spkr0 at pcppi0
npx0 at isa0 port 0xf0/16: reported by CPUID; using exception 16
mtrr: Pentium Pro MTRR support
umass0 at uhub0 port 4 configuration 1 interface 0 "Generic USB2.0-CRW" rev 
2.00/58.89 addr 2
umass0: using SCSI over Bulk-Only
scsibus1 at umass0: 2 targets, initiator 0
sd1 at scsibus1 targ 1 lun 0: <Generic-, Multi-Card, 1.00> SCSI0 0/direct 
removable serial.0bda0158114173400000
uvideo0 at uhub0 port 8 configuration 1 interface 0 "Chicony Chicony USB 2.0 
Camera" rev 2.00/20.56 addr 3
video0 at uvideo0
vscsi0 at root
scsibus2 at vscsi0: 256 targets
softraid0 at root
root on sd0a (ef1ee17e3b8fe612.a) swap on sd0b dump on sd0b
scsibus3 at softraid0: 1 targets
sd2 at scsibus3 targ 0 lun 0: <OPENBSD, SR CRYPTO, 004> SCSI2 0/direct fixed
sd2: 84099MB, 512 bytes/sec, 172235024 sec total
umodem0 at uhub0 port 1 configuration 3 interface 0 "SAMSUNG SAMSUNG_Android" 
rev 2.00/4.00 addr 4
umodem0: data interface 1, has no CM over data, has no break
umodem0: status change notification available
ucom0 at umodem0
umass1 at uhub0 port 1 configuration 3 interface 2 "SAMSUNG SAMSUNG_Android" 
rev 2.00/4.00 addr 4
umass1: using SCSI over Bulk-Only
scsibus4 at umass1: 2 targets, initiator 0
sd3 at scsibus4 targ 1 lun 0: <SAMSUNG, SGH-I897, 0000> SCSI2 0/direct removable
sd4 at scsibus4 targ 1 lun 1: <SAMSUNG, SGH-I897 Card, 0000> SCSI2 0/direct 
removable
ugen0 at uhub0 port 1 configuration 3 "SAMSUNG SAMSUNG_Android" rev 2.00/4.00 
addr 4
ucom0 detached
umodem0 detached
sd3 detached
sd4 detached
scsibus4 detached
umass1 detached
ugen0 detached
urndis0 at uhub0 port 1 configuration 6 interface 0 "SAMSUNG SAMSUNG_Android" 
rev 2.00/4.00 addr 4
urndis0: address 7a:e6:07:e9:37:e3

Reply via email to