summaryrefslogtreecommitdiff
path: root/net-misc/r8152
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2022-11-12 09:31:41 +0000
committerV3n3RiX <venerix@koprulu.sector>2022-11-12 09:31:41 +0000
commit983485e93d76602266889d23c963609073b75e51 (patch)
tree19081a3616b34ff1d8bc5521d767740501b31153 /net-misc/r8152
parent3a9a4f8b478ff62e3c752e20305edb2c7d91959f (diff)
gentoo auto-resync : 12:11:2022 - 09:31:40
Diffstat (limited to 'net-misc/r8152')
-rw-r--r--net-misc/r8152/Manifest4
-rw-r--r--net-misc/r8152/files/r8152-2.16.3-kernel-5.19-fix.patch43
-rw-r--r--net-misc/r8152/metadata.xml17
-rw-r--r--net-misc/r8152/r8152-2.16.3.ebuild49
4 files changed, 113 insertions, 0 deletions
diff --git a/net-misc/r8152/Manifest b/net-misc/r8152/Manifest
new file mode 100644
index 000000000000..cbcaa5b83b2d
--- /dev/null
+++ b/net-misc/r8152/Manifest
@@ -0,0 +1,4 @@
+AUX r8152-2.16.3-kernel-5.19-fix.patch 1599 BLAKE2B e1300601e2dcd98729481a6d146ffcc0b55e6163c405608ed783bc56acca65654317804c1da780203d96945b49d815b6efd740a752335d4c0aa562f2ba84bbf3 SHA512 6cdb4ee02c6727d87d94fbd4058b7bbd18e3bb4542c2489d4080217ef323faddbf5b998a83dd42b8e1a1e4c1eb6f65762616382fc5fd8519db07d6dd01f83b4a
+DIST r8152-2.16.3.tar.bz2 73331 BLAKE2B 9e22ee6d9d0197def782f77bfd0c88a2d8827d4f8cc0bbb1a6583ab67533cd07ba79a16cd9350272ed18c733fe809ea1ff70596627abdc65d452bdf817628bc8 SHA512 c37bf5199d3a857c9a7a12f3aa4ecfe9c04b49413aea862a053ebee24c137cd35769e5d5cc7e2bb7dd3bf9057f51ffada0b4e0c53cb3d417e05c8e3fc830705c
+EBUILD r8152-2.16.3.ebuild 1186 BLAKE2B a2677a3275123439393ee103a35e5a9a7ebff7e7377d58ea0d0bced6fd83b7af0c71ae227ce23f7825e54927f769a8e0dda09ba41e48371a7d54b88f42b10738 SHA512 c0cf0f803e16fb7709e2efac79effd3a82eadcfdb80135164eaa0b63364e5ee73e347e0d733ffa90d3977852bb6fefa19f8fff70ecda41b8f1a8e295e8802428
+MISC metadata.xml 660 BLAKE2B 1f7bd7d75e5fc3b88b140f88b82390b09cbffed8770b73b4584f7d9114fd1b97a84f745881d424f30c1a738c332bb04bab3d651bd9734f0170164eb8158ef098 SHA512 c0258ae24671a18801a9a499869267b2c3d2d0350e1fbbf91db6fe2358326bb27551623ef93c9c9a9bebde3c08520463eae00a05802053a0f5b7ade1b0f5ea4d
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
+}