public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Pacho Ramos" <pacho@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: net-misc/r8168/files/, net-misc/r8168/
Date: Sun, 27 Mar 2022 09:30:57 +0000 (UTC)	[thread overview]
Message-ID: <1648373447.13afe46537e99157756939d331bebed49169dfc6.pacho@gentoo> (raw)

commit:     13afe46537e99157756939d331bebed49169dfc6
Author:     Pacho Ramos <pacho <AT> gentoo <DOT> org>
AuthorDate: Sun Mar 27 09:29:07 2022 +0000
Commit:     Pacho Ramos <pacho <AT> gentoo <DOT> org>
CommitDate: Sun Mar 27 09:30:47 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=13afe465

net-misc/r8168: Fix build with kernel 5.17

Thanks-to: Peter Levine
Closes: https://bugs.gentoo.org/836129

Signed-off-by: Pacho Ramos <pacho <AT> gentoo.org>

 net-misc/r8168/files/r8168-8.049.02-5.17-fix.patch | 70 ++++++++++++++++++++++
 net-misc/r8168/r8168-8.049.02-r1.ebuild            |  7 ++-
 2 files changed, 75 insertions(+), 2 deletions(-)

diff --git a/net-misc/r8168/files/r8168-8.049.02-5.17-fix.patch b/net-misc/r8168/files/r8168-8.049.02-5.17-fix.patch
new file mode 100644
index 000000000000..9e4e77615458
--- /dev/null
+++ b/net-misc/r8168/files/r8168-8.049.02-5.17-fix.patch
@@ -0,0 +1,70 @@
+PDE_DATA has been replaced with pde_data
+netdev->dev_addr is now const and uses assignment helpers like eth_hw_addr_set
+
+https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=359745d
+https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=48eab83
+https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=adeef3e
+
+--- a/src/r8168_n.c
++++ b/src/r8168_n.c
+@@ -95,6 +95,10 @@
+ #include <linux/seq_file.h>
+ #endif
+ 
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,17,0)
++#define PDE_DATA pde_data
++#endif
++
+ #define FIRMWARE_8168D_1    "rtl_nic/rtl8168d-1.fw"
+ #define FIRMWARE_8168D_2    "rtl_nic/rtl8168d-2.fw"
+ #define FIRMWARE_8168E_1    "rtl_nic/rtl8168e-1.fw"
+@@ -563,7 +567,7 @@
+ static void rtl8168_down(struct net_device *dev);
+ 
+ static int rtl8168_set_mac_address(struct net_device *dev, void *p);
+-void rtl8168_rar_set(struct rtl8168_private *tp, uint8_t *addr);
++void rtl8168_rar_set(struct rtl8168_private *tp, const uint8_t *addr);
+ static void rtl8168_desc_addr_fill(struct rtl8168_private *);
+ static void rtl8168_tx_desc_init(struct rtl8168_private *tp);
+ static void rtl8168_rx_desc_init(struct rtl8168_private *tp);
+@@ -24129,9 +24133,17 @@
+         rtl8168_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
++                mac_addr[i] = RTL_R8(tp, MAC0 + i);
++                tp->org_mac_addr[i] = mac_addr[i]; /* keep the original MAC address */
++#endif
+         }
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,17,0)
++        eth_hw_addr_set(dev, mac_addr);
++#endif
+ #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,13)
+         memcpy(dev->perm_addr, dev->dev_addr, dev->addr_len);
+ #endif
+@@ -24159,9 +24171,11 @@
+                 return -EADDRNOTAVAIL;
+ 
+         spin_lock_irqsave(&tp->lock, flags);
+-
++#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
+         rtl8168_rar_set(tp, dev->dev_addr);
+ 
+         spin_unlock_irqrestore(&tp->lock, flags);
+@@ -24177,7 +24191,7 @@
+  *****************************************************************************/
+ void
+ rtl8168_rar_set(struct rtl8168_private *tp,
+-                uint8_t *addr)
++                const uint8_t *addr)
+ {
+         uint32_t rar_low = 0;
+         uint32_t rar_high = 0;

diff --git a/net-misc/r8168/r8168-8.049.02-r1.ebuild b/net-misc/r8168/r8168-8.049.02-r1.ebuild
index 2f271eb31f74..6686979b10d9 100644
--- a/net-misc/r8168/r8168-8.049.02-r1.ebuild
+++ b/net-misc/r8168/r8168-8.049.02-r1.ebuild
@@ -1,7 +1,7 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2022 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI=7
+EAPI=8
 
 inherit linux-info linux-mod
 
@@ -24,6 +24,9 @@ IUSE="use-firmware"
 CONFIG_CHECK="~!R8169"
 WARNING_R8169="CONFIG_R8169 is enabled. ${P} will not be loaded unless kernel driver Realtek 8169 PCI Gigabit Ethernet (CONFIG_R8169) is DISABLED."
 
+PATCHES=(
+	"${FILESDIR}/r8168-8.049.02-5.17-fix.patch"
+)
 pkg_setup() {
 	linux-mod_pkg_setup
 	BUILD_PARAMS="KERNELDIR=${KV_DIR}"


             reply	other threads:[~2022-03-27  9:31 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-27  9:30 Pacho Ramos [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-06-16  9:38 [gentoo-commits] repo/gentoo:master commit in: net-misc/r8168/files/, net-misc/r8168/ Pacho Ramos
2023-08-19 22:32 Conrad Kostecki
2023-02-26 15:51 Pacho Ramos
2022-12-19  9:49 Pacho Ramos
2022-12-04 14:50 Pacho Ramos
2022-08-02 17:36 Pacho Ramos
2022-05-26  9:44 Pacho Ramos
2020-04-03 18:50 Pacho Ramos
2018-04-27 21:09 James Le Cuirot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1648373447.13afe46537e99157756939d331bebed49169dfc6.pacho@gentoo \
    --to=pacho@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox