Package Details: r8125-dkms 9.014.01-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: 15
Popularity: 0.010819
First Submitted: 2020-11-21 14:53 (UTC)
Last Updated: 2024-11-08 20:45 (UTC)

Dependencies (3)

Required by (0)

Sources (2)

Latest Comments

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

simona commented on 2022-06-23 17:23 (UTC) (edited on 2022-06-23 17:23 (UTC) by simona)

this dkms is now required? or I can use kernel driver.

g749 commented on 2022-06-02 00:48 (UTC)

Add a patch file to make the driver work with 5.18 kernel. Also added linux-zen-headers as optional dependency.

diff --git a/5.18.patch b/5.18.patch
new file mode 100644
index 0000000..d4db6fc
--- /dev/null
+++ b/5.18.patch
@@ -0,0 +1,17 @@
+--- r8125_n.org.c  2022-06-02 01:43:21.746116107 +0200
++++ r8125_n.c  2022-06-02 01:38:14.408257684 +0200
+@@ -11952,11 +11952,11 @@
+ 
+         if ((sizeof(dma_addr_t) > 4) &&
+             use_dac &&
+-            !pci_set_dma_mask(pdev, DMA_BIT_MASK(64)) &&
+-            !pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(64))) {
++            !dma_set_mask(&pdev->dev, DMA_BIT_MASK(64)) &&
++            !dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(64))) {
+                 dev->features |= NETIF_F_HIGHDMA;
+         } else {
+-                rc = pci_set_dma_mask(pdev, DMA_BIT_MASK(32));
++                rc = dma_set_mask(&pdev->dev, DMA_BIT_MASK(32));
+                 if (rc < 0) {
+ #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,0)
+                         if (netif_msg_probe(tp))
diff --git a/PKGBUILD b/PKGBUILD
index 159f45e..16442c1 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -4,7 +4,7 @@

_pkgname=r8125
pkgname=${_pkgname}-dkms
-pkgver=9.009.00
+pkgver=9.009.01
pkgrel=1
url="https://www.realtek.com/en/component/zoo/category/network-interface-controllers-10-100-1000m-gigabit-ethernet-pci-express-software"
pkgdesc="Kernel module for RTL8125"
@@ -12,11 +12,24 @@ license=('GPL2')
arch=('any')
depends=('dkms')
conflicts=("${_pkgname}")
+
optdepends=('linux-headers: Build the module for Arch kernel'
-            'linux-lts-headers: Build the module for LTS Arch kernel')
-source=("http://rtitwww.realtek.com/rtdrivers/cn/nic1/${_pkgname}-${pkgver}.tar.bz2" 'dkms.conf')
-sha256sums=('1f73d1b84372b82efa091eca5075b34ff622bf7f4385dc16359d1be828f54b14'
-            'ad4c67e0c74661d19b74872f98254184d4b04e32e4c57b338a84fbcefa4c721f')
+            'linux-lts-headers: Build the module for LTS Arch kernel'
+            'linux-zen-headers: Build the module for Arch kernel')
+source=("http://rtitwww.realtek.com/rtdrivers/cn/nic1/${_pkgname}-${pkgver}.tar.bz2"
+        'dkms.conf'
+        '5.18.patch')
+sha256sums=('1bfc5b43a98c7b800fce4885d85e8f7eb4a9f3a245fd0f55eb3912634c2a04ff'
+            'ad4c67e0c74661d19b74872f98254184d4b04e32e4c57b338a84fbcefa4c721f'
+            'b0cbf6d1bc392846c72f479947cf70ec186c4e2c4cd0b6668580eed02aba02ad')
+
+prepare() {
+  dir_name="${_pkgname}-${pkgver}"
+  org_path=`pwd`
+  cd "${dir_name}"/src/
+  patch <"${org_path}"/5.18.patch
+  cd "${org_path}"
+}

package() {
  dir_name="${_pkgname}-${pkgver}"

saitoRS commented on 2022-05-29 02:08 (UTC) (edited on 2022-05-29 02:09 (UTC) by saitoRS)

This stopped working for me after I upgraded to kernel 5.18. The default r8169 driver seems to be working now though, in case anyone else has blacklisted it like I did.

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.

jeker 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?