[Q] USB to Ethernet via cdc_ether.ko (reverse tether) - General Questions and Answers

Hello,
I am tasked with reverse tethering an Android phone (e.g. Motorola Droid Bionic 2.3.4) to a nondisclosed network device (NDND) via USB cable.
That is to say the Motorola Droid Bionic needs to access the network via a USB cable attached to the NDND (not the other way around).
To do this I am told the Android device can connect to the NDND via the Android cdc_ether.ko driver.
Note: the NDND has a special micro USB cable that provides power to simlate the Android phone being a USB host.
My attempts to do this using a rooted Motorola Droid Bionic 2.3.4 phone have so far been unsuccesful.
What I have learned using dmesg is the Bionic does register the cdc_ether driver, i.e.
…….
<6>[ 1.135437] usbcore: registered new interface driver asix
<6>[ 1.135467] usbcore: registered new interface driver cdc_ether <<<
<6>[ 1.135498] usbcore: registered new interface driver net1080
<6>[ 1.135559] usbcore: registered new interface driver cdc_subset
<6>[ 1.135589] usbcore: registered new interface driver zaurus
<6>[ 1.135620] usbcore: registered new interface driver MOSCHIP usb-ethernet driver
…….
and the Bionic actually appears to use the cdc_ether driver for its LTE radio, i.e.
......
<6>[ 27.376129] usb 1-2: new high speed USB device using ehci-omap and address 2
<6>[ 27.541076] cdc_ether 1-2:1.0: usb1: register 'cdc_ether' at usb-ehci-omap-2, Motorola Wrigley LTE CDC Ethernet Device, 02:21:00:1d:34:fb
.......
but when I connect the Bionic to the NDND nothing appears in the dmesg log,
and I am unable to ping the NDND from the Bionic.
My paranoid suspicion is that the Bionic might have a stripped down version of the cdc_ether driver
that only works with its LTE radio (see dmesg output above).
Using the lsmod command, does NOT list cdc_ether, so I am guessing it is built-in to the kernel.
If someone who is adept at compiling Android kernel would be so kind,
I really would appreciate it if they would compile a version of cdc_ether.ko for Bionic/Gingerbread/2.3.4 and post it here.
But would this be enough to fix the problem, because how would the built-in cdc_ether be removed if it is not listed by lsmod?
Perhaps the cdc_ether driver interface could be renamed e.g. cdc_ether2 to avoid entry point collisions.
For what is worth, here is a link to the cdc_ether driver source code:
m8-android-kernel.googlecode.com/svn/trunk/drivers/net/usb/cdc_ether.c
Any advice regarding cdc_ether is much appreciated.
Thanks in advance.

Using the Bionic's Power Control widget to turn on USB Host mode fixes the problem.
The fourth button from the left on the Power Control widget
is the USB Host Mode button

Related

[SOLVED] Linux USB Tethering on Touch Pro Working via ICS / usb-rndis-lite

There has been many problems in getting Internet Connection Sharing working properly in Linux. I had been using WModem/Wvdial which I have posted about here. The only problem is that this limited you to only certain ROMs as most chefs remove the Wmodem application as ICS is much easier to use. You can also use a BT dialup connection which is well documented for Linux/WM6 but this is not ideal for the faster HSDPA/HSUPA speeds.
So the problem exists with the current usb-rndis-lite implementation where the device is recognized but the rndis0 interface never gets a dhcp address from the phone. In my many google searches I have come across a real solution that works. I do not take ANY credit for this as I simply stumbled across this on my many google searches. All credit to José Oliveira for posting this solution. For the full version please see
Original Post
The Fix:
Code:
Step 1 - Install Pre-requisites
open a terminal (use same terminal in next steps)
Code:
$ sudo apt-get install subversion
Step 2 - Get the Source
Code:
$ svn co http://synce.svn.sourceforge.net/svnroot/synce/trunk/usb-rndis-lite
cd usb-rndis-lite/
Step 3 - Modify the source (Diamond only)
Code:
$ gedit rndis_host.c
on line 524, find this bit
Code:
if (tmp <>hard_mtu) {
dev_err(&intf->dev,
"dev can't take %u byte packets (max %u)\n",
dev->hard_mtu, tmp);
goto fail;
}
change it to this
Code:
if (tmp <>hard_mtu) {
dev_err(&intf->dev,
"dev can't take %u byte packets (max %u)\n",
dev->hard_mtu, tmp);
retval = -EINVAL;
/* goto fail;*/
}
save the file
Step 4 - Compile and make and install
Code:
$ make
$ sudo ./clean.sh
$ sudo make install
Step 5 - Start the Internet Connection Sharing
On OLD Tytn II's open Comm Manager on your phone and click on the Internet Sharing Now make sure USB is selected and choose connect
On Diamonds it's a seperate program called Internet Connection Sharing
Step 6 - Plug in the Phone (USB)
You may need so select that device in NetworkManager or "sudo dhclient rndis0".
Verified on a HTC AT&T Fuze (Touch Pro). Mods I apologize for the double post as I posted this solution in the Diamond forum as well.
-e
Have you tested Bluetooth using wmodem? It doesnt appear to work on my touch pro. I am using the Sprint stock rom, but I have added the wmodem application and done all the registery hacks. USB works perfectly, but I can't get Bluetooth to connect at all.
weird i had no issues with ICS and my kubuntu laptop.
Are you using wmodem (DUN) or Internet Sharing application (PAN)? I have no issues connecting BT using Internet Sharing (PAN), but (PAN) doesn't work well with my work VPN.
I made a little change into the fix and now it's working for me :
Code:
if (tmp < dev->hard_mtu) {
dev_err(&intf->dev,
"dev can't take %u byte packets (max %u)\n",
dev->hard_mtu, tmp);
retval = -EINVAL;
/* goto fail;*/
}
internet sharing not working for me.
I am totally stumped. I have compiled and installed the usb-rndis-lite modules, but my phone (HTC 8525) still won't provide internet to my debian linux box.
when I plug the phone into the usb port. I see that eth1 is created by the rndis_host module. This is with the connection sharing off. When I press connect on the phone, the computer acts like the usb was disconnected and reconnected. In the process the eth1 interface was deregistered.
I have tried to plug the usb cable in while the phone was already in the connected mode (internet sharing shows "check usb connection"). This way, I get no indication of rndis_host doing anything. No interface is created at all.
Here is dmesg output:
Code:
usb 3-1: new full speed USB device using uhci_hcd and address 68
usb 3-1: configuration #1 chosen from 1 choice
rndis_host 3-1:1.0: RNDIS_MSG_QUERY(0x00010202) failed, -47
eth1: register 'rndis_host' at usb-0000:00:10.2-1, RNDIS device, 80:00:60:0f:e8:00
usb 3-1: New USB device found, idVendor=0bb4, idProduct=0b04
usb 3-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb 3-1: Product: Generic RNDIS
usb 3-1: Manufacturer: HTC
usb 3-1: SerialNumber: 01145735-9943-0170-0800-0050bf3f5173
eth1: no IPv6 routers present
usb 3-1: USB disconnect, address 68
eth1: unregister 'rndis_host' usb-0000:00:10.2-1, RNDIS device
usb 3-1: new full speed USB device using uhci_hcd and address 69
usb 3-1: configuration #1 chosen from 1 choice
usb 3-1: New USB device found, idVendor=0bb4, idProduct=0303
usb 3-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb 3-1: Product: Generic RNDIS
usb 3-1: Manufacturer: HTC
usb 3-1: SerialNumber: 01145735-9943-0170-0800-0050bf3f5173
usb 1-2: new full speed USB device using uhci_hcd and address 68
usb 1-2: device descriptor read/64, error -110
hub 1-0:1.0: unable to enumerate USB device on port 2
usb 3-1: USB disconnect, address 69
Any Ideas?
Thanks,
David

[Q] USB Host questions

