public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: net-misc/r8152/, net-misc/r8152/files/
@ 2022-11-22 23:42 Sam James
  0 siblings, 0 replies; 3+ messages in thread
From: Sam James @ 2022-11-22 23:42 UTC (permalink / raw
  To: gentoo-commits

commit:     075f9be47b5343e90d7d0ab0dc94b3072ce2cd2c
Author:     Jay Faulkner <jay <AT> jvf <DOT> cc>
AuthorDate: Tue Nov 22 22:27:02 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Nov 22 23:29:56 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=075f9be4

net-misc/r8152: Support kernel 6.1

Kernel 6.1 is changing the interface for network drivers. This is a
backwards-compatable fix to the kernel module to make it work on 6.1.

Thanks to ervin.popescu10 <AT> gmail.com for the patch.

Signed-off-by: Jay Faulkner <jay <AT> jvf.cc>
Closes: https://github.com/gentoo/gentoo/pull/28391
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../r8152/files/r8152-2.16.3-kernel-6.1-fix.patch  | 46 ++++++++++++++++++++++
 net-misc/r8152/r8152-2.16.3.ebuild                 |  1 +
 2 files changed, 47 insertions(+)

diff --git a/net-misc/r8152/files/r8152-2.16.3-kernel-6.1-fix.patch b/net-misc/r8152/files/r8152-2.16.3-kernel-6.1-fix.patch
new file mode 100644
index 000000000000..d20db413a16b
--- /dev/null
+++ b/net-misc/r8152/files/r8152-2.16.3-kernel-6.1-fix.patch
@@ -0,0 +1,46 @@
+https://github.com/ervinpopescu/realtek-r8152-linux/commit/0029747c3cf68dbccbebfcb560277040673dfe36.patch
+From: ervinpopescu <ervin.popescu10@gmail.com>
+Date: Tue, 15 Nov 2022 19:30:16 +0200
+Subject: [PATCH] Fix for linux 6.1 without breaking older kernel compatibility
+
+--- a/r8152.c
++++ b/r8152.c
+@@ -17558,7 +17558,6 @@ static void r8156_init(struct r8152 *tp)
+ //		break;
+ //	}
+ 
+-
+ 	r8153b_mcu_spdown_en(tp, false);
+ 
+ 	ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PLA_EXTRA_STATUS);
+@@ -18339,7 +18338,6 @@ int rtl8152_get_settings(struct net_device *netdev, struct ethtool_cmd *cmd)
+ 		cmd->autoneg = AUTONEG_DISABLE;
+ 	}
+ 
+-
+ 	if (netif_running(netdev) && netif_carrier_ok(netdev)) {
+ 		u16 speed = rtl8152_get_speed(tp);
+ 
+@@ -19202,7 +19200,6 @@ static int rtltool_ioctl(struct r8152 *tp, struct ifreq *ifr)
+ 		}
+ 		break;
+ 
+-
+ 	case RTLTOOL_USB_OCP_WRITE_DWORD:
+ 		if (!tp->rtk_enable_diag && net_ratelimit())
+ 			netif_warn(tp, drv, netdev,
+@@ -20708,10 +20705,14 @@ static int rtl8152_probe(struct usb_interface *intf,
+ 
+ 	usb_set_intfdata(intf, tp);
+ 
++#if LINUX_VERSION_CODE < KERNEL_VERSION(6,1,0)
+ 	if (tp->support_2500full)
+ 		netif_napi_add(netdev, &tp->napi, r8152_poll, 256);
+ 	else
+ 		netif_napi_add(netdev, &tp->napi, r8152_poll, 64);
++#else /* LINUX_VERSION_CODE >= KERNEL_VERSION(6,1,0) */
++  netif_napi_add(netdev, &tp->napi, r8152_poll);
++#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(6,1,0) */
+ 
+ 	ret = register_netdev(netdev);
+ 	if (ret != 0) {

diff --git a/net-misc/r8152/r8152-2.16.3.ebuild b/net-misc/r8152/r8152-2.16.3.ebuild
index bb0eb2cef113..ef6a81cfcf22 100644
--- a/net-misc/r8152/r8152-2.16.3.ebuild
+++ b/net-misc/r8152/r8152-2.16.3.ebuild
@@ -24,6 +24,7 @@ IUSE="+center-tap-short"
 # with kernel support patches. It appears to be used by the AUR maintainer.
 PATCHES=(
 	"${FILESDIR}"/${PN}-2.16.3-kernel-5.19-fix.patch
+	"${FILESDIR}"/${PN}-2.16.3-kernel-6.1-fix.patch
 )
 
 pkg_setup() {


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-misc/r8152/, net-misc/r8152/files/
@ 2024-03-29 13:55 Joonas Niilola
  0 siblings, 0 replies; 3+ messages in thread
From: Joonas Niilola @ 2024-03-29 13:55 UTC (permalink / raw
  To: gentoo-commits

commit:     458ac56c274e347c83fc5b87ea376fc1b57ef3a2
Author:     Jay Faulkner <jay <AT> jvf <DOT> cc>
AuthorDate: Mon Mar 25 22:34:35 2024 +0000
Commit:     Joonas Niilola <juippis <AT> gentoo <DOT> org>
CommitDate: Fri Mar 29 13:54:42 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=458ac56c

net-misc/r8152: fix bug 926829; build on kernel >=6.8

Imports patch from bug 926829 to fix build issues on linux kernels 6.8
or newer.

Closes: https://bugs.gentoo.org/926829
Signed-off-by: Jay Faulkner <jay <AT> jvf.cc>
Signed-off-by: Joonas Niilola <juippis <AT> gentoo.org>

 .../files/r8152-2.17.1-kernel-6.8-strscpy.patch    | 32 ++++++++++++++++++++++
 net-misc/r8152/r8152-2.17.1.ebuild                 |  3 +-
 2 files changed, 34 insertions(+), 1 deletion(-)

diff --git a/net-misc/r8152/files/r8152-2.17.1-kernel-6.8-strscpy.patch b/net-misc/r8152/files/r8152-2.17.1-kernel-6.8-strscpy.patch
new file mode 100644
index 000000000000..2449d2883346
--- /dev/null
+++ b/net-misc/r8152/files/r8152-2.17.1-kernel-6.8-strscpy.patch
@@ -0,0 +1,32 @@
+Bug: https://bugs.gentoo.org/926829
+Patch from Christian Bricart to remove strlcpy and replace with strscpy
+so this builds with linux kernels =>6.8.
+
+Signed-Off-By: Jay Faulkner <jay@jvf.cc>
+
+diff -Naur r8152-2.17.1/compatibility.h r8152-2.17.1.patched/compatibility.h
+--- r8152-2.17.1/compatibility.h	2024-03-12 09:43:05.150688533 +0100
++++ r8152-2.17.1.patched/compatibility.h	2024-03-12 09:46:20.913759268 +0100
+@@ -18,6 +18,10 @@
+ #include <net/gso.h>
+ #endif
+ 
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 3, 0)
++#define strscpy strlcpy
++#endif
++
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,31)
+ 	#include <linux/mdio.h>
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,0)
+diff -Naur r8152-2.17.1/r8152.c r8152-2.17.1.patched/r8152.c
+--- r8152-2.17.1/r8152.c	2024-03-12 09:43:05.130688336 +0100
++++ r8152-2.17.1.patched/r8152.c	2024-03-12 09:45:13.264694513 +0100
+@@ -19691,7 +19691,7 @@
+ 		uinfo->idVendor = __le16_to_cpu(udev->descriptor.idVendor);
+ 		uinfo->idProduct = __le16_to_cpu(udev->descriptor.idProduct);
+ 		uinfo->bcdDevice = __le16_to_cpu(udev->descriptor.bcdDevice);
+-		strlcpy(uinfo->devpath, udev->devpath, sizeof(udev->devpath));
++		strscpy(uinfo->devpath, udev->devpath, sizeof(udev->devpath));
+ 		pla_ocp_read(tp, PLA_IDR, sizeof(uinfo->dev_addr),
+ 			     uinfo->dev_addr);
+

diff --git a/net-misc/r8152/r8152-2.17.1.ebuild b/net-misc/r8152/r8152-2.17.1.ebuild
index 7d3f7b0a6e6e..992571ed39c9 100644
--- a/net-misc/r8152/r8152-2.17.1.ebuild
+++ b/net-misc/r8152/r8152-2.17.1.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2023 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=8
@@ -23,6 +23,7 @@ IUSE="+center-tap-short"
 PATCHES=(
 	"${FILESDIR}"/${PN}-2.16.3-kernel-6.4.10-fix.patch
 	"${FILESDIR}"/${PN}-2.16.3-asus-c5000-support.patch
+	"${FILESDIR}"/${PN}-2.17.1-kernel-6.8-strscpy.patch
 )
 
 src_compile() {


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: net-misc/r8152/, net-misc/r8152/files/
@ 2024-06-26  0:38 Yixun Lan
  0 siblings, 0 replies; 3+ messages in thread
From: Yixun Lan @ 2024-06-26  0:38 UTC (permalink / raw
  To: gentoo-commits

commit:     2461e19f9fd55a266a076d24bbf77516dce152a8
Author:     Jay Faulkner <jay <AT> jvf <DOT> cc>
AuthorDate: Tue Jun 11 22:59:06 2024 +0000
Commit:     Yixun Lan <dlan <AT> gentoo <DOT> org>
CommitDate: Wed Jun 26 00:36:55 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2461e19f

net-misc/r8152-2.17.1: fix for 6.9 kernels

Fixes this module for 6.9.x kernels. No impact for older kernels.

Closes: https://bugs.gentoo.org/934074
Closes: https://github.com/gentoo/gentoo/pull/37125
Signed-off-by: Jay Faulkner <jay <AT> jvf.cc>
Signed-off-by: Yixun Lan <dlan <AT> gentoo.org>

 .../r8152/files/r8152-2.17.1-kernel-6.9-fix.patch  | 117 +++++++++++++++++++++
 net-misc/r8152/r8152-2.17.1.ebuild                 |   1 +
 2 files changed, 118 insertions(+)

diff --git a/net-misc/r8152/files/r8152-2.17.1-kernel-6.9-fix.patch b/net-misc/r8152/files/r8152-2.17.1-kernel-6.9-fix.patch
new file mode 100644
index 000000000000..433d3deab34e
--- /dev/null
+++ b/net-misc/r8152/files/r8152-2.17.1-kernel-6.9-fix.patch
@@ -0,0 +1,117 @@
+From: https://github.com/wget/realtek-r8152-linux/pull/41
+From a5b3b4a882a3a637ccfa447dc7d2e84eac9ef0fc Mon Sep 17 00:00:00 2001
+From: "oleg.hoefling" <oleg.hoefling@gmail.com>
+Date: Wed, 22 May 2024 00:44:37 +0200
+Subject: [PATCH] add compat for 6.9.X kernels
+
+Signed-off-by: oleg.hoefling <oleg.hoefling@gmail.com>
+--- a/r8152.c
++++ b/r8152.c
+@@ -950,7 +950,10 @@ struct r8152 {
+ 		void (*up)(struct r8152 *tp);
+ 		void (*down)(struct r8152 *tp);
+ 		void (*unload)(struct r8152 *tp);
+-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0)
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,9,0)
++		int (*eee_get)(struct r8152 *tp, struct ethtool_keee *eee);
++		int (*eee_set)(struct r8152 *tp, struct ethtool_keee *eee);
++#elif LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0)
+ 		int (*eee_get)(struct r8152 *tp, struct ethtool_eee *eee);
+ 		int (*eee_set)(struct r8152 *tp, struct ethtool_eee *eee);
+ #endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0) */
+@@ -19099,7 +19102,11 @@ static void rtl8152_get_strings(struct net_device *dev, u32 stringset, u8 *data)
+ }
+ 
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,0)
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,9,0)
++static int r8152_get_eee(struct r8152 *tp, struct ethtool_keee *eee)
++#else
+ static int r8152_get_eee(struct r8152 *tp, struct ethtool_eee *eee)
++#endif
+ {
+ 	u32 lp, adv, supported = 0;
+ 	u16 val;
+@@ -19115,17 +19122,32 @@ static int r8152_get_eee(struct r8152 *tp, struct ethtool_eee *eee)
+ 
+ 	eee->eee_enabled = tp->eee_en;
+ 	eee->eee_active = !!(supported & adv & lp);
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,9,0)
++	ethtool_convert_legacy_u32_to_link_mode(eee->supported, supported);
++	ethtool_convert_legacy_u32_to_link_mode(eee->advertised, tp->eee_adv);
++	ethtool_convert_legacy_u32_to_link_mode(eee->lp_advertised, lp);
++#else
+ 	eee->supported = supported;
+ 	eee->advertised = tp->eee_adv;
+ 	eee->lp_advertised = lp;
++#endif
+ 
+ 	return 0;
+ }
+ 
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,9,0)
++static int r8152_set_eee(struct r8152 *tp, struct ethtool_keee *eee)
++#else
+ static int r8152_set_eee(struct r8152 *tp, struct ethtool_eee *eee)
++#endif
+ {
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,9,0)
++	u32 advertised = 0;
++	ethtool_convert_link_mode_to_legacy_u32(&advertised, eee->advertised);
++	u16 val = ethtool_adv_to_mmd_eee_adv_t(advertised);
++#else
+ 	u16 val = ethtool_adv_to_mmd_eee_adv_t(eee->advertised);
+-
++#endif
+ 	tp->eee_en = eee->eee_enabled;
+ 	tp->eee_adv = val;
+ 
+@@ -19134,7 +19156,11 @@ static int r8152_set_eee(struct r8152 *tp, struct ethtool_eee *eee)
+ 	return 0;
+ }
+ 
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,9,0)
++static int r8153_get_eee(struct r8152 *tp, struct ethtool_keee *eee)
++#else
+ static int r8153_get_eee(struct r8152 *tp, struct ethtool_eee *eee)
++#endif
+ {
+ 	u32 lp, adv, supported = 0;
+ 	u16 val;
+@@ -19150,15 +19176,25 @@ static int r8153_get_eee(struct r8152 *tp, struct ethtool_eee *eee)
+ 
+ 	eee->eee_enabled = tp->eee_en;
+ 	eee->eee_active = !!(supported & adv & lp);
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,9,0)
++	ethtool_convert_legacy_u32_to_link_mode(eee->supported, supported);
++	ethtool_convert_legacy_u32_to_link_mode(eee->advertised, tp->eee_adv);
++	ethtool_convert_legacy_u32_to_link_mode(eee->lp_advertised, lp);
++#else
+ 	eee->supported = supported;
+ 	eee->advertised = tp->eee_adv;
+ 	eee->lp_advertised = lp;
++#endif
+ 
+ 	return 0;
+ }
+ 
+ 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 r8152 *tp = netdev_priv(net);
+ 	int ret;
+@@ -19185,7 +19221,11 @@ 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 r8152 *tp = netdev_priv(net);
+ 	int ret;

diff --git a/net-misc/r8152/r8152-2.17.1.ebuild b/net-misc/r8152/r8152-2.17.1.ebuild
index 865057ee5c0d..0c0485efb61b 100644
--- a/net-misc/r8152/r8152-2.17.1.ebuild
+++ b/net-misc/r8152/r8152-2.17.1.ebuild
@@ -24,6 +24,7 @@ PATCHES=(
 	"${FILESDIR}"/${PN}-2.16.3-kernel-6.4.10-fix.patch
 	"${FILESDIR}"/${PN}-2.16.3-asus-c5000-support.patch
 	"${FILESDIR}"/${PN}-2.17.1-kernel-6.8-strscpy.patch
+	"${FILESDIR}"/${PN}-2.17.1-kernel-6.9-fix.patch
 )
 
 src_compile() {


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-06-26  0:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-29 13:55 [gentoo-commits] repo/gentoo:master commit in: net-misc/r8152/, net-misc/r8152/files/ Joonas Niilola
  -- strict thread matches above, loose matches on Subject: below --
2024-06-26  0:38 Yixun Lan
2022-11-22 23:42 Sam James

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox