diff --git a/package/kernel/mt76/Makefile b/package/kernel/mt76/Makefile index 0c4feb36772..d55feab020a 100644 --- a/package/kernel/mt76/Makefile +++ b/package/kernel/mt76/Makefile @@ -8,9 +8,9 @@ PKG_LICENSE_FILES:= PKG_SOURCE_URL:=https://github.com/openwrt/mt76 PKG_SOURCE_PROTO:=git -PKG_SOURCE_DATE:=2025-06-18 -PKG_SOURCE_VERSION:=a17fbd3d85981af047bd75777a106a230de0178b -PKG_MIRROR_HASH:=714219787b93c202a6efa22b795a92ddcb26df0899c492c71b5c813d78df4fa2 +PKG_SOURCE_DATE:=2025-07-07 +PKG_SOURCE_VERSION:=32ca2b6db354db090eb306e9f5b85651e92dfa8b +PKG_MIRROR_HASH:=01d3ec909e474f4ccdfdab6559c30c54d05abdd87db2e9fdadb548e09a3fec2a PKG_MAINTAINER:=Felix Fietkau PKG_USE_NINJA:=0 diff --git a/package/kernel/mt76/patches/001-wifi-mt76-convert-platform-driver-.remove-to-.remove.patch b/package/kernel/mt76/patches/001-wifi-mt76-convert-platform-driver-.remove-to-.remove.patch deleted file mode 100644 index 1fd82660cfd..00000000000 --- a/package/kernel/mt76/patches/001-wifi-mt76-convert-platform-driver-.remove-to-.remove.patch +++ /dev/null @@ -1,98 +0,0 @@ -From: Shiji Yang -Date: Mon, 28 Apr 2025 22:16:03 +0800 -Subject: [PATCH] wifi: mt76: convert platform driver .remove to .remove_new - -This conversion can make the mt76 driver compatible with both -the 6.6 and 6.12 kernels. Fixes build error on 6.12: - -/workspaces/openwrt/build_dir/target-x86_64_musl/linux-x86_64/mt76-2025.04.11~be28ef77/mt7603/soc.c:77:27: error: initialization of 'void (*)(struct platform_device *)' from incompatible pointer type 'int (*)(struct platform_device *)' [-Werror=incompatible-pointer-types] - 77 | .remove = mt76_wmac_remove, - | ^~~~~~~~~~~~~~~~ - -Signed-off-by: Shiji Yang ---- - mt7603/soc.c | 6 ++---- - mt7615/soc.c | 6 ++---- - mt7915/soc.c | 6 ++---- - 3 files changed, 6 insertions(+), 12 deletions(-) - ---- a/mt7603/soc.c -+++ b/mt7603/soc.c -@@ -52,15 +52,13 @@ error: - return ret; - } - --static int -+static void - mt76_wmac_remove(struct platform_device *pdev) - { - struct mt76_dev *mdev = platform_get_drvdata(pdev); - struct mt7603_dev *dev = container_of(mdev, struct mt7603_dev, mt76); - - mt7603_unregister_device(dev); -- -- return 0; - } - - static const struct of_device_id of_wmac_match[] = { -@@ -74,7 +72,7 @@ MODULE_FIRMWARE(MT7628_FIRMWARE_E2); - - struct platform_driver mt76_wmac_driver = { - .probe = mt76_wmac_probe, -- .remove = mt76_wmac_remove, -+ .remove_new = mt76_wmac_remove, - .driver = { - .name = "mt76_wmac", - .of_match_table = of_wmac_match, ---- a/mt7615/soc.c -+++ b/mt7615/soc.c -@@ -45,13 +45,11 @@ static int mt7622_wmac_probe(struct plat - return mt7615_mmio_probe(&pdev->dev, mem_base, irq, mt7615e_reg_map); - } - --static int mt7622_wmac_remove(struct platform_device *pdev) -+static void mt7622_wmac_remove(struct platform_device *pdev) - { - struct mt7615_dev *dev = platform_get_drvdata(pdev); - - mt7615_unregister_device(dev); -- -- return 0; - } - - static const struct of_device_id mt7622_wmac_of_match[] = { -@@ -65,7 +63,7 @@ struct platform_driver mt7622_wmac_drive - .of_match_table = mt7622_wmac_of_match, - }, - .probe = mt7622_wmac_probe, -- .remove = mt7622_wmac_remove, -+ .remove_new = mt7622_wmac_remove, - }; - - MODULE_FIRMWARE(MT7622_FIRMWARE_N9); ---- a/mt7915/soc.c -+++ b/mt7915/soc.c -@@ -1283,13 +1283,11 @@ free_device: - return ret; - } - --static int mt798x_wmac_remove(struct platform_device *pdev) -+static void mt798x_wmac_remove(struct platform_device *pdev) - { - struct mt7915_dev *dev = platform_get_drvdata(pdev); - - mt7915_unregister_device(dev); -- -- return 0; - } - - static const struct of_device_id mt798x_wmac_of_match[] = { -@@ -1306,7 +1304,7 @@ struct platform_driver mt798x_wmac_drive - .of_match_table = mt798x_wmac_of_match, - }, - .probe = mt798x_wmac_probe, -- .remove = mt798x_wmac_remove, -+ .remove_new = mt798x_wmac_remove, - }; - - MODULE_FIRMWARE(MT7986_FIRMWARE_WA); diff --git a/package/kernel/mt76/patches/002-wifi-mt76-replace-strlcpy-with-strscpy.patch b/package/kernel/mt76/patches/002-wifi-mt76-replace-strlcpy-with-strscpy.patch deleted file mode 100644 index 9e7d1ee057a..00000000000 --- a/package/kernel/mt76/patches/002-wifi-mt76-replace-strlcpy-with-strscpy.patch +++ /dev/null @@ -1,73 +0,0 @@ -From d6b484b5cb2a7d509b36a220911509ddd8b777c4 Mon Sep 17 00:00:00 2001 -From: Azeem Shaikh -Date: Mon, 3 Jul 2023 18:12:56 +0000 -Subject: wifi: mt76: Replace strlcpy() with strscpy() - -strlcpy() reads the entire source buffer first. -This read may exceed the destination size limit. -This is both inefficient and can lead to linear read -overflows if a source string is not NUL-terminated [1]. -In an effort to remove strlcpy() completely [2], replace -strlcpy() here with strscpy(). - -Direct replacement is safe here since DEV_ASSIGN is only used by -TRACE macros and the return values are ignored. - -[1] https://www.kernel.org/doc/html/latest/process/deprecated.html#strlcpy -[2] https://github.com/KSPP/linux/issues/89 - -Signed-off-by: Azeem Shaikh -Reviewed-by: Kees Cook -Signed-off-by: Kalle Valo -Link: https://lore.kernel.org/r/20230703181256.3712079-1-azeemshaikh38@gmail.com ---- - mt7615/mt7615_trace.h | 2 +- - mt76x02_trace.h | 2 +- - trace.h | 2 +- - usb_trace.h | 2 +- - 4 files changed, 4 insertions(+), 4 deletions(-) - ---- a/mt7615/mt7615_trace.h -+++ b/mt7615/mt7615_trace.h -@@ -14,7 +14,7 @@ - - #define MAXNAME 32 - #define DEV_ENTRY __array(char, wiphy_name, 32) --#define DEV_ASSIGN strlcpy(__entry->wiphy_name, \ -+#define DEV_ASSIGN strscpy(__entry->wiphy_name, \ - wiphy_name(mt76_hw(dev)->wiphy), MAXNAME) - #define DEV_PR_FMT "%s" - #define DEV_PR_ARG __entry->wiphy_name ---- a/mt76x02_trace.h -+++ b/mt76x02_trace.h -@@ -14,7 +14,7 @@ - - #define MAXNAME 32 - #define DEV_ENTRY __array(char, wiphy_name, 32) --#define DEV_ASSIGN strlcpy(__entry->wiphy_name, \ -+#define DEV_ASSIGN strscpy(__entry->wiphy_name, \ - wiphy_name(mt76_hw(dev)->wiphy), MAXNAME) - #define DEV_PR_FMT "%s" - #define DEV_PR_ARG __entry->wiphy_name ---- a/trace.h -+++ b/trace.h -@@ -14,7 +14,7 @@ - - #define MAXNAME 32 - #define DEV_ENTRY __array(char, wiphy_name, 32) --#define DEVICE_ASSIGN strlcpy(__entry->wiphy_name, \ -+#define DEVICE_ASSIGN strscpy(__entry->wiphy_name, \ - wiphy_name(dev->hw->wiphy), MAXNAME) - #define DEV_PR_FMT "%s" - #define DEV_PR_ARG __entry->wiphy_name ---- a/usb_trace.h -+++ b/usb_trace.h -@@ -14,7 +14,7 @@ - - #define MAXNAME 32 - #define DEV_ENTRY __array(char, wiphy_name, 32) --#define DEV_ASSIGN strlcpy(__entry->wiphy_name, \ -+#define DEV_ASSIGN strscpy(__entry->wiphy_name, \ - wiphy_name(dev->hw->wiphy), MAXNAME) - #define DEV_PR_FMT "%s " - #define DEV_PR_ARG __entry->wiphy_name diff --git a/package/kernel/mt76/patches/003-wifi-mt76-link_id.patch b/package/kernel/mt76/patches/003-wifi-mt76-link_id.patch deleted file mode 100644 index 494796f9793..00000000000 --- a/package/kernel/mt76/patches/003-wifi-mt76-link_id.patch +++ /dev/null @@ -1,34 +0,0 @@ ---- a/mac80211.c -+++ b/mac80211.c -@@ -1702,7 +1702,7 @@ s8 mt76_get_power_bound(struct mt76_phy - EXPORT_SYMBOL_GPL(mt76_get_power_bound); - - int mt76_get_txpower(struct ieee80211_hw *hw, struct ieee80211_vif *vif, -- int *dbm) -+ unsigned int link_id, int *dbm) - { - struct mt76_phy *phy = mt76_vif_phy(hw, vif); - int n_chains, delta; ---- a/mt76.h -+++ b/mt76.h -@@ -1496,7 +1496,7 @@ int mt76_get_min_avg_rssi(struct mt76_de - s8 mt76_get_power_bound(struct mt76_phy *phy, s8 txpower); - - int mt76_get_txpower(struct ieee80211_hw *hw, struct ieee80211_vif *vif, -- int *dbm); -+ unsigned int link_id, int *dbm); - int mt76_init_sar_power(struct ieee80211_hw *hw, - const struct cfg80211_sar_specs *sar); - int mt76_get_sar_power(struct mt76_phy *phy, ---- a/mt7996/main.c -+++ b/mt7996/main.c -@@ -664,7 +664,8 @@ static void mt7996_configure_filter(stru - } - - static int --mt7996_get_txpower(struct ieee80211_hw *hw, struct ieee80211_vif *vif, int *dbm) -+mt7996_get_txpower(struct ieee80211_hw *hw, struct ieee80211_vif *vif, -+ unsigned int link_id, int *dbm) - { - struct mt7996_vif *mvif = (struct mt7996_vif *)vif->drv_priv; - struct mt7996_phy *phy = mt7996_vif_link_phy(&mvif->deflink);