[openwrt/openwrt] package: add kmod-r8126 ethernet driver

LEDE Commits lede-commits at lists.infradead.org
Sat Aug 17 03:42:37 PDT 2024


noltari pushed a commit to openwrt/openwrt.git, branch openwrt-23.05:
https://git.openwrt.org/a79157f2575142053dabec6e1d7cd038ad3634d6

commit a79157f2575142053dabec6e1d7cd038ad3634d6
Author: Álvaro Fernández Rojas <noltari at gmail.com>
AuthorDate: Sat Jun 22 16:04:24 2024 +0200

    package: add kmod-r8126 ethernet driver
    
    r8126 is an out of tree driver provided by Realtek for RTL8126 devices.
    
    Signed-off-by: Álvaro Fernández Rojas <noltari at gmail.com>
    (cherry picked from 54623c6a1daeb029858aab96a58e0ee8607f738b)
---
 package/kernel/r8126/Makefile                      | 33 ++++++++++++++++++++++
 .../r8126/patches/0001-r8126.h-use-BIT_ULL.patch   | 21 ++++++++++++++
 2 files changed, 54 insertions(+)

diff --git a/package/kernel/r8126/Makefile b/package/kernel/r8126/Makefile
new file mode 100644
index 0000000000..2f88ab4188
--- /dev/null
+++ b/package/kernel/r8126/Makefile
@@ -0,0 +1,33 @@
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=r8126
+PKG_VERSION:=10.013.00
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+PKG_SOURCE_URL:=https://github.com/openwrt/rtl8126/releases/download/$(PKG_VERSION)
+PKG_HASH:=b41bda6ff3bbb7d9bc5b81c5c21355f031587d3a3a5862abcd4d766e942272e7
+
+PKG_BUILD_PARALLEL:=1
+PKG_LICENSE:=GPLv2
+PKG_MAINTAINER:=Alvaro Fernandez Rojas <noltari at gmail.com>
+
+include $(INCLUDE_DIR)/kernel.mk
+include $(INCLUDE_DIR)/package.mk
+
+define KernelPackage/r8126
+  SUBMENU:=Network Devices
+  TITLE:=Realtek RTL8126 PCI 5 Gigabit Ethernet driver
+  DEPENDS:=@PCI_SUPPORT
+  FILES:=$(PKG_BUILD_DIR)/src/r8126.ko
+  AUTOLOAD:=$(call AutoProbe,r8126)
+  PROVIDES:=kmod-r8169
+endef
+
+define Build/Compile
+	+$(KERNEL_MAKE) $(PKG_JOBS) \
+		M="$(PKG_BUILD_DIR)/src" \
+		modules
+endef
+
+$(eval $(call KernelPackage,r8126))
diff --git a/package/kernel/r8126/patches/0001-r8126.h-use-BIT_ULL.patch b/package/kernel/r8126/patches/0001-r8126.h-use-BIT_ULL.patch
new file mode 100644
index 0000000000..cf83163966
--- /dev/null
+++ b/package/kernel/r8126/patches/0001-r8126.h-use-BIT_ULL.patch
@@ -0,0 +1,21 @@
+From 9649df50a239d1379cc8d9febd4854a0c7ca0731 Mon Sep 17 00:00:00 2001
+From: Mieczyslaw Nalewaj <namiltd at poczta.onet.pl>
+Date: Sat, 10 Aug 2024 17:42:44 +0200
+Subject: [PATCH] r8126.h: use BIT_ULL
+
+Fixes compilation on 32 bit systems.
+---
+ r8126.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/src/r8126.h
++++ b/src/r8126.h
+@@ -678,7 +678,7 @@ This is free software, and you are welco
+ #ifndef ADVERTISED_2500baseX_Full
+ #define ADVERTISED_2500baseX_Full  0x8000
+ #endif
+-#define RTK_ADVERTISED_5000baseX_Full  BIT(48)
++#define RTK_ADVERTISED_5000baseX_Full  BIT_ULL(48)
+ 
+ #define RTK_ADVERTISE_2500FULL  0x80
+ #define RTK_ADVERTISE_5000FULL  0x100




More information about the lede-commits mailing list