Hello!
I have a Plugable 2.5Gbe Ethernet USB adapter (Realtek RTL8156B) and an ASUS RT-AX86U router running the latest stable Merlin firmware (3004.388.6_2).
When I plug the adapter into the router, it is identified correctly as a USB device in the Network Map view, however I was unable to get it to work as a WAN connection (selecting WAN USB and all that), plus I see frequent log spam with dmesg. I've been following this well-known guide from a few years ago that mentions that this is due to a missing kernel module for this chipset and provides instructions how to compile one yourself (as well as optimize performance). The tutorial showed how to do this for the AX88U, so I adjusted a few things to be correct for the AX86U (i.e. to use release src-rt-5.02L.07p2axhnd). Everything seemed to work just fine compiling the firmware and tools (iperf3, ethtool) using the /gnuton/Asuswrt-Merlin-Toolchains-Docker docker container, except when building the r8152 driver, which gives me the following error:
I've searched all over the forum and I see some people mentioning that they got it working without compiling any driver (doesn't work for me?), while some others mentioning having similar issues when following the tutorial. If I look at the comments in the original tutorial, there are a few mentioning that they get the same issue for AX86U for some reason, but not for AX88U. When investigating the commands make is running, I can see that the issue is caused due to two missing/empty defines (" -D "):
I'm not sure where these come from and if I get rid of them and run gcc manually, it does compile, but I see the mention in the comments of that tutorial that someone already tried that and the kernel module was not loadable as a result. I would like to understand where the issue comes from and hoping someone has successfully done this before for AX86U.
Thank you for any help!
I have a Plugable 2.5Gbe Ethernet USB adapter (Realtek RTL8156B) and an ASUS RT-AX86U router running the latest stable Merlin firmware (3004.388.6_2).
When I plug the adapter into the router, it is identified correctly as a USB device in the Network Map view, however I was unable to get it to work as a WAN connection (selecting WAN USB and all that), plus I see frequent log spam with dmesg. I've been following this well-known guide from a few years ago that mentions that this is due to a missing kernel module for this chipset and provides instructions how to compile one yourself (as well as optimize performance). The tutorial showed how to do this for the AX88U, so I adjusted a few things to be correct for the AX86U (i.e. to use release src-rt-5.02L.07p2axhnd). Everything seemed to work just fine compiling the firmware and tools (iperf3, ethtool) using the /gnuton/Asuswrt-Merlin-Toolchains-Docker docker container, except when building the r8152 driver, which gives me the following error:
Code:
$make ARCH=arm64 CROSS_COMPILE=aarch64-linux- -C /build/mnt/fastdata/asus/asuswrt-merlin.ng/release/src-rt-5.02L.07p2axhnd/kernel/linux-4.1 M=`pwd` modules
make: Entering directory '/build/mnt/fastdata/asus/asuswrt-merlin.ng/release/src-rt-5.02L.07p2axhnd/kernel/linux-4.1'
CC [M] /build/mnt/fastdata/asus/r8152-2.17.1/r8152.o
<command-line>:0:1: error: macro names must be identifiers
In file included from include/linux/kobject.h:21:0,
from include/linux/module.h:16,
from /build/mnt/fastdata/asus/r8152-2.17.1/r8152.c:15:
include/linux/sysfs.h: In function ‘sysfs_get_dirent’:
include/linux/sysfs.h:496:37: warning: pointer targets in passing argument 2 of ‘kernfs_find_and_get’ differ in signedness [-Wpointer-sign]
return kernfs_find_and_get(parent, name);
...
make[1]: *** [scripts/Makefile.build:296: /build/mnt/fastdata/asus/r8152-2.17.1/r8152.o] Error 1
make: *** [Makefile:1748: _module_/build/mnt/fastdata/asus/r8152-2.17.1] Error 2
make: Leaving directory '/build/mnt/fastdata/asus/asuswrt-merlin.ng/release/src-rt-5.02L.07p2axhnd/kernel/linux-4.1'
I've searched all over the forum and I see some people mentioning that they got it working without compiling any driver (doesn't work for me?), while some others mentioning having similar issues when following the tutorial. If I look at the comments in the original tutorial, there are a few mentioning that they get the same issue for AX86U for some reason, but not for AX88U. When investigating the commands make is running, I can see that the issue is caused due to two missing/empty defines (" -D "):
Code:
$ make -n ARCH=arm64 CROSS_COMPILE=aarch64-linux- -C /build/mnt/fastdata/asus/asuswrt-merlin.ng/release/src-rt-5.02L.07p2axhnd/kernel/linux-4.1 M=`pwd` modules
make: Entering directory '/build/mnt/fastdata/asus/asuswrt-merlin.ng/release/src-rt-5.02L.07p2axhnd/kernel/linux-4.1'
mkdir -p /build/mnt/fastdata/asus/r8152-2.17.1/.tmp_versions ; rm -f /build/mnt/fastdata/asus/r8152-2.17.1/.tmp_versions/*
test -e ./Module.symvers || ( \
echo; \
echo " WARNING: Symbol version dump ./Module.symvers"; \
echo " is missing; modules will have no dependencies and modversions."; \
echo )
make -f ./scripts/Makefile.build obj=/build/mnt/fastdata/asus/r8152-2.17.1
set -e; echo ' CC [M] /build/mnt/fastdata/asus/r8152-2.17.1/r8152.o'; aarch64-linux-gcc -Wp,-MD,/build/mnt/fastdata/asus/r8152-2.17.1/.r8152.o.d -nostdinc -isystem /home/docker/am-toolchains/brcm-arm-hnd/crosstools-aarch64-gcc-5.3-linux-4.1-glibc-2.22-binutils-2.25/usr/bin/../lib/gcc/aarch64-buildroot-linux-gnu/5.3.0/include -I./arch/arm64/include -Iarch/arm64/include/generated/uapi -Iarch/arm64/include/generated -Iinclude -I./arch/arm64/include/uapi -Iarch/arm64/include/generated/uapi -I./include/uapi -Iinclude/generated/uapi -include ./include/linux/kconfig.h -D__KERNEL__ -mlittle-endian -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Wno-format-security -std=gnu89 -D -mgeneral-regs-only -O2 -fno-omit-frame-pointer -fno-optimize-sibling-calls -DMODULE -mcmodel=large -D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(r8152)" -D"KBUILD_MODNAME=KBUILD_STR(r8152)" -c -o /build/mnt/fastdata/asus/r8152-2.17.1/r8152.o /build/mnt/fastdata/asus/r8152-2.17.1/r8152.c; scripts/basic/fixdep /build/mnt/fastdata/asus/r8152-2.17.1/.r8152.o.d /build/mnt/fastdata/asus/r8152-2.17.1/r8152.o 'aarch64-linux-gcc -Wp,-MD,/build/mnt/fastdata/asus/r8152-2.17.1/.r8152.o.d -nostdinc -isystem /home/docker/am-toolchains/brcm-arm-hnd/crosstools-aarch64-gcc-5.3-linux-4.1-glibc-2.22-binutils-2.25/usr/bin/../lib/gcc/aarch64-buildroot-linux-gnu/5.3.0/include -I./arch/arm64/include -Iarch/arm64/include/generated/uapi -Iarch/arm64/include/generated -Iinclude -I./arch/arm64/include/uapi -Iarch/arm64/include/generated/uapi -I./include/uapi -Iinclude/generated/uapi -include ./include/linux/kconfig.h -D__KERNEL__ -mlittle-endian -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Wno-format-security -std=gnu89 -D -mgeneral-regs-only -O2 -fno-omit-frame-pointer -fno-optimize-sibling-calls -DMODULE -mcmodel=large -D"KBUILD_STR(s)=\#s" -D"KBUILD_BASENAME=KBUILD_STR(r8152)" -D"KBUILD_MODNAME=KBUILD_STR(r8152)" -c -o /build/mnt/fastdata/asus/r8152-2.17.1/r8152.o /build/mnt/fastdata/asus/r8152-2.17.1/r8152.c' > /build/mnt/fastdata/asus/r8152-2.17.1/.r8152.o.tmp; rm -f /build/mnt/fastdata/asus/r8152-2.17.1/.r8152.o.d; mv -f /build/mnt/fastdata/asus/r8152-2.17.1/.r8152.o.tmp /build/mnt/fastdata/asus/r8152-2.17.1/.r8152.o.cmd
{ echo /build/mnt/fastdata/asus/r8152-2.17.1/r8152.ko; echo /build/mnt/fastdata/asus/r8152-2.17.1/r8152.o; } > /build/mnt/fastdata/asus/r8152-2.17.1/.tmp_versions/r8152.mod
(cat /dev/null; echo kernel//build/mnt/fastdata/asus/r8152-2.17.1/r8152.ko;) > /build/mnt/fastdata/asus/r8152-2.17.1/modules.order
:
echo ' Building modules, stage 2.';
make -f ./scripts/Makefile.modpost
echo ' MODPOST 0 modules'; find /build/mnt/fastdata/asus/r8152-2.17.1/.tmp_versions -name '*.mod' | xargs -r grep -h '\.ko$' | sort -u | sed 's/\.ko$/.o/' | scripts/mod/modpost -i ./Module.symvers -I /build/mnt/fastdata/asus/r8152-2.17.1/Module.symvers -o /build/mnt/fastdata/asus/r8152-2.17.1/Module.symvers -S -w -s -T - vmlinux
make: Leaving directory '/build/mnt/fastdata/asus/asuswrt-merlin.ng/release/src-rt-5.02L.07p2axhnd/kernel/linux-4.1'
I'm not sure where these come from and if I get rid of them and run gcc manually, it does compile, but I see the mention in the comments of that tutorial that someone already tried that and the kernel module was not loadable as a result. I would like to understand where the issue comes from and hoping someone has successfully done this before for AX86U.
Thank you for any help!
Attachments
Last edited: