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

commit:     0deab1e144a0472a21613080eb6204eb7d850026
Author:     Jay Faulkner <jay <AT> jvf <DOT> cc>
AuthorDate: Sat Nov 12 05:31:04 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Nov 12 05:52:15 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0deab1e1

net-misc/r8152: New package

r8152 is the driver for many Realtek USB Ethernet NICs.

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

 net-misc/r8152/Manifest                            |  1 +
 .../r8152/files/r8152-2.16.3-kernel-5.19-fix.patch | 43 +++++++++++++++++++
 net-misc/r8152/metadata.xml                        | 17 ++++++++
 net-misc/r8152/r8152-2.16.3.ebuild                 | 49 ++++++++++++++++++++++
 4 files changed, 110 insertions(+)

diff --git a/net-misc/r8152/Manifest b/net-misc/r8152/Manifest
new file mode 100644
index 000000000000..1ea2813cb410
--- /dev/null
+++ b/net-misc/r8152/Manifest
@@ -0,0 +1 @@
+DIST r8152-2.16.3.tar.bz2 73331 BLAKE2B 9e22ee6d9d0197def782f77bfd0c88a2d8827d4f8cc0bbb1a6583ab67533cd07ba79a16cd9350272ed18c733fe809ea1ff70596627abdc65d452bdf817628bc8 SHA512 c37bf5199d3a857c9a7a12f3aa4ecfe9c04b49413aea862a053ebee24c137cd35769e5d5cc7e2bb7dd3bf9057f51ffada0b4e0c53cb3d417e05c8e3fc830705c

diff --git a/net-misc/r8152/files/r8152-2.16.3-kernel-5.19-fix.patch b/net-misc/r8152/files/r8152-2.16.3-kernel-5.19-fix.patch
new file mode 100644
index 000000000000..076d78f46062
--- /dev/null
+++ b/net-misc/r8152/files/r8152-2.16.3-kernel-5.19-fix.patch
@@ -0,0 +1,43 @@
+From: https://github.com/wget/realtek-r8152-linux/commit/6ffb3760c34a904467d70830ac9c10211e8f5d3a
+From: Hyacinthe Cartiaux <hyacinthe.cartiaux@free.fr>
+Date: Wed, 14 Sep 2022 15:13:31 +0200
+Subject: [PATCH] Fix for linux 5.19 without breaking older kernel
+ compatibility
+
+--- a/r8152.c
++++ b/r8152.c
+@@ -20458,9 +20458,13 @@ static ssize_t sg_en_store(struct device *dev, struct device_attribute *attr,
+ 		return -EINVAL;
+ 	}
+ 
+-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26)
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,19,0)
++/* LINUX_VERSION_CODE >= KERNEL_VERSION(5,19,0) */
++	netif_set_tso_max_size(netdev, tso_size);
++#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26)
++/* LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26) */
+ 	netif_set_gso_max_size(netdev, tso_size);
+-#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26) */
++#endif
+ 
+ 	return count;
+ }
+@@ -20620,12 +20624,16 @@ static int rtl8152_probe(struct usb_interface *intf,
+ 	rtl_get_mapt_ver(tp);
+ 
+ 	netdev->ethtool_ops = &ops;
+-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26)
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,19,0)
++/* LINUX_VERSION_CODE >= KERNEL_VERSION(5,19,0) */
++	netif_set_tso_max_size(netdev, RTL_LIMITED_TSO_SIZE);
++#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26)
++/* LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26) */
+ 	if (!tp->sg_use)
+ 		netif_set_gso_max_size(netdev, RTL_LIMITED_TSO_SIZE);
+ #else
+ 	netdev->features &= ~(NETIF_F_TSO | NETIF_F_TSO6);
+-#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26) */
++#endif
+ 
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)
+ 	/* MTU range: 68 - 1500 or 9194 */

diff --git a/net-misc/r8152/metadata.xml b/net-misc/r8152/metadata.xml
new file mode 100644
index 000000000000..b840941c9ce9
--- /dev/null
+++ b/net-misc/r8152/metadata.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+	<maintainer type="person" proxied="yes">
+		<email>jay@jvf.cc</email>
+		<name>Jay Faulkner</name>
+	</maintainer>
+	<maintainer type="project" proxied="proxy">
+		<email>proxy-maint@gentoo.org</email>
+		<name>Proxy Maintainers</name>
+	</maintainer>
+	<longdescription>Official Realtek r8152 linux driver. The following cards are currently supported:
+RTL8156 RTL8156B(S)(G) RTL8153 RTL8153B RTL8154 RTL8154B RTL8152B</longdescription>
+	<use>
+		<flag name="center-tap-short">Enable support for center tap short</flag>
+	</use>
+</pkgmetadata>

diff --git a/net-misc/r8152/r8152-2.16.3.ebuild b/net-misc/r8152/r8152-2.16.3.ebuild
new file mode 100644
index 000000000000..bb0eb2cef113
--- /dev/null
+++ b/net-misc/r8152/r8152-2.16.3.ebuild
@@ -0,0 +1,49 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit udev linux-info linux-mod
+
+DESCRIPTION="r8152 driver for Realtek USB FE / GBE / 2.5G Gaming Ethernet Family Controller"
+HOMEPAGE="https://www.realtek.com/en/component/zoo/category/network-interface-controllers-10-100-1000m-gigabit-ethernet-usb-3-0-software"
+
+SRC_URI="http://rtitwww.realtek.com/rtdrivers/cn/nic1/${P}.tar.bz2"
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+RDEPEND="virtual/udev"
+DEPEND="${RDEPEND}"
+
+MODULE_NAMES="r8152(net/usb:${S})"
+BUILD_TARGETS="modules"
+IUSE="+center-tap-short"
+
+# https://github.com/wget/realtek-r8152-linux/ keeps reasonably up to date
+# with kernel support patches. It appears to be used by the AUR maintainer.
+PATCHES=(
+	"${FILESDIR}"/${PN}-2.16.3-kernel-5.19-fix.patch
+)
+
+pkg_setup() {
+	linux-mod_pkg_setup
+	BUILD_PARAMS="KERNELDIR=${KV_DIR}"
+	BUILD_PARAMS+=" CONFIG_CTAP_SHORT=$(usex center-tap-short on off)"
+}
+
+src_install() {
+	linux-mod_src_install
+	einstalldocs
+	udev_dorules 50-usb-realtek-net.rules
+}
+
+pkg_postinst() {
+	linux-mod_pkg_postinst
+	udev_reload
+}
+
+pkg_postrm() {
+	linux-mod_pkg_postrm
+	udev_reload
+}


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

* [gentoo-commits] repo/gentoo:master commit in: net-misc/r8152/files/, net-misc/r8152/
@ 2023-08-03 16:22 Sam James
  0 siblings, 0 replies; 4+ messages in thread
From: Sam James @ 2023-08-03 16:22 UTC (permalink / raw
  To: gentoo-commits

commit:     a743949c03cbe3003bd4a09bbd3cb905eabdf2bd
Author:     Jay Faulkner <jay <AT> jvf <DOT> cc>
AuthorDate: Sat Jun 17 22:54:22 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu Aug  3 16:22:11 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a743949c

net-misc/r8152: linux-mod-r1, new hardware support

Uses new eclass, linux-mod-r1.
Adds patch with support for ASUS USB C5000 cards.

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

 .../files/r8152-2.16.3-asus-c5000-support.patch    | 23 ++++++++++
 net-misc/r8152/r8152-2.16.3-r1.ebuild              | 52 ++++++++++++++++++++++
 2 files changed, 75 insertions(+)

diff --git a/net-misc/r8152/files/r8152-2.16.3-asus-c5000-support.patch b/net-misc/r8152/files/r8152-2.16.3-asus-c5000-support.patch
new file mode 100644
index 000000000000..4c9d9b9dd601
--- /dev/null
+++ b/net-misc/r8152/files/r8152-2.16.3-asus-c5000-support.patch
@@ -0,0 +1,23 @@
+From: https://github.com/wget/realtek-r8152-linux/issues/30
+From: Mark Taylor <mark.taylor.hq@gmail.com>
+Date: Thu, 8 Jun 2023 14:36:30 -0400
+Subject: [PATCH] Add support for ASUS C2500
+
+--- a/r8152.c
++++ b/r8152.c
+@@ -807,6 +807,7 @@
+ #define VENDOR_ID_LINKSYS		0x13b1
+ #define VENDOR_ID_NVIDIA		0x0955
+ #define VENDOR_ID_TPLINK		0x2357
++#define VENDOR_ID_ASUS			0x0b05
+ 
+ #define MCU_TYPE_PLA			0x0100
+ #define MCU_TYPE_USB			0x0000
+@@ -20846,6 +20847,8 @@
+ 	/* Getac */
+ 	REALTEK_USB_DEVICE(0x2baf, 0x0012),
+ 
++	/* ASUS */
++	REALTEK_USB_DEVICE(VENDOR_ID_ASUS, 0x1976),
+ 	{}
+ };

