Overview

Request 5109 (accepted)

update to 8.048.03

Submit package home:Aloysius:branches:Essentials / r8168 to package Essentials / r8168

r8168.changes Changed
x
 
1
@@ -1,4 +1,10 @@
2
 -------------------------------------------------------------------
3
+Tue Jun  2 07:17:12 UTC 2020 - Luigi Baldoni <aloisio@gmx.com>
4
+
5
+- Update to version 8.048.03
6
+- Drop 83b957b4.patch (fixed upstream)
7
+
8
+-------------------------------------------------------------------
9
 Tue Mar 31 06:40:50 UTC 2020 - Werner Fink <werner@suse.de>
10
 
11
 - Add patch 83b957b4.patch to get it build for kernel 5.6 
12
r8168.spec Changed
35
 
1
@@ -1,7 +1,7 @@
2
 #
3
 # spec file for package r8168
4
 #
5
-# Copyright (c) 2019 Packman Team <packman@links2linux.de>
6
+# Copyright (c) 2020 Packman Team <packman@links2linux.de>
7
 # Copyright (c) 2017 SUSE LINUX Products GmbH, Nuernberg, Germany.
8
 #
9
 # All modifications and additions to the file contributed by third parties
10
@@ -18,7 +18,7 @@
11
 
12
 #!BuildIgnore: enough-build-resources
13
 Name:           r8168
14
-Version:        8.048.00
15
+Version:        8.048.03
16
 Release:        0
17
 Summary:        Device driver for RealTek Gigabit Ethernet controllers
18
 License:        GPL-2.0-or-later
19
@@ -31,7 +31,6 @@
20
 Source2:        Module.supported
21
 Patch0:         r8168-kernel_version.patch
22
 Patch1:         r8168-configuration.patch
23
-Patch42:        83b957b4.patch
24
 BuildRequires:  kernel-source
25
 BuildRequires:  kernel-syms
26
 BuildRequires:  libelf-devel
27
@@ -60,7 +59,6 @@
28
 %setup -q
29
 %patch0 -b .p0
30
 %patch1 -b .p1
31
-%patch42 -p1 -b .p42
32
 cp %{S:1} .
33
 cp %{S:2} .
34
 
35
83b957b4.patch Deleted
99
 
1
@@ -1,97 +0,0 @@
2
-From 83b957b43d320da29476c6782be55df1bfb62d94 Mon Sep 17 00:00:00 2001
3
-From: petehg <pherworth@gmail.com>
4
-Date: Sun, 1 Mar 2020 09:38:25 +0000
5
-Subject: [PATCH] added patch for kernel-5.6
6
-
7
----
8
- src/r8168_n.c | 33 +++++++++++++++++++++++++++------
9
- 1 file changed, 27 insertions(+), 6 deletions(-)
10
-
11
-diff --git a/src/r8168_n.c b/src/r8168_n.c
12
-index 0df6041..557823e 100755
13
---- a/src/r8168_n.c
14
-+++ b/src/r8168_n.c
15
-@@ -456,7 +456,11 @@ static void rtl8168_hw_config(struct net_device *dev);
16
- static void rtl8168_hw_start(struct net_device *dev);
17
- static int rtl8168_close(struct net_device *dev);
18
- static void rtl8168_set_rx_mode(struct net_device *dev);
19
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0) 
20
-+static void rtl8168_tx_timeout(struct net_device *dev, unsigned int new_mtu);
21
-+#else
22
- static void rtl8168_tx_timeout(struct net_device *dev);
23
-+#endif
24
- static struct net_device_stats *rtl8168_get_stats(struct net_device *dev);
25
- static int rtl8168_rx_interrupt(struct net_device *, struct rtl8168_private *, napi_budget);
26
- static int rtl8168_change_mtu(struct net_device *dev, int new_mtu);
27
-@@ -1615,7 +1619,14 @@ static int rtl8168_proc_open(struct inode *inode, struct file *file)
28
- 
29
-         return single_open(file, show, dev);
30
- }
31
--
32
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0)
33
-+static const struct proc_ops rtl8168_proc_ops = {
34
-+        .proc_open           = rtl8168_proc_open,
35
-+        .proc_read           = seq_read,
36
-+        .proc_lseek          = seq_lseek,
37
-+        .proc_release        = single_release,
38
-+};
39
-+#else
40
- static const struct file_operations rtl8168_proc_fops = {
41
-         .open           = rtl8168_proc_open,
42
-         .read           = seq_read,
43
-@@ -1623,6 +1634,7 @@ static const struct file_operations rtl8168_proc_fops = {
44
-         .release        = single_release,
45
- };
46
- #endif
47
-+#endif
48
- 
49
- /*
50
-  * Table of proc files we need to create.
51
-@@ -1665,9 +1677,15 @@ static void rtl8168_proc_init(struct net_device *dev)
52
-                 tp->proc_dir = dir;
53
-                 proc_init_num++;
54
- 
55
--                for (f = rtl8168_proc_files; f->name[0]; f++) {
56
--                        if (!proc_create_data(f->name, S_IFREG | S_IRUGO, dir,
57
--                                              &rtl8168_proc_fops, f->show)) {
58
-+     for (f = rtl8168_proc_files; f->name[0]; f++) {
59
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0)
60
-+         if (!proc_create_data(f->name, S_IFREG | S_IRUGO, dir,
61
-+                                              &rtl8168_proc_ops, f->show)) 
62
-+#else        
63
-+         if (!proc_create_data(f->name, S_IFREG | S_IRUGO, dir,
64
-+                                              &rtl8168_proc_fops, f->show))
65
-+#endif
66
-+         {
67
-                                 printk("Unable to initialize "
68
-                                        "/proc/net/%s/%s/%s\n",
69
-                                        MODULENAME, dev->name, f->name);
70
-@@ -25881,7 +25899,6 @@ rtl8168_init_one(struct pci_dev *pdev,
71
- #if LINUX_VERSION_CODE > KERNEL_VERSION(2,4,22)
72
-         SET_ETHTOOL_OPS(dev, &rtl8168_ethtool_ops);
73
- #endif
74
--
75
-         dev->watchdog_timeo = RTL8168_TX_TIMEOUT;
76
-         dev->irq = pdev->irq;
77
-         dev->base_addr = (unsigned long) ioaddr;
78
-@@ -27817,7 +27834,7 @@ static void rtl8168_reset_task(struct work_struct *work)
79
- #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24)
80
-         rtl8168_rx_interrupt(dev, tp, &budget);
81
- #else
82
--        rtl8168_rx_interrupt(dev, tp, budget);
83
-+        rtl8168_rx_interrupt(dev, tp, budget);      
84
- #endif  //LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24)
85
- 
86
-         spin_lock_irqsave(&tp->lock, flags);
87
-@@ -27844,7 +27861,11 @@ static void rtl8168_reset_task(struct work_struct *work)
88
- }
89
- 
90
- static void
91
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0)
92
-+rtl8168_tx_timeout(struct net_device *dev, unsigned int txqueue)
93
-+#else
94
- rtl8168_tx_timeout(struct net_device *dev)
95
-+#endif
96
- {
97
-         struct rtl8168_private *tp = netdev_priv(dev);
98
-         unsigned long flags;
99
r8168-8.048.00.tar.bz2/src/r8168.h -> r8168-8.048.03.tar.bz2/src/r8168.h Changed
62
 
1
@@ -4,7 +4,7 @@
2
 # r8168 is the Linux device driver released for Realtek Gigabit Ethernet
3
 # controllers with PCI-Express interface.
4
 #
5
-# Copyright(c) 2019 Realtek Semiconductor Corp. All rights reserved.
6
+# Copyright(c) 2020 Realtek Semiconductor Corp. All rights reserved.
7
 #
8
 # This program is free software; you can redistribute it and/or modify it
9
 # under the terms of the GNU General Public License as published by the Free
10
@@ -335,12 +335,12 @@
11
 #define DASH_SUFFIX ""
12
 #endif
13
 
14
-#define RTL8168_VERSION "8.048.00" NAPI_SUFFIX FIBER_SUFFIX REALWOW_SUFFIX DASH_SUFFIX
15
+#define RTL8168_VERSION "8.048.03" NAPI_SUFFIX FIBER_SUFFIX REALWOW_SUFFIX DASH_SUFFIX
16
 #define MODULENAME "r8168"
17
 #define PFX MODULENAME ": "
18
 
19
 #define GPL_CLAIM "\
20
-r8168  Copyright (C) 2019  Realtek NIC software team <nicfae@realtek.com> \n \
21
+r8168  Copyright (C) 2020  Realtek NIC software team <nicfae@realtek.com> \n \
22
 This program comes with ABSOLUTELY NO WARRANTY; for details, please see <http://www.gnu.org/licenses/>. \n \
23
 This is free software, and you are welcome to redistribute it under certain conditions; see <http://www.gnu.org/licenses/>. \n"
24
 
25
@@ -359,9 +359,6 @@
26
 #define R8168_MSG_DEFAULT \
27
     (NETIF_MSG_DRV | NETIF_MSG_PROBE | NETIF_MSG_IFUP | NETIF_MSG_IFDOWN)
28
 
29
-#define TX_BUFFS_AVAIL(tp) \
30
-    (tp->dirty_tx + NUM_TX_DESC - tp->cur_tx - 1)
31
-
32
 #ifdef CONFIG_R8168_NAPI
33
 #define rtl8168_rx_hwaccel_skb      vlan_hwaccel_receive_skb
34
 #define rtl8168_rx_quota(count, quota)  min(count, quota)
35
@@ -437,6 +434,8 @@
36
 
37
 #define SHORT_PACKET_PADDING_BUF_SIZE 256
38
 
39
+#define RTK_MAGIC_DEBUG_VALUE 0x0badbeef
40
+
41
 /* write/read MMIO register */
42
 #define RTL_W8(tp, reg, val8)  writeb((val8), tp->mmio_addr + (reg))
43
 #define RTL_W16(tp, reg, val16)    writew((val16), tp->mmio_addr + (reg))
44
@@ -1572,6 +1571,8 @@
45
         u32 HwFiberStat;
46
         u8 HwSwitchMdiToFiber;
47
 
48
+        u8 HwSuppSerDesPhyVer;
49
+
50
         u8 HwSuppPhyOcpVer;
51
 
52
         u16 NicCustLedValue;
53
@@ -1808,6 +1809,8 @@
54
 void rtl8168_hw_disable_mac_mcu_bps(struct net_device *dev);
55
 
56
 #define HW_SUPPORT_CHECK_PHY_DISABLE_MODE(_M)        ((_M)->HwSuppCheckPhyDisableModeVer > 0 )
57
+#define HW_SUPP_SERDES_PHY(_M)        ((_M)->HwSuppSerDesPhyVer > 0)
58
+#define HW_HAS_WRITE_PHY_MCU_RAM_CODE(_M)        (((_M)->HwHasWrRamCodeToMicroP == TRUE) ? 1 : 0)
59
 
60
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,34)
61
 #define netdev_mc_count(dev) ((dev)->mc_count)
62
r8168-8.048.00.tar.bz2/src/r8168_asf.c -> r8168-8.048.03.tar.bz2/src/r8168_asf.c Changed
10
 
1
@@ -4,7 +4,7 @@
2
 # r8168 is the Linux device driver released for Realtek Gigabit Ethernet
3
 # controllers with PCI-Express interface.
4
 #
5
-# Copyright(c) 2019 Realtek Semiconductor Corp. All rights reserved.
6
+# Copyright(c) 2020 Realtek Semiconductor Corp. All rights reserved.
7
 #
8
 # This program is free software; you can redistribute it and/or modify it
9
 # under the terms of the GNU General Public License as published by the Free
10
r8168-8.048.00.tar.bz2/src/r8168_asf.h -> r8168-8.048.03.tar.bz2/src/r8168_asf.h Changed
10
 
1
@@ -4,7 +4,7 @@
2
 # r8168 is the Linux device driver released for Realtek Gigabit Ethernet
3
 # controllers with PCI-Express interface.
4
 #
5
-# Copyright(c) 2019 Realtek Semiconductor Corp. All rights reserved.
6
+# Copyright(c) 2020 Realtek Semiconductor Corp. All rights reserved.
7
 #
8
 # This program is free software; you can redistribute it and/or modify it
9
 # under the terms of the GNU General Public License as published by the Free
10
r8168-8.048.00.tar.bz2/src/r8168_dash.h -> r8168-8.048.03.tar.bz2/src/r8168_dash.h Changed
10
 
1
@@ -4,7 +4,7 @@
2
 # r8168 is the Linux device driver released for Realtek Gigabit Ethernet
3
 # controllers with PCI-Express interface.
4
 #
5
-# Copyright(c) 2019 Realtek Semiconductor Corp. All rights reserved.
6
+# Copyright(c) 2020 Realtek Semiconductor Corp. All rights reserved.
7
 #
8
 # This program is free software; you can redistribute it and/or modify it
9
 # under the terms of the GNU General Public License as published by the Free
10
r8168-8.048.00.tar.bz2/src/r8168_fiber.h -> r8168-8.048.03.tar.bz2/src/r8168_fiber.h Changed
24
 
1
@@ -4,7 +4,7 @@
2
 # r8168 is the Linux device driver released for Realtek Gigabit Ethernet
3
 # controllers with PCI-Express interface.
4
 #
5
-# Copyright(c) 2019 Realtek Semiconductor Corp. All rights reserved.
6
+# Copyright(c) 2020 Realtek Semiconductor Corp. All rights reserved.
7
 #
8
 # This program is free software; you can redistribute it and/or modify it
9
 # under the terms of the GNU General Public License as published by the Free
10
@@ -55,11 +55,12 @@
11
 void rtl8168_hw_init_fiber_nic(struct net_device *dev);
12
 void rtl8168_hw_fiber_nic_d3_para(struct net_device *dev);
13
 void rtl8168_hw_fiber_phy_config(struct net_device *dev);
14
-u32 rtl8168_hw_fiber_get_connect_status(struct net_device *dev);
15
 void rtl8168_hw_switch_mdi_to_fiber(struct net_device *dev);
16
 void rtl8168_hw_switch_mdi_to_nic(struct net_device *dev);
17
 unsigned int rtl8168_hw_fiber_link_ok(struct net_device *dev);
18
 void rtl8168_check_fiber_link_status(struct net_device *dev);
19
+void rtl8168_check_hw_fiber_mode_support(struct net_device *dev);
20
+void rtl8168_set_fiber_mode_software_variable(struct net_device *dev);
21
 
22
 
23
 #endif /* _LINUX_R8168_FIBER_H */
24
r8168-8.048.00.tar.bz2/src/r8168_n.c -> r8168-8.048.03.tar.bz2/src/r8168_n.c Changed
684
 
1
@@ -4,7 +4,7 @@
2
 # r8168 is the Linux device driver released for Realtek Gigabit Ethernet
3
 # controllers with PCI-Express interface.
4
 #
5
-# Copyright(c) 2019 Realtek Semiconductor Corp. All rights reserved.
6
+# Copyright(c) 2020 Realtek Semiconductor Corp. All rights reserved.
7
 #
8
 # This program is free software; you can redistribute it and/or modify it
9
 # under the terms of the GNU General Public License as published by the Free
10
@@ -456,7 +456,11 @@
11
 static void rtl8168_hw_start(struct net_device *dev);
12
 static int rtl8168_close(struct net_device *dev);
13
 static void rtl8168_set_rx_mode(struct net_device *dev);
14
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0)
15
+static void rtl8168_tx_timeout(struct net_device *dev, unsigned int txqueue);
16
+#else
17
 static void rtl8168_tx_timeout(struct net_device *dev);
18
+#endif
19
 static struct net_device_stats *rtl8168_get_stats(struct net_device *dev);
20
 static int rtl8168_rx_interrupt(struct net_device *, struct rtl8168_private *, napi_budget);
21
 static int rtl8168_change_mtu(struct net_device *dev, int new_mtu);
22
@@ -881,6 +885,7 @@
23
         seq_printf(m, "HwFiberModeVer\t0x%x\n", tp->HwFiberModeVer);
24
         seq_printf(m, "HwFiberStat\t0x%x\n", tp->HwFiberStat);
25
         seq_printf(m, "HwSwitchMdiToFiber\t0x%x\n", tp->HwSwitchMdiToFiber);
26
+        seq_printf(m, "HwSuppSerDesPhyVer\t0x%x\n", tp->HwSuppSerDesPhyVer);
27
         seq_printf(m, "NicCustLedValue\t0x%x\n", tp->NicCustLedValue);
28
         seq_printf(m, "RequiredSecLanDonglePatch\t0x%x\n", tp->RequiredSecLanDonglePatch);
29
         seq_printf(m, "HwSuppDashVer\t0x%x\n", tp->HwSuppDashVer);
30
@@ -1190,6 +1195,7 @@
31
                         "HwFiberModeVer\t0x%x\n"
32
                         "HwFiberStat\t0x%x\n"
33
                         "HwSwitchMdiToFiber\t0x%x\n"
34
+                        "HwSuppSerDesPhyVer\t0x%x\n"
35
                         "NicCustLedValue\t0x%x\n"
36
                         "RequiredSecLanDonglePatch\t0x%x\n"
37
                         "HwSuppDashVer\t0x%x\n"
38
@@ -1270,6 +1276,7 @@
39
                         tp->HwFiberModeVer,
40
                         tp->HwFiberStat,
41
                         tp->HwSwitchMdiToFiber,
42
+                        tp->HwSuppSerDesPhyVer,
43
                         tp->NicCustLedValue,
44
                         tp->RequiredSecLanDonglePatch,
45
                         tp->HwSuppDashVer,
46
@@ -1616,6 +1623,14 @@
47
         return single_open(file, show, dev);
48
 }
49
 
50
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0)
51
+static const struct proc_ops rtl8168_proc_fops = {
52
+        .proc_open           = rtl8168_proc_open,
53
+        .proc_read           = seq_read,
54
+        .proc_lseek          = seq_lseek,
55
+        .proc_release        = single_release,
56
+};
57
+#else
58
 static const struct file_operations rtl8168_proc_fops = {
59
         .open           = rtl8168_proc_open,
60
         .read           = seq_read,
61
@@ -1624,6 +1639,8 @@
62
 };
63
 #endif
64
 
65
+#endif
66
+
67
 /*
68
  * Table of proc files we need to create.
69
  */
70
@@ -2088,6 +2105,52 @@
71
         return data16;
72
 }
73
 
74
+static void
75
+rtl8168_clear_and_set_mcu_ocp_bit(
76
+        struct rtl8168_private *tp,
77
+        u16   addr,
78
+        u16   clearmask,
79
+        u16   setmask
80
+)
81
+{
82
+        u16 RegValue;
83
+
84
+        RegValue = rtl8168_mac_ocp_read(tp, addr);
85
+        RegValue &= ~clearmask;
86
+        RegValue |= setmask;
87
+        rtl8168_mac_ocp_write(tp, addr, RegValue);
88
+}
89
+
90
+/*
91
+static void
92
+rtl8168_clear_mcu_ocp_bit(
93
+        struct rtl8168_private *tp,
94
+        u16   addr,
95
+        u16   mask
96
+)
97
+{
98
+        rtl8168_clear_and_set_mcu_ocp_bit(tp,
99
+                                          addr,
100
+                                          mask,
101
+                                          0
102
+                                         );
103
+}
104
+*/
105
+
106
+static void
107
+rtl8168_set_mcu_ocp_bit(
108
+        struct rtl8168_private *tp,
109
+        u16   addr,
110
+        u16   mask
111
+)
112
+{
113
+        rtl8168_clear_and_set_mcu_ocp_bit(tp,
114
+                                          addr,
115
+                                          0,
116
+                                          mask
117
+                                         );
118
+}
119
+
120
 static u32 real_ocp_read(struct rtl8168_private *tp, u16 addr, u8 len)
121
 {
122
         int i, val_shift, shift = 0;
123
@@ -3699,10 +3762,6 @@
124
         rtl8168_check_fiber_link_status(dev);
125
 #endif //ENABLE_FIBER_SUPPORT
126
 
127
-#ifdef ENABLE_FIBER_SUPPORT
128
-        rtl8168_check_fiber_link_status(dev);
129
-#endif //ENABLE_FIBER_SUPPORT
130
-
131
         link_status_on = tp->link_ok(dev);
132
 
133
         if (tp->mcfg == CFG_METHOD_11)
134
@@ -4483,7 +4542,7 @@
135
                 tp->wol_opts |= WAKE_MCAST;
136
 
137
 out_unlock:
138
-        tp->wol_enabled = (tp->wol_opts) ? WOL_ENABLED : WOL_DISABLED;
139
+        tp->wol_enabled = (tp->wol_opts || tp->dash_printer_enabled) ? WOL_ENABLED : WOL_DISABLED;
140
 
141
         spin_unlock_irqrestore(&tp->lock, flags);
142
 }
