Projects
home:bitstreamout:Essentials
r8168
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 39
View file
r8168.changes
Changed
@@ -8,6 +8,9 @@ * r8168-kernel_version.patch * r8168-support-dev0x8136.patch * r8168-support-linux-5.19.patch +- Add patch r8168-support-ethtool_keee.patch + * Port struct ethtool_eee to new kernel struct ethtool_eee + and hopefully this works ------------------------------------------------------------------- Thu Mar 28 12:50:15 UTC 2024 - Dr. Werner Fink <werner@suse.de>
View file
r8168.spec
Changed
@@ -32,6 +32,7 @@ Patch0: r8168-kernel_version.patch Patch1: r8168-configuration.patch Patch2: r8168-support-linux-5.19.patch +Patch3: r8168-support-ethtool_keee.patch Patch4: r8168-support-dev0x8136.patch Patch5: r8168-support-linux-L15.5.patch BuildRequires: kernel-source @@ -72,6 +73,11 @@ then %patch -P 5 -b .p5 fi + argc=$(sed -rn '/ethtool_keee/p' /usr/src/linux/include/linux/ethtool.h | wc -l) + if test -n "$argc" -a "$argc" -eq 3 + then +%patch -P 3 -p1 -b .p3 + fi fi if test -e /usr/src/linux/include/net/gso.h then
View file
r8168-support-ethtool_keee.patch
Added
@@ -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)
View file
r8168-support-linux-L15.5.patch
Changed
@@ -4,7 +4,7 @@ --- src/r8168_n.c +++ src/r8168_n.c 2024-03-13 12:10:07.947820999 +0000 -@@ -6986,7 +6986,7 @@ rtl8168_set_ring_size(struct rtl8168_pri +@@ -7234,7 +7234,7 @@ rtl8168_set_ring_size(struct rtl8168_pri } #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) @@ -13,7 +13,7 @@ static void rtl8168_get_ringparam(struct net_device *dev, struct ethtool_ringparam *ring, struct kernel_ethtool_ringparam *kernel_ring, -@@ -6994,7 +6994,7 @@ static void rtl8168_get_ringparam(struct +@@ -7242,7 +7242,7 @@ static void rtl8168_get_ringparam(struct #else static void rtl8168_get_ringparam(struct net_device *dev, struct ethtool_ringparam *ring) @@ -22,7 +22,7 @@ { struct rtl8168_private *tp = netdev_priv(dev); -@@ -7004,7 +7004,7 @@ static void rtl8168_get_ringparam(struct +@@ -7252,7 +7252,7 @@ static void rtl8168_get_ringparam(struct ring->tx_pending = tp->tx_ring0.num_tx_desc; } @@ -31,7 +31,7 @@ static int rtl8168_set_ringparam(struct net_device *dev, struct ethtool_ringparam *ring, struct kernel_ethtool_ringparam *kernel_ring, -@@ -7012,7 +7012,7 @@ static int rtl8168_set_ringparam(struct +@@ -7260,7 +7260,7 @@ static int rtl8168_set_ringparam(struct #else static int rtl8168_set_ringparam(struct net_device *dev, struct ethtool_ringparam *ring) @@ -40,7 +40,7 @@ { struct rtl8168_private *tp = netdev_priv(dev); u32 new_rx_count, new_tx_count; -@@ -26644,11 +26644,11 @@ rtl8168_release_board(struct pci_dev *pd +@@ -26737,11 +26737,11 @@ rtl8168_release_board(struct pci_dev *pd static void rtl8168_hw_address_set(struct net_device *dev, u8 mac_addrMAC_ADDR_LEN) {
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.