So I've gotten the USB host working with a mouse and keyboard. I'm trying to use a USB to Ethernet adapter on this phone as part of a project. I plugged in an Apple USB to Ethernet adapter, but no results. This adapter works on my friend's transformer tablet instantly (under settings, where it has Wifi, a new setting appears for ethernet). I plugged it it and typed dmesg in terminal and got this
<6>[ 1081.729558] usb 1-1: New USB device found, idVendor=05ac, idProduct=1402
<6>[ 1081.729650] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
<6>[ 1081.729803] usb 1-1: Product: Apple USB Ethernet Adapter
<6>[ 1081.729894] usb 1-1: Manufacturer: Apple Inc.
<6>[ 1081.730047] usb 1-1: SerialNumber: 000137
so I know it's enumerating properly. I'm wondering if something could be done like this:
http://forum.xda-developers.com/showthread.php?t=1274656
I tried that package, but nothing happened. Could this be done without kernel source code, and could the One V source be close enough to make a runnable package?
Shameless self-bump...
We got this to use on a UAV to take pictures, so I don't really care about anything else on the phone working besides camera, cpu, sensors, gps, and usb host.
kotoshi said:
So I've gotten the USB host working with a mouse and keyboard. I'm trying to use a USB to Ethernet adapter on this phone as part of a project. I plugged in an Apple USB to Ethernet adapter, but no results. This adapter works on my friend's transformer tablet instantly (under settings, where it has Wifi, a new setting appears for ethernet). I plugged it it and typed dmesg in terminal and got this
<6>[ 1081.729558] usb 1-1: New USB device found, idVendor=05ac, idProduct=1402
<6>[ 1081.729650] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
<6>[ 1081.729803] usb 1-1: Product: Apple USB Ethernet Adapter
<6>[ 1081.729894] usb 1-1: Manufacturer: Apple Inc.
<6>[ 1081.730047] usb 1-1: SerialNumber: 000137
so I know it's enumerating properly. I'm wondering if something could be done like this:
http://forum.xda-developers.com/showthread.php?t=1274656
I tried that package, but nothing happened. Could this be done without kernel source code, and could the One V source be close enough to make a runnable package?
Click to expand...
Click to collapse
I can't offer much insight to your question. Kernel work is something I know little about.
I believe the 3 phones from the One series were supposed to have usb host included to a certain extent since the phone contains .kl files that are for usb only type controllers. It doesn't look like the feature made it into the shipped build though.
I would expect the one V kernel to have lots of similarity to the one S & One X kernel so it might help.
Could you please post the files or instructions on how you got it to work with a mouse and keyboard?
I followed this
http://forum.xda-developers.com/showthread.php?t=1629134&highlight=usb+host

[Q] DVB-T dongle through OTG on eos 2

Just flashed eos 2 upgrading from a 4.0.3 nightly
(UK Wifi-Only XOOM with ClockWork)
I got a question for you: I tryied to attach a DVB-T dongle, through an OTG
cable, without any expectation.. in dmesg there are references to USB devices,
but all related to the USB hub:
Code:
[14033.728916] cpcap-otg cpcap-otg: SUSPEND --> HOST[14033.734381] tegra-ehci tegra-ehci.0: Tegra EHCI Host Controller
[14033.735207] tegra-ehci tegra-ehci.0: new USB bus registered, assigned bus number 2
[14033.814996] tegra-ehci tegra-ehci.0: irq 52, io mem 0xc5000000
[14033.837508] tegra-ehci tegra-ehci.0: USB 2.0 started, EHCI 1.00
[14033.837722] usb usb2: New USB device found, idVendor=1d6b, idProduct=0002
[14033.837814] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[14033.837966] usb usb2: Product: Tegra EHCI Host Controller
[14033.838050] usb usb2: Manufacturer: Linux 2.6.39.4-Tiamat-3.0.15-gpuoc-00001-gde1b8c2 ehci_hcd
[14033.838202] usb usb2: SerialNumber: tegra-ehci.0
[14033.840005] hub 2-0:1.0: USB hub found
[14033.840108] hub 2-0:1.0: 1 port detected
There is no mention of the attached device, but it seems that the kernel
recognizes some USB activity. The cable is working (I tryied it with several
USB keys) and the DVB-T dongle too. Here's the dmesg log of a linux
machine (ubuntu) when I attach the device:
Code:
[ 58.029317] usb 1-1: new high-speed USB device number 2 using ehci_hcd
[ 58.807095] IR NEC protocol handler initialized
[ 58.908150] IR RC5(x) protocol handler initialized
[ 58.974855] dib0700: loaded with support for 21 different device-types
[ 58.983660] IR RC6 protocol handler initialized
[ 59.003086] dvb-usb: found a 'Compro Videomate U500' in warm state.
[ 59.003229] dvb-usb: will pass the complete MPEG2 transport stream to the software demuxer.
[ 59.006471] DVB: registering new adapter (Compro Videomate U500)
[ 59.089976] IR JVC protocol handler initialized
[ 59.103600] IR Sony protocol handler initialized
[ 59.116159] IR MCE Keyboard/mouse protocol handler initialized
[ 59.141967] lirc_dev: IR Remote Control driver registered, major 250
[ 59.144610] IR LIRC bridge handler initialized
[ 59.658663] DVB: registering adapter 0 frontend 0 (DiBcom 7000PC)...
[ 59.742154] MT2060: successfully identified (IF1 = 1220)
[ 60.688569] Registered IR keymap rc-dib0700-rc5
[ 60.689296] input: IR-receiver inside an USB DVB receiver as /devices/pci0000:00/0000:00:0b.0/usb1/1-1/rc/rc0/input6
[ 60.689778] rc0: IR-receiver inside an USB DVB receiver as /devices/pci0000:00/0000:00:0b.0/usb1/1-1/rc/rc0
[ 60.710720] dvb-usb: schedule remote query interval to 50 msecs.
[ 60.710725] dvb-usb: Compro Videomate U500 successfully initialized and connected.
[ 60.712443] usbcore: registered new interface driver dvb_usb_dib0700
I would like to recompile the proper driver for tiamat kernel 3.0.15,
if possibile, but is an OTG cable enough to support this device ?
thanks guys ! :-D
(maybe this is not the right thread, feel free to move my post !)

