What's new

Has Anyone managed to compile r8152.ko driver for the RT-AX86U Pro, help really appreciated

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

DonCom

New Around Here
Hello everyone,

So for about 3 days I’ve been trying to compile the r8152.ko driver for the AX86u Pro unsuccessfully. I have a Realtek based usb adapter specifically RTL8156BG chipset. I’ve read and researched every post on the forums regarding using the usb as another Ethernet port. Reason I need this is because I have 1.8Gbit internet connection and only one 2.5Gbit WAN/LAN port. I originally wanted to use LACP/802.3ad mode 4 to the 2.5Gbit switch but even with a 2.5Gbit NIC on a PC I could only obtain 1Gbit from the switch connected to the AX86U Pro with two Ethernet cables configured as LACP in the Web UI. It’s unfortunately one of the cheap Chinese managed switches from AliExpress as decent ones in the UK are 3x the cost but it does support LACP using a hashing method I was told by the support team. It doesn’t allow me to get more than 1Gbit even with a iperf3 parallel test so I thought I would go down the USB route to add another 2.5Gbit port to the router giving me a grand total of 2 x 2.5Gbit ports instead as LACP isn’t achieving what I need. One to the switch and one for the WAN port. I have tried the following steps regarding the driver:

1. The toolchain docker image
2. The custom firmware manager by Adam(think that’s his name) from GitHub.
3. A Ubuntu 20.04 VM with everything needed installed manually.

The furtherest I got was with the docker image where it successfully seems to have compiled the kernel but I just couldn’t get the r8152.c driver source code to compile and I did literally try everything possible. I am very use to Ubuntu/Debian based servers and the command line as I have been doing Linux server administration for 10 years+ but I am certainly rusty when it comes to compiling and even more so when it’s a completely different architecture like ARM compared to x86_64bit. Any help is truly appreciated and any one who can help, I owe you a beer token haha. Anyway thanks a lot in advance.

Cheers!
 
Last edited:
Wouldn't it be much simpler AND SUPPORTED to use a router that has multiple 2.5 Gbps (or greater) ports?
  • GT-AX6000
  • RT-AX88U Pro
  • GT-AX11000 Pro
  • GT-AX16000
  • RT-BE96U
  • GT-BE98
  • GT-BE98 Pro
  • and probably others...
Otherwise, you are probably starting a game of whack-a-mole, where you solve one issue only to be faced with another.
 
Wouldn't it be much simpler AND SUPPORTED to use a router that has multiple 2.5 Gbps (or greater) ports?
  • GT-AX6000
  • RT-AX88U Pro
  • GT-AX11000 Pro
  • GT-AX16000
  • RT-BE96U
  • GT-BE98
  • GT-BE98 Pro
  • and probably others...
Otherwise, you are probably starting a game of whack-a-mole, where you solve one issue only to be faced with another.
If I had the money trust me I would because I totally get where you’re coming from, from my experience too.
 
Not sure if this helps with Merlin firmware, but I was able to compile that module for GPL firmware using my old notes (I needed cp210x but just tried to compile rtl8152 and it compiled fine though I did not try if it loads ok):

Thanks I will take a look, do you have that r8152.ko available to share if it’s been created from Realtek’s latest driver dated I think 20th may 2024, cheers!
 
If I had the money trust me I would because I totally get where you’re coming from, from my experience too.
Sometimes you need to assess your requirements (including planned expansions/upgrades) before making the purchase. The RT-AX86U Pro that you bought (which does not support your latest requirements) is currently only $30 cheaper than the GT-AX6000 ($200 vs $230) on Amazon US.
 
Not sure if this helps with Merlin firmware, but I was able to compile that module for GPL firmware using my old notes (I needed cp210x but just tried to compile rtl8152 and it compiled fine though I did not try if it loads ok):

Even with those sources it complains about not having compatibility.h
 
Even with those sources it complains about not having compatibility.h

Ah I misunderstood, thought you meant module distributred with kernel. However I was able to compile module from Realtek sources (r8152-2.18.1.tar.bz2) as well by setting up GPL sources as described in my notes and then:

