From fbad2cb36892351ee38611b4f694c5a64374aab3 Mon Sep 17 00:00:00 2001 From: suyuan <175338101@qq.com> Date: Mon, 24 Jul 2023 14:54:48 +0800 Subject: [PATCH] fix --- luci-app-zerotier/Makefile | 19 --- .../luasrc/controller/zerotier.lua | 24 ---- .../luasrc/model/cbi/zerotier/info.lua | 15 --- .../luasrc/model/cbi/zerotier/manual.lua | 26 ---- .../luasrc/model/cbi/zerotier/settings.lua | 37 ------ .../luasrc/view/zerotier/zerotier_status.htm | 29 ----- luci-app-zerotier/po/zh-cn/zerotier.po | 35 ------ luci-app-zerotier/po/zh_Hans | 1 - luci-app-zerotier/root/etc/init.d/zerotier | 113 ------------------ .../root/etc/uci-defaults/40_luci-zerotier | 18 --- luci-app-zerotier/root/etc/zerotier.start | 28 ----- luci-app-zerotier/root/etc/zerotier.stop | 15 --- .../root/etc/zerotier/zerotier.log | 0 r8125/Makefile | 37 ------ r8125/patches/010-config.patch | 22 ---- r8125/patches/020-5.19-support.patch | 18 --- r8125/patches/021-6.1-suppot.patch | 14 --- .../030-add-LED-configuration-from-OF.patch | 43 ------- r8152/Makefile | 55 --------- r8152/patches/010-5.19-support.patch | 19 --- r8152/patches/020-6.1-support.patch | 38 ------ .../100-add-LED-configuration-from-OF.patch | 74 ------------ r8168/Makefile | 39 ------ ...-r8168-add-LED-configuration-from-OF.patch | 42 ------- r8168/patches/020-5.18-support.patch | 47 -------- r8168/patches/030-5.19-support.patch | 18 --- r8168/patches/030-6.1-support.patch | 14 --- 27 files changed, 840 deletions(-) delete mode 100755 luci-app-zerotier/Makefile delete mode 100755 luci-app-zerotier/luasrc/controller/zerotier.lua delete mode 100755 luci-app-zerotier/luasrc/model/cbi/zerotier/info.lua delete mode 100755 luci-app-zerotier/luasrc/model/cbi/zerotier/manual.lua delete mode 100755 luci-app-zerotier/luasrc/model/cbi/zerotier/settings.lua delete mode 100755 luci-app-zerotier/luasrc/view/zerotier/zerotier_status.htm delete mode 100755 luci-app-zerotier/po/zh-cn/zerotier.po delete mode 100755 luci-app-zerotier/po/zh_Hans delete mode 100755 luci-app-zerotier/root/etc/init.d/zerotier delete mode 100755 luci-app-zerotier/root/etc/uci-defaults/40_luci-zerotier delete mode 100755 luci-app-zerotier/root/etc/zerotier.start delete mode 100755 luci-app-zerotier/root/etc/zerotier.stop delete mode 100755 luci-app-zerotier/root/etc/zerotier/zerotier.log delete mode 100755 r8125/Makefile delete mode 100755 r8125/patches/010-config.patch delete mode 100755 r8125/patches/020-5.19-support.patch delete mode 100755 r8125/patches/021-6.1-suppot.patch delete mode 100755 r8125/patches/030-add-LED-configuration-from-OF.patch delete mode 100755 r8152/Makefile delete mode 100755 r8152/patches/010-5.19-support.patch delete mode 100755 r8152/patches/020-6.1-support.patch delete mode 100755 r8152/patches/100-add-LED-configuration-from-OF.patch delete mode 100755 r8168/Makefile delete mode 100755 r8168/patches/001-r8168-add-LED-configuration-from-OF.patch delete mode 100755 r8168/patches/020-5.18-support.patch delete mode 100755 r8168/patches/030-5.19-support.patch delete mode 100755 r8168/patches/030-6.1-support.patch diff --git a/luci-app-zerotier/Makefile b/luci-app-zerotier/Makefile deleted file mode 100755 index 5c070ef7c..000000000 --- a/luci-app-zerotier/Makefile +++ /dev/null @@ -1,19 +0,0 @@ -# -# Copyright (C) 2008-2014 The LuCI Team -# -# This is free software, licensed under the Apache License, Version 2.0 . -# - -include $(TOPDIR)/rules.mk - -LUCI_TITLE:=LuCI for Zerotier -LUCI_DEPENDS:=+zerotier -LUCI_PKGARCH:=all - -PKG_NAME:=luci-app-zerotier -PKG_VERSION:=1.0 -PKG_RELEASE:=21 - -include $(TOPDIR)/feeds/luci/luci.mk - -# call BuildPackage - OpenWrt buildroot signature diff --git a/luci-app-zerotier/luasrc/controller/zerotier.lua b/luci-app-zerotier/luasrc/controller/zerotier.lua deleted file mode 100755 index f2973c65e..000000000 --- a/luci-app-zerotier/luasrc/controller/zerotier.lua +++ /dev/null @@ -1,24 +0,0 @@ -module("luci.controller.zerotier", package.seeall) - -function index() - if not nixio.fs.access("/etc/config/zerotier") then - return - end - - entry({"admin", "vpn"}, firstchild(), "VPN", 45).dependent = false - - entry({"admin", "vpn", "zerotier"}, alias("admin", "vpn", "zerotier", "general"), _("ZeroTier"), 99) - - entry({"admin", "vpn", "zerotier", "general"}, cbi("zerotier/settings"), _("Base Setting"), 1) - entry({"admin", "vpn", "zerotier", "log"}, form("zerotier/info"), _("Interface Info"), 2) - entry({"admin", "vpn", "zerotier", "manual"}, cbi("zerotier/manual"), _("Manual Config"), 3) - - entry({"admin", "vpn", "zerotier", "status"}, call("act_status")) -end - -function act_status() - local e = {} - e.running = luci.sys.call("pgrep /usr/bin/zerotier-one >/dev/null") == 0 - luci.http.prepare_content("application/json") - luci.http.write_json(e) -end diff --git a/luci-app-zerotier/luasrc/model/cbi/zerotier/info.lua b/luci-app-zerotier/luasrc/model/cbi/zerotier/info.lua deleted file mode 100755 index bb8fc3769..000000000 --- a/luci-app-zerotier/luasrc/model/cbi/zerotier/info.lua +++ /dev/null @@ -1,15 +0,0 @@ -local fs = require "nixio.fs" -local conffile = "/tmp/zero.info" - -f = SimpleForm("logview") - -t = f:field(TextValue, "conf") -t.rmempty = true -t.rows = 19 -function t.cfgvalue() - luci.sys.exec("for i in $(ifconfig | grep 'zt' | awk '{print $1}'); do ifconfig $i; done > /tmp/zero.info") - return fs.readfile(conffile) or "" -end -t.readonly = "readonly" - -return f diff --git a/luci-app-zerotier/luasrc/model/cbi/zerotier/manual.lua b/luci-app-zerotier/luasrc/model/cbi/zerotier/manual.lua deleted file mode 100755 index 71ae2bb37..000000000 --- a/luci-app-zerotier/luasrc/model/cbi/zerotier/manual.lua +++ /dev/null @@ -1,26 +0,0 @@ -local m, s, o -local fs = require "nixio.fs" -local jsonc = require "luci.jsonc" or nil -m = Map("zerotier") -s = m:section(NamedSection, "sample_config", "zerotier") -s.anonymous = true -s.addremove = false -o = s:option(TextValue, "manualconfig") -o.rows = 20 -o.wrap = "soft" -o.rmempty = true -o.cfgvalue = function(self, section) - return fs.readfile("/etc/config/zero/local.conf") -end -o.write = function(self, section, value) - fs.writefile("/etc/config/zero/local.conf", value:gsub("\r\n", "\n")) -end -o.validate = function(self, value) - if jsonc == nil or jsonc.parse(value) ~= nil then - return value - end - return nil -end -o.description = - 'https://www.zerotier.com/manual/
https://github.com/zerotier/ZeroTierOne/blob/dev/service/README.md' -return m diff --git a/luci-app-zerotier/luasrc/model/cbi/zerotier/settings.lua b/luci-app-zerotier/luasrc/model/cbi/zerotier/settings.lua deleted file mode 100755 index fc70a8581..000000000 --- a/luci-app-zerotier/luasrc/model/cbi/zerotier/settings.lua +++ /dev/null @@ -1,37 +0,0 @@ -a = Map("zerotier") -a.title = translate("ZeroTier") -a.description = translate("Zerotier is an open source, cross-platform and easy to use virtual LAN") - -a:section(SimpleSection).template = "zerotier/zerotier_status" - -t = a:section(NamedSection, "sample_config", "zerotier") -t.anonymous = true -t.addremove = false - -e = t:option(Flag, "enabled", translate("Enable")) -e.default = 0 -e.rmempty = false - -e = t:option(DynamicList, "join", translate('ZeroTier Network ID')) -e.password = true -e.rmempty = false - -e = t:option(Flag, "nat", translate("Auto NAT Clients")) -e.description = translate("Allow zerotier clients access your LAN network") -e.default = 0 -e.rmempty = false - -e = t:option(MultiValue, "access", translate("Zerotier Access Control")) -e.default = "lanfwzt ztfwwan ztfwlan" -e.rmempty = false -e:value("lanfwzt", translate("LAN Access Zerotier")) -e:value("wanfwzt", translate("WAN Access Zerotier")) -e:value("ztfwwan", translate("Remote Access WAN")) -e:value("ztfwlan", translate("Remote Access LAN")) -e.widget = "checkbox" - -e = t:option(DummyValue, "opennewwindow", translate( - "")) -e.description = translate("Create or manage your zerotier network, and auth clients who could access") - -return a diff --git a/luci-app-zerotier/luasrc/view/zerotier/zerotier_status.htm b/luci-app-zerotier/luasrc/view/zerotier/zerotier_status.htm deleted file mode 100755 index b2faf8e44..000000000 --- a/luci-app-zerotier/luasrc/view/zerotier/zerotier_status.htm +++ /dev/null @@ -1,29 +0,0 @@ - - -
-

- - <%:Collecting data...%> - -

-
\ No newline at end of file diff --git a/luci-app-zerotier/po/zh-cn/zerotier.po b/luci-app-zerotier/po/zh-cn/zerotier.po deleted file mode 100755 index 07adfeabc..000000000 --- a/luci-app-zerotier/po/zh-cn/zerotier.po +++ /dev/null @@ -1,35 +0,0 @@ -msgid "Zerotier is an open source, cross-platform and easy to use virtual LAN" -msgstr "Zerotier 是一个开源,跨平台,而且适合内网穿透互联的傻瓜配置虚拟 VPN LAN" - -msgid "Auto NAT Clients" -msgstr "自动允许客户端 NAT" - -msgid "Allow zerotier clients access your LAN network" -msgstr "允许 Zerotier 的拨入客户端访问路由器 LAN 资源(需要在 Zerotier 管理页面设定到 LAN 网段的路由表)" - -msgid "Create or manage your zerotier network, and auth clients who could access" -msgstr "点击跳转到 Zerotier 官网管理平台,新建或者管理网络,并允许客户端接入访问你私人网路(新接入的节点默认不允许访问)" - -msgid "Base Setting" -msgstr "基本设置" - -msgid "Interface Info" -msgstr "接口信息" - -msgid "Zerotier Access Control" -msgstr "Zerotier 准入控制" - -msgid "LAN Access Zerotier" -msgstr "LAN 可接入 Zerotier" - -msgid "WAN Access Zerotier" -msgstr "WAN 可接入 Zerotier" - -msgid "Remote Access WAN" -msgstr "外部访问可接入 WAN" - -msgid "Remote Access LAN" -msgstr "外部访问可接入 LAN" - -msgid "Manual Config" -msgstr "手动设置" diff --git a/luci-app-zerotier/po/zh_Hans b/luci-app-zerotier/po/zh_Hans deleted file mode 100755 index 41451e4a1..000000000 --- a/luci-app-zerotier/po/zh_Hans +++ /dev/null @@ -1 +0,0 @@ -zh-cn \ No newline at end of file diff --git a/luci-app-zerotier/root/etc/init.d/zerotier b/luci-app-zerotier/root/etc/init.d/zerotier deleted file mode 100755 index 666d67533..000000000 --- a/luci-app-zerotier/root/etc/init.d/zerotier +++ /dev/null @@ -1,113 +0,0 @@ -#!/bin/sh /etc/rc.common - -START=99 - -USE_PROCD=1 - -PROG=/usr/bin/zerotier-one -CONFIG_PATH=/var/lib/zerotier-one - -service_triggers() { - procd_add_reload_trigger "zerotier" - procd_add_interface_trigger "interface.*.up" wan /etc/init.d/zerotier restart -} - -section_enabled() { - config_get_bool enabled "$1" 'enabled' 0 - [ $enabled -gt 0 ] -} - -start_instance() { - local cfg="$1" - local port secret config_path - local ARGS="" - - if ! section_enabled "$cfg"; then - echo "disabled in config" - return 1 - fi - - [ -d /etc/config/zero ] || mkdir -p /etc/config/zero - config_path=/etc/config/zero - - config_get_bool port $cfg 'port' - config_get secret $cfg 'secret' - - # Remove existing link or folder - rm -rf $CONFIG_PATH - - # Create link from CONFIG_PATH to config_path - if [ -n "$config_path" -a "$config_path" != $CONFIG_PATH ]; then - if [ ! -d "$config_path" ]; then - echo "ZeroTier config_path does not exist: $config_path" - return - fi - - ln -s $config_path $CONFIG_PATH - fi - - mkdir -p $CONFIG_PATH/networks.d - - if [ -n "$port" ]; then - ARGS="$ARGS -p$port" - fi - - if [ "$secret" = "generate" ]; then - echo "Generate secret - please wait..." - local sf="/tmp/zt.$cfg.secret" - - zerotier-idtool generate "$sf" > /dev/null - [ $? -ne 0 ] && return 1 - - secret="$(cat $sf)" - rm "$sf" - - uci set zerotier.$cfg.secret="$secret" - uci commit zerotier - fi - - if [ -n "$secret" ]; then - echo "$secret" > $CONFIG_PATH/identity.secret - # make sure there is not previous identity.public - rm -f $CONFIG_PATH/identity.public - fi - - add_join() { - # an (empty) config file will cause ZT to join a network - touch $CONFIG_PATH/networks.d/$1.conf - } - - config_list_foreach $cfg 'join' add_join - - procd_open_instance - procd_set_param command $PROG $ARGS $CONFIG_PATH - procd_set_param stderr 1 - procd_close_instance -} - -start_service() { - config_load 'zerotier' - config_foreach start_instance 'zerotier' - touch /tmp/zero.log && /etc/zerotier.start > /tmp/zero.log 2>&1 & -} - -stop_instance() { - rm -f /tmp/zero.log - local cfg="$1" - - /etc/zerotier.stop > /tmp/zero.log 2>&1 & - - # Remove existing link or folder - rm -f $CONFIG_PATH/networks.d/*.conf - rm -rf $CONFIG_PATH -} - -stop_service() { - config_load 'zerotier' - config_foreach stop_instance 'zerotier' -} - -reload_service() { - stop - start -} diff --git a/luci-app-zerotier/root/etc/uci-defaults/40_luci-zerotier b/luci-app-zerotier/root/etc/uci-defaults/40_luci-zerotier deleted file mode 100755 index 616824562..000000000 --- a/luci-app-zerotier/root/etc/uci-defaults/40_luci-zerotier +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh - -uci -q batch <<-EOF >/dev/null - delete ucitrack.@zerotier[-1] - add ucitrack zerotier - set ucitrack.@zerotier[-1].init=zerotier - commit ucitrack - - delete firewall.zerotier - set firewall.zerotier=include - set firewall.zerotier.type=script - set firewall.zerotier.path=/etc/zerotier.start - set firewall.zerotier.reload=1 - commit firewall -EOF - -rm -f /tmp/luci-indexcache -exit 0 diff --git a/luci-app-zerotier/root/etc/zerotier.start b/luci-app-zerotier/root/etc/zerotier.start deleted file mode 100755 index b43e5f974..000000000 --- a/luci-app-zerotier/root/etc/zerotier.start +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/sh - -zero_enable="$(uci get zerotier.sample_config.enabled)" - -[ "${zero_enable}" -ne "1" ] && exit 0 - -[ -f "/tmp/zero.log" ] && { - while [ "$(ifconfig | grep 'zt' | awk '{print $1}')" = "" ] - do - sleep 1 - done -} - -nat_enable="$(uci get zerotier.sample_config.nat)" -zt0="$(ifconfig | grep 'zt' | awk '{print $1}')" -echo "${zt0}" > "/tmp/zt.nif" - -[ "${nat_enable}" -eq "1" ] && { - for i in ${zt0} - do - ip_segment="" - iptables -I FORWARD -i "$i" -j ACCEPT - iptables -I FORWARD -o "$i" -j ACCEPT - iptables -t nat -I POSTROUTING -o "$i" -j MASQUERADE - ip_segment="$(ip route | grep "dev $i proto kernel" | awk '{print $1}')" - iptables -t nat -I POSTROUTING -s "${ip_segment}" -j MASQUERADE - done -} diff --git a/luci-app-zerotier/root/etc/zerotier.stop b/luci-app-zerotier/root/etc/zerotier.stop deleted file mode 100755 index cbe7ec4b6..000000000 --- a/luci-app-zerotier/root/etc/zerotier.stop +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh - -zt0="$(ifconfig | grep 'zt' | awk '{print $1}')" -[ -z "${zt0}" ] && zt0="$(cat "/tmp/zt.nif")" - -for i in ${zt0} -do - ip_segment="" - iptables -D FORWARD -i "$i" -j ACCEPT 2>/dev/null - iptables -D FORWARD -o "$i" -j ACCEPT 2>/dev/null - iptables -t nat -D POSTROUTING -o "$i" -j MASQUERADE 2>/dev/null - ip_segment="$(ip route | grep "dev $i proto" | awk '{print $1}')" - iptables -t nat -D POSTROUTING -s "${ip_segment}" -j MASQUERADE 2>/dev/null - echo "zt interface $i is stopped!" -done diff --git a/luci-app-zerotier/root/etc/zerotier/zerotier.log b/luci-app-zerotier/root/etc/zerotier/zerotier.log deleted file mode 100755 index e69de29bb..000000000 diff --git a/r8125/Makefile b/r8125/Makefile deleted file mode 100755 index befd2aabb..000000000 --- a/r8125/Makefile +++ /dev/null @@ -1,37 +0,0 @@ -# Attribution: https://gist.github.com/lenew/9b41ba901c3393047ede0766760f9d55 - -#Put this source to 'package/lean/r8125' folder of OpenWRT/LEDE SDK -#Build(make menuconfig, make defconfig, make) - -include $(TOPDIR)/rules.mk -include $(INCLUDE_DIR)/kernel.mk - -PKG_NAME:=r8125 -PKG_VERSION:=9.010.01-1 -PKG_RELEASE:=$(AUTORELEASE) - - -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz -PKG_SOURCE_URL:=https://codeload.github.com/awesometic/realtek-r8125-dkms/tar.gz/$(PKG_VERSION)? -PKG_HASH:=81fb9a100e6cefb421557639b476fd03af61a99c55bc8fb03c6e396532bd0944 -PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/realtek-$(PKG_NAME)-dkms-$(PKG_VERSION) - -include $(INCLUDE_DIR)/package.mk - -define KernelPackage/r8125 - TITLE:=Driver for Realtek r8125 chipsets - SUBMENU:=Network Devices - VERSION:=$(LINUX_VERSION)+$(PKG_VERSION)-$(BOARD)-$(PKG_RELEASE) - FILES:= $(PKG_BUILD_DIR)/src/r8125.ko - AUTOLOAD:=$(call AutoProbe,r8125) -endef - -define Package/r8125/description - This package contains a driver for Realtek r8125 chipsets. -endef - -define Build/Compile - +$(KERNEL_MAKE) M=$(PKG_BUILD_DIR)/src modules -endef - -$(eval $(call KernelPackage,r8125)) diff --git a/r8125/patches/010-config.patch b/r8125/patches/010-config.patch deleted file mode 100755 index e7934c01c..000000000 --- a/r8125/patches/010-config.patch +++ /dev/null @@ -1,22 +0,0 @@ ---- a/src/Makefile -+++ b/src/Makefile -@@ -35,16 +35,16 @@ ENABLE_REALWOW_SUPPORT = n - ENABLE_DASH_SUPPORT = n - ENABLE_DASH_PRINTER_SUPPORT = n - CONFIG_DOWN_SPEED_100 = n --CONFIG_ASPM = y -+CONFIG_ASPM = n - ENABLE_S5WOL = y - ENABLE_S5_KEEP_CURR_MAC = n - ENABLE_EEE = y - ENABLE_S0_MAGIC_PACKET = n - ENABLE_TX_NO_CLOSE = y --ENABLE_MULTIPLE_TX_QUEUE = n -+ENABLE_MULTIPLE_TX_QUEUE = y - ENABLE_PTP_SUPPORT = n - ENABLE_PTP_MASTER_MODE = n --ENABLE_RSS_SUPPORT = n -+ENABLE_RSS_SUPPORT = y - ENABLE_LIB_SUPPORT = n - ENABLE_USE_FIRMWARE_FILE = n - DISABLE_PM_SUPPORT = n diff --git a/r8125/patches/020-5.19-support.patch b/r8125/patches/020-5.19-support.patch deleted file mode 100755 index 481c7739e..000000000 --- a/r8125/patches/020-5.19-support.patch +++ /dev/null @@ -1,18 +0,0 @@ ---- a/src/r8125_n.c -+++ b/src/r8125_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; diff --git a/r8125/patches/021-6.1-suppot.patch b/r8125/patches/021-6.1-suppot.patch deleted file mode 100755 index c460ce33b..000000000 --- a/r8125/patches/021-6.1-suppot.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- a/src/r8125.h -+++ b/src/r8125.h -@@ -633,7 +633,11 @@ - typedef struct napi_struct *napi_ptr; - typedef int napi_budget; - -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0) -+#define RTL_NAPI_CONFIG(ndev, priv, function, weight) netif_napi_add_weight(ndev, &priv->napi, function, weight) -+#else - #define RTL_NAPI_CONFIG(ndev, priv, function, weight) netif_napi_add(ndev, &priv->napi, function, weight) -+#endif - #define RTL_NAPI_QUOTA(budget, ndev) min(budget, budget) - #define RTL_GET_PRIV(stuct_ptr, priv_struct) container_of(stuct_ptr, priv_struct, stuct_ptr) - #define RTL_GET_NETDEV(priv_ptr) struct net_device *dev = priv_ptr->dev; diff --git a/r8125/patches/030-add-LED-configuration-from-OF.patch b/r8125/patches/030-add-LED-configuration-from-OF.patch deleted file mode 100755 index 5f6f1d29b..000000000 --- a/r8125/patches/030-add-LED-configuration-from-OF.patch +++ /dev/null @@ -1,43 +0,0 @@ ---- a/src/r8125_n.c -+++ b/src/r8125_n.c -@@ -43,6 +43,7 @@ - #include - #include - #include -+#include - #include - #include - #include -@@ -10407,6 +10408,23 @@ rtl8125_setup_mqs_reg(struct rtl8125_private *tp) - } - } - -+static int -+rtl8125_led_configuration(struct rtl8125_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 - rtl8125_init_software_variable(struct net_device *dev) - { -@@ -10838,6 +10856,8 @@ rtl8125_init_software_variable(struct net_device *dev) - if (tp->InitRxDescType == RX_DESC_RING_TYPE_3) - tp->rtl8125_rx_config |= EnableRxDescV3; - -+ rtl8125_led_configuration(tp); -+ - tp->NicCustLedValue = RTL_R16(tp, CustomLED); - - tp->wol_opts = rtl8125_get_hw_wol(tp); diff --git a/r8152/Makefile b/r8152/Makefile deleted file mode 100755 index 5921bdcc7..000000000 --- a/r8152/Makefile +++ /dev/null @@ -1,55 +0,0 @@ -# -# Download realtek r8152 linux driver from official site: -# [https://www.realtek.com/en/component/zoo/category/network-interface-controllers-10-100-1000m-gigabit-ethernet-usb-3-0-software] -# - -include $(TOPDIR)/rules.mk -include $(INCLUDE_DIR)/kernel.mk - -PKG_NAME:=r8152 -PKG_VERSION:=2.16.3.20220914 -PKG_RELEASE:=3 - -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz -PKG_SOURCE_URL:=https://codeload.github.com/wget/realtek-r8152-linux/tar.gz/v$(PKG_VERSION)? -PKG_HASH:=61ed7af34c8882c6028ddd1a27bb78fb5bfba41211f84dd7a06e4dc84dbe9a9a - -PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/realtek-$(PKG_NAME)-linux-$(PKG_VERSION) - -PKG_BUILD_PARALLEL:=1 - -PKG_MAINTAINER:=Tianling Shen - -include $(INCLUDE_DIR)/package.mk - -define KernelPackage/usb-net-rtl8152-vendor - VERSION:=$(LINUX_VERSION)+$(PKG_VERSION)-$(BOARD)-$(PKG_RELEASE) - TITLE:=Kernel module for USB-to-Ethernet Realtek convertors - SUBMENU:=USB Support - DEPENDS:=+kmod-usb-net - FILES:=$(PKG_BUILD_DIR)/r8152.ko - AUTOLOAD:=$(call AutoProbe,r8152) - CONFLICTS:=kmod-usb-net-rtl8152 -endef - -define KernelPackage/usb-net-rtl8152-vendor/description - Kernel module for Realtek RTL8152/RTL8153 Based USB Ethernet Adapters -endef - -R8152_MAKEOPTS= -C $(PKG_BUILD_DIR) \ - 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) $(PKG_JOBS) $(R8152_MAKEOPTS) modules -endef - -$(eval $(call KernelPackage,usb-net-rtl8152-vendor)) diff --git a/r8152/patches/010-5.19-support.patch b/r8152/patches/010-5.19-support.patch deleted file mode 100755 index 944e5bfcc..000000000 --- a/r8152/patches/010-5.19-support.patch +++ /dev/null @@ -1,19 +0,0 @@ ---- a/r8152.c -+++ b/r8152.c -@@ -1026,6 +1026,16 @@ - #define RTL_ADVERTISED_1000_FULL BIT(5) - #define RTL_ADVERTISED_2500_FULL BIT(6) - -+#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. - */ diff --git a/r8152/patches/020-6.1-support.patch b/r8152/patches/020-6.1-support.patch deleted file mode 100755 index 756aba51f..000000000 --- a/r8152/patches/020-6.1-support.patch +++ /dev/null @@ -1,38 +0,0 @@ ---- a/compatibility.h -+++ b/compatibility.h -@@ -237,9 +237,15 @@ - #define napi_disable(napi_ptr) netif_poll_disable(container_of(napi_ptr, struct r8152, napi)->netdev) - #define napi_schedule(napi_ptr) netif_rx_schedule(container_of(napi_ptr, struct r8152, napi)->netdev) - #define napi_complete(napi_ptr) netif_rx_complete(container_of(napi_ptr, struct r8152, napi)->netdev) -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0) -+ #define netif_napi_add_weight(ndev, napi_ptr, function, weight_t) \ -+ ndev->poll = function; \ -+ ndev->weight = weight_t; -+#else - #define netif_napi_add(ndev, napi_ptr, function, weight_t) \ - ndev->poll = function; \ - ndev->weight = weight_t; -+#endif - typedef unsigned long uintptr_t; - #define DMA_BIT_MASK(value) \ - (value < 64 ? ((1ULL << value) - 1) : 0xFFFFFFFFFFFFFFFFULL) ---- a/r8152.c -+++ b/r8152.c -@@ -20718,10 +20718,17 @@ - - usb_set_intfdata(intf, tp); - -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0) -+ if (tp->support_2500full) -+ netif_napi_add_weight(netdev, &tp->napi, r8152_poll, 256); -+ else -+ netif_napi_add_weight(netdev, &tp->napi, r8152_poll, 64); -+#else - if (tp->support_2500full) - netif_napi_add(netdev, &tp->napi, r8152_poll, 256); - else - netif_napi_add(netdev, &tp->napi, r8152_poll, 64); -+#endif - - ret = register_netdev(netdev); - if (ret != 0) { diff --git a/r8152/patches/100-add-LED-configuration-from-OF.patch b/r8152/patches/100-add-LED-configuration-from-OF.patch deleted file mode 100755 index 38d885d72..000000000 --- a/r8152/patches/100-add-LED-configuration-from-OF.patch +++ /dev/null @@ -1,74 +0,0 @@ -From 82985725e071f2a5735052f18e109a32aeac3a0b Mon Sep 17 00:00:00 2001 -From: David Bauer -Date: Sun, 26 Jul 2020 02:38:31 +0200 -Subject: [PATCH] add LED configuration from OF - -This adds the ability to configure the LED configuration register using -OF. This way, the correct value for board specific LED configuration can -be determined. - -Signed-off-by: David Bauer ---- - r8152.c | 23 +++++++++++++++++++++++ - 1 file changed, 23 insertions(+) - ---- a/r8152.c -+++ b/r8152.c -@@ -18,6 +18,7 @@ - #include - #include - #include -+#include - #include - #include - #include -@@ -9804,6 +9805,22 @@ static void rtl_tally_reset(struct r8152 - ocp_write_word(tp, MCU_TYPE_PLA, PLA_RSTTALLY, ocp_data); - } - -+static int r8152_led_configuration(struct r8152 *tp) -+{ -+ u32 led_data; -+ int ret; -+ -+ ret = of_property_read_u32(tp->udev->dev.of_node, "realtek,led-data", -+ &led_data); -+ -+ if (ret) -+ return ret; -+ -+ ocp_write_word(tp, MCU_TYPE_PLA, PLA_LEDSEL, led_data); -+ -+ return 0; -+} -+ - static void r8152b_init(struct r8152 *tp) - { - u32 ocp_data; -@@ -9865,6 +9882,8 @@ static void r8152b_init(struct r8152 *tp - ocp_data = ocp_read_word(tp, MCU_TYPE_USB, USB_USB_CTRL); - ocp_data &= ~(RX_AGG_DISABLE | RX_ZERO_EN); - ocp_write_word(tp, MCU_TYPE_USB, USB_USB_CTRL, ocp_data); -+ -+ r8152_led_configuration(tp); - } - - static void r8153_init(struct r8152 *tp) -@@ -10008,6 +10027,8 @@ static void r8153_init(struct r8152 *tp) - tp->coalesce = COALESCE_SLOW; - break; - } -+ -+ r8152_led_configuration(tp); - } - - static void r8153b_init(struct r8152 *tp) -@@ -10098,6 +10119,8 @@ static void r8153b_init(struct r8152 *tp - rtl_tally_reset(tp); - - tp->coalesce = 15000; /* 15 us */ -+ -+ r8152_led_configuration(tp); - } - - static void r8153c_init(struct r8152 *tp) diff --git a/r8168/Makefile b/r8168/Makefile deleted file mode 100755 index 8f810c518..000000000 --- a/r8168/Makefile +++ /dev/null @@ -1,39 +0,0 @@ -# -# 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.051.02 -PKG_RELEASE:=1 - -PKG_SOURCE_PROTO:=git -PKG_SOURCE_URL:=https://github.com/BROBIRD/openwrt-r8168.git -PKG_SOURCE_VERSION:=4f6cfe1ca12fb772deed57f1d2d1062af041ad07 -PKG_MIRROR_HASH:=6b149f5eb3b9e1dc50867a694984d253aa58d97dd5fbab30eb405d2d7b2be587 - -PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) - -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 - -define Build/Compile - +$(KERNEL_MAKE) M=$(PKG_BUILD_DIR)/src modules -endef - -$(eval $(call KernelPackage,r8168)) diff --git a/r8168/patches/001-r8168-add-LED-configuration-from-OF.patch b/r8168/patches/001-r8168-add-LED-configuration-from-OF.patch deleted file mode 100755 index f49842442..000000000 --- a/r8168/patches/001-r8168-add-LED-configuration-from-OF.patch +++ /dev/null @@ -1,42 +0,0 @@ ---- a/src/r8168_n.c -+++ b/src/r8168_n.c -@@ -47,6 +47,7 @@ - #include - #include - #include -+#include - #include - #include - #include -@@ -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); diff --git a/r8168/patches/020-5.18-support.patch b/r8168/patches/020-5.18-support.patch deleted file mode 100755 index 499389274..000000000 --- a/r8168/patches/020-5.18-support.patch +++ /dev/null @@ -1,47 +0,0 @@ ---- 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)) diff --git a/r8168/patches/030-5.19-support.patch b/r8168/patches/030-5.19-support.patch deleted file mode 100755 index d4dca3125..000000000 --- a/r8168/patches/030-5.19-support.patch +++ /dev/null @@ -1,18 +0,0 @@ ---- 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; diff --git a/r8168/patches/030-6.1-support.patch b/r8168/patches/030-6.1-support.patch deleted file mode 100755 index 44ab2be19..000000000 --- a/r8168/patches/030-6.1-support.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- a/src/r8168.h ---- b/src/r8168.h -@@ -566,7 +566,11 @@ - typedef struct napi_struct *napi_ptr; - typedef int napi_budget; - -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0) -+#define RTL_NAPI_CONFIG(ndev, priv, function, weight) netif_napi_add_weight(ndev, &priv->napi, function, weight) -+#else - #define RTL_NAPI_CONFIG(ndev, priv, function, weight) netif_napi_add(ndev, &priv->napi, function, weight) -+#endif - #define RTL_NAPI_QUOTA(budget, ndev) min(budget, budget) - #define RTL_GET_PRIV(stuct_ptr, priv_struct) container_of(stuct_ptr, priv_struct, stuct_ptr) - #define RTL_GET_NETDEV(priv_ptr) struct net_device *dev = priv_ptr->dev;