[Q] ADDING RNDIS module for DROID x to enable wired tethering - Droid X General

I am trying to compile rndis gadget module to load on a DX or D2. If this works we can get wired tethering enabled on DX and D2 for computer with rndis host support.
Motorola's implementation of RNDIS is usbnet (motorola network inteface) which has driver's for windows but not for linux. The phones virtual usb ethernet can be made to show up on a windows machine by using the command on a rooted phone.
#echo 1 > /sys/class/usb_composite/usbnet/enable
With the right drivers from motorola, a virtual ethernet interface shows up on the windows machine with ip address range 192.168.16.x. If the routing tables on the phone are modified, we have wired tethering on windows machines only.
I downloaded the froyo kernel for the droidx but when i try to load the f_rndis.ko file i compiled, i get kernel tainted on dmesg. Anyone willing to help me with this?

sound great but W A Y beyond me
You will succeed...

are you succeed?

Does this have anything to do with the tun.ko filea? I think I may have seen someone elae working on something similar. Sorry if I'm way off!
Sent from my DROIDX using XDA App

gowthamj said:
I am trying to compile rndis gadget module to load on a DX or D2.
Click to expand...
Click to collapse
Gowthami
Any new developments with this? Did you or anyone ever get it to work?
I tried to do this myself and ran into issues. Granted it was the first time I ever attempted a "make" so I'm not sure I have much to add but this:
arch\arm\configs\sholes_defconfig was used as the config to make the tun.ko VPN module.
PleaseStirMe

Hi,
I just do it, compiling module to enable the /dev/usb0 to show up ! But It doesn't work; They add a module that unify usb ether,adb and mtp without include rndis support. Furthermore this is not a module so can't remove it from the kernel to load the good module.
Any ideas?

Related

MotoUSB reverse tether w/ linux success

I have successfully used reverse USB tethering on a flipout. This method should be portable to other devices running the motorola android multi-device driver with usb0.
If you are comparing to any windows drivers, say that installed from the driver installer MSI when connecting a flipout and maybe other devices in 'portal' mode, the (windows) driver will be motousbnet. On linux, the driver is cdc_subset. However, this driver does not know how to bind to the motorola
1. Figure out the usb vendor id, product id, and interface class, interface subclass, and interface protocol of the networking interface. On the flipout, this is named the 'motorola networking interface'. On my device, it has these ids: 0x22b8, 0x41da, 0x02, 0x0a, 0x01. You can find these ids via exploring /sys/bus/usb on a linux system, or with the lsusb utility.
2. patch your cdc_subset driver to support the USB id and interface of the above device. You will need to inspect via lsusb or sysfs to setup a 'product' and 'driver info' structure in cdc_subset.c to select the correct interface and endpoints. The pertinent parts of my cdc_subset.c are as follows:
Code:
add to products
{
// Moto flipout usb
USB_DEVICE_AND_INTERFACE_INFO (0x22b8, 0x41da, 0x02, 0x0a, 0x01),
.driver_info = (unsigned long) &motousb_info,
},
add near other driver_infos:
static const struct driver_info motousb_info = {
.description = "Motorola USB endpoint",
.check_connect = always_connected,
.in=0x84, .out=0x03,
};
3. Doing such a mod and compiling yourself a new cdc_subset.ko, and installing that, will yield a usb driver that can talk to usb0 on your flipout. At this point, you just have to configure networking. I setup proxyarp on my LAN and usb0 interfaces, and set up some manual addresses and routes. Other options could be to add usb0 to a bridge, or do routing and DHCP, or routing + nat + DHCP. You'll probably need to netcfg rmnet0 down and setprop net.dns1 and net.rmnet0.dns1 your ips manually. Make sure you save your old dns. I'm not sure if that gets restored from carrier when you turn rmnet back on.
4. after all that, you should be online.
5. EDIT: all compiling and module installation steps noted above happen on the host PC, if that wasn't clear.
Work to follow:
use SL4A to automate usb0 bringup
interface with APNDroid to soft-down the 3g instead of nuking it the hard way. killing the radio process will get you back online, but thats effectively the same as resetting the baseband, so you'll need to re-unlock your SIM etc.
Thanks man! This is awesome. It worked on my Motorola Defy (same parameters) under Ubunutu.
Hi,
I thing this is what i am looking for, enable a motorola device (defy) to be a usb0 device with ubuntu so you can have an IP, and ssh easly with your droid (using vlc remote with usb cable). I realy appreciate this native feature with my old htc.
where is the cdc_subset.c ?
tkx
balek said:
Hi,
I thing this is what i am looking for, enable a motorola device (defy) to be a usb0 device with ubuntu so you can have an IP, and ssh easly with your droid (using vlc remote with usb cable). I realy appreciate this native feature with my old htc.
where is the cdc_subset.c ?
tkx
Click to expand...
Click to collapse
It's in the kernel source. -- You'll have to download the linux or kernel source package that matches the kernel you run on your ubuntu machine, modify your cdc_subset driver, rebuild it, and install it.
Learning things like the kernel build system and how to install a kernel module are exercises for the reader.
Good job! I'll try it once i get my Ubuntu installation up and running again ^_^
Defy and Debian USB network works partially...
Hello. The idea was good...
My config is:
- on one side: a Defy (CM7 1.0-RC1 Nightly build 2037, Gingerbread 2.3.4)
- on the other side: a Linux Debian (Squeeze , kernel 3.0.0-1-686-pae)
I patched the cdc_subset driver as proposed. I saw a little difference on the endpoints: lsusb -v reports 0x83 for 'in' endpoint and 0x2 (bulk) or 0x3 (interrupt) for 'out' endpoint. I tried all combinations and only 0x83/0x2 give a working ping between hosts. => Are the initial endpoints working (0x84/0x3) ?
See attached file for the complete listing, search 'SDX' to see where I patched.
When I plug the USB cable, the usb0 interface is brought up on linux automatically and that's perfect.
With a simple network configuration, ping works on both hosts.
.
So everything seems right.
I then tried to transfer a huge 100MB file to see the performance:
- scp from linux to defy => OK, ~5MB/s
- scp from defy to linux => FAILURE after a few MB transfered
In the second test, the connection is completely frozen and I see errors on both interfaces (ifconfig usb0, error packets). I repeated the test multiple times with alternate network configs, without wifi etc., and I could never transfer the file completely.
Can someone confirm me:
- that the transfer is working for him in both ways with huge files
- what is reported by "lsusb -v -d 22b8:41da" to see if my endpoints for a Defy are correct
I'm not sure, but maybe cdc_subset is not the right driver to patch ?
Or simply it's a bug in scp or sshd on Defy ! I should try with something else like ftp or http...
I keep working on this topic...Thx for any clue !
sdxmob said:
Hello. The idea was good...
My config is:
- on one side: a Defy (CM7 1.0-RC1 Nightly build 2037, Gingerbread 2.3.4)
- on the other side: a Linux Debian (Squeeze , kernel 3.0.0-1-686-pae)
I patched the cdc_subset driver as proposed. I saw a little difference on the endpoints: lsusb -v reports 0x83 for 'in' endpoint and 0x2 (bulk) or 0x3 (interrupt) for 'out' endpoint. I tried all combinations and only 0x83/0x2 give a working ping between hosts. => Are the initial endpoints working (0x84/0x3) ?
See attached file for the complete listing, search 'SDX' to see where I patched.
When I plug the USB cable, the usb0 interface is brought up on linux automatically and that's perfect.
With a simple network configuration, ping works on both hosts.
.
So everything seems right.
I then tried to transfer a huge 100MB file to see the performance:
- scp from linux to defy => OK, ~5MB/s
- scp from defy to linux => FAILURE after a few MB transfered
In the second test, the connection is completely frozen and I see errors on both interfaces (ifconfig usb0, error packets). I repeated the test multiple times with alternate network configs, without wifi etc., and I could never transfer the file completely.
Can someone confirm me:
- that the transfer is working for him in both ways with huge files
- what is reported by "lsusb -v -d 22b8:41da" to see if my endpoints for a Defy are correct
I'm not sure, but maybe cdc_subset is not the right driver to patch ?
Or simply it's a bug in scp or sshd on Defy ! I should try with something else like ftp or http...
I keep working on this topic...Thx for any clue !
Click to expand...
Click to collapse
Any news with defy ?

Windows 7 x64 USB Tethering

