Package Details: r8125-dkms 9.015.00-1

Git Clone URL: https://aur.archlinux.org/r8125-dkms.git (read-only, click to copy)
Package Base: r8125-dkms
Description: Kernel module for RTL8125
Upstream URL: https://www.realtek.com/en/component/zoo/category/network-interface-controllers-10-100-1000m-gigabit-ethernet-pci-express-software
Licenses: GPL2
Conflicts: r8125
Submitter: ptb
Maintainer: aravance
Last Packager: aravance
Votes: 17
Popularity: 0.47
First Submitted: 2020-11-21 14:53 (UTC)
Last Updated: 2025-02-24 22:55 (UTC)

Dependencies (3)

Required by (0)

Sources (2)

Latest Comments

« First ‹ Previous 1 2 3 4 5 6 Next › Last »

Karlson2k commented on 2022-04-19 11:49 (UTC)

The previous patch is incomplete and not fully correct. The better patch:

Compatibility with Linux Kernel 5.17+.

diff --git a/src/r8125_n.c b/src/r8125_n.c
--- a/src/r8125_n.c
+++ b/src/r8125_n.c
@@ -349,7 +349,7 @@ static int rtl8125_change_mtu(struct net_device *dev, int new_mtu);
 static void rtl8125_down(struct net_device *dev);

 static int rtl8125_set_mac_address(struct net_device *dev, void *p);
-static void rtl8125_rar_set(struct rtl8125_private *tp, uint8_t *addr);
+static void rtl8125_rar_set(struct rtl8125_private *tp, const uint8_t *addr);
 static void rtl8125_desc_addr_fill(struct rtl8125_private *);
 static void rtl8125_tx_desc_init(struct rtl8125_private *tp);
 static void rtl8125_rx_desc_init(struct rtl8125_private *tp);
@@ -1750,7 +1750,13 @@ static void rtl8125_proc_module_init(void)
 static int rtl8125_proc_open(struct inode *inode, struct file *file)
 {
         struct net_device *dev = proc_get_parent_data(inode);
-        int (*show)(struct seq_file *, void *) = PDE_DATA(inode);
+        int (*show)(struct seq_file *, void *) =
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5,17,0)
+            PDE_DATA(inode);
+#else
+            pde_data(inode);
+#endif
+

         return single_open(file, show, dev);
 }
@@ -5234,8 +5240,15 @@ rtl8125_set_ring_size(struct rtl8125_private *tp, u32 rx, u32 tx)
 }

 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5,17,0)
 static void rtl8125_get_ringparam(struct net_device *dev,
                                   struct ethtool_ringparam *ring)
+#else
+static void rtl8125_get_ringparam(struct net_device* dev,
+                                  struct ethtool_ringparam* ring,
+                                  struct kernel_ethtool_ringparam* kernel_ring,
+                                  struct netlink_ext_ack* extack)
+#endif
 {
         struct rtl8125_private *tp = netdev_priv(dev);

@@ -5245,8 +5258,15 @@ static void rtl8125_get_ringparam(struct net_device *dev,
         ring->tx_pending = tp->tx_ring[0].num_tx_desc;
 }

+#if LINUX_VERSION_CODE < KERNEL_VERSION(5,17,0)
 static int rtl8125_set_ringparam(struct net_device *dev,
                                  struct ethtool_ringparam *ring)
+#else
+static int rtl8125_set_ringparam(struct net_device* dev,
+                                 struct ethtool_ringparam* ring,
+                                 struct kernel_ethtool_ringparam* kernel_ring,
+                                 struct netlink_ext_ack* extack)
+#endif
 {
         struct rtl8125_private *tp = netdev_priv(dev);
         u32 new_rx_count, new_tx_count;
@@ -10889,6 +10909,9 @@ rtl8125_get_mac_address(struct net_device *dev)
         struct rtl8125_private *tp = netdev_priv(dev);
         int i;
         u8 mac_addr[MAC_ADDR_LEN];
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,17,0)
+        u8 addr[ETH_ALEN];
+#endif

         for (i = 0; i < MAC_ADDR_LEN; i++)
                 mac_addr[i] = RTL_R8(tp, MAC0 + i);
@@ -10916,9 +10939,17 @@ rtl8125_get_mac_address(struct net_device *dev)
         rtl8125_rar_set(tp, mac_addr);

         for (i = 0; i < MAC_ADDR_LEN; i++) {
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5,17,0)
                 dev->dev_addr[i] = RTL_R8(tp, MAC0 + i);
                 tp->org_mac_addr[i] = dev->dev_addr[i]; /* keep the original MAC address */
+#else
+                addr[i] = RTL_R8(tp, MAC0 + i);
+                tp->org_mac_addr[i] = addr[i]; /* keep the original MAC address */
+#endif
         }
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,17,0)
+        eth_hw_addr_set(dev, addr);
+#endif
 #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,13)
         memcpy(dev->perm_addr, dev->dev_addr, dev->addr_len);
 #endif
@@ -10944,7 +10975,11 @@ rtl8125_set_mac_address(struct net_device *dev,
         if (!is_valid_ether_addr(addr->sa_data))
                 return -EADDRNOTAVAIL;

+#if LINUX_VERSION_CODE < KERNEL_VERSION(5,17,0)
         memcpy(dev->dev_addr, addr->sa_data, dev->addr_len);
+#else
+        eth_hw_addr_set(dev, addr->sa_data);
+#endif

         rtl8125_rar_set(tp, dev->dev_addr);

@@ -10959,7 +10994,7 @@ rtl8125_set_mac_address(struct net_device *dev,
  *****************************************************************************/
 void
 rtl8125_rar_set(struct rtl8125_private *tp,
-                uint8_t *addr)
+                const uint8_t *addr)
 {
         uint32_t rar_low = 0;
         uint32_t rar_high = 0;

https://github.com/Karlson2k/gentoo/blob/r8125-k5.17-fix/net-misc/r8125/files/r8125-9.008.00-linux-5.17.patch

ede1998 commented on 2022-04-09 16:31 (UTC) (edited on 2022-04-09 16:33 (UTC) by ede1998)

I had the same issue as jiffy1111. For now, I just cloned the repository and installed the driver manually from commit "Update to 9.008.00." (6156e027c127) with:

# on machine with working network drivers: download driver needed for package, see URL in PKGBUILD
curl "http://rtitwww.realtek.com/rtdrivers/cn/nic1/r8125-9.008.00.tar.bz2" -LO
git clone https://aur.archlinux.org/r8125-dkms.git

# on machine missing r8125 driver
cd /path/to/repository/r8125-dkms
cp /path/to/downloaded/driver .
git checkout 6156e027c127af961c89bad600546d234d82ccab
makepkg -si

That's what worked for me till we get an update.

jiffy1111 commented on 2022-04-06 12:52 (UTC) (edited on 2022-04-06 12:52 (UTC) by jiffy1111)

Hi, this update broke an lts kernel

==> dkms install --no-depmod r8125/9.008.00 -k 5.15.32-1-lts
Error! Bad return status for module build on kernel: 5.15.32-1-lts (x86_64)
Consult /var/lib/dkms/r8125/9.008.00/build/make.log for more information.
==> WARNING: `dkms install --no-depmod r8125/9.008.00 -k 5.15.32-1-lts' exited 10

~  cat /var/lib/dkms/r8125/9.008.00/build/make.log
DKMS make.log for r8125-9.008.00 for kernel 5.15.32-1-lts (x86_64)
Wed Apr  6 08:44:27 AM EDT 2022
make: Entering directory '/usr/lib/modules/5.15.32-1-lts/build'
  CC [M]  /var/lib/dkms/r8125/9.008.00/build/r8125_n.o
  CC [M]  /var/lib/dkms/r8125/9.008.00/build/rtl_eeprom.o
  CC [M]  /var/lib/dkms/r8125/9.008.00/build/rtltool.o
/var/lib/dkms/r8125/9.008.00/build/r8125_n.c: In function ‘rtl8125_proc_open’:
/var/lib/dkms/r8125/9.008.00/build/r8125_n.c:1753:50: error: implicit declaration of function ‘pde_data’ [-Werror=implicit-function-declaration]
 1753 |         int (*show)(struct seq_file *, void *) = pde_data(inode);
      |                                                  ^~~~~~~~
/var/lib/dkms/r8125/9.008.00/build/r8125_n.c:1753:50: warning: initialization of ‘int (*)(struct seq_file *, void *)’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
/var/lib/dkms/r8125/9.008.00/build/r8125_n.c: At top level:
/var/lib/dkms/r8125/9.008.00/build/r8125_n.c:5243:42: warning: ‘struct kernel_ethtool_ringparam’ declared inside parameter list will not be visible outside of this definition or declaration
 5243 |                                   struct kernel_ethtool_ringparam *kernel_ring,
      |                                          ^~~~~~~~~~~~~~~~~~~~~~~~
/var/lib/dkms/r8125/9.008.00/build/r8125_n.c:5261:42: warning: ‘struct kernel_ethtool_ringparam’ declared inside parameter list will not be visible outside of this definition or declaration
 5261 |                                   struct kernel_ethtool_ringparam *kernel_ring,
      |                                          ^~~~~~~~~~~~~~~~~~~~~~~~
/var/lib/dkms/r8125/9.008.00/build/r8125_n.c:5792:31: error: initialization of ‘void (*)(struct net_device *, struct ethtool_ringparam *)’ from incompatible pointer type ‘void (*)(struct net_device *, struct ethtool_ringparam *, struct kernel_ethtool_ringparam *, struct netlink_ext_ack *)’ [-Werror=incompatible-pointer-types]
 5792 |         .get_ringparam      = rtl8125_get_ringparam,
      |                               ^~~~~~~~~~~~~~~~~~~~~
/var/lib/dkms/r8125/9.008.00/build/r8125_n.c:5792:31: note: (near initialization for ‘rtl8125_ethtool_ops.get_ringparam’)
/var/lib/dkms/r8125/9.008.00/build/r8125_n.c:5793:31: error: initialization of ‘int (*)(struct net_device *, struct ethtool_ringparam *)’ from incompatible pointer type ‘int (*)(struct net_device *, struct ethtool_ringparam *, struct kernel_ethtool_ringparam *, struct netlink_ext_ack *)’ [-Werror=incompatible-pointer-types]
 5793 |         .set_ringparam      = rtl8125_set_ringparam,
      |                               ^~~~~~~~~~~~~~~~~~~~~
/var/lib/dkms/r8125/9.008.00/build/r8125_n.c:5793:31: note: (near initialization for ‘rtl8125_ethtool_ops.set_ringparam’)
cc1: some warnings being treated as errors
make[1]: *** [scripts/Makefile.build:277: /var/lib/dkms/r8125/9.008.00/build/r8125_n.o] Error 1
make: *** [Makefile:1868: /var/lib/dkms/r8125/9.008.00/build] Error 2
make: Leaving directory '/usr/lib/modules/5.15.32-1-lts/build'

shanedav4 commented on 2022-04-03 23:57 (UTC)

Thank You jeker. Your patch worked perfectly and I was able to compile the code from Realtek's page without a problem.

lowvoltage commented on 2022-04-02 09:18 (UTC)

This patch fixes the build errors for Linux 5.17:

--- r8125-9.008.00/src/r8125_n.c        2022-02-24 16:45:51.000000000 +0100
+++ r8125-9.008.00-linux5.17/src/r8125_n.c      2022-04-02 11:12:08.754829003 +0200
@@ -1750,7 +1750,7 @@
 static int rtl8125_proc_open(struct inode *inode, struct file *file)
 {
         struct net_device *dev = proc_get_parent_data(inode);
-        int (*show)(struct seq_file *, void *) = PDE_DATA(inode);
+        int (*show)(struct seq_file *, void *) = pde_data(inode);

         return single_open(file, show, dev);
 }
@@ -5234,8 +5234,15 @@
 }

 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5,15,0)
 static void rtl8125_get_ringparam(struct net_device *dev,
                                   struct ethtool_ringparam *ring)
+#else
+static void rtl8125_get_ringparam(struct net_device *dev,
+                                  struct ethtool_ringparam *ring,
+                                  struct kernel_ethtool_ringparam *kernel_ring,
+                                  struct netlink_ext_ack *extack)
+#endif
 {
         struct rtl8125_private *tp = netdev_priv(dev);

@@ -5245,8 +5252,15 @@
         ring->tx_pending = tp->tx_ring[0].num_tx_desc;
 }

+#if LINUX_VERSION_CODE < KERNEL_VERSION(5,15,0)
 static int rtl8125_set_ringparam(struct net_device *dev,
                                  struct ethtool_ringparam *ring)
+#else
+static int rtl8125_set_ringparam(struct net_device *dev,
+                                  struct ethtool_ringparam *ring,
+                                  struct kernel_ethtool_ringparam *kernel_ring,
+                                  struct netlink_ext_ack *extack)
+#endif
 {
         struct rtl8125_private *tp = netdev_priv(dev);
         u32 new_rx_count, new_tx_count;
@@ -10889,6 +10903,7 @@
         struct rtl8125_private *tp = netdev_priv(dev);
         int i;
         u8 mac_addr[MAC_ADDR_LEN];
+        u8 addr[ETH_ALEN];

         for (i = 0; i < MAC_ADDR_LEN; i++)
                 mac_addr[i] = RTL_R8(tp, MAC0 + i);
@@ -10916,9 +10931,10 @@
         rtl8125_rar_set(tp, mac_addr);

         for (i = 0; i < MAC_ADDR_LEN; i++) {
-                dev->dev_addr[i] = RTL_R8(tp, MAC0 + i);
+                addr[i] = RTL_R8(tp, MAC0 + i);
                 tp->org_mac_addr[i] = dev->dev_addr[i]; /* keep the original MAC address */
         }
+        eth_hw_addr_set(dev, addr);
 #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,13)
         memcpy(dev->perm_addr, dev->dev_addr, dev->addr_len);
 #endif

It's lazily cobbled together from similar patches for r8168 and r8125.

darose commented on 2022-04-01 18:23 (UTC)

I switched over to the r8169 module on 3/30 and haven't run into any issues so far.

ptb commented on 2022-04-01 18:18 (UTC)

Sadly I don't have time to have a look at this in the next two weeks. At the moment I'm testing if the r8169 driver is finally working with my network adapter. So far 2.5GbE is working fine without random interruptions, which it did not with the 5.16 kernel. Did anyone notice issues with the r8169 driver and a r8125 network adapter?

shanedav4 commented on 2022-04-01 11:34 (UTC)

Just another person here with no programming experience saying help. The r8125-dkms works fine with Kernel 5.16 but 5.17 totally hoses it. I try this and I also tried downloading the code from Realtek and that didn't work either with 5.17. When you get a chance could you look into this? Maybe we just need to wait for Realtek to update their code for 5.17. Thank You so much for working to provide this for us. I'll unblacklist r8169 for now.

mathes.s commented on 2022-03-30 12:18 (UTC)

I could fix the not working network for me by removing this package and re-enabling the r8169 module. Then the system used the build module directly from the kernel.

So thanks for your efforts in the past to build this package, but I think I no longer need it.

mathes.s commented on 2022-03-30 08:24 (UTC)

Hi, I am also getting build errors. This comes out of the "var/lib/dkms/r8125/9.008.00/build/make.log"



DKMS make.log for r8125-9.008.00 for kernel 5.17.1-arch1-1 (x86_64)
Mi 30. Mär 10:20:05 CEST 2022
make: Verzeichnis „/usr/lib/modules/5.17.1-arch1-1/build“ wird betreten
  CC [M]  /var/lib/dkms/r8125/9.008.00/build/r8125_n.o
  CC [M]  /var/lib/dkms/r8125/9.008.00/build/rtl_eeprom.o
  CC [M]  /var/lib/dkms/r8125/9.008.00/build/rtltool.o
/var/lib/dkms/r8125/9.008.00/build/r8125_n.c: In Funktion »rtl8125_proc_open«:
/var/lib/dkms/r8125/9.008.00/build/r8125_n.c:1753:50: Fehler: Implizite Deklaration der Funktion »PDE_DATA«; meinten Sie »NODE_DATA«? [-Werror=implicit-function-declaration]
 1753 |         int (*show)(struct seq_file *, void *) = PDE_DATA(inode);
      |                                                  ^~~~~~~~
      |                                                  NODE_DATA
/var/lib/dkms/r8125/9.008.00/build/r8125_n.c:1753:50: Warnung: Initialisierung von »int (*)(struct seq_file *, void *)« von »int« wandelt eine Zahl in einen Zeiger um, ohne explizite Typkonvertierung [-Wint-conversion]
/var/lib/dkms/r8125/9.008.00/build/r8125_n.c: Auf höchster Ebene:
/var/lib/dkms/r8125/9.008.00/build/r8125_n.c:5778:31: Fehler: Initialisierung von »void (*)(struct net_device *, struct ethtool_ringparam *, struct kernel_ethtool_ringparam *, struct netlink_ext_ack *)« von inkompatiblem Zeigertyp »void (*)(struct net_device *, struct ethtool_ringparam *)« [-Werror=incompatible-pointer-types]
 5778 |         .get_ringparam      = rtl8125_get_ringparam,
      |                               ^~~~~~~~~~~~~~~~~~~~~
/var/lib/dkms/r8125/9.008.00/build/r8125_n.c:5778:31: Anmerkung: (nahe der Initialisierung für »rtl8125_ethtool_ops.get_ringparam«)
/var/lib/dkms/r8125/9.008.00/build/r8125_n.c:5779:31: Fehler: Initialisierung von »int (*)(struct net_device *, struct ethtool_ringparam *, struct kernel_ethtool_ringparam *, struct netlink_ext_ack *)« von inkompatiblem Zeigertyp »int (*)(struct net_device *, struct ethtool_ringparam *)« [-Werror=incompatible-pointer-types]
 5779 |         .set_ringparam      = rtl8125_set_ringparam,
      |                               ^~~~~~~~~~~~~~~~~~~~~
/var/lib/dkms/r8125/9.008.00/build/r8125_n.c:5779:31: Anmerkung: (nahe der Initialisierung für »rtl8125_ethtool_ops.set_ringparam«)
/var/lib/dkms/r8125/9.008.00/build/r8125_n.c: In Funktion »rtl8125_get_mac_address«:
/var/lib/dkms/r8125/9.008.00/build/r8125_n.c:10919:34: Fehler: Zuweisung der schreibgeschützten Speicherstelle »*(dev->dev_addr + (sizetype)i)«
10919 |                 dev->dev_addr[i] = RTL_R8(tp, MAC0 + i);
      |                                  ^
/var/lib/dkms/r8125/9.008.00/build/r8125_n.c: In Funktion »rtl8125_set_mac_address«:
/var/lib/dkms/r8125/9.008.00/build/r8125_n.c:10947:19: Warnung: Übergabe des Arguments 1 von »memcpy« entfernt Kennzeichner »const« von Zeiger-Ziel-Typ [-Wdiscarded-qualifiers]
10947 |         memcpy(dev->dev_addr, addr->sa_data, dev->addr_len);
      |                ~~~^~~~~~~~~~
In Datei, eingebunden von ./include/linux/string.h:253,
                 von ./include/linux/bitmap.h:11,
                 von ./include/linux/cpumask.h:12,
                 von ./arch/x86/include/asm/cpumask.h:5,
                 von ./arch/x86/include/asm/msr.h:11,
                 von ./arch/x86/include/asm/processor.h:22,
                 von ./arch/x86/include/asm/timex.h:5,
                 von ./include/linux/timex.h:65,
                 von ./include/linux/time32.h:13,
                 von ./include/linux/time.h:60,
                 von ./include/linux/stat.h:19,
                 von ./include/linux/module.h:13,
                 von /var/lib/dkms/r8125/9.008.00/build/r8125_n.c:39:
./include/linux/fortify-string.h:212:37: Anmerkung: »void *« erwartet, aber Argument hat Typ »const unsigned char *«
  212 | __FORTIFY_INLINE void *memcpy(void *p, const void *q, __kernel_size_t size)
      |                               ~~~~~~^
/var/lib/dkms/r8125/9.008.00/build/r8125_n.c:10949:32: Warnung: Übergabe des Arguments 2 von »rtl8125_rar_set« entfernt Kennzeichner »const« von Zeiger-Ziel-Typ [-Wdiscarded-qualifiers]
10949 |         rtl8125_rar_set(tp, dev->dev_addr);
      |                             ~~~^~~~~~~~~~
/var/lib/dkms/r8125/9.008.00/build/r8125_n.c:352:66: Anmerkung: »uint8_t *« {alias »unsigned char *«} erwartet, aber Argument hat Typ »const unsigned char *«
  352 | static void rtl8125_rar_set(struct rtl8125_private *tp, uint8_t *addr);
      |                                                         ~~~~~~~~~^~~~
/var/lib/dkms/r8125/9.008.00/build/r8125_n.c: In Funktion »rtl8125_resume«:
/var/lib/dkms/r8125/9.008.00/build/r8125_n.c:15582:32: Warnung: Übergabe des Arguments 2 von »rtl8125_rar_set« entfernt Kennzeichner »const« von Zeiger-Ziel-Typ [-Wdiscarded-qualifiers]
15582 |         rtl8125_rar_set(tp, dev->dev_addr);
      |                             ~~~^~~~~~~~~~
/var/lib/dkms/r8125/9.008.00/build/r8125_n.c:10962:26: Anmerkung: »uint8_t *« {alias »unsigned char *«} erwartet, aber Argument hat Typ »const unsigned char *«
10962 |                 uint8_t *addr)
      |                 ~~~~~~~~~^~~~
cc1: Einige Warnungen werden als Fehler behandelt
make[1]: *** [scripts/Makefile.build:288: /var/lib/dkms/r8125/9.008.00/build/r8125_n.o] Fehler 1
make: *** [Makefile:1831: /var/lib/dkms/r8125/9.008.00/build] Fehler 2
make: Verzeichnis „/usr/lib/modules/5.17.1-arch1-1/build“ wird verlassen