* [gentoo-commits] repo/gentoo:master commit in: net-misc/r8168/files/, net-misc/r8168/
@ 2018-04-27 21:09 James Le Cuirot
0 siblings, 0 replies; 10+ messages in thread
From: James Le Cuirot @ 2018-04-27 21:09 UTC (permalink / raw
To: gentoo-commits
commit: ee232457ed7bad1c3d62c4c509419086b6ea3a65
Author: James Le Cuirot <chewi <AT> gentoo <DOT> org>
AuthorDate: Fri Apr 27 21:09:01 2018 +0000
Commit: James Le Cuirot <chewi <AT> gentoo <DOT> org>
CommitDate: Fri Apr 27 21:09:41 2018 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ee232457
net-misc/r8168: Drop old 8.044.02
Closes: https://bugs.gentoo.org/646114
Package-Manager: Portage-2.3.31, Repoman-2.3.9
net-misc/r8168/Manifest | 1 -
.../r8168/files/r8168-8.044.02-linux-4.11.patch | 27 ------------------
net-misc/r8168/r8168-8.044.02.ebuild | 33 ----------------------
3 files changed, 61 deletions(-)
diff --git a/net-misc/r8168/Manifest b/net-misc/r8168/Manifest
index 3455812608f..eae877f341a 100644
--- a/net-misc/r8168/Manifest
+++ b/net-misc/r8168/Manifest
@@ -1,2 +1 @@
-DIST r8168-8.044.02.tar.bz2 95880 BLAKE2B f153b077f8112c2b3c81a923a9a9c7d5096d141adb1cc8dd220f9fdf5df32af90c30f19512dc95bb2761febcfe3a59b6634e9fdec8fbb08b6b493a15aad99d0f SHA512 d7e4fd73ee4f17440613b78163777fc0b9e472490a900fdf8e66c4e16f413cc01f49991a68c7bfb19ddf9577e706d0410ff7c8e85ced53e9740e69efda729512
DIST r8168-8.045.08.tar.bz2 104427 BLAKE2B 56e332b518aa3c244750310a77d53ca2fc9a365f4a043e452c5593bcfcd5679c882d35b9977438ddb6a42ba40bb7c9b45e73926fda37c372314d57290ea3ffab SHA512 9037527f193d59da8bcf69396582e13acb58880ce52328e596ffb469352d38649d43f3c31b01ed607773bba1624561f299b3909dd6124448ed75e8f548d80563
diff --git a/net-misc/r8168/files/r8168-8.044.02-linux-4.11.patch b/net-misc/r8168/files/r8168-8.044.02-linux-4.11.patch
deleted file mode 100644
index ba1dd372dfa..00000000000
--- a/net-misc/r8168/files/r8168-8.044.02-linux-4.11.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-diff a/src/r8168.h b/src/r8168.h
---- a/src/r8168.h 2017-01-11 14:19:18.000000000 +0800
-+++ b/src/r8168.h 2017-05-02 21:18:54.541652414 +0800
-@@ -36,6 +36,10 @@
- #include "r8168_realwow.h"
- #include "r8168_fiber.h"
-
-+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0))
-+#include <linux/sched/signal.h>
-+#endif
-+
- #if LINUX_VERSION_CODE < KERNEL_VERSION(4,0,0)
- #if defined(skb_vlan_tag_present) && !defined(vlan_tx_tag_present)
- #define vlan_tx_tag_present skb_vlan_tag_present
-diff a/src/r8168_n.c b/src/r8168_n.c
---- a/src/r8168_n.c 2017-01-11 14:18:43.000000000 +0800
-+++ b/src/r8168_n.c 2017-05-02 21:20:57.488644205 +0800
-@@ -25732,7 +25732,9 @@
- if (rtl8168_rx_vlan_skb(tp, desc, skb) < 0)
- rtl8168_rx_skb(tp, skb);
-
-+#if (LINUX_VERSION_CODE <= KERNEL_VERSION(4, 10, 0))
- dev->last_rx = jiffies;
-+#endif
- RTLDEV->stats.rx_bytes += pkt_size;
- RTLDEV->stats.rx_packets++;
- }
diff --git a/net-misc/r8168/r8168-8.044.02.ebuild b/net-misc/r8168/r8168-8.044.02.ebuild
deleted file mode 100644
index 4822eb15079..00000000000
--- a/net-misc/r8168/r8168-8.044.02.ebuild
+++ /dev/null
@@ -1,33 +0,0 @@
-# Copyright 1999-2017 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-
-inherit linux-info linux-mod eutils
-
-DESCRIPTION="r8168 driver for Realtek 8111/8168 PCI-E NICs"
-HOMEPAGE="http://www.realtek.com.tw"
-SRC_URI="http://12244.wpc.azureedge.net/8012244/drivers/rtdrivers/cn/nic/0009-${P}.tar.bz2 -> ${P}.tar.bz2"
-LICENSE="GPL-2"
-SLOT="0"
-KEYWORDS="amd64 x86"
-
-MODULE_NAMES="r8168(net:${S}/src)"
-BUILD_TARGETS="modules"
-
-CONFIG_CHECK="!R8169"
-ERROR_R8169="${P} requires Realtek 8169 PCI Gigabit Ethernet adapter (CONFIG_R8169) to be DISABLED"
-
-PATCHES=(
- "${FILESDIR}"/${P}-linux-4.11.patch
-)
-
-pkg_setup() {
- linux-mod_pkg_setup
- BUILD_PARAMS="KERNELDIR=${KV_DIR}"
-}
-
-src_install() {
- linux-mod_src_install
- dodoc README
-}
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: net-misc/r8168/files/, net-misc/r8168/
@ 2020-04-03 18:50 Pacho Ramos
0 siblings, 0 replies; 10+ messages in thread
From: Pacho Ramos @ 2020-04-03 18:50 UTC (permalink / raw
To: gentoo-commits
commit: aa2fdf6947e9f98d25d726f0e648fd88cb42bdbe
Author: Pacho Ramos <pacho <AT> gentoo <DOT> org>
AuthorDate: Fri Apr 3 18:49:49 2020 +0000
Commit: Pacho Ramos <pacho <AT> gentoo <DOT> org>
CommitDate: Fri Apr 3 18:50:00 2020 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=aa2fdf69
net-misc/r8168: Bump to 8.048.02
Package-Manager: Portage-2.3.96, Repoman-2.3.22
Signed-off-by: Pacho Ramos <pacho <AT> gentoo.org>
net-misc/r8168/Manifest | 1 +
net-misc/r8168/files/kernel56.patch | 50 ++++++++++++++++++++++++++++++++++++
net-misc/r8168/r8168-8.048.02.ebuild | 36 ++++++++++++++++++++++++++
3 files changed, 87 insertions(+)
diff --git a/net-misc/r8168/Manifest b/net-misc/r8168/Manifest
index fe7c83a9a60..f1ac5992372 100644
--- a/net-misc/r8168/Manifest
+++ b/net-misc/r8168/Manifest
@@ -1 +1,2 @@
DIST r8168-8.048.00.tar.bz2 109018 BLAKE2B e3587fda9cdad8a8433933daef7f05b123b661e6079703c840fb20562ff8511424bf183781970957fa3b0371ebcb4c7a5b7ef84101c3ac5bed7d3eee1236194c SHA512 425d3e0fc56006e9371c31078d32f6fd135a038b13ec1c4f1b809f68e73e8fd15e4a4c2d027c0b4a2cee9ef0dda348b478cc855fb123eb05e4157564ab9de12a
+DIST r8168-8.048.02.tar.bz2 109232 BLAKE2B 24c04cd0e47fce427ef7de1a2e41e384fd7c0d8dd028715411cc6f47901b703c824dd9c15bc0ed90f649520bd5fd25dbd48cdc37f94ca8f838a07faa99c8aa84 SHA512 d9d828e4717d2857bd38e8c9b9005de19387419db9bc8d174f5c8a8ea120c81c3094770b164a1f92cec7833696d7a1302332ef473c5852146fff5dbf9a69196e
diff --git a/net-misc/r8168/files/kernel56.patch b/net-misc/r8168/files/kernel56.patch
new file mode 100644
index 00000000000..23bb3a1856a
--- /dev/null
+++ b/net-misc/r8168/files/kernel56.patch
@@ -0,0 +1,50 @@
+--- r8168-8.048.00/src/r8168_n.c 2019-11-26 08:32:35.000000000 +0000
++++ r8168-8.048.00/src/r8168_n.c 2020-03-16 12:34:04.893511463 +0000
+@@ -456,7 +456,13 @@ static void rtl8168_hw_config(struct net
+ static void rtl8168_hw_start(struct net_device *dev);
+ static int rtl8168_close(struct net_device *dev);
+ static void rtl8168_set_rx_mode(struct net_device *dev);
++
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5,6,0)
+ static void rtl8168_tx_timeout(struct net_device *dev);
++#else
++static void rtl8168_tx_timeout(struct net_device *dev, unsigned int txqueue);
++#endif
++
+ static struct net_device_stats *rtl8168_get_stats(struct net_device *dev);
+ static int rtl8168_rx_interrupt(struct net_device *, struct rtl8168_private *, napi_budget);
+ static int rtl8168_change_mtu(struct net_device *dev, int new_mtu);
+@@ -1616,12 +1622,21 @@ static int rtl8168_proc_open(struct inod
+ return single_open(file, show, dev);
+ }
+
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5,6,0)
+ static const struct file_operations rtl8168_proc_fops = {
+ .open = rtl8168_proc_open,
+ .read = seq_read,
+ .llseek = seq_lseek,
+ .release = single_release,
+ };
++#else
++static const struct proc_ops rtl8168_proc_fops = {
++ .proc_open = rtl8168_proc_open,
++ .proc_read = seq_read,
++ .proc_lseek = seq_lseek,
++ .proc_release = single_release,
++};
++#endif
+ #endif
+
+ /*
+@@ -27844,7 +27859,11 @@ static void rtl8168_reset_task(struct wo
+ }
+
+ static void
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5,6,0)
+ rtl8168_tx_timeout(struct net_device *dev)
++#else
++rtl8168_tx_timeout(struct net_device *dev, unsigned int txqueue)
++#endif
+ {
+ struct rtl8168_private *tp = netdev_priv(dev);
+ unsigned long flags;
\ No newline at end of file
diff --git a/net-misc/r8168/r8168-8.048.02.ebuild b/net-misc/r8168/r8168-8.048.02.ebuild
new file mode 100644
index 00000000000..299ab1010e4
--- /dev/null
+++ b/net-misc/r8168/r8168-8.048.02.ebuild
@@ -0,0 +1,36 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit linux-info linux-mod
+
+DESCRIPTION="r8168 driver for Realtek 8111/8168 PCI-E NICs"
+HOMEPAGE="https://www.realtek.com/en/component/zoo/category/network-interface-controllers-10-100-1000m-gigabit-ethernet-pci-express-software"
+
+# "GBE Ethernet LINUX driver r8168 for kernel up to 4.15" from above link,
+# we need to mirror it to avoid users from needing to fill a captcha to
+# download
+SRC_URI="https://dev.gentoo.org/~pacho/${PN}/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+MODULE_NAMES="r8168(net:${S}/src)"
+BUILD_TARGETS="modules"
+
+CONFIG_CHECK="!R8169"
+ERROR_R8169="${P} requires Realtek 8169 PCI Gigabit Ethernet adapter (CONFIG_R8169) to be DISABLED"
+
+PATCHES=( "${FILESDIR}/kernel56.patch" )
+
+pkg_setup() {
+ linux-mod_pkg_setup
+ BUILD_PARAMS="KERNELDIR=${KV_DIR}"
+}
+
+src_install() {
+ linux-mod_src_install
+ einstalldocs
+}
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: net-misc/r8168/files/, net-misc/r8168/
@ 2022-03-27 9:30 Pacho Ramos
0 siblings, 0 replies; 10+ messages in thread
From: Pacho Ramos @ 2022-03-27 9:30 UTC (permalink / raw
To: gentoo-commits
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}"
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: net-misc/r8168/files/, net-misc/r8168/
@ 2022-05-26 9:44 Pacho Ramos
0 siblings, 0 replies; 10+ messages in thread
From: Pacho Ramos @ 2022-05-26 9:44 UTC (permalink / raw
To: gentoo-commits
commit: ae9bc85fa88f2bbd5e806d623a2bb902987f744b
Author: Pacho Ramos <pacho <AT> gentoo <DOT> org>
AuthorDate: Thu May 26 09:23:50 2022 +0000
Commit: Pacho Ramos <pacho <AT> gentoo <DOT> org>
CommitDate: Thu May 26 09:43:52 2022 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ae9bc85f
net-misc/r8168: add 8.050.02
Also fix build with kernel 5.18
Thanks-to: Peter Levine
Closes: https://bugs.gentoo.org/847154
Signed-off-by: Pacho Ramos <pacho <AT> gentoo.org>
net-misc/r8168/Manifest | 1 +
net-misc/r8168/files/r8168-8.050.02-5.18-fix.patch | 51 ++++++++++++++++++++++
net-misc/r8168/r8168-8.050.02.ebuild | 40 +++++++++++++++++
3 files changed, 92 insertions(+)
diff --git a/net-misc/r8168/Manifest b/net-misc/r8168/Manifest
index 497e72dd1f42..256b1a5092df 100644
--- a/net-misc/r8168/Manifest
+++ b/net-misc/r8168/Manifest
@@ -1,2 +1,3 @@
DIST r8168-8.049.02.tar.bz2 113195 BLAKE2B ee34ac7249d732a867384fdd2c87321a513e7b2770c79d0c13666edca7d4bf752d853d7f91554d7ee716b3f30ec5f3a69aed96221a79a60282f0b6d2f70f05d6 SHA512 8ccb69ab533cde6ff88f0e8af2dd66f7e6ce9467020a727d47748c5109b64d6d14eee6bc151db5ddbe70a476a2def5f2faf3871902b335074f43dd05484d39e0
DIST r8168-8.050.00.tar.bz2 115418 BLAKE2B b3e24d0548494f1904b5d3341994bdda35a05a71dce85a64c9e87cbde7f40807b0b1bcd78401928ff7625e67606918d5c844e8254cbbab62ed3f8e8058a3f15b SHA512 04043fd01ea877ea9f422b8f2319630b8664a49b41363039fc725ed382dc5afb732dda59ba63021a94c50b12ed2f0b3585cd668d969bc06fdc40d08420dbdb95
+DIST r8168-8.050.02.tar.bz2 115331 BLAKE2B 37690019e6b8642929e167df426e1a5e3c4d805ab812541018fa950084061ad971648b867dc5723e611c43fecb0f04d5915bb8199006ac50640aef5a9c2eb41c SHA512 54d7080b598933c7d24ca513019c6c971f7472320d474ab4ed4148d859886f942e52896d0b98046a780319f708847596e6bc081a88a9c11e075593c97eb831b2
diff --git a/net-misc/r8168/files/r8168-8.050.02-5.18-fix.patch b/net-misc/r8168/files/r8168-8.050.02-5.18-fix.patch
new file mode 100644
index 000000000000..442fa1c3eadf
--- /dev/null
+++ b/net-misc/r8168/files/r8168-8.050.02-5.18-fix.patch
@@ -0,0 +1,51 @@
+Functions like 'pci_dma_sync_single_for_device', 'pci_set_dma_mask', and 'pci_set_consistent_dma_mask'
+no longer exist in 5.18.0.
+Fix similar to https://www.mail-archive.com/linux-kernel@vger.kernel.org/msg2238850.html
+
+--- a/src/r8168_n.c
++++ b/src/r8168_n.c
+@@ -3698,7 +3698,11 @@
+ txd->opts2 = 0;
+ while (1) {
+ memset(tmpAddr, pattern++, len - 14);
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5,18,0)
+ pci_dma_sync_single_for_device(tp->pci_dev,
++#else
++ dma_sync_single_for_device(&tp->pci_dev->dev,
++#endif
+ le64_to_cpu(mapping),
+ len, DMA_TO_DEVICE);
+ txd->opts1 = cpu_to_le32(DescOwn | FirstFrag | LastFrag | len);
+@@ -3726,7 +3730,11 @@
+ if (rx_len == len) {
+ dma_sync_single_for_cpu(tp_to_dev(tp), le64_to_cpu(rxd->addr), tp->rx_buf_sz, DMA_FROM_DEVICE);
+ i = memcmp(skb->data, rx_skb->data, rx_len);
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5,18,0)
+ pci_dma_sync_single_for_device(tp->pci_dev, le64_to_cpu(rxd->addr), tp->rx_buf_sz, DMA_FROM_DEVICE);
++#else
++ dma_sync_single_for_device(&tp->pci_dev->dev, le64_to_cpu(rxd->addr), tp->rx_buf_sz, DMA_FROM_DEVICE);
++#endif
+ if (i == 0) {
+ // dev_printk(KERN_INFO, tp_to_dev(tp), "loopback test finished\n",rx_len,len);
+ break;
+@@ -26408,11 +26416,20 @@
+
+ if ((sizeof(dma_addr_t) > 4) &&
+ use_dac &&
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5,18,0)
+ !pci_set_dma_mask(pdev, DMA_BIT_MASK(64)) &&
+ !pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(64))) {
++#else
++ !dma_set_mask(&pdev->dev, DMA_BIT_MASK(64)) &&
++ !dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(64))) {
++#endif
+ dev->features |= NETIF_F_HIGHDMA;
+ } else {
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5,18,0)
+ rc = pci_set_dma_mask(pdev, DMA_BIT_MASK(32));
++#else
++ rc = dma_set_mask(&pdev->dev, DMA_BIT_MASK(32));
++#endif
+ if (rc < 0) {
+ #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,0)
+ if (netif_msg_probe(tp))
diff --git a/net-misc/r8168/r8168-8.050.02.ebuild b/net-misc/r8168/r8168-8.050.02.ebuild
new file mode 100644
index 000000000000..33393afdbf6a
--- /dev/null
+++ b/net-misc/r8168/r8168-8.050.02.ebuild
@@ -0,0 +1,40 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit linux-info linux-mod
+
+DESCRIPTION="r8168 driver for Realtek 8111/8168 PCI-E NICs"
+HOMEPAGE="https://www.realtek.com/en/component/zoo/category/network-interface-controllers-10-100-1000m-gigabit-ethernet-pci-express-software"
+
+# "GBE Ethernet LINUX driver r8168 for kernel up to 5.17" from above link,
+# we need to mirror it to avoid users from needing to fill a captcha to
+# download
+SRC_URI="https://dev.gentoo.org/~pacho/${PN}/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+MODULE_NAMES="r8168(net:${S}/src)"
+BUILD_TARGETS="modules"
+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.050.02-5.18-fix.patch"
+)
+
+pkg_setup() {
+ linux-mod_pkg_setup
+ BUILD_PARAMS="KERNELDIR=${KV_DIR}"
+ BUILD_PARAMS+=" ENABLE_USE_FIRMWARE_FILE=$(usex use-firmware y n)"
+}
+
+src_install() {
+ linux-mod_src_install
+ einstalldocs
+}
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: net-misc/r8168/files/, net-misc/r8168/
@ 2022-08-02 17:36 Pacho Ramos
0 siblings, 0 replies; 10+ messages in thread
From: Pacho Ramos @ 2022-08-02 17:36 UTC (permalink / raw
To: gentoo-commits
commit: b74666ef91c8b5a079782b77e86e3fb01ffb5807
Author: Pacho Ramos <pacho <AT> gentoo <DOT> org>
AuthorDate: Tue Aug 2 17:35:52 2022 +0000
Commit: Pacho Ramos <pacho <AT> gentoo <DOT> org>
CommitDate: Tue Aug 2 17:35:52 2022 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b74666ef
net-misc/r8168: Fix kernel 5.19 support
Thanks-to: Peter Levine
Closes: https://bugs.gentoo.org/862609
Signed-off-by: Pacho Ramos <pacho <AT> gentoo.org>
net-misc/r8168/files/r8168-8.050.03-5.19-fix.patch | 23 ++++++++++++++++++++++
net-misc/r8168/r8168-8.050.03.ebuild | 1 +
2 files changed, 24 insertions(+)
diff --git a/net-misc/r8168/files/r8168-8.050.03-5.19-fix.patch b/net-misc/r8168/files/r8168-8.050.03-5.19-fix.patch
new file mode 100644
index 000000000000..d0f5d30ada06
--- /dev/null
+++ b/net-misc/r8168/files/r8168-8.050.03-5.19-fix.patch
@@ -0,0 +1,23 @@
+From: Andrea Righi <andrea.righi@canonical.com>
+Subject: support linux 5.19
+
+Index: r8168-8.050.03/src/r8168_n.c
+===================================================================
+--- r8168-8.050.03.orig/src/r8168_n.c
++++ r8168-8.050.03/src/r8168_n.c
+@@ -116,6 +116,15 @@
+ #define FIRMWARE_8168FP_3 "rtl_nic/rtl8168fp-3.fw"
+ #define FIRMWARE_8168FP_4 "rtl_nic/rtl8168fp-4.fw"
+
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0)
++static inline void netif_set_gso_max_size(struct net_device *dev,
++ unsigned int size)
++{
++ /* dev->gso_max_size is read locklessly from sk_setup_caps() */
++ WRITE_ONCE(dev->gso_max_size, size);
++}
++#endif
++
+ /* Maximum number of multicast addresses to filter (vs. Rx-all-multicast).
+ The RTL chips use a 64 element hash table based on the Ethernet CRC. */
+ static const int multicast_filter_limit = 32;
diff --git a/net-misc/r8168/r8168-8.050.03.ebuild b/net-misc/r8168/r8168-8.050.03.ebuild
index 33393afdbf6a..b2ff7ea4f8a6 100644
--- a/net-misc/r8168/r8168-8.050.03.ebuild
+++ b/net-misc/r8168/r8168-8.050.03.ebuild
@@ -26,6 +26,7 @@ WARNING_R8169="CONFIG_R8169 is enabled. ${P} will not be loaded unless kernel dr
PATCHES=(
"${FILESDIR}/r8168-8.050.02-5.18-fix.patch"
+ "${FILESDIR}/r8168-8.050.03-5.19-fix.patch"
)
pkg_setup() {
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: net-misc/r8168/files/, net-misc/r8168/
@ 2022-12-04 14:50 Pacho Ramos
0 siblings, 0 replies; 10+ messages in thread
From: Pacho Ramos @ 2022-12-04 14:50 UTC (permalink / raw
To: gentoo-commits
commit: aa794c7213cd2c028fd48d097c518009765dd266
Author: Pacho Ramos <pacho <AT> gentoo <DOT> org>
AuthorDate: Sun Dec 4 12:58:59 2022 +0000
Commit: Pacho Ramos <pacho <AT> gentoo <DOT> org>
CommitDate: Sun Dec 4 14:49:16 2022 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=aa794c72
net-misc/r8168: drop 8.049.02-r1
Signed-off-by: Pacho Ramos <pacho <AT> gentoo.org>
net-misc/r8168/Manifest | 1 -
net-misc/r8168/files/r8168-8.049.02-5.17-fix.patch | 70 ----------------------
net-misc/r8168/r8168-8.049.02-r1.ebuild | 39 ------------
3 files changed, 110 deletions(-)
diff --git a/net-misc/r8168/Manifest b/net-misc/r8168/Manifest
index a1d893baeda4..0770f6988b67 100644
--- a/net-misc/r8168/Manifest
+++ b/net-misc/r8168/Manifest
@@ -1,3 +1,2 @@
-DIST r8168-8.049.02.tar.bz2 113195 BLAKE2B ee34ac7249d732a867384fdd2c87321a513e7b2770c79d0c13666edca7d4bf752d853d7f91554d7ee716b3f30ec5f3a69aed96221a79a60282f0b6d2f70f05d6 SHA512 8ccb69ab533cde6ff88f0e8af2dd66f7e6ce9467020a727d47748c5109b64d6d14eee6bc151db5ddbe70a476a2def5f2faf3871902b335074f43dd05484d39e0
DIST r8168-8.050.03.tar.bz2 115525 BLAKE2B 9681417c5ded9d089259d80226a16789beaacf31902d896410d581927468c44486a4c496e45d9973851ccca2d4c408159064452849b03347c789390b2b23e57b SHA512 b4c0af2f4e6b9dc36f2db9e33f465d8598afa0b28577ea1f016617e853af00cf41886941fd8173a5b035e219d87a0fae28771230079c88f34039efe669c1e1c6
DIST r8168-8.051.02.tar.bz2 115969 BLAKE2B 28b809c0330920ee0db7a8f8d41e178882531cd0a6793efeadd9670b1a9b5cbe903061073fd1d461f4234feb41249a244f9ef35cdbb780da498e5a6d6f1a5490 SHA512 2f29a413e7db2b7295ea0a970b3385de1dfd6e41e1820097355687daa5c8d155c1cf6115c72875bff4f366365579bffc81733469a62d76f437065b7e514387ca
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
deleted file mode 100644
index 9e4e77615458..000000000000
--- a/net-misc/r8168/files/r8168-8.049.02-5.17-fix.patch
+++ /dev/null
@@ -1,70 +0,0 @@
-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
deleted file mode 100644
index 6686979b10d9..000000000000
--- a/net-misc/r8168/r8168-8.049.02-r1.ebuild
+++ /dev/null
@@ -1,39 +0,0 @@
-# Copyright 1999-2022 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-inherit linux-info linux-mod
-
-DESCRIPTION="r8168 driver for Realtek 8111/8168 PCI-E NICs"
-HOMEPAGE="https://www.realtek.com/en/component/zoo/category/network-interface-controllers-10-100-1000m-gigabit-ethernet-pci-express-software"
-
-# "GBE Ethernet LINUX driver r8168 for kernel up to 5.6" from above link,
-# we need to mirror it to avoid users from needing to fill a captcha to
-# download
-SRC_URI="https://dev.gentoo.org/~pacho/${PN}/${P}.tar.bz2"
-
-LICENSE="GPL-2"
-SLOT="0"
-KEYWORDS="amd64 x86"
-
-MODULE_NAMES="r8168(net:${S}/src)"
-BUILD_TARGETS="modules"
-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}"
- BUILD_PARAMS+=" ENABLE_USE_FIRMWARE_FILE=$(usex use-firmware y n)"
-}
-
-src_install() {
- linux-mod_src_install
- einstalldocs
-}
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: net-misc/r8168/files/, net-misc/r8168/
@ 2022-12-19 9:49 Pacho Ramos
0 siblings, 0 replies; 10+ messages in thread
From: Pacho Ramos @ 2022-12-19 9:49 UTC (permalink / raw
To: gentoo-commits
commit: ac9de419ed2d6f29b84de420c318879164c38a08
Author: Pacho Ramos <pacho <AT> gentoo <DOT> org>
AuthorDate: Mon Dec 19 09:49:13 2022 +0000
Commit: Pacho Ramos <pacho <AT> gentoo <DOT> org>
CommitDate: Mon Dec 19 09:49:13 2022 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ac9de419
net-misc/r8168: Fix support for kernel 6.1
Signed-off-by: Pacho Ramos <pacho <AT> gentoo.org>
net-misc/r8168/files/r8168-8.051.02-6.1-fix.patch | 25 +++++++++++++++++++++++
net-misc/r8168/r8168-8.051.02.ebuild | 4 ++++
2 files changed, 29 insertions(+)
diff --git a/net-misc/r8168/files/r8168-8.051.02-6.1-fix.patch b/net-misc/r8168/files/r8168-8.051.02-6.1-fix.patch
new file mode 100644
index 000000000000..9a9e3e539259
--- /dev/null
+++ b/net-misc/r8168/files/r8168-8.051.02-6.1-fix.patch
@@ -0,0 +1,25 @@
+From 39dd0fd2e5dc45cd63113f33a9890e36c304916d Mon Sep 17 00:00:00 2001
+From: zu1k <i@zu1k.com>
+Date: Sat, 29 Oct 2022 21:57:39 +0800
+Subject: [PATCH] Adapted for Linux 6.1
+
+---
+ src/r8168.h | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/src/r8168.h b/src/r8168.h
+index 662974a..baf48c6 100755
+--- a/src/r8168.h
++++ b/src/r8168.h
+@@ -561,7 +561,11 @@ typedef int *napi_budget;
+ typedef struct napi_struct *napi_ptr;
+ typedef int napi_budget;
+
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0)
++#define RTL_NAPI_CONFIG(ndev, priv, function, weight) netif_napi_add(ndev, &priv->napi, function)
++#else
+ #define RTL_NAPI_CONFIG(ndev, priv, function, weight) netif_napi_add(ndev, &priv->napi, function, weight)
++#endif
+ #define RTL_NAPI_QUOTA(budget, ndev) min(budget, budget)
+ #define RTL_GET_PRIV(stuct_ptr, priv_struct) container_of(stuct_ptr, priv_struct, stuct_ptr)
+ #define RTL_GET_NETDEV(priv_ptr) struct net_device *dev = priv_ptr->dev;
diff --git a/net-misc/r8168/r8168-8.051.02.ebuild b/net-misc/r8168/r8168-8.051.02.ebuild
index 4258fbb99cdb..853cd629f555 100644
--- a/net-misc/r8168/r8168-8.051.02.ebuild
+++ b/net-misc/r8168/r8168-8.051.02.ebuild
@@ -24,6 +24,10 @@ 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}/${PN}-8.051.02-6.1-fix.patch"
+)
+
pkg_setup() {
linux-mod_pkg_setup
BUILD_PARAMS="KERNELDIR=${KV_DIR}"
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: net-misc/r8168/files/, net-misc/r8168/
@ 2023-02-26 15:51 Pacho Ramos
0 siblings, 0 replies; 10+ messages in thread
From: Pacho Ramos @ 2023-02-26 15:51 UTC (permalink / raw
To: gentoo-commits
commit: a645c864b8322a334317042707bd2b66ed0e8638
Author: Pacho Ramos <pacho <AT> gentoo <DOT> org>
AuthorDate: Sun Feb 26 15:23:31 2023 +0000
Commit: Pacho Ramos <pacho <AT> gentoo <DOT> org>
CommitDate: Sun Feb 26 15:51:32 2023 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a645c864
net-misc/r8168: drop 8.050.03
Signed-off-by: Pacho Ramos <pacho <AT> gentoo.org>
net-misc/r8168/Manifest | 1 -
net-misc/r8168/files/r8168-8.050.02-5.18-fix.patch | 51 ----------------------
net-misc/r8168/files/r8168-8.050.03-5.19-fix.patch | 23 ----------
net-misc/r8168/r8168-8.050.03.ebuild | 41 -----------------
4 files changed, 116 deletions(-)
diff --git a/net-misc/r8168/Manifest b/net-misc/r8168/Manifest
index 0770f6988b67..df4b080d77e0 100644
--- a/net-misc/r8168/Manifest
+++ b/net-misc/r8168/Manifest
@@ -1,2 +1 @@
-DIST r8168-8.050.03.tar.bz2 115525 BLAKE2B 9681417c5ded9d089259d80226a16789beaacf31902d896410d581927468c44486a4c496e45d9973851ccca2d4c408159064452849b03347c789390b2b23e57b SHA512 b4c0af2f4e6b9dc36f2db9e33f465d8598afa0b28577ea1f016617e853af00cf41886941fd8173a5b035e219d87a0fae28771230079c88f34039efe669c1e1c6
DIST r8168-8.051.02.tar.bz2 115969 BLAKE2B 28b809c0330920ee0db7a8f8d41e178882531cd0a6793efeadd9670b1a9b5cbe903061073fd1d461f4234feb41249a244f9ef35cdbb780da498e5a6d6f1a5490 SHA512 2f29a413e7db2b7295ea0a970b3385de1dfd6e41e1820097355687daa5c8d155c1cf6115c72875bff4f366365579bffc81733469a62d76f437065b7e514387ca
diff --git a/net-misc/r8168/files/r8168-8.050.02-5.18-fix.patch b/net-misc/r8168/files/r8168-8.050.02-5.18-fix.patch
deleted file mode 100644
index 442fa1c3eadf..000000000000
--- a/net-misc/r8168/files/r8168-8.050.02-5.18-fix.patch
+++ /dev/null
@@ -1,51 +0,0 @@
-Functions like 'pci_dma_sync_single_for_device', 'pci_set_dma_mask', and 'pci_set_consistent_dma_mask'
-no longer exist in 5.18.0.
-Fix similar to https://www.mail-archive.com/linux-kernel@vger.kernel.org/msg2238850.html
-
---- a/src/r8168_n.c
-+++ b/src/r8168_n.c
-@@ -3698,7 +3698,11 @@
- txd->opts2 = 0;
- while (1) {
- memset(tmpAddr, pattern++, len - 14);
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(5,18,0)
- pci_dma_sync_single_for_device(tp->pci_dev,
-+#else
-+ dma_sync_single_for_device(&tp->pci_dev->dev,
-+#endif
- le64_to_cpu(mapping),
- len, DMA_TO_DEVICE);
- txd->opts1 = cpu_to_le32(DescOwn | FirstFrag | LastFrag | len);
-@@ -3726,7 +3730,11 @@
- if (rx_len == len) {
- dma_sync_single_for_cpu(tp_to_dev(tp), le64_to_cpu(rxd->addr), tp->rx_buf_sz, DMA_FROM_DEVICE);
- i = memcmp(skb->data, rx_skb->data, rx_len);
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(5,18,0)
- pci_dma_sync_single_for_device(tp->pci_dev, le64_to_cpu(rxd->addr), tp->rx_buf_sz, DMA_FROM_DEVICE);
-+#else
-+ dma_sync_single_for_device(&tp->pci_dev->dev, le64_to_cpu(rxd->addr), tp->rx_buf_sz, DMA_FROM_DEVICE);
-+#endif
- if (i == 0) {
- // dev_printk(KERN_INFO, tp_to_dev(tp), "loopback test finished\n",rx_len,len);
- break;
-@@ -26408,11 +26416,20 @@
-
- if ((sizeof(dma_addr_t) > 4) &&
- use_dac &&
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(5,18,0)
- !pci_set_dma_mask(pdev, DMA_BIT_MASK(64)) &&
- !pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(64))) {
-+#else
-+ !dma_set_mask(&pdev->dev, DMA_BIT_MASK(64)) &&
-+ !dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(64))) {
-+#endif
- dev->features |= NETIF_F_HIGHDMA;
- } else {
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(5,18,0)
- rc = pci_set_dma_mask(pdev, DMA_BIT_MASK(32));
-+#else
-+ rc = dma_set_mask(&pdev->dev, DMA_BIT_MASK(32));
-+#endif
- if (rc < 0) {
- #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,0)
- if (netif_msg_probe(tp))
diff --git a/net-misc/r8168/files/r8168-8.050.03-5.19-fix.patch b/net-misc/r8168/files/r8168-8.050.03-5.19-fix.patch
deleted file mode 100644
index d0f5d30ada06..000000000000
--- a/net-misc/r8168/files/r8168-8.050.03-5.19-fix.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-From: Andrea Righi <andrea.righi@canonical.com>
-Subject: support linux 5.19
-
-Index: r8168-8.050.03/src/r8168_n.c
-===================================================================
---- r8168-8.050.03.orig/src/r8168_n.c
-+++ r8168-8.050.03/src/r8168_n.c
-@@ -116,6 +116,15 @@
- #define FIRMWARE_8168FP_3 "rtl_nic/rtl8168fp-3.fw"
- #define FIRMWARE_8168FP_4 "rtl_nic/rtl8168fp-4.fw"
-
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0)
-+static inline void netif_set_gso_max_size(struct net_device *dev,
-+ unsigned int size)
-+{
-+ /* dev->gso_max_size is read locklessly from sk_setup_caps() */
-+ WRITE_ONCE(dev->gso_max_size, size);
-+}
-+#endif
-+
- /* Maximum number of multicast addresses to filter (vs. Rx-all-multicast).
- The RTL chips use a 64 element hash table based on the Ethernet CRC. */
- static const int multicast_filter_limit = 32;
diff --git a/net-misc/r8168/r8168-8.050.03.ebuild b/net-misc/r8168/r8168-8.050.03.ebuild
deleted file mode 100644
index 6c2652606478..000000000000
--- a/net-misc/r8168/r8168-8.050.03.ebuild
+++ /dev/null
@@ -1,41 +0,0 @@
-# Copyright 1999-2022 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-inherit linux-info linux-mod
-
-DESCRIPTION="r8168 driver for Realtek 8111/8168 PCI-E NICs"
-HOMEPAGE="https://www.realtek.com/en/component/zoo/category/network-interface-controllers-10-100-1000m-gigabit-ethernet-pci-express-software"
-
-# "GBE Ethernet LINUX driver r8168 for kernel up to 5.17" from above link,
-# we need to mirror it to avoid users from needing to fill a captcha to
-# download
-SRC_URI="https://dev.gentoo.org/~pacho/${PN}/${P}.tar.bz2"
-
-LICENSE="GPL-2"
-SLOT="0"
-KEYWORDS="amd64 x86"
-
-MODULE_NAMES="r8168(net:${S}/src)"
-BUILD_TARGETS="modules"
-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.050.02-5.18-fix.patch"
- "${FILESDIR}/r8168-8.050.03-5.19-fix.patch"
-)
-
-pkg_setup() {
- linux-mod_pkg_setup
- BUILD_PARAMS="KERNELDIR=${KV_DIR}"
- BUILD_PARAMS+=" ENABLE_USE_FIRMWARE_FILE=$(usex use-firmware y n)"
-}
-
-src_install() {
- linux-mod_src_install
- einstalldocs
-}
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: net-misc/r8168/files/, net-misc/r8168/
@ 2023-08-19 22:32 Conrad Kostecki
0 siblings, 0 replies; 10+ messages in thread
From: Conrad Kostecki @ 2023-08-19 22:32 UTC (permalink / raw
To: gentoo-commits
commit: 13f43b73752f9cc8630655794307f7b7f77f97c5
Author: Karlson2k (Evgeny Grin) <k2k <AT> narod <DOT> ru>
AuthorDate: Tue Aug 15 14:34:57 2023 +0000
Commit: Conrad Kostecki <conikost <AT> gentoo <DOT> org>
CommitDate: Sat Aug 19 22:31:56 2023 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=13f43b73
net-misc/r8168: fixed build with kernel 6.4.10+
Bug: https://bugs.gentoo.org/912242
Signed-off-by: Karlson2k (Evgeny Grin) <k2k <AT> narod.ru>
Closes: https://github.com/gentoo/gentoo/pull/32323
Signed-off-by: Conrad Kostecki <conikost <AT> gentoo.org>
net-misc/r8168/files/r8168-8.051.02-6.4.10-fix.patch | 17 +++++++++++++++++
net-misc/r8168/r8168-8.051.02.ebuild | 1 +
2 files changed, 18 insertions(+)
diff --git a/net-misc/r8168/files/r8168-8.051.02-6.4.10-fix.patch b/net-misc/r8168/files/r8168-8.051.02-6.4.10-fix.patch
new file mode 100644
index 000000000000..f10b86447971
--- /dev/null
+++ b/net-misc/r8168/files/r8168-8.051.02-6.4.10-fix.patch
@@ -0,0 +1,17 @@
+Fixed build with kernels 6.4.10+
+Gentoo Bug: https://bugs.gentoo.org/912242
+See also: https://github.com/mtorromeo/r8168/issues/54
+
+---
+--- a/src/r8168_n.c 2023-08-13 03:33:06.977422132 +0400
++++ b/src/r8168_n.c 2023-08-13 03:38:39.767005101 +0400
+@@ -81,6 +81,10 @@
+ #include <linux/mdio.h>
+ #endif
+
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,4,10)
++#include <net/gso.h>
++#endif
++
+ #include <asm/io.h>
+ #include <asm/irq.h>
diff --git a/net-misc/r8168/r8168-8.051.02.ebuild b/net-misc/r8168/r8168-8.051.02.ebuild
index 1b19ce47db5e..8f0c5b529c63 100644
--- a/net-misc/r8168/r8168-8.051.02.ebuild
+++ b/net-misc/r8168/r8168-8.051.02.ebuild
@@ -26,6 +26,7 @@ WARNING_R8169="CONFIG_R8169 is enabled. ${P} will not be loaded unless kernel dr
PATCHES=(
"${FILESDIR}/${PN}-8.051.02-6.1-fix.patch"
+ "${FILESDIR}/${P}-6.4.10-fix.patch" # bug 912242
)
pkg_setup() {
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: net-misc/r8168/files/, net-misc/r8168/
@ 2024-06-16 9:38 Pacho Ramos
0 siblings, 0 replies; 10+ messages in thread
From: Pacho Ramos @ 2024-06-16 9:38 UTC (permalink / raw
To: gentoo-commits
commit: 936e16fc58fb445b6dcf1b6b3bdf08444c91f22c
Author: Pacho Ramos <pacho <AT> gentoo <DOT> org>
AuthorDate: Sun Jun 16 09:37:58 2024 +0000
Commit: Pacho Ramos <pacho <AT> gentoo <DOT> org>
CommitDate: Sun Jun 16 09:37:58 2024 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=936e16fc
net-misc/r8168: Fix for kernel 6.9
Closes: https://bugs.gentoo.org/931878
Signed-off-by: Pacho Ramos <pacho <AT> gentoo.org>
.../r8168/files/r8168-8.053.00-kernel-6.9.patch | 119 +++++++++++++++++++++
net-misc/r8168/r8168-8.053.00.ebuild | 2 +
2 files changed, 121 insertions(+)
diff --git a/net-misc/r8168/files/r8168-8.053.00-kernel-6.9.patch b/net-misc/r8168/files/r8168-8.053.00-kernel-6.9.patch
new file mode 100644
index 000000000000..526805cd1166
--- /dev/null
+++ b/net-misc/r8168/files/r8168-8.053.00-kernel-6.9.patch
@@ -0,0 +1,119 @@
+From 94426e16197c244d03aad0434e3490acdaa830fe Mon Sep 17 00:00:00 2001
+From: Masato TOYOSHIMA <phoepsilonix@phoepsilonix.love>
+Date: Tue, 14 May 2024 14:52:58 +0900
+Subject: [PATCH] Linux 6.9 compat: change to ethtool_keee from ethtool_eee
+
+linux/include/linux/ethtool.h
+
+struct ethtool_ops
+ int (*get_eee)(struct net_device *dev, struct ethtool_keee *eee);
+ int (*set_eee)(struct net_device *dev, struct ethtool_keee *eee);
+
+change to ethtool_keee from ethtool_eee
+ rtl_ethtool_get_eee(struct net_device *net, struct ethtool_keee *edata)
+ rtl_ethtool_set_eee(struct net_device *net, struct ethtool_keee *edata)
+---
+ src/r8168_n.c | 44 ++++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 44 insertions(+)
+
+diff --git a/src/r8168_n.c b/src/r8168_n.c
+index ad63f42..3d67641 100755
+--- a/src/r8168_n.c
++++ b/src/r8168_n.c
+@@ -7941,7 +7941,11 @@ rtl8168_device_lpi_t_to_ethtool_lpi_t(struct rtl8168_private *tp , u32 lpi_timer
+ }
+
+ static int
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,9,0)
++rtl_ethtool_get_eee(struct net_device *net, struct ethtool_keee *edata)
++#else
+ rtl_ethtool_get_eee(struct net_device *net, struct ethtool_eee *edata)
++#endif
+ {
+ struct rtl8168_private *tp = netdev_priv(net);
+ struct ethtool_eee *eee = &tp->eee;
+@@ -7975,9 +7979,15 @@ rtl_ethtool_get_eee(struct net_device *net, struct ethtool_eee *edata)
+
+ edata->eee_enabled = !!val;
+ edata->eee_active = !!(supported & adv & lp);
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,9,0)
++ ethtool_convert_legacy_u32_to_link_mode(edata->supported, supported);
++ ethtool_convert_legacy_u32_to_link_mode(edata->advertised, adv);
++ ethtool_convert_legacy_u32_to_link_mode(edata->lp_advertised, lp);
++#else
+ edata->supported = supported;
+ edata->advertised = adv;
+ edata->lp_advertised = lp;
++#endif
+ edata->tx_lpi_enabled = edata->eee_enabled;
+ edata->tx_lpi_timer = tx_lpi_timer;
+
+@@ -7985,11 +7995,19 @@ rtl_ethtool_get_eee(struct net_device *net, struct ethtool_eee *edata)
+ }
+
+ static int
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,9,0)
++rtl_ethtool_set_eee(struct net_device *net, struct ethtool_keee *edata)
++#else
+ rtl_ethtool_set_eee(struct net_device *net, struct ethtool_eee *edata)
++#endif
+ {
+ struct rtl8168_private *tp = netdev_priv(net);
+ struct ethtool_eee *eee = &tp->eee;
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,9,0)
++ u32 advertising, adv;
++#else
+ u32 advertising;
++#endif
+ int rc = 0;
+
+ if (!rtl8168_support_eee(tp))
+@@ -8013,6 +8031,18 @@ rtl_ethtool_set_eee(struct net_device *net, struct ethtool_eee *edata)
+ }
+
+ advertising = tp->advertising;
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,9,0)
++ ethtool_convert_link_mode_to_legacy_u32(&adv, edata->advertised);
++ if (linkmode_empty(edata->advertised)) {
++ adv = advertising & eee->supported;
++ ethtool_convert_legacy_u32_to_link_mode(edata->advertised, adv);
++ } else if (!linkmode_empty(edata->advertised) & ~advertising) {
++ dev_printk(KERN_WARNING, tp_to_dev(tp), "EEE advertised %x must be a subset of autoneg advertised speeds %x\n",
++ adv, advertising);
++ rc = -EINVAL;
++ goto out;
++ }
++#else
+ if (!edata->advertised) {
+ edata->advertised = advertising & eee->supported;
+ } else if (edata->advertised & ~advertising) {
+@@ -8021,15 +8051,29 @@ rtl_ethtool_set_eee(struct net_device *net, struct ethtool_eee *edata)
+ rc = -EINVAL;
+ goto out;
+ }
++#endif
+
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,9,0)
++ if (!linkmode_empty(edata->advertised) & ~eee->supported) {
++ dev_printk(KERN_WARNING, tp_to_dev(tp), "EEE advertised %x must be a subset of support %x\n",
++ adv, eee->supported);
++ rc = -EINVAL;
++ goto out;
++ }
++#else
+ if (edata->advertised & ~eee->supported) {
+ dev_printk(KERN_WARNING, tp_to_dev(tp), "EEE advertised %x must be a subset of support %x\n",
+ edata->advertised, eee->supported);
+ rc = -EINVAL;
+ goto out;
+ }
++#endif
+
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,9,0)
++ ethtool_convert_link_mode_to_legacy_u32(&eee->advertised, edata->advertised);
++#else
+ eee->advertised = edata->advertised;
++#endif
+ eee->eee_enabled = edata->eee_enabled;
+
+ if (eee->eee_enabled)
diff --git a/net-misc/r8168/r8168-8.053.00.ebuild b/net-misc/r8168/r8168-8.053.00.ebuild
index c413c7299d97..5cb149094196 100644
--- a/net-misc/r8168/r8168-8.053.00.ebuild
+++ b/net-misc/r8168/r8168-8.053.00.ebuild
@@ -18,6 +18,8 @@ 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}"/${PN}-8.053.00-kernel-6.9.patch )
+
src_compile() {
local modlist=( ${PN}=kernel/drivers/net/ethernet/realtek:src )
local modargs=(
^ permalink raw reply related [flat|nested] 10+ messages in thread
end of thread, other threads:[~2024-06-16 9:38 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-02 17:36 [gentoo-commits] repo/gentoo:master commit in: net-misc/r8168/files/, net-misc/r8168/ Pacho Ramos
-- strict thread matches above, loose matches on Subject: below --
2024-06-16 9:38 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-05-26 9:44 Pacho Ramos
2022-03-27 9:30 Pacho Ramos
2020-04-03 18:50 Pacho Ramos
2018-04-27 21:09 James Le Cuirot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox