From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 0206915808B for ; Sun, 27 Mar 2022 09:31:02 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 472D4E0929; Sun, 27 Mar 2022 09:31:01 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id D986CE0929 for ; Sun, 27 Mar 2022 09:31:00 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 7213E335D3B for ; Sun, 27 Mar 2022 09:30:59 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id DEDC5177 for ; Sun, 27 Mar 2022 09:30:57 +0000 (UTC) From: "Pacho Ramos" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Pacho Ramos" Message-ID: <1648373447.13afe46537e99157756939d331bebed49169dfc6.pacho@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: net-misc/r8168/files/, net-misc/r8168/ X-VCS-Repository: repo/gentoo X-VCS-Files: net-misc/r8168/files/r8168-8.049.02-5.17-fix.patch net-misc/r8168/r8168-8.049.02-r1.ebuild X-VCS-Directories: net-misc/r8168/ net-misc/r8168/files/ X-VCS-Committer: pacho X-VCS-Committer-Name: Pacho Ramos X-VCS-Revision: 13afe46537e99157756939d331bebed49169dfc6 X-VCS-Branch: master Date: Sun, 27 Mar 2022 09:30:57 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: f8416ea5-c210-43b2-a3de-166a70321150 X-Archives-Hash: bc4e120e38e0dc232f012f734e0813ec commit: 13afe46537e99157756939d331bebed49169dfc6 Author: Pacho Ramos gentoo org> AuthorDate: Sun Mar 27 09:29:07 2022 +0000 Commit: Pacho Ramos gentoo 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 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 + #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}"