From 2389793edf00288c32152391ecfd26d49eac12ba Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Tue, 25 Feb 2025 21:15:19 +0100 Subject: [PATCH 1/5] kernel: kmod-btmtk: Extract btmtk.ko into own package btmtk.ko is used by btusb.ko and btmtkuart.ko, add it into an own package and make both packages depend on it. Fixes: 1c42a0be3619 ("kernel: modules: bluetooth: separating UART and USB drivers") Link: https://github.com/openwrt/openwrt/pull/18110 Signed-off-by: Hauke Mehrtens --- package/kernel/linux/modules/bluetooth.mk | 17 ++++++++++++++--- target/linux/mediatek/modules.mk | 2 +- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/package/kernel/linux/modules/bluetooth.mk b/package/kernel/linux/modules/bluetooth.mk index a498c31e0b..b4163eb950 100644 --- a/package/kernel/linux/modules/bluetooth.mk +++ b/package/kernel/linux/modules/bluetooth.mk @@ -60,7 +60,7 @@ $(eval $(call KernelPackage,hci-uart)) define KernelPackage/btusb SUBMENU:=$(BLUETOOTH_MENU) TITLE:=Bluetooth HCI USB support - DEPENDS:=@USB_SUPPORT +kmod-usb-core +kmod-bluetooth + DEPENDS:=@USB_SUPPORT +kmod-usb-core +kmod-bluetooth +kmod-btmtk KCONFIG:= \ CONFIG_BT_HCIBTUSB \ CONFIG_BT_HCIBTUSB_BCM=n \ @@ -69,8 +69,7 @@ define KernelPackage/btusb FILES:= \ $(LINUX_DIR)/drivers/bluetooth/btusb.ko \ $(LINUX_DIR)/drivers/bluetooth/btintel.ko \ - $(LINUX_DIR)/drivers/bluetooth/btrtl.ko \ - $(LINUX_DIR)/drivers/bluetooth/btmtk.ko + $(LINUX_DIR)/drivers/bluetooth/btrtl.ko AUTOLOAD:=$(call AutoProbe,btusb) endef @@ -81,6 +80,18 @@ endef $(eval $(call KernelPackage,btusb)) +define KernelPackage/btmtk + SUBMENU:=$(BLUETOOTH_MENU) + TITLE:=MTK Bluetooth support + HIDDEN:=1 + DEPENDS:=+kmod-bluetooth + KCONFIG:=CONFIG_BT_MTK + FILES:=$(LINUX_DIR)/drivers/bluetooth/btmtk.ko +endef + +$(eval $(call KernelPackage,btmtk)) + + define KernelPackage/ath3k SUBMENU:=$(BLUETOOTH_MENU) TITLE:=ATH3K Kernel Module support diff --git a/target/linux/mediatek/modules.mk b/target/linux/mediatek/modules.mk index 8480123725..ade8d60ab3 100644 --- a/target/linux/mediatek/modules.mk +++ b/target/linux/mediatek/modules.mk @@ -18,7 +18,7 @@ $(eval $(call KernelPackage,ata-ahci-mtk)) define KernelPackage/btmtkuart SUBMENU:=Other modules TITLE:=MediaTek HCI UART driver - DEPENDS:=@TARGET_mediatek_mt7622 +kmod-bluetooth +mt7622bt-firmware + DEPENDS:=@TARGET_mediatek_mt7622 +kmod-bluetooth +kmod-btmtk +mt7622bt-firmware KCONFIG:=CONFIG_BT_MTKUART FILES:= \ $(LINUX_DIR)/drivers/bluetooth/btmtkuart.ko From 23fdbd4e7135f97f1b032b69d09e5dfde0d999b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= Date: Thu, 27 Feb 2025 08:31:12 +0100 Subject: [PATCH 2/5] omcproxy: update to latest version MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Changelog: https://github.com/openwrt/omcproxy/compare/bfba2aa75802ff1a70ef2fd3eba53409a8c6e93a...582cd8d3ae7e6af0073ce1d9198387af48affd60 Signed-off-by: Álvaro Fernández Rojas Link: https://github.com/openwrt/openwrt/pull/18130 Signed-off-by: Robert Marko --- package/network/services/omcproxy/Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/package/network/services/omcproxy/Makefile b/package/network/services/omcproxy/Makefile index 0ca0970af2..a295431cb5 100644 --- a/package/network/services/omcproxy/Makefile +++ b/package/network/services/omcproxy/Makefile @@ -8,13 +8,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=omcproxy -PKG_RELEASE:=9 +PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/omcproxy.git -PKG_MIRROR_HASH:=61f03d76b14149e417360b6aaa630e920b75a31a6a497353b7160b3a374b20b2 -PKG_SOURCE_DATE:=2021-11-04 -PKG_SOURCE_VERSION:=bfba2aa75802ff1a70ef2fd3eba53409a8c6e93a +PKG_MIRROR_HASH:=b18c6dcc323dc35cfeb3503562dd3d8b9fb27fcf6ddd98690a64bd709920ff3d +PKG_SOURCE_DATE:=2025-02-27 +PKG_SOURCE_VERSION:=582cd8d3ae7e6af0073ce1d9198387af48affd60 PKG_MAINTAINER:=Steven Barth PKG_LICENSE:=Apache-2.0 From a8dea562aa6146f5955ef081ee3240f0b960edf9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= Date: Thu, 27 Feb 2025 08:04:50 +0100 Subject: [PATCH 3/5] kernel: r8125: update to v9.015.00 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Changelog: https://github.com/openwrt/rtl8125/compare/9.014.01...9.015.00 Signed-off-by: Álvaro Fernández Rojas --- package/kernel/r8125/Makefile | 4 ++-- ...0-r8125-print-link-speed-and-duplex-mode.patch | 15 ++++++++------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/package/kernel/r8125/Makefile b/package/kernel/r8125/Makefile index 647630393a..232cf695b8 100644 --- a/package/kernel/r8125/Makefile +++ b/package/kernel/r8125/Makefile @@ -1,12 +1,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=r8125 -PKG_VERSION:=9.014.01 +PKG_VERSION:=9.015.00 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:=https://github.com/openwrt/rtl8125/releases/download/$(PKG_VERSION) -PKG_HASH:=f006aa95501738ca55c522812c9d1b473ac781675f3ad88ce341a09316b8aa13 +PKG_HASH:=7d6906336c3ad960c3e7c0299ad655659d7110bdc933c5b568b7f2536cb8ffc3 PKG_BUILD_PARALLEL:=1 PKG_LICENSE:=GPLv2 diff --git a/package/kernel/r8125/patches/200-r8125-print-link-speed-and-duplex-mode.patch b/package/kernel/r8125/patches/200-r8125-print-link-speed-and-duplex-mode.patch index a3b3562149..449cc9a7e2 100644 --- a/package/kernel/r8125/patches/200-r8125-print-link-speed-and-duplex-mode.patch +++ b/package/kernel/r8125/patches/200-r8125-print-link-speed-and-duplex-mode.patch @@ -18,11 +18,12 @@ Signed-off-by: Álvaro Fernández Rojas --- a/src/r8125.h +++ b/src/r8125.h -@@ -1672,6 +1672,8 @@ enum RTL8125_register_content { +@@ -1687,6 +1687,9 @@ enum RTL8125_register_content { LinkStatus = 0x02, FullDup = 0x01, +#define RTL8125_FULL_DUPLEX_MASK (_2500bpsF | _1000bpsF | FullDup) ++#define RTL8125_SPEED_1000_MASK (_1000bpsF | _1000bpsL | _2500bpsL) + /* DBG_reg */ Fix_Nak_1 = (1 << 4), @@ -37,11 +38,11 @@ Signed-off-by: Álvaro Fernández Rojas #include #include #include -@@ -5116,6 +5117,38 @@ rtl8125_link_down_patch(struct net_devic +@@ -5023,6 +5024,38 @@ rtl8125_link_down_patch(struct net_devic #endif } -+static unsigned int rtl8125_phy_duplex(u16 status) ++static unsigned int rtl8125_phy_duplex(u32 status) +{ + unsigned int duplex = DUPLEX_UNKNOWN; + @@ -55,14 +56,14 @@ Signed-off-by: Álvaro Fernández Rojas + return duplex; +} + -+static int rtl8125_phy_speed(u16 status) ++static int rtl8125_phy_speed(u32 status) +{ + int speed = SPEED_UNKNOWN; + + if (status & LinkStatus) { + if (status & _2500bpsF) + speed = SPEED_2500; -+ else if (status & _1000bpsF) ++ else if (status & RTL8125_SPEED_1000_MASK) + speed = SPEED_1000; + else if (status & _100bps) + speed = SPEED_100; @@ -76,14 +77,14 @@ Signed-off-by: Álvaro Fernández Rojas static void _rtl8125_check_link_status(struct net_device *dev, unsigned int link_state) { -@@ -5128,11 +5161,18 @@ _rtl8125_check_link_status(struct net_de +@@ -5035,11 +5068,18 @@ _rtl8125_check_link_status(struct net_de if (link_state == R8125_LINK_STATE_ON) { rtl8125_link_on_patch(dev); - if (netif_msg_ifup(tp)) - printk(KERN_INFO PFX "%s: link up\n", dev->name); + if (netif_msg_ifup(tp)) { -+ const u16 phy_status = RTL_R16(tp, PHYstatus); ++ const u32 phy_status = RTL_R32(tp, PHYstatus); + const unsigned int phy_duplex = rtl8125_phy_duplex(phy_status); + const int phy_speed = rtl8125_phy_speed(phy_status); + printk(KERN_INFO PFX "%s: Link is Up - %s/%s\n", From 3d3328bf5f019507896bfa9ffeb53777fc5bfeaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= Date: Thu, 27 Feb 2025 08:06:27 +0100 Subject: [PATCH 4/5] kernel: r8126: update to v10.015.00 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Changelog: https://github.com/openwrt/rtl8126/compare/10.014.01...10.015.00 Signed-off-by: Álvaro Fernández Rojas --- package/kernel/r8126/Makefile | 4 ++-- ...8126-print-link-speed-and-duplex-mode.patch | 18 ++++++++++-------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/package/kernel/r8126/Makefile b/package/kernel/r8126/Makefile index a8f60f9dbb..da43697bfb 100644 --- a/package/kernel/r8126/Makefile +++ b/package/kernel/r8126/Makefile @@ -1,12 +1,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=r8126 -PKG_VERSION:=10.014.01 +PKG_VERSION:=10.015.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:=dbb10a7abd0972e4abd1b89ea4eb22fc55d6c1dc2f711b5acf4a3bc376275e21 +PKG_HASH:=fac513aa925264a95b053e7532fcda56022d29db288f6625fafee2759a8a6124 PKG_BUILD_PARALLEL:=1 PKG_LICENSE:=GPLv2 diff --git a/package/kernel/r8126/patches/200-r8126-print-link-speed-and-duplex-mode.patch b/package/kernel/r8126/patches/200-r8126-print-link-speed-and-duplex-mode.patch index 27b3d626c1..236f80c7fd 100644 --- a/package/kernel/r8126/patches/200-r8126-print-link-speed-and-duplex-mode.patch +++ b/package/kernel/r8126/patches/200-r8126-print-link-speed-and-duplex-mode.patch @@ -18,11 +18,13 @@ Signed-off-by: Álvaro Fernández Rojas --- a/src/r8126.h +++ b/src/r8126.h -@@ -1740,6 +1740,8 @@ enum RTL8126_register_content { +@@ -1756,6 +1756,10 @@ enum RTL8126_register_content { LinkStatus = 0x02, FullDup = 0x01, +#define RTL8126_FULL_DUPLEX_MASK (_5000bpsF | _2500bpsF | _1000bpsF | FullDup) ++#define RTL8126_SPEED_1000_MASK (_1000bpsF | _1000bpsL | _2500bpsL) ++#define RTL8126_SPEED_2500_MASK (_2500bpsF | _5000bpsL) + /* DBG_reg */ Fix_Nak_1 = (1 << 4), @@ -37,11 +39,11 @@ Signed-off-by: Álvaro Fernández Rojas #include #include #include -@@ -4744,6 +4745,40 @@ rtl8126_link_down_patch(struct net_devic +@@ -4661,6 +4662,40 @@ rtl8126_link_down_patch(struct net_devic #endif } -+static unsigned int rtl8126_phy_duplex(u16 status) ++static unsigned int rtl8126_phy_duplex(u32 status) +{ + unsigned int duplex = DUPLEX_UNKNOWN; + @@ -55,16 +57,16 @@ Signed-off-by: Álvaro Fernández Rojas + return duplex; +} + -+static int rtl8126_phy_speed(u16 status) ++static int rtl8126_phy_speed(u32 status) +{ + int speed = SPEED_UNKNOWN; + + if (status & LinkStatus) { + if (status & _5000bpsF) + speed = SPEED_5000; -+ else if (status & _2500bpsF) ++ else if (status & RTL8126_SPEED_2500_MASK) + speed = SPEED_2500; -+ else if (status & _1000bpsF) ++ else if (status & RTL8126_SPEED_1000_MASK) + speed = SPEED_1000; + else if (status & _100bps) + speed = SPEED_100; @@ -78,14 +80,14 @@ Signed-off-by: Álvaro Fernández Rojas static void _rtl8126_check_link_status(struct net_device *dev, unsigned int link_state) { -@@ -4756,11 +4791,18 @@ _rtl8126_check_link_status(struct net_de +@@ -4673,11 +4708,18 @@ _rtl8126_check_link_status(struct net_de if (link_state == R8126_LINK_STATE_ON) { rtl8126_link_on_patch(dev); - if (netif_msg_ifup(tp)) - printk(KERN_INFO PFX "%s: link up\n", dev->name); + if (netif_msg_ifup(tp)) { -+ const u16 phy_status = RTL_R16(tp, PHYstatus); ++ const u32 phy_status = RTL_R32(tp, PHYstatus); + const unsigned int phy_duplex = rtl8126_phy_duplex(phy_status); + const int phy_speed = rtl8126_phy_speed(phy_status); + printk(KERN_INFO PFX "%s: Link is Up - %s/%s\n", From fe37574be63ef7c6c1c1e611f052ed25c99a8aa1 Mon Sep 17 00:00:00 2001 From: Robert Marko Date: Thu, 27 Feb 2025 11:05:26 +0100 Subject: [PATCH 5/5] libpcap: add missing PKG_CONFIG_DEPENDS entries Currently, enabling USB, BT or Netfilter support after initial compilation will not trigger a rebuild, so add the missing PKG_CONFIG_DEPENDS so that rebuild gets triggered. Signed-off-by: Robert Marko --- package/libs/libpcap/Makefile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/package/libs/libpcap/Makefile b/package/libs/libpcap/Makefile index 09aab0981c..14b97f902a 100644 --- a/package/libs/libpcap/Makefile +++ b/package/libs/libpcap/Makefile @@ -22,7 +22,11 @@ PKG_CPE_ID:=cpe:/a:tcpdump:libpcap PKG_ASLR_PIE_REGULAR:=1 -PKG_CONFIG_DEPENDS := CONFIG_PACKAGE_rpcapd +PKG_CONFIG_DEPENDS := \ + CONFIG_PACKAGE_rpcapd \ + CONFIG_PCAP_HAS_USB \ + CONFIG_PCAP_HAS_BT \ + CONFIG_PCAP_HAS_NETFILTER include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/cmake.mk