diff --git a/net-misc/r8152/r8152-2.16.3-r1.ebuild b/net-misc/r8152/r8152-2.16.3-r1.ebuild
new file mode 100644
index 000000000000..cec0f989cc1f
--- /dev/null
+++ b/net-misc/r8152/r8152-2.16.3-r1.ebuild
@@ -0,0 +1,52 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit udev linux-info linux-mod-r1
+
+DESCRIPTION="r8152 driver for Realtek USB FE / GBE / 2.5G Gaming Ethernet Family Controller"
+HOMEPAGE="https://www.realtek.com/en/component/zoo/category/network-interface-controllers-10-100-1000m-gigabit-ethernet-usb-3-0-software"
+SRC_URI="http://rtitwww.realtek.com/rtdrivers/cn/nic1/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+RDEPEND="virtual/udev"
+DEPEND="${RDEPEND}"
+
+IUSE="+center-tap-short"
+
+# https://github.com/wget/realtek-r8152-linux/ keeps reasonably up to date
+# 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
+	"${FILESDIR}"/${PN}-2.16.3-asus-c5000-support.patch
+)
+
+src_compile() {
+	local modlist=( ${PN}=kernel/net/usb:. )
+	local modargs=(
+		KERNELDIR="${KV_OUT_DIR}"
+		CONFIG_CTAP_SHORT="$(usex center-tap-short on off)"
+	)
+
+	linux-mod-r1_src_compile
+}
+
+src_install() {
+	linux-mod-r1_src_install
+	udev_dorules 50-usb-realtek-net.rules
+}
+
+pkg_postinst() {
+	linux-mod-r1_pkg_postinst
+	udev_reload
+}
+
+pkg_postrm() {
+	linux-mod-r1_pkg_postrm
+	udev_reload
+}


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

* [gentoo-commits] repo/gentoo:master commit in: net-misc/r8152/files/, net-misc/r8152/
@ 2023-08-18  3:48 Sam James
  0 siblings, 0 replies; 4+ messages in thread
From: Sam James @ 2023-08-18  3:48 UTC (permalink / raw
  To: gentoo-commits

commit:     ae31310d7938f6ca21ce4dd7ceb76e09a604b755
Author:     Jay Faulkner <jay <AT> jvf <DOT> cc>
AuthorDate: Thu Aug 17 23:06:01 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Aug 18 03:48:04 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ae31310d

net-misc/r8152: Fix build issues for kernel 6.4.10+

Build of this module was broken by a recent kernel update; this change
allows the module to build on 6.4.10+ now as well as against older
kernels.

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

 .../files/r8152-2.16.3-kernel-6.4.10-fix.patch     | 27 ++++++++++++++++++++++
 net-misc/r8152/r8152-2.16.3-r1.ebuild              |  1 +
 net-misc/r8152/r8152-2.16.3.ebuild                 |  1 +
 3 files changed, 29 insertions(+)

diff --git a/net-misc/r8152/files/r8152-2.16.3-kernel-6.4.10-fix.patch b/net-misc/r8152/files/r8152-2.16.3-kernel-6.4.10-fix.patch
new file mode 100644
index 000000000000..016e6c24fb0c
--- /dev/null
+++ b/net-misc/r8152/files/r8152-2.16.3-kernel-6.4.10-fix.patch
@@ -0,0 +1,27 @@
+From: https://github.com/wget/realtek-r8152-linux/pull/33.patch
+From ea0387211368754fb1d3fe9f72ddc766ba2dacce Mon Sep 17 00:00:00 2001
+From: Martin Pecka <peckama2@fel.cvut.cz>
+Date: Mon, 14 Aug 2023 13:44:36 +0200
+Subject: [PATCH] Fixed compatibility with Linux 6.4.10+
+
+---
+ r8152.c | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/r8152.c b/r8152.c
+index c3ba2ca..47aad6d 100644
+--- a/r8152.c
++++ b/r8152.c
+@@ -25,6 +25,12 @@
+ #include <linux/ip.h>
+ #include <linux/ipv6.h>
+ #include <net/ip6_checksum.h>
++// Linux 6.4.10 added net/gso.h
++#if defined __has_include
++#if __has_include (<net/gso.h>)
++#include <net/gso.h>
++#endif
++#endif
+ #include <linux/usb/cdc.h>
+ #include <linux/suspend.h>
+ #include <linux/atomic.h>

diff --git a/net-misc/r8152/r8152-2.16.3-r1.ebuild b/net-misc/r8152/r8152-2.16.3-r1.ebuild
index aeaed97ff0a8..d37cee6a6d2d 100644
--- a/net-misc/r8152/r8152-2.16.3-r1.ebuild
+++ b/net-misc/r8152/r8152-2.16.3-r1.ebuild
@@ -23,6 +23,7 @@ IUSE="+center-tap-short"
 PATCHES=(
 	"${FILESDIR}"/${PN}-2.16.3-kernel-5.19-fix.patch
 	"${FILESDIR}"/${PN}-2.16.3-kernel-6.1-fix.patch
+	"${FILESDIR}"/${PN}-2.16.3-kernel-6.4.10-fix.patch
 	"${FILESDIR}"/${PN}-2.16.3-asus-c5000-support.patch
 )
 

diff --git a/net-misc/r8152/r8152-2.16.3.ebuild b/net-misc/r8152/r8152-2.16.3.ebuild
index b4d899b3c45e..5130aa2dfa1d 100644
--- a/net-misc/r8152/r8152-2.16.3.ebuild
+++ b/net-misc/r8152/r8152-2.16.3.ebuild
@@ -25,6 +25,7 @@ IUSE="+center-tap-short"
 PATCHES=(
 	"${FILESDIR}"/${PN}-2.16.3-kernel-5.19-fix.patch
 	"${FILESDIR}"/${PN}-2.16.3-kernel-6.1-fix.patch
+	"${FILESDIR}"/${PN}-2.16.3-kernel-6.4.10-fix.patch
 )
 
 pkg_setup() {


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

* [gentoo-commits] repo/gentoo:master commit in: net-misc/r8152/files/, net-misc/r8152/
@ 2024-09-20  3:14 Eli Schwartz
  0 siblings, 0 replies; 4+ messages in thread
From: Eli Schwartz @ 2024-09-20  3:14 UTC (permalink / raw
  To: gentoo-commits

commit:     95809b7071235e3b3d637432575a9e8e43e597f6
Author:     Jay Faulkner <jay <AT> jvf <DOT> cc>
AuthorDate: Thu Sep 12 03:33:53 2024 +0000
Commit:     Eli Schwartz <eschwartz <AT> gentoo <DOT> org>
CommitDate: Fri Sep 20 03:06:20 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=95809b70

net-misc/r8152: add 2.18.1, update metadata

This introduces the next version of r8152, but also includes a change in
source. It is no longer possible to download the r8152 sources directly
from realtek without passing a captcha challenge. So, I imported the
tarballs directly into a new github project, documented the source and
the SHA256, and am now using releases from that as the source.

Signed-off-by: Jay Faulkner <jay <AT> jvf.cc>
Closes: https://github.com/gentoo/gentoo/pull/38573
[Eli: dropped stable keyword for bump]
Signed-off-by: Eli Schwartz <eschwartz <AT> gentoo.org>

 net-misc/r8152/Manifest                            |   1 +
 .../r8152/files/r8152-2.18.1-kernel-6.9-fix.patch  | 134 +++++++++++++++++++++
 net-misc/r8152/metadata.xml                        |  10 +-
 net-misc/r8152/r8152-2.18.1.ebuild                 |  55 +++++++++
 4 files changed, 198 insertions(+), 2 deletions(-)

diff --git a/net-misc/r8152/Manifest b/net-misc/r8152/Manifest
index cb9a42a0c0e3..60c6ab7c9d0c 100644
--- a/net-misc/r8152/Manifest
+++ b/net-misc/r8152/Manifest
@@ -1 +1,2 @@
 DIST r8152-2.17.1.tar.bz2 75156 BLAKE2B 05b55ea17a579add9a9abee89db490685086bfe29aeea6cbfbdbb63a81dbee4d1cac151822c178e52febe4bee14a3b5deb20737f671fcdbc6dd6d01938b1d18c SHA512 e465b524ee8aaed12da8258195fb8a4c9fea0862812c1ab268e31ad6ec61444c4f4332d643124063b389fd1df7a271c6c057537d4cbe67188a1a2262b4793f42
+DIST r8152-2.18.1.tar.gz 109919 BLAKE2B 59fa24b599a7378109e162689ef4ff305dc0d3a7f3bc77059d9e2f142e0b4fd01b38fcfdfe7bc1f3aa13805302522632e4305990133d53266d7c268e1f2284c0 SHA512 c99f482bd69b2263943bdb26a8fea40eed09ca21f8f42436937dc5c83239f0fe48a386ea4f2ddf90a193c808503a3709ea9637793d476774107c4757b56c4223

diff --git a/net-misc/r8152/files/r8152-2.18.1-kernel-6.9-fix.patch b/net-misc/r8152/files/r8152-2.18.1-kernel-6.9-fix.patch
new file mode 100644
index 000000000000..155a5aa1100b
--- /dev/null
+++ b/net-misc/r8152/files/r8152-2.18.1-kernel-6.9-fix.patch
@@ -0,0 +1,134 @@
+From 32d026ab6b601cfe2882818921ba379cfbc3031e Mon Sep 17 00:00:00 2001
+From: Jay Faulkner <jay@jvf.cc>
+Date: Wed, 11 Sep 2024 20:30:33 -0700
+Subject: [PATCH] Forward ported version of kernel 6.9.x fix patch
+
+Original version sourced from below; has been forward-ported from
+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>
+---
+ r8152.c | 50 ++++++++++++++++++++++++++++++++++++++++++++++----
+ 1 file changed, 46 insertions(+), 4 deletions(-)
+
+diff --git a/r8152.c b/r8152.c
+index cee3b23..4063525 100644
+--- a/r8152.c
++++ b/r8152.c
+@@ -1006,7 +1006,10 @@ struct r8152 {
+ 		int (*up)(struct r8152 *tp);
+ 		int (*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) */
+@@ -23342,8 +23345,13 @@ 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;
+ 	int ret;
+@@ -23369,17 +23377,33 @@ static int r8152_get_eee(struct r8152 *tp, struct ethtool_eee *eee)
+ 
+ 	eee->eee_enabled = tp->eee_en;
+ 	eee->eee_active = !!(supported & adv & lp);
+-	eee->supported = supported;
++#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 = mmd_eee_adv_to_ethtool_adv_t(tp->eee_adv);
+ 	eee->lp_advertised = lp;
++#endif
+ 
+ out:
+ 	return (ret < 0) ? ret : 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
+ {
+-	u16 val = ethtool_adv_to_mmd_eee_adv_t(eee->advertised);
++#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;
+@@ -23387,7 +23411,11 @@ static int r8152_set_eee(struct r8152 *tp, struct ethtool_eee *eee)
+ 	return rtl_eee_enable(tp, tp->eee_en);
+ }
+ 
++#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;
+@@ -23410,16 +23438,26 @@ static int r8153_get_eee(struct r8152 *tp, struct ethtool_eee *eee)
+ 
+ 	eee->eee_enabled = tp->eee_en;
+ 	eee->eee_active = !!(supported & adv & lp);
+-	eee->supported = supported;
++#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 = mmd_eee_adv_to_ethtool_adv_t(tp->eee_adv);
+ 	eee->lp_advertised = lp;
++#endif
+ 
+ out:
+ 	return (ret < 0) ? ret : 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;
+@@ -23446,7 +23484,11 @@ out:
+ }
+ 
+ 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;
+-- 
+2.46.0
+

diff --git a/net-misc/r8152/metadata.xml b/net-misc/r8152/metadata.xml
index b840941c9ce9..932424f746ed 100644
--- a/net-misc/r8152/metadata.xml
+++ b/net-misc/r8152/metadata.xml
@@ -9,9 +9,15 @@
 		<email>proxy-maint@gentoo.org</email>
 		<name>Proxy Maintainers</name>
 	</maintainer>
-	<longdescription>Official Realtek r8152 linux driver. The following cards are currently supported:
-RTL8156 RTL8156B(S)(G) RTL8153 RTL8153B RTL8154 RTL8154B RTL8152B</longdescription>
+	<longdescription>
+		Official Realtek r8152 linux driver. Supports most realtek
+		USB network cards, including: RTL8157, RTL8156(,B), RTL8153(,B,C,D,E),
+		RTL8154(,B), RTL8152B.
+	</longdescription>
 	<use>
 		<flag name="center-tap-short">Enable support for center tap short</flag>
 	</use>
+	<upstream>
+		<remote-id type="github">jayofdoom/realtek-r8152-unchanged</remote-id>
+	</upstream>
 </pkgmetadata>

diff --git a/net-misc/r8152/r8152-2.18.1.ebuild b/net-misc/r8152/r8152-2.18.1.ebuild
new file mode 100644
index 000000000000..ca03338e82f4
--- /dev/null
+++ b/net-misc/r8152/r8152-2.18.1.ebuild
@@ -0,0 +1,55 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit linux-mod-r1 udev
+
+DESCRIPTION="r8152 driver for Realtek USB FE / GBE / 2.5G Gaming Ethernet Family Controller"
+# Using github readme as homepage as the realtek page has changed location twice in six months.
+HOMEPAGE="https://github.com/jayofdoom/realtek-r8152-unchanged"
+SRC_URI="https://github.com/jayofdoom/realtek-r8152-unchanged/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz"
+S="${WORKDIR}/realtek-r8152-unchanged-${PV}"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+RDEPEND="virtual/udev"
+DEPEND="${RDEPEND}"
+
+IUSE="+center-tap-short"
+
+# Many of the patches are sourced from pull requests to
+# https://github.com/wget/realtek-r8152-linux/ -- we do not use this repo
+# as the official upstream as it does not keep a clear deliniation between
+# shipped realtek code and patches. It is the source used by the AUR package.
+PATCHES=(
+	"${FILESDIR}"/${PN}-2.16.3-kernel-6.4.10-fix.patch
+	"${FILESDIR}"/${PN}-2.16.3-asus-c5000-support.patch
+	"${FILESDIR}"/${PN}-2.18.1-kernel-6.9-fix.patch
+)
+
+src_compile() {
+	local modlist=( ${PN}=kernel/net/usb:. )
+	local modargs=(
+		KERNELDIR="${KV_OUT_DIR}"
+		CONFIG_CTAP_SHORT="$(usex center-tap-short on off)"
+	)
+
+	linux-mod-r1_src_compile
+}
+
+src_install() {
+	linux-mod-r1_src_install
+	udev_dorules 50-usb-realtek-net.rules
+}
+
+pkg_postinst() {
+	linux-mod-r1_pkg_postinst
+	udev_reload
+}
+
+pkg_postrm() {
+	udev_reload
+}


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

end of thread, other threads:[~2024-09-20  3:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-18  3:48 [gentoo-commits] repo/gentoo:master commit in: net-misc/r8152/files/, net-misc/r8152/ Sam James
  -- strict thread matches above, loose matches on Subject: below --
2024-09-20  3:14 Eli Schwartz
2023-08-03 16:22 Sam James
2022-11-12  5:52 Sam James

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