[Q] Minix Neo x7 USB<->Serial adapter issue

Hello,
I have an issue I can't resolve by myself. I would like to use Prolific pl2303 usb<->serial adapter. I can't make it work. I see /dev/ttyUSB0 but it doesn't work as serial port. In dmesg I see:
<6>[ 1844.751839] usb 2-1.4.5: new full speed USB device number 10 using usb20_host
<6>[ 1844.853186] usb 2-1.4.5: New USB device found, idVendor=067b, idProduct=2303
<6>[ 1844.853292] usb 2-1.4.5: New USB device strings: Mfr=1, Product=2, SerialNumber=0
<6>[ 1844.853395] usb 2-1.4.5: Product: USB-Serial Controller C
<6>[ 1844.853462] usb 2-1.4.5: Manufacturer: Prolific Technology Inc.
<6>[ 1844.855524] option 2-1.4.5:1.0: GSM modem (1-port) converter detected
<6>[ 1844.856420] usb 2-1.4.5: GSM modem (1-port) converter now attached to ttyUSB0
Obviously it should be handled by pl2303.ko, but it seems it's not so.
How to make pl2303.ko handle the device?
Thanx in advance.

OTG cable + Card reader = not working.

Hey Im running US retail on my XT 1032, with root and unlocked bootloader. I have the last OTA update with OTG fix.
Since I updated I've been trying to connect my Card reader to my moto g with the OTG cable, but it doesn't work, it doesn't recognize it. I tried with two differents readers and two micro sd, both in NTFS, FAT and FAT32.
I tried a pen drive and it works fine. Its weird because meenova its a card reader too and it works perfectly (I havent got one, and its really hard to buy it in my country because of the costumes policy).
I have a Sandisk 16gb Ultra, so, I really want to fix this.
Any idea?
tatitar said:
Any idea?
Click to expand...
Click to collapse
If you have root, try run the following command from a shell after pluging in the usb device
Code:
echo -n 1 | tee /sys/bus/usb/devices/1-1/bConfigurationValue
I used to have a problem with my HP TP, some USB devices asked to much juice and the default settings reject the device.
Have a look at the following post for more info.
http://rootzwiki.com/topic/33033-otg-usb-insufficient-available-bus-toolthingy/
A "dmesg" output will help you to identify why the device is not been detected.
dubidu said:
If you have root, try run the following command from a shell after pluging in the usb device
Code:
echo -n 1 | tee /sys/bus/usb/devices/1-1/bConfigurationValue
I used to have a problem with my HP TP, some USB devices asked to much juice and the default settings reject the device.
Have a look at the following post for more info.
http://rootzwiki.com/topic/33033-otg-usb-insufficient-available-bus-toolthingy/
A "dmesg" output will help you to identify why the device is not been detected.
Click to expand...
Click to collapse
I tried that and got "tee not found" Maybe I'll sell my microsd and buy a pendrive with that money, I tried almost everything
tatitar said:
I tried that and got "tee not found" Maybe I'll sell my microsd and buy a pendrive with that money, I tried almost everything
Click to expand...
Click to collapse
you don't really need tee, an echo will also change the parameter.
post a dmesg output when you plug the device, that may tell us why is failing to mount
dubidu said:
you don't really need tee, an echo will also change the parameter.
post a dmesg output when you plug the device, that may tell us why is failing to mount
Click to expand...
Click to collapse
http://www.sendspace.com/file/fhj00w There's my dmesg
Can't see anything related to been rejected due power, so the bConfig trick will not work in this case.
Code:
<6>[64952.092782,0] msm_otg f9a55000.usb: USB exited from low power mode
<6>[64952.151006,0] healthd: battery l=96 v=4229 t=27.4 h=2 st=3 c=136 chg=
<6>[64952.182920,0] healthd: battery l=96 v=4224 t=27.4 h=2 st=3 c=188 chg=
<6>[64952.206377,0] msm_hsusb_host msm_hsusb_host: Qualcomm On-Chip EHCI Host Controller
<6>[64952.206931,0] msm_hsusb_host msm_hsusb_host: new USB bus registered, assigned bus number 1
<6>[64952.238571,0] msm_hsusb_host msm_hsusb_host: irq 166, io mem 0xf9a55000
<6>[64952.258317,0] msm_hsusb_host msm_hsusb_host: USB 2.0 started, EHCI 1.00
<6>[64952.258647,0] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
<6>[64952.258750,0] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
<6>[64952.258924,0] usb usb1: Product: Qualcomm On-Chip EHCI Host Controller
<6>[64952.259099,0] usb usb1: Manufacturer: Linux 3.4.0-gc6fc9e1-00001-gf3bf628 ehci_hcd
<6>[64952.259197,0] usb usb1: SerialNumber: msm_hsusb_host
<6>[64952.261601,0] hub 1-0:1.0: USB hub found
<6>[64952.261731,0] hub 1-0:1.0: 1 port detected
<3>[64952.518160,0] hub 1-0:1.0: unable to enumerate USB device on port 1
<6>[64955.061905,0] msm_otg f9a55000.usb: USB in low power mode
I guess that reader is not supported by the current kernel. It looks like it is detected as a USB Hub, not as a simple USB storage device.
Code:
<6>[64952.261601,0] hub 1-0:1.0: USB hub found
Get a cheap one (e.g: like this http://www.ebay.co.uk/itm/OTG-USB-M...aphy_MemoryCardReaders_RL&hash=item5d46cbed5b
I have a couple and they do the job fine.
http://forum.xda-developers.com/moto-x/general/otg-supported-4-4-2-unrooted-via-t2709553
My fix for the X.
Question related to OTG, for Moto G running Kitkat is it safe to directly unplug the OTG cable with the USB?
hypertx said:
Question related to OTG, for Moto G running Kitkat is it safe to directly unplug the OTG cable with the USB?
Click to expand...
Click to collapse
I do it all the time, BUT IF YOU FORGET YOU HAVE A WRITE OPERATION IN PROGRESS IT WILL TRASH the card.
Btw do all the G's have /storage/usbdisk on 442?http://forum.xda-developers.com/attachment.php?attachmentid=2675348&stc=1&d=1396975449
dubidu said:
Can't see anything related to been rejected due power, so the bConfig trick will not work in this case.
Code:
<6>[64952.092782,0] msm_otg f9a55000.usb: USB exited from low power mode
<6>[64952.151006,0] healthd: battery l=96 v=4229 t=27.4 h=2 st=3 c=136 chg=
<6>[64952.182920,0] healthd: battery l=96 v=4224 t=27.4 h=2 st=3 c=188 chg=
<6>[64952.206377,0] msm_hsusb_host msm_hsusb_host: Qualcomm On-Chip EHCI Host Controller
<6>[64952.206931,0] msm_hsusb_host msm_hsusb_host: new USB bus registered, assigned bus number 1
<6>[64952.238571,0] msm_hsusb_host msm_hsusb_host: irq 166, io mem 0xf9a55000
<6>[64952.258317,0] msm_hsusb_host msm_hsusb_host: USB 2.0 started, EHCI 1.00
<6>[64952.258647,0] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
<6>[64952.258750,0] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
<6>[64952.258924,0] usb usb1: Product: Qualcomm On-Chip EHCI Host Controller
<6>[64952.259099,0] usb usb1: Manufacturer: Linux 3.4.0-gc6fc9e1-00001-gf3bf628 ehci_hcd
<6>[64952.259197,0] usb usb1: SerialNumber: msm_hsusb_host
<6>[64952.261601,0] hub 1-0:1.0: USB hub found
<6>[64952.261731,0] hub 1-0:1.0: 1 port detected
<3>[64952.518160,0] hub 1-0:1.0: unable to enumerate USB device on port 1
<6>[64955.061905,0] msm_otg f9a55000.usb: USB in low power mode
I guess that reader is not supported by the current kernel. It looks like it is detected as a USB Hub, not as a simple USB storage device.
Code:
<6>[64952.261601,0] hub 1-0:1.0: USB hub found
Get a cheap one (e.g: like this http://www.ebay.co.uk/itm/OTG-USB-M...aphy_MemoryCardReaders_RL&hash=item5d46cbed5b
I have a couple and they do the job fine.
Click to expand...
Click to collapse
Thanks, Im from Argentina and I couldn't find a micro usb card reader, and if I buy it in ebay I should wait 3 - 4 months because of post office delay, maybe I'll buy a pendrive. My reader is similar to yours, but with usb not micro
I have this problem too... Any other ideas?

Categories

Resources