143
@@ -4529,6 +4588,9 @@
144
                 RTL_W8(tp, cfg[i].reg, options);
145
         }
146
 
147
+        if (tp->dash_printer_enabled)
148
+                RTL_W8(tp, Config5, RTL_R8(tp, Config5) | LanWake);
149
+
150
         rtl8168_disable_cfg9346_write(tp);
151
 }
152
 
153
@@ -4601,6 +4663,9 @@
154
                         rtl8168_disable_cfg9346_write(tp);
155
                 }
156
 
157
+                if (HW_SUPP_SERDES_PHY(tp))
158
+                        return;
159
+
160
                 rtl8168_mdio_write(tp, 0x1F, 0x0000);
161
                 auto_nego = rtl8168_mdio_read(tp, MII_ADVERTISE);
162
                 auto_nego &= ~(ADVERTISE_10HALF | ADVERTISE_10FULL
163
@@ -4760,11 +4825,11 @@
164
 
165
         tp->wol_opts = wol->wolopts;
166
 
167
-        tp->wol_enabled = (tp->wol_opts) ? WOL_ENABLED : WOL_DISABLED;
168
+        tp->wol_enabled = (tp->wol_opts || tp->dash_printer_enabled) ? WOL_ENABLED : WOL_DISABLED;
169
 
170
         spin_unlock_irqrestore(&tp->lock, flags);
171
 
172
-        device_set_wakeup_enable(&tp->pci_dev->dev, wol->wolopts);
173
+        device_set_wakeup_enable(&tp->pci_dev->dev, tp->wol_enabled);
174
 
175
         return 0;
176
 }
177
@@ -6205,6 +6270,9 @@
178
                 return -EOPNOTSUPP;
179
         }
180
 
181
+        if (HW_SUPP_SERDES_PHY(tp) || !HW_HAS_WRITE_PHY_MCU_RAM_CODE(tp))
182
+                return -EOPNOTSUPP;
183
+
184
         spin_lock_irqsave(&tp->lock, flags);
185
 
186
         if (unlikely(tp->rtk_enable_diag)) {
187
@@ -6861,6 +6929,21 @@
188
 }
189
 
190
 static void
191
+rtl8168_switch_to_sgmii_mode(
192
+        struct rtl8168_private *tp
193
+)
194
+{
195
+        if (FALSE == HW_SUPP_SERDES_PHY(tp)) return;
196
+
197
+        switch (tp->HwSuppSerDesPhyVer) {
198
+        case 1:
199
+                rtl8168_mac_ocp_write(tp, 0xEB00, 0x2);
200
+                rtl8168_set_mcu_ocp_bit(tp, 0xEB16, BIT_1);
201
+                break;
202
+        }
203
+}
204
+
205
+static void
206
 rtl8168_exit_oob(struct net_device *dev)
