--- /dev/null
+--- r8168-8.048.00/src/r8168_n.c 2019-11-26 08:32:35.000000000 +0000\r
++++ r8168-8.048.00/src/r8168_n.c 2020-03-16 12:34:04.893511463 +0000\r
+@@ -456,7 +456,13 @@ static void rtl8168_hw_config(struct net\r
+ static void rtl8168_hw_start(struct net_device *dev);\r
+ static int rtl8168_close(struct net_device *dev);\r
+ static void rtl8168_set_rx_mode(struct net_device *dev);\r
++\r
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5,6,0)\r
+ static void rtl8168_tx_timeout(struct net_device *dev);\r
++#else\r
++static void rtl8168_tx_timeout(struct net_device *dev, unsigned int txqueue);\r
++#endif\r
++\r
+ static struct net_device_stats *rtl8168_get_stats(struct net_device *dev);\r
+ static int rtl8168_rx_interrupt(struct net_device *, struct rtl8168_private *, napi_budget);\r
+ static int rtl8168_change_mtu(struct net_device *dev, int new_mtu);\r
+@@ -1616,12 +1622,21 @@ static int rtl8168_proc_open(struct inod\r
+ return single_open(file, show, dev);\r
+ }\r
+ \r
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5,6,0)\r
+ static const struct file_operations rtl8168_proc_fops = {\r
+ .open = rtl8168_proc_open,\r
+ .read = seq_read,\r
+ .llseek = seq_lseek,\r
+ .release = single_release,\r
+ };\r
++#else\r
++static const struct proc_ops rtl8168_proc_fops = {\r
++ .proc_open = rtl8168_proc_open,\r
++ .proc_read = seq_read,\r
++ .proc_lseek = seq_lseek,\r
++ .proc_release = single_release,\r
++};\r
++#endif\r
+ #endif\r
+ \r
+ /*\r
+@@ -27844,7 +27859,11 @@ static void rtl8168_reset_task(struct wo\r
+ }\r
+ \r
+ static void\r
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5,6,0)\r
+ rtl8168_tx_timeout(struct net_device *dev)\r
++#else\r
++rtl8168_tx_timeout(struct net_device *dev, unsigned int txqueue)\r
++#endif\r
+ {\r
+ struct rtl8168_private *tp = netdev_priv(dev);\r
+ unsigned long flags;
\ No newline at end of file
--- /dev/null
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit linux-info linux-mod
+
+DESCRIPTION="r8168 driver for Realtek 8111/8168 PCI-E NICs"
+HOMEPAGE="https://www.realtek.com/en/component/zoo/category/network-interface-controllers-10-100-1000m-gigabit-ethernet-pci-express-software"
+
+# "GBE Ethernet LINUX driver r8168 for kernel up to 4.15" from above link,
+# we need to mirror it to avoid users from needing to fill a captcha to
+# download
+SRC_URI="https://dev.gentoo.org/~pacho/${PN}/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+MODULE_NAMES="r8168(net:${S}/src)"
+BUILD_TARGETS="modules"
+
+CONFIG_CHECK="!R8169"
+ERROR_R8169="${P} requires Realtek 8169 PCI Gigabit Ethernet adapter (CONFIG_R8169) to be DISABLED"
+
+PATCHES=( "${FILESDIR}/kernel56.patch" )
+
+pkg_setup() {
+ linux-mod_pkg_setup
+ BUILD_PARAMS="KERNELDIR=${KV_DIR}"
+}
+
+src_install() {
+ linux-mod_src_install
+ einstalldocs
+}