* Modify /build/release/src-rt-5.04axhnd.675x/kernel/linux-4.19/Makefile and comment out row: KBUILD_CFLAGS += -D$(MODEL)

* export C_INCLUDE_PATH=/build/release/src-rt-5.04axhnd.675x/kernel/bcmkernel/include

* make ARCH=arm64 CROSS_COMPILE=aarch64-linux- -C /build/release/src-rt-5.04axhnd.675x/kernel/linux-4.19 M=/build/release/src-rt-5.04axhnd.675x/r8152-2.18.1 modules

Module loads on my RT-AX86U Pro, but I do not have that dongle so it does nothing... I have uploaded module to https://drive.google.com/file/d/1GCkFm0HZKZwXFMb8Ay6JxAaIc2bNamq-/view?usp=sharing but yeah no idea if it works with Merlin or at all...

Thanking following sources:
* https://www.snbforums.com/threads/i...rtl8156-r8152-driver-for-asus-rt-ax86u.89398/
* https://web.archive.org/web/20210416211827/https://wu.renjie.im/blog/network/ax88u-nbase-t/
 
Ah I misunderstood, thought you meant module distributred with kernel. However I was able to compile module from Realtek sources (r8152-2.18.1.tar.bz2) as well by setting up GPL sources as described in my notes and then:

* Modify /build/release/src-rt-5.04axhnd.675x/kernel/linux-4.19/Makefile and comment out row: KBUILD_CFLAGS += -D$(MODEL)

* export C_INCLUDE_PATH=/build/release/src-rt-5.04axhnd.675x/kernel/bcmkernel/include

* make ARCH=arm64 CROSS_COMPILE=aarch64-linux- -C /build/release/src-rt-5.04axhnd.675x/kernel/linux-4.19 M=/build/release/src-rt-5.04axhnd.675x/r8152-2.18.1 modules

Module loads on my RT-AX86U Pro, but I do not have that dongle so it does nothing... I have uploaded module to https://drive.google.com/file/d/1GCkFm0HZKZwXFMb8Ay6JxAaIc2bNamq-/view?usp=sharing but yeah no idea if it works with Merlin or at all...

Thanking following sources:
* https://www.snbforums.com/threads/i...rtl8156-r8152-driver-for-asus-rt-ax86u.89398/
* https://web.archive.org/web/20210416211827/https://wu.renjie.im/blog/network/ax88u-nbase-t/
Thanks very much for that man!, can you send me your full notes so just incase in future if I need to compile that driver I’ll totally know what to do, again really appreciate it!, I’ll report back when I have a spare hour to test if it loads and works with Merlin, cheers!
 
Thanks very much for that man!, can you send me your full notes so just incase in future if I need to compile that driver I’ll totally know what to do, again really appreciate it!, I’ll report back when I have a spare hour to test if it loads and works with Merlin, cheers!

I try to keep https://github.com/jarpatus/asuswrt_scripts/blob/main/kernel_modules.md up to date as I personally need some extra modules, but here is summary what worked for me now:

- Get and extract GPL sources
- Use gnuton's docker image for compiling and run commands:

source /home/docker/envs/bcm-hnd-ax-4.19.sh
cd /build/release/src-rt-5.04axhnd.675x/
make RT-AX86U_PRO

- Ctrl+C after a while as we do not need whole firmware
- In case of new kernel moduels, modify kernel/linux-4.19/.config and then:

make kernel modules

For Realtek's r8152 sources continue with steps provided in my previous message.

Though I agree with visortgw to an extent, if you are going to use your router for "production", plan to upgrade to router which has natively 2x2.5 Gbe. Compiling extra modules is fun and all but when automatic firmware upgrade breaks your USB dongle when you have something important to do then it is no fun anymore...

I use cp201x module for zigbee dongle and entware and zigbee2mqtt so I can use zigbee dongles from good spots instead of server in the garage, but if this breaks it is no big deal. Whole network going down would be...
 

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top