summaryrefslogtreecommitdiff
path: root/net-misc/r8152/files
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/files
parent3a9a4f8b478ff62e3c752e20305edb2c7d91959f (diff)
gentoo auto-resync : 12:11:2022 - 09:31:40
Diffstat (limited to 'net-misc/r8152/files')
-rw-r--r--net-misc/r8152/files/r8152-2.16.3-kernel-5.19-fix.patch43
1 files changed, 43 insertions, 0 deletions
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 */