+++ /dev/null
-diff -ur r8168-8.048.02/src/r8168_n.c r8168-8.048.02-256/src/r8168_n.c
---- r8168-8.048.02/src/r8168_n.c 2021-02-06 21:15:28.271768114 +0100
-+++ r8168-8.048.02-256/src/r8168_n.c 2021-02-06 21:15:11.085159309 +0100
-@@ -24389,11 +24389,11 @@
- tp->advertising = advertising_mode;
-
- tp->max_jumbo_frame_size = rtl_chip_info[tp->chipset].jumbo_frame_sz;
--#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)
- /* MTU range: 60 - hw-specific max */
- dev->min_mtu = ETH_ZLEN;
- dev->max_mtu = tp->max_jumbo_frame_size;
--#endif //LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)
-+#endif //LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)
- tp->eee_enabled = eee_enable;
- tp->eee_adv_t = MDIO_EEE_1000T | MDIO_EEE_100TX;
- }
-@@ -27421,12 +27421,12 @@
- int ret = 0;
- unsigned long flags;
-
--#if LINUX_VERSION_CODE < KERNEL_VERSION(4,10,0)
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,11,0)
- if (new_mtu < ETH_ZLEN)
- return -EINVAL;
- else if (new_mtu > tp->max_jumbo_frame_size)
- new_mtu = tp->max_jumbo_frame_size;
--#endif //LINUX_VERSION_CODE < KERNEL_VERSION(4,10,0)
-+#endif //LINUX_VERSION_CODE < KERNEL_VERSION(4,11,0)
-
- spin_lock_irqsave(&tp->lock, flags);
- dev->mtu = new_mtu;
-@@ -28798,7 +28798,7 @@
- }
- #endif
-
--#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)
- if (RTL_NETIF_RX_COMPLETE(dev, napi, work_done) == FALSE) return RTL_NAPI_RETURN_VALUE;
- #else
- RTL_NETIF_RX_COMPLETE(dev, napi, work_done);
--- /dev/null
+--- r8168-8.048.02/src/r8168_n.c~ 2022-04-02 22:25:30.000000000 +0200
++++ r8168-8.048.02/src/r8168_n.c 2022-04-02 22:28:28.896501079 +0200
+@@ -1615,7 +1615,11 @@
+ static int rtl8168_proc_open(struct inode *inode, struct file *file)
+ {
+ struct net_device *dev = proc_get_parent_data(inode);
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5,17,0)
+ int (*show)(struct seq_file *, void *) = PDE_DATA(inode);
++#else
++ int (*show)(struct seq_file *, void *) = pde_data(inode);
++#endif
+
+ return single_open(file, show, dev);
+ }
+--- r8168-8.049.02/src/r8168_n.c.orig 2022-04-02 23:30:49.000000000 +0200
++++ r8168-8.049.02/src/r8168_n.c 2022-04-02 23:40:02.568626144 +0200
+@@ -24065,6 +24065,9 @@
+ struct rtl8168_private *tp = netdev_priv(dev);
+ int i;
+ u8 mac_addr[MAC_ADDR_LEN];
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,17,0)
++ u8 addr[ETH_ALEN] __aligned(4);
++#endif
+
+ for (i = 0; i < MAC_ADDR_LEN; i++)
+ mac_addr[i] = RTL_R8(tp, MAC0 + i);
+@@ -24132,10 +24135,18 @@
+
+ rtl8168_rar_set(tp, mac_addr);
+
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,17,0)
++ for (i = 0; i < MAC_ADDR_LEN; i++) {
++ addr[i] = RTL_R8(tp, MAC0 + i);
++ tp->org_mac_addr[i] = dev->dev_addr[i]; /* keep the original MAC address */
++ }
++ eth_hw_addr_set(dev, addr);
++#else
+ for (i = 0; i < MAC_ADDR_LEN; i++) {
+ dev->dev_addr[i] = RTL_R8(tp, MAC0 + i);
+ tp->org_mac_addr[i] = dev->dev_addr[i]; /* keep the original MAC address */
+ }
++#endif
+ #if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,13)
+ memcpy(dev->perm_addr, dev->dev_addr, dev->addr_len);
+ #endif
+++ /dev/null
---- r8168-8.048.02/src/r8168_n.c~ 2020-02-12 15:43:44.000000000 +0100
-+++ r8168-8.048.02/src/r8168_n.c 2020-04-04 22:52:03.066746887 +0200
-@@ -1616,12 +1616,21 @@
- return single_open(file, show, dev);
- }
-
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(5,6,0)
- static const struct file_operations rtl8168_proc_fops = {
- .open = rtl8168_proc_open,
- .read = seq_read,
- .llseek = seq_lseek,
- .release = single_release,
- };
-+#else
-+static const struct proc_ops rtl8168_proc_fops = {
-+ .proc_open = rtl8168_proc_open,
-+ .proc_read = seq_read,
-+ .proc_lseek = seq_lseek,
-+ .proc_release = single_release,
-+};
-+#endif
- #endif
-
- /*
---- r8168-8.048.02/src/r8168_n.c~ 2020-04-04 22:53:42.000000000 +0200
-+++ r8168-8.048.02/src/r8168_n.c 2020-04-04 22:58:05.263418678 +0200
-@@ -456,7 +456,11 @@
- static void rtl8168_hw_start(struct net_device *dev);
- static int rtl8168_close(struct net_device *dev);
- static void rtl8168_set_rx_mode(struct net_device *dev);
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(5,6,0)
- static void rtl8168_tx_timeout(struct net_device *dev);
-+#else
-+static void rtl8168_tx_timeout(struct net_device *dev, unsigned int txqueue);
-+#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);
-@@ -27858,7 +27858,11 @@
- }
-
- static void
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(5,6,0)
- rtl8168_tx_timeout(struct net_device *dev)
-+#else
-+rtl8168_tx_timeout(struct net_device *dev, unsigned int txqueue)
-+#endif
- {
- struct rtl8168_private *tp = netdev_priv(dev);
- unsigned long flags;
# nothing to be placed to debuginfo package
%define _enable_debug_packages 0
-%define rel 2
+%define rel 1
%define pname r8168
Summary: Linux driver for RTL8111/8168B PCI Express Gigabit Ethernet controllers
Summary(pl.UTF-8): Linuksowy sterownik dla kart sieciowych RTL8111/8168B PCI Express Gigabit Ethernet
Name: %{pname}%{_alt_kernel}
-Version: 8.048.02
+Version: 8.049.02
Release: %{rel}%{?_pld_builder:@%{_kernel_ver_str}}
License: GPL
Group: Base/Kernel
# https://www.realtek.com/en/component/zoo/category/network-interface-controllers-10-100-1000m-gigabit-ethernet-pci-express-software
# unfortunately this download is not DF-friendly.
Source0: %{pname}-%{version}.tar.bz2
-# Source0-md5: 45370f7630da1ff6e3a9996e445a94af
-Patch0: kernel-5.6.patch
-Patch1: kernel-4.9.256.patch
+# Source0-md5: 9c2191ca3ff85102bc18a41916eceb8b
+Patch0: kernel-5.17.patch
BuildRequires: rpmbuild(macros) >= 1.701
%{expand:%buildrequires_kernel kernel%%{_alt_kernel}-module-build >= 3:2.6.20.2}
BuildRoot: %{tmpdir}/%{pname}-%{version}-root-%(id -u -n)
%prep
%setup -q -n %{pname}-%{version}
%patch0 -p1
-%patch1 -p1
%build
%{expand:%build_kernel_packages}