Welcome! Log In Create A New Profile

Advanced

moi+_r8168_revisited

Posted by ri8 
ri8
moi+_r8168_revisited
December 31, 2025 08:14AM
Hi bodhi,

updated to 6.17.7, headers, kirkwood-moi-plus.tdb.
latest u-boot update - Nov. 2024, since then not updated.

Please see dkms log:

DKMS make.log for r8168-8.051.02 for kernel 6.17.7-kirkwood-tld-1 (armv5tel)
Wed Dec 31 05:56:07 PST 2025
make: Entering directory '/usr/src/linux-headers-6.17.7-kirkwood-tld-1'
make[1]: Entering directory '/var/lib/dkms/r8168/8.051.02/build'
  CC [M]  r8168_n.o
r8168_n.c:2110:5: warning: no previous prototype for 'mdio_real_read' [-Wmissing-prototypes]
 2110 | u32 mdio_real_read(struct rtl8168_private *tp,
      |     ^~~~~~~~~~~~~~
r8168_n.c: In function 'rtl8168_get_drvinfo':
r8168_n.c:5229:17: error: implicit declaration of function 'strlcpy'; did you mean 'strncpy'? [-Werror=implicit-function-declaration]
 5229 |                 strlcpy(info->fw_version, rtl_fw->version,
      |                 ^~~~~~~
      |                 strncpy
r8168_n.c: At top level:
r8168_n.c:6888:20: error: initialization of 'int (*)(struct net_device *, struct ethtool_keee *)' from incompatible pointer type 'int (*)(struct net_device *, struct ethtool_eee *)' [-Werror=incompatible-pointer-types]
 6888 |         .get_eee = rtl_ethtool_get_eee,
      |                    ^~~~~~~~~~~~~~~~~~~
r8168_n.c:6888:20: note: (near initialization for 'rtl8168_ethtool_ops.get_eee')
r8168_n.c:6889:20: error: initialization of 'int (*)(struct net_device *, struct ethtool_keee *)' from incompatible pointer type 'int (*)(struct net_device *, struct ethtool_eee *)' [-Werror=incompatible-pointer-types]
 6889 |         .set_eee = rtl_ethtool_set_eee,
      |                    ^~~~~~~~~~~~~~~~~~~
r8168_n.c:6889:20: note: (near initialization for 'rtl8168_ethtool_ops.set_eee')
r8168_n.c: In function 'rtl8168_delete_esd_timer':
r8168_n.c:24642:9: error: implicit declaration of function 'del_timer_sync'; did you mean 'dev_mc_sync'? [-Werror=implicit-function-declaration]
24642 |         del_timer_sync(timer);
      |         ^~~~~~~~~~~~~~
      |         dev_mc_sync
r8168_n.c: In function 'rtl8168_esd_timer':
r8168_n.c:26671:38: error: implicit declaration of function 'from_timer'; did you mean 'mod_timer'? [-Werror=implicit-function-declaration]
26671 |         struct rtl8168_private *tp = from_timer(tp, t, esd_timer);
      |                                      ^~~~~~~~~~
      |                                      mod_timer
r8168_n.c:26671:56: error: 'esd_timer' undeclared (first use in this function); did you mean 'add_timer'?
26671 |         struct rtl8168_private *tp = from_timer(tp, t, esd_timer);
      |                                                        ^~~~~~~~~
      |                                                        add_timer
r8168_n.c:26671:56: note: each undeclared identifier is reported only once for each function it appears in
r8168_n.c: In function 'rtl8168_link_timer':
r8168_n.c:26852:56: error: 'link_timer' undeclared (first use in this function)
26852 |         struct rtl8168_private *tp = from_timer(tp, t, link_timer);
      |                                                        ^~~~~~~~~~
r8168_n.c: In function 'r8168_csum_workaround':
r8168_n.c:29208:24: error: implicit declaration of function 'skb_gso_segment'; did you mean 'skb_gso_reset'? [-Werror=implicit-function-declaration]
29208 |                 segs = skb_gso_segment(skb, features);
      |                        ^~~~~~~~~~~~~~~
      |                        skb_gso_reset
r8168_n.c:29208:22: warning: assignment to 'struct sk_buff *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
29208 |                 segs = skb_gso_segment(skb, features);
      |                      ^
cc1: some warnings being treated as errors
make[3]: *** [/usr/src/linux-headers-6.17.7-kirkwood-tld-1/scripts/Makefile.build:287: r8168_n.o] Error 1
make[2]: *** [/usr/src/linux-headers-6.17.7-kirkwood-tld-1/Makefile:2011: .] Error 2
make[1]: *** [/usr/src/linux-headers-6.17.7-kirkwood-tld-1/Makefile:248: __sub-make] Error 2
make[1]: Leaving directory '/var/lib/dkms/r8168/8.051.02/build'
make: *** [Makefile:248: __sub-make] Error 2
make: Leaving directory '/usr/src/linux-headers-6.17.7-kirkwood-tld-1'

Regards,
alex



Edited 1 time(s). Last edit at 12/31/2025 08:15AM by ri8.
Re: moi+_r8168_revisited
December 31, 2025 11:21AM
r8168-8.051.02 is 3 years old. Meanwhile 8.055.00 is available, which might better match your kernel. (and compiler).
ri8
Re: moi+_r8168_revisited
January 01, 2026 08:03AM
Hi Mijzelf,

thanks for your attention;
compiling & inserting r8168
with autorun.sh OK,
but no wireless device
to use (it's onboard USB chip r8188EUS);

after reboot (excerpt)

[    5.783798] Run /init as init process
[    5.788178]   with arguments:
[    5.788188]     /init
[    5.788196]   with environment:
[    5.788204]     HOME=/
[    5.788212]     TERM=linux
[    7.661454] usb 1-1-port3: attempt power cycle
[    9.701321] usb 1-1-port3: unable to enumerate USB device
[    9.745810] r8168: loading out-of-tree module taints kernel.
[   20.480513] EXT4-fs (sda3): mounting ext3 file system using the ext4 subsystem
[   20.918488] EXT4-fs (sda3): mounted filesystem 0dab553c-2087-4866-8318-a06a2829035e ro with ordered data mode. Quota mode: none.
[   25.581119] orion_wdt: Initial timeout 21 sec
[   25.700561] marvell-cesa f1030000.crypto: CESA device successfully registered
[   25.796054] sd 0:0:0:0: Attached scsi generic sg0 type 0
[   27.600446] EXT4-fs (sda3): re-mounted 0dab553c-2087-4866-8318-a06a2829035e r/w.
[   30.880217] random: crng init done
[   33.420927] mv643xx_eth_port mv643xx_eth_port.0 eth0: link up, 100 Mb/s, full duplex, flow control disabled
[   33.760382] mv643xx_eth_port mv643xx_eth_port.0 eth0: link down
[   33.767074] mv643xx_eth_port mv643xx_eth_port.0 eth0: link up, 100 Mb/s, full duplex, flow control disabled
[   34.800427] mv643xx_eth_port mv643xx_eth_port.0 eth0: link down
[   34.807165] mv643xx_eth_port mv643xx_eth_port.0 eth0: link up, 100 Mb/s, full duplex, flow control disabled
[   35.475081] cfg80211: Loading compiled-in X.509 certificates for regulatory database
[   35.522302] Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
[   35.530517] Loaded X.509 cert 'wens: 61c038651aabdcf94bd0ac7ff06c7248db18c600'
[   35.559799] faux_driver regulatory: Direct firmware load for regulatory.db failed with error -2
[   35.569312] cfg80211: failed to load regulatory.db

root@debian:~# iwconfig
lo no wireless extensions.

eth0 no wireless extensions.

by the way, on installing a new kernel with dpkg -i kirkwood-debian-xxx.deb

automatically starts dkms, recompiling r8168 code from kernel source tree, and fails.
How have i to deal with that?

root@debian:~# dkms status
r8168/8.051.02: added

if i remove it, on reinstall the kernel package with dpkg -i
dkms adds it automatically to the list and tries to recompile.

The same after reinstall firmware-realtek (it's dated 2023, as i see)

Wait, now i see s-thing new:
after
 insmod src/8168.ko in 
dmesg last line:

 2382.549508] Invalid ELF header magic: != \x7fELF


Regards,
alex



Edited 1 time(s). Last edit at 01/01/2026 08:21AM by ri8.
Re: moi+_r8168_revisited
January 02, 2026 02:10AM
I don't have real answers to your questions, but

Quote

installing a new kernel with dpkg -i kirkwood-debian-xxx.deb automatically starts dkms, recompiling r8168 code from kernel source tree

AFAIK that isn't true. dkms is designed to automatically compile modules which are not in the source tree. (Or which have an incompatible/outdated stock module). Yet it uses the header files from the current kernel.

But my experience with dkms is limited. On reading your post I guess you should somehow remove/purge 8.051.02 and add 8.055.00. But I don't know how. Have you read the documentation?

Quote

2382.549508] Invalid ELF header magic: != \x7fELF

That is wrong, of course. 'file /path/to/8168.ko' should show a comparable output as for any other module from /lib/modules/
ri8
Re: moi+_r8168_revisited
January 03, 2026 01:25AM
OK, RTFM.

But, again, module, even being success.ly
compiled, doesnt' work.

bodhi cited, stand Nov. 2023:

Quote
bodhi

OK. So we know this Wifi chip is USB based, and the module rtl8xxxu already has support for this chip. But we don't know how it is connected internally.



Edited 1 time(s). Last edit at 01/03/2026 01:31AM by ri8.
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: