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, 16 Jun 2024 09:38:37 +0000 (UTC) [thread overview]
Message-ID: <1718530678.936e16fc58fb445b6dcf1b6b3bdf08444c91f22c.pacho@gentoo> (raw)
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=(
next reply other threads:[~2024-06-16 9:38 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-16 9:38 Pacho Ramos [this message]
-- strict thread matches above, loose matches on Subject: below --
2023-08-19 22:32 [gentoo-commits] repo/gentoo:master commit in: net-misc/r8168/files/, net-misc/r8168/ 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
2022-03-27 9:30 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=1718530678.936e16fc58fb445b6dcf1b6b3bdf08444c91f22c.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