diff --git a/package/kernel/mt76/Makefile b/package/kernel/mt76/Makefile index 55aaa2c0b..60f5da0db 100644 --- a/package/kernel/mt76/Makefile +++ b/package/kernel/mt76/Makefile @@ -8,9 +8,17 @@ PKG_LICENSE_FILES:= PKG_SOURCE_URL:=https://github.com/openwrt/mt76 PKG_SOURCE_PROTO:=git -PKG_SOURCE_DATE:=2023-03-01 -PKG_SOURCE_VERSION:=c32d6d849c43792abd8007e13e468b12d6d6e0b7 -PKG_MIRROR_HASH:=b7004bc920ba44cef2f7868d94beb2d288ff9d399af624ce5dad972f953723c8 + +ifdef CONFIG_TARGET_ramips +PKG_SOURCE_DATE:=2022-12-22 +PKG_SOURCE_VERSION:=5b509e80384ab019ac11aa90c81ec0dbb5b0d7f2 +PKG_MIRROR_HASH:=6fc25df4d28becd010ff4971b23731c08b53e69381a9e4c868091899712f78a9 +PATCH_DIR:=./patches-5.4 +else +PKG_SOURCE_DATE:=2023-04-18 +PKG_SOURCE_VERSION:=cddbd796bbc649debe457f7b34b200bbda4fcc53 +PKG_MIRROR_HASH:=3c9e24863f3e045dbab1d05cf760ef0f4a21106766987558ce4df6c0964df11a +endif PKG_MAINTAINER:=Felix Fietkau PKG_USE_NINJA:=0 diff --git a/package/kernel/mt76/patches-5.4/001-allow-vht-on-2g.patch b/package/kernel/mt76/patches-5.4/001-allow-vht-on-2g.patch new file mode 100644 index 000000000..12ce67daf --- /dev/null +++ b/package/kernel/mt76/patches-5.4/001-allow-vht-on-2g.patch @@ -0,0 +1,59 @@ +From ed0b9c38becdbf9379787ca0b4db557f03a31dd7 Mon Sep 17 00:00:00 2001 +From: DENG Qingfang +Date: Mon, 23 Nov 2020 10:46:37 +0800 +Subject: [PATCH] mt76: allow VHT rate on 2.4GHz + +Allow chips that support 11ac to use 256QAM on 2.4GHz + +Signed-off-by: DENG Qingfang +--- + mac80211.c | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +diff --git a/mac80211.c b/mac80211.c +index 766681a4..06aa4228 100644 +--- a/mac80211.c ++++ b/mac80211.c +@@ -281,7 +281,7 @@ static void mt76_init_stream_cap(struct mt76_phy *phy, + void mt76_set_stream_caps(struct mt76_phy *phy, bool vht) + { + if (phy->cap.has_2ghz) +- mt76_init_stream_cap(phy, &phy->sband_2g.sband, false); ++ mt76_init_stream_cap(phy, &phy->sband_2g.sband, vht); + if (phy->cap.has_5ghz) + mt76_init_stream_cap(phy, &phy->sband_5g.sband, vht); + if (phy->cap.has_6ghz) +@@ -348,13 +348,13 @@ mt76_init_sband(struct mt76_phy *phy, struct mt76_sband *msband, + + static int + mt76_init_sband_2g(struct mt76_phy *phy, struct ieee80211_rate *rates, +- int n_rates) ++ int n_rates, bool vht) + { + phy->hw->wiphy->bands[NL80211_BAND_2GHZ] = &phy->sband_2g.sband; + + return mt76_init_sband(phy, &phy->sband_2g, mt76_channels_2ghz, + ARRAY_SIZE(mt76_channels_2ghz), rates, +- n_rates, true, false); ++ n_rates, true, vht); + } + + static int +@@ -506,7 +506,7 @@ int mt76_register_phy(struct mt76_phy *phy, bool vht, + return ret; + + if (phy->cap.has_2ghz) { +- ret = mt76_init_sband_2g(phy, rates, n_rates); ++ ret = mt76_init_sband_2g(phy, rates, n_rates, vht); + if (ret) + return ret; + } +@@ -644,7 +644,7 @@ int mt76_register_device(struct mt76_dev *dev, bool vht, + return ret; + + if (phy->cap.has_2ghz) { +- ret = mt76_init_sband_2g(phy, rates, n_rates); ++ ret = mt76_init_sband_2g(phy, rates, n_rates, vht); + if (ret) + return ret; + } diff --git a/package/kernel/mt76/patches-5.4/002-fix-build-error.patch b/package/kernel/mt76/patches-5.4/002-fix-build-error.patch new file mode 100644 index 000000000..0480a4eb3 --- /dev/null +++ b/package/kernel/mt76/patches-5.4/002-fix-build-error.patch @@ -0,0 +1,57 @@ +--- a/debugfs.c ++++ b/debugfs.c +@@ -25,6 +25,7 @@ mt76_reg_get(void *data, u64 *val) + DEFINE_DEBUGFS_ATTRIBUTE(fops_regval, mt76_reg_get, mt76_reg_set, + "0x%08llx\n"); + ++#if 0 + static int + mt76_napi_threaded_set(void *data, u64 val) + { +@@ -50,6 +51,7 @@ mt76_napi_threaded_get(void *data, u64 *val) + + DEFINE_DEBUGFS_ATTRIBUTE(fops_napi_threaded, mt76_napi_threaded_get, + mt76_napi_threaded_set, "%llu\n"); ++#endif + + int mt76_queues_read(struct seq_file *s, void *data) + { +@@ -116,8 +118,6 @@ mt76_register_debugfs_fops(struct mt76_phy *phy, + debugfs_create_bool("led_active_low", 0600, dir, &phy->leds.al); + debugfs_create_u32("regidx", 0600, dir, &dev->debugfs_reg); + debugfs_create_file_unsafe("regval", 0600, dir, dev, fops); +- debugfs_create_file_unsafe("napi_threaded", 0600, dir, dev, +- &fops_napi_threaded); + debugfs_create_blob("eeprom", 0400, dir, &dev->eeprom); + if (dev->otp.data) + debugfs_create_blob("otp", 0400, dir, &dev->otp); +--- a/mt7615/mcu.c ++++ b/mt7615/mcu.c +@@ -6,6 +6,7 @@ + */ + + #include ++#include + #include "mt7615.h" + #include "mcu.h" + #include "mac.h" +--- a/mt7915/mt7915.h ++++ b/mt7915/mt7915.h +@@ -6,6 +6,7 @@ + + #include + #include ++#include + #include "../mt76_connac.h" + #include "regs.h" + +--- a/mt76_connac_mcu.c ++++ b/mt76_connac_mcu.c +@@ -2,6 +2,7 @@ + /* Copyright (C) 2020 MediaTek Inc. */ + + #include ++#include + #include "mt76_connac2_mac.h" + #include "mt76_connac_mcu.h" + diff --git a/package/kernel/mt76/patches/100-api_update.patch b/package/kernel/mt76/patches-5.4/100-api_update.patch similarity index 100% rename from package/kernel/mt76/patches/100-api_update.patch rename to package/kernel/mt76/patches-5.4/100-api_update.patch diff --git a/package/kernel/mt76/patches/110-wifi-mt76-ignore-key-disable-commands.patch b/package/kernel/mt76/patches-5.4/110-wifi-mt76-ignore-key-disable-commands.patch similarity index 92% rename from package/kernel/mt76/patches/110-wifi-mt76-ignore-key-disable-commands.patch rename to package/kernel/mt76/patches-5.4/110-wifi-mt76-ignore-key-disable-commands.patch index 78b70d790..3c132420e 100644 --- a/package/kernel/mt76/patches/110-wifi-mt76-ignore-key-disable-commands.patch +++ b/package/kernel/mt76/patches-5.4/110-wifi-mt76-ignore-key-disable-commands.patch @@ -251,7 +251,7 @@ Signed-off-by: Felix Fietkau --- a/mt7915/main.c +++ b/mt7915/main.c -@@ -410,16 +410,15 @@ static int mt7915_set_key(struct ieee802 +@@ -399,16 +399,15 @@ static int mt7915_set_key(struct ieee802 mt7915_mcu_add_bss_info(phy, vif, true); } @@ -299,28 +299,3 @@ Signed-off-by: Felix Fietkau err = mt76_connac_mcu_add_key(&dev->mt76, vif, &msta->bip, key, MCU_UNI_CMD(STA_REC_UPDATE), &msta->wcid, cmd); ---- a/mt7996/main.c -+++ b/mt7996/main.c -@@ -351,16 +351,15 @@ static int mt7996_set_key(struct ieee802 - mt7996_mcu_add_bss_info(phy, vif, true); - } - -- if (cmd == SET_KEY) -+ if (cmd == SET_KEY) { - *wcid_keyidx = idx; -- else if (idx == *wcid_keyidx) -- *wcid_keyidx = -1; -- else -+ } else { -+ if (idx == *wcid_keyidx) -+ *wcid_keyidx = -1; - goto out; -+ } - -- mt76_wcid_key_setup(&dev->mt76, wcid, -- cmd == SET_KEY ? key : NULL); -- -+ mt76_wcid_key_setup(&dev->mt76, wcid, key); - err = mt7996_mcu_add_key(&dev->mt76, vif, &msta->bip, - key, MCU_WMWA_UNI_CMD(STA_REC_UPDATE), - &msta->wcid, cmd); diff --git a/package/kernel/mt76/patches/001-allow-vht-on-2g.patch b/package/kernel/mt76/patches/001-allow-vht-on-2g.patch index 0a40968a9..aaa8dd5fa 100644 --- a/package/kernel/mt76/patches/001-allow-vht-on-2g.patch +++ b/package/kernel/mt76/patches/001-allow-vht-on-2g.patch @@ -14,7 +14,7 @@ diff --git a/mac80211.c b/mac80211.c index 766681a4..06aa4228 100644 --- a/mac80211.c +++ b/mac80211.c -@@ -264,7 +264,7 @@ static void mt76_init_stream_cap(struct mt76_phy *phy, +@@ -282,7 +282,7 @@ static void mt76_init_stream_cap(struct mt76_phy *phy, void mt76_set_stream_caps(struct mt76_phy *phy, bool vht) { if (phy->cap.has_2ghz) @@ -23,7 +23,7 @@ index 766681a4..06aa4228 100644 if (phy->cap.has_5ghz) mt76_init_stream_cap(phy, &phy->sband_5g.sband, vht); if (phy->cap.has_6ghz) -@@ -333,13 +333,13 @@ mt76_init_sband(struct mt76_phy *phy, struct mt76_sband *msband, +@@ -349,13 +349,13 @@ mt76_init_sband(struct mt76_phy *phy, struct mt76_sband *msband, static int mt76_init_sband_2g(struct mt76_phy *phy, struct ieee80211_rate *rates, @@ -39,8 +39,8 @@ index 766681a4..06aa4228 100644 } static int -@@ -475,7 +475,7 @@ int mt76_register_phy(struct mt76_phy *phy, bool vht, - mt76_phy_init(phy, phy->hw); +@@ -508,7 +508,7 @@ int mt76_register_phy(struct mt76_phy *phy, bool vht, + return ret; if (phy->cap.has_2ghz) { - ret = mt76_init_sband_2g(phy, rates, n_rates); @@ -48,8 +48,8 @@ index 766681a4..06aa4228 100644 if (ret) return ret; } -@@ -594,7 +594,7 @@ int mt76_register_device(struct mt76_dev *dev, bool vht, - mt76_phy_init(phy, hw); +@@ -691,7 +691,7 @@ int mt76_register_device(struct mt76_dev *dev, bool vht, + return ret; if (phy->cap.has_2ghz) { - ret = mt76_init_sband_2g(phy, rates, n_rates);