207
 {
208
         struct rtl8168_private *tp = netdev_priv(dev);
209
@@ -6868,6 +6951,12 @@
210
 
211
         RTL_W32(tp, RxConfig, RTL_R32(tp, RxConfig) & ~(AcceptErr | AcceptRunt | AcceptBroadcast | AcceptMulticast | AcceptMyPhys |  AcceptAllPhys));
212
 
213
+        if (HW_SUPP_SERDES_PHY(tp)) {
214
+                if (tp->HwSuppSerDesPhyVer == 1) {
215
+                        rtl8168_switch_to_sgmii_mode(tp);
216
+                }
217
+        }
218
+
219
         switch (tp->mcfg) {
220
         case CFG_METHOD_23:
221
         case CFG_METHOD_27:
222
@@ -9213,7 +9302,11 @@
223
         rtl8168_mac_ocp_write(tp, 0xFC2A, 0x0B14);
224
         rtl8168_mac_ocp_write(tp, 0xFC2C, 0x0BE4);
225
 
226
-        rtl8168_mac_ocp_write(tp, 0xFC38, 0x0006);
227
+        if (tp->HwSuppSerDesPhyVer == 1) {
228
+                rtl8168_mac_ocp_write(tp, 0xFC38, 0x0007);
229
+        } else {
230
+                rtl8168_mac_ocp_write(tp, 0xFC38, 0x0006);
231
+        }
232
 }
233
 
234
 static void
235
@@ -9714,6 +9807,7 @@
236
                 rtl8168_ephy_write(tp, 0x1E, 0x20EB);
237
                 rtl8168_ephy_write(tp, 0x0D, 0x1666);
238
                 ClearPCIePhyBit(tp, 0x0B, BIT_0);
239
+                SetPCIePhyBit(tp, 0x1D, BIT_14);
240
 
241
                 break;
242
         case CFG_METHOD_29:
243
@@ -22491,7 +22585,7 @@
244
                 rtl8168_mdio_write(tp, 0x1F, 0x0000);
245
 
246
                 if (aspm) {
247
-                        if (tp->HwHasWrRamCodeToMicroP == TRUE) {
248
+                        if (HW_HAS_WRITE_PHY_MCU_RAM_CODE(tp)) {
249
                                 rtl8168_mdio_write(tp, 0x1f, 0x0000);
250
                                 rtl8168_mdio_write(tp, 0x15, 0x1006);
251
                         }
252
@@ -22779,7 +22873,7 @@
253
                 rtl8168_mdio_write(tp, 0x1f, 0x0000);
254
 
255
                 if (aspm) {
256
-                        if (tp->HwHasWrRamCodeToMicroP == TRUE) {
257
+                        if (HW_HAS_WRITE_PHY_MCU_RAM_CODE(tp)) {
258
                                 rtl8168_mdio_write(tp, 0x1f, 0x0000);
259
                                 gphy_val = rtl8168_mdio_read(tp, 0x15);
260
                                 gphy_val |= BIT_12;
261
@@ -22787,7 +22881,7 @@
262
                         }
263
                 }
264
         } else if (tp->mcfg == CFG_METHOD_18) {
265
-                if (tp->HwHasWrRamCodeToMicroP == TRUE) {
266
+                if (HW_HAS_WRITE_PHY_MCU_RAM_CODE(tp)) {
267
                         rtl8168_mdio_write(tp, 0x1F, 0x0005);
268
                         rtl8168_mdio_write(tp, 0x05, 0x8b80);
269
                         gphy_val = rtl8168_mdio_read(tp, 0x06);
270
@@ -22866,7 +22960,7 @@
271
                 rtl8168_mdio_write(tp, 0x06, rtl8168_mdio_read(tp, 0x06) & ~BIT_8);
272
                 rtl8168_mdio_write(tp, 0x1f, 0x0000);
273
 
274
-                if (tp->HwHasWrRamCodeToMicroP == TRUE) {
275
+                if (HW_HAS_WRITE_PHY_MCU_RAM_CODE(tp)) {
276
                         rtl8168_mdio_write(tp, 0x1f, 0x0005);
277
                         rtl8168_mdio_write(tp, 0x05, 0x8b85);
278
                         rtl8168_mdio_write(tp, 0x06, rtl8168_mdio_read(tp, 0x06) | BIT_15);
279
@@ -22874,7 +22968,7 @@
280
                 }
281
 
282
                 if (aspm) {
283
-                        if (tp->HwHasWrRamCodeToMicroP == TRUE) {
284
+                        if (HW_HAS_WRITE_PHY_MCU_RAM_CODE(tp)) {
285
                                 rtl8168_mdio_write(tp, 0x1f, 0x0000);
286
                                 gphy_val = rtl8168_mdio_read(tp, 0x15);
287
                                 gphy_val |= BIT_12;
288
@@ -22882,7 +22976,7 @@
289
                         }
290
                 }
291
         } else if (tp->mcfg == CFG_METHOD_19) {
292
-                if (tp->HwHasWrRamCodeToMicroP == TRUE) {
293
+                if (HW_HAS_WRITE_PHY_MCU_RAM_CODE(tp)) {
294
                         rtl8168_mdio_write(tp, 0x1F, 0x0005);
295
                         rtl8168_mdio_write(tp, 0x05, 0x8b80);
296
                         gphy_val = rtl8168_mdio_read(tp, 0x06);
297
@@ -22925,7 +23019,7 @@
298
                 rtl8168_mdio_write(tp, 0x06, rtl8168_mdio_read(tp, 0x06) & ~BIT_8);
299
                 rtl8168_mdio_write(tp, 0x1f, 0x0000);
300
 
301
-                if (tp->HwHasWrRamCodeToMicroP == TRUE) {
302
+                if (HW_HAS_WRITE_PHY_MCU_RAM_CODE(tp)) {
303
                         rtl8168_mdio_write(tp, 0x1f, 0x0005);
304
                         rtl8168_mdio_write(tp, 0x05, 0x8b85);
305
                         rtl8168_mdio_write(tp, 0x06, rtl8168_mdio_read(tp, 0x06) | BIT_15);
306
@@ -22933,7 +23027,7 @@
307
                 }
308
 
309
                 if (aspm) {
310
-                        if (tp->HwHasWrRamCodeToMicroP == TRUE) {
311
+                        if (HW_HAS_WRITE_PHY_MCU_RAM_CODE(tp)) {
312
                                 rtl8168_mdio_write(tp, 0x1f, 0x0000);
313
                                 gphy_val = rtl8168_mdio_read(tp, 0x15);
314
                                 gphy_val |= BIT_12;
315
@@ -22942,7 +23036,7 @@
316
                 }
317
         } else if (tp->mcfg == CFG_METHOD_20) {
318
 
319
-                if (tp->HwHasWrRamCodeToMicroP == TRUE) {
320
+                if (HW_HAS_WRITE_PHY_MCU_RAM_CODE(tp)) {
321
                         rtl8168_mdio_write(tp, 0x1F, 0x0005);
322
                         rtl8168_mdio_write(tp, 0x05, 0x8b80);
323
                         gphy_val = rtl8168_mdio_read(tp, 0x06);
324
@@ -23017,7 +23111,7 @@
325
                 rtl8168_mdio_write(tp, 0x06, rtl8168_mdio_read(tp, 0x06) & ~BIT_8);
326
                 rtl8168_mdio_write(tp, 0x1f, 0x0000);
327
 
328
-                if (tp->HwHasWrRamCodeToMicroP == TRUE) {
329
+                if (HW_HAS_WRITE_PHY_MCU_RAM_CODE(tp)) {
330
                         rtl8168_mdio_write(tp, 0x1f, 0x0005);
331
                         rtl8168_mdio_write(tp, 0x05, 0x8b85);
332
                         rtl8168_mdio_write(tp, 0x06, rtl8168_mdio_read(tp, 0x06) | BIT_15);
333
@@ -23025,7 +23119,7 @@
334
                 }
335
 
336
                 if (aspm) {
337
-                        if (tp->HwHasWrRamCodeToMicroP == TRUE) {
338
+                        if (HW_HAS_WRITE_PHY_MCU_RAM_CODE(tp)) {
339
                                 rtl8168_mdio_write(tp, 0x1f, 0x0000);
340
                                 gphy_val = rtl8168_mdio_read(tp, 0x15);
341
                                 gphy_val |= BIT_12;
342
@@ -23087,7 +23181,7 @@
343
                 rtl8168_mdio_write(tp, 0x14, 0x9222);
344
 
345
                 if (aspm) {
346
-                        if (tp->HwHasWrRamCodeToMicroP == TRUE) {
347
+                        if (HW_HAS_WRITE_PHY_MCU_RAM_CODE(tp)) {
348
                                 rtl8168_mdio_write(tp, 0x1F, 0x0A43);
349
                                 rtl8168_mdio_write(tp, 0x10, rtl8168_mdio_read(tp, 0x10) | BIT_2);
350
                         }
351
@@ -23131,7 +23225,7 @@
352
                 rtl8168_mdio_write(tp, 0x1F, 0x0000);
353
 
354
                 if (aspm) {
355
-                        if (tp->HwHasWrRamCodeToMicroP == TRUE) {
356
+                        if (HW_HAS_WRITE_PHY_MCU_RAM_CODE(tp)) {
357
                                 rtl8168_mdio_write(tp, 0x1F, 0x0A43);
358
                                 rtl8168_mdio_write(tp, 0x10, rtl8168_mdio_read(tp, 0x10) | BIT_2);
359
                         }
360
@@ -23159,7 +23253,7 @@
361
                 rtl8168_mdio_write(tp, 0x11, gphy_val);
362
 
363
                 if (aspm) {
364
-                        if (tp->HwHasWrRamCodeToMicroP == TRUE) {
365
+                        if (HW_HAS_WRITE_PHY_MCU_RAM_CODE(tp)) {
366
                                 rtl8168_mdio_write(tp, 0x1F, 0x0A43);
367
                                 rtl8168_mdio_write(tp, 0x10, rtl8168_mdio_read(tp, 0x10) | BIT_2);
368
                         }
369
@@ -23231,7 +23325,7 @@
370
                 rtl8168_mdio_write(tp, 0x14, (rtl8168_mdio_read(tp, 0x14) & ~0xFF00) | 0x8400);
371
 
372
                 if (aspm) {
373
-                        if (tp->HwHasWrRamCodeToMicroP == TRUE) {
374
+                        if (HW_HAS_WRITE_PHY_MCU_RAM_CODE(tp)) {
375
                                 rtl8168_mdio_write(tp, 0x1F, 0x0A43);
376
                                 rtl8168_mdio_write(tp, 0x10, rtl8168_mdio_read(tp, 0x10) | BIT_2);
377
                         }
378
@@ -23303,7 +23397,7 @@
379
                 rtl8168_mdio_write(tp, 0x14, (rtl8168_mdio_read(tp, 0x14) & ~0xFF00) | 0x8400);
380
 
381
                 if (aspm) {
382
-                        if (tp->HwHasWrRamCodeToMicroP == TRUE) {
383
+                        if (HW_HAS_WRITE_PHY_MCU_RAM_CODE(tp)) {
384
                                 rtl8168_mdio_write(tp, 0x1F, 0x0A43);
385
                                 rtl8168_mdio_write(tp, 0x10, rtl8168_mdio_read(tp, 0x10) | BIT_2);
386
                         }
387
@@ -23378,7 +23472,7 @@
388
                                     );
389
                 rtl8168_mdio_write(tp, 0x1F, 0x0000);
390
 
391
-                if (tp->HwHasWrRamCodeToMicroP) {
392
+                if (HW_HAS_WRITE_PHY_MCU_RAM_CODE(tp)) {
393
                         u16 dout_tapbin;
394
 
395
                         dout_tapbin = 0x0000;
396
@@ -23468,7 +23562,7 @@
397
                 rtl8168_mdio_write(tp, 0x1F, 0x0000);
398
 
399
                 if (aspm) {
400
-                        if (tp->HwHasWrRamCodeToMicroP == TRUE) {
401
+                        if (HW_HAS_WRITE_PHY_MCU_RAM_CODE(tp)) {
402
                                 rtl8168_mdio_write(tp, 0x1F, 0x0A43);
403
                                 rtl8168_set_eth_phy_bit( tp, 0x10, BIT_2 );
404
                                 rtl8168_mdio_write(tp, 0x1F, 0x0000);
405
@@ -23482,7 +23576,7 @@
406
                                       BIT_5 | BIT_4 | BIT_3 | BIT_2 | BIT_1 | BIT_0,
407
                                       0x0A );
408
 
409
-                if (tp->HwHasWrRamCodeToMicroP) {
410
+                if (HW_HAS_WRITE_PHY_MCU_RAM_CODE(tp)) {
411
                         rtl8168_mdio_write(tp, 0x1F, 0x0A43);
412
                         rtl8168_mdio_write(tp, 0x13, 0x8011);
413
                         rtl8168_set_eth_phy_bit(tp, 0x14, BIT_11);
414
@@ -23520,7 +23614,7 @@
415
                         rtl8168_mdio_write(tp, 0x1F, 0x0000);
416
                 }
417
 
418
-                if (tp->HwHasWrRamCodeToMicroP) {
419
+                if (HW_HAS_WRITE_PHY_MCU_RAM_CODE(tp)) {
420
                         rtl8168_mdio_write(tp, 0x1F, 0x0A43);
421
                         rtl8168_mdio_write(tp, 0x13, 0x85FE);
422
                         ClearAndSetEthPhyBit(
423
@@ -23543,7 +23637,7 @@
424
                 }
425
 
426
                 if (aspm) {
427
-                        if (tp->HwHasWrRamCodeToMicroP == TRUE) {
428
+                        if (HW_HAS_WRITE_PHY_MCU_RAM_CODE(tp)) {
429
                                 rtl8168_mdio_write(tp, 0x1F, 0x0A43);
430
                                 rtl8168_set_eth_phy_bit( tp, 0x10, BIT_2 );
431
                                 rtl8168_mdio_write(tp, 0x1F, 0x0000);
432
@@ -23697,7 +23791,8 @@
433
                 rtl8168_mdio_write(tp, 0x1F, 0x0000);
434
 
435
                 if (aspm) {
436
-                        if (tp->HwHasWrRamCodeToMicroP == TRUE) {
437
+                        if (!HW_SUPP_SERDES_PHY(tp) &&
438
+                            HW_HAS_WRITE_PHY_MCU_RAM_CODE(tp)) {
439
                                 rtl8168_mdio_write(tp, 0x1F, 0x0A43);
440
                                 rtl8168_set_eth_phy_bit( tp, 0x10, BIT_2 );
441
                                 rtl8168_mdio_write(tp, 0x1F, 0x0000);
442
@@ -23746,7 +23841,7 @@
443
 
444
         rtl8168_mdio_write(tp, 0x1F, 0x0000);
445
 
446
-        if (tp->HwHasWrRamCodeToMicroP == TRUE) {
447
+        if (HW_HAS_WRITE_PHY_MCU_RAM_CODE(tp)) {
448
                 if (tp->eee_enabled)
449
                         rtl8168_enable_EEE(tp);
450
                 else
451
@@ -23921,7 +24016,7 @@
452
                 break;
453
         }
454
 
455
-        if (HW_DASH_SUPPORT_TYPE_3(tp) && tp->HwPkgDet == 0x06)
456
+        if (HW_SUPP_SERDES_PHY(tp))
457
                 eee_enable = 0;
458
 
459
         switch (tp->mcfg) {
460
@@ -24186,28 +24281,22 @@
461
         }
462
 
463
 #ifdef ENABLE_FIBER_SUPPORT
464
+        rtl8168_check_hw_fiber_mode_support(dev);
465
+#endif //ENABLE_FIBER_SUPPORT
466
+
467
         switch(tp->mcfg) {
468
-        case CFG_METHOD_29:
469
-        case CFG_METHOD_30:
470
-                if ((pdev->subsystem_vendor == 0x1170 && pdev->subsystem_device == 0x0612) ||
471
-                    (pdev->subsystem_vendor == 0x1028 && pdev->subsystem_device == 0x080C) ||
472
-                    (pdev->subsystem_vendor == 0x107d && pdev->subsystem_device == 0x29b0) ||
473
-                    (pdev->subsystem_vendor == 0x107d && pdev->subsystem_device == 0x29b1) ||
474
-                    (pdev->subsystem_vendor == 0x107d && pdev->subsystem_device == 0x29b3) ||
475
-                    (pdev->subsystem_vendor == 0x107d && pdev->subsystem_device == 0x29b5))
476
-                        tp->HwFiberModeVer = FIBER_MODE_RTL8168H_RTL8211FS;
477
-                if((pdev->subsystem_vendor == 0x1d05 && pdev->subsystem_device == 0x2014))
478
-                        tp->HwFiberModeVer = FIBER_MODE_RTL8168H_MDI_SWITCH_RTL8211FS;
479
+        case CFG_METHOD_32:
480
+        case CFG_METHOD_33:
481
+                if (tp->HwPkgDet == 0x06) {
482
+                        u8 tmpUchar = rtl8168_eri_read(tp, 0xE6, 1, ERIAR_ExGMAC);
483
+                        if (tmpUchar == 0x02)
484
+                                tp->HwSuppSerDesPhyVer = 1;
485
+                        else if (tmpUchar == 0x00)
486
+                                tp->HwSuppSerDesPhyVer = 2;
487
+                }
488
                 break;
489
         }
490
 
491
-        if (HW_FIBER_MODE_ENABLED(tp))
492
-                tp->HwFiberStat = rtl8168_hw_fiber_get_connect_status(dev);
493
-
494
-        if (tp->HwFiberStat != FIBER_STAT_CONNECT)
495
-                tp->HwFiberModeVer = FIBER_MODE_NIC_ONLY;
496
-#endif //ENABLE_FIBER_SUPPORT
497
-
498
         if (pdev->subsystem_vendor == 0x144d) {
499
                 if (pdev->subsystem_device == 0xc098 ||
500
                     pdev->subsystem_device == 0xc0b1 ||
501
@@ -24229,14 +24318,6 @@
502
                         break;
503
                 }
504
         }
505
-#ifdef ENABLE_FIBER_SUPPORT
506
-        switch (tp->HwFiberModeVer) {
507
-        case FIBER_MODE_RTL8168H_RTL8211FS:
508
-        case FIBER_MODE_RTL8168H_MDI_SWITCH_RTL8211FS:
509
-                tp->RequiredSecLanDonglePatch = TRUE;
510
-                break;
511
-        }
512
-#endif //ENABLE_FIBER_SUPPORT
513
 
514
         switch (tp->mcfg) {
515
         case CFG_METHOD_16:
516
@@ -24379,6 +24460,11 @@
517
 #endif //LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)
518
         tp->eee_enabled = eee_enable;
519
         tp->eee_adv_t = MDIO_EEE_1000T | MDIO_EEE_100TX;
520
+
521
+#ifdef ENABLE_FIBER_SUPPORT
522
+        if (HW_FIBER_MODE_ENABLED(tp))
523
+                rtl8168_set_fiber_mode_software_variable(dev);
524
+#endif //ENABLE_FIBER_SUPPORT
525
 }
526
 
527
 static void
528
@@ -26431,7 +26517,7 @@
529
         case CFG_METHOD_32:
530
         case CFG_METHOD_33:
531
                 csi_tmp = rtl8168_eri_read(tp, 0xDE, 1, ERIAR_ExGMAC);
532
-                csi_tmp &= ~BIT_0;
533
+                csi_tmp &= BIT_0;
534
                 rtl8168_eri_write(tp, 0xDE, 1, csi_tmp, ERIAR_ExGMAC);
535
                 break;
536
         }
537
@@ -27057,17 +27143,22 @@
538
 
539
                 mac_ocp_data = rtl8168_mac_ocp_read(tp, 0xE056);
540
                 mac_ocp_data &= ~(BIT_7 | BIT_6 | BIT_5 | BIT_4);
541
-                mac_ocp_data |= (BIT_6 | BIT_5 | BIT_4);
542
+                if (FALSE == HW_SUPP_SERDES_PHY(tp))
543
+                        mac_ocp_data |= (BIT_6 | BIT_5 | BIT_4);
544
                 rtl8168_mac_ocp_write(tp, 0xE056, mac_ocp_data);
545
-                rtl8168_mac_ocp_write(tp, 0xEA80, 0x0003);
546
+                if (FALSE == HW_SUPP_SERDES_PHY(tp))
547
+                        rtl8168_mac_ocp_write(tp, 0xEA80, 0x0003);
548
+                else
549
+                        rtl8168_mac_ocp_write(tp, 0xEA80, 0x0000);
550
 
551
                 rtl8168_oob_mutex_lock(tp);
552
                 mac_ocp_data = rtl8168_mac_ocp_read(tp, 0xE052);
553
-                mac_ocp_data |= BIT_0;
554
-                if (tp->mcfg == CFG_METHOD_32 || tp->mcfg == CFG_METHOD_33)
555
-                        mac_ocp_data |= BIT_3;
556
-                else
557
-                        mac_ocp_data &= ~BIT_3;
558
+                mac_ocp_data &= ~(BIT_3 | BIT_0);
559
+                if (FALSE == HW_SUPP_SERDES_PHY(tp)) {
560
+                        mac_ocp_data |= BIT_0;
561
+                        if (tp->mcfg == CFG_METHOD_32 || tp->mcfg == CFG_METHOD_33)
562
+                                mac_ocp_data |= BIT_3;
563
+                }
564
                 rtl8168_mac_ocp_write(tp, 0xE052, mac_ocp_data);
565
                 rtl8168_oob_mutex_unlock(tp);
566
 
567
@@ -27090,16 +27181,24 @@
568
                 if (dev->mtu > ETH_DATA_LEN)
569
                         RTL_W8(tp, MTPS, 0x27);
570
 
571
-                RTL_W8(tp, 0xD0, RTL_R8(tp, 0xD0) | BIT_6);
572
-                RTL_W8(tp, 0xF2, RTL_R8(tp, 0xF2) | BIT_6);
573
-
574
-                RTL_W8(tp, 0xD0, RTL_R8(tp, 0xD0) | BIT_7);
575
+                if (FALSE == HW_SUPP_SERDES_PHY(tp)) {
576
+                        RTL_W8(tp, 0xD0, RTL_R8(tp, 0xD0) | BIT_6);
577
+                        RTL_W8(tp, 0xF2, RTL_R8(tp, 0xF2) | BIT_6);
578
+                        RTL_W8(tp, 0xD0, RTL_R8(tp, 0xD0) | BIT_7);
579
+                } else {
580
+                        RTL_W8(tp, 0xD0, RTL_R8(tp, 0xD0) & ~BIT_6);
581
+                        RTL_W8(tp, 0xF2, RTL_R8(tp, 0xF2) & ~BIT_6);
582
+                        RTL_W8(tp, 0xD0, RTL_R8(tp, 0xD0) & ~BIT_7);
583
+                }
584
 
585
                 rtl8168_eri_write(tp, 0xC0, 2, 0x0000, ERIAR_ExGMAC);
586
                 rtl8168_eri_write(tp, 0xB8, 4, 0x00000000, ERIAR_ExGMAC);
587
 
588
                 rtl8168_oob_mutex_lock(tp);
589
-                rtl8168_eri_write(tp, 0x5F0, 2, 0x4F87, ERIAR_ExGMAC);
590
+                if (FALSE == HW_SUPP_SERDES_PHY(tp))
591
+                        rtl8168_eri_write(tp, 0x5F0, 2, 0x4F87, ERIAR_ExGMAC);
592
+                else
593
+                        rtl8168_eri_write(tp, 0x5F0, 2, 0x4080, ERIAR_ExGMAC);
594
                 rtl8168_oob_mutex_unlock(tp);
595
 
596
                 csi_tmp = rtl8168_eri_read(tp, 0xD4, 4, ERIAR_ExGMAC);
597
@@ -27661,7 +27760,8 @@
598
         unsigned int len = tx_skb->len;
599
 
600
         dma_unmap_single(&pdev->dev, le64_to_cpu(desc->addr), len, DMA_TO_DEVICE);
601
-        desc->opts1 = 0x00;
602
+
603
+        desc->opts1 = cpu_to_le32(RTK_MAGIC_DEBUG_VALUE);
604
         desc->opts2 = 0x00;
605
         desc->addr = 0x00;
606
         tx_skb->len = 0;
607
@@ -27843,8 +27943,13 @@
608
         }
609
 }
610
 
611
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0)
612
+static void
613
+rtl8168_tx_timeout(struct net_device *dev, unsigned int txqueue)
614
+#else
615
 static void
616
 rtl8168_tx_timeout(struct net_device *dev)
617
+#endif
618
 {
619
         struct rtl8168_private *tp = netdev_priv(dev);
620
         unsigned long flags;
621
@@ -28126,6 +28231,15 @@
622
 }
623
 #endif
624
 
625
+static bool rtl8168_tx_slots_avail(struct rtl8168_private *tp,
626
+                                   unsigned int nr_frags)
627
+{
628
+        unsigned int slots_avail = tp->dirty_tx + NUM_TX_DESC - tp->cur_tx;
629
+
630
+        /* A skbuff with nr_frags needs nr_frags+1 entries in the tx queue */
631
+        return slots_avail > nr_frags;
632
+}
633
+
634
 static int
635
 rtl8168_start_xmit(struct sk_buff *skb,
636
                    struct net_device *dev)
637
@@ -28143,7 +28257,7 @@
638
 
639
         spin_lock_irqsave(&tp->lock, flags);
640
 
641
-        if (unlikely(TX_BUFFS_AVAIL(tp) < skb_shinfo(skb)->nr_frags)) {
642
+        if (unlikely(!rtl8168_tx_slots_avail(tp, skb_shinfo(skb)->nr_frags))) {
643
                 if (netif_msg_drv(tp)) {
644
                         printk(KERN_ERR
645
                                "%s: BUG! Tx Ring full when queue awake!\n",
646
@@ -28155,8 +28269,14 @@
647
         entry = tp->cur_tx % NUM_TX_DESC;
648
         txd = tp->TxDescArray + entry;
649
 
650
-        if (unlikely(le32_to_cpu(txd->opts1) & DescOwn))
651
+        if (unlikely(le32_to_cpu(txd->opts1) & DescOwn)) {
652
+                if (netif_msg_drv(tp)) {
653
+                        printk(KERN_ERR
654
+                               "%s: BUG! Tx Desc is own by hardware!\n",
655
+                               dev->name);
656
+                }
657
                 goto err_stop;
658
+        }
659
 
660
         opts1 = DescOwn;
661
         opts2 = rtl8168_tx_vlan_tag(tp, skb);
662
@@ -28271,10 +28391,10 @@
663
 
664
         RTL_W8(tp, TxPoll, NPQ);    /* set polling bit */
665
 
666
-        if (TX_BUFFS_AVAIL(tp) < MAX_SKB_FRAGS) {
667
+        if (!rtl8168_tx_slots_avail(tp, MAX_SKB_FRAGS)) {
668
                 netif_stop_queue(dev);
669
                 smp_rmb();
670
-                if (TX_BUFFS_AVAIL(tp) >= MAX_SKB_FRAGS)
671
+                if (rtl8168_tx_slots_avail(tp, MAX_SKB_FRAGS))
672
                         netif_wake_queue(dev);
673
         }
674
 
675
@@ -28346,7 +28466,7 @@
676
                 tp->dirty_tx = dirty_tx;
677
                 smp_wmb();
678
                 if (netif_queue_stopped(dev) &&
679
-                    (TX_BUFFS_AVAIL(tp) >= MAX_SKB_FRAGS)) {
680
+                    (rtl8168_tx_slots_avail(tp, MAX_SKB_FRAGS))) {
681
                         netif_wake_queue(dev);
682
                 }
683
                 smp_rmb();
684
r8168-8.048.00.tar.bz2/src/r8168_realwow.h -> r8168-8.048.03.tar.bz2/src/r8168_realwow.h Changed
10
 
1
@@ -4,7 +4,7 @@
2
 # r8168 is the Linux device driver released for Realtek Gigabit Ethernet
3
 # controllers with PCI-Express interface.
4
 #
5
-# Copyright(c) 2019 Realtek Semiconductor Corp. All rights reserved.
6
+# Copyright(c) 2020 Realtek Semiconductor Corp. All rights reserved.
7
 #
8
 # This program is free software; you can redistribute it and/or modify it
9
 # under the terms of the GNU General Public License as published by the Free
10
r8168-8.048.00.tar.bz2/src/rtl_eeprom.c -> r8168-8.048.03.tar.bz2/src/rtl_eeprom.c Changed
10
 
1
@@ -4,7 +4,7 @@
2
 # r8168 is the Linux device driver released for Realtek Gigabit Ethernet
3
 # controllers with PCI-Express interface.
4
 #
5
-# Copyright(c) 2019 Realtek Semiconductor Corp. All rights reserved.
6
+# Copyright(c) 2020 Realtek Semiconductor Corp. All rights reserved.
7
 #
8
 # This program is free software; you can redistribute it and/or modify it
9
 # under the terms of the GNU General Public License as published by the Free
10
r8168-8.048.00.tar.bz2/src/rtl_eeprom.h -> r8168-8.048.03.tar.bz2/src/rtl_eeprom.h Changed
10
 
1
@@ -4,7 +4,7 @@
2
 # r8168 is the Linux device driver released for Realtek Gigabit Ethernet
3
 # controllers with PCI-Express interface.
4
 #
5
-# Copyright(c) 2019 Realtek Semiconductor Corp. All rights reserved.
6
+# Copyright(c) 2020 Realtek Semiconductor Corp. All rights reserved.
7
 #
8
 # This program is free software; you can redistribute it and/or modify it
9
 # under the terms of the GNU General Public License as published by the Free
10
r8168-8.048.00.tar.bz2/src/rtltool.c -> r8168-8.048.03.tar.bz2/src/rtltool.c Changed
10
 
1
@@ -4,7 +4,7 @@
2
 # r8168 is the Linux device driver released for Realtek Gigabit Ethernet
3
 # controllers with PCI-Express interface.
4
 #
5
-# Copyright(c) 2019 Realtek Semiconductor Corp. All rights reserved.
6
+# Copyright(c) 2020 Realtek Semiconductor Corp. All rights reserved.
7
 #
8
 # This program is free software; you can redistribute it and/or modify it
9
 # under the terms of the GNU General Public License as published by the Free
10
r8168-8.048.00.tar.bz2/src/rtltool.h -> r8168-8.048.03.tar.bz2/src/rtltool.h Changed
10
 
1
@@ -4,7 +4,7 @@
2
 # r8168 is the Linux device driver released for Realtek Gigabit Ethernet
3
 # controllers with PCI-Express interface.
4
 #
5
-# Copyright(c) 2019 Realtek Semiconductor Corp. All rights reserved.
6
+# Copyright(c) 2020 Realtek Semiconductor Corp. All rights reserved.
7
 #
8
 # This program is free software; you can redistribute it and/or modify it
9
 # under the terms of the GNU General Public License as published by the Free
10
Refresh

No build results available

Refresh

No rpmlint results available

Request History
Luigi Baldoni's avatar

Aloysius created request almost 5 years ago

update to 8.048.03


bitstreamout's avatar

bitstreamout accepted request almost 5 years ago

Thanks