Projects
Essentials
r8168
Sign Up
Log In
Username
Password
We truncated the diff of some files because they were too big. If you want to see the full diff for every file,
click here
.
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 28
View file
r8168.changes
Changed
@@ -1,4 +1,27 @@ ------------------------------------------------------------------- +Wed Mar 13 12:12:43 UTC 2024 - Dr. Werner Fink <werner@suse.de> + +- Update to new version r8168-8.052.01 +- Remove patches now upstream + * skb_gso_segment.patch + * r8168-support-linux-6.1.0.patch +- Port patches + * r8168-configuration.patch + * r8168-kernel_version.patch + * r8168-support-dev0x8136.patch + * r8168-support-linux-5.19.patch + * r8168-support-linux-L15.5.patch +- Add r8168.keyring and signature of tar ball to check tar ball +- Add patch r8168-gcc14.patch + * Avoid gcc14 trouble + * Switch from deprecated strlcpy() to strscpy() + +------------------------------------------------------------------- +Wed Mar 13 11:26:04 UTC 2024 - Dr. Werner Fink <werner@suse.de> + +- Use %patch -P N instead of deprecated %patchN. + +------------------------------------------------------------------- Thu Oct 19 08:29:04 UTC 2023 - Dr. Werner Fink <werner@suse.de> - Dynamic adaption of patch skb_gso_segment.patch means if net/gso.h
View file
r8168.spec
Changed
@@ -18,7 +18,7 @@ #!BuildIgnore: enough-build-resources Name: r8168 -Version: 8.051.02 +Version: 8.052.01 Release: 0 Summary: Device driver for RealTek Gigabit Ethernet controllers License: GPL-2.0-or-later @@ -27,13 +27,14 @@ Source0: https://github.com/mtorromeo/r8168/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz Source1: preamble Source2: Module.supported +Source3: https://github.com/mtorromeo/r8168/releases/download/%{version}/%{name}-%{version}.tar.gz.asc +Source4: r8168.keyring Patch0: r8168-kernel_version.patch Patch1: r8168-configuration.patch Patch2: r8168-support-linux-5.19.patch -Patch3: r8168-support-linux-6.1.0.patch +Patch3: r8168-gcc14.patch Patch4: r8168-support-dev0x8136.patch Patch5: r8168-support-linux-L15.5.patch -Patch6: skb_gso_segment.patch BuildRequires: kernel-source BuildRequires: kernel-syms BuildRequires: libelf-devel @@ -61,25 +62,24 @@ %prep %setup -q -%patch0 -b .p0 -%patch1 -b .p1 -%patch2 -p1 -b .p2 -%patch3 -p1 -b .p3 -%patch4 -p1 -b .p4 +%patch -P 0 -b .p0 +%patch -P 1 -b .p1 +%patch -P 2 -p1 -b .p2 +%patch -P 3 -b .p3 +%patch -P 4 -p1 -b .p4 if test -e /usr/src/linux/include/linux/ethtool.h then argc=$(sed -rn '/\*get_ringparam/,/;$/p' /usr/src/linux/include/linux/ethtool.h | wc -l) if test -n "$argc" -a "$argc" -eq 4 then -%patch5 -b .p5 +%patch -P 5 -b .p5 fi fi if test -e /usr/src/linux/include/net/gso.h then version=$(uname -r|sed -r 's/-.*//;s/\./,/g') - sed -ri "/KERNEL_VERSION/{s/\(6,4,10\)/(${version})/}" %{PATCH6} + sed -ri "/KERNEL_VERSION/{s/\(6,4,10\)/(${version})/}" src/r8168_n.c fi -%patch6 -p1 -b .p6 cp %{S:1} . cp %{S:2} .
View file
r8168-configuration.patch
Changed
@@ -4,7 +4,7 @@ --- src/Makefile +++ src/Makefile 2022-05-10 10:26:59.851240712 +0000 -@@ -48,6 +48,7 @@ CONFIG_CTAP_SHORT_OFF = n +@@ -52,6 +52,7 @@ CONFIG_CTAP_SHORT_OFF = n ifneq ($(KERNELRELEASE),) obj-m := r8168.o r8168-objs := r8168_n.o r8168_asf.o rtl_eeprom.o rtltool.o
View file
r8168-gcc14.patch
Added
@@ -0,0 +1,25 @@ +--- + src/r8168_n.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +--- src/r8168_n.c ++++ src/r8168_n.c 2024-03-13 12:25:52.886342182 +0000 +@@ -6312,7 +6312,7 @@ rtl8168_get_drvinfo(struct net_device *d + info->eedump_len = tp->eeprom_len; + BUILD_BUG_ON(sizeof(info->fw_version) < sizeof(rtl_fw->version)); + if (rtl_fw) +- strlcpy(info->fw_version, rtl_fw->version, ++ strscpy(info->fw_version, rtl_fw->version, + sizeof(info->fw_version)); + } + +@@ -28103,7 +28103,8 @@ rtl8168_link_timer(struct timer_list *t) + } + */ + +-int rtl8168_enable_msix(struct rtl8168_private *tp) ++static int ++rtl8168_enable_msix(struct rtl8168_private *tp) + { + int i, nvecs = 0; + struct msix_entry msix_entR8168_MAX_MSIX_VEC;
View file
r8168-kernel_version.patch
Changed
@@ -4,8 +4,8 @@ 2 files changed, 18 insertions(+), 1 deletion(-) --- src/r8168.h -+++ src/r8168.h 2022-05-10 10:26:28.831787721 +0000 -@@ -121,6 +121,10 @@ do { \ ++++ src/r8168.h 2024-03-13 11:51:59.011947503 +0000 +@@ -133,6 +133,10 @@ do { \ } while (0) #endif //LINUX_VERSION_CODE < KERNEL_VERSION(2,6,15) @@ -17,7 +17,7 @@ #if defined(skb_vlan_tag_present) && !defined(vlan_tx_tag_present) #define vlan_tx_tag_present skb_vlan_tag_present --- src/r8168_n.c -+++ src/r8168_n.c 2022-05-10 10:26:28.871787016 +0000 ++++ src/r8168_n.c 2024-03-13 11:57:02.890342590 +0000 @@ -61,11 +61,16 @@ #include <linux/rtnetlink.h> #include <linux/completion.h> @@ -35,7 +35,7 @@ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,37) #include <linux/prefetch.h> #endif -@@ -571,8 +576,12 @@ static void rtl8168_set_rx_mode(struct n +@@ -590,8 +595,12 @@ static void rtl8168_set_rx_mode(struct n #if LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0) static void rtl8168_tx_timeout(struct net_device *dev, unsigned int txqueue); #else @@ -46,9 +46,9 @@ #endif +#endif static struct net_device_stats *rtl8168_get_stats(struct net_device *dev); - static int rtl8168_rx_interrupt(struct net_device *, struct rtl8168_private *, napi_budget); - static int rtl8168_change_mtu(struct net_device *dev, int new_mtu); -@@ -28985,8 +28994,12 @@ static void + static int rtl8168_rx_interrupt(struct net_device *, struct rtl8168_private *, struct rtl8168_rx_ring *, napi_budget); + #ifdef CONFIG_R8168_NAPI +@@ -30765,8 +30774,12 @@ static void rtl8168_tx_timeout(struct net_device *dev, unsigned int txqueue) #else static void @@ -60,13 +60,13 @@ +#endif { struct rtl8168_private *tp = netdev_priv(dev); - unsigned long flags; -@@ -29672,7 +29685,7 @@ process_pkt: - if (rtl8168_rx_vlan_skb(tp, desc, skb) < 0) - rtl8168_rx_skb(tp, skb); +@@ -31502,7 +31515,7 @@ rtl8168_rx_interrupt(struct net_device * + + if (rtl8168_rx_vlan_skb(tp, desc, skb) < 0) + rtl8168_rx_skb(tp, skb, ring_index); -#if LINUX_VERSION_CODE < KERNEL_VERSION(4,11,0) +#if LINUX_VERSION_CODE < KERNEL_VERSION(4,4,0) - dev->last_rx = jiffies; + dev->last_rx = jiffies; #endif //LINUX_VERSION_CODE < KERNEL_VERSION(4,11,0) - RTLDEV->stats.rx_bytes += pkt_size; + RTLDEV->stats.rx_bytes += pkt_size;
View file
r8168-support-dev0x8136.patch
Changed
@@ -12,7 +12,7 @@ index 28d7636..cbf43d1 100755 --- a/src/r8168_n.c +++ b/src/r8168_n.c -@@ -411,6 +411,7 @@ static const struct { +@@ -430,6 +430,7 @@ static const struct { static struct pci_device_id rtl8168_pci_tbl = { { PCI_DEVICE(PCI_VENDOR_ID_REALTEK, 0x8168), },
View file
r8168-support-linux-5.19.patch
Changed
@@ -1,6 +1,6 @@ --- r8168-8.050.03/src/r8168_n.c +++ r8168-8.050.03/src/r8168_n.c -@@ -121,6 +121,15 @@ +@@ -126,6 +126,15 @@ #define FIRMWARE_8168FP_3 "rtl_nic/rtl8168fp-3.fw" #define FIRMWARE_8168FP_4 "rtl_nic/rtl8168fp-4.fw"
View file
r8168-support-linux-6.1.0.patch
Deleted
@@ -1,25 +0,0 @@ -From 39dd0fd2e5dc45cd63113f33a9890e36c304916d Mon Sep 17 00:00:00 2001 -From: zu1k <i@zu1k.com> -Date: Sat, 29 Oct 2022 21:57:39 +0800 -Subject: PATCH Adapted for Linux 6.1 - ---- - src/r8168.h | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/src/r8168.h b/src/r8168.h -index 662974a..baf48c6 100755 ---- a/src/r8168.h -+++ b/src/r8168.h -@@ -570,7 +570,11 @@ typedef int *napi_budget; - typedef struct napi_struct *napi_ptr; - typedef int napi_budget; - -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0) -+#define RTL_NAPI_CONFIG(ndev, priv, function, weight) netif_napi_add(ndev, &priv->napi, function) -+#else - #define RTL_NAPI_CONFIG(ndev, priv, function, weight) netif_napi_add(ndev, &priv->napi, function, weight) -+#endif - #define RTL_NAPI_QUOTA(budget, ndev) min(budget, budget) - #define RTL_GET_PRIV(stuct_ptr, priv_struct) container_of(stuct_ptr, priv_struct, stuct_ptr) - #define RTL_GET_NETDEV(priv_ptr) struct net_device *dev = priv_ptr->dev;
View file
r8168-support-linux-L15.5.patch
Changed
@@ -3,8 +3,8 @@ 1 file changed, 6 insertions(+), 6 deletions(-) --- src/r8168_n.c -+++ src/r8168_n.c 2023-05-10 10:40:25.454736974 +0000 -@@ -5964,7 +5964,7 @@ rtl8168_wait_for_quiescence(struct net_d ++++ src/r8168_n.c 2024-03-13 12:10:07.947820999 +0000 +@@ -6986,7 +6986,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, -@@ -5972,7 +5972,7 @@ static void rtl8168_get_ringparam(struct +@@ -6994,7 +6994,7 @@ static void rtl8168_get_ringparam(struct #else static void rtl8168_get_ringparam(struct net_device *dev, struct ethtool_ringparam *ring) @@ -22,8 +22,8 @@ { struct rtl8168_private *tp = netdev_priv(dev); -@@ -5982,7 +5982,7 @@ static void rtl8168_get_ringparam(struct - ring->tx_pending = tp->num_tx_desc; +@@ -7004,7 +7004,7 @@ static void rtl8168_get_ringparam(struct + ring->tx_pending = tp->tx_ring0.num_tx_desc; } -#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,17,0) @@ -31,7 +31,7 @@ static int rtl8168_set_ringparam(struct net_device *dev, struct ethtool_ringparam *ring, struct kernel_ethtool_ringparam *kernel_ring, -@@ -5990,7 +5990,7 @@ static int rtl8168_set_ringparam(struct +@@ -7012,7 +7012,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; -@@ -25420,11 +25420,11 @@ rtl8168_release_board(struct pci_dev *pd +@@ -26644,11 +26644,11 @@ rtl8168_release_board(struct pci_dev *pd static void rtl8168_hw_address_set(struct net_device *dev, u8 mac_addrMAC_ADDR_LEN) {
View file
skb_gso_segment.patch
Deleted
@@ -1,25 +0,0 @@ -From fc2e0d28c79d3f6ef052d85a7cb146610554ff22 Mon Sep 17 00:00:00 2001 -From: safocl <safocl88@gmail.com> -Date: Sun, 13 Aug 2023 04:23:03 +0400 -Subject: PATCH Fix missing skb_gso_segment function declaration This - motivation from this issue(https://github.com/mtorromeo/r8168/issues/54) - ---- - src/r8168_n.c | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/src/r8168_n.c b/src/r8168_n.c -index 7e9e2ea..3855910 100755 ---- a/src/r8168_n.c -+++ b/src/r8168_n.c -@@ -86,6 +86,10 @@ - #include <linux/mdio.h> - #endif - -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,4,10) -+#include <net/gso.h> -+#endif -+ - #include <asm/io.h> - #include <asm/irq.h> -
View file
r8168-8.052.01.tar.gz.asc
Added
@@ -0,0 +1,7 @@ +-----BEGIN PGP SIGNATURE----- + +iHUEABYIAB0WIQQMrarPcPZMZU4TGzERZ1x0NCnd7wUCZRk1EAAKCRARZ1x0NCnd +761TAPsHdh+FI5/eoR1/vSKJ8nCBXVmP6xR9q5bHvknbyzcGJAD/Zq5BWgkYnfBR +M3Ow6FM7EZ7+iAlkIRAavYHASGXERQ4= +=QvU5 +-----END PGP SIGNATURE-----
View file
r8168-8.051.02.tar.gz/Makefile -> r8168-8.052.01.tar.gz/Makefile
Changed
@@ -4,7 +4,7 @@ # r8168 is the Linux device driver released for Realtek Gigabit Ethernet # controllers with PCI-Express interface. # -# Copyright(c) 2022 Realtek Semiconductor Corp. All rights reserved. +# Copyright(c) 2023 Realtek Semiconductor Corp. All rights reserved. # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the Free
View file
r8168-8.051.02.tar.gz/src/Makefile -> r8168-8.052.01.tar.gz/src/Makefile
Changed
@@ -4,7 +4,7 @@ # r8168 is the Linux device driver released for Realtek Gigabit Ethernet # controllers with PCI-Express interface. # -# Copyright(c) 2022 Realtek Semiconductor Corp. All rights reserved. +# Copyright(c) 2023 Realtek Semiconductor Corp. All rights reserved. # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the Free @@ -44,6 +44,10 @@ CONFIG_DYNAMIC_ASPM = y ENABLE_USE_FIRMWARE_FILE = n CONFIG_CTAP_SHORT_OFF = n +ENABLE_MULTIPLE_TX_QUEUE = n +ENABLE_RSS_SUPPORT = n +ENABLE_LIB_SUPPORT = n +DISABLE_WOL_SUPPORT = n ifneq ($(KERNELRELEASE),) obj-m := r8168.o @@ -67,7 +71,9 @@ r8168-objs += r8168_dash.o EXTRA_CFLAGS += -DENABLE_DASH_SUPPORT -DENABLE_DASH_PRINTER_SUPPORT endif - EXTRA_CFLAGS += -DCONFIG_R8168_NAPI + ifneq ($(ENABLE_RSS_SUPPORT), y) + EXTRA_CFLAGS += -DCONFIG_R8168_NAPI + endif EXTRA_CFLAGS += -DCONFIG_R8168_VLAN ifeq ($(CONFIG_DOWN_SPEED_100), y) EXTRA_CFLAGS += -DCONFIG_DOWN_SPEED_100 @@ -97,6 +103,20 @@ ifeq ($(CONFIG_CTAP_SHORT_OFF), y) EXTRA_CFLAGS += -DCONFIG_CTAP_SHORT_OFF endif + ifeq ($(ENABLE_MULTIPLE_TX_QUEUE), y) + EXTRA_CFLAGS += -DENABLE_MULTIPLE_TX_QUEUE + endif + ifeq ($(ENABLE_RSS_SUPPORT), y) + r8168-objs += r8168_rss.o + EXTRA_CFLAGS += -DENABLE_RSS_SUPPORT + endif + ifeq ($(ENABLE_LIB_SUPPORT), y) + r8168-objs += r8168_lib.o + EXTRA_CFLAGS += -DENABLE_LIB_SUPPORT + endif + ifeq ($(DISABLE_WOL_SUPPORT), y) + EXTRA_CFLAGS += -DDISABLE_WOL_SUPPORT + endif else BASEDIR := /lib/modules/$(shell uname -r) KERNELDIR ?= $(BASEDIR)/build
View file
r8168-8.051.02.tar.gz/src/Makefile_linux24x -> r8168-8.052.01.tar.gz/src/Makefile_linux24x
Changed
@@ -4,7 +4,7 @@ # r8168 is the Linux device driver released for Realtek Gigabit Ethernet # controllers with PCI-Express interface. # -# Copyright(c) 2022 Realtek Semiconductor Corp. All rights reserved. +# Copyright(c) 2023 Realtek Semiconductor Corp. All rights reserved. # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the Free
View file
r8168-8.051.02.tar.gz/src/r8168.h -> r8168-8.052.01.tar.gz/src/r8168.h
Changed
@@ -5,7 +5,7 @@ # r8168 is the Linux device driver released for Realtek Gigabit Ethernet # controllers with PCI-Express interface. # -# Copyright(c) 2022 Realtek Semiconductor Corp. All rights reserved. +# Copyright(c) 2023 Realtek Semiconductor Corp. All rights reserved. # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the Free @@ -33,9 +33,21 @@ ***********************************************************************************/ #include <linux/ethtool.h> +#include <linux/interrupt.h> +#include <linux/version.h> #include "r8168_dash.h" #include "r8168_realwow.h" #include "r8168_fiber.h" +#include "r8168_rss.h" +#ifdef ENABLE_LIB_SUPPORT +#include "r8168_lib.h" +#endif + +/* +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,12,0)&& !defined(ENABLE_LIB_SUPPORT) +#define RTL_USE_NEW_INTR_API +#endif +*/ #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,32) typedef int netdev_tx_t; @@ -130,11 +142,14 @@ #endif #endif //LINUX_VERSION_CODE < KERNEL_VERSION(4,0,0) -#define RTL_ALLOC_SKB_INTR(tp, length) dev_alloc_skb(length) +#define RTL_ALLOC_SKB_INTR(napi, length) dev_alloc_skb(length) +#define R8168_USE_NAPI_ALLOC_SKB 0 #ifdef CONFIG_R8168_NAPI #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,0) #undef RTL_ALLOC_SKB_INTR -#define RTL_ALLOC_SKB_INTR(tp, length) napi_alloc_skb(&tp->napi, length) +#define RTL_ALLOC_SKB_INTR(napi, length) napi_alloc_skb(napi, length) +#undef R8168_USE_NAPI_ALLOC_SKB +#define R8168_USE_NAPI_ALLOC_SKB 1 #endif #endif @@ -319,7 +334,7 @@ #ifndef NET_IP_ALIGN #define NET_IP_ALIGN 2 #endif -#define RTK_RX_ALIGN 8 +#define RTK_RX_ALIGN NET_IP_ALIGN #ifdef CONFIG_R8168_NAPI #define NAPI_SUFFIX "-NAPI" @@ -343,13 +358,18 @@ #else #define DASH_SUFFIX "" #endif +#if defined(ENABLE_RSS_SUPPORT) +#define RSS_SUFFIX "-RSS" +#else +#define RSS_SUFFIX "" +#endif -#define RTL8168_VERSION "8.051.02" NAPI_SUFFIX FIBER_SUFFIX REALWOW_SUFFIX DASH_SUFFIX +#define RTL8168_VERSION "8.052.01" NAPI_SUFFIX FIBER_SUFFIX REALWOW_SUFFIX DASH_SUFFIX RSS_SUFFIX #define MODULENAME "r8168" #define PFX MODULENAME ": " #define GPL_CLAIM "\ -r8168 Copyright (C) 2022 Realtek NIC software team <nicfae@realtek.com> \n \ +r8168 Copyright (C) 2023 Realtek NIC software team <nicfae@realtek.com> \n \ This program comes with ABSOLUTELY NO WARRANTY; for details, please see <http://www.gnu.org/licenses/>. \n \ This is free software, and you are welcome to redistribute it under certain conditions; see <http://www.gnu.org/licenses/>. \n" @@ -428,6 +448,8 @@ #define R8168_PCI_REGS_SIZE (0x100) #define R8168_NAPI_WEIGHT 64 +#define R8168_MAX_MSIX_VEC 4 + #define RTL8168_TX_TIMEOUT (6 * HZ) #define RTL8168_LINK_TIMEOUT (1 * HZ) #define RTL8168_ESD_TIMEOUT (2 * HZ) @@ -438,10 +460,17 @@ #define MIN_NUM_TX_DESC 32 /* Minimum number of Tx descriptor registers */ #define MIN_NUM_RX_DESC 32 /* Minimum number of Rx descriptor registers */ -#define NUM_TX_DESC 256 /* Number of Tx descriptor registers */ -#define NUM_RX_DESC 256 /* Number of Rx descriptor registers */ +#define NUM_TX_DESC 1024 /* Number of Tx descriptor registers */ +#define NUM_RX_DESC 1024 /* Number of Rx descriptor registers */ -#define RX_BUF_SIZE 0x05F3 /* 0x05F3 = 1522bye + 1 */ +#define RX_BUF_SIZE 0x05F2 /* 0x05F2 = 1522bye */ +#define R8168_MAX_TX_QUEUES (2) +#define R8168_MAX_RX_QUEUES (4) +#define R8168_MAX_QUEUES R8168_MAX_RX_QUEUES +#define R8168_MULTI_TX_Q(tp) (rtl8168_tot_tx_rings(tp) > 1) +#define R8168_MULTI_RX_Q(tp) (rtl8168_tot_rx_rings(tp) > 1) +#define R8168_MULTI_RX_4Q(tp) (rtl8168_tot_rx_rings(tp) > 3) +#define R8168_MULTI_RSS_4Q(tp) (tp->num_hw_tot_en_rx_rings > 3) #define OCP_STD_PHY_BASE 0xa400 @@ -566,7 +595,11 @@ typedef struct napi_struct *napi_ptr; typedef int napi_budget; +#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,1,0) +#define RTL_NAPI_CONFIG(ndev, priv, function, weight) netif_napi_add_weight(ndev, &priv->napi, function, weight) +#else #define RTL_NAPI_CONFIG(ndev, priv, function, weight) netif_napi_add(ndev, &priv->napi, function, weight) +#endif //LINUX_VERSION_CODE >= KERNEL_VERSION(6,1,0) #define RTL_NAPI_QUOTA(budget, ndev) min(budget, budget) #define RTL_GET_PRIV(stuct_ptr, priv_struct) container_of(stuct_ptr, priv_struct, stuct_ptr) #define RTL_GET_NETDEV(priv_ptr) struct net_device *dev = priv_ptr->dev; @@ -1095,13 +1128,20 @@ ERIAR = 0x74, EPHY_RXER_NUM = 0x7C, EPHYAR = 0x80, + IntrMask1 = 0x84, + IntrMask2 = 0x85, + IntrStatus1 = 0x86, + IntrStatus2 = 0x87, TimeInt2 = 0x8C, + Rss_indir_tbl = 0x90, OCPDR = 0xB0, MACOCP = 0xB0, OCPAR = 0xB4, SecMAC0 = 0xB4, SecMAC4 = 0xB8, PHYOCP = 0xB8, + IntrMask3 = 0xC0, + IntrStatus3 = 0xC1, DBG_reg = 0xD1, TwiCmdReg = 0xD2, MCUCmd_reg = 0xD3, @@ -1122,6 +1162,14 @@ CMAC_IBIMR0 = 0xFA, CMAC_IBISR0 = 0xFB, FuncForceEvent = 0xFC, + + /* ERI */ + RSS_KEY_8168 = 0x90, + RSS_CTRL_8168 = 0xB8, + Q_NUM_CTRL_8168 = 0xC0, + + /* MAC OCP */ + EEE_TXIDLE_TIMER_8168 = 0xe048, }; enum RTL8168_register_content { @@ -1137,6 +1185,8 @@ TxOK = 0x0004, RxErr = 0x0002, RxOK = 0x0001, + RxDU1 = 0x0002, + RxOK1 = 0x0001, /* RxStatusDesc */ RxRWT = (1 << 22), @@ -1181,6 +1231,7 @@ RxCfg_fet_multi_en = (1 << 14), RxCfg_half_refetch = (1 << 13), RxCfg_9356SEL = (1 << 6), + RxCfg_rx_desc_v2_en = (1 << 24), /* TxConfigBits */ TxInterFrameGapShift = 24, @@ -1435,6 +1486,17 @@ BIT_31 = (1 << 31) }; +#define RTL8168_CP_NUM 4 +#define RTL8168_MAX_SUPPORT_cp_len 110 + +enum rtl8168_cp_status { + rtl8168_cp_normal = 0, + rtl8168_cp_short, + rtl8168_cp_open, + rtl8168_cp_mismatch, + rtl8168_cp_unknown +}; + enum effuse { EFUSE_NOT_SUPPORT = 0, EFUSE_SUPPORT_V1, @@ -1455,6 +1517,29 @@ u64 addr; }; +struct RxDescV2 { + u32 opts1; + u32 opts2; + u64 addr; + u32 rsvd1;
View file
r8168-8.051.02.tar.gz/src/r8168_asf.c -> r8168-8.052.01.tar.gz/src/r8168_asf.c
Changed
@@ -5,7 +5,7 @@ # r8168 is the Linux device driver released for Realtek Gigabit Ethernet # controllers with PCI-Express interface. # -# Copyright(c) 2022 Realtek Semiconductor Corp. All rights reserved. +# Copyright(c) 2023 Realtek Semiconductor Corp. All rights reserved. # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the Free @@ -60,7 +60,6 @@ struct rtl8168_private *tp = netdev_priv(dev); void *user_data = ifr->ifr_data; struct asf_ioctl_struct asf_usrdata; - unsigned long flags; if (tp->mcfg != CFG_METHOD_7 && tp->mcfg != CFG_METHOD_8) return -EOPNOTSUPP; @@ -68,8 +67,6 @@ if (copy_from_user(&asf_usrdata, user_data, sizeof(struct asf_ioctl_struct))) return -EFAULT; - spin_lock_irqsave(&tp->lock, flags); - switch (asf_usrdata.offset) { case HBPeriod: rtl8168_asf_hbperiod(tp, asf_usrdata.arg, asf_usrdata.u.data); @@ -192,12 +189,9 @@ rtl8168_asf_key_access(tp, asf_usrdata.arg, KR, asf_usrdata.u.data); break; default: - spin_unlock_irqrestore(&tp->lock, flags); return -EOPNOTSUPP; } - spin_unlock_irqrestore(&tp->lock, flags); - if (copy_to_user(user_data, &asf_usrdata, sizeof(struct asf_ioctl_struct))) return -EFAULT;
View file
r8168-8.051.02.tar.gz/src/r8168_asf.h -> r8168-8.052.01.tar.gz/src/r8168_asf.h
Changed
@@ -5,7 +5,7 @@ # r8168 is the Linux device driver released for Realtek Gigabit Ethernet # controllers with PCI-Express interface. # -# Copyright(c) 2022 Realtek Semiconductor Corp. All rights reserved. +# Copyright(c) 2023 Realtek Semiconductor Corp. All rights reserved. # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the Free
View file
r8168-8.051.02.tar.gz/src/r8168_dash.h -> r8168-8.052.01.tar.gz/src/r8168_dash.h
Changed
@@ -5,7 +5,7 @@ # r8168 is the Linux device driver released for Realtek Gigabit Ethernet # controllers with PCI-Express interface. # -# Copyright(c) 2022 Realtek Semiconductor Corp. All rights reserved. +# Copyright(c) 2023 Realtek Semiconductor Corp. All rights reserved. # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the Free
View file
r8168-8.051.02.tar.gz/src/r8168_fiber.h -> r8168-8.052.01.tar.gz/src/r8168_fiber.h
Changed
@@ -5,7 +5,7 @@ # r8168 is the Linux device driver released for Realtek Gigabit Ethernet # controllers with PCI-Express interface. # -# Copyright(c) 2022 Realtek Semiconductor Corp. All rights reserved. +# Copyright(c) 2023 Realtek Semiconductor Corp. All rights reserved. # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the Free
View file
r8168-8.051.02.tar.gz/src/r8168_firmware.c -> r8168-8.052.01.tar.gz/src/r8168_firmware.c
Changed
@@ -5,7 +5,7 @@ # r8168 is the Linux device driver released for Realtek Gigabit Ethernet # controllers with PCI-Express interface. # -# Copyright(c) 2022 Realtek Semiconductor Corp. All rights reserved. +# Copyright(c) 2023 Realtek Semiconductor Corp. All rights reserved. # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the Free
View file
r8168-8.051.02.tar.gz/src/r8168_firmware.h -> r8168-8.052.01.tar.gz/src/r8168_firmware.h
Changed
@@ -5,7 +5,7 @@ # r8168 is the Linux device driver released for Realtek 2.5Gigabit Ethernet # controllers with PCI-Express interface. # -# Copyright(c) 2022 Realtek Semiconductor Corp. All rights reserved. +# Copyright(c) 2023 Realtek Semiconductor Corp. All rights reserved. # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the Free
View file
r8168-8.051.02.tar.gz/src/r8168_n.c -> r8168-8.052.01.tar.gz/src/r8168_n.c
Changed
@@ -5,7 +5,7 @@ # r8168 is the Linux device driver released for Realtek Gigabit Ethernet # controllers with PCI-Express interface. # -# Copyright(c) 2022 Realtek Semiconductor Corp. All rights reserved. +# Copyright(c) 2023 Realtek Semiconductor Corp. All rights reserved. # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the Free @@ -81,6 +81,10 @@ #include <linux/mdio.h> #endif +#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,4,10) +#include <net/gso.h> +#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(6,4,10) */ + #include <asm/io.h> #include <asm/irq.h> @@ -113,6 +117,7 @@ #define FIRMWARE_8168H_1 "rtl_nic/rtl8168h-1.fw" #define FIRMWARE_8168H_2 "rtl_nic/rtl8168h-2.fw" #define FIRMWARE_8168H_3 "rtl_nic/rtl8168h-3.fw" +#define FIRMWARE_8168H_4 "rtl_nic/rtl8168h-4.fw" #define FIRMWARE_8168FP_3 "rtl_nic/rtl8168fp-3.fw" #define FIRMWARE_8168FP_4 "rtl_nic/rtl8168fp-4.fw" @@ -160,6 +165,8 @@ CFG_METHOD_33 = {"RTL8168FP/8111FP", FIRMWARE_8168FP_4}, CFG_METHOD_34 = {"RTL8168FP/8111FP", FIRMWARE_8168FP_4}, CFG_METHOD_35 = {"RTL8168H/8111H", FIRMWARE_8168H_3}, + CFG_METHOD_36 = {"RTL8168H/8111H", FIRMWARE_8168H_4}, + CFG_METHOD_37 = {"RTL8168M/8111M", FIRMWARE_8168H_2}, CFG_METHOD_DEFAULT = {"Unknown", }, }; @@ -295,91 +302,103 @@ _R("RTL8168G/8111G", CFG_METHOD_21, - RxCfg_128_int_en | RxEarly_off_V2 | Rx_Single_fetch_V2 | (RX_DMA_BURST << RxCfgDMAShift), + RxCfg_128_int_en | RxEarly_off_V2 | (RX_DMA_BURST << RxCfgDMAShift), 0xff7e5880, Jumbo_Frame_9k), _R("RTL8168G/8111G", CFG_METHOD_22, - RxCfg_128_int_en | RxEarly_off_V2 | Rx_Single_fetch_V2 | (RX_DMA_BURST << RxCfgDMAShift), + RxCfg_128_int_en | RxEarly_off_V2 | (RX_DMA_BURST << RxCfgDMAShift), 0xff7e5880, Jumbo_Frame_9k), _R("RTL8168EP/8111EP", CFG_METHOD_23, - RxCfg_128_int_en | RxEarly_off_V2 | Rx_Single_fetch_V2 | (RX_DMA_BURST << RxCfgDMAShift), + RxCfg_128_int_en | RxEarly_off_V2 | (RX_DMA_BURST << RxCfgDMAShift), 0xff7e5880, Jumbo_Frame_9k), _R("RTL8168GU/8111GU", CFG_METHOD_24, - RxCfg_128_int_en | RxEarly_off_V2 | Rx_Single_fetch_V2 | (RX_DMA_BURST << RxCfgDMAShift), + RxCfg_128_int_en | RxEarly_off_V2 | (RX_DMA_BURST << RxCfgDMAShift), 0xff7e5880, Jumbo_Frame_9k), _R("RTL8168GU/8111GU", CFG_METHOD_25, - RxCfg_128_int_en | RxEarly_off_V2 | Rx_Single_fetch_V2 | (RX_DMA_BURST << RxCfgDMAShift), + RxCfg_128_int_en | RxEarly_off_V2 | (RX_DMA_BURST << RxCfgDMAShift), 0xff7e5880, Jumbo_Frame_9k), _R("8411B", CFG_METHOD_26, - RxCfg_128_int_en | RxEarly_off_V2 | Rx_Single_fetch_V2 | (RX_DMA_BURST << RxCfgDMAShift), + RxCfg_128_int_en | RxEarly_off_V2 | (RX_DMA_BURST << RxCfgDMAShift), 0xff7e5880, Jumbo_Frame_9k), _R("RTL8168EP/8111EP", CFG_METHOD_27, - RxCfg_128_int_en | RxEarly_off_V2 | Rx_Single_fetch_V2 | (RX_DMA_BURST << RxCfgDMAShift), + RxCfg_128_int_en | RxEarly_off_V2 | (RX_DMA_BURST << RxCfgDMAShift), 0xff7e5880, Jumbo_Frame_9k), _R("RTL8168EP/8111EP", CFG_METHOD_28, - RxCfg_128_int_en | RxEarly_off_V2 | Rx_Single_fetch_V2 | (RX_DMA_BURST << RxCfgDMAShift), + RxCfg_128_int_en | RxEarly_off_V2 | (RX_DMA_BURST << RxCfgDMAShift), 0xff7e5880, Jumbo_Frame_9k), _R("RTL8168H/8111H", CFG_METHOD_29, - RxCfg_128_int_en | RxEarly_off_V2 | Rx_Single_fetch_V2 | (RX_DMA_BURST << RxCfgDMAShift), + RxCfg_128_int_en | RxEarly_off_V2 | (RX_DMA_BURST << RxCfgDMAShift), 0xff7e5880, Jumbo_Frame_9k), _R("RTL8168H/8111H", CFG_METHOD_30, - RxCfg_128_int_en | RxEarly_off_V2 | Rx_Single_fetch_V2 | (RX_DMA_BURST << RxCfgDMAShift), + RxCfg_128_int_en | RxEarly_off_V2 | (RX_DMA_BURST << RxCfgDMAShift), 0xff7e5880, Jumbo_Frame_9k), _R("RTL8168FP/8111FP", CFG_METHOD_31, - RxCfg_128_int_en | RxEarly_off_V2 | Rx_Single_fetch_V2 | (RX_DMA_BURST << RxCfgDMAShift), + RxCfg_128_int_en | RxEarly_off_V2 | (RX_DMA_BURST << RxCfgDMAShift), 0xff7e5880, Jumbo_Frame_9k), _R("RTL8168FP/8111FP", CFG_METHOD_32, - RxCfg_128_int_en | RxEarly_off_V2 | Rx_Single_fetch_V2 | (RX_DMA_BURST << RxCfgDMAShift), + RxCfg_128_int_en | RxEarly_off_V2 | (RX_DMA_BURST << RxCfgDMAShift), 0xff7e5880, Jumbo_Frame_9k), _R("RTL8168FP/8111FP", CFG_METHOD_33, - RxCfg_128_int_en | RxEarly_off_V2 | Rx_Single_fetch_V2 | (RX_DMA_BURST << RxCfgDMAShift), + RxCfg_128_int_en | RxEarly_off_V2 | (RX_DMA_BURST << RxCfgDMAShift), 0xff7e5880, Jumbo_Frame_9k), _R("RTL8168FP/8111FP", CFG_METHOD_34, - RxCfg_128_int_en | RxEarly_off_V2 | Rx_Single_fetch_V2 | (RX_DMA_BURST << RxCfgDMAShift), + RxCfg_128_int_en | RxEarly_off_V2 | (RX_DMA_BURST << RxCfgDMAShift), 0xff7e5880, Jumbo_Frame_9k), _R("RTL8168H/8111H", CFG_METHOD_35, - RxCfg_128_int_en | RxEarly_off_V2 | Rx_Single_fetch_V2 | (RX_DMA_BURST << RxCfgDMAShift), + RxCfg_128_int_en | RxEarly_off_V2 | (RX_DMA_BURST << RxCfgDMAShift), + 0xff7e5880, + Jumbo_Frame_9k), + + _R("RTL8168H/8111H", + CFG_METHOD_36, + RxCfg_128_int_en | RxEarly_off_V2 | (RX_DMA_BURST << RxCfgDMAShift), + 0xff7e5880, + Jumbo_Frame_9k), + + _R("RTL8168M/8111M", + CFG_METHOD_37, + RxCfg_128_int_en | RxEarly_off_V2 | (RX_DMA_BURST << RxCfgDMAShift), 0xff7e5880, Jumbo_Frame_9k), @@ -406,7 +425,6 @@ MODULE_DEVICE_TABLE(pci, rtl8168_pci_tbl); -static int rx_copybreak = 0; static int use_dac = 1; static int timer_count = 0x2600; static int dynamic_aspm_packet_threshold = 10; @@ -459,6 +477,11 @@ #else static int s0_magic_packet = 0; #endif +#ifdef DISABLE_WOL_SUPPORT +static int disable_wol_support = 1; +#else +static int disable_wol_support = 0; +#endif MODULE_AUTHOR("Realtek and the Linux r8168 crew <netdev@vger.kernel.org>"); MODULE_DESCRIPTION("RealTek RTL-8168 Gigabit Ethernet driver"); @@ -487,9 +510,6 @@ module_param(s5_keep_curr_mac, int, 0); MODULE_PARM_DESC(s5_keep_curr_mac, "Enable Shutdown Keep Current MAC Address."); -module_param(rx_copybreak, int, 0); -MODULE_PARM_DESC(rx_copybreak, "Copy breakpoint for copy-only-tiny-frames"); - module_param(use_dac, int, 0); MODULE_PARM_DESC(use_dac, "Enable PCI DAC. Unsafe on 32 bit PCI slot."); @@ -508,6 +528,9 @@ module_param(dynamic_aspm_packet_threshold, int, 0); MODULE_PARM_DESC(dynamic_aspm_packet_threshold, "Dynamic ASPM packet threshold."); +module_param(disable_wol_support, int, 0); +MODULE_PARM_DESC(disable_wol_support, "Disable PM support."); + #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,0) module_param_named(debug, debug.msg_enable, int, 0); MODULE_PARM_DESC(debug, "Debug verbosity level (0=none, ..., 16=all)"); @@ -533,6 +556,7 @@ MODULE_FIRMWARE(FIRMWARE_8168H_1); MODULE_FIRMWARE(FIRMWARE_8168H_2); MODULE_FIRMWARE(FIRMWARE_8168H_3);
View file
r8168-8.051.02.tar.gz/src/r8168_realwow.h -> r8168-8.052.01.tar.gz/src/r8168_realwow.h
Changed
@@ -5,7 +5,7 @@ # r8168 is the Linux device driver released for Realtek Gigabit Ethernet # controllers with PCI-Express interface. # -# Copyright(c) 2022 Realtek Semiconductor Corp. All rights reserved. +# Copyright(c) 2023 Realtek Semiconductor Corp. All rights reserved. # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the Free
View file
r8168-8.052.01.tar.gz/src/r8168_rss.c
Added
@@ -0,0 +1,439 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* +################################################################################ +# +# r8168 is the Linux device driver released for Realtek Gigabit Ethernet +# controllers with PCI-Express interface. +# +# Copyright(c) 2023 Realtek Semiconductor Corp. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the Free +# Software Foundation; either version 2 of the License, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +# more details. +# +# You should have received a copy of the GNU General Public License along with +# this program; if not, see <http://www.gnu.org/licenses/>. +# +# Author: +# Realtek NIC software team <nicfae@realtek.com> +# No. 2, Innovation Road II, Hsinchu Science Park, Hsinchu 300, Taiwan +# +################################################################################ +*/ + +/************************************************************************************ + * This product is covered by one or more of the following patents: + * US6,570,884, US6,115,776, and US6,327,625. + ***********************************************************************************/ + +#include <linux/version.h> +#include "r8168.h" + +enum rtl8168_rss_register_content { + /* RSS */ + RSS_CTRL_TCP_IPV4_SUPP = (1 << 0), + RSS_CTRL_IPV4_SUPP = (1 << 1), + RSS_CTRL_TCP_IPV6_SUPP = (1 << 2), + RSS_CTRL_IPV6_SUPP = (1 << 3), + RSS_CTRL_IPV6_EXT_SUPP = (1 << 4), + RSS_CTRL_TCP_IPV6_EXT_SUPP = (1 << 5), + RSS_HALF_SUPP = (1 << 7), + RSS_QUAD_CPU_EN = (1 << 16), + RSS_HQ_Q_SUP_R = (1 << 31), +}; + +static int rtl8168_get_rss_hash_opts(struct rtl8168_private *tp, + struct ethtool_rxnfc *cmd) +{ + cmd->data = 0; + + /* Report default options for RSS */ + switch (cmd->flow_type) { + case TCP_V4_FLOW: + cmd->data |= RXH_L4_B_0_1 | RXH_L4_B_2_3; + /* fallthrough */ + case IPV4_FLOW: + cmd->data |= RXH_IP_SRC | RXH_IP_DST; + break; + case TCP_V6_FLOW: + cmd->data |= RXH_L4_B_0_1 | RXH_L4_B_2_3; + /* fallthrough */ + case IPV6_FLOW: + cmd->data |= RXH_IP_SRC | RXH_IP_DST; + break; + default: + return -EINVAL; + } + + return 0; +} + +int rtl8168_get_rxnfc(struct net_device *dev, struct ethtool_rxnfc *cmd, + u32 *rule_locs) +{ + struct rtl8168_private *tp = netdev_priv(dev); + int ret = -EOPNOTSUPP; + + netif_info(tp, drv, tp->dev, "rss get rxnfc\n"); + + if (!(dev->features & NETIF_F_RXHASH)) + return ret; + + switch (cmd->cmd) { + case ETHTOOL_GRXRINGS: + cmd->data = rtl8168_tot_rx_rings(tp); + ret = 0; + break; + case ETHTOOL_GRXFH: + ret = rtl8168_get_rss_hash_opts(tp, cmd); + break; + default: + break; + } + + return ret; +} + +u32 rtl8168_rss_indir_tbl_entries(struct rtl8168_private *tp) +{ + return tp->HwSuppIndirTblEntries; +} + +#define RSS_MASK_BITS_OFFSET (8) +static int _rtl8168_set_rss_hash_opt(struct rtl8168_private *tp) +{ + u32 hash_mask_len; + u32 rss_ctrl; + + /* Perform hash on these packet types */ + rss_ctrl = RSS_CTRL_TCP_IPV4_SUPP + | RSS_CTRL_IPV4_SUPP + | RSS_CTRL_IPV6_SUPP + | RSS_CTRL_IPV6_EXT_SUPP + | RSS_CTRL_TCP_IPV6_SUPP + | RSS_CTRL_TCP_IPV6_EXT_SUPP; + + if (R8168_MULTI_RSS_4Q(tp)) + rss_ctrl |= RSS_QUAD_CPU_EN; + + hash_mask_len = ilog2(rtl8168_rss_indir_tbl_entries(tp)); + hash_mask_len &= (BIT_0 | BIT_1 | BIT_2); + rss_ctrl |= hash_mask_len << RSS_MASK_BITS_OFFSET; + + rtl8168_eri_write(tp, RSS_CTRL_8168, 4, rss_ctrl, ERIAR_ExGMAC); + + return 0; +} + +static int rtl8168_set_rss_hash_opt(struct rtl8168_private *tp, + struct ethtool_rxnfc *nfc) +{ + u32 rss_flags = tp->rss_flags; + + netif_info(tp, drv, tp->dev, "rss set hash\n"); + + /* + * RSS does not support anything other than hashing + * to queues on src and dst IPs and ports + */ + if (nfc->data & ~(RXH_IP_SRC | RXH_IP_DST | + RXH_L4_B_0_1 | RXH_L4_B_2_3)) + return -EINVAL; + + switch (nfc->flow_type) { + case TCP_V4_FLOW: + case TCP_V6_FLOW: + if (!(nfc->data & RXH_IP_SRC) || + !(nfc->data & RXH_IP_DST) || + !(nfc->data & RXH_L4_B_0_1) || + !(nfc->data & RXH_L4_B_2_3)) + return -EINVAL; + break; + case SCTP_V4_FLOW: + case AH_ESP_V4_FLOW: + case AH_V4_FLOW: + case ESP_V4_FLOW: + case SCTP_V6_FLOW: + case AH_ESP_V6_FLOW: + case AH_V6_FLOW: + case ESP_V6_FLOW: + case IP_USER_FLOW: + case ETHER_FLOW: + /* RSS is not supported for these protocols */ + if (nfc->data) { + netif_err(tp, drv, tp->dev, "Command parameters not supported\n"); + return -EINVAL; + } + return 0; + default: + return -EINVAL; + } + + /* if we changed something we need to update flags */ + if (rss_flags != tp->rss_flags) { + u32 rss_ctrl = rtl8168_eri_read(tp, RSS_CTRL_8168, 4, ERIAR_ExGMAC); + + tp->rss_flags = rss_flags; + + /* Perform hash on these packet types */ + rss_ctrl |= RSS_CTRL_TCP_IPV4_SUPP + | RSS_CTRL_IPV4_SUPP + | RSS_CTRL_IPV6_SUPP + | RSS_CTRL_IPV6_EXT_SUPP + | RSS_CTRL_TCP_IPV6_SUPP + | RSS_CTRL_TCP_IPV6_EXT_SUPP; + + if (R8168_MULTI_RSS_4Q(tp)) + rss_ctrl |= RSS_QUAD_CPU_EN; + else + rss_ctrl &= ~RSS_QUAD_CPU_EN; + + rtl8168_eri_write(tp, RSS_CTRL_8168, 4, rss_ctrl, ERIAR_ExGMAC); + } +
View file
r8168-8.052.01.tar.gz/src/r8168_rss.h
Added
@@ -0,0 +1,66 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* +################################################################################ +# +# r8125 is the Linux device driver released for Realtek 2.5Gigabit Ethernet +# controllers with PCI-Express interface. +# +# Copyright(c) 2023 Realtek Semiconductor Corp. All rights reserved. +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the Free +# Software Foundation; either version 2 of the License, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +# more details. +# +# You should have received a copy of the GNU General Public License along with +# this program; if not, see <http://www.gnu.org/licenses/>. +# +# Author: +# Realtek NIC software team <nicfae@realtek.com> +# No. 2, Innovation Road II, Hsinchu Science Park, Hsinchu 300, Taiwan +# +################################################################################ +*/ + +/************************************************************************************ + * This product is covered by one or more of the following patents: + * US6,570,884, US6,115,776, and US6,327,625. + ***********************************************************************************/ + +#ifndef _LINUX_RTL8168_RSS_H +#define _LINUX_RTL8168_RSS_H + +#include <linux/netdevice.h> +#include <linux/types.h> + +#define RTL8168_RSS_INDIR_TBL_SIZE 8 +#define RTL8168_RSS_KEY_SIZE 40 /* size of RSS Hash Key in bytes */ +#define RTL8168_MAX_INDIRECTION_TABLE_ENTRIES 128 + +struct rtl8168_private; +struct RxDescV2; + +int rtl8168_get_rxnfc(struct net_device *dev, struct ethtool_rxnfc *cmd, + u32 *rule_locs); +int rtl8168_set_rxnfc(struct net_device *dev, struct ethtool_rxnfc *cmd); +u32 rtl8168_get_rxfh_key_size(struct net_device *netdev); +u32 rtl8168_rss_indir_size(struct net_device *netdev); +int rtl8168_get_rxfh(struct net_device *netdev, u32 *indir, u8 *key, + u8 *hfunc); +int rtl8168_set_rxfh(struct net_device *netdev, const u32 *indir, + const u8 *key, const u8 hfunc); +void rtl8168_rx_hash(struct rtl8168_private *tp, + struct RxDescV2 *desc, + struct sk_buff *skb); +void _rtl8168_config_rss(struct rtl8168_private *tp); +void rtl8168_config_rss(struct rtl8168_private *tp); +void rtl8168_init_rss(struct rtl8168_private *tp); +u32 rtl8168_rss_indir_tbl_entries(struct rtl8168_private *tp); +void rtl8168_disable_rss(struct rtl8168_private *tp); + +#endif /* _LINUX_RTL8168_RSS_H */
View file
r8168-8.051.02.tar.gz/src/rtl_eeprom.c -> r8168-8.052.01.tar.gz/src/rtl_eeprom.c
Changed
@@ -5,7 +5,7 @@ # r8168 is the Linux device driver released for Realtek Gigabit Ethernet # controllers with PCI-Express interface. # -# Copyright(c) 2022 Realtek Semiconductor Corp. All rights reserved. +# Copyright(c) 2023 Realtek Semiconductor Corp. All rights reserved. # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the Free
View file
r8168-8.051.02.tar.gz/src/rtl_eeprom.h -> r8168-8.052.01.tar.gz/src/rtl_eeprom.h
Changed
@@ -5,7 +5,7 @@ # r8168 is the Linux device driver released for Realtek Gigabit Ethernet # controllers with PCI-Express interface. # -# Copyright(c) 2022 Realtek Semiconductor Corp. All rights reserved. +# Copyright(c) 2023 Realtek Semiconductor Corp. All rights reserved. # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the Free
View file
r8168-8.051.02.tar.gz/src/rtltool.c -> r8168-8.052.01.tar.gz/src/rtltool.c
Changed
@@ -5,7 +5,7 @@ # r8168 is the Linux device driver released for Realtek Gigabit Ethernet # controllers with PCI-Express interface. # -# Copyright(c) 2022 Realtek Semiconductor Corp. All rights reserved. +# Copyright(c) 2023 Realtek Semiconductor Corp. All rights reserved. # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the Free @@ -47,7 +47,6 @@ int rtl8168_tool_ioctl(struct rtl8168_private *tp, struct ifreq *ifr) { struct rtltool_cmd my_cmd; - unsigned long flags; int ret; if (copy_from_user(&my_cmd, ifr->ifr_data, sizeof(my_cmd))) @@ -72,7 +71,6 @@ break; } break; - case RTLTOOL_WRITE_MAC: if (my_cmd.len==1) writeb(my_cmd.data, tp->mmio_addr+my_cmd.offset); @@ -84,51 +82,31 @@ ret = -EOPNOTSUPP; break; } - break; - case RTLTOOL_READ_PHY: - spin_lock_irqsave(&tp->lock, flags); my_cmd.data = rtl8168_mdio_prot_read(tp, my_cmd.offset); - spin_unlock_irqrestore(&tp->lock, flags); - if (copy_to_user(ifr->ifr_data, &my_cmd, sizeof(my_cmd))) { ret = -EFAULT; break; } - break; - case RTLTOOL_WRITE_PHY: - spin_lock_irqsave(&tp->lock, flags); rtl8168_mdio_prot_write(tp, my_cmd.offset, my_cmd.data); - spin_unlock_irqrestore(&tp->lock, flags); break; - case RTLTOOL_READ_EPHY: - spin_lock_irqsave(&tp->lock, flags); my_cmd.data = rtl8168_ephy_read(tp, my_cmd.offset); - spin_unlock_irqrestore(&tp->lock, flags); - if (copy_to_user(ifr->ifr_data, &my_cmd, sizeof(my_cmd))) { ret = -EFAULT; break; } - break; - case RTLTOOL_WRITE_EPHY: - spin_lock_irqsave(&tp->lock, flags); rtl8168_ephy_write(tp, my_cmd.offset, my_cmd.data); - spin_unlock_irqrestore(&tp->lock, flags); break; - case RTLTOOL_READ_ERI: my_cmd.data = 0; if (my_cmd.len==1 || my_cmd.len==2 || my_cmd.len==4) { - spin_lock_irqsave(&tp->lock, flags); my_cmd.data = rtl8168_eri_read(tp, my_cmd.offset, my_cmd.len, ERIAR_ExGMAC); - spin_unlock_irqrestore(&tp->lock, flags); } else { ret = -EOPNOTSUPP; break; @@ -138,20 +116,15 @@ ret = -EFAULT; break; } - break; - case RTLTOOL_WRITE_ERI: if (my_cmd.len==1 || my_cmd.len==2 || my_cmd.len==4) { - spin_lock_irqsave(&tp->lock, flags); rtl8168_eri_write(tp, my_cmd.offset, my_cmd.len, my_cmd.data, ERIAR_ExGMAC); - spin_unlock_irqrestore(&tp->lock, flags); } else { ret = -EOPNOTSUPP; break; } break; - case RTLTOOL_READ_PCI: my_cmd.data = 0; if (my_cmd.len==1) @@ -173,7 +146,6 @@ break; } break; - case RTLTOOL_WRITE_PCI: if (my_cmd.len==1) pci_write_config_byte(tp->pci_dev, my_cmd.offset, @@ -188,108 +160,69 @@ ret = -EOPNOTSUPP; break; } - break; - case RTLTOOL_READ_EEPROM: - spin_lock_irqsave(&tp->lock, flags); my_cmd.data = rtl8168_eeprom_read_sc(tp, my_cmd.offset); - spin_unlock_irqrestore(&tp->lock, flags); - if (copy_to_user(ifr->ifr_data, &my_cmd, sizeof(my_cmd))) { ret = -EFAULT; break; } - break; - case RTLTOOL_WRITE_EEPROM: - spin_lock_irqsave(&tp->lock, flags); rtl8168_eeprom_write_sc(tp, my_cmd.offset, my_cmd.data); - spin_unlock_irqrestore(&tp->lock, flags); break; - case RTL_READ_OOB_MAC: - spin_lock_irqsave(&tp->lock, flags); rtl8168_oob_mutex_lock(tp); my_cmd.data = rtl8168_ocp_read(tp, my_cmd.offset, 4); rtl8168_oob_mutex_unlock(tp); - spin_unlock_irqrestore(&tp->lock, flags); if (copy_to_user(ifr->ifr_data, &my_cmd, sizeof(my_cmd))) { ret = -EFAULT; break; } break; - case RTL_WRITE_OOB_MAC: if (my_cmd.len == 0 || my_cmd.len > 4) return -EOPNOTSUPP; - spin_lock_irqsave(&tp->lock, flags); rtl8168_oob_mutex_lock(tp); rtl8168_ocp_write(tp, my_cmd.offset, my_cmd.len, my_cmd.data); rtl8168_oob_mutex_unlock(tp); - spin_unlock_irqrestore(&tp->lock, flags); break; - case RTL_ENABLE_PCI_DIAG: - spin_lock_irqsave(&tp->lock, flags); tp->rtk_enable_diag = 1; - spin_unlock_irqrestore(&tp->lock, flags); - dprintk("enable rtk diag\n"); break; - case RTL_DISABLE_PCI_DIAG: - spin_lock_irqsave(&tp->lock, flags); tp->rtk_enable_diag = 0; - spin_unlock_irqrestore(&tp->lock, flags); - dprintk("disable rtk diag\n"); break; - case RTL_READ_MAC_OCP: if (my_cmd.offset % 2) return -EOPNOTSUPP; - spin_lock_irqsave(&tp->lock, flags); my_cmd.data = rtl8168_mac_ocp_read(tp, my_cmd.offset); - spin_unlock_irqrestore(&tp->lock, flags); - if (copy_to_user(ifr->ifr_data, &my_cmd, sizeof(my_cmd))) { ret = -EFAULT; break; } break; - case RTL_WRITE_MAC_OCP: if ((my_cmd.offset % 2) || (my_cmd.len != 2)) return -EOPNOTSUPP; - spin_lock_irqsave(&tp->lock, flags); rtl8168_mac_ocp_write(tp, my_cmd.offset, (u16)my_cmd.data); - spin_unlock_irqrestore(&tp->lock, flags); break; - case RTL_DIRECT_READ_PHY_OCP: - spin_lock_irqsave(&tp->lock, flags); my_cmd.data = rtl8168_mdio_prot_direct_read_phy_ocp(tp, my_cmd.offset); - spin_unlock_irqrestore(&tp->lock, flags); - if (copy_to_user(ifr->ifr_data, &my_cmd, sizeof(my_cmd))) {
View file
r8168-8.051.02.tar.gz/src/rtltool.h -> r8168-8.052.01.tar.gz/src/rtltool.h
Changed
@@ -5,7 +5,7 @@ # r8168 is the Linux device driver released for Realtek Gigabit Ethernet # controllers with PCI-Express interface. # -# Copyright(c) 2022 Realtek Semiconductor Corp. All rights reserved. +# Copyright(c) 2023 Realtek Semiconductor Corp. All rights reserved. # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the Free
View file
r8168.keyring
Added
@@ -0,0 +1,19 @@ +-----BEGIN PGP PUBLIC KEY BLOCK----- + +mDMEWjorXBYJKwYBBAHaRw8BAQdAjGKRKfCsgqRDija1BdhFQyhl7v8ooFB9n0+B +fFFwIUq0N01hc3NpbWlsaWFubyBUb3Jyb21lbyA8bWFzc2ltaWxpYW5vLnRvcnJv +bWVvQGdtYWlsLmNvbT6I0AQTFggAeAIbAwULCQgHAgYVCAkKCwIEFgIDAQIeAQIX +gAUJEJ7XDhYhBAytqs9w9kxlThMbMRFnXHQ0Kd3vBQJjhKA5ORSAAAAAABAAIHBy +b29mQGFyaWFkbmUuaWRodHRwczovL2Zvc3N0b2Rvbi5vcmcvQG10b3Jyb21lbwAK +CRARZ1x0NCnd74sYAP9cd+GQFHYUdC8h5rinC8zlLfCSRmK4RmpynORvNUoHlwD/ +VHc1QKQygGJHkGUR/BzBwhvy9V8VFUXLHEkix/5EAgy4MwRaOiyTFgkrBgEEAdpH +DwEBB0ALDo3UpmTEMnSfibzebWay/yHw5PQ3M6dikohuznLdD4h+BBgWCAAmAhsg +FiEEDK2qz3D2TGVOExsxEWdcdDQp3e8FAmFzE3sFCRCe6GgACgkQEWdcdDQp3e+l +MgEAqNJOWIvlmwvgDUnM49o9Xy+ev0ApfCcpd+M9Viv3HmwA/RFNVLW5Q3ClhUPd +RHRSgOI/txQSMCX24h1R4g5Ck3kPuDgEWjorXBIKKwYBBAGXVQEFAQEHQG8U6zt8 +dY35U3jMoulSJrEfc2IawNGNum7hdNwGarUhAwEIB4h+BBgWCAAmAhsMFiEEDK2q +z3D2TGVOExsxEWdcdDQp3e8FAmFzE3sFCRCe6Z8ACgkQEWdcdDQp3e/FnQD/ROjp +SAtLo4A2PbQ9Awk4V/dW2iSGXT+c946xwd6v+toA/R3VhNaxQpVjqpwLYYhV2T+E +8i1/tU0JWRZh4/DUvY0P +=mnMt +-----END PGP PUBLIC KEY BLOCK-----
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
.