1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-03-09 15:40:03 +00:00

Update relatek drivers

This commit is contained in:
Ycarus (Yannick Chabanois) 2021-11-18 16:24:16 +01:00
parent bf11c19bb4
commit 734f9dd8c2
22 changed files with 251 additions and 19487 deletions

54
r8168/Makefile Normal file
View file

@ -0,0 +1,54 @@
#
# Download realtek r8168 linux driver from official site:
# [https://www.realtek.com/component/zoo/category/network-interface-controllers-10-100-1000m-gigabit-ethernet-pci-express-software]
#
include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=r8168
PKG_VERSION:=8.049.02
PKG_RELEASE:=$(AUTORELEAE)
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_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
MAKE_PATH:=src
include $(INCLUDE_DIR)/package.mk
define KernelPackage/r8168
TITLE:=Driver for Realtek r8168 chipsets
SUBMENU:=Network Devices
VERSION:=$(LINUX_VERSION)+$(PKG_VERSION)-$(BOARD)-$(PKG_RELEASE)
FILES:= $(PKG_BUILD_DIR)/src/r8168.ko
AUTOLOAD:=$(call AutoProbe,r8168)
CONFLICTS:=kmod-r8169
endef
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
endef
$(eval $(call KernelPackage,r8168))

View file

@ -0,0 +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);