mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-03-09 15:40:03 +00:00
update
This commit is contained in:
parent
8cf19a4638
commit
678c91253d
30 changed files with 12291 additions and 83 deletions
|
@ -7,19 +7,16 @@ include $(TOPDIR)/rules.mk
|
|||
include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
PKG_NAME:=r8168
|
||||
PKG_VERSION:=8.049.02
|
||||
PKG_RELEASE:=$(AUTORELEAE)
|
||||
PKG_VERSION:=8.050.03
|
||||
PKG_RELEASE:=$(AUTORELEASE)
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://github.com/BROBIRD/openwrt-r8168.git
|
||||
PKG_SOURCE_DATE:=2021-10-08
|
||||
PKG_SOURCE_VERSION:=2b969c15afe403a685fc7ee069620782241e3ad6
|
||||
PKG_MIRROR_HASH:=e4632c10d460f005eff76da8a183d7ff0c8819b0d099872589b7b06a9b8d9952
|
||||
PKG_SOURCE_VERSION:=ddfaceacd1b7ed2857fb995642a8ffb1fc37e989
|
||||
PKG_MIRROR_HASH:=5428f60dc33e9503c6cfdf690c00077149dce24cbb0591129d905b9f1aad9202
|
||||
|
||||
PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||
|
||||
MAKE_PATH:=src
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define KernelPackage/r8168
|
||||
|
@ -35,20 +32,8 @@ define Package/r8168/description
|
|||
This package contains a driver for Realtek r8168 chipsets.
|
||||
endef
|
||||
|
||||
R8168_MAKEOPTS= -C $(PKG_BUILD_DIR)/src \
|
||||
PATH="$(TARGET_PATH)" \
|
||||
ARCH="$(LINUX_KARCH)" \
|
||||
CROSS_COMPILE="$(TARGET_CROSS)" \
|
||||
TARGET="$(HAL_TARGET)" \
|
||||
TOOLPREFIX="$(KERNEL_CROSS)" \
|
||||
TOOLPATH="$(KERNEL_CROSS)" \
|
||||
KERNELPATH="$(LINUX_DIR)" \
|
||||
KERNELDIR="$(LINUX_DIR)" \
|
||||
LDOPTS=" " \
|
||||
DOMULTI=1
|
||||
|
||||
define Build/Compile
|
||||
$(MAKE) $(R8168_MAKEOPTS) modules
|
||||
+$(KERNEL_MAKE) M=$(PKG_BUILD_DIR)/src modules
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,r8168))
|
||||
|
|
|
@ -1,42 +1,42 @@
|
|||
--- a/src/r8168_n.c
|
||||
+++ b/src/r8168_n.c
|
||||
@@ -47,6 +47,7 @@
|
||||
#include <linux/etherdevice.h>
|
||||
#include <linux/delay.h>
|
||||
#include <linux/mii.h>
|
||||
+#include <linux/of.h>
|
||||
#include <linux/if_vlan.h>
|
||||
#include <linux/crc32.h>
|
||||
#include <linux/interrupt.h>
|
||||
@@ -23482,6 +23483,22 @@ rtl8168_set_bios_setting(struct net_devi
|
||||
}
|
||||
}
|
||||
|
||||
+static int rtl8168_led_configuration(struct rtl8168_private *tp)
|
||||
+{
|
||||
+ u32 led_data;
|
||||
+ int ret;
|
||||
+
|
||||
+ ret = of_property_read_u32(tp->pci_dev->dev.of_node,
|
||||
+ "realtek,led-data", &led_data);
|
||||
+
|
||||
+ if (ret)
|
||||
+ return ret;
|
||||
+
|
||||
+ RTL_W16(tp, CustomLED, led_data);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
static void
|
||||
rtl8168_init_software_variable(struct net_device *dev)
|
||||
{
|
||||
@@ -24000,6 +24017,8 @@ rtl8168_init_software_variable(struct ne
|
||||
tp->NotWrMcuPatchCode = TRUE;
|
||||
}
|
||||
|
||||
+ rtl8168_led_configuration(tp);
|
||||
+
|
||||
tp->NicCustLedValue = RTL_R16(tp, CustomLED);
|
||||
|
||||
rtl8168_get_hw_wol(dev);
|
||||
--- a/src/r8168_n.c
|
||||
+++ b/src/r8168_n.c
|
||||
@@ -47,6 +47,7 @@
|
||||
#include <linux/etherdevice.h>
|
||||
#include <linux/delay.h>
|
||||
#include <linux/mii.h>
|
||||
+#include <linux/of.h>
|
||||
#include <linux/if_vlan.h>
|
||||
#include <linux/crc32.h>
|
||||
#include <linux/interrupt.h>
|
||||
@@ -24643,6 +24644,22 @@ rtl8168_set_bios_setting(struct net_devi
|
||||
}
|
||||
}
|
||||
|
||||
+static int rtl8168_led_configuration(struct rtl8168_private *tp)
|
||||
+{
|
||||
+ u32 led_data;
|
||||
+ int ret;
|
||||
+
|
||||
+ ret = of_property_read_u32(tp->pci_dev->dev.of_node,
|
||||
+ "realtek,led-data", &led_data);
|
||||
+
|
||||
+ if (ret)
|
||||
+ return ret;
|
||||
+
|
||||
+ RTL_W16(tp, CustomLED, led_data);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
static void
|
||||
rtl8168_init_software_variable(struct net_device *dev)
|
||||
{
|
||||
@@ -25206,6 +25223,8 @@ rtl8168_init_software_variable(struct ne
|
||||
tp->NotWrMcuPatchCode = TRUE;
|
||||
}
|
||||
|
||||
+ rtl8168_led_configuration(tp);
|
||||
+
|
||||
tp->NicCustLedValue = RTL_R16(tp, CustomLED);
|
||||
|
||||
rtl8168_get_hw_wol(dev);
|
||||
|
|
47
r8168/patches/020-5.18-support.patch
Normal file
47
r8168/patches/020-5.18-support.patch
Normal file
|
@ -0,0 +1,47 @@
|
|||
--- a/src/r8168_n.c
|
||||
+++ b/src/r8168_n.c
|
||||
@@ -3715,7 +3715,11 @@
|
||||
txd->opts2 = 0;
|
||||
while (1) {
|
||||
memset(tmpAddr, pattern++, len - 14);
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5,18,0)
|
||||
pci_dma_sync_single_for_device(tp->pci_dev,
|
||||
+#else
|
||||
+ dma_sync_single_for_device(tp_to_dev(tp),
|
||||
+#endif
|
||||
le64_to_cpu(mapping),
|
||||
len, DMA_TO_DEVICE);
|
||||
txd->opts1 = cpu_to_le32(DescOwn | FirstFrag | LastFrag | len);
|
||||
@@ -3743,7 +3747,11 @@
|
||||
if (rx_len == len) {
|
||||
dma_sync_single_for_cpu(tp_to_dev(tp), le64_to_cpu(rxd->addr), tp->rx_buf_sz, DMA_FROM_DEVICE);
|
||||
i = memcmp(skb->data, rx_skb->data, rx_len);
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5,18,0)
|
||||
pci_dma_sync_single_for_device(tp->pci_dev, le64_to_cpu(rxd->addr), tp->rx_buf_sz, DMA_FROM_DEVICE);
|
||||
+#else
|
||||
+ dma_sync_single_for_device(tp_to_dev(tp), le64_to_cpu(rxd->addr), tp->rx_buf_sz, DMA_FROM_DEVICE);
|
||||
+#endif
|
||||
if (i == 0) {
|
||||
// dev_printk(KERN_INFO, tp_to_dev(tp), "loopback test finished\n",rx_len,len);
|
||||
break;
|
||||
@@ -26464,11 +26472,20 @@
|
||||
|
||||
if ((sizeof(dma_addr_t) > 4) &&
|
||||
use_dac &&
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5,18,0)
|
||||
!pci_set_dma_mask(pdev, DMA_BIT_MASK(64)) &&
|
||||
!pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(64))) {
|
||||
+#else
|
||||
+ !dma_set_mask(&pdev->dev, DMA_BIT_MASK(64)) &&
|
||||
+ !dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(64))) {
|
||||
+#endif
|
||||
dev->features |= NETIF_F_HIGHDMA;
|
||||
} else {
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5,18,0)
|
||||
rc = pci_set_dma_mask(pdev, DMA_BIT_MASK(32));
|
||||
+#else
|
||||
+ rc = dma_set_mask(&pdev->dev, DMA_BIT_MASK(32));
|
||||
+#endif
|
||||
if (rc < 0) {
|
||||
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,0)
|
||||
if (netif_msg_probe(tp))
|
18
r8168/patches/030-5.19-support.patch
Normal file
18
r8168/patches/030-5.19-support.patch
Normal file
|
@ -0,0 +1,18 @@
|
|||
--- a/src/r8168_n.c
|
||||
+++ b/src/r8168_n.c
|
||||
@@ -116,6 +116,15 @@
|
||||
#define FIRMWARE_8168FP_3 "rtl_nic/rtl8168fp-3.fw"
|
||||
#define FIRMWARE_8168FP_4 "rtl_nic/rtl8168fp-4.fw"
|
||||
|
||||
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 0)
|
||||
+static inline void netif_set_gso_max_size(struct net_device *dev,
|
||||
+ unsigned int size)
|
||||
+{
|
||||
+ /* dev->gso_max_size is read locklessly from sk_setup_caps() */
|
||||
+ WRITE_ONCE(dev->gso_max_size, size);
|
||||
+}
|
||||
+#endif
|
||||
+
|
||||
/* Maximum number of multicast addresses to filter (vs. Rx-all-multicast).
|
||||
The RTL chips use a 64 element hash table based on the Ethernet CRC. */
|
||||
static const int multicast_filter_limit = 32;
|
Loading…
Add table
Add a link
Reference in a new issue