Hi,
It seems that I've searched everywhere and tried everything, but I'm unable to get USB tethering to work.
Please correct me if I'm wrong, but this is my understanding of how it should work between Windows 7 64bit and Typhoon's CM7 Android running on the HTC HD2:
Phone Side:
Wired tethering is already available as an option, so simply enable USB tethering by ticking Settings -> Wireless and network settings -> Tethering & portable hotspot -> USB tethering
Windows Side:
Install the correct ADB driver for the HTC HD2. Does this create a new network adapter? I'm assuming a internet connection starts automatically as soon as tethering is enabled on the phone (and this runs via the network adapter)
When I connect the phone via USB, windows is unable to automatically find a driver. Apparently windows already comes prepackaged with a RDNIS driver, but this doesn't seem to work. The phone shows up in device manager under "Other devices" and is listed as "ADB" with a yellow exclamation mark. Where do I find the correct driver to use, and what happens after I've installed the driver. Is it true that the process is automatic, or do I need to right click on the installed adapter and click connect?
Any assistance would be greatly appreciated,
Regards,
XA83
Hi guys. Would really appreciate some tips on this one.
Is nobody using USB tethering on Win7 64?
Regards,
XA83
Hey. I haven't been able to get native USB teathering to work. U can use a app to make it work that seems to be the only way as of now. If you search my posts I posted the apk file.
Sent from my HTC HD2 using XDA Premium App
In the past I've had to search on google for the ADB driver but cannot remember where i found it since I couldnt find it again but a friend just brang their desire hd over and windows 7 found the driver straight away, do u know anyone who would borrow u their android device?
dunno if this helps
http://developer.android.com/sdk/win-usb.html
Thanks for the replies.
I've already installed the Google USB driver (from the developer site listed above). The phone shows up and the ADB driver is installed.
I've also tried installing the wired tethering apk from google apps. It is currently at version 1.4.
HOWEVER, I still don't understand how this is supposed to work as the ADB driver is not listed under networking devices. Surely you need a network driver to able to establish a connection. What am I not understanding?
Regards,
XA83
Hey, just built a new PC for a friend and tried sharing my internet connection using easytether which didnt work because the pc didnt have the correct adb driver. My friend then installed HTC Sync (for her Desire HD) and windows found an adb driver in there. Now the native tethering & easytether on my phone works.
Now I'm not too sure if htc sync has ANYTHING to do with this, or if the driver was downloaded from her desire hd (usb was plugged in already) but I guess you could try downloading htc sync and see what happens.

USB to LAN : Trendnet TUE2-ET100

