[Driver] Asix AX88772 kernel module (USB Ethernet)

Search This thread

kevinf28

Senior Member
Oct 29, 2012
109
39
Hello, this is my first dev posting, so let me know if there is anything missing...

I have a Samsung Galaxy SIII S3 SGH-I747M (Bell) with Jelly Bean 4.1.1 kernel 3.0.31 (stock rooted, root66_BMC_I747MVLDLK4.7z). I also have an Asix USB LAN adapter (from monoprice) + USB OTG cable which did not work out of the box... but i am a software engineer... so I made it work. The process below should work for other carriers / modules if you find the proper kernel source. Compiling latest drivers directly from Asix is the best method... Read that part first!

Read the README that comes with your kernel source, you may need a different compiler! https://github.com/AdiPat/Android_Toolchains is where I got mine...

Details about the Asix AX88772 USB lan RJ45 adapter chipset can be found here:
http://www.asix.com.tw/products.php?op=pItemdetail&PItemID=86;71;101

You can skip to "Usage instructions" section and download pre-compiled modules, if you have identical kernel + phone

built from SGH-I747M_BMC_JB_Opensource.zip (I747MVLDLK4, my phone) + latest Asix driver, works great!!!
https://www.dropbox.com/sh/3lrhwdf2vxe5z90/Hr3-nYX4Ff

built from SGH-I747M_BMC_JB_Opensource.zip (I747MVLDLK4, my phone) stock kernel driver, 'insmod's, but 'ping' is flaky?
https://www.dropbox.com/sh/u068760ytpsn0k1/3di6Wg44ja

built from GT-I930_JB_Opensource_Update7.zip (I9300XXELLA, requested by gingerneil), stock kernel driver, works great!!!
https://www.dropbox.com/sh/5emvafthv061fp6/BKcakiOie8

built from GT-I930_JB_Opensource_Update8.zip (EMR2, requested by gingerneil), stock kernel driver, untested
https://www.dropbox.com/sh/rmc1n4yxckg01zy/a2V5hvIp20

built from Cyanogenmod 10 for i9300, git commit 43aaedbcde478c8e032771d62a1956133b29b1d4, untested
https://www.dropbox.com/sh/n1tdiap4pi2vzm8/TKAj_lChXA

built from Android 4.1.1 for Galaxy Tab 2 (GT-P5110) kernel 3.0.31-523998, contact 'patelkes' if you have questions.
https://www.dropbox.com/sh/r0zkg5do2n3lyg3/fWWyhsz2qy

built from Android 4.? for Xperia Tablet Z ROM (10.3.1.C.0.136), contact 'kristouf666' if you have questions.
https://www.dropbox.com/sh/nxqo1ipkbojakls/eDLHXJzl5s

built from Cyanogenmod 10.1.3 for SGH-i747m, git commit ?
Work in progress


Build environment setup:

-Get root access on a Ubuntu Natty (11.04) or similar linux build machine / virtual machine
-Install standard unix compiler tools
apt-get install build-essential​
-Install library for menuconfig
apt-get install libncurses5-dev​
-Install lzop (android compression util)
apt-get install lzop​
-Install git
apt-get install git​
-Download Android toolchains using git
-Download samsung kernel SGH-I747M_BMC_JB_Opensource.zip (international model, etc, also available)... Or download your 3rd party Cyanogenmod,etc kernel SOURCE instead.
-Extract to /root/kernel
mkdir /root/kernel
cd /root/kernel
unzip SGH-I747M_BMC_JB_Opensource.zip
-Set path so Android compiler can be found
export CROSS_COMPILE=/root/Android_Toolchains/arm-eabi-4.4.3/bin/arm-eabi-
**EDIT: newer kernels, such as Cyanogenmod 10.2.1, use this
export CROSS_COMPILE=/root/Android_Toolchains/arm-eabi-4.6/bin/arm-eabi-


Compiling built-in kernel modules: (left for documentation sake, the better method is "Compiling latest drivers directly from Asix")

-Generate '.config' file in kernel folder (replace 'm2_att_defconfig' with name of file in 'arch\arm\configs\')
make arch=arm m2_att_defconfig​
-Modify kernel config to include Asix module and usbnet module
make menuconfig
[Navigate using arrow keys and enter]
Device Drivers ->
Network device support ->
USB Network Adapters ->
Multi-Purpose USB Networking Framework ->
[PRESS SPACEBAR until an M appears on the left]
[M] Multi-purpose USB Networking Framework
[M] ASIX AX88xxx Based USB 2.0 Ethernet Adapters

For reference here is the help info for the 2 options that are now set to 'M'

-Compile modules, where 2 is the number of CPU cores you have (speeds it up)
make -j2 && make -j2 modules
-Once finished, grab your modules
/root/kernel/drivers/net/usb/usbnet.ko
/root/kernel/drivers/net/usb/asix.ko


Usage instructions:

-Use a root explorer such as ES File manager
Mount /system as rw in ES File manager root settings
copy asix.ko and usbnet.ko to /system/lib/modules/
-Use a terminal emulator / adb shell to load modules (asix depends on usbnet, so load usbnet first)
su
cd /system/lib/modules
insmod usbnet.ko
insmod asix.ko
-If there are errors, run 'dmesg' and see section called "Insmod errors"
-If there are no errors, you should see 'eth0' in 'netcfg'
-'lsmod' lists modules loaded
-Connect your USB ethernet adapter to an ethernet network
-netcfg should show eth0 as connected
-Setup ethernet settings, if you want static address, for typical internet router at 192.168.1.1
ifconfig eth0 192.168.1.100 netmask 255.255.255.0
route add default gw 192.168.1.1 dev eth0
setprop net.dns1 192.168.1.1
ip addr show
ip route show
-Setup ethernet settings, if you want automatic dhcp address
dhcpcd eth0
-If you want one-click enable of your USB, see section "usbnet widget"

Insmod errors:

exec format error : wrong compiler / wrong kernel source / wrong phone
init_module failed usbnet.ko (file exists) : module already loaded or built into kernel
no such file or directory : run dmesg immediately after attempt... you are missing module dependency
can't open usbnet.ko : are you root?

usbnet widget


Install Smanager
Download my usbnet script http://pastebin.com/zQRQ6Kdj
Use a quality notepad editor such as notepad ++ to edit, ensure line endings are "Unix"
Place in /system/lib/modules/usbnet *cannot be on sdcard, as sdcard is a windows filesystem*
In terminal emulator / adb: "chmod 777 /system/lib/modules/usbnet"
Open Smanager
-Menu -> Scripts
-Menu -> Browser -> /system/lib/modules/usbnet
-Ensure "Fav", "SU" and "is executable" are checked and give it a name 'usbnet', press save.
On homescreen, add widget, Smanager, pick your script 'usbnet'
You now have 1 click access to loading the modules, setting IP address, and testing connectivity to your router.

GT-9300 differences (thanks gingerneil)
Kernel source
GT-I930_JB_Opensource_Update7.zip​

While building the kernel, the make config step is different
make arch=arm m0_00_defconfig​

There is a third module built,
/root/kernel/drivers/net/mii.ko​

Usage instructions, new order of operations

insmod mii.ko
insmod usbnet.ko
insmod asix.ko​

/system/lib/modules is not persistent on this phone, instead store modules + usbnet script
/system/media​

Compiling latest drivers directly from Asix

For some reason on my phone the stock kernel asix module did not work 100%.
I could insmod both modules, and using Wireshark, I verified my computer was receiving 'ping' packets, but the phone wasn't getting any 'ping reply' packets. This latest Asix driver works perfectly for me.

UPDATE:: http://www.asix.com.tw/FrootAttach/...0_772_178_LINUX_DRIVER_v4.13.0_Source.tar.bz2 is available, but I have not tried it!


Follow "Environment setup" above

Code:
cd kernel_src_folder

Generate kernel '.config' file (replace 'm2_att_defconfig' with name of file in 'arch\arm\configs\')

Code:
make arch=arm m2_att_defconfig

Code:
mkdir /root/asix && cd /root/asix

Code:
wget http://www.asix.com.tw/FrootAttach/driver/AX88772B_772A_760_772_178_LINUX_Driver_v4.4.1_Source.zip

Code:
unzip AX88772B_772A_760_772_178_LINUX_Driver_v4.4.1_Source.zip

Code:
rm -rf Makefile

# we are replacing the Makefile with a new one.... if you edit, ensure indents = TABS
Code:
wget [url]http://pastebin.com/raw.php?i=4xLxksX3[/url] -O Makefile

Code:
CROSS_COMPILE=/root/Android_Toolchains/arm-eabi-4.4.3/bin/arm-eabi- make
**EDIT: newer kernels, such as Cyanogenmod 10.2.1, use this
Code:
CROSS_COMPILE=/root/Android_Toolchains/arm-eabi-4.6/bin/arm-eabi- make

Follow the "usage instructions" above, but since this is an "all-in-one" module, remove references to 'usbnet'


Other informational Links

Thanks to viulian for his inspirational post here in regards to compiling external module.

If you want to compare your phone's kernel configuration to the one in the download source from Samsung, read this post:

To see the list of loadable and built-in modules, see this.

More information about compiling kernel modules / asix / other usb chipsets / other devices

Did you know that Asix now manages Moschip products? Looking for MCS7830 drivers?

Thanks to zhlvf for pointing this , there is a way to hack android to think Wifi is connected when an USB ethernet is plugged in... (solves issues in some apps, like google play / market, which ignore USB ethernet as a valid connection).

Make errors documentation

Model number and version code explanation (how to tell which samsung.opensource.com zip file to download)

https://www.kernel.org/doc/Documentation/kbuild/modules.txt

To get the active .config from a Cyanogen mod android,
Code:
adb pull /proc/config.gz
 
Last edited:

gingerneil

Senior Member
Nov 14, 2012
131
27
Usage instructions:

-Use a root explorer such as ES File manager
Mount /system as rw in ES File manager root settings
copy asix.ko and usbnet.ko to /system/lib/modules/
-Use a terminal emulator / adb shell to load modules (asix depends on usbnet, so load usbnet first)
su
cd /system/lib/modules
insmod usbnet.ko
insmod asix.ko
-If there are errors, run 'dmesg'
-If there are no errors, you should see 'eth0' in 'netcfg'
-Connect your USB ethernet adapter to an ethernet network
-netcfg should show eth0 as connected
-Setup ethernet settings, if you want static address, for typical internet router at 192.168.1.1
ifconfig eth0 192.168.1.100 netmask 255.255.255.0
route add default gw 192.168.1.1 dev eth0
setprop net.dns1 192.168.1.1
-Setup ethernet settings, if you want automatic dhcp address
dhcpd eth0

Hi,
I have tried to insert your modules (I have the 3.0.31 kernel on the international S3) - but I get "exec format error". This is after placing your files in right place, and running under root through terminal emulator. Any idea why I am getting this error, and how to get around it ?
 

kevinf28

Senior Member
Oct 29, 2012
109
39
Hi,
I have tried to insert your modules (I have the 3.0.31 kernel on the international S3) - but I get "exec format error". This is after placing your files in right place, and running under root through terminal emulator. Any idea why I am getting this error, and how to get around it ?

Unfortunately, you are not running an "identical" kernel. Linux is particularly fussy with kernel modules, it has to be a perfect match.

Android takes a generic 3.0.31 linux kernel and applies device specific patches. So my i747 3.0.31 kernel is not identical to your i9300 3.0.31.

I can build the modules for you, since I already have the environment setup. Please visit http://opensource.samsung.com/reception/receptionSub.do?method=search&searchValue=i9300 and let me know which one sounds correct..
 

gingerneil

Senior Member
Nov 14, 2012
131
27
I can build the modules for you, since I already have the environment setup. Please visit http://opensource.samsung.com/reception/receptionSub.do?method=search&searchValue=i9300 and let me know which one sounds correct..

That would be fantastic - thanks. I am running the internation i9300 - so I would go with the top one -
GT-I9300_JB_Opensource_Update7.zip
But I'm not sure what may be different across the updates.
I assume that is doesnt matter which ROM I am running, and that a full Rom Manager backup would also backup my stock kernel ?
 

kevinf28

Senior Member
Oct 29, 2012
109
39
That would be fantastic - thanks. I am running the internation i9300 - so I would go with the top one -
GT-I9300_JB_Opensource_Update7.zip
But I'm not sure what may be different across the updates.
I assume that is doesnt matter which ROM I am running, and that a full Rom Manager backup would also backup my stock kernel ?

Kernel loadable modules are completely inert by themselves, so there is no need to worry about your phone bricking [but a backup never hurts].

If you build modules into the kernel itself on the other hand, its possible for the kernel to fail / panic / etc, so I don't plan on building any kernel packages.

Please see the OP for the 9300 modules. Hope they work! What is your full kernel version string and baseband version from "About Device" page?
 

gingerneil

Senior Member
Nov 14, 2012
131
27
Kernel loadable modules are completely inert by themselves, so there is no need to worry about your phone bricking [but a backup never hurts].

If you build modules into the kernel itself on the other hand, its possible for the kernel to fail / panic / etc, so I don't plan on building any kernel packages.

Please see the OP for the 9300 modules. Hope they work! What is your full kernel version string and baseband version from "About Device" page?

It's giving a ' no such file or directory' error - even though the files are there and I'm running insmod from the dir as su. See terminal screen shot. thanks for the help!
 

Attachments

  • 13-02-04-09-43-45.jpg
    13-02-04-09-43-45.jpg
    61.5 KB · Views: 2,449
  • Screenshot_2013-02-04-21-27-481.jpg
    Screenshot_2013-02-04-21-27-481.jpg
    82.2 KB · Views: 2,218
Last edited:

gingerneil

Senior Member
Nov 14, 2012
131
27
I updated the OP with insmod errors

It does look like GT-I9300_JB_Opensource_Update7.zip JB 4.1.2 matches your I9300XXELLA baseband version.

http://www.androidgalaxys.net/news-...gente-samsung-per-galaxy-s3-di-android-4-1-2/
http://www.androidgalaxys.net/appro...punto-esclamativo-rosso-come-nuovo-controllo/

Thanks - so it looks like I have some module dependancy issues. I'll take a look at dmesg and see whats going on. Seems strange though, if the zip does match everything...
Maybe I should go back to a stock ROM as I am currently running a de-odexed stock.
 

kevinf28

Senior Member
Oct 29, 2012
109
39
Thanks - so it looks like I have some module dependancy issues. I'll take a look at dmesg and see whats going on. Seems strange though, if the zip does match everything...
Maybe I should go back to a stock ROM as I am currently running a de-odexed stock.

It may be something trival, perhaps there is a third module you need for the international version.. I can't load your modules to test them, I get the exec format error :p. In regular linux, ldd is an amazing tool to list all the module deps, but unfortunately, it doesn't work for ARM, and arm-eabi-ldd does not exist in my toolchain.

[Edit: I have edited the OP, I rebuilt the modules and they do have some binary differences... give them a try as well]
 
Last edited:

gingerneil

Senior Member
Nov 14, 2012
131
27
It may be something trival, perhaps there is a third module you need for the international version.. I can't load your modules to test them, I get the exec format error :p. In regular linux, ldd is an amazing tool to list all the module deps, but unfortunately, it doesn't work for ARM, and arm-eabi-ldd does not exist in my toolchain.

[Edit: I have edited the OP, I rebuilt the modules and they do have some binary differences... give them a try as well]

Thanks - I'll give them a go. I went back to stock LLA ROM and it still didnt work.

---------- Post added at 03:24 PM ---------- Previous post was at 03:22 PM ----------

Just curious... what are you using the USB-LAN adapter for with the USB-OTG?

I'd like to use it for syncing files from my server without having to dig out my laptop to piggy back of its ethernet. Films can take an age to copy over wifi compared to LAN.
 

gingerneil

Senior Member
Nov 14, 2012
131
27
Having another go at getting the modules in. I am setting up the environment with the aim of compiling with the modules in and flashing the full kernel rather than adding via insmod....
 

gingerneil

Senior Member
Nov 14, 2012
131
27
Cool. README_Kernel.txt is important, the make configure step is slightly different.

OK - will see how I get on. Any tips would be great, as this will be my first attempt at compiling! The only linux based system I have it a raspberry pi connected to my TV running raspbmc. Currently seems to be running through the steps ok though.
 
Last edited:

kevinf28

Senior Member
Oct 29, 2012
109
39
Dmesg log attached - couldnt see how to attach on a pm!

Easy one, you are missing the 'mii' module,

<4>[ 3929.962119] c1 usbnet: Unknown symbol mii_nway_restart (err 0)
<4>[ 3929.962173] c1 usbnet: Unknown symbol mii_link_ok (err 0)
<4>[ 3929.962225] c1 usbnet: Unknown symbol mii_ethtool_sset (err 0)
<4>[ 3929.962270] c1 usbnet: Unknown symbol mii_ethtool_gset (err 0)

The pastebin link http://pastebin.com/wNaBWvZG references "Selects: MII [=m]"

On my phone, it didn't complain about mii, so i didn't think it was needed
https://www.dropbox.com/sh/5emvafthv061fp6/BKcakiOie8 has mii.ko, so load that first, then usbnet, then asix.

I also updated the OP to include a usbnet widget for one click module loading... that script would have to be modified to include insmod mii.ko
 

gingerneil

Senior Member
Nov 14, 2012
131
27
Easy one, you are missing the 'mii' module,

<4>[ 3929.962119] c1 usbnet: Unknown symbol mii_nway_restart (err 0)
<4>[ 3929.962173] c1 usbnet: Unknown symbol mii_link_ok (err 0)
<4>[ 3929.962225] c1 usbnet: Unknown symbol mii_ethtool_sset (err 0)
<4>[ 3929.962270] c1 usbnet: Unknown symbol mii_ethtool_gset (err 0)

The pastebin link http://pastebin.com/wNaBWvZG references "Selects: MII [=m]"

On my phone, it didn't complain about mii, so i didn't think it was needed
https://www.dropbox.com/sh/5emvafthv061fp6/BKcakiOie8 has mii.ko, so load that first, then usbnet, then asix.

I also updated the OP to include a usbnet widget for one click module loading... that script would have to be modified to include insmod mii.ko

Fantastic - mods loaded, will test when I get home. Thanks too for the widget script!
 

gingerneil

Senior Member
Nov 14, 2012
131
27
Mods loaded and ethernet up and running - brilliant!
Only one issue now - I can't get the script to persist after a reboot unless it's somewhere like /sdcard0/download or on the extsdcard. It just gets deleted. I then can't get it to execute from there as I can't change the permission. Need to keep fiddling to find something that works. Minor issue tho!
 

kevinf28

Senior Member
Oct 29, 2012
109
39
Do the mods persist in /system/lib/modules ?

What about /data? That is your sdcard as ext4.

If all else fails...have you tried remounting /system as read only to force writes to disk? (Cache issue)

Sent from my SGH-I747M using xda app-developers app
 

Top Liked Posts

  • There are no posts matching your filters.
  • 19
    Hello, this is my first dev posting, so let me know if there is anything missing...

    I have a Samsung Galaxy SIII S3 SGH-I747M (Bell) with Jelly Bean 4.1.1 kernel 3.0.31 (stock rooted, root66_BMC_I747MVLDLK4.7z). I also have an Asix USB LAN adapter (from monoprice) + USB OTG cable which did not work out of the box... but i am a software engineer... so I made it work. The process below should work for other carriers / modules if you find the proper kernel source. Compiling latest drivers directly from Asix is the best method... Read that part first!

    Read the README that comes with your kernel source, you may need a different compiler! https://github.com/AdiPat/Android_Toolchains is where I got mine...

    Details about the Asix AX88772 USB lan RJ45 adapter chipset can be found here:
    http://www.asix.com.tw/products.php?op=pItemdetail&PItemID=86;71;101

    You can skip to "Usage instructions" section and download pre-compiled modules, if you have identical kernel + phone

    built from SGH-I747M_BMC_JB_Opensource.zip (I747MVLDLK4, my phone) + latest Asix driver, works great!!!
    https://www.dropbox.com/sh/3lrhwdf2vxe5z90/Hr3-nYX4Ff

    built from SGH-I747M_BMC_JB_Opensource.zip (I747MVLDLK4, my phone) stock kernel driver, 'insmod's, but 'ping' is flaky?
    https://www.dropbox.com/sh/u068760ytpsn0k1/3di6Wg44ja

    built from GT-I930_JB_Opensource_Update7.zip (I9300XXELLA, requested by gingerneil), stock kernel driver, works great!!!
    https://www.dropbox.com/sh/5emvafthv061fp6/BKcakiOie8

    built from GT-I930_JB_Opensource_Update8.zip (EMR2, requested by gingerneil), stock kernel driver, untested
    https://www.dropbox.com/sh/rmc1n4yxckg01zy/a2V5hvIp20

    built from Cyanogenmod 10 for i9300, git commit 43aaedbcde478c8e032771d62a1956133b29b1d4, untested
    https://www.dropbox.com/sh/n1tdiap4pi2vzm8/TKAj_lChXA

    built from Android 4.1.1 for Galaxy Tab 2 (GT-P5110) kernel 3.0.31-523998, contact 'patelkes' if you have questions.
    https://www.dropbox.com/sh/r0zkg5do2n3lyg3/fWWyhsz2qy

    built from Android 4.? for Xperia Tablet Z ROM (10.3.1.C.0.136), contact 'kristouf666' if you have questions.
    https://www.dropbox.com/sh/nxqo1ipkbojakls/eDLHXJzl5s

    built from Cyanogenmod 10.1.3 for SGH-i747m, git commit ?
    Work in progress


    Build environment setup:

    -Get root access on a Ubuntu Natty (11.04) or similar linux build machine / virtual machine
    -Install standard unix compiler tools
    apt-get install build-essential​
    -Install library for menuconfig
    apt-get install libncurses5-dev​
    -Install lzop (android compression util)
    apt-get install lzop​
    -Install git
    apt-get install git​
    -Download Android toolchains using git
    -Download samsung kernel SGH-I747M_BMC_JB_Opensource.zip (international model, etc, also available)... Or download your 3rd party Cyanogenmod,etc kernel SOURCE instead.
    -Extract to /root/kernel
    mkdir /root/kernel
    cd /root/kernel
    unzip SGH-I747M_BMC_JB_Opensource.zip
    -Set path so Android compiler can be found
    export CROSS_COMPILE=/root/Android_Toolchains/arm-eabi-4.4.3/bin/arm-eabi-
    **EDIT: newer kernels, such as Cyanogenmod 10.2.1, use this
    export CROSS_COMPILE=/root/Android_Toolchains/arm-eabi-4.6/bin/arm-eabi-


    Compiling built-in kernel modules: (left for documentation sake, the better method is "Compiling latest drivers directly from Asix")

    -Generate '.config' file in kernel folder (replace 'm2_att_defconfig' with name of file in 'arch\arm\configs\')
    make arch=arm m2_att_defconfig​
    -Modify kernel config to include Asix module and usbnet module
    make menuconfig
    [Navigate using arrow keys and enter]
    Device Drivers ->
    Network device support ->
    USB Network Adapters ->
    Multi-Purpose USB Networking Framework ->
    [PRESS SPACEBAR until an M appears on the left]
    [M] Multi-purpose USB Networking Framework
    [M] ASIX AX88xxx Based USB 2.0 Ethernet Adapters

    For reference here is the help info for the 2 options that are now set to 'M'

    -Compile modules, where 2 is the number of CPU cores you have (speeds it up)
    make -j2 && make -j2 modules
    -Once finished, grab your modules
    /root/kernel/drivers/net/usb/usbnet.ko
    /root/kernel/drivers/net/usb/asix.ko


    Usage instructions:

    -Use a root explorer such as ES File manager
    Mount /system as rw in ES File manager root settings
    copy asix.ko and usbnet.ko to /system/lib/modules/
    -Use a terminal emulator / adb shell to load modules (asix depends on usbnet, so load usbnet first)
    su
    cd /system/lib/modules
    insmod usbnet.ko
    insmod asix.ko
    -If there are errors, run 'dmesg' and see section called "Insmod errors"
    -If there are no errors, you should see 'eth0' in 'netcfg'
    -'lsmod' lists modules loaded
    -Connect your USB ethernet adapter to an ethernet network
    -netcfg should show eth0 as connected
    -Setup ethernet settings, if you want static address, for typical internet router at 192.168.1.1
    ifconfig eth0 192.168.1.100 netmask 255.255.255.0
    route add default gw 192.168.1.1 dev eth0
    setprop net.dns1 192.168.1.1
    ip addr show
    ip route show
    -Setup ethernet settings, if you want automatic dhcp address
    dhcpcd eth0
    -If you want one-click enable of your USB, see section "usbnet widget"

    Insmod errors:

    exec format error : wrong compiler / wrong kernel source / wrong phone
    init_module failed usbnet.ko (file exists) : module already loaded or built into kernel
    no such file or directory : run dmesg immediately after attempt... you are missing module dependency
    can't open usbnet.ko : are you root?

    usbnet widget


    Install Smanager
    Download my usbnet script http://pastebin.com/zQRQ6Kdj
    Use a quality notepad editor such as notepad ++ to edit, ensure line endings are "Unix"
    Place in /system/lib/modules/usbnet *cannot be on sdcard, as sdcard is a windows filesystem*
    In terminal emulator / adb: "chmod 777 /system/lib/modules/usbnet"
    Open Smanager
    -Menu -> Scripts
    -Menu -> Browser -> /system/lib/modules/usbnet
    -Ensure "Fav", "SU" and "is executable" are checked and give it a name 'usbnet', press save.
    On homescreen, add widget, Smanager, pick your script 'usbnet'
    You now have 1 click access to loading the modules, setting IP address, and testing connectivity to your router.

    GT-9300 differences (thanks gingerneil)
    Kernel source
    GT-I930_JB_Opensource_Update7.zip​

    While building the kernel, the make config step is different
    make arch=arm m0_00_defconfig​

    There is a third module built,
    /root/kernel/drivers/net/mii.ko​

    Usage instructions, new order of operations

    insmod mii.ko
    insmod usbnet.ko
    insmod asix.ko​

    /system/lib/modules is not persistent on this phone, instead store modules + usbnet script
    /system/media​

    Compiling latest drivers directly from Asix

    For some reason on my phone the stock kernel asix module did not work 100%.
    I could insmod both modules, and using Wireshark, I verified my computer was receiving 'ping' packets, but the phone wasn't getting any 'ping reply' packets. This latest Asix driver works perfectly for me.

    UPDATE:: http://www.asix.com.tw/FrootAttach/...0_772_178_LINUX_DRIVER_v4.13.0_Source.tar.bz2 is available, but I have not tried it!


    Follow "Environment setup" above

    Code:
    cd kernel_src_folder

    Generate kernel '.config' file (replace 'm2_att_defconfig' with name of file in 'arch\arm\configs\')

    Code:
    make arch=arm m2_att_defconfig

    Code:
    mkdir /root/asix && cd /root/asix

    Code:
    wget http://www.asix.com.tw/FrootAttach/driver/AX88772B_772A_760_772_178_LINUX_Driver_v4.4.1_Source.zip

    Code:
    unzip AX88772B_772A_760_772_178_LINUX_Driver_v4.4.1_Source.zip

    Code:
    rm -rf Makefile

    # we are replacing the Makefile with a new one.... if you edit, ensure indents = TABS
    Code:
    wget [url]http://pastebin.com/raw.php?i=4xLxksX3[/url] -O Makefile

    Code:
    CROSS_COMPILE=/root/Android_Toolchains/arm-eabi-4.4.3/bin/arm-eabi- make
    **EDIT: newer kernels, such as Cyanogenmod 10.2.1, use this
    Code:
    CROSS_COMPILE=/root/Android_Toolchains/arm-eabi-4.6/bin/arm-eabi- make

    Follow the "usage instructions" above, but since this is an "all-in-one" module, remove references to 'usbnet'


    Other informational Links

    Thanks to viulian for his inspirational post here in regards to compiling external module.

    If you want to compare your phone's kernel configuration to the one in the download source from Samsung, read this post:

    To see the list of loadable and built-in modules, see this.

    More information about compiling kernel modules / asix / other usb chipsets / other devices

    Did you know that Asix now manages Moschip products? Looking for MCS7830 drivers?

    Thanks to zhlvf for pointing this , there is a way to hack android to think Wifi is connected when an USB ethernet is plugged in... (solves issues in some apps, like google play / market, which ignore USB ethernet as a valid connection).

    Make errors documentation

    Model number and version code explanation (how to tell which samsung.opensource.com zip file to download)

    https://www.kernel.org/doc/Documentation/kbuild/modules.txt

    To get the active .config from a Cyanogen mod android,
    Code:
    adb pull /proc/config.gz
    1
    They don't persist in the modules folder. I've put them, and the script, in /system/media/usbnet and all seems fine. I have a shortcut to the script created using Root Explorer on the front page. All working great!
    1
    I'm very interested to get this working on my international version of the i9300. My ROM is Android 4.1.2 build XXEMR2. What build, version and kernel are you running that let you insmod the driver files?

    You have to go through http://opensource.samsung.com/reception/receptionSub.do?method=search&searchValue=i9300 and try to find which one matches your kernel + baseband.

    http://xdaforums.com/showpost.php?p=37591202&postcount=6 is his stats
    1
    It's very odd. I'm not a Linux expert, but the error doesn't make sense.
    I'm using the downloads linked in #37 above. Thanks for trying it - really appreciated!

    For starters, you have to use the git utility... At least for me, unzipping that archive gave me a host of errors:
    Code:
    symlink error: File name too long
      android_kernel_samsung_smdk4412-43aaedbcde478c8e032771d62a1956133b29b1d4/net/s                                                                                                             unrpc/auth_null.c -> /*^J * linux/net/sunrpc/auth_null.c^J *^J * AUTH_NULL authe

    I got the module to compile (although it was finicky... ), I am unable to build the full CM10 kernel (eg: 'make all' aka 'make'). I think the CM team has made a mess of the kernel.

    You should be able to do the following... if not, your build system is borked. I dont know.
    cd /root/git
    git clone https://github.com/CyanogenMod/android_kernel_samsung_smdk4412.git
    cd android_kernel_samsung_smdk4412
    git checkout 43aaedbcde478c8e032771d62a1956133b29b1d4
    ARCH=arm CROSS_COMPILE=/root/git/Android_Toolchains/arm-eabi-4.4.3/bin/arm-eabi- make cyanogenmod_i9300_defconfig
    ARCH=arm CROSS_COMPILE=/root/git/Android_Toolchains/arm-eabi-4.4.3/bin/arm-eabi- make modules_prepare
    cd /root/asix
    nano Makefile [point kernel path to /root/git/android_kernel_samsung_smdk4412]
    ARCH=arm CROSS_COMPILE=/root/git/Android_Toolchains/arm-eabi-4.4.3/bin/arm-eabi- make​

    I added my compiled CM10 module to the OP.
    1
    Still having the same issues with the environment. I've gone back to trying to build the samsung kernel, using the latest update, but it still fails in the same way. :(

    Did you try my pre-compiled CM10 module?