Hi everybody,
Like video said, I'm noob !
I come from french and surely I'm not the better englishman of france, but I need you and I try to resolv my problem :=)
I have iconia a500, and go with it in holidays.
In my room, only RJ45 for internet, not WiFi... And my lady NEED internet ^^
That's why I try to use this device.
But, when I try to use it... It doesn't works :=/
I've seen that with taboonay it can works but it's rom for 3.2 and I am in 4.03...
Here my configuraiton :
CWM-based Recovery v5.5.0.X(thor2002rorev1.7)
Flexreaper 5.1
I use Trendnet TUE2-ET100 for network adaptator.
Have we one rom who can help me plz ?
I wait your help if it's possible.
Thank you.
Hi,
Nobody can help me ?
It would be probably better to just buy simplest access point out there and use it as a bridge between ethernet cable and wifi . You don't even need router functionality if the tablet will be the only device used. Just buy AP, configure it and just connect the cable to the RJ45 socket and voila.
You will probably need to connect AP to the PC with a cable to configure it but you need to do this only once. You need to configure the wifi name and security (preferably WPA2 PSK).
Hi,
Thank you for you answer !
Can we resolv problem without AP ?
The reason it's that we go to hotel and I bagage is full... xD
With USB analyser software (or application), I can see one information about my LAN adaptator... But it doesn't works when I try to use it.
I don't know if one other kernel can help me or if it's with other custom ROM...
Thank you very much for your help and your solution !
But if we have other possibility it's ok for moi :=)
Merci ;=)
Try the following:
Reboot the tablet (do not connect ethernet adapter yet)
In the terminal emulator display run dmesg (you can dump it with dmesg > /sdcard/dmesg1.txt for comparison)
Connect adapter
Run dmesg again and check for differences at the end (dump it with dmesg > /sdcard/dmesg2.txt and then compare both files).
This will tell if the kernel itself is recognizing the device properly as a networking device. If it doesn't then you need different kernel or kernel module for the current one for this device.
If the device is recognized and the proper kernel module is loaded and still no connectivity then one of the following can be true:
The device doesn't send request to acquire IP from DHCP (dhcp client in the rom not configured to support other devices than the built-in ones).
The device receives the IP, but the routing is not being set so the connection is not set as a default route.
The Android itself doesn't recognize the new interface and apps cannot start the connection using Android API (OS thinks it is offline).
Unfortunatelly I don't know much about how the networking on the application level works in Android and I don't have any USB ethernet adapter to do some tesing myself. I would need to ask some friends if they have one.
Very thanks to your help and sorry for this.
Below results dmesg after plug usb adapter.
Usb 1-1: new high speed usb device number 2 using tegra-ehci
Usb...: new usb device found, idVendor=0b95, idProduct=2,
Usb... : new usb device strings: mfr=1, product=2, serialnumber=3
Usb... : product: ax88772
Usb... : manufacturer: asix elec. Corp.
Usb... : seriaonumber xxxxxx
We can see that android see usb device.
But, when i made <ifconfig>, i can see only the wlan0 interface, no eth0 or other...
Maybe i have to mount it ?
Thanks for your help.
No, you don't mount network devices .
It seems that the tablet is not loading any kernel module for this device. I've done some searching and this device requires usbnet and asix modules to be loaded. I have checked if I have those module in my a500 (running CM9) and I don't have any of them.
I think that you would need to build your own kernel with proper modules to gain support for this adapter.
OMG xD
Build my own kernel
ok ok, let's go, I have already help my father to build house, I can did it !
...
Is it difficult to build kernel ? ^^
Are there any tutoriel for this ? or I need help of xda's members ?
Like other post, thank you for your interest and your help.
Sorry to make you spend time on my case
I'm sorry but my knowledge about compiling kernels is limited to PC Linux. I've never crosscompiled kernels for ARM architecture. It shouldn't be that hard. I think that you will need the Android SDK to do that. Search the dev forum.
I've been thinking about the module itself and you probably don't even need to compile whole kernel. You just need the kernel header files for the kernel you are using and you can probably compile the module alone and then just copy it to device. But you need to ask someone that is more knowledgable in this area than me.
hello, have you managed to build module for ICS or jellybean?
i have the same USB LAN adapter (i'm french too ^^)
Hope to have a positive reply!!!
thanks

NexusHD2 & Reverse Tether

Hi everyone i'm trying to use the reverse tether app with my NexusHD2 2.4. The app seems legit but the problem is located to the device drivers.
I'm running Windows 7 ultimate x64. Currently my device is recognized as Android Composite ADB interface
Even normal tethering is not connecting and i get a usb fail.
i've read that i need the Remote NDIS based internet sharing device driver to work i was unable to find one working.
Is there anyone solved this problem. If yes please provide the appropriate drivers.
Thanks a lot
p.s. Yes, i really really need usb reverse tethering and no there it to possibility to share through wifi.
I think that unfortunately currently is not possible to do that, but if you use the search maybe you can find some help.

[Help] I need install Wireless Dongle driver on Huawei nove 2i with [RTL88x2BU]

Ask for help I want to install Wireless Dongle driver on android device. I have a driver file. But I can't install it. I want a simple guide step by step on linux
I have a picture preview. Have driver file Please check it for me About how I can install as easily as possible. Thank you very much
My devices
huawei nova 2i android 8.0 (Oreo)
android box CS918 Rockchip android 4.4 (KitKat)
Equipment is not the same But I think the driver installation method should be the same.
Driver Link + Guide [RTL88x2BU_WiFi_linux_v5.2.4.4]
https://www.mediafire.com/file/94b5wkvj41g1bla/RTL88x2BU_WiFi_linux_v5.2.4.4.rar/file
surathus said:
Ask for help I want to install Wireless Dongle driver on android device. I have a driver file. But I can't install it. I want a simple guide step by step on linux
I have a picture preview. Have driver file Please check it for me About how I can install as easily as possible. Thank you very much
My devices
huawei nova 2i android 8.0 (Oreo)
android box CS918 Rockchip android 4.4 (KitKat)
Equipment is not the same But I think the driver installation method should be the same.
Driver Link + Guide [RTL88x2BU_WiFi_linux_v5.2.4.4]
https://www.mediafire.com/file/94b5wkvj41g1bla/RTL88x2BU_WiFi_linux_v5.2.4.4.rar/file
Click to expand...
Click to collapse
You'd need to add support to kernel if you want to use the dongle on your phone over OTG.
There is a experimental entry in Kconfig for Realtek devices which have not been tested, enabling that might work. Else you will have to add support yourself.
Either way you'll need to compile your own kernel for it.
Have you tested by simply inserting OTG and dongle and see what happens?
Since phone has wifi already (I guess) it might not work if internal is interfering with external.
ante0 said:
You'd need to add support to kernel if you want to use the dongle on your phone over OTG.
There is a experimental entry in Kconfig for Realtek devices which have not been tested, enabling that might work. Else you will have to add support yourself.
Either way you'll need to compile your own kernel for it.
Have you tested by simply inserting OTG and dongle and see what happens?
Since phone has wifi already (I guess) it might not work if internal is interfering with external.
Click to expand...
Click to collapse
Thanks for the info
repeatedly
Who can get the files that I posted? Can be created as a driver Thank you very much
surathus said:
Who can get the files that I posted? Can be created as a driver Thank you very much
Click to expand...
Click to collapse
I had to add that driver to several linux kernels that i use on my machines (Ubuntu and OpenElec).
Never tested on my Mate 10 Pro, or any other Android device.
However, adding that to the kernel would require some work and i'm not even sure it works fine on android.
Here's a link to my github - > https://github.com/pretoriano80/RTL8822BU
Pretoriano80 said:
I had to add that driver to several linux kernels that i use on my machines (Ubuntu and OpenElec).
Never tested on my Mate 10 Pro, or any other Android device.
However, adding that to the kernel would require some work and i'm not even sure it works fine on android.
Here's a link to my github - > https://github.com/pretoriano80/RTL8822BU
Click to expand...
Click to collapse
thank alot for your help..
...Oh, I forgot to say that My device The model name really is named Realtek 8811CU Wireless Lan 802.11ac USB NIC.
I use the 8811CU driver installed on linux. It can connect and use normally. But the driver that came with the device The name is back. This model is RTL88x2BU. Will it work as well with the links you recommend?
surathus said:
thank alot for your help..
...Oh, I forgot to say that My device The model name really is named Realtek 8811CU Wireless Lan 802.11ac USB NIC.
I use the 8811CU driver installed on linux. It can connect and use normally. But the driver that came with the device The name is back. This model is RTL88x2BU. Will it work as well with the links you recommend?
Click to expand...
Click to collapse
Then probably this - > https://github.com/brektrou/rtl8821CU <- should work for your device.
Pretoriano80 said:
Then probably this - > https://github.com/brektrou/rtl8821CU <- should work for your device.
Click to expand...
Click to collapse
What do I have to do? help guide step-by-step That can help teach me
Right now it works great on linux & windows 10 but can not running on adroid devices.
surathus said:
What do I have to do? help guide step-by-step That can help teach me
Right now it works great on linux & windows 10 but can not running on adroid devices.
Click to expand...
Click to collapse
There is no easy way to do that. First you will have to check if your kernel has support for that Realtek driver and it it does, enable it (as ante0 said).
If it doesn't have support for that driver, then first compile the kernel from sources (without any modification to the source) and check if your device will boot, if it doesn't, then you can stop here and forget about adding that driver to the kernel.
If it does boot with the compiled kernel, then you will have to add the driver to the source code and here, again, there's no guarantee it will work. (compilation might fail or simply, the kernel builds just fine but the driver won't work... like i said, there's no easy way for this).
In my opinion, you better start searching on GitHub for an android kernel that already has support for that driver, but you will also have to check the kernel version (if it matches yours, then you have higher chances to port it for your device's kernel).
Best option : Buy a Wi-Fi adapter that have in-kernel support already.
Pretoriano80 said:
There is no easy way to do that. First you will have to check if your kernel has support for that Realtek driver and it it does, enable it (as ante0 said).
If it doesn't have support for that driver, then first compile the kernel from sources (without any modification to the source) and check if your device will boot, if it doesn't, then you can stop here and forget about adding that driver to the kernel.
If it does boot with the compiled kernel, then you will have to add the driver to the source code and here, again, there's no guarantee it will work. (compilation might fail or simply, the kernel builds just fine but the driver won't work... like i said, there's no easy way for this).
In my opinion, you better start searching on GitHub for an android kernel that already has support for that driver, but you will also have to check the kernel version (if it matches yours, then you have higher chances to port it for your device's kernel).
Best option : Buy a Wi-Fi adapter that have in-kernel support already.
Click to expand...
Click to collapse
Thanks again

Categories

Resources