mt76 update

Signed-off-by: Arif Alam <arif.alam@netexperience.com>
This commit is contained in:
Arif Alam
2025-07-26 23:43:17 -04:00
parent 7795c51947
commit b2dacf060c
128 changed files with 3814 additions and 1213 deletions

View File

@@ -8,9 +8,9 @@ PKG_LICENSE_FILES:=
PKG_SOURCE_URL:=https://github.com/openwrt/mt76
PKG_SOURCE_PROTO:=git
PKG_SOURCE_DATE:=2024-04-03
PKG_SOURCE_VERSION:=1e336a8582dce2ef32ddd440d423e9afef961e71
PKG_MIRROR_HASH:=48e787bcf0c526d9511375a8a3a77c850de9deca79f6177d2eeea7ca8bd798e2
PKG_SOURCE_DATE:=2024-07-13
PKG_SOURCE_VERSION:=3b47d9df427c4833605a172f2a8f0e0012b04c80
PKG_MIRROR_HASH:=23c3aaa53fb2e088446eb18148a44d3edcd3a0eda1ee41cf5cbf56064ebbee58
PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
PKG_USE_NINJA:=0
@@ -317,23 +317,54 @@ endef
define KernelPackage/mt7996e
$(KernelPackage/mt76-default)
TITLE:=MediaTek MT7996/MT7995/MT7919 wireless driver
DEPENDS+=@PCI_SUPPORT +kmod-mt76-core +kmod-mt76-connac +kmod-hwmon-core +kmod-thermal +@DRIVER_11AX_SUPPORT +@DRIVER_11BE_SUPPORT
TITLE:=MediaTek MT7996E wireless driver
DEPENDS+=@PCI_SUPPORT +kmod-mt76-connac +kmod-hwmon-core +@DRIVER_11AX_SUPPORT \
+@KERNEL_RELAY +@DRIVER_11BE_SUPPORT
FILES:= $(PKG_BUILD_DIR)/mt7996/mt7996e.ko
AUTOLOAD:=$(call AutoProbe,mt7996e)
endef
define KernelPackage/mt7992-firmware
$(KernelPackage/mt76-default)
TITLE:=MediaTek MT7992 firmware
DEPENDS+=+kmod-mt7996e
endef
define KernelPackage/mt7992-23-firmware
$(KernelPackage/mt76-default)
TITLE:=MediaTek MT7996 firmware (2+3 antenna variant)
DEPENDS+=+kmod-mt7996e
endef
define KernelPackage/mt7996-firmware-common
$(KernelPackage/mt76-default)
TITLE:=MediaTek MT7996 firmware (common files)
HIDDEN:=1
endef
define KernelPackage/mt7996-firmware
$(KernelPackage/mt76-default)
TITLE:=MediaTek MT7996 firmware
DEPENDS+=+kmod-mt7996e
DEPENDS+=+kmod-mt7996e +kmod-mt7996-firmware-common
endef
define KernelPackage/mt7996-233-firmware
$(KernelPackage/mt76-default)
TITLE:=MediaTek MT7996 firmware (2+3+3 antenna variant)
DEPENDS+=+kmod-mt7996e +kmod-mt7996-firmware-common
endef
define KernelPackage/mt7925-firmware
$(KernelPackage/mt76-default)
TITLE:=MediaTek MT7925 firmware
DEPENDS+=+kmod-mt7925e
endef
define KernelPackage/mt7925-common
$(KernelPackage/mt76-default)
TITLE:=MediaTek MT7925 wireless driver common code
HIDDEN:=1
DEPENDS+=+kmod-mt792x-common +@DRIVER_11AX_SUPPORT +kmod-hwmon-core
DEPENDS+=+kmod-mt792x-common +@DRIVER_11AX_SUPPORT +kmod-hwmon-core +@DRIVER_11BE_SUPPORT
FILES:= $(PKG_BUILD_DIR)/mt7925/mt7925-common.ko
endef
@@ -342,7 +373,7 @@ define KernelPackage/mt7925u
TITLE:=MediaTek MT7925U wireless driver
DEPENDS+=+kmod-mt792x-usb +kmod-mt7925-common
FILES:= $(PKG_BUILD_DIR)/mt7925/mt7925u.ko
AUTOLOAD:=$(call AutoProbe,mt7921u)
AUTOLOAD:=$(call AutoProbe,mt7925u)
endef
define KernelPackage/mt7925e
@@ -350,7 +381,7 @@ define KernelPackage/mt7925e
TITLE:=MediaTek MT7925e wireless driver
DEPENDS+=@PCI_SUPPORT +kmod-mt7925-common
FILES:= $(PKG_BUILD_DIR)/mt7925/mt7925e.ko
AUTOLOAD:=$(call AutoProbe,mt7921e)
AUTOLOAD:=$(call AutoProbe,mt7925e)
endef
define Package/mt76-test
@@ -708,22 +739,78 @@ define KernelPackage/mt7922-firmware/install
$(1)/lib/firmware/mediatek
endef
define KernelPackage/mt7996-firmware/install
define KernelPackage/mt7925-firmware/install
$(INSTALL_DIR) $(1)/lib/firmware/mediatek/mt7925
cp \
$(PKG_BUILD_DIR)/firmware/mt7925/WIFI_MT7925_PATCH_MCU_1_1_hdr.bin \
$(PKG_BUILD_DIR)/firmware/mt7925/WIFI_RAM_CODE_MT7925_1_1.bin \
$(1)/lib/firmware/mediatek/mt7925
endef
define KernelPackage/mt7992-firmware/install
$(INSTALL_DIR) $(1)/lib/firmware/mediatek/mt7996
cp \
$(PKG_BUILD_DIR)/firmware/mt7996/mt7992_dsp.bin \
$(PKG_BUILD_DIR)/firmware/mt7996/mt7992_eeprom.bin \
$(PKG_BUILD_DIR)/firmware/mt7996/mt7992_eeprom_2i5i.bin \
$(PKG_BUILD_DIR)/firmware/mt7996/mt7992_eeprom_2i5e.bin \
$(PKG_BUILD_DIR)/firmware/mt7996/mt7992_rom_patch.bin \
$(PKG_BUILD_DIR)/firmware/mt7996/mt7992_wa.bin \
$(PKG_BUILD_DIR)/firmware/mt7996/mt7992_wm.bin \
$(1)/lib/firmware/mediatek/mt7996
endef
define KernelPackage/mt7992-23-firmware/install
$(INSTALL_DIR) $(1)/lib/firmware/mediatek/mt7996
cp \
$(PKG_BUILD_DIR)/firmware/mt7996/mt7992_dsp_23.bin \
$(PKG_BUILD_DIR)/firmware/mt7996/mt7992_eeprom_23.bin \
$(PKG_BUILD_DIR)/firmware/mt7996/mt7992_eeprom_23_2i5i.bin \
$(PKG_BUILD_DIR)/firmware/mt7996/mt7992_rom_patch_23.bin \
$(PKG_BUILD_DIR)/firmware/mt7996/mt7992_wa_23.bin \
$(PKG_BUILD_DIR)/firmware/mt7996/mt7992_wm_23.bin \
$(1)/lib/firmware/mediatek/mt7996
endef
define KernelPackage/mt7996-firmware-common/install
$(INSTALL_DIR) $(1)/lib/firmware/mediatek/mt7996
cp \
$(PKG_BUILD_DIR)/firmware/mt7996/mt7996_dsp.bin \
$(1)/lib/firmware/mediatek/mt7996
endef
define KernelPackage/mt7996-firmware/install
$(INSTALL_DIR) $(1)/lib/firmware/mediatek/mt7996
cp \
$(PKG_BUILD_DIR)/firmware/mt7996/mt7996_eeprom.bin \
$(PKG_BUILD_DIR)/firmware/mt7996/mt7996_eeprom_2i5i6i.bin \
$(PKG_BUILD_DIR)/firmware/mt7996/mt7996_rom_patch.bin \
$(PKG_BUILD_DIR)/firmware/mt7996/mt7996_wa.bin \
$(PKG_BUILD_DIR)/firmware/mt7996/mt7996_wm.bin \
$(1)/lib/firmware/mediatek/mt7996
endef
define KernelPackage/mt7996-233-firmware/install
$(INSTALL_DIR) $(1)/lib/firmware/mediatek/mt7996
cp \
$(PKG_BUILD_DIR)/firmware/mt7996/mt7996_eeprom_233.bin \
$(PKG_BUILD_DIR)/firmware/mt7996/mt7996_eeprom_233_2i5i6i.bin \
$(PKG_BUILD_DIR)/firmware/mt7996/mt7996_rom_patch_233.bin \
$(PKG_BUILD_DIR)/firmware/mt7996/mt7996_wa_233.bin \
$(PKG_BUILD_DIR)/firmware/mt7996/mt7996_wm_233.bin \
$(1)/lib/firmware/mediatek/mt7996
endef
define Package/mt76-test/install
mkdir -p $(1)/usr/sbin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/tools/mt76-test $(1)/usr/sbin
endef
define Build/InstallDev
mkdir -p $(STAGING_DIR_IMAGE)
$(CP) $(PKG_BUILD_DIR)/firmware/mt7981_eeprom_mt7976_dbdc.bin $(STAGING_DIR_IMAGE)/
endef
$(eval $(call KernelPackage,mt76-core))
$(eval $(call KernelPackage,mt76-usb))
$(eval $(call KernelPackage,mt76x02-usb))
@@ -753,6 +840,7 @@ $(eval $(call KernelPackage,mt7981-firmware))
$(eval $(call KernelPackage,mt7986-firmware))
$(eval $(call KernelPackage,mt7921-firmware))
$(eval $(call KernelPackage,mt7922-firmware))
$(eval $(call KernelPackage,mt7925-firmware))
$(eval $(call KernelPackage,mt792x-common))
$(eval $(call KernelPackage,mt792x-usb))
$(eval $(call KernelPackage,mt7921-common))
@@ -763,6 +851,10 @@ $(eval $(call KernelPackage,mt7921e))
$(eval $(call KernelPackage,mt7925u))
$(eval $(call KernelPackage,mt7925e))
$(eval $(call KernelPackage,mt7996e))
$(eval $(call KernelPackage,mt7992-firmware))
$(eval $(call KernelPackage,mt7992-23-firmware))
$(eval $(call KernelPackage,mt7996-firmware-common))
$(eval $(call KernelPackage,mt7996-firmware))
$(eval $(call KernelPackage,mt7996-233-firmware))
$(eval $(call KernelPackage,mt76))
$(eval $(call BuildPackage,mt76-test))

View File

@@ -1,7 +1,7 @@
From e9f5961a07a895d18b6158a94d74633c07eab50f Mon Sep 17 00:00:00 2001
From 67edc0d71c271793b5ab04338abedaab41b8586e Mon Sep 17 00:00:00 2001
From: Evelyn Tsai <evelyn.tsai@mediatek.com>
Date: Thu, 18 May 2023 18:11:37 +0800
Subject: [PATCH 01/14] wifi: mt76: fix incorrect HE TX GI report
Subject: [PATCH 01/21] wifi: mt76: fix incorrect HE TX GI report
Change GI reporting source from static capability to rate-tuning module.
@@ -17,7 +17,7 @@ Signed-off-by: Benjamin Lin <benjamin-jw.lin@mediatek.com>
7 files changed, 282 insertions(+), 22 deletions(-)
diff --git a/mt76.h b/mt76.h
index 2cbea73..92acba9 100644
index 7dd59db3..bf0770a8 100644
--- a/mt76.h
+++ b/mt76.h
@@ -282,12 +282,16 @@ struct mt76_queue_ops {
@@ -38,10 +38,10 @@ index 2cbea73..92acba9 100644
MT_PHY_TYPE_HE_EXT_SU,
MT_PHY_TYPE_HE_TB,
diff --git a/mt7915/init.c b/mt7915/init.c
index eee1879..edf83c4 100644
index f1ef965f..888dbf82 100644
--- a/mt7915/init.c
+++ b/mt7915/init.c
@@ -673,6 +673,8 @@ mt7915_register_ext_phy(struct mt7915_dev *dev, struct mt7915_phy *phy)
@@ -674,6 +674,8 @@ mt7915_register_ext_phy(struct mt7915_dev *dev, struct mt7915_phy *phy)
struct mt76_phy *mphy = phy->mt76;
int ret;
@@ -50,7 +50,7 @@ index eee1879..edf83c4 100644
INIT_DELAYED_WORK(&mphy->mac_work, mt7915_mac_work);
mt7915_eeprom_parse_hw_cap(dev, phy);
@@ -1206,6 +1208,8 @@ int mt7915_register_device(struct mt7915_dev *dev)
@@ -1204,6 +1206,8 @@ int mt7915_register_device(struct mt7915_dev *dev)
dev->phy.dev = dev;
dev->phy.mt76 = &dev->mt76.phy;
dev->mt76.phy.priv = &dev->phy;
@@ -60,7 +60,7 @@ index eee1879..edf83c4 100644
INIT_DELAYED_WORK(&dev->mphy.mac_work, mt7915_mac_work);
INIT_LIST_HEAD(&dev->sta_rc_list);
diff --git a/mt7915/mac.c b/mt7915/mac.c
index 8008ce3..b915201 100644
index 8008ce3f..b9152018 100644
--- a/mt7915/mac.c
+++ b/mt7915/mac.c
@@ -180,15 +180,7 @@ static void mt7915_mac_sta_poll(struct mt7915_dev *dev)
@@ -188,7 +188,7 @@ index 8008ce3..b915201 100644
mt76_tx_status_check(mphy->dev, false);
diff --git a/mt7915/main.c b/mt7915/main.c
index b16a633..e61041d 100644
index 2624edbb..b2a6278f 100644
--- a/mt7915/main.c
+++ b/mt7915/main.c
@@ -752,6 +752,7 @@ int mt7915_mac_sta_add(struct mt76_dev *mdev, struct ieee80211_vif *vif,
@@ -220,7 +220,7 @@ index b16a633..e61041d 100644
static void mt7915_tx(struct ieee80211_hw *hw,
diff --git a/mt7915/mcu.c b/mt7915/mcu.c
index fe54a2f..7df2162 100644
index 18ba20cf..9774bcce 100644
--- a/mt7915/mcu.c
+++ b/mt7915/mcu.c
@@ -3793,6 +3793,167 @@ out:
@@ -392,7 +392,7 @@ index fe54a2f..7df2162 100644
struct cfg80211_he_bss_color *he_bss_color)
{
diff --git a/mt7915/mcu.h b/mt7915/mcu.h
index b41ac4a..8f36546 100644
index b41ac4aa..8f365461 100644
--- a/mt7915/mcu.h
+++ b/mt7915/mcu.h
@@ -152,6 +152,61 @@ struct mt7915_mcu_eeprom_info {
@@ -466,7 +466,7 @@ index b41ac4a..8f36546 100644
+};
#endif
diff --git a/mt7915/mt7915.h b/mt7915/mt7915.h
index a30d08e..aee30c7 100644
index a30d08eb..aee30c73 100644
--- a/mt7915/mt7915.h
+++ b/mt7915/mt7915.h
@@ -137,6 +137,7 @@ struct mt7915_sta {

View File

@@ -1,22 +1,21 @@
From c7b5350668962272203b878cfc1ae2754c807d56 Mon Sep 17 00:00:00 2001
From fc2e7f5745752912872c9648619bc7e677aa5063 Mon Sep 17 00:00:00 2001
From: Bo Jiao <Bo.Jiao@mediatek.com>
Date: Mon, 22 May 2023 13:49:37 +0800
Subject: [PATCH 02/14] wifi: mt76: mt7915: add pc stack dump for WM's
coredump.
Subject: [PATCH] wifi: mt76: mt7915: add pc stack dump for WM's coredump.
Signed-off-by: Bo Jiao <Bo.Jiao@mediatek.com>
---
mt76.h | 11 +++
mt76_connac_mcu.c | 9 +++
mt7915/coredump.c | 169 +++++++++++++++++++++++++++++++---------------
mt7915/coredump.h | 34 +++++++---
mt7915/coredump.c | 171 ++++++++++++++++++++++++++++++++--------------
mt7915/coredump.h | 34 ++++++---
mt7915/mac.c | 33 ++++++---
mt7915/mt7915.h | 2 +-
mt7915/regs.h | 20 ++++++
7 files changed, 207 insertions(+), 71 deletions(-)
7 files changed, 209 insertions(+), 71 deletions(-)
diff --git a/mt76.h b/mt76.h
index 92acba9..ee14425 100644
index bf0770a..4fb0787 100644
--- a/mt76.h
+++ b/mt76.h
@@ -32,6 +32,8 @@
@@ -52,7 +51,7 @@ index 92acba9..ee14425 100644
struct net_device napi_dev;
struct net_device tx_napi_dev;
diff --git a/mt76_connac_mcu.c b/mt76_connac_mcu.c
index b35acf8..1ea9798 100644
index 162c57f..4baaaac 100644
--- a/mt76_connac_mcu.c
+++ b/mt76_connac_mcu.c
@@ -2941,6 +2941,9 @@ int mt76_connac2_load_ram(struct mt76_dev *dev, const char *fw_wm,
@@ -86,7 +85,7 @@ index b35acf8..1ea9798 100644
struct mt76_connac2_patch_sec *sec;
u32 len, addr, mode;
diff --git a/mt7915/coredump.c b/mt7915/coredump.c
index 5daf225..298c1ca 100644
index 5daf225..78f4c3f 100644
--- a/mt7915/coredump.c
+++ b/mt7915/coredump.c
@@ -7,7 +7,7 @@
@@ -388,7 +387,7 @@ index 5daf225..298c1ca 100644
}
}
@@ -399,13 +458,17 @@ int mt7915_coredump_register(struct mt7915_dev *dev)
@@ -399,13 +458,19 @@ int mt7915_coredump_register(struct mt7915_dev *dev)
void mt7915_coredump_unregister(struct mt7915_dev *dev)
{
@@ -398,18 +397,20 @@ index 5daf225..298c1ca 100644
- dev->coredump.crash_data->memdump_buf_len = 0;
- }
+ int i;
+ struct mt7915_crash_data *crash_data;
+
+ for (i = 0; i < __MT76_RAM_TYPE_MAX; i++) {
+ crash_data = dev->coredump.crash_data[i];
+
+ if (!crash_data)
+ continue;
- vfree(dev->coredump.crash_data);
- dev->coredump.crash_data = NULL;
+ for (i = 0; i < __MT76_RAM_TYPE_MAX; i++) {
+ if (dev->coredump.crash_data[i]->memdump_buf) {
+ vfree(dev->coredump.crash_data[i]->memdump_buf);
+ dev->coredump.crash_data[i]->memdump_buf = NULL;
+ dev->coredump.crash_data[i]->memdump_buf_len = 0;
+ }
+ if (crash_data->memdump_buf)
+ vfree(crash_data->memdump_buf);
+
+ vfree(dev->coredump.crash_data[i]);
+ dev->coredump.crash_data[i] = NULL;
+ vfree(crash_data);
+ }
}
@@ -637,5 +638,5 @@ index 89ac8e6..7515b23 100644
+
#endif
--
2.18.0
2.45.2

View File

@@ -1,7 +1,7 @@
From 5201efd8c8527bf4f7f60c8be5d558f847b8c4e4 Mon Sep 17 00:00:00 2001
From c4f870c030edebe27120d87364a213c9f8f7089c Mon Sep 17 00:00:00 2001
From: Howard Hsu <howard-yh.hsu@mediatek.com>
Date: Thu, 13 Jul 2023 15:50:00 +0800
Subject: [PATCH 03/14] wifi: mt76: mt7915: move temperature margin check to
Subject: [PATCH 03/21] wifi: mt76: mt7915: move temperature margin check to
mt7915_thermal_temp_store()
Originally, we would reduce the 10-degree margin to the restore
@@ -17,10 +17,10 @@ Signed-off-by: Howard Hsu <howard-yh.hsu@mediatek.com>
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/mt7915/init.c b/mt7915/init.c
index edf83c4..9fe0524 100644
index 888dbf82..3b352fe9 100644
--- a/mt7915/init.c
+++ b/mt7915/init.c
@@ -83,12 +83,13 @@ static ssize_t mt7915_thermal_temp_store(struct device *dev,
@@ -84,12 +84,13 @@ static ssize_t mt7915_thermal_temp_store(struct device *dev,
mutex_lock(&phy->dev->mt76.mutex);
val = clamp_val(DIV_ROUND_CLOSEST(val, 1000), 60, 130);
@@ -38,7 +38,7 @@ index edf83c4..9fe0524 100644
return -EINVAL;
}
diff --git a/mt7915/mcu.c b/mt7915/mcu.c
index 7df2162..6e9970c 100644
index 9774bcce..dcf8782a 100644
--- a/mt7915/mcu.c
+++ b/mt7915/mcu.c
@@ -3226,8 +3226,7 @@ int mt7915_mcu_set_thermal_protect(struct mt7915_phy *phy)

View File

@@ -1,7 +1,7 @@
From 81f7cb7c452f3e3cce7818bfd0547fc57c280dce Mon Sep 17 00:00:00 2001
From 349e821372153fddd6abcd295e50753e5f040f1f Mon Sep 17 00:00:00 2001
From: Evelyn Tsai <evelyn.tsai@mediatek.com>
Date: Sat, 29 Jul 2023 04:53:47 +0800
Subject: [PATCH 04/14] wifi: mt76: mt7915: fix txpower issues
Subject: [PATCH 04/21] wifi: mt76: mt7915: fix txpower issues
---
eeprom.c | 2 +-
@@ -10,7 +10,7 @@ Subject: [PATCH 04/14] wifi: mt76: mt7915: fix txpower issues
3 files changed, 28 insertions(+), 23 deletions(-)
diff --git a/eeprom.c b/eeprom.c
index 0bc66cc..ecd09c0 100644
index 0bc66cc1..ecd09c03 100644
--- a/eeprom.c
+++ b/eeprom.c
@@ -343,7 +343,7 @@ s8 mt76_get_rate_power_limits(struct mt76_phy *phy,
@@ -23,7 +23,7 @@ index 0bc66cc..ecd09c0 100644
if (!mcs_rates)
diff --git a/mt7915/debugfs.c b/mt7915/debugfs.c
index 5780138..894e2cd 100644
index 57801388..894e2cd7 100644
--- a/mt7915/debugfs.c
+++ b/mt7915/debugfs.c
@@ -951,9 +951,9 @@ mt7915_xmit_queues_show(struct seq_file *file, void *data)
@@ -107,7 +107,7 @@ index 5780138..894e2cd 100644
reg = is_mt7915(&dev->mt76) ? MT_WF_PHY_TPC_CTRL_STAT(band) :
MT_WF_PHY_TPC_CTRL_STAT_MT7916(band);
diff --git a/mt7915/main.c b/mt7915/main.c
index e61041d..1903db4 100644
index b2a6278f..a2ad918d 100644
--- a/mt7915/main.c
+++ b/mt7915/main.c
@@ -1080,6 +1080,7 @@ mt7915_set_antenna(struct ieee80211_hw *hw, u32 tx_ant, u32 rx_ant)

View File

@@ -1,7 +1,7 @@
From d4b6226c74988932d9df8f1a6b5afbcea7effc38 Mon Sep 17 00:00:00 2001
From 7b49a07b4440843e3a85c268d3526b410ebf061e Mon Sep 17 00:00:00 2001
From: MeiChia Chiu <meichia.chiu@mediatek.com>
Date: Thu, 26 Oct 2023 21:11:05 +0800
Subject: [PATCH 05/14] wifi: mt76: mt7915: Fixed null pointer dereference
Subject: [PATCH 05/21] wifi: mt76: mt7915: Fixed null pointer dereference
issue
Without this patch, when the station is still in Authentication stage and
@@ -17,7 +17,7 @@ Signed-off-by: MeiChia Chiu <meichia.chiu@mediatek.com>
1 file changed, 7 insertions(+)
diff --git a/mt7915/main.c b/mt7915/main.c
index 1903db4..61a1dbb 100644
index a2ad918d..ec2360c3 100644
--- a/mt7915/main.c
+++ b/mt7915/main.c
@@ -1170,9 +1170,16 @@ static void mt7915_sta_rc_update(struct ieee80211_hw *hw,

View File

@@ -1,7 +1,7 @@
From dbc2448c773d6c2e8a36513a0c855ff0775f5ec4 Mon Sep 17 00:00:00 2001
From b6f567e8d4223c309134df14c577f0adee2044bf Mon Sep 17 00:00:00 2001
From: Evelyn Tsai <evelyn.tsai@mediatek.com>
Date: Sat, 18 Nov 2023 07:36:45 +0800
Subject: [PATCH 06/14] wifi: mt76: ACS channel time too long on duty channel
Subject: [PATCH 06/21] wifi: mt76: ACS channel time too long on duty channel
Issue:
There's a chance that the channel time for duty channel is zero in ACS
@@ -26,10 +26,10 @@ scan done and before restore to duty channel.
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/mac80211.c b/mac80211.c
index e7b763b..bc20f60 100644
index 94e85ed9..aee6f1e7 100644
--- a/mac80211.c
+++ b/mac80211.c
@@ -927,6 +927,7 @@ void mt76_set_channel(struct mt76_phy *phy)
@@ -928,6 +928,7 @@ void mt76_set_channel(struct mt76_phy *phy)
struct cfg80211_chan_def *chandef = &hw->conf.chandef;
bool offchannel = hw->conf.flags & IEEE80211_CONF_OFFCHANNEL;
int timeout = HZ / 5;
@@ -37,7 +37,7 @@ index e7b763b..bc20f60 100644
wait_event_timeout(dev->tx_wait, !mt76_has_tx_pending(phy), timeout);
mt76_update_survey(phy);
@@ -941,7 +942,7 @@ void mt76_set_channel(struct mt76_phy *phy)
@@ -942,7 +943,7 @@ void mt76_set_channel(struct mt76_phy *phy)
if (!offchannel)
phy->main_chan = chandef->chan;

View File

@@ -1,7 +1,7 @@
From 72e729e50f4b162db845e988275b91db2d558ef1 Mon Sep 17 00:00:00 2001
From d5a9af18ab8f2c8c6a46c10ef99f2a50e08ae9c3 Mon Sep 17 00:00:00 2001
From: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
Date: Thu, 16 Nov 2023 14:41:54 +0800
Subject: [PATCH 07/14] wifi: mt76: mt7915: add post channel switch for DFS
Subject: [PATCH 07/21] wifi: mt76: mt7915: add post channel switch for DFS
channel switching
Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
@@ -10,7 +10,7 @@ Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
1 file changed, 22 insertions(+)
diff --git a/mt7915/main.c b/mt7915/main.c
index 61a1dbb..71e0d55 100644
index ec2360c3..0d24e74c 100644
--- a/mt7915/main.c
+++ b/mt7915/main.c
@@ -736,6 +736,27 @@ mt7915_channel_switch_beacon(struct ieee80211_hw *hw,
@@ -41,7 +41,7 @@ index 61a1dbb..71e0d55 100644
int mt7915_mac_sta_add(struct mt76_dev *mdev, struct ieee80211_vif *vif,
struct ieee80211_sta *sta)
{
@@ -1701,6 +1722,7 @@ const struct ieee80211_ops mt7915_ops = {
@@ -1705,6 +1726,7 @@ const struct ieee80211_ops mt7915_ops = {
.get_txpower = mt76_get_txpower,
.set_sar_specs = mt7915_set_sar_specs,
.channel_switch_beacon = mt7915_channel_switch_beacon,

View File

@@ -1,7 +1,7 @@
From 0e87f52e13e654b144c12e3aad968fbc3da5ac1b Mon Sep 17 00:00:00 2001
From 2b85ea7a8f85c36709442d5ebab72bded582d5cd Mon Sep 17 00:00:00 2001
From: "Henry.Yen" <henry.yen@mediatek.com>
Date: Mon, 8 Jan 2024 17:19:01 +0800
Subject: [PATCH 08/14] wifi: mt76: mt7915: add support for realtime Rx rate
Subject: [PATCH 08/21] wifi: mt76: mt7915: add support for realtime Rx rate
updates
Add support for realtime Rx rate updates.
@@ -19,7 +19,7 @@ Signed-off-by: Henry.Yen <henry.yen@mediatek.com>
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/mt76_connac.h b/mt76_connac.h
index 91987bd..4871857 100644
index 445d0f0a..5028e49a 100644
--- a/mt76_connac.h
+++ b/mt76_connac.h
@@ -260,6 +260,12 @@ static inline bool is_connac_v1(struct mt76_dev *dev)
@@ -36,7 +36,7 @@ index 91987bd..4871857 100644
{
switch (mt76_chip(dev)) {
diff --git a/mt7915/main.c b/mt7915/main.c
index 71e0d55..5d31f5a 100644
index 0d24e74c..645d9779 100644
--- a/mt7915/main.c
+++ b/mt7915/main.c
@@ -1118,7 +1118,7 @@ static void mt7915_sta_statistics(struct ieee80211_hw *hw,

View File

@@ -1,7 +1,7 @@
From 995dd81673e89e6b387d256e26a0cf07e2ccb0e5 Mon Sep 17 00:00:00 2001
From bc85ec5a69b6e57eab15c50b54e0603a0829d102 Mon Sep 17 00:00:00 2001
From: MeiChia Chiu <MeiChia.Chiu@mediatek.com>
Date: Wed, 24 Jan 2024 15:04:33 +0800
Subject: [PATCH 09/14] wifi: mt76: mt7915: remove redundant argument in
Subject: [PATCH 09/21] wifi: mt76: mt7915: remove redundant argument in
add_beacon function
Remove redundant argument "changed".
@@ -15,7 +15,7 @@ Signed-off-by: MeiChia Chiu <meichia.chiu@mediatek.com>
4 files changed, 5 insertions(+), 7 deletions(-)
diff --git a/mt7915/mac.c b/mt7915/mac.c
index 0f6b806..ada3a7f 100644
index 0f6b8067..ada3a7f4 100644
--- a/mt7915/mac.c
+++ b/mt7915/mac.c
@@ -1285,8 +1285,7 @@ mt7915_update_vif_beacon(void *priv, u8 *mac, struct ieee80211_vif *vif)
@@ -29,7 +29,7 @@ index 0f6b806..ada3a7f 100644
default:
break;
diff --git a/mt7915/main.c b/mt7915/main.c
index 5d31f5a..9eeca39 100644
index 645d9779..f0491d66 100644
--- a/mt7915/main.c
+++ b/mt7915/main.c
@@ -659,7 +659,7 @@ static void mt7915_bss_info_changed(struct ieee80211_hw *hw,
@@ -51,7 +51,7 @@ index 5d31f5a..9eeca39 100644
}
diff --git a/mt7915/mcu.c b/mt7915/mcu.c
index 6e9970c..84ffe07 100644
index dcf8782a..a71562fb 100644
--- a/mt7915/mcu.c
+++ b/mt7915/mcu.c
@@ -1970,8 +1970,7 @@ mt7915_mcu_add_inband_discov(struct mt7915_dev *dev, struct ieee80211_vif *vif,
@@ -65,7 +65,7 @@ index 6e9970c..84ffe07 100644
struct mt7915_dev *dev = mt7915_hw_dev(hw);
struct mt7915_phy *phy = mt7915_hw_phy(hw);
diff --git a/mt7915/mt7915.h b/mt7915/mt7915.h
index 5cd2b33..e1801d5 100644
index 5cd2b334..e1801d5b 100644
--- a/mt7915/mt7915.h
+++ b/mt7915/mt7915.h
@@ -461,7 +461,7 @@ int mt7915_mcu_update_bss_color(struct mt7915_dev *dev, struct ieee80211_vif *vi

View File

@@ -1,7 +1,7 @@
From 9c7177584089b98089142568514af4b23e0d4e72 Mon Sep 17 00:00:00 2001
From 664d47ddcc7ed90b5d2d73b2040759bf0bf75714 Mon Sep 17 00:00:00 2001
From: Benjamin Lin <benjamin-jw.lin@mediatek.com>
Date: Mon, 29 Jan 2024 11:28:41 +0800
Subject: [PATCH 10/14] wifi: mt76: mt7915: add support for WMM PBC
Subject: [PATCH 10/21] wifi: mt76: mt7915: add support for WMM PBC
configuration
---
@@ -14,10 +14,10 @@ Subject: [PATCH 10/14] wifi: mt76: mt7915: add support for WMM PBC
6 files changed, 127 insertions(+)
diff --git a/mt76_connac_mcu.h b/mt76_connac_mcu.h
index 67be14d..1dd8244 100644
index 6873ce14..46dcd1c6 100644
--- a/mt76_connac_mcu.h
+++ b/mt76_connac_mcu.h
@@ -1025,6 +1025,7 @@ enum {
@@ -1026,6 +1026,7 @@ enum {
MCU_EXT_EVENT_ASSERT_DUMP = 0x23,
MCU_EXT_EVENT_RDD_REPORT = 0x3a,
MCU_EXT_EVENT_CSA_NOTIFY = 0x4f,
@@ -25,7 +25,7 @@ index 67be14d..1dd8244 100644
MCU_EXT_EVENT_WA_TX_STAT = 0x74,
MCU_EXT_EVENT_BCC_NOTIFY = 0x75,
MCU_EXT_EVENT_MURU_CTRL = 0x9f,
@@ -1220,6 +1221,7 @@ enum {
@@ -1222,6 +1223,7 @@ enum {
MCU_EXT_CMD_TXDPD_CAL = 0x60,
MCU_EXT_CMD_CAL_CACHE = 0x67,
MCU_EXT_CMD_RED_ENABLE = 0x68,
@@ -34,10 +34,10 @@ index 67be14d..1dd8244 100644
MCU_EXT_CMD_SET_RADAR_TH = 0x7c,
MCU_EXT_CMD_SET_RDD_PATTERN = 0x7d,
diff --git a/mt7915/init.c b/mt7915/init.c
index 9fe0524..f81a2f2 100644
index 3b352fe9..46762827 100644
--- a/mt7915/init.c
+++ b/mt7915/init.c
@@ -1221,6 +1221,8 @@ int mt7915_register_device(struct mt7915_dev *dev)
@@ -1219,6 +1219,8 @@ int mt7915_register_device(struct mt7915_dev *dev)
INIT_WORK(&dev->dump_work, mt7915_mac_dump_work);
mutex_init(&dev->dump_mutex);
@@ -47,7 +47,7 @@ index 9fe0524..f81a2f2 100644
phy2 = mt7915_alloc_ext_phy(dev);
diff --git a/mt7915/mac.c b/mt7915/mac.c
index ada3a7f..e167e7b 100644
index ada3a7f4..e167e7b6 100644
--- a/mt7915/mac.c
+++ b/mt7915/mac.c
@@ -2032,6 +2032,8 @@ void mt7915_mac_work(struct work_struct *work)
@@ -79,7 +79,7 @@ index ada3a7f..e167e7b 100644
if (++phy->stats_work_count == 10) {
diff --git a/mt7915/mcu.c b/mt7915/mcu.c
index 84ffe07..446c512 100644
index a71562fb..9126e62f 100644
--- a/mt7915/mcu.c
+++ b/mt7915/mcu.c
@@ -354,6 +354,93 @@ mt7915_mcu_rx_bcc_notify(struct mt7915_dev *dev, struct sk_buff *skb)
@@ -187,7 +187,7 @@ index 84ffe07..446c512 100644
break;
}
diff --git a/mt7915/mcu.h b/mt7915/mcu.h
index 8f36546..fa0847d 100644
index 8f365461..fa0847d5 100644
--- a/mt7915/mcu.h
+++ b/mt7915/mcu.h
@@ -329,10 +329,25 @@ enum {
@@ -217,7 +217,7 @@ index 8f36546..fa0847d 100644
};
diff --git a/mt7915/mt7915.h b/mt7915/mt7915.h
index e1801d5..89156f3 100644
index e1801d5b..89156f35 100644
--- a/mt7915/mt7915.h
+++ b/mt7915/mt7915.h
@@ -326,6 +326,9 @@ struct mt7915_dev {

View File

@@ -1,7 +1,7 @@
From 3bbf19ff34cd0d7ef3371b49101bbcaf9d068668 Mon Sep 17 00:00:00 2001
From 1587828e06491339654d20dea3382749fde143ed Mon Sep 17 00:00:00 2001
From: Peter Chiu <chui-hao.chiu@mediatek.com>
Date: Mon, 29 Jan 2024 11:02:06 +0800
Subject: [PATCH 11/14] wifi: mt76: fix tx statistics about tx retry and tx
Subject: [PATCH 11/21] wifi: mt76: fix tx statistics about tx retry and tx
fail
The tx retry and tx failed are reported by PPDU TxS.
@@ -13,7 +13,7 @@ Signed-off-by: Peter Chiu <chui-hao.chiu@mediatek.com>
2 files changed, 1 insertion(+), 4 deletions(-)
diff --git a/mt76_connac_mac.c b/mt76_connac_mac.c
index b841bf6..630c640 100644
index b841bf62..630c6402 100644
--- a/mt76_connac_mac.c
+++ b/mt76_connac_mac.c
@@ -716,9 +716,6 @@ bool mt76_connac2_mac_add_txs_skb(struct mt76_dev *dev, struct mt76_wcid *wcid,
@@ -27,7 +27,7 @@ index b841bf6..630c640 100644
skb = mt76_tx_status_skb_get(dev, wcid, pid, &list);
if (skb) {
diff --git a/mt7915/mac.c b/mt7915/mac.c
index e167e7b..a5d0b09 100644
index e167e7b6..a5d0b096 100644
--- a/mt7915/mac.c
+++ b/mt7915/mac.c
@@ -1021,7 +1021,7 @@ static void mt7915_mac_add_txs(struct mt7915_dev *dev, void *data)

View File

@@ -1,7 +1,7 @@
From fa15f886fd427e2de3e09ef5c93743e611483adf Mon Sep 17 00:00:00 2001
From 65092f531e1319ed6ddb25e982393eddccb781b5 Mon Sep 17 00:00:00 2001
From: Peter Chiu <chui-hao.chiu@mediatek.com>
Date: Mon, 29 Jan 2024 15:33:24 +0800
Subject: [PATCH 12/14] wifi: mt76: add sanity check to prevent kernel crash
Subject: [PATCH 12/21] wifi: mt76: add sanity check to prevent kernel crash
wcid may not be initialized when mac80211 calls mt76.tx and it would lead to
kernel crash.
@@ -12,7 +12,7 @@ Signed-off-by: Peter Chiu <chui-hao.chiu@mediatek.com>
1 file changed, 8 insertions(+)
diff --git a/tx.c b/tx.c
index 5cf6ede..ab42f69 100644
index 5cf6edee..ab42f69b 100644
--- a/tx.c
+++ b/tx.c
@@ -345,6 +345,14 @@ mt76_tx(struct mt76_phy *phy, struct ieee80211_sta *sta,

View File

@@ -1,15 +1,26 @@
From ef9b267adeee3803ae8ee3073d2ebcbd3e1c95f9 Mon Sep 17 00:00:00 2001
From a2f8deaaf6a97b0157e49ec476b003ef1dd234f8 Mon Sep 17 00:00:00 2001
From: Peter Chiu <chui-hao.chiu@mediatek.com>
Date: Mon, 29 Jan 2024 15:33:24 +0800
Subject: [PATCH] wifi: mt76: mt7915: limit per-band token count
Subject: [PATCH 13/21] wifi: mt76: mt7915: limit per-band token count
Add a threshold for per-band token count to prevent a band from interfering
with the other band.
Signed-off-by: Peter Chiu <chui-hao.chiu@mediatek.com>
---
mt76.h | 8 +++++++-
mt76_connac_mac.c | 2 ++
mt7915/init.c | 3 +++
mt7915/mac.c | 3 ++-
mt7921/pci_mac.c | 2 +-
mt7925/pci_mac.c | 2 +-
mt7996/init.c | 5 +++++
mt7996/mac.c | 3 ++-
tx.c | 20 ++++++++++++++++++--
9 files changed, 41 insertions(+), 7 deletions(-)
diff --git a/mt76.h b/mt76.h
index ee14425d..b83456b4 100644
index 4fb07877..05ee568c 100644
--- a/mt76.h
+++ b/mt76.h
@@ -407,6 +407,8 @@ struct mt76_txwi_cache {
@@ -38,7 +49,7 @@ index ee14425d..b83456b4 100644
spinlock_t rx_token_lock;
struct idr rx_token;
@@ -1662,7 +1667,8 @@ static inline bool mt76_queue_is_wed_rx(struct mt76_queue *q)
@@ -1674,7 +1679,8 @@ static inline bool mt76_queue_is_wed_rx(struct mt76_queue *q)
struct mt76_txwi_cache *
mt76_token_release(struct mt76_dev *dev, int token, bool *wake);
@@ -62,10 +73,10 @@ index 630c6402..a92c261d 100644
spin_unlock_bh(&dev->token_lock);
idr_destroy(&dev->token);
diff --git a/mt7915/init.c b/mt7915/init.c
index f81a2f2f..3ec9eab7 100644
index 46762827..ea9bc735 100644
--- a/mt7915/init.c
+++ b/mt7915/init.c
@@ -1225,6 +1225,8 @@ int mt7915_register_device(struct mt7915_dev *dev)
@@ -1223,6 +1223,8 @@ int mt7915_register_device(struct mt7915_dev *dev)
dev->dbdc_support = mt7915_band_config(dev);
@@ -74,7 +85,7 @@ index f81a2f2f..3ec9eab7 100644
phy2 = mt7915_alloc_ext_phy(dev);
if (IS_ERR(phy2))
return PTR_ERR(phy2);
@@ -1257,6 +1259,7 @@ int mt7915_register_device(struct mt7915_dev *dev)
@@ -1255,6 +1257,7 @@ int mt7915_register_device(struct mt7915_dev *dev)
}
dev->recovery.hw_init_done = true;
@@ -130,10 +141,10 @@ index 9fca8879..f1d615c0 100644
return id;
diff --git a/mt7996/init.c b/mt7996/init.c
index 9aa97e4a..7549a108 100644
index 283df84f..d191a7b7 100644
--- a/mt7996/init.c
+++ b/mt7996/init.c
@@ -634,6 +634,8 @@ static int mt7996_register_phy(struct mt7996_dev *dev, struct mt7996_phy *phy,
@@ -635,6 +635,8 @@ static int mt7996_register_phy(struct mt7996_dev *dev, struct mt7996_phy *phy,
mtk_wed_device_start(&dev->mt76.mmio.wed_hif2, irq_mask);
}

View File

@@ -1,7 +1,7 @@
From c3b0d9d6116df31a11d18e42e7227bf516c104f9 Mon Sep 17 00:00:00 2001
From 55dd46f8caed3d8baa6819d884a1e82c496083f5 Mon Sep 17 00:00:00 2001
From: Peter Chiu <chui-hao.chiu@mediatek.com>
Date: Thu, 14 Mar 2024 17:55:12 +0800
Subject: [PATCH 14/14] wifi: mt76: mt7915: update power on sequence
Subject: [PATCH 14/21] wifi: mt76: mt7915: update power on sequence
Update power on sequence to prevent unexpected behavior.
@@ -13,7 +13,7 @@ Signed-off-by: Peter Chiu <chui-hao.chiu@mediatek.com>
3 files changed, 48 insertions(+), 2 deletions(-)
diff --git a/mt7915/mt7915.h b/mt7915/mt7915.h
index 89156f3..74cd8ca 100644
index 89156f35..74cd8caf 100644
--- a/mt7915/mt7915.h
+++ b/mt7915/mt7915.h
@@ -329,6 +329,7 @@ struct mt7915_dev {
@@ -25,7 +25,7 @@ index 89156f3..74cd8ca 100644
enum {
diff --git a/mt7915/regs.h b/mt7915/regs.h
index 7515b23..3452a7e 100644
index 7515b23f..3452a7e9 100644
--- a/mt7915/regs.h
+++ b/mt7915/regs.h
@@ -775,6 +775,7 @@ enum offs_rev {
@@ -45,7 +45,7 @@ index 7515b23..3452a7e 100644
/* ADIE */
#define MT_ADIE_CHIP_ID 0x02c
diff --git a/mt7915/soc.c b/mt7915/soc.c
index 92d8d71..bb3468a 100644
index 92d8d710..bb3468a9 100644
--- a/mt7915/soc.c
+++ b/mt7915/soc.c
@@ -260,6 +260,7 @@ static int mt7986_wmac_consys_lockup(struct mt7915_dev *dev, bool enable)

View File

@@ -1,7 +1,8 @@
From 7b7d9e3ef08ce5526d43d657cb717b471002b087 Mon Sep 17 00:00:00 2001
From 22225104ac30af79661bf46c04e8c9523c2d22fd Mon Sep 17 00:00:00 2001
From: Benjamin Lin <benjamin-jw.lin@mediatek.com>
Date: Wed, 3 Apr 2024 14:05:59 +0800
Subject: [PATCH] wifi: mt76: mt7915: add support for IEEE 802.11 fragmentation
Subject: [PATCH 15/21] wifi: mt76: mt7915: add support for IEEE 802.11
fragmentation
Add fragmentation index into TXD.DW2 to support IEEE 802.11 fragmentation.
@@ -12,7 +13,7 @@ Signed-off-by: Benjamin Lin <benjamin-jw.lin@mediatek.com>
2 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/mt76_connac2_mac.h b/mt76_connac2_mac.h
index 5f13211..eb47653 100644
index 5f132115..eb476536 100644
--- a/mt76_connac2_mac.h
+++ b/mt76_connac2_mac.h
@@ -355,4 +355,11 @@ enum tx_port_idx {
@@ -28,7 +29,7 @@ index 5f13211..eb47653 100644
+
#endif /* __MT76_CONNAC2_MAC_H */
diff --git a/mt76_connac_mac.c b/mt76_connac_mac.c
index 630c640..d7d602a 100644
index a92c261d..170ef367 100644
--- a/mt76_connac_mac.c
+++ b/mt76_connac_mac.c
@@ -391,6 +391,7 @@ mt76_connac2_mac_write_txwi_80211(struct mt76_dev *dev, __le32 *txwi,

View File

@@ -1,7 +1,7 @@
From 239f1a1bb8eedd9f24dd3abcb801dceac7fe7ffb Mon Sep 17 00:00:00 2001
From 9db10864ac1dbdc802e563fc6d8752c8b275c302 Mon Sep 17 00:00:00 2001
From: Benjamin Lin <benjamin-jw.lin@mediatek.com>
Date: Wed, 17 Apr 2024 10:47:08 +0800
Subject: [PATCH] wifi: mt76: mt7915: add dummy HW offload of IEEE 802.11
Subject: [PATCH 16/21] wifi: mt76: mt7915: add dummy HW offload of IEEE 802.11
fragmentation
Currently, CONNAC2 series do not support encryption for fragmented Tx frames.
@@ -14,10 +14,10 @@ Signed-off-by: Benjamin Lin <benjamin-jw.lin@mediatek.com>
2 files changed, 8 insertions(+)
diff --git a/mt7915/init.c b/mt7915/init.c
index 3ec9eab..19a68c5 100644
index ea9bc735..470b198a 100644
--- a/mt7915/init.c
+++ b/mt7915/init.c
@@ -398,6 +398,7 @@ mt7915_init_wiphy(struct mt7915_phy *phy)
@@ -399,6 +399,7 @@ mt7915_init_wiphy(struct mt7915_phy *phy)
ieee80211_hw_set(hw, SUPPORTS_RX_DECAP_OFFLOAD);
ieee80211_hw_set(hw, SUPPORTS_MULTI_BSSID);
ieee80211_hw_set(hw, WANT_MONITOR_VIF);
@@ -26,7 +26,7 @@ index 3ec9eab..19a68c5 100644
hw->max_tx_fragments = 4;
diff --git a/mt7915/main.c b/mt7915/main.c
index 9eeca39..5224d83 100644
index f0491d66..f4673c8d 100644
--- a/mt7915/main.c
+++ b/mt7915/main.c
@@ -1614,6 +1614,12 @@ mt7915_twt_teardown_request(struct ieee80211_hw *hw,
@@ -42,7 +42,7 @@ index 9eeca39..5224d83 100644
static int
mt7915_set_radar_background(struct ieee80211_hw *hw,
struct cfg80211_chan_def *chandef)
@@ -1741,6 +1747,7 @@ const struct ieee80211_ops mt7915_ops = {
@@ -1745,6 +1751,7 @@ const struct ieee80211_ops mt7915_ops = {
.sta_set_decap_offload = mt7915_sta_set_decap_offload,
.add_twt_setup = mt7915_mac_add_twt_setup,
.twt_teardown_request = mt7915_twt_teardown_request,

View File

@@ -1,103 +0,0 @@
From 9c6e5082d5552ac2cefe5b4857da4b29b0c76685 Mon Sep 17 00:00:00 2001
From: Benjamin Lin <benjamin-jw.lin@mediatek.com>
Date: Thu, 25 Apr 2024 17:17:13 +0800
Subject: [PATCH] wifi: mt76: mt7915: fix inconsistent QoS mapping between SW
and HW
The mapping from IP DSCP to IEEE 802.11 user priority may be customized.
Therefore, driver needs to pass the mapping to HW, so that the QoS type of traffic can be mapped in a consistent manner for both SW and HW paths.
Signed-off-by: Benjamin Lin <benjamin-jw.lin@mediatek.com>
---
mt76_connac_mcu.h | 1 +
mt7915/main.c | 3 +++
mt7915/mcu.c | 37 +++++++++++++++++++++++++++++++++++++
mt7915/mt7915.h | 1 +
4 files changed, 42 insertions(+)
diff --git a/mt76_connac_mcu.h b/mt76_connac_mcu.h
index 1dd8244..0936c1c 100644
--- a/mt76_connac_mcu.h
+++ b/mt76_connac_mcu.h
@@ -1236,6 +1236,7 @@ enum {
MCU_EXT_CMD_GROUP_PRE_CAL_INFO = 0xab,
MCU_EXT_CMD_DPD_PRE_CAL_INFO = 0xac,
MCU_EXT_CMD_PHY_STAT_INFO = 0xad,
+ MCU_EXT_CMD_SET_QOS_MAP = 0xb4,
};
enum {
diff --git a/mt7915/main.c b/mt7915/main.c
index 5ed84bc..26f9a5a 100644
--- a/mt7915/main.c
+++ b/mt7915/main.c
@@ -646,6 +646,9 @@ static void mt7915_bss_info_changed(struct ieee80211_hw *hw,
}
}
+ if (changed & BSS_CHANGED_QOS)
+ mt7915_mcu_set_qos_map(dev, vif);
+
/* ensure that enable txcmd_mode after bss_info */
if (changed & (BSS_CHANGED_QOS | BSS_CHANGED_BEACON_ENABLED))
mt7915_mcu_set_tx(dev, vif);
diff --git a/mt7915/mcu.c b/mt7915/mcu.c
index 446c512..3d7fc6d 100644
--- a/mt7915/mcu.c
+++ b/mt7915/mcu.c
@@ -4212,3 +4212,40 @@ int mt7915_mcu_rf_regval(struct mt7915_dev *dev, u32 regidx, u32 *val, bool set)
return 0;
}
+
+int mt7915_mcu_set_qos_map(struct mt7915_dev *dev, struct ieee80211_vif *vif)
+{
+#define IP_DSCP_NUM 64
+ struct mt7915_vif *mvif = (struct mt7915_vif *)vif->drv_priv;
+ struct {
+ u8 bss_idx;
+ u8 qos_map_enable;
+ u8 __rsv[2];
+ s8 qos_map[IP_DSCP_NUM];
+ } __packed req = {
+ .bss_idx = mvif->mt76.idx,
+ .qos_map_enable = false,
+ };
+ struct cfg80211_qos_map *qos_map;
+
+ rcu_read_lock();
+ qos_map = ieee80211_get_qos_map(vif);
+ if (qos_map) {
+ struct cfg80211_dscp_range *dscp_range = qos_map->up;
+ s8 up;
+
+ req.qos_map_enable = true;
+ for (up = 0; up < IEEE80211_NUM_UPS; ++up) {
+ u8 low = dscp_range[up].low, high = dscp_range[up].high;
+
+ if (low >= IP_DSCP_NUM || high >= IP_DSCP_NUM || low > high)
+ continue;
+
+ memset(req.qos_map + low, up, high - low + 1);
+ }
+ }
+ rcu_read_unlock();
+
+ return mt76_mcu_send_msg(&dev->mt76, MCU_WA_EXT_CMD(SET_QOS_MAP), &req,
+ sizeof(req), true);
+}
diff --git a/mt7915/mt7915.h b/mt7915/mt7915.h
index 74cd8ca..66d87d7 100644
--- a/mt7915/mt7915.h
+++ b/mt7915/mt7915.h
@@ -521,6 +521,7 @@ int mt7915_mcu_fw_dbg_ctrl(struct mt7915_dev *dev, u32 module, u8 level);
void mt7915_mcu_rx_event(struct mt7915_dev *dev, struct sk_buff *skb);
void mt7915_mcu_exit(struct mt7915_dev *dev);
void mt7915_mcu_wmm_pbc_work(struct work_struct *work);
+int mt7915_mcu_set_qos_map(struct mt7915_dev *dev, struct ieee80211_vif *vif);
static inline u16 mt7915_wtbl_size(struct mt7915_dev *dev)
{
--
2.18.0

View File

@@ -1,7 +1,7 @@
From 1a9953c39a08407607e5ef9d2ca4fefa77b5eaea Mon Sep 17 00:00:00 2001
From d0d40f91383444dce590d39157d05f4922102db3 Mon Sep 17 00:00:00 2001
From: Howard Hsu <howard-yh.hsu@mediatek.com>
Date: Fri, 12 Apr 2024 11:33:08 +0800
Subject: [PATCH] wifi: mt76: mt7915: fix rx filter setting for bfee
Subject: [PATCH 17/21] wifi: mt76: mt7915: fix rx filter setting for bfee
functionality
Fix rx filter setting to prevent dropping NDPA frames. Without this
@@ -14,7 +14,7 @@ Signed-off-by: Howard Hsu <howard-yh.hsu@mediatek.com>
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/mt7915/main.c b/mt7915/main.c
index 9eeca39..6674c27 100644
index f4673c8d..f40a9007 100644
--- a/mt7915/main.c
+++ b/mt7915/main.c
@@ -564,8 +564,7 @@ static void mt7915_configure_filter(struct ieee80211_hw *hw,

View File

@@ -0,0 +1,144 @@
From 605a40dad37c685a49f2c7985e3a05806d7ac1fc Mon Sep 17 00:00:00 2001
From: Benjamin Lin <benjamin-jw.lin@mediatek.com>
Date: Thu, 25 Apr 2024 17:17:13 +0800
Subject: [PATCH] wifi: mt76: mt7915: fix inconsistent QoS mapping between SW
and HW
The mapping from IP DSCP to IEEE 802.11 user priority may be customized.
Therefore, the mapping needs to be passed to HW, so that the QoS type of traffic can be mapped in a consistent manner for both SW and HW paths.
Signed-off-by: Benjamin Lin <benjamin-jw.lin@mediatek.com>
---
mt76_connac_mcu.h | 1 +
mt7915/main.c | 59 ++++++++++++++++++++++++++++++++++++++++++++++-
mt7915/mt7915.h | 4 ++++
3 files changed, 63 insertions(+), 1 deletion(-)
diff --git a/mt76_connac_mcu.h b/mt76_connac_mcu.h
index 46dcd1c..e0255a2 100644
--- a/mt76_connac_mcu.h
+++ b/mt76_connac_mcu.h
@@ -1238,6 +1238,7 @@ enum {
MCU_EXT_CMD_GROUP_PRE_CAL_INFO = 0xab,
MCU_EXT_CMD_DPD_PRE_CAL_INFO = 0xac,
MCU_EXT_CMD_PHY_STAT_INFO = 0xad,
+ MCU_EXT_CMD_SET_QOS_MAP = 0xb4,
};
enum {
diff --git a/mt7915/main.c b/mt7915/main.c
index f40a900..71f3ad1 100644
--- a/mt7915/main.c
+++ b/mt7915/main.c
@@ -209,7 +209,7 @@ static int mt7915_add_interface(struct ieee80211_hw *hw,
struct mt7915_phy *phy = mt7915_hw_phy(hw);
struct mt76_txq *mtxq;
bool ext_phy = phy != &dev->phy;
- int idx, ret = 0;
+ int idx, i, ret = 0;
mutex_lock(&dev->mt76.mutex);
@@ -255,6 +255,12 @@ static int mt7915_add_interface(struct ieee80211_hw *hw,
mvif->sta.wcid.tx_info |= MT_WCID_TX_INFO_SET;
mt76_wcid_init(&mvif->sta.wcid);
+ /* init Default QoS map, defined in section 2.3 of RFC8325.
+ * Three most significant bits of DSCP are used as UP.
+ */
+ for (i = 0; i < IP_DSCP_NUM; ++i)
+ mvif->qos_map[i] = i >> 3;
+
mt7915_mac_wtbl_update(dev, idx,
MT_WTBL_UPDATE_ADM_COUNT_CLEAR);
@@ -1619,6 +1625,56 @@ mt7915_set_frag_threshold(struct ieee80211_hw *hw, u32 val)
return 0;
}
+static int
+mt7915_set_qos_map(struct ieee80211_vif *vif, struct cfg80211_qos_map *usr_qos_map)
+{
+ struct mt7915_vif *mvif = (struct mt7915_vif *)vif->drv_priv;
+ struct {
+ u8 bss_idx;
+ u8 qos_map_enable;
+ u8 __rsv[2];
+ s8 qos_map[IP_DSCP_NUM];
+ } __packed req = {
+ .bss_idx = mvif->mt76.idx,
+ .qos_map_enable = usr_qos_map ? true : false,
+ };
+
+ /* Prevent access to members of mt7915_vif before its initialization. */
+ if (!mvif->phy)
+ return -EPERM;
+
+ if (usr_qos_map) {
+ struct cfg80211_dscp_exception *exception = usr_qos_map->dscp_exception;
+ struct cfg80211_dscp_range *range = usr_qos_map->up;
+ s8 i;
+
+ /* Default QoS map, defined in section 2.3 of RFC8325.
+ * Three most significant bits of DSCP are used as UP.
+ */
+ for (i = 0; i < IP_DSCP_NUM; ++i)
+ req.qos_map[i] = i >> 3;
+
+ /* User-defined QoS map */
+ for (i = 0; i < IEEE80211_NUM_UPS; ++i) {
+ u8 low = range[i].low, high = range[i].high;
+
+ if (low < IP_DSCP_NUM && high < IP_DSCP_NUM && low <= high)
+ memset(req.qos_map + low, i, high - low + 1);
+ }
+
+ for (i = 0; i < usr_qos_map->num_des; ++i) {
+ u8 dscp = exception[i].dscp, up = exception[i].up;
+
+ if (dscp < IP_DSCP_NUM && up < IEEE80211_NUM_UPS)
+ req.qos_map[dscp] = up;
+ }
+ memcpy(mvif->qos_map, req.qos_map, IP_DSCP_NUM);
+ }
+
+ return mt76_mcu_send_msg(&mvif->phy->dev->mt76, MCU_WA_EXT_CMD(SET_QOS_MAP),
+ &req, sizeof(req), true);
+}
+
static int
mt7915_set_radar_background(struct ieee80211_hw *hw,
struct cfg80211_chan_def *chandef)
@@ -1751,6 +1807,7 @@ const struct ieee80211_ops mt7915_ops = {
.add_twt_setup = mt7915_mac_add_twt_setup,
.twt_teardown_request = mt7915_twt_teardown_request,
.set_frag_threshold = mt7915_set_frag_threshold,
+ .set_qos_map = mt7915_set_qos_map,
CFG80211_TESTMODE_CMD(mt76_testmode_cmd)
CFG80211_TESTMODE_DUMP(mt76_testmode_dump)
#ifdef CONFIG_MAC80211_DEBUGFS
diff --git a/mt7915/mt7915.h b/mt7915/mt7915.h
index 74cd8ca..bfac851 100644
--- a/mt7915/mt7915.h
+++ b/mt7915/mt7915.h
@@ -83,6 +83,8 @@
#define MT7915_CRIT_TEMP 110
#define MT7915_MAX_TEMP 120
+#define IP_DSCP_NUM 64
+
struct mt7915_vif;
struct mt7915_sta;
struct mt7915_dfs_pulse;
@@ -175,6 +177,8 @@ struct mt7915_vif {
struct ieee80211_tx_queue_params queue_params[IEEE80211_NUM_ACS];
struct cfg80211_bitrate_mask bitrate_mask;
+ /* QoS map support */
+ u8 qos_map[IP_DSCP_NUM];
};
/* crash-dump */
--
2.45.2

View File

@@ -0,0 +1,58 @@
From d189b10ff8b7cd3d6fdabde17e8476bfe66466cc Mon Sep 17 00:00:00 2001
From: Howard Hsu <howard-yh.hsu@mediatek.com>
Date: Fri, 19 Apr 2024 15:43:23 +0800
Subject: [PATCH 19/21] wifi: mt76: mt7915: adjust rx filter
Adjust rx filter setting to drop the packet that we do not need to
receive.
Fixes: e57b7901469f ("mt76: add mac80211 driver for MT7915 PCIe-based chipsets")
Signed-off-by: Howard Hsu <howard-yh.hsu@mediatek.com>
---
mt7915/main.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/mt7915/main.c b/mt7915/main.c
index 3a8b9404..0d2614e1 100644
--- a/mt7915/main.c
+++ b/mt7915/main.c
@@ -489,7 +489,8 @@ static int mt7915_config(struct ieee80211_hw *hw, u32 changed)
rxfilter |= MT_WF_RFCR_DROP_OTHER_UC;
dev->monitor_mask &= ~BIT(band);
} else {
- rxfilter &= ~MT_WF_RFCR_DROP_OTHER_UC;
+ rxfilter &= ~(MT_WF_RFCR_DROP_A2_BSSID |
+ MT_WF_RFCR_DROP_OTHER_UC);
dev->monitor_mask |= BIT(band);
}
@@ -552,13 +553,14 @@ static void mt7915_configure_filter(struct ieee80211_hw *hw,
MT_WF_RFCR_DROP_MCAST |
MT_WF_RFCR_DROP_BCAST |
MT_WF_RFCR_DROP_DUPLICATE |
- MT_WF_RFCR_DROP_A2_BSSID |
MT_WF_RFCR_DROP_UNWANTED_CTL |
MT_WF_RFCR_DROP_STBC_MULTI);
+ phy->rxfilter |= MT_WF_RFCR_DROP_VERSION;
MT76_FILTER(OTHER_BSS, MT_WF_RFCR_DROP_OTHER_TIM |
MT_WF_RFCR_DROP_A3_MAC |
- MT_WF_RFCR_DROP_A3_BSSID);
+ MT_WF_RFCR_DROP_A3_BSSID |
+ MT_WF_RFCR_DROP_A2_BSSID);
MT76_FILTER(FCSFAIL, MT_WF_RFCR_DROP_FCSFAIL);
@@ -569,7 +571,8 @@ static void mt7915_configure_filter(struct ieee80211_hw *hw,
*total_flags = flags;
rxfilter = phy->rxfilter;
if (hw->conf.flags & IEEE80211_CONF_MONITOR)
- rxfilter &= ~MT_WF_RFCR_DROP_OTHER_UC;
+ rxfilter &= ~(MT_WF_RFCR_DROP_A2_BSSID |
+ MT_WF_RFCR_DROP_OTHER_UC);
else
rxfilter |= MT_WF_RFCR_DROP_OTHER_UC;
mt76_wr(dev, MT_WF_RFCR(band), rxfilter);
--
2.18.0

View File

@@ -1,8 +1,8 @@
From eaa1c8b40685b56c6298c85cb0a44c7b97c62e8c Mon Sep 17 00:00:00 2001
From cab458a1d2d91784aa28bacfd0b6649fd5c3f740 Mon Sep 17 00:00:00 2001
From: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
Date: Wed, 20 Sep 2023 11:10:57 +0800
Subject: [PATCH 1038/1053] wifi: mt76: mt7915: add additional chain signal
info to station dump
Subject: [PATCH 20/21] wifi: mt76: mt7915: add additional chain signal info to
station dump
Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
---
@@ -10,10 +10,10 @@ Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mt7915/mac.c b/mt7915/mac.c
index b0ddb10..9a49375 100644
index 4604a682..95c794a3 100644
--- a/mt7915/mac.c
+++ b/mt7915/mac.c
@@ -442,7 +442,7 @@ mt7915_mac_fill_rx(struct mt7915_dev *dev, struct sk_buff *skb,
@@ -437,7 +437,7 @@ mt7915_mac_fill_rx(struct mt7915_dev *dev, struct sk_buff *skb,
if (v0 & MT_PRXV_HT_AD_CODE)
status->enc_flags |= RX_ENC_FLAG_LDPC;

View File

@@ -1,7 +1,7 @@
From 1e641bcbd21de95f4719063eecde6df206e2cf55 Mon Sep 17 00:00:00 2001
From 9976288a87664bacf514902869be38215da1d8b1 Mon Sep 17 00:00:00 2001
From: Henry Yen <henry.yen@mediatek.com>
Date: Wed, 6 Mar 2024 12:42:06 +0800
Subject: [PATCH 1050/1053] wifi: mt76: mt7915: remove unnecessary register
Subject: [PATCH 21/21] wifi: mt76: mt7915: remove unnecessary register
settings
Remove unnecessary register settings from the driver layer,
@@ -9,15 +9,15 @@ and let firmware take over the configuration control.
Signed-off-by: Henry.Yen <henry.yen@mediatek.com>
---
mt7915/init.c | 35 -----------------------------------
mt7915/init.c | 30 ------------------------------
mt7915/mac.c | 43 +------------------------------------------
2 files changed, 1 insertion(+), 77 deletions(-)
2 files changed, 1 insertion(+), 72 deletions(-)
diff --git a/mt7915/init.c b/mt7915/init.c
index 26ae63f..9ffeca5 100644
index 470b198a..84c69a88 100644
--- a/mt7915/init.c
+++ b/mt7915/init.c
@@ -488,30 +488,6 @@ mt7915_mac_init_band(struct mt7915_dev *dev, u8 band)
@@ -476,30 +476,6 @@ mt7915_mac_init_band(struct mt7915_dev *dev, u8 band)
{
u32 mask, set;
@@ -48,19 +48,19 @@ index 26ae63f..9ffeca5 100644
/* mt7915: disable rx rate report by default due to hw issues */
mt76_clear(dev, MT_DMA_DCR0(band), MT_DMA_DCR0_RXD_G5_EN);
@@ -614,23 +590,12 @@ mt7915_init_led_mux(struct mt7915_dev *dev)
@@ -602,23 +578,17 @@ mt7915_init_led_mux(struct mt7915_dev *dev)
void mt7915_mac_init(struct mt7915_dev *dev)
{
int i;
- u32 rx_len = is_mt7915(&dev->mt76) ? 0x400 : 0x680;
-
- /* config pse qid6 wfdma port selection */
- if (!is_mt7915(&dev->mt76) && dev->hif2)
- mt76_rmw(dev, MT_WF_PP_TOP_RXQ_WFDMA_CF_5, 0,
- MT_WF_PP_TOP_RXQ_QID6_WFDMA_HIF_SEL_MASK);
-
- mt76_rmw_field(dev, MT_MDP_DCR1, MT_MDP_DCR1_MAX_RX_LEN, rx_len);
/* config pse qid6 wfdma port selection */
if (!is_mt7915(&dev->mt76) && dev->hif2)
mt76_rmw(dev, MT_WF_PP_TOP_RXQ_WFDMA_CF_5, 0,
MT_WF_PP_TOP_RXQ_QID6_WFDMA_HIF_SEL_MASK);
- mt76_rmw_field(dev, MT_MDP_DCR1, MT_MDP_DCR1_MAX_RX_LEN, rx_len);
-
if (!is_mt7915(&dev->mt76))
mt76_clear(dev, MT_MDP_DCR2, MT_MDP_DCR2_RX_TRANS_SHORT);
else
@@ -73,10 +73,10 @@ index 26ae63f..9ffeca5 100644
mt7915_mac_wtbl_update(dev, i,
MT_WTBL_UPDATE_ADM_COUNT_CLEAR);
diff --git a/mt7915/mac.c b/mt7915/mac.c
index e9f50a3..c84b957 100644
index 95c794a3..1c5ab41f 100644
--- a/mt7915/mac.c
+++ b/mt7915/mac.c
@@ -1202,61 +1202,20 @@ void mt7915_mac_reset_counters(struct mt7915_phy *phy)
@@ -1149,61 +1149,20 @@ void mt7915_mac_reset_counters(struct mt7915_phy *phy)
void mt7915_mac_set_timing(struct mt7915_phy *phy)
{

View File

@@ -0,0 +1,163 @@
From 40d175e8ad31eb956071998bc3801538020febf0 Mon Sep 17 00:00:00 2001
From: Benjamin Lin <benjamin-jw.lin@mediatek.com>
Date: Fri, 2 Aug 2024 14:22:45 +0800
Subject: [PATCH] wifi: mt76: mt7915: enable PPDU TXS to update data-frame TX
rate
When WED is on, only use data-frame TXS to update station's TX rate.
When WED is off, enable PPDU TXS to update TX rate.
Signed-off-by: Benjamin Lin <benjamin-jw.lin@mediatek.com>
---
mt76_connac.h | 2 +-
mt76_connac_mac.c | 10 ++++++----
mt7915/init.c | 3 +--
mt7915/mac.c | 13 +------------
mt7915/main.c | 1 -
mt7915/mt7915.h | 1 -
tx.c | 5 ++---
7 files changed, 11 insertions(+), 24 deletions(-)
diff --git a/mt76_connac.h b/mt76_connac.h
index 5028e49..355b506 100644
--- a/mt76_connac.h
+++ b/mt76_connac.h
@@ -436,7 +436,7 @@ u16 mt76_connac2_mac_tx_rate_val(struct mt76_phy *mphy,
struct ieee80211_vif *vif,
bool beacon, bool mcast);
bool mt76_connac2_mac_fill_txs(struct mt76_dev *dev, struct mt76_wcid *wcid,
- __le32 *txs_data);
+ int pid, __le32 *txs_data);
bool mt76_connac2_mac_add_txs_skb(struct mt76_dev *dev, struct mt76_wcid *wcid,
int pid, __le32 *txs_data);
void mt76_connac2_mac_decode_he_radiotap(struct mt76_dev *dev,
diff --git a/mt76_connac_mac.c b/mt76_connac_mac.c
index 170ef36..ead859a 100644
--- a/mt76_connac_mac.c
+++ b/mt76_connac_mac.c
@@ -594,7 +594,7 @@ void mt76_connac2_mac_write_txwi(struct mt76_dev *dev, __le32 *txwi,
EXPORT_SYMBOL_GPL(mt76_connac2_mac_write_txwi);
bool mt76_connac2_mac_fill_txs(struct mt76_dev *dev, struct mt76_wcid *wcid,
- __le32 *txs_data)
+ int pid, __le32 *txs_data)
{
struct mt76_sta_stats *stats = &wcid->stats;
struct ieee80211_supported_band *sband;
@@ -606,8 +606,7 @@ bool mt76_connac2_mac_fill_txs(struct mt76_dev *dev, struct mt76_wcid *wcid,
txs = le32_to_cpu(txs_data[0]);
/* PPDU based reporting */
- if (mtk_wed_device_active(&dev->mmio.wed) &&
- FIELD_GET(MT_TXS0_TXS_FORMAT, txs) > 1) {
+ if (FIELD_GET(MT_TXS0_TXS_FORMAT, txs) > 1) {
stats->tx_bytes +=
le32_get_bits(txs_data[5], MT_TXS5_MPDU_TX_BYTE) -
le32_get_bits(txs_data[7], MT_TXS7_MPDU_RETRY_BYTE);
@@ -628,6 +627,9 @@ bool mt76_connac2_mac_fill_txs(struct mt76_dev *dev, struct mt76_wcid *wcid,
}
}
+ if (pid != MT_PACKET_ID_WED)
+ return true;
+
txrate = FIELD_GET(MT_TXS0_TX_RATE, txs);
rate.mcs = FIELD_GET(MT_TX_RATE_IDX, txrate);
@@ -737,7 +739,7 @@ bool mt76_connac2_mac_add_txs_skb(struct mt76_dev *dev, struct mt76_wcid *wcid,
!!(info->flags & IEEE80211_TX_STAT_ACK);
info->status.rates[0].idx = -1;
- mt76_connac2_mac_fill_txs(dev, wcid, txs_data);
+ mt76_connac2_mac_fill_txs(dev, wcid, pid, txs_data);
mt76_tx_status_skb_done(dev, skb, &list);
}
mt76_tx_status_unlock(dev, &list);
diff --git a/mt7915/init.c b/mt7915/init.c
index 84c69a8..ebf5500 100644
--- a/mt7915/init.c
+++ b/mt7915/init.c
@@ -505,8 +505,7 @@ mt7915_mac_init_band(struct mt7915_dev *dev, u8 band)
/* MT_TXD5_TX_STATUS_HOST (MPDU format) has higher priority than
* MT_AGG_ACR_PPDU_TXS2H (PPDU format) even though ACR bit is set.
*/
- if (mtk_wed_device_active(&dev->mt76.mmio.wed))
- mt76_set(dev, MT_AGG_ACR4(band), MT_AGG_ACR_PPDU_TXS2H);
+ mt76_set(dev, MT_AGG_ACR4(band), MT_AGG_ACR_PPDU_TXS2H);
}
static void
diff --git a/mt7915/mac.c b/mt7915/mac.c
index 1c5ab41..9ac85df 100644
--- a/mt7915/mac.c
+++ b/mt7915/mac.c
@@ -748,17 +748,6 @@ int mt7915_tx_prepare_skb(struct mt76_dev *mdev, void *txwi_ptr,
if (!wcid)
wcid = &dev->mt76.global_wcid;
- if (sta) {
- struct mt7915_sta *msta;
-
- msta = (struct mt7915_sta *)sta->drv_priv;
-
- if (time_after(jiffies, msta->jiffies + HZ / 4)) {
- info->flags |= IEEE80211_TX_CTL_REQ_TX_STATUS;
- msta->jiffies = jiffies;
- }
- }
-
t = (struct mt76_txwi_cache *)(txwi + mdev->drv->txwi_size);
t->skb = tx_info->skb;
@@ -1023,7 +1012,7 @@ static void mt7915_mac_add_txs(struct mt7915_dev *dev, void *data)
msta = container_of(wcid, struct mt7915_sta, wcid);
if (le32_get_bits(txs_data[0], MT_TXS0_TXS_FORMAT) == MT_TXS_PPDU_FMT)
- mt76_connac2_mac_fill_txs(&dev->mt76, wcid, txs_data);
+ mt76_connac2_mac_fill_txs(&dev->mt76, wcid, pid, txs_data);
else
mt76_connac2_mac_add_txs_skb(&dev->mt76, wcid, pid, txs_data);
diff --git a/mt7915/main.c b/mt7915/main.c
index 73a7153..fc45789 100644
--- a/mt7915/main.c
+++ b/mt7915/main.c
@@ -787,7 +787,6 @@ int mt7915_mac_sta_add(struct mt76_dev *mdev, struct ieee80211_vif *vif,
msta->wcid.idx = idx;
msta->wcid.phy_idx = ext_phy;
msta->wcid.tx_info |= MT_WCID_TX_INFO_SET;
- msta->jiffies = jiffies;
ewma_avg_signal_init(&msta->avg_ack_signal);
diff --git a/mt7915/mt7915.h b/mt7915/mt7915.h
index bfac851..77626e7 100644
--- a/mt7915/mt7915.h
+++ b/mt7915/mt7915.h
@@ -146,7 +146,6 @@ struct mt7915_sta {
struct ewma_avg_signal avg_ack_signal;
unsigned long changed;
- unsigned long jiffies;
struct mt76_connac_sta_key_conf bip;
struct {
diff --git a/tx.c b/tx.c
index 0fdf7d8..1fee6ff 100644
--- a/tx.c
+++ b/tx.c
@@ -136,9 +136,8 @@ mt76_tx_status_skb_add(struct mt76_dev *dev, struct mt76_wcid *wcid,
if (!(info->flags & (IEEE80211_TX_CTL_REQ_TX_STATUS |
IEEE80211_TX_CTL_RATE_CTRL_PROBE))) {
- if (mtk_wed_device_active(&dev->mmio.wed) &&
- ((info->flags & IEEE80211_TX_CTL_HW_80211_ENCAP) ||
- ieee80211_is_data(hdr->frame_control)))
+ if (info->flags & IEEE80211_TX_CTL_HW_80211_ENCAP ||
+ ieee80211_is_data(hdr->frame_control))
return MT_PACKET_ID_WED;
return MT_PACKET_ID_NO_SKB;
--
2.45.2

View File

@@ -0,0 +1,77 @@
From b5c9fa8bc514d8db22a93c3d4d3e686b9b34a52d Mon Sep 17 00:00:00 2001
From: Rex Lu <rex.lu@mediatek.com>
Date: Wed, 21 Aug 2024 20:13:37 +0800
Subject: [PATCH] wifi: mt76: mt7915: fix add ba issue on tid not equal to zero
case
Signed-off-by: Rex Lu <rex.lu@mediatek.com>
---
mt76.h | 6 ++++++
mt7915/main.c | 7 +++++++
2 files changed, 13 insertions(+)
diff --git a/mt76.h b/mt76.h
index bdc9a9b..592c3cd 100644
--- a/mt76.h
+++ b/mt76.h
@@ -52,6 +52,8 @@
#define MT_WED_RRO_Q_MSDU_PG(_n) __MT_WED_RRO_Q(MT76_WED_RRO_Q_MSDU_PG, _n)
#define MT_WED_RRO_Q_IND __MT_WED_RRO_Q(MT76_WED_RRO_Q_IND, 0)
+#define AMPDU_ADDBA_SUCC_SHFT IEEE80211_NUM_TIDS
+
struct mt76_dev;
struct mt76_phy;
struct mt76_wcid;
@@ -356,6 +358,10 @@ struct mt76_wcid {
int inactive_count;
struct rate_info rate;
+ /*
+ *Bit 0 - 15: ADDBA of TID n started
+ *Bit 16 - 31: ADDBA of TID n succeeded
+ */
unsigned long ampdu_state;
u16 idx;
diff --git a/mt7915/main.c b/mt7915/main.c
index 73a7153..35b97db 100644
--- a/mt7915/main.c
+++ b/mt7915/main.c
@@ -907,12 +907,14 @@ mt7915_ampdu_action(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
case IEEE80211_AMPDU_TX_OPERATIONAL:
mtxq->aggr = true;
mtxq->send_bar = false;
+ set_bit((tid + AMPDU_ADDBA_SUCC_SHFT), &msta->wcid.ampdu_state);
ret = mt7915_mcu_add_tx_ba(dev, params, true);
break;
case IEEE80211_AMPDU_TX_STOP_FLUSH:
case IEEE80211_AMPDU_TX_STOP_FLUSH_CONT:
mtxq->aggr = false;
clear_bit(tid, &msta->wcid.ampdu_state);
+ clear_bit((tid + AMPDU_ADDBA_SUCC_SHFT), &msta->wcid.ampdu_state);
ret = mt7915_mcu_add_tx_ba(dev, params, false);
break;
case IEEE80211_AMPDU_TX_START:
@@ -922,6 +924,7 @@ mt7915_ampdu_action(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
case IEEE80211_AMPDU_TX_STOP_CONT:
mtxq->aggr = false;
clear_bit(tid, &msta->wcid.ampdu_state);
+ clear_bit((tid + AMPDU_ADDBA_SUCC_SHFT), &msta->wcid.ampdu_state);
ret = mt7915_mcu_add_tx_ba(dev, params, false);
ieee80211_stop_tx_ba_cb_irqsafe(vif, sta->addr, tid);
break;
@@ -1747,6 +1750,10 @@ mt7915_net_fill_forward_path(struct ieee80211_hw *hw,
if (msta->wcid.idx > 0xff)
return -EIO;
+ if (!test_bit((mvif->qos_map[path->mtk_wdma.tid >> 2] + AMPDU_ADDBA_SUCC_SHFT),
+ &msta->wcid.ampdu_state))
+ return -EAGAIN;
+
path->type = DEV_PATH_MTK_WDMA;
path->dev = ctx->dev;
path->mtk_wdma.wdma_idx = wed->wdma_idx;
--
2.45.2

View File

@@ -0,0 +1,101 @@
From 721b1a5bd935b16ff933ace32a6da36bec473e19 Mon Sep 17 00:00:00 2001
From: Rex Lu <rex.lu@mediatek.com>
Date: Wed, 11 Dec 2024 11:41:49 +0800
Subject: [PATCH] wifi: mt76: mt7915: refactor check for TX BA sesstion status
Signed-off-by: Rex Lu <rex.lu@mediatek.com>
---
mt76.h | 3 ++-
mt76_connac_mac.c | 41 +++++++++++++++++++++++++++++++----------
2 files changed, 33 insertions(+), 11 deletions(-)
diff --git a/mt76.h b/mt76.h
index 592c3cd..fbddd7e 100644
--- a/mt76.h
+++ b/mt76.h
@@ -348,6 +348,7 @@ DECLARE_EWMA(signal, 10, 8);
#define MT_WCID_TX_INFO_TXPWR_ADJ GENMASK(25, 18)
#define MT_WCID_TX_INFO_SET BIT(31)
+#define ADDBA_RETRY_PERIOD (5 * HZ)
struct mt76_wcid {
struct mt76_rx_tid __rcu *aggr[IEEE80211_NUM_TIDS];
@@ -363,7 +364,7 @@ struct mt76_wcid {
*Bit 16 - 31: ADDBA of TID n succeeded
*/
unsigned long ampdu_state;
-
+ unsigned long last_addba_req_time[IEEE80211_NUM_TIDS];
u16 idx;
u8 hw_key_idx;
u8 hw_key_idx2;
diff --git a/mt76_connac_mac.c b/mt76_connac_mac.c
index 4d24cc6..c250f9f 100644
--- a/mt76_connac_mac.c
+++ b/mt76_connac_mac.c
@@ -474,6 +474,34 @@ mt76_connac2_mac_write_txwi_80211(struct mt76_dev *dev, __le32 *txwi,
}
}
+static void
+mt76_check_tx_ba_status(struct mt76_wcid *wcid, u8 tid)
+{
+ struct ieee80211_sta *sta;
+
+ if (!wcid)
+ return;
+
+ sta = wcid_to_sta(wcid);
+
+ if (!sta ||
+ !(sta->ht_cap.ht_supported || sta->he_cap.has_he))
+ return;
+
+ if (test_bit(tid, &wcid->ampdu_state)) {
+ ieee80211_refresh_tx_agg_session_timer(sta, tid);
+ return;
+ }
+
+ if (!wcid->last_addba_req_time[tid] ||
+ time_after(jiffies, wcid->last_addba_req_time[tid] + ADDBA_RETRY_PERIOD)) {
+ set_bit(tid, &wcid->ampdu_state);
+ if (ieee80211_start_tx_ba_session(sta, tid, 0) < 0)
+ clear_bit(tid, &wcid->ampdu_state);
+ wcid->last_addba_req_time[tid] = jiffies;
+ }
+}
+
void mt76_connac2_mac_write_txwi(struct mt76_dev *dev, __le32 *txwi,
struct sk_buff *skb, struct mt76_wcid *wcid,
struct ieee80211_key_conf *key, int pid,
@@ -617,14 +645,8 @@ bool mt76_connac2_mac_fill_txs(struct mt76_dev *dev, struct mt76_wcid *wcid,
le32_get_bits(txs_data[7], MT_TXS7_MPDU_RETRY_CNT);
if (wcid->sta) {
- struct ieee80211_sta *sta;
- u8 tid;
-
- sta = container_of((void *)wcid, struct ieee80211_sta,
- drv_priv);
- tid = FIELD_GET(MT_TXS0_TID, txs);
-
- ieee80211_refresh_tx_agg_session_timer(sta, tid);
+ if (!le32_get_bits(txs_data[0], MT_TXS0_FIXED_RATE))
+ mt76_check_tx_ba_status(wcid, FIELD_GET(MT_TXS0_TID, txs));
}
}
@@ -1134,8 +1156,7 @@ void mt76_connac2_tx_check_aggr(struct ieee80211_sta *sta, __le32 *txwi)
return;
wcid = (struct mt76_wcid *)sta->drv_priv;
- if (!test_and_set_bit(tid, &wcid->ampdu_state))
- ieee80211_start_tx_ba_session(sta, tid, 0);
+ mt76_check_tx_ba_status(wcid, tid);
}
EXPORT_SYMBOL_GPL(mt76_connac2_tx_check_aggr);
--
2.45.2

View File

@@ -0,0 +1,38 @@
From bd1f21a77b832ff70db23751789006090a4c5cd8 Mon Sep 17 00:00:00 2001
From: Peter Chiu <chui-hao.chiu@mediatek.com>
Date: Mon, 14 Oct 2024 10:33:39 +0800
Subject: [PATCH] wifi: mt76: mt7915: delete twt flow before remove stations
Send a mcu command to FW to remove twt flows before removing stations.
If we remove stations first, twt flows may not be remove correctly.
Signed-off-by: Peter Chiu <chui-hao.chiu@mediatek.com>
---
mt7915/main.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/mt7915/main.c b/mt7915/main.c
index 35b97db7..a7aba999 100644
--- a/mt7915/main.c
+++ b/mt7915/main.c
@@ -812,14 +812,14 @@ void mt7915_mac_sta_remove(struct mt76_dev *mdev, struct ieee80211_vif *vif,
struct mt7915_phy *phy = msta->vif->phy;
int i;
+ for (i = 0; i < ARRAY_SIZE(msta->twt.flow); i++)
+ mt7915_mac_twt_teardown_flow(dev, msta, i);
+
mt7915_mcu_add_sta(dev, vif, sta, false);
mt7915_mac_wtbl_update(dev, msta->wcid.idx,
MT_WTBL_UPDATE_ADM_COUNT_CLEAR);
- for (i = 0; i < ARRAY_SIZE(msta->twt.flow); i++)
- mt7915_mac_twt_teardown_flow(dev, msta, i);
-
spin_lock_bh(&mdev->sta_poll_lock);
if (!list_empty(&msta->wcid.poll_list))
list_del_init(&msta->wcid.poll_list);
--
2.45.2

View File

@@ -0,0 +1,27 @@
From 4efdf548d28d3afbc367e2cbe365107db1869690 Mon Sep 17 00:00:00 2001
From: Peter Chiu <chui-hao.chiu@mediatek.com>
Date: Wed, 16 Oct 2024 08:41:49 +0800
Subject: [PATCH] mtk: mt76: do not report ACK when TXS is lost
Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
---
tx.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/tx.c b/tx.c
index d6054ab6..b3d76692 100644
--- a/tx.c
+++ b/tx.c
@@ -100,7 +100,8 @@ __mt76_tx_status_skb_done(struct mt76_dev *dev, struct sk_buff *skb, u8 flags,
return;
/* Tx status can be unreliable. if it fails, mark the frame as ACKed */
- if (flags & MT_TX_CB_TXS_FAILED) {
+ if ((flags & MT_TX_CB_TXS_FAILED) &&
+ (dev->drv->drv_flags & MT_DRV_SW_RX_AIRTIME)) { /* Only CE chips do so */
info->status.rates[0].count = 0;
info->status.rates[0].idx = -1;
info->flags |= IEEE80211_TX_STAT_ACK;
--
2.45.2

View File

@@ -0,0 +1,30 @@
From 74d7c4a6d5ae3bb7cc5c04d74b713682442724ab Mon Sep 17 00:00:00 2001
From: Peter Chiu <chui-hao.chiu@mediatek.com>
Date: Tue, 26 Nov 2024 13:29:18 +0800
Subject: [PATCH] wifi: mt76: mt7915: fix register mapping
Bypass the entry when ofs is equal to dev->reg.map[i].size.
Without this patch, it would get incorrect register mapping when the
CR address is located at the boundary of an entry.
Signed-off-by: Peter Chiu <chui-hao.chiu@mediatek.com>
---
mt7915/mmio.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mt7915/mmio.c b/mt7915/mmio.c
index 1ea91676..7a4268bb 100644
--- a/mt7915/mmio.c
+++ b/mt7915/mmio.c
@@ -490,7 +490,7 @@ static u32 __mt7915_reg_addr(struct mt7915_dev *dev, u32 addr)
continue;
ofs = addr - dev->reg.map[i].phys;
- if (ofs > dev->reg.map[i].size)
+ if (ofs >= dev->reg.map[i].size)
continue;
return dev->reg.map[i].maps + ofs;
--
2.45.2

View File

@@ -0,0 +1,61 @@
From 1aead9dad4c2eb2592332b402f23f43f4ee79207 Mon Sep 17 00:00:00 2001
From: Peter Chiu <chui-hao.chiu@mediatek.com>
Date: Thu, 22 May 2025 15:42:50 +0800
Subject: [PATCH] wifi: mt76: mt7915: update adie patch in mt7986 power on
sequence
Update adie init CR.
Signed-off-by: Peter Chiu <chui-hao.chiu@mediatek.com>
diff --git a/mt7915/regs.h b/mt7915/regs.h
index 3452a7e9..28ded58c 100644
--- a/mt7915/regs.h
+++ b/mt7915/regs.h
@@ -941,6 +941,7 @@ enum offs_rev {
#define MT_ADIE_XTAL_TRIM1_40M_OSC 0x399
#define MT_ADIE_WRI_CK_SEL 0x4ac
#define MT_ADIE_RG_STRAP_PIN_IN 0x4fc
+#define MT_ADIE_RG_TOP_XO_08 0x600
#define MT_ADIE_XTAL_C1 0x654
#define MT_ADIE_XTAL_C2 0x658
#define MT_ADIE_RG_XO_01 0x65c
diff --git a/mt7915/soc.c b/mt7915/soc.c
index bb3468a9..c613e77a 100644
--- a/mt7915/soc.c
+++ b/mt7915/soc.c
@@ -506,6 +506,7 @@ static int mt798x_wmac_adie_patch_7976(struct mt7915_dev *dev, u8 adie)
{
u32 id, version, rg_xo_01, rg_xo_03;
int ret;
+ bool need_adie_patch = false;
ret = mt76_wmac_spi_read(dev, adie, MT_ADIE_CHIP_ID, &id);
if (ret)
@@ -525,6 +526,7 @@ static int mt798x_wmac_adie_patch_7976(struct mt7915_dev *dev, u8 adie)
if (is_mt7981(&dev->mt76)) {
rg_xo_01 = 0x1959c80f;
} else if (is_mt7986(&dev->mt76)) {
+ need_adie_patch = true;
rg_xo_01 = 0x1959f80f;
} else {
WARN_ON(1);
@@ -537,7 +539,14 @@ static int mt798x_wmac_adie_patch_7976(struct mt7915_dev *dev, u8 adie)
if (ret)
return ret;
- return mt76_wmac_spi_write(dev, adie, MT_ADIE_RG_XO_03, rg_xo_03);
+ ret = mt76_wmac_spi_write(dev, adie, MT_ADIE_RG_XO_03, rg_xo_03);
+ if (ret)
+ return ret;
+
+ if (!need_adie_patch)
+ return 0;
+
+ return mt76_wmac_spi_write(dev, adie, MT_ADIE_RG_TOP_XO_08, 0);
}
static int
--
2.45.2

View File

@@ -1,7 +1,7 @@
From 4300f1a6eb91cc3291d73e415ae32cbd120f6bc6 Mon Sep 17 00:00:00 2001
From 4cdf382808962e209db2575b74d5fde2d2e7ac72 Mon Sep 17 00:00:00 2001
From: Evelyn Tsai <evelyn.tsai@mediatek.com>
Date: Sat, 1 Apr 2023 08:18:17 +0800
Subject: [PATCH 0999/1053] wifi: mt76: mt7915: build pass for Linux Kernel 5.4
Subject: [PATCH 0999/1052] wifi: mt76: mt7915: build pass for Linux Kernel 5.4
fixes
---
@@ -23,7 +23,7 @@ Subject: [PATCH 0999/1053] wifi: mt76: mt7915: build pass for Linux Kernel 5.4
15 files changed, 123 insertions(+), 232 deletions(-)
diff --git a/debugfs.c b/debugfs.c
index c4649ba..1c8328d 100644
index c4649ba0..1c8328d5 100644
--- a/debugfs.c
+++ b/debugfs.c
@@ -33,8 +33,10 @@ mt76_napi_threaded_set(void *data, u64 val)
@@ -38,7 +38,7 @@ index c4649ba..1c8328d 100644
return 0;
}
diff --git a/dma.c b/dma.c
index f4f88c4..ccdd564 100644
index f4f88c44..ccdd5646 100644
--- a/dma.c
+++ b/dma.c
@@ -178,7 +178,7 @@ mt76_free_pending_rxwi(struct mt76_dev *dev)
@@ -240,7 +240,7 @@ index f4f88c4..ccdd564 100644
if (mtk_wed_device_active(&dev->mmio.wed))
diff --git a/dma.h b/dma.h
index 1de5a2b..619dc0f 100644
index 1de5a2b2..619dc0fe 100644
--- a/dma.h
+++ b/dma.h
@@ -79,8 +79,7 @@ enum mt76_dma_wed_ind_reason {
@@ -254,7 +254,7 @@ index 1de5a2b..619dc0f 100644
bool reset_idx);
void mt76_dma_queue_reset(struct mt76_dev *dev, struct mt76_queue *q);
diff --git a/eeprom.c b/eeprom.c
index ecd09c0..a267397 100644
index ecd09c03..a2673978 100644
--- a/eeprom.c
+++ b/eeprom.c
@@ -163,9 +163,15 @@ void
@@ -275,10 +275,10 @@ index ecd09c0..a267397 100644
if (!is_valid_ether_addr(phy->macaddr)) {
eth_random_addr(phy->macaddr);
diff --git a/mac80211.c b/mac80211.c
index bc20f60..b30a74e 100644
index aee6f1e7..4d50bfae 100644
--- a/mac80211.c
+++ b/mac80211.c
@@ -577,47 +577,6 @@ void mt76_unregister_phy(struct mt76_phy *phy)
@@ -578,47 +578,6 @@ void mt76_unregister_phy(struct mt76_phy *phy)
}
EXPORT_SYMBOL_GPL(mt76_unregister_phy);
@@ -326,7 +326,7 @@ index bc20f60..b30a74e 100644
struct mt76_dev *
mt76_alloc_device(struct device *pdev, unsigned int size,
const struct ieee80211_ops *ops,
@@ -1817,21 +1776,6 @@ void mt76_ethtool_worker(struct mt76_ethtool_worker_info *wi,
@@ -1818,21 +1777,6 @@ void mt76_ethtool_worker(struct mt76_ethtool_worker_info *wi,
}
EXPORT_SYMBOL_GPL(mt76_ethtool_worker);
@@ -349,7 +349,7 @@ index bc20f60..b30a74e 100644
{
struct ieee80211_hw *hw = phy->hw;
diff --git a/mcu.c b/mcu.c
index a8cafa3..fa4b054 100644
index a8cafa39..fa4b0544 100644
--- a/mcu.c
+++ b/mcu.c
@@ -4,6 +4,7 @@
@@ -361,7 +361,7 @@ index a8cafa3..fa4b054 100644
struct sk_buff *
__mt76_mcu_msg_alloc(struct mt76_dev *dev, const void *data,
diff --git a/mt76.h b/mt76.h
index b83456b..a07c7df 100644
index 05ee568c..063fc364 100644
--- a/mt76.h
+++ b/mt76.h
@@ -15,11 +15,6 @@
@@ -393,7 +393,7 @@ index b83456b..a07c7df 100644
void mt76_ethtool_worker(struct mt76_ethtool_worker_info *wi,
struct mt76_sta_stats *stats, bool eht);
int mt76_skb_adjust_pad(struct sk_buff *skb, int pad);
@@ -1673,25 +1667,6 @@ void __mt76_set_tx_blocked(struct mt76_dev *dev, bool blocked);
@@ -1685,25 +1679,6 @@ void __mt76_set_tx_blocked(struct mt76_dev *dev, bool blocked);
struct mt76_txwi_cache *mt76_rx_token_release(struct mt76_dev *dev, int token);
int mt76_rx_token_consume(struct mt76_dev *dev, void *ptr,
struct mt76_txwi_cache *r, dma_addr_t phys);
@@ -420,7 +420,7 @@ index b83456b..a07c7df 100644
static inline void mt76_set_tx_blocked(struct mt76_dev *dev, bool blocked)
{
diff --git a/mt7615/mcu.c b/mt7615/mcu.c
index ae34d01..c9444c6 100644
index c807bd8d..a9310660 100644
--- a/mt7615/mcu.c
+++ b/mt7615/mcu.c
@@ -10,6 +10,7 @@
@@ -432,7 +432,7 @@ index ae34d01..c9444c6 100644
static bool prefer_offload_fw = true;
module_param(prefer_offload_fw, bool, 0644);
diff --git a/mt76_connac.h b/mt76_connac.h
index 4871857..8e7068c 100644
index 5028e49a..5356c52c 100644
--- a/mt76_connac.h
+++ b/mt76_connac.h
@@ -56,7 +56,6 @@ enum {
@@ -452,7 +452,7 @@ index 4871857..8e7068c 100644
if (chandef->width >= ARRAY_SIZE(width_to_bw))
diff --git a/mt76_connac_mcu.c b/mt76_connac_mcu.c
index 1ea9798..a8f097d 100644
index 4baaaacf..4e84f8d2 100644
--- a/mt76_connac_mcu.c
+++ b/mt76_connac_mcu.c
@@ -4,6 +4,7 @@
@@ -524,10 +524,10 @@ index 1ea9798..a8f097d 100644
#define DEFAULT_HE_DURATION_RTS_THRES 1023
static void
diff --git a/mt76_connac_mcu.h b/mt76_connac_mcu.h
index 1dd8244..61ca241 100644
index e0255a23..abc57f18 100644
--- a/mt76_connac_mcu.h
+++ b/mt76_connac_mcu.h
@@ -1984,12 +1984,8 @@ void mt76_connac_mcu_reg_wr(struct mt76_dev *dev, u32 offset, u32 val);
@@ -1992,12 +1992,8 @@ void mt76_connac_mcu_reg_wr(struct mt76_dev *dev, u32 offset, u32 val);
const struct ieee80211_sta_he_cap *
mt76_connac_get_he_phy_cap(struct mt76_phy *phy, struct ieee80211_vif *vif);
@@ -541,10 +541,10 @@ index 1dd8244..61ca241 100644
int mt76_connac_mcu_add_key(struct mt76_dev *dev, struct ieee80211_vif *vif,
struct mt76_connac_sta_key_conf *sta_key_conf,
diff --git a/mt7915/main.c b/mt7915/main.c
index 9eeca39..407da07 100644
index 0d2614e1..a3facc9a 100644
--- a/mt7915/main.c
+++ b/mt7915/main.c
@@ -1438,22 +1438,20 @@ void mt7915_get_et_strings(struct ieee80211_hw *hw,
@@ -1440,22 +1440,20 @@ void mt7915_get_et_strings(struct ieee80211_hw *hw,
struct ieee80211_vif *vif,
u32 sset, u8 *data)
{
@@ -573,7 +573,7 @@ index 9eeca39..407da07 100644
}
static void mt7915_ethtool_worker(void *wi_data, struct ieee80211_sta *sta)
@@ -1481,7 +1479,7 @@ void mt7915_get_et_stats(struct ieee80211_hw *hw,
@@ -1483,7 +1481,7 @@ void mt7915_get_et_stats(struct ieee80211_hw *hw,
.idx = mvif->mt76.idx,
};
/* See mt7915_ampdu_stat_read_phy, etc */
@@ -582,7 +582,7 @@ index 9eeca39..407da07 100644
mutex_lock(&dev->mt76.mutex);
@@ -1593,12 +1591,9 @@ void mt7915_get_et_stats(struct ieee80211_hw *hw,
@@ -1595,12 +1593,9 @@ void mt7915_get_et_stats(struct ieee80211_hw *hw,
return;
ei += wi.worker_stat_count;
@@ -599,7 +599,7 @@ index 9eeca39..407da07 100644
static void
diff --git a/mt7915/mcu.c b/mt7915/mcu.c
index 446c512..8f6bc6e 100644
index 9126e62f..34323577 100644
--- a/mt7915/mcu.c
+++ b/mt7915/mcu.c
@@ -6,6 +6,7 @@
@@ -611,10 +611,10 @@ index 446c512..8f6bc6e 100644
#define fw_name(_dev, name, ...) ({ \
char *_fw; \
diff --git a/usb.c b/usb.c
index dc690d1..058f2d1 100644
index 58ff0682..0ca3b069 100644
--- a/usb.c
+++ b/usb.c
@@ -319,27 +319,29 @@ mt76u_set_endpoints(struct usb_interface *intf,
@@ -318,27 +318,29 @@ mt76u_set_endpoints(struct usb_interface *intf,
static int
mt76u_fill_rx_sg(struct mt76_dev *dev, struct mt76_queue *q, struct urb *urb,
@@ -649,7 +649,7 @@ index dc690d1..058f2d1 100644
urb->num_sgs = i;
}
@@ -352,16 +354,15 @@ mt76u_fill_rx_sg(struct mt76_dev *dev, struct mt76_queue *q, struct urb *urb,
@@ -351,16 +353,15 @@ mt76u_fill_rx_sg(struct mt76_dev *dev, struct mt76_queue *q, struct urb *urb,
static int
mt76u_refill_rx(struct mt76_dev *dev, struct mt76_queue *q,
@@ -669,7 +669,7 @@ index dc690d1..058f2d1 100644
return urb->transfer_buffer ? 0 : -ENOMEM;
}
@@ -399,7 +400,7 @@ mt76u_rx_urb_alloc(struct mt76_dev *dev, struct mt76_queue *q,
@@ -398,7 +399,7 @@ mt76u_rx_urb_alloc(struct mt76_dev *dev, struct mt76_queue *q,
if (err)
return err;
@@ -678,7 +678,7 @@ index dc690d1..058f2d1 100644
}
static void mt76u_urb_free(struct urb *urb)
@@ -407,10 +408,10 @@ static void mt76u_urb_free(struct urb *urb)
@@ -406,10 +407,10 @@ static void mt76u_urb_free(struct urb *urb)
int i;
for (i = 0; i < urb->num_sgs; i++)
@@ -691,7 +691,7 @@ index dc690d1..058f2d1 100644
usb_free_urb(urb);
}
@@ -546,8 +547,6 @@ mt76u_process_rx_entry(struct mt76_dev *dev, struct urb *urb,
@@ -545,8 +546,6 @@ mt76u_process_rx_entry(struct mt76_dev *dev, struct urb *urb,
len -= data_len;
nsgs++;
}
@@ -700,7 +700,7 @@ index dc690d1..058f2d1 100644
dev->drv->rx_skb(dev, MT_RXQ_MAIN, skb, NULL);
return nsgs;
@@ -613,7 +612,7 @@ mt76u_process_rx_queue(struct mt76_dev *dev, struct mt76_queue *q)
@@ -612,7 +611,7 @@ mt76u_process_rx_queue(struct mt76_dev *dev, struct mt76_queue *q)
count = mt76u_process_rx_entry(dev, urb, q->buf_size);
if (count > 0) {
@@ -709,7 +709,7 @@ index dc690d1..058f2d1 100644
if (err < 0)
break;
}
@@ -664,10 +663,6 @@ mt76u_alloc_rx_queue(struct mt76_dev *dev, enum mt76_rxq_id qid)
@@ -663,10 +662,6 @@ mt76u_alloc_rx_queue(struct mt76_dev *dev, enum mt76_rxq_id qid)
struct mt76_queue *q = &dev->q_rx[qid];
int i, err;
@@ -720,7 +720,7 @@ index dc690d1..058f2d1 100644
spin_lock_init(&q->lock);
q->entry = devm_kcalloc(dev->dev,
MT_NUM_RX_ENTRIES, sizeof(*q->entry),
@@ -696,6 +691,7 @@ EXPORT_SYMBOL_GPL(mt76u_alloc_mcu_queue);
@@ -695,6 +690,7 @@ EXPORT_SYMBOL_GPL(mt76u_alloc_mcu_queue);
static void
mt76u_free_rx_queue(struct mt76_dev *dev, struct mt76_queue *q)
{
@@ -728,7 +728,7 @@ index dc690d1..058f2d1 100644
int i;
for (i = 0; i < q->ndesc; i++) {
@@ -705,8 +701,13 @@ mt76u_free_rx_queue(struct mt76_dev *dev, struct mt76_queue *q)
@@ -704,8 +700,13 @@ mt76u_free_rx_queue(struct mt76_dev *dev, struct mt76_queue *q)
mt76u_urb_free(q->entry[i].urb);
q->entry[i].urb = NULL;
}
@@ -745,7 +745,7 @@ index dc690d1..058f2d1 100644
static void mt76u_free_rx(struct mt76_dev *dev)
diff --git a/wed.c b/wed.c
index f89e453..f7a3f1b 100644
index f89e4537..f7a3f1b3 100644
--- a/wed.c
+++ b/wed.c
@@ -9,8 +9,12 @@

View File

@@ -1,4 +1,4 @@
From ae5f0852b50290e0aaf2ff9d5dd8f9bd2b97bbb6 Mon Sep 17 00:00:00 2001
From fc8eaff0aa3ff1f6a7ac8808922aafba48ed3efc Mon Sep 17 00:00:00 2001
From: Shayne Chen <shayne.chen@mediatek.com>
Date: Wed, 22 Jun 2022 10:39:47 +0800
Subject: [PATCH] wifi: mt76: mt7915: add mtk internal debug tools for mt76
@@ -23,10 +23,10 @@ Subject: [PATCH] wifi: mt76: mt7915: add mtk internal debug tools for mt76
create mode 100644 mt7915/mtk_mcu.c
diff --git a/mt76_connac_mcu.h b/mt76_connac_mcu.h
index 99cdd1b..a8690cd 100644
index abc57f18..01d6598a 100644
--- a/mt76_connac_mcu.h
+++ b/mt76_connac_mcu.h
@@ -1195,6 +1195,7 @@ enum {
@@ -1197,6 +1197,7 @@ enum {
MCU_EXT_CMD_SET_TX_POWER_CTRL = 0x11,
MCU_EXT_CMD_FW_LOG_2_HOST = 0x13,
MCU_EXT_CMD_TXBF_ACTION = 0x1e,
@@ -34,7 +34,7 @@ index 99cdd1b..a8690cd 100644
MCU_EXT_CMD_EFUSE_BUFFER_MODE = 0x21,
MCU_EXT_CMD_THERMAL_PROT = 0x23,
MCU_EXT_CMD_STA_REC_UPDATE = 0x25,
@@ -1218,6 +1219,11 @@ enum {
@@ -1220,6 +1221,11 @@ enum {
MCU_EXT_CMD_TX_POWER_FEATURE_CTRL = 0x58,
MCU_EXT_CMD_RXDCOC_CAL = 0x59,
MCU_EXT_CMD_GET_MIB_INFO = 0x5a,
@@ -47,7 +47,7 @@ index 99cdd1b..a8690cd 100644
MCU_EXT_CMD_CAL_CACHE = 0x67,
MCU_EXT_CMD_RED_ENABLE = 0x68,
diff --git a/mt7915/Makefile b/mt7915/Makefile
index c4dca9c..fd71141 100644
index c4dca9c1..fd711416 100644
--- a/mt7915/Makefile
+++ b/mt7915/Makefile
@@ -4,7 +4,7 @@ EXTRA_CFLAGS += -DCONFIG_MT76_LEDS
@@ -60,7 +60,7 @@ index c4dca9c..fd71141 100644
mt7915e-$(CONFIG_NL80211_TESTMODE) += testmode.o
mt7915e-$(CONFIG_MT798X_WMAC) += soc.o
diff --git a/mt7915/debugfs.c b/mt7915/debugfs.c
index 894e2cd..2661386 100644
index 894e2cd7..26613869 100644
--- a/mt7915/debugfs.c
+++ b/mt7915/debugfs.c
@@ -8,6 +8,9 @@
@@ -232,7 +232,7 @@ index 894e2cd..2661386 100644
if (dev->relay_fwlog)
diff --git a/mt7915/mac.c b/mt7915/mac.c
index 4604a68..d99864f 100644
index 9c56f105..d1f58eb4 100644
--- a/mt7915/mac.c
+++ b/mt7915/mac.c
@@ -282,6 +282,10 @@ mt7915_mac_fill_rx(struct mt7915_dev *dev, struct sk_buff *skb,
@@ -271,7 +271,7 @@ index 4604a68..d99864f 100644
}
diff --git a/mt7915/main.c b/mt7915/main.c
index e10cdb3..3ac3df3 100644
index 2b161611..90cd834c 100644
--- a/mt7915/main.c
+++ b/mt7915/main.c
@@ -73,7 +73,11 @@ int mt7915_run(struct ieee80211_hw *hw)
@@ -292,10 +292,10 @@ index e10cdb3..3ac3df3 100644
mt76_wcid_init(&mvif->sta.wcid);
+ mvif->sta.vif = mvif;
mt7915_mac_wtbl_update(dev, idx,
MT_WTBL_UPDATE_ADM_COUNT_CLEAR);
/* init Default QoS map, defined in section 2.3 of RFC8325.
* Three most significant bits of DSCP are used as UP.
diff --git a/mt7915/mcu.c b/mt7915/mcu.c
index 3e3d57c..1a3647a 100644
index 34323577..ff7f81b0 100644
--- a/mt7915/mcu.c
+++ b/mt7915/mcu.c
@@ -205,6 +205,11 @@ mt7915_mcu_send_message(struct mt76_dev *mdev, struct sk_buff *skb,
@@ -355,10 +355,11 @@ index 3e3d57c..1a3647a 100644
int mt7915_mcu_rf_regval(struct mt7915_dev *dev, u32 regidx, u32 *val, bool set)
{
struct {
@@ -4214,6 +4241,25 @@ int mt7915_mcu_rf_regval(struct mt7915_dev *dev, u32 regidx, u32 *val, bool set)
@@ -4213,3 +4240,22 @@ int mt7915_mcu_rf_regval(struct mt7915_dev *dev, u32 regidx, u32 *val, bool set)
return 0;
}
+
+#ifdef MTK_DEBUG
+int mt7915_mcu_set_amsdu_algo(struct mt7915_dev *dev, u16 wcid, u8 enable)
+{
@@ -377,12 +378,8 @@ index 3e3d57c..1a3647a 100644
+ return mt76_mcu_send_msg(&dev->mt76, MCU_EXT_CMD(MEC_CTRL), &req, sizeof(req), true);
+}
+#endif
+
int mt7915_mcu_set_qos_map(struct mt7915_dev *dev, struct ieee80211_vif *vif)
{
#define IP_DSCP_NUM 64
diff --git a/mt7915/mcu.h b/mt7915/mcu.h
index fa0847d..9ae0f07 100644
index fa0847d5..9ae0f07a 100644
--- a/mt7915/mcu.h
+++ b/mt7915/mcu.h
@@ -347,6 +347,10 @@ enum {
@@ -397,7 +394,7 @@ index fa0847d..9ae0f07 100644
MCU_WA_PARAM_RED_SETTING = 0x40,
};
diff --git a/mt7915/mt7915.h b/mt7915/mt7915.h
index 66d87d7..398f851 100644
index bfac8516..72158419 100644
--- a/mt7915/mt7915.h
+++ b/mt7915/mt7915.h
@@ -9,6 +9,7 @@
@@ -408,7 +405,7 @@ index 66d87d7..398f851 100644
#define MT7915_MAX_INTERFACES 19
#define MT7915_WTBL_SIZE 288
#define MT7916_WTBL_SIZE 544
@@ -244,6 +245,14 @@ struct mt7915_phy {
@@ -248,6 +249,14 @@ struct mt7915_phy {
#endif
};
@@ -423,7 +420,7 @@ index 66d87d7..398f851 100644
struct mt7915_dev {
union { /* must be first */
struct mt76_dev mt76;
@@ -327,6 +336,33 @@ struct mt7915_dev {
@@ -331,6 +340,33 @@ struct mt7915_dev {
void __iomem *dcm;
void __iomem *sku;
@@ -457,7 +454,7 @@ index 66d87d7..398f851 100644
bool wmm_pbc_enable;
struct work_struct wmm_pbc_work;
u32 adie_type;
@@ -611,4 +647,24 @@ void mt7915_sta_add_debugfs(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
@@ -614,4 +650,24 @@ void mt7915_sta_add_debugfs(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
int mt7915_mmio_wed_init(struct mt7915_dev *dev, void *pdev_ptr,
bool pci, int *irq);
@@ -484,7 +481,7 @@ index 66d87d7..398f851 100644
#endif
diff --git a/mt7915/mt7915_debug.h b/mt7915/mt7915_debug.h
new file mode 100644
index 0000000..1ec8de9
index 00000000..2f9f3da7
--- /dev/null
+++ b/mt7915/mt7915_debug.h
@@ -0,0 +1,1442 @@
@@ -853,8 +850,8 @@ index 0000000..1ec8de9
+ [DBG_PSE_FREEPG_CNT] = { DBG_INVALID_BASE, 0x380},
+ [DBG_PSE_FREEPG_HEAD_TAIL] = { DBG_INVALID_BASE, 0x384},
+ [DBG_PSE_HIF0_PG_INFO] = { DBG_INVALID_BASE, 0x150},
+ [DBG_PSE_PG_HIF1_GROUP] = { DBG_INVALID_BASE, 0x154},
+ [DBG_PSE_HIF1_PG_INFO] = { DBG_INVALID_BASE, 0x160},
+ [DBG_PSE_PG_HIF1_GROUP] = { DBG_INVALID_BASE, 0x114},
+ [DBG_PSE_HIF1_PG_INFO] = { DBG_INVALID_BASE, 0x154},
+ [DBG_PSE_PG_CPU_GROUP] = { DBG_INVALID_BASE, 0x118},
+ [DBG_PSE_CPU_PG_INFO] = { DBG_INVALID_BASE, 0x158},
+ [DBG_PSE_PG_PLE_GROUP] = { DBG_INVALID_BASE, 0x11c},
@@ -866,7 +863,7 @@ index 0000000..1ec8de9
+ [DBG_PSE_PG_LMAC2_GROUP] = { DBG_INVALID_BASE, 0x12c},
+ [DBG_PSE_LMAC2_PG_INFO] = { DBG_INVALID_BASE, 0x16c},
+ [DBG_PSE_PG_LMAC3_GROUP] = { DBG_INVALID_BASE, 0x130},
+ [DBG_PSE_LMAC3_PG_INFO] = { DBG_INVALID_BASE, 0x17c},
+ [DBG_PSE_LMAC3_PG_INFO] = { DBG_INVALID_BASE, 0x170},
+ [DBG_PSE_PG_MDP_GROUP] = { DBG_INVALID_BASE, 0x134},
+ [DBG_PSE_MDP_PG_INFO] = { DBG_INVALID_BASE, 0x174},
+ [DBG_PSE_PG_PLE1_GROUP] = { DBG_INVALID_BASE, 0x120},
@@ -1386,17 +1383,17 @@ index 0000000..1ec8de9
+#define MT_DBG_PSE_MDP_PG_INFO_MDP_SRC_CNT_MASK GENMASK(27, 16)
+#define MT_DBG_PSE_MDP_PG_INFO_MDP_RSV_CNT_MASK GENMASK(11, 0)
+
+#define MT_DBG_PSE_FL_QUE_CTRL_0_ADDR MT_DBG_PLE(0x1b0)
+#define MT_DBG_PSE_FL_QUE_CTRL_0_ADDR MT_DBG_PSE(0x1b0)
+#define MT_DBG_PSE_FL_QUE_CTRL_0_EXECUTE_MASK BIT(31)
+#define MT_DBG_PSE_FL_QUE_CTRL_0_Q_BUF_QID_SHFT 24
+#define MT_DBG_PSE_FL_QUE_CTRL_0_Q_BUF_PID_SHFT 10
+#define MT_DBG_PSE_FL_QUE_CTRL_0_Q_BUF_WLANID_MASK GENMASK(9, 0)
+
+#define MT_DBG_PSE_FL_QUE_CTRL_2_ADDR MT_DBG_PLE(0x1b8)
+#define MT_DBG_PSE_FL_QUE_CTRL_2_ADDR MT_DBG_PSE(0x1b8)
+#define MT_DBG_PSE_FL_QUE_CTRL_2_QUEUE_TAIL_FID_MASK GENMASK(27, 16)
+#define MT_DBG_PSE_FL_QUE_CTRL_2_QUEUE_HEAD_FID_MASK GENMASK(11, 0)
+
+#define MT_DBG_PSE_FL_QUE_CTRL_3_ADDR MT_DBG_PLE(0x1bc)
+#define MT_DBG_PSE_FL_QUE_CTRL_3_ADDR MT_DBG_PSE(0x1bc)
+#define MT_DBG_PSE_FL_QUE_CTRL_3_QUEUE_PKT_NUM_MASK GENMASK(11, 0)
+
+
@@ -1932,7 +1929,7 @@ index 0000000..1ec8de9
+#endif
diff --git a/mt7915/mtk_debugfs.c b/mt7915/mtk_debugfs.c
new file mode 100644
index 0000000..62d3a99
index 00000000..c0fcb2ee
--- /dev/null
+++ b/mt7915/mtk_debugfs.c
@@ -0,0 +1,3750 @@
@@ -3749,8 +3746,8 @@ index 0000000..62d3a99
+ rsv_pg = FIELD_GET(MT_DBG_PSE_LMAC1_PG_INFO_LMAC1_RSV_CNT_MASK, pg_flow_ctrl[11]);
+ used_pg = FIELD_GET(MT_DBG_PSE_LMAC1_PG_INFO_LMAC1_SRC_CNT_MASK, pg_flow_ctrl[11]);
+ seq_printf(s, "\t\tThe used/reserved pages of LMAC1 group=0x%03x/0x%03x\n", used_pg, rsv_pg);
+ seq_printf(s, "\tReserved page counter of LMAC2 group(0x82068180): 0x%08x\n", pg_flow_ctrl[11]);
+ seq_printf(s, "\tLMAC2 group page status(0x82068184): 0x%08x\n", pg_flow_ctrl[12]);
+ seq_printf(s, "\tReserved page counter of LMAC2 group(0x82068180): 0x%08x\n", pg_flow_ctrl[12]);
+ seq_printf(s, "\tLMAC2 group page status(0x82068184): 0x%08x\n", pg_flow_ctrl[13]);
+ min_q = FIELD_GET(MT_DBG_PSE_PG_LMAC2_GROUP_LMAC2_MIN_QUOTA_MASK, pg_flow_ctrl[12]);
+ max_q = FIELD_GET(MT_DBG_PSE_PG_LMAC2_GROUP_LMAC2_MAX_QUOTA_MASK, pg_flow_ctrl[12]);
+ seq_printf(s, "\t\tThe max/min quota pages of LMAC2 group=0x%03x/0x%03x\n", max_q, min_q);
@@ -3776,8 +3773,8 @@ index 0000000..62d3a99
+ used_pg = FIELD_GET(MT_DBG_PSE_PLE_PG_INFO_PLE_SRC_CNT_MASK, pg_flow_ctrl[15]);
+ seq_printf(s, "\t\tThe used/reserved pages of PLE group=0x%03x/0x%03x\n", used_pg, rsv_pg);
+
+ seq_printf(s, "\tReserved page counter of PLE1 group(0x82068168): 0x%08x\n", pg_flow_ctrl[14]);
+ seq_printf(s, "\tPLE1 group page status(0x8206816c): 0x%08x\n", pg_flow_ctrl[15]);
+ seq_printf(s, "\tReserved page counter of PLE1 group(0x82068168): 0x%08x\n", pg_flow_ctrl[20]);
+ seq_printf(s, "\tPLE1 group page status(0x8206816c): 0x%08x\n", pg_flow_ctrl[21]);
+ min_q = FIELD_GET(MT_DBG_PSE_PG_PLE_GROUP_PLE_MIN_QUOTA_MASK, pg_flow_ctrl[20]);
+ max_q = FIELD_GET(MT_DBG_PSE_PG_PLE_GROUP_PLE_MAX_QUOTA_MASK, pg_flow_ctrl[20]);
+ seq_printf(s, "\t\tThe max/min quota pages of PLE1 group=0x%03x/0x%03x\n", max_q, min_q);
@@ -4862,7 +4859,7 @@ index 0000000..62d3a99
+ struct mt76_dev *mdev = NULL;
+ int i;
+
+ seq_printf(s, "Version: 2.2.24.3\n");
+ seq_printf(s, "Version: 2.2.24.7\n");
+
+ if (!test_bit(MT76_STATE_MCU_RUNNING, &dev->mphy.state))
+ return 0;
@@ -5688,7 +5685,7 @@ index 0000000..62d3a99
+#endif
diff --git a/mt7915/mtk_mcu.c b/mt7915/mtk_mcu.c
new file mode 100644
index 0000000..143dae2
index 00000000..143dae26
--- /dev/null
+++ b/mt7915/mtk_mcu.c
@@ -0,0 +1,51 @@
@@ -5744,7 +5741,7 @@ index 0000000..143dae2
+ sizeof(req), true);
+}
diff --git a/mt7915/soc.c b/mt7915/soc.c
index bb3468a..b941a49 100644
index bb3468a9..b941a49d 100644
--- a/mt7915/soc.c
+++ b/mt7915/soc.c
@@ -360,6 +360,13 @@ static int mt798x_wmac_sku_setup(struct mt7915_dev *dev, u32 *adie_type)
@@ -5762,7 +5759,7 @@ index bb3468a..b941a49 100644
mt76_wmac_spi_unlock(dev);
diff --git a/tools/fwlog.c b/tools/fwlog.c
index e5d4a10..3d51d9e 100644
index e5d4a105..3d51d9ec 100644
--- a/tools/fwlog.c
+++ b/tools/fwlog.c
@@ -26,7 +26,7 @@ static const char *debugfs_path(const char *phyname, const char *file)
@@ -5876,5 +5873,5 @@ index e5d4a10..3d51d9e 100644
return ret;
}
--
2.18.0
2.45.2

View File

@@ -1,4 +1,4 @@
From b50df1502bddba9963eadba8d69e6b95a9b87337 Mon Sep 17 00:00:00 2001
From e15bcf231758ad3d3060512e772257ac7aaaaa3f Mon Sep 17 00:00:00 2001
From: Bo Jiao <Bo.Jiao@mediatek.com>
Date: Mon, 6 Jun 2022 20:13:02 +0800
Subject: [PATCH] wifi: mt76: mt7915: csi: implement csi support
@@ -6,22 +6,23 @@ Subject: [PATCH] wifi: mt76: mt7915: csi: implement csi support
---
mt76_connac_mcu.h | 2 +
mt7915/Makefile | 4 +-
mt7915/init.c | 38 ++++
mt7915/main.c | 4 +
mt7915/mcu.c | 203 ++++++++++++++++++++
mt7915/mcu.h | 74 ++++++++
mt7915/mt7915.h | 60 ++++++
mt7915/vendor.c | 470 ++++++++++++++++++++++++++++++++++++++++++++++
mt7915/vendor.h | 63 +++++++
9 files changed, 916 insertions(+), 2 deletions(-)
mt7915/debugfs.c | 48 ++++
mt7915/init.c | 46 ++++
mt7915/main.c | 13 +
mt7915/mcu.c | 203 ++++++++++++++++
mt7915/mcu.h | 74 ++++++
mt7915/mt7915.h | 78 ++++++
mt7915/vendor.c | 606 ++++++++++++++++++++++++++++++++++++++++++++++
mt7915/vendor.h | 75 ++++++
10 files changed, 1147 insertions(+), 2 deletions(-)
create mode 100644 mt7915/vendor.c
create mode 100644 mt7915/vendor.h
diff --git a/mt76_connac_mcu.h b/mt76_connac_mcu.h
index a8690cd..cda7559 100644
index 01d6598a..ad63596d 100644
--- a/mt76_connac_mcu.h
+++ b/mt76_connac_mcu.h
@@ -1029,6 +1029,7 @@ enum {
@@ -1030,6 +1030,7 @@ enum {
MCU_EXT_EVENT_WA_TX_STAT = 0x74,
MCU_EXT_EVENT_BCC_NOTIFY = 0x75,
MCU_EXT_EVENT_MURU_CTRL = 0x9f,
@@ -29,7 +30,7 @@ index a8690cd..cda7559 100644
};
/* unified event table */
@@ -1243,6 +1244,7 @@ enum {
@@ -1245,6 +1246,7 @@ enum {
MCU_EXT_CMD_DPD_PRE_CAL_INFO = 0xac,
MCU_EXT_CMD_PHY_STAT_INFO = 0xad,
MCU_EXT_CMD_SET_QOS_MAP = 0xb4,
@@ -38,7 +39,7 @@ index a8690cd..cda7559 100644
enum {
diff --git a/mt7915/Makefile b/mt7915/Makefile
index fd71141..65129b4 100644
index fd711416..65129b4f 100644
--- a/mt7915/Makefile
+++ b/mt7915/Makefile
@@ -1,10 +1,10 @@
@@ -54,24 +55,92 @@ index fd71141..65129b4 100644
mt7915e-$(CONFIG_NL80211_TESTMODE) += testmode.o
mt7915e-$(CONFIG_MT798X_WMAC) += soc.o
diff --git a/mt7915/debugfs.c b/mt7915/debugfs.c
index 26613869..909df246 100644
--- a/mt7915/debugfs.c
+++ b/mt7915/debugfs.c
@@ -1241,6 +1241,51 @@ mt7915_rf_regval_set(void *data, u64 val)
DEFINE_DEBUGFS_ATTRIBUTE(fops_rf_regval, mt7915_rf_regval_get,
mt7915_rf_regval_set, "0x%08llx\n");
+#ifdef CONFIG_MTK_VENDOR
+static ssize_t
+mt7915_get_csi_stats(struct file *file, char __user *user_buf,
+ size_t count, loff_t *ppos)
+
+{
+ struct mt7915_phy *phy = file->private_data;
+ struct csi_mac_filter *current_mac, *tmp_mac;
+ static const size_t sz = 4096;
+ char *buf;
+ u32 reg, len = 0;
+ int ret;
+
+ buf = kzalloc(sz, GFP_KERNEL);
+ if (!buf)
+ return -ENOMEM;
+
+ len += scnprintf(buf + len, sz - len, "CSI enable: %d\n", phy->csi.enable);
+
+ if (phy->csi.enable) {
+ len += scnprintf(buf + len, sz - len, "CSI data_cnt: %d\n", phy->csi.count);
+
+ mutex_lock(&phy->csi.mac_filter_lock);
+
+ list_for_each_entry_safe(current_mac, tmp_mac, &phy->csi.mac_filter_list, node) {
+ len += scnprintf(buf + len, sz - len, "mac: %pM, interval: %d\n", current_mac->mac, current_mac->interval);
+ }
+
+ mutex_unlock(&phy->csi.mac_filter_lock);
+ }
+
+ ret = simple_read_from_buffer(user_buf, count, ppos, buf, len);
+
+out:
+ kfree(buf);
+ return ret;
+}
+
+static const struct file_operations mt7915_csi_ops = {
+ .read = mt7915_get_csi_stats,
+ .open = simple_open,
+ .llseek = default_llseek,
+};
+#endif
+
int mt7915_init_debugfs(struct mt7915_phy *phy)
{
struct mt7915_dev *dev = phy->dev;
@@ -1283,6 +1328,9 @@ int mt7915_init_debugfs(struct mt7915_phy *phy)
debugfs_create_devm_seqfile(dev->mt76.dev, "rdd_monitor", dir,
mt7915_rdd_monitor);
}
+#ifdef CONFIG_MTK_VENDOR
+ debugfs_create_file("csi_stats", 0400, dir, phy, &mt7915_csi_ops);
+#endif
if (!ext_phy)
dev->debugfs_dir = dir;
diff --git a/mt7915/init.c b/mt7915/init.c
index 19a68c5..c504ebf 100644
index 84c69a88..ac15bc53 100644
--- a/mt7915/init.c
+++ b/mt7915/init.c
@@ -697,6 +697,12 @@ mt7915_register_ext_phy(struct mt7915_dev *dev, struct mt7915_phy *phy)
@@ -668,6 +668,14 @@ mt7915_register_ext_phy(struct mt7915_dev *dev, struct mt7915_phy *phy)
/* init wiphy according to mphy and phy */
mt7915_init_wiphy(phy);
+#ifdef CONFIG_MTK_VENDOR
+ INIT_LIST_HEAD(&phy->csi.csi_list);
+ spin_lock_init(&phy->csi.csi_lock);
+ INIT_LIST_HEAD(&phy->csi.data_list);
+ spin_lock_init(&phy->csi.data_lock);
+ INIT_LIST_HEAD(&phy->csi.mac_filter_list);
+ mutex_init(&phy->csi.mac_filter_lock);
+ mt7915_vendor_register(phy);
+#endif
+
ret = mt76_register_phy(mphy, true, mt76_rates,
ARRAY_SIZE(mt76_rates));
if (ret)
@@ -1178,6 +1184,24 @@ void mt7915_set_stream_he_caps(struct mt7915_phy *phy)
@@ -1146,6 +1154,28 @@ void mt7915_set_stream_he_caps(struct mt7915_phy *phy)
}
}
@@ -80,14 +149,18 @@ index 19a68c5..c504ebf 100644
+{
+ struct csi_data *c, *tmp_c;
+
+ spin_lock_bh(&phy->csi.csi_lock);
+ spin_lock_bh(&phy->csi.data_lock);
+ phy->csi.enable = 0;
+
+ list_for_each_entry_safe(c, tmp_c, &phy->csi.csi_list, node) {
+ list_for_each_entry_safe(c, tmp_c, &phy->csi.data_list, node) {
+ list_del(&c->node);
+ kfree(c);
+ }
+ spin_unlock_bh(&phy->csi.csi_lock);
+ spin_unlock_bh(&phy->csi.data_lock);
+
+ mutex_lock(&phy->csi.mac_filter_lock);
+ mt7915_csi_mac_filter_clear(phy);
+ mutex_unlock(&phy->csi.mac_filter_lock);
+
+ return 0;
+}
@@ -96,7 +169,7 @@ index 19a68c5..c504ebf 100644
static void mt7915_unregister_ext_phy(struct mt7915_dev *dev)
{
struct mt7915_phy *phy = mt7915_ext_phy(dev);
@@ -1186,6 +1210,10 @@ static void mt7915_unregister_ext_phy(struct mt7915_dev *dev)
@@ -1154,6 +1184,10 @@ static void mt7915_unregister_ext_phy(struct mt7915_dev *dev)
if (!phy)
return;
@@ -107,7 +180,7 @@ index 19a68c5..c504ebf 100644
mt7915_unregister_thermal(phy);
mt76_unregister_phy(mphy);
ieee80211_free_hw(mphy->hw);
@@ -1198,6 +1226,10 @@ static void mt7915_stop_hardware(struct mt7915_dev *dev)
@@ -1166,6 +1200,10 @@ static void mt7915_stop_hardware(struct mt7915_dev *dev)
mt7915_dma_cleanup(dev);
tasklet_disable(&dev->mt76.irq_tasklet);
@@ -118,13 +191,15 @@ index 19a68c5..c504ebf 100644
if (is_mt798x(&dev->mt76))
mt7986_wmac_disable(dev);
}
@@ -1242,6 +1274,12 @@ int mt7915_register_device(struct mt7915_dev *dev)
@@ -1210,6 +1248,14 @@ int mt7915_register_device(struct mt7915_dev *dev)
dev->mt76.test_ops = &mt7915_testmode_ops;
#endif
+#ifdef CONFIG_MTK_VENDOR
+ INIT_LIST_HEAD(&dev->phy.csi.csi_list);
+ spin_lock_init(&dev->phy.csi.csi_lock);
+ INIT_LIST_HEAD(&dev->phy.csi.data_list);
+ spin_lock_init(&dev->phy.csi.data_lock);
+ INIT_LIST_HEAD(&dev->phy.csi.mac_filter_list);
+ mutex_init(&dev->phy.csi.mac_filter_lock);
+ mt7915_vendor_register(&dev->phy);
+#endif
+
@@ -132,22 +207,31 @@ index 19a68c5..c504ebf 100644
ARRAY_SIZE(mt76_rates));
if (ret)
diff --git a/mt7915/main.c b/mt7915/main.c
index 3ac3df3..4edb11a 100644
index 90cd834c..9a7703cf 100644
--- a/mt7915/main.c
+++ b/mt7915/main.c
@@ -811,6 +811,10 @@ void mt7915_mac_sta_remove(struct mt76_dev *mdev, struct ieee80211_vif *vif,
@@ -816,6 +816,19 @@ void mt7915_mac_sta_remove(struct mt76_dev *mdev, struct ieee80211_vif *vif,
struct mt7915_sta *msta = (struct mt7915_sta *)sta->drv_priv;
struct mt7915_phy *phy = msta->vif->phy;
int i;
+#ifdef CONFIG_MTK_VENDOR
+ mt7915_mcu_set_csi(&dev->phy, 2, 8, 1, 0, sta->addr, 0);
+#endif
+ struct csi_mac_filter *ent;
+
mt7915_mcu_add_sta(dev, vif, sta, false);
+ mutex_lock(&phy->csi.mac_filter_lock);
+ ent = mt7915_csi_mac_filter_find(phy, sta->addr);
+ if (ent && !mt7915_mcu_set_csi(phy, 2, 8, 1, 0, sta->addr, 0)) {
+ list_del(&ent->node);
+ kfree(ent);
+ phy->csi.mac_filter_cnt--;
+ }
+
+ mutex_unlock(&phy->csi.mac_filter_lock);
+#endif
mt7915_mac_wtbl_update(dev, msta->wcid.idx,
for (i = 0; i < ARRAY_SIZE(msta->twt.flow); i++)
mt7915_mac_twt_teardown_flow(dev, msta, i);
diff --git a/mt7915/mcu.c b/mt7915/mcu.c
index 1a3647a..65609b4 100644
index ff7f81b0..44765b1f 100644
--- a/mt7915/mcu.c
+++ b/mt7915/mcu.c
@@ -40,6 +40,10 @@ static bool sr_scene_detect = true;
@@ -193,7 +277,7 @@ index 1a3647a..65609b4 100644
+ if (is_valid_ether_addr(mac_addr)) {
+ ether_addr_copy(req.mac_addr, mac_addr);
+
+ if (req.v2 == 1 && sta_interval)
+ if ((req.v2 == ADD_CSI_MAC) && sta_interval)
+ req.sta_interval = sta_interval;
+ }
+
@@ -341,21 +425,21 @@ index 1a3647a..65609b4 100644
+
+ /* put the csi data into list */
+ INIT_LIST_HEAD(&target_csi->node);
+ spin_lock_bh(&phy->csi.csi_lock);
+ spin_lock_bh(&phy->csi.data_lock);
+
+ if (!phy->csi.enable) {
+ kfree(target_csi);
+ spin_unlock_bh(&phy->csi.csi_lock);
+ spin_unlock_bh(&phy->csi.data_lock);
+ return 0;
+ }
+
+ list_add_tail(&target_csi->node, &phy->csi.csi_list);
+ list_add_tail(&target_csi->node, &phy->csi.data_list);
+ phy->csi.count++;
+
+ if (phy->csi.count > CSI_MAX_BUF_NUM) {
+ struct csi_data *old;
+
+ old = list_first_entry(&phy->csi.csi_list,
+ old = list_first_entry(&phy->csi.data_list,
+ struct csi_data, node);
+
+ list_del(&old->node);
@@ -365,7 +449,7 @@ index 1a3647a..65609b4 100644
+
+ if (target_csi->chain_info & BIT(15)) /* last chain */
+ phy->csi.last_record = target_csi->ts;
+ spin_unlock_bh(&phy->csi.csi_lock);
+ spin_unlock_bh(&phy->csi.data_lock);
+
+ return 0;
+}
@@ -375,7 +459,7 @@ index 1a3647a..65609b4 100644
int mt7915_dbg_mcu_wa_cmd(struct mt7915_dev *dev, int cmd, u32 a1, u32 a2, u32 a3, bool wait_resp)
{
diff --git a/mt7915/mcu.h b/mt7915/mcu.h
index 9ae0f07..f32d525 100644
index 9ae0f07a..f32d5256 100644
--- a/mt7915/mcu.h
+++ b/mt7915/mcu.h
@@ -604,4 +604,78 @@ mt7915_get_power_bound(struct mt7915_phy *phy, s8 txpower)
@@ -458,10 +542,10 @@ index 9ae0f07..f32d525 100644
+
#endif
diff --git a/mt7915/mt7915.h b/mt7915/mt7915.h
index 398f851..5a26335 100644
index 72158419..4c2abdbf 100644
--- a/mt7915/mt7915.h
+++ b/mt7915/mt7915.h
@@ -195,6 +195,45 @@ struct mt7915_hif {
@@ -199,6 +199,57 @@ struct mt7915_hif {
int irq;
};
@@ -502,25 +586,41 @@ index 398f851..5a26335 100644
+
+ struct list_head node;
+};
+struct csi_mac_filter {
+ struct list_head node;
+
+ u8 mac[ETH_ALEN];
+ u32 interval;
+};
+
+#define DEL_CSI_MAC 0
+#define ADD_CSI_MAC 1
+#define SHOW_CSI_MAC 2
+
+#define MAX_CSI_MAC_NUM 10
+#endif
+
struct mt7915_phy {
struct mt76_phy *mt76;
struct mt7915_dev *dev;
@@ -243,6 +282,21 @@ struct mt7915_phy {
@@ -247,6 +298,25 @@ struct mt7915_phy {
u8 spe_idx;
} test;
#endif
+
+#ifdef CONFIG_MTK_VENDOR
+ struct {
+ struct list_head csi_list;
+ spinlock_t csi_lock; /* used for csi data push/pop */
+ struct list_head data_list;
+ spinlock_t data_lock;
+ u32 count;
+ bool mask;
+ bool reorder;
+ bool enable;
+
+ struct mutex mac_filter_lock;
+ struct list_head mac_filter_list;
+ u8 mac_filter_cnt;
+
+ struct csi_data buffered_csi;
+ u32 interval;
+ u32 last_record;
@@ -529,7 +629,7 @@ index 398f851..5a26335 100644
};
#ifdef MTK_DEBUG
@@ -647,6 +701,12 @@ void mt7915_sta_add_debugfs(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
@@ -650,6 +720,14 @@ void mt7915_sta_add_debugfs(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
int mt7915_mmio_wed_init(struct mt7915_dev *dev, void *pdev_ptr,
bool pci, int *irq);
@@ -537,6 +637,8 @@ index 398f851..5a26335 100644
+void mt7915_vendor_register(struct mt7915_phy *phy);
+int mt7915_mcu_set_csi(struct mt7915_phy *phy, u8 mode,
+ u8 cfg, u8 v1, u32 v2, u8 *mac_addr, u32 sta_interval);
+struct csi_mac_filter *mt7915_csi_mac_filter_find(struct mt7915_phy *phy, u8 *addr);
+void mt7915_csi_mac_filter_clear(struct mt7915_phy *phy);
+#endif
+
#ifdef MTK_DEBUG
@@ -544,10 +646,10 @@ index 398f851..5a26335 100644
int mt7915_dbg_mcu_wa_cmd(struct mt7915_dev *dev, int cmd, u32 a1, u32 a2, u32 a3, bool wait_resp);
diff --git a/mt7915/vendor.c b/mt7915/vendor.c
new file mode 100644
index 0000000..55da60a
index 00000000..92496513
--- /dev/null
+++ b/mt7915/vendor.c
@@ -0,0 +1,470 @@
@@ -0,0 +1,606 @@
+// SPDX-License-Identifier: ISC
+/*
+ * Copyright (C) 2020, MediaTek Inc. All rights reserved.
@@ -571,6 +673,7 @@ index 0000000..55da60a
+ [MTK_VENDOR_ATTR_CSI_CTRL_STA_INTERVAL] = { .type = NLA_U32 },
+ [MTK_VENDOR_ATTR_CSI_CTRL_DUMP_NUM] = { .type = NLA_U16 },
+ [MTK_VENDOR_ATTR_CSI_CTRL_DATA] = { .type = NLA_NESTED },
+ [MTK_VENDOR_ATTR_CSI_CTRL_DUMP_MAC_FILTER] = { .type = NLA_NESTED },
+};
+
+struct csi_null_tone {
@@ -728,6 +831,67 @@ index 0000000..55da60a
+ return mode * 11 + ch_bw * ch_bw + (data_bw + 1) * 2 + pri_ch_idx;
+}
+
+struct csi_mac_filter *mt7915_csi_mac_filter_find(struct mt7915_phy *phy, u8 *addr)
+{
+ struct csi_mac_filter *ent, *tmp_ent;
+
+ list_for_each_entry_safe(ent, tmp_ent, &phy->csi.mac_filter_list, node) {
+ if (ether_addr_equal(ent->mac, addr))
+ return ent;
+ }
+
+ return NULL;
+}
+
+void mt7915_csi_mac_filter_clear(struct mt7915_phy *phy)
+{
+ struct csi_mac_filter *ent, *tmp_ent;
+ list_for_each_entry_safe(ent, tmp_ent, &phy->csi.mac_filter_list, node) {
+ list_del(&ent->node);
+ kfree(ent);
+ }
+
+ phy->csi.mac_filter_cnt = 0;
+}
+
+static int mt7915_vendor_reply_csi_mac_filter(struct wiphy *wiphy, struct mt7915_phy *phy)
+{
+ struct sk_buff *skb;
+ struct csi_mac_filter *ent, *tmp_ent;
+ int idx = 0;
+ struct nlattr *a, *b;
+
+ mutex_lock(&phy->csi.mac_filter_lock);
+
+#define ENTRY_SIZE nla_total_size(nla_total_size(ETH_ALEN) + \
+ nla_total_size(sizeof(ent->interval)))
+
+ skb = cfg80211_vendor_cmd_alloc_reply_skb(wiphy, ENTRY_SIZE *
+ phy->csi.mac_filter_cnt);
+ if (!skb) {
+ mutex_unlock(&phy->csi.mac_filter_lock);
+ return -ENOMEM;
+ }
+
+ a = nla_nest_start(skb, MTK_VENDOR_ATTR_CSI_CTRL_DUMP_MAC_FILTER);
+
+ list_for_each_entry_safe(ent, tmp_ent, &phy->csi.mac_filter_list, node) {
+
+ b = nla_nest_start(skb, idx++);
+ nla_put(skb, MTK_VENDOR_ATTR_CSI_MAC_FILTER_MAC,
+ ETH_ALEN, ent->mac);
+ nla_put_u32(skb, MTK_VENDOR_ATTR_CSI_MAC_FILTER_INTERVAL, ent->interval);
+ nla_nest_end(skb, b);
+ }
+
+ nla_nest_end(skb, a);
+#undef ENTRY_SIZE
+
+ mutex_unlock(&phy->csi.mac_filter_lock);
+
+ return cfg80211_vendor_cmd_reply(skb);
+}
+
+static int mt7915_vendor_csi_ctrl(struct wiphy *wiphy,
+ struct wireless_dev *wdev,
+ const void *data,
@@ -787,12 +951,86 @@ index 0000000..55da60a
+ nla_get_u32(tb[MTK_VENDOR_ATTR_CSI_CTRL_STA_INTERVAL]);
+ }
+
+ err = mt7915_mcu_set_csi(phy, mode, type, v1, v2, mac_addr, sta_interval);
+ if (mode == 0) {
+ mutex_lock(&phy->csi.mac_filter_lock);
+
+ if (err < 0)
+ return err;
+ err = mt7915_mcu_set_csi(phy, mode, type, v1, v2,
+ mac_addr, sta_interval);
+ if (err) {
+ mutex_unlock(&phy->csi.mac_filter_lock);
+ return err;
+ }
+
+ spin_lock_bh(&phy->csi.csi_lock);
+ mt7915_csi_mac_filter_clear(phy);
+
+ mutex_unlock(&phy->csi.mac_filter_lock);
+ } else if (mode == 2 && type == 8 && v1 == 1 && (v2 == ADD_CSI_MAC || v2 == DEL_CSI_MAC)) {
+ struct csi_mac_filter *ent;
+
+ mutex_lock(&phy->csi.mac_filter_lock);
+
+ if (v2 == DEL_CSI_MAC) {
+ ent = mt7915_csi_mac_filter_find(phy, mac_addr);
+ if (!ent) {
+ mutex_unlock(&phy->csi.mac_filter_lock);
+ return -ENOENT;
+ }
+ } else {
+ if (is_mt7915(phy->mt76->dev)) {
+ if (phy->csi.mac_filter_cnt >= MAX_CSI_MAC_NUM) {
+ mutex_unlock(&phy->csi.mac_filter_lock);
+ return -ENOSPC;
+ }
+ } else {
+ if (phy->csi.mac_filter_cnt >= MAX_CSI_MAC_NUM/2) {
+ mutex_unlock(&phy->csi.mac_filter_lock);
+ return -ENOSPC;
+ }
+ }
+
+ ent = mt7915_csi_mac_filter_find(phy, mac_addr);
+ if (ent) {
+ mutex_unlock(&phy->csi.mac_filter_lock);
+ return -EEXIST;
+ }
+
+ ent = kzalloc(sizeof(*ent), GFP_KERNEL);
+ if (!ent) {
+ mutex_unlock(&phy->csi.mac_filter_lock);
+ return -ENOMEM;
+ }
+
+ ether_addr_copy(ent->mac, mac_addr);
+ ent->interval = sta_interval;
+ }
+
+ err = mt7915_mcu_set_csi(phy, mode, type, v1, v2,
+ mac_addr, sta_interval);
+ if (err) {
+ if (v2 == ADD_CSI_MAC)
+ kfree(ent);
+ mutex_unlock(&phy->csi.mac_filter_lock);
+ return err;
+ }
+
+ if (v2 == DEL_CSI_MAC) {
+ list_del(&ent->node);
+ kfree(ent);
+ phy->csi.mac_filter_cnt--;
+ } else {
+ list_add_tail(&ent->node, &phy->csi.mac_filter_list);
+ phy->csi.mac_filter_cnt++;
+ }
+
+ mutex_unlock(&phy->csi.mac_filter_lock);
+ } else if (mode == 2 && type == 8 && v1 == 1 && v2 == SHOW_CSI_MAC) {
+ return mt7915_vendor_reply_csi_mac_filter(wiphy, phy);
+ } else {
+ err = mt7915_mcu_set_csi(phy, mode, type, v1, v2,
+ mac_addr, sta_interval);
+ if (err)
+ return err;
+ }
+
+ phy->csi.enable = !!mode;
+
@@ -804,20 +1042,20 @@ index 0000000..55da60a
+ }
+
+ /* clean up old csi stats */
+ if ((mode == 0 || mode == 2) && !list_empty(&phy->csi.csi_list)) {
+ if (mode == 0 && !list_empty(&phy->csi.data_list)) {
+ struct csi_data *c, *tmp_c;
+
+ list_for_each_entry_safe(c, tmp_c, &phy->csi.csi_list,
+ spin_lock_bh(&phy->csi.data_lock);
+ list_for_each_entry_safe(c, tmp_c, &phy->csi.data_list,
+ node) {
+ list_del(&c->node);
+ kfree(c);
+ phy->csi.count--;
+ }
+ spin_unlock_bh(&phy->csi.data_lock);
+ } else if (mode == 1) {
+ phy->csi.last_record = 0;
+ }
+
+ spin_unlock_bh(&phy->csi.csi_lock);
+ }
+
+ if (tb[MTK_VENDOR_ATTR_CSI_CTRL_INTERVAL])
@@ -933,14 +1171,14 @@ index 0000000..55da60a
+ *storage |= RESERVED_SET;
+ }
+
+ spin_lock_bh(&phy->csi.csi_lock);
+ spin_lock_bh(&phy->csi.data_lock);
+
+ if (!list_empty(&phy->csi.csi_list)) {
+ if (!list_empty(&phy->csi.data_list)) {
+ struct csi_data *csi;
+ void *a, *b;
+ int i;
+
+ csi = list_first_entry(&phy->csi.csi_list, struct csi_data, node);
+ csi = list_first_entry(&phy->csi.data_list, struct csi_data, node);
+
+ mt7915_vendor_csi_tone_mask(phy, csi);
+
@@ -993,7 +1231,7 @@ index 0000000..55da60a
+ err = phy->csi.count;
+ }
+out:
+ spin_unlock_bh(&phy->csi.csi_lock);
+ spin_unlock_bh(&phy->csi.data_lock);
+
+ return err;
+}
@@ -1020,10 +1258,10 @@ index 0000000..55da60a
+}
diff --git a/mt7915/vendor.h b/mt7915/vendor.h
new file mode 100644
index 0000000..e1f5fd3
index 00000000..d2b90aa0
--- /dev/null
+++ b/mt7915/vendor.h
@@ -0,0 +1,63 @@
@@ -0,0 +1,75 @@
+/* SPDX-License-Identifier: ISC */
+#ifndef __MT7915_VENDOR_H
+#define __MT7915_VENDOR_H
@@ -1049,6 +1287,7 @@ index 0000000..e1f5fd3
+ MTK_VENDOR_ATTR_CSI_CTRL_DUMP_NUM,
+
+ MTK_VENDOR_ATTR_CSI_CTRL_DATA,
+ MTK_VENDOR_ATTR_CSI_CTRL_DUMP_MAC_FILTER,
+
+ /* keep last */
+ NUM_MTK_VENDOR_ATTRS_CSI_CTRL,
@@ -1086,7 +1325,18 @@ index 0000000..e1f5fd3
+ NUM_MTK_VENDOR_ATTRS_CSI_DATA - 1
+};
+
+enum mtk_vendor_attr_csi_mac_filter {
+ MTK_VENDOR_ATTR_CSI_MAC_FILTER_UNSPEC,
+
+ MTK_VENDOR_ATTR_CSI_MAC_FILTER_MAC,
+ MTK_VENDOR_ATTR_CSI_MAC_FILTER_INTERVAL,
+
+ /* keep last */
+ NUM_MTK_VENDOR_ATTRS_CSI_MAC_FILTER,
+ MTK_VENDOR_ATTR_CSI_MAC_FILTER_MAX =
+ NUM_MTK_VENDOR_ATTRS_CSI_MAC_FILTER - 1
+};
+#endif
--
2.18.0
2.45.2

View File

@@ -1,22 +1,22 @@
From 1a63c07be0a813d1342346c937cd2f949439b837 Mon Sep 17 00:00:00 2001
From 3ae462a794ae2a8b613c23aa6179cf5c7b2f7b3c Mon Sep 17 00:00:00 2001
From: Bo Jiao <Bo.Jiao@mediatek.com>
Date: Tue, 11 Jan 2022 12:03:23 +0800
Subject: [PATCH] wifi: mt76: mt7915: air monitor support
Subject: [PATCH 1002/1052] wifi: mt76: mt7915: air monitor support
---
mt76_connac_mcu.h | 2 +
mt7915/mac.c | 4 +
mt7915/main.c | 3 +
mt7915/mt7915.h | 32 ++++
mt7915/mt7915.h | 33 +++++
mt7915/vendor.c | 361 ++++++++++++++++++++++++++++++++++++++++++++++
mt7915/vendor.h | 38 +++++
6 files changed, 440 insertions(+)
6 files changed, 441 insertions(+)
diff --git a/mt76_connac_mcu.h b/mt76_connac_mcu.h
index cda7559..3aa4e59 100644
index ad63596d..cd6db774 100644
--- a/mt76_connac_mcu.h
+++ b/mt76_connac_mcu.h
@@ -1243,6 +1243,8 @@ enum {
@@ -1245,6 +1245,8 @@ enum {
MCU_EXT_CMD_GROUP_PRE_CAL_INFO = 0xab,
MCU_EXT_CMD_DPD_PRE_CAL_INFO = 0xac,
MCU_EXT_CMD_PHY_STAT_INFO = 0xad,
@@ -26,7 +26,7 @@ index cda7559..3aa4e59 100644
MCU_EXT_CMD_CSI_CTRL = 0xc2,
};
diff --git a/mt7915/mac.c b/mt7915/mac.c
index d99864f..e38905a 100644
index 8268c19a..778f04f7 100644
--- a/mt7915/mac.c
+++ b/mt7915/mac.c
@@ -531,6 +531,10 @@ mt7915_mac_fill_rx(struct mt7915_dev *dev, struct sk_buff *skb,
@@ -41,7 +41,7 @@ index d99864f..e38905a 100644
status->flag |= RX_FLAG_8023;
mt7915_wed_check_ppe(dev, &dev->mt76.q_rx[q], msta, skb,
diff --git a/mt7915/main.c b/mt7915/main.c
index 4edb11a..847c74b 100644
index 12bb0b39..aca3e9c0 100644
--- a/mt7915/main.c
+++ b/mt7915/main.c
@@ -800,6 +800,9 @@ int mt7915_mac_sta_add(struct mt76_dev *mdev, struct ieee80211_vif *vif,
@@ -55,13 +55,21 @@ index 4edb11a..847c74b 100644
}
diff --git a/mt7915/mt7915.h b/mt7915/mt7915.h
index 5a26335..576e70a 100644
index 1316f93d..bb39a53a 100644
--- a/mt7915/mt7915.h
+++ b/mt7915/mt7915.h
@@ -232,6 +232,33 @@ struct csi_data {
@@ -232,6 +232,7 @@ struct csi_data {
struct list_head node;
};
+
struct csi_mac_filter {
struct list_head node;
@@ -244,6 +245,33 @@ struct csi_mac_filter {
#define SHOW_CSI_MAC 2
#define MAX_CSI_MAC_NUM 10
+
+#define MT7915_AIR_MONITOR_MAX_ENTRY 16
+#define MT7915_AIR_MONITOR_MAX_GROUP MT7915_AIR_MONITOR_MAX_ENTRY >> 1
@@ -92,7 +100,7 @@ index 5a26335..576e70a 100644
#endif
struct mt7915_phy {
@@ -296,6 +323,8 @@ struct mt7915_phy {
@@ -312,6 +340,8 @@ struct mt7915_phy {
u32 interval;
u32 last_record;
} csi;
@@ -101,10 +109,10 @@ index 5a26335..576e70a 100644
#endif
};
@@ -705,6 +734,9 @@ int mt7915_mmio_wed_init(struct mt7915_dev *dev, void *pdev_ptr,
void mt7915_vendor_register(struct mt7915_phy *phy);
int mt7915_mcu_set_csi(struct mt7915_phy *phy, u8 mode,
@@ -722,6 +752,9 @@ int mt7915_mcu_set_csi(struct mt7915_phy *phy, u8 mode,
u8 cfg, u8 v1, u32 v2, u8 *mac_addr, u32 sta_interval);
struct csi_mac_filter *mt7915_csi_mac_filter_find(struct mt7915_phy *phy, u8 *addr);
void mt7915_csi_mac_filter_clear(struct mt7915_phy *phy);
+void mt7915_vendor_amnt_fill_rx(struct mt7915_phy *phy, struct sk_buff *skb);
+int mt7915_vendor_amnt_sta_remove(struct mt7915_phy *phy,
+ struct ieee80211_sta *sta);
@@ -112,10 +120,10 @@ index 5a26335..576e70a 100644
#ifdef MTK_DEBUG
diff --git a/mt7915/vendor.c b/mt7915/vendor.c
index 55da60a..c964b14 100644
index 92496513..fb32cd6d 100644
--- a/mt7915/vendor.c
+++ b/mt7915/vendor.c
@@ -448,6 +448,355 @@ out:
@@ -584,6 +584,355 @@ out:
return err;
}
@@ -471,7 +479,7 @@ index 55da60a..c964b14 100644
static const struct wiphy_vendor_command mt7915_vendor_commands[] = {
{
.info = {
@@ -460,6 +809,18 @@ static const struct wiphy_vendor_command mt7915_vendor_commands[] = {
@@ -596,6 +945,18 @@ static const struct wiphy_vendor_command mt7915_vendor_commands[] = {
.dumpit = mt7915_vendor_csi_ctrl_dump,
.policy = csi_ctrl_policy,
.maxattr = MTK_VENDOR_ATTR_CSI_CTRL_MAX,
@@ -491,7 +499,7 @@ index 55da60a..c964b14 100644
};
diff --git a/mt7915/vendor.h b/mt7915/vendor.h
index e1f5fd3..1863eee 100644
index d2b90aa0..429b25b7 100644
--- a/mt7915/vendor.h
+++ b/mt7915/vendor.h
@@ -5,6 +5,7 @@
@@ -502,10 +510,11 @@ index e1f5fd3..1863eee 100644
MTK_NL80211_VENDOR_SUBCMD_CSI_CTRL = 0xc2,
};
@@ -60,4 +61,41 @@ enum mtk_vendor_attr_csi_data {
NUM_MTK_VENDOR_ATTRS_CSI_DATA - 1
@@ -72,4 +73,41 @@ enum mtk_vendor_attr_csi_mac_filter {
MTK_VENDOR_ATTR_CSI_MAC_FILTER_MAX =
NUM_MTK_VENDOR_ATTRS_CSI_MAC_FILTER - 1
};
+
+enum mtk_vendor_attr_mnt_ctrl {
+ MTK_VENDOR_ATTR_AMNT_CTRL_UNSPEC,
+
@@ -542,7 +551,6 @@ index e1f5fd3..1863eee 100644
+ MTK_VENDOR_ATTR_AMNT_DUMP_MAX =
+ NUM_MTK_VENDOR_ATTRS_AMNT_DUMP - 1
+};
+
#endif
--
2.18.0

View File

@@ -1,7 +1,7 @@
From a0249520b2ff800bcff8ed1f8531dddccc97d29b Mon Sep 17 00:00:00 2001
From 6ec4565becc5364a689b346496c7caaef98f83e9 Mon Sep 17 00:00:00 2001
From: Evelyn Tsai <evelyn.tsai@mediatek.com>
Date: Tue, 4 Apr 2023 02:23:57 +0800
Subject: [PATCH 1003/1053] wifi: mt76: mt7915: add support for muru_onoff via
Subject: [PATCH 1003/1052] wifi: mt76: mt7915: add support for muru_onoff via
---
mt7915/init.c | 1 +
@@ -12,10 +12,10 @@ Subject: [PATCH 1003/1053] wifi: mt76: mt7915: add support for muru_onoff via
5 files changed, 50 insertions(+), 2 deletions(-)
diff --git a/mt7915/init.c b/mt7915/init.c
index 6d23dfd..fc42974 100644
index ac15bc53..18c6ef7e 100644
--- a/mt7915/init.c
+++ b/mt7915/init.c
@@ -363,6 +363,7 @@ mt7915_init_wiphy(struct mt7915_phy *phy)
@@ -364,6 +364,7 @@ mt7915_init_wiphy(struct mt7915_phy *phy)
IEEE80211_RADIOTAP_TIMESTAMP_UNIT_US;
phy->slottime = 9;
@@ -24,7 +24,7 @@ index 6d23dfd..fc42974 100644
hw->sta_data_size = sizeof(struct mt7915_sta);
hw->vif_data_size = sizeof(struct mt7915_vif);
diff --git a/mt7915/mcu.c b/mt7915/mcu.c
index 9baf52b..6f73a7b 100644
index 44765b1f..6867635f 100644
--- a/mt7915/mcu.c
+++ b/mt7915/mcu.c
@@ -965,6 +965,7 @@ mt7915_mcu_sta_muru_tlv(struct mt7915_dev *dev, struct sk_buff *skb,
@@ -57,7 +57,7 @@ index 9baf52b..6f73a7b 100644
muru->mimo_dl.vht_mu_bfee =
!!(sta->deflink.vht_cap.cap & IEEE80211_VHT_CAP_MU_BEAMFORMEE_CAPABLE);
diff --git a/mt7915/mcu.h b/mt7915/mcu.h
index f32d525..f44146e 100644
index f32d5256..f44146ed 100644
--- a/mt7915/mcu.h
+++ b/mt7915/mcu.h
@@ -678,4 +678,10 @@ enum CSI_CHAIN_TYPE {
@@ -72,10 +72,10 @@ index f32d525..f44146e 100644
+
#endif
diff --git a/mt7915/mt7915.h b/mt7915/mt7915.h
index 35ccfa3..e21a101 100644
index bb39a53a..14107de3 100644
--- a/mt7915/mt7915.h
+++ b/mt7915/mt7915.h
@@ -289,6 +289,8 @@ struct mt7915_phy {
@@ -302,6 +302,8 @@ struct mt7915_phy {
u32 rx_ampdu_ts;
u32 ampdu_ref;
@@ -85,7 +85,7 @@ index 35ccfa3..e21a101 100644
struct mt76_channel_state state_ts;
diff --git a/mt7915/mtk_debugfs.c b/mt7915/mtk_debugfs.c
index d2b5b7d..f521740 100644
index 665d8bd4..0beb3644 100644
--- a/mt7915/mtk_debugfs.c
+++ b/mt7915/mtk_debugfs.c
@@ -2554,6 +2554,38 @@ static int mt7915_token_txd_read(struct seq_file *s, void *data)

View File

@@ -1,7 +1,7 @@
From e98f4b4ccc941705436b9cdfbd22b2e72b2ef055 Mon Sep 17 00:00:00 2001
From 230a5ba21216bb292f2fb1b0cf2236e2e14de2ca Mon Sep 17 00:00:00 2001
From: MeiChia Chiu <meichia.chiu@mediatek.com>
Date: Mon, 6 Jun 2022 20:15:51 +0800
Subject: [PATCH] wifi: mt76: mt7915: certification patches
Subject: [PATCH 1004/1052] wifi: mt76: mt7915: certification patches
---
mt76_connac_mcu.h | 1 +
@@ -16,10 +16,10 @@ Subject: [PATCH] wifi: mt76: mt7915: certification patches
9 files changed, 955 insertions(+), 5 deletions(-)
diff --git a/mt76_connac_mcu.h b/mt76_connac_mcu.h
index 3aa4e59..d62b7df 100644
index cd6db774..bd28cc50 100644
--- a/mt76_connac_mcu.h
+++ b/mt76_connac_mcu.h
@@ -1246,6 +1246,7 @@ enum {
@@ -1248,6 +1248,7 @@ enum {
/* for vendor csi and air monitor */
MCU_EXT_CMD_SMESH_CTRL = 0xae,
MCU_EXT_CMD_SET_QOS_MAP = 0xb4,
@@ -28,7 +28,7 @@ index 3aa4e59..d62b7df 100644
};
diff --git a/mt7915/mac.c b/mt7915/mac.c
index e38905a..43cff27 100644
index 778f04f7..2fd1d1fb 100644
--- a/mt7915/mac.c
+++ b/mt7915/mac.c
@@ -8,6 +8,7 @@
@@ -39,7 +39,7 @@ index e38905a..43cff27 100644
#define to_rssi(field, rcpi) ((FIELD_GET(field, rcpi) - 220) / 2)
@@ -2002,6 +2003,21 @@ static void mt7915_mac_sta_stats_work(struct mt7915_phy *phy)
@@ -1961,6 +1962,21 @@ static void mt7915_mac_sta_stats_work(struct mt7915_phy *phy)
spin_unlock_bh(&phy->stats_lock);
}
@@ -61,7 +61,7 @@ index e38905a..43cff27 100644
void mt7915_mac_sta_rc_work(struct work_struct *work)
{
struct mt7915_dev *dev = container_of(work, struct mt7915_dev, rc_work);
@@ -2024,6 +2040,13 @@ void mt7915_mac_sta_rc_work(struct work_struct *work)
@@ -1983,6 +1999,13 @@ void mt7915_mac_sta_rc_work(struct work_struct *work)
sta = container_of((void *)msta, struct ieee80211_sta, drv_priv);
vif = container_of((void *)msta->vif, struct ieee80211_vif, drv_priv);
@@ -76,7 +76,7 @@ index e38905a..43cff27 100644
IEEE80211_RC_NSS_CHANGED |
IEEE80211_RC_BW_CHANGED))
diff --git a/mt7915/main.c b/mt7915/main.c
index 847c74b..8835cda 100644
index aca3e9c0..09e1a83b 100644
--- a/mt7915/main.c
+++ b/mt7915/main.c
@@ -771,6 +771,9 @@ int mt7915_mac_sta_add(struct mt76_dev *mdev, struct ieee80211_vif *vif,
@@ -107,7 +107,7 @@ index 847c74b..8835cda 100644
void mt7915_mac_sta_remove(struct mt76_dev *mdev, struct ieee80211_vif *vif,
diff --git a/mt7915/mcu.c b/mt7915/mcu.c
index b38c3d1..b50a2c2 100644
index 6867635f..c819a3be 100644
--- a/mt7915/mcu.c
+++ b/mt7915/mcu.c
@@ -4402,6 +4402,472 @@ mt7915_mcu_report_csi(struct mt7915_dev *dev, struct sk_buff *skb)
@@ -584,7 +584,7 @@ index b38c3d1..b50a2c2 100644
#ifdef MTK_DEBUG
diff --git a/mt7915/mcu.h b/mt7915/mcu.h
index f44146e..eef2fc0 100644
index f44146ed..eef2fc00 100644
--- a/mt7915/mcu.h
+++ b/mt7915/mcu.h
@@ -486,10 +486,14 @@ enum {
@@ -818,10 +818,10 @@ index f44146e..eef2fc0 100644
#endif
diff --git a/mt7915/mt7915.h b/mt7915/mt7915.h
index 30fb064..136e89f 100644
index 14107de3..cf49ac86 100644
--- a/mt7915/mt7915.h
+++ b/mt7915/mt7915.h
@@ -733,6 +733,19 @@ int mt7915_mmio_wed_init(struct mt7915_dev *dev, void *pdev_ptr,
@@ -749,6 +749,19 @@ int mt7915_mmio_wed_init(struct mt7915_dev *dev, void *pdev_ptr,
bool pci, int *irq);
#ifdef CONFIG_MTK_VENDOR
@@ -842,7 +842,7 @@ index 30fb064..136e89f 100644
int mt7915_mcu_set_csi(struct mt7915_phy *phy, u8 mode,
u8 cfg, u8 v1, u32 v2, u8 *mac_addr, u32 sta_interval);
diff --git a/mt7915/mtk_debugfs.c b/mt7915/mtk_debugfs.c
index 2f55a84..84f8fae 100644
index 0beb3644..54daa736 100644
--- a/mt7915/mtk_debugfs.c
+++ b/mt7915/mtk_debugfs.c
@@ -2560,7 +2560,8 @@ static int mt7915_muru_onoff_get(void *data, u64 *val)
@@ -867,11 +867,11 @@ index 2f55a84..84f8fae 100644
}
diff --git a/mt7915/vendor.c b/mt7915/vendor.c
index c964b14..7a71894 100644
index fb32cd6d..e4317af3 100644
--- a/mt7915/vendor.c
+++ b/mt7915/vendor.c
@@ -23,6 +23,29 @@ csi_ctrl_policy[NUM_MTK_VENDOR_ATTRS_CSI_CTRL] = {
[MTK_VENDOR_ATTR_CSI_CTRL_DATA] = { .type = NLA_NESTED },
@@ -24,6 +24,29 @@ csi_ctrl_policy[NUM_MTK_VENDOR_ATTRS_CSI_CTRL] = {
[MTK_VENDOR_ATTR_CSI_CTRL_DUMP_MAC_FILTER] = { .type = NLA_NESTED },
};
+static const struct nla_policy
@@ -900,7 +900,7 @@ index c964b14..7a71894 100644
struct csi_null_tone {
u8 start;
u8 end;
@@ -797,6 +820,149 @@ mt7915_vendor_amnt_ctrl_dump(struct wiphy *wiphy, struct wireless_dev *wdev,
@@ -933,6 +956,149 @@ mt7915_vendor_amnt_ctrl_dump(struct wiphy *wiphy, struct wireless_dev *wdev,
return len + 1;
}
@@ -1050,7 +1050,7 @@ index c964b14..7a71894 100644
static const struct wiphy_vendor_command mt7915_vendor_commands[] = {
{
.info = {
@@ -821,6 +987,28 @@ static const struct wiphy_vendor_command mt7915_vendor_commands[] = {
@@ -957,6 +1123,28 @@ static const struct wiphy_vendor_command mt7915_vendor_commands[] = {
.dumpit = mt7915_vendor_amnt_ctrl_dump,
.policy = amnt_ctrl_policy,
.maxattr = MTK_VENDOR_ATTR_AMNT_CTRL_MAX,
@@ -1080,7 +1080,7 @@ index c964b14..7a71894 100644
};
diff --git a/mt7915/vendor.h b/mt7915/vendor.h
index 1863eee..1a18cae 100644
index 429b25b7..1a0139d7 100644
--- a/mt7915/vendor.h
+++ b/mt7915/vendor.h
@@ -7,6 +7,48 @@

View File

@@ -1,7 +1,7 @@
From 7f14adae86830929258aad73e8290a7fd2b4e03e Mon Sep 17 00:00:00 2001
From d6ae847c0cea20f781970198a2aed4dc7e4daffa Mon Sep 17 00:00:00 2001
From: Evelyn Tsai <evelyn.tsai@mediatek.com>
Date: Tue, 4 Apr 2023 02:27:44 +0800
Subject: [PATCH 1005/1053] wifi: mt76: mt7915: add mt76 vendor muru onoff
Subject: [PATCH 1005/1052] wifi: mt76: mt7915: add mt76 vendor muru onoff
command
---
@@ -12,7 +12,7 @@ Subject: [PATCH 1005/1053] wifi: mt76: mt7915: add mt76 vendor muru onoff
4 files changed, 63 insertions(+)
diff --git a/mt7915/mcu.c b/mt7915/mcu.c
index cd533ae..63fb826 100644
index c819a3be..cd5363c6 100644
--- a/mt7915/mcu.c
+++ b/mt7915/mcu.c
@@ -4422,6 +4422,13 @@ void mt7915_set_wireless_vif(void *data, u8 *mac, struct ieee80211_vif *vif)
@@ -30,7 +30,7 @@ index cd533ae..63fb826 100644
}
diff --git a/mt7915/mcu.h b/mt7915/mcu.h
index eef2fc0..8650053 100644
index eef2fc00..86500536 100644
--- a/mt7915/mcu.h
+++ b/mt7915/mcu.h
@@ -493,6 +493,7 @@ enum {
@@ -42,10 +42,10 @@ index eef2fc0..8650053 100644
};
diff --git a/mt7915/vendor.c b/mt7915/vendor.c
index 7a71894..a8b1fa8 100644
index e4317af3..cf09b513 100644
--- a/mt7915/vendor.c
+++ b/mt7915/vendor.c
@@ -35,6 +35,11 @@ wireless_ctrl_policy[NUM_MTK_VENDOR_ATTRS_WIRELESS_CTRL] = {
@@ -36,6 +36,11 @@ wireless_ctrl_policy[NUM_MTK_VENDOR_ATTRS_WIRELESS_CTRL] = {
[MTK_VENDOR_ATTR_WIRELESS_CTRL_CERT] = {.type = NLA_U8 },
};
@@ -57,7 +57,7 @@ index 7a71894..a8b1fa8 100644
static const struct nla_policy
rfeature_ctrl_policy[NUM_MTK_VENDOR_ATTRS_RFEATURE_CTRL] = {
[MTK_VENDOR_ATTR_RFEATURE_CTRL_HE_GI] = {.type = NLA_U8 },
@@ -963,6 +968,33 @@ static int mt7915_vendor_wireless_ctrl(struct wiphy *wiphy,
@@ -1099,6 +1104,33 @@ static int mt7915_vendor_wireless_ctrl(struct wiphy *wiphy,
return 0;
}
@@ -91,7 +91,7 @@ index 7a71894..a8b1fa8 100644
static const struct wiphy_vendor_command mt7915_vendor_commands[] = {
{
.info = {
@@ -1009,6 +1041,17 @@ static const struct wiphy_vendor_command mt7915_vendor_commands[] = {
@@ -1145,6 +1177,17 @@ static const struct wiphy_vendor_command mt7915_vendor_commands[] = {
.doit = mt7915_vendor_wireless_ctrl,
.policy = wireless_ctrl_policy,
.maxattr = MTK_VENDOR_ATTR_WIRELESS_CTRL_MAX,
@@ -110,7 +110,7 @@ index 7a71894..a8b1fa8 100644
};
diff --git a/mt7915/vendor.h b/mt7915/vendor.h
index 1a18cae..a4a9180 100644
index 1a0139d7..9cb67551 100644
--- a/mt7915/vendor.h
+++ b/mt7915/vendor.h
@@ -9,6 +9,7 @@ enum mtk_nl80211_vendor_subcmds {

View File

@@ -1,14 +1,14 @@
From 3b76edcb079437bf742c4442c4db4609cf10d6b6 Mon Sep 17 00:00:00 2001
From d48d6a0643e5be590744db4173e14c87f4945390 Mon Sep 17 00:00:00 2001
From: Peter Chiu <chui-hao.chiu@mediatek.com>
Date: Thu, 14 Apr 2022 15:18:02 +0800
Subject: [PATCH 1006/1053] wifi: mt76: mt7915: drop undefined action frame
Subject: [PATCH 1006/1052] wifi: mt76: mt7915: drop undefined action frame
---
mt7915/mac.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/mt7915/mac.c b/mt7915/mac.c
index 43cff27..6b99437 100644
index 2fd1d1fb..4177d6a3 100644
--- a/mt7915/mac.c
+++ b/mt7915/mac.c
@@ -744,6 +744,8 @@ int mt7915_tx_prepare_skb(struct mt76_dev *mdev, void *txwi_ptr,

View File

@@ -1,7 +1,7 @@
From 6668ef935f03e166732511ed063f706b9139cd19 Mon Sep 17 00:00:00 2001
From bbbac8090c06fd110f3770d99e7993017101cfd0 Mon Sep 17 00:00:00 2001
From: Shayne Chen <shayne.chen@mediatek.com>
Date: Mon, 6 Jun 2022 19:46:26 +0800
Subject: [PATCH 1007/1053] wifi: mt76: testmode: rework testmode init
Subject: [PATCH 1007/1052] wifi: mt76: testmode: rework testmode init
registers
---
@@ -18,10 +18,10 @@ Subject: [PATCH 1007/1053] wifi: mt76: testmode: rework testmode init
10 files changed, 164 insertions(+), 35 deletions(-)
diff --git a/mac80211.c b/mac80211.c
index b30a74e..3f5c2ed 100644
index 4d50bfae..9ebb2746 100644
--- a/mac80211.c
+++ b/mac80211.c
@@ -804,7 +804,8 @@ void mt76_rx(struct mt76_dev *dev, enum mt76_rxq_id q, struct sk_buff *skb)
@@ -805,7 +805,8 @@ void mt76_rx(struct mt76_dev *dev, enum mt76_rxq_id q, struct sk_buff *skb)
}
#ifdef CONFIG_NL80211_TESTMODE
@@ -32,7 +32,7 @@ index b30a74e..3f5c2ed 100644
if (status->flag & RX_FLAG_FAILED_FCS_CRC)
phy->test.rx_stats.fcs_error[q]++;
diff --git a/mt76.h b/mt76.h
index a07c7df..fe5b136 100644
index 063fc364..329e4d7a 100644
--- a/mt76.h
+++ b/mt76.h
@@ -709,6 +709,8 @@ struct mt76_testmode_ops {
@@ -62,10 +62,10 @@ index a07c7df..fe5b136 100644
};
diff --git a/mt76_connac_mcu.h b/mt76_connac_mcu.h
index 53262ce..75cb4e9 100644
index bd28cc50..f5edeef6 100644
--- a/mt76_connac_mcu.h
+++ b/mt76_connac_mcu.h
@@ -1239,6 +1239,7 @@ enum {
@@ -1241,6 +1241,7 @@ enum {
MCU_EXT_CMD_OFFCH_SCAN_CTRL = 0x9a,
MCU_EXT_CMD_SET_RDD_TH = 0x9d,
MCU_EXT_CMD_MURU_CTRL = 0x9f,
@@ -74,7 +74,7 @@ index 53262ce..75cb4e9 100644
MCU_EXT_CMD_GROUP_PRE_CAL_INFO = 0xab,
MCU_EXT_CMD_DPD_PRE_CAL_INFO = 0xac,
diff --git a/mt7915/mcu.h b/mt7915/mcu.h
index 8650053..7653b5e 100644
index 86500536..7653b5e2 100644
--- a/mt7915/mcu.h
+++ b/mt7915/mcu.h
@@ -9,6 +9,7 @@
@@ -86,7 +86,7 @@ index 8650053..7653b5e 100644
MCU_ATE_CLEAN_TXQUEUE = 0x1c,
};
diff --git a/mt7915/mmio.c b/mt7915/mmio.c
index 6004d64..694fc1b 100644
index d6ecd698..02b4714c 100644
--- a/mt7915/mmio.c
+++ b/mt7915/mmio.c
@@ -120,6 +120,7 @@ static const u32 mt7986_reg[] = {
@@ -106,7 +106,7 @@ index 6004d64..694fc1b 100644
[TMAC_ODTR] = 0x0cc,
[TMAC_ATCR] = 0x00c,
diff --git a/mt7915/regs.h b/mt7915/regs.h
index 3452a7e..8bb6a9f 100644
index 3452a7e9..8bb6a9f2 100644
--- a/mt7915/regs.h
+++ b/mt7915/regs.h
@@ -48,6 +48,7 @@ enum reg_rev {
@@ -154,7 +154,7 @@ index 3452a7e..8bb6a9f 100644
#define MT_AGG_ACR0(_band) MT_WF_AGG(_band, __OFFS(AGG_ACR0))
#define MT_AGG_ACR_CFEND_RATE GENMASK(13, 0)
diff --git a/mt7915/testmode.c b/mt7915/testmode.c
index 0d76ae3..4693919 100644
index 0d76ae31..46939191 100644
--- a/mt7915/testmode.c
+++ b/mt7915/testmode.c
@@ -30,7 +30,7 @@ struct reg_band {
@@ -379,7 +379,7 @@ index 0d76ae3..4693919 100644
const struct mt76_testmode_ops mt7915_testmode_ops = {
diff --git a/mt7915/testmode.h b/mt7915/testmode.h
index 5573ac3..a1c54c8 100644
index 5573ac30..a1c54c89 100644
--- a/mt7915/testmode.h
+++ b/mt7915/testmode.h
@@ -33,6 +33,12 @@ struct mt7915_tm_clean_txq {
@@ -430,7 +430,7 @@ index 5573ac3..a1c54c8 100644
+
#endif
diff --git a/testmode.c b/testmode.c
index ca4fecc..9e05b86 100644
index ca4feccf..9e05b862 100644
--- a/testmode.c
+++ b/testmode.c
@@ -448,8 +448,7 @@ int mt76_testmode_cmd(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
@@ -454,7 +454,7 @@ index ca4fecc..9e05b86 100644
return -EMSGSIZE;
diff --git a/testmode.h b/testmode.h
index 5e2792d..8961326 100644
index 5e2792d8..89613266 100644
--- a/testmode.h
+++ b/testmode.h
@@ -101,6 +101,8 @@ enum mt76_testmode_attr {

View File

@@ -1,4 +1,4 @@
From e6c4c7343a54ef607d8ceafa4615a32165c121fd Mon Sep 17 00:00:00 2001
From 5731c2406732aff2f7702091d197f15245ac375c Mon Sep 17 00:00:00 2001
From: Shayne Chen <shayne.chen@mediatek.com>
Date: Thu, 21 Apr 2022 15:43:19 +0800
Subject: [PATCH] wifi: mt76: testmode: additional supports
@@ -20,13 +20,13 @@ Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
mt7915/mmio.c | 2 +
mt7915/mt7915.h | 17 +-
mt7915/regs.h | 3 +
mt7915/testmode.c | 1244 ++++++++++++++++++++++++++++++++++++++++++---
mt7915/testmode.c | 1245 ++++++++++++++++++++++++++++++++++++++++++---
mt7915/testmode.h | 278 ++++++++++
testmode.c | 289 +++++++++--
testmode.h | 79 +++
testmode.h | 85 ++++
tools/fields.c | 90 +++-
tx.c | 3 +-
20 files changed, 2073 insertions(+), 169 deletions(-)
20 files changed, 2080 insertions(+), 169 deletions(-)
diff --git a/dma.c b/dma.c
index ccdd564..bc8afcf 100644
@@ -43,7 +43,7 @@ index ccdd564..bc8afcf 100644
#endif
diff --git a/mac80211.c b/mac80211.c
index 3f5c2ed..305cae7 100644
index 9ebb274..d6b7037 100644
--- a/mac80211.c
+++ b/mac80211.c
@@ -55,6 +55,13 @@ static const struct ieee80211_channel mt76_channels_5ghz[] = {
@@ -73,10 +73,10 @@ index 3f5c2ed..305cae7 100644
static const struct ieee80211_channel mt76_channels_6ghz[] = {
diff --git a/mt76.h b/mt76.h
index fe5b136..a7d424f 100644
index 6575dd2..e29df4e 100644
--- a/mt76.h
+++ b/mt76.h
@@ -707,6 +707,21 @@ struct mt76_testmode_ops {
@@ -714,6 +714,21 @@ struct mt76_testmode_ops {
int (*set_params)(struct mt76_phy *phy, struct nlattr **tb,
enum mt76_testmode_state new_state);
int (*dump_stats)(struct mt76_phy *phy, struct sk_buff *msg);
@@ -98,7 +98,7 @@ index fe5b136..a7d424f 100644
};
#define MT_TM_FW_RX_COUNT BIT(0)
@@ -715,16 +730,13 @@ struct mt76_testmode_data {
@@ -722,16 +737,13 @@ struct mt76_testmode_data {
enum mt76_testmode_state state;
u32 param_set[DIV_ROUND_UP(NUM_MT76_TM_ATTRS, 32)];
@@ -117,7 +117,7 @@ index fe5b136..a7d424f 100644
u8 tx_rate_stbc;
u8 tx_ltf;
@@ -740,10 +752,37 @@ struct mt76_testmode_data {
@@ -747,10 +759,37 @@ struct mt76_testmode_data {
u8 tx_power[4];
u8 tx_power_control;
@@ -156,7 +156,7 @@ index fe5b136..a7d424f 100644
u32 tx_pending;
u32 tx_queued;
u16 tx_queued_limit;
@@ -1348,6 +1387,68 @@ static inline bool mt76_testmode_enabled(struct mt76_phy *phy)
@@ -1355,6 +1394,68 @@ static inline bool mt76_testmode_enabled(struct mt76_phy *phy)
#endif
}
@@ -225,7 +225,7 @@ index fe5b136..a7d424f 100644
static inline bool mt76_is_testmode_skb(struct mt76_dev *dev,
struct sk_buff *skb,
struct ieee80211_hw **hw)
@@ -1358,7 +1459,8 @@ static inline bool mt76_is_testmode_skb(struct mt76_dev *dev,
@@ -1365,7 +1466,8 @@ static inline bool mt76_is_testmode_skb(struct mt76_dev *dev,
for (i = 0; i < ARRAY_SIZE(dev->phys); i++) {
struct mt76_phy *phy = dev->phys[i];
@@ -235,7 +235,7 @@ index fe5b136..a7d424f 100644
*hw = dev->phys[i]->hw;
return true;
}
@@ -1460,7 +1562,8 @@ int mt76_testmode_cmd(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
@@ -1467,7 +1569,8 @@ int mt76_testmode_cmd(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
int mt76_testmode_dump(struct ieee80211_hw *hw, struct sk_buff *skb,
struct netlink_callback *cb, void *data, int len);
int mt76_testmode_set_state(struct mt76_phy *phy, enum mt76_testmode_state state);
@@ -246,7 +246,7 @@ index fe5b136..a7d424f 100644
static inline void mt76_testmode_reset(struct mt76_phy *phy, bool disable)
{
diff --git a/mt76_connac_mcu.c b/mt76_connac_mcu.c
index a8f097d..44cd646 100644
index 4e84f8d..2acd7ef 100644
--- a/mt76_connac_mcu.c
+++ b/mt76_connac_mcu.c
@@ -407,6 +407,7 @@ void mt76_connac_mcu_sta_basic_tlv(struct mt76_dev *dev, struct sk_buff *skb,
@@ -268,10 +268,10 @@ index a8f097d..44cd646 100644
return;
diff --git a/mt76_connac_mcu.h b/mt76_connac_mcu.h
index 22d477f..0f408d9 100644
index f5edeef..152b4aa 100644
--- a/mt76_connac_mcu.h
+++ b/mt76_connac_mcu.h
@@ -1023,6 +1023,7 @@ enum {
@@ -1024,6 +1024,7 @@ enum {
MCU_EXT_EVENT_FW_LOG_2_HOST = 0x13,
MCU_EXT_EVENT_THERMAL_PROTECT = 0x22,
MCU_EXT_EVENT_ASSERT_DUMP = 0x23,
@@ -279,7 +279,7 @@ index 22d477f..0f408d9 100644
MCU_EXT_EVENT_RDD_REPORT = 0x3a,
MCU_EXT_EVENT_CSA_NOTIFY = 0x4f,
MCU_EXT_EVENT_BSS_ACQ_PKT_CNT = 0x52,
@@ -1246,6 +1247,7 @@ enum {
@@ -1248,6 +1249,7 @@ enum {
MCU_EXT_CMD_PHY_STAT_INFO = 0xad,
/* for vendor csi and air monitor */
MCU_EXT_CMD_SMESH_CTRL = 0xae,
@@ -301,10 +301,10 @@ index bfdbc15..f4876fe 100644
return ret;
}
diff --git a/mt7915/init.c b/mt7915/init.c
index 0350250..5c4aa1e 100644
index 18c6ef7..0c58ab7 100644
--- a/mt7915/init.c
+++ b/mt7915/init.c
@@ -727,7 +727,7 @@ static void mt7915_init_work(struct work_struct *work)
@@ -700,7 +700,7 @@ static void mt7915_init_work(struct work_struct *work)
struct mt7915_dev *dev = container_of(work, struct mt7915_dev,
init_work);
@@ -314,7 +314,7 @@ index 0350250..5c4aa1e 100644
mt7915_txbf_init(dev);
}
diff --git a/mt7915/mac.c b/mt7915/mac.c
index 6b99437..7d3397e 100644
index 79eb92b..7fce115 100644
--- a/mt7915/mac.c
+++ b/mt7915/mac.c
@@ -586,6 +586,7 @@ mt7915_mac_fill_rx_vector(struct mt7915_dev *dev, struct sk_buff *skb)
@@ -394,7 +394,7 @@ index 6b99437..7d3397e 100644
#endif
}
@@ -1420,7 +1444,7 @@ mt7915_mac_restart(struct mt7915_dev *dev)
@@ -1379,7 +1403,7 @@ mt7915_mac_restart(struct mt7915_dev *dev)
goto out;
/* set the necessary init items */
@@ -404,7 +404,7 @@ index 6b99437..7d3397e 100644
goto out;
diff --git a/mt7915/main.c b/mt7915/main.c
index 8835cda..e53754c 100644
index caff98c..721aa66 100644
--- a/mt7915/main.c
+++ b/mt7915/main.c
@@ -238,7 +238,7 @@ static int mt7915_add_interface(struct ieee80211_hw *hw,
@@ -417,7 +417,7 @@ index 8835cda..e53754c 100644
mvif->mt76.wmm_idx += 2;
diff --git a/mt7915/mcu.c b/mt7915/mcu.c
index 0d1bab1..05919e9 100644
index cd5363c..b5177e3 100644
--- a/mt7915/mcu.c
+++ b/mt7915/mcu.c
@@ -478,6 +478,11 @@ mt7915_mcu_rx_ext_event(struct mt7915_dev *dev, struct sk_buff *skb)
@@ -556,7 +556,7 @@ index 7653b5e..c791c7f 100644
enum {
diff --git a/mt7915/mmio.c b/mt7915/mmio.c
index 694fc1b..222e2cf 100644
index 02b4714..730cd33 100644
--- a/mt7915/mmio.c
+++ b/mt7915/mmio.c
@@ -134,6 +134,7 @@ static const u32 mt7915_offs[] = {
@@ -576,10 +576,10 @@ index 694fc1b..222e2cf 100644
[AGG_PCR0] = 0x040,
[AGG_ACR0] = 0x054,
diff --git a/mt7915/mt7915.h b/mt7915/mt7915.h
index 136e89f..37abf56 100644
index f7aeb44..efa9488 100644
--- a/mt7915/mt7915.h
+++ b/mt7915/mt7915.h
@@ -304,11 +304,15 @@ struct mt7915_phy {
@@ -321,11 +321,15 @@ struct mt7915_phy {
s32 last_freq_offset;
u8 last_rcpi[4];
@@ -595,7 +595,7 @@ index 136e89f..37abf56 100644
} test;
#endif
@@ -421,6 +425,14 @@ struct mt7915_dev {
@@ -442,6 +446,14 @@ struct mt7915_dev {
void __iomem *dcm;
void __iomem *sku;
@@ -610,7 +610,7 @@ index 136e89f..37abf56 100644
#ifdef MTK_DEBUG
u16 wlan_idx;
struct {
@@ -601,8 +613,8 @@ int mt7915_mcu_set_fixed_rate_ctrl(struct mt7915_dev *dev,
@@ -622,8 +634,8 @@ int mt7915_mcu_set_fixed_rate_ctrl(struct mt7915_dev *dev,
struct ieee80211_vif *vif,
struct ieee80211_sta *sta,
void *data, u32 field);
@@ -621,14 +621,14 @@ index 136e89f..37abf56 100644
int mt7915_mcu_get_eeprom_free_block(struct mt7915_dev *dev, u8 *block_num);
int mt7915_mcu_set_mac(struct mt7915_dev *dev, int band, bool enable,
bool hdr_trans);
@@ -641,6 +653,7 @@ int mt7915_mcu_fw_log_2_host(struct mt7915_dev *dev, u8 type, u8 ctrl);
@@ -662,6 +674,7 @@ int mt7915_mcu_fw_log_2_host(struct mt7915_dev *dev, u8 type, u8 ctrl);
int mt7915_mcu_fw_dbg_ctrl(struct mt7915_dev *dev, u32 module, u8 level);
void mt7915_mcu_rx_event(struct mt7915_dev *dev, struct sk_buff *skb);
void mt7915_mcu_exit(struct mt7915_dev *dev);
+int mt7915_tm_txbf_status_read(struct mt7915_dev *dev, struct sk_buff *skb);
void mt7915_mcu_wmm_pbc_work(struct work_struct *work);
int mt7915_mcu_set_qos_map(struct mt7915_dev *dev, struct ieee80211_vif *vif);
static inline u16 mt7915_wtbl_size(struct mt7915_dev *dev)
diff --git a/mt7915/regs.h b/mt7915/regs.h
index 8bb6a9f..1236da9 100644
--- a/mt7915/regs.h
@@ -651,7 +651,7 @@ index 8bb6a9f..1236da9 100644
(_n) * 4))
#define MT_AGG_PCR0(_band, _n) MT_WF_AGG(_band, (__OFFS(AGG_PCR0) + \
diff --git a/mt7915/testmode.c b/mt7915/testmode.c
index 4693919..32dc85c 100644
index 4693919..10713f6 100644
--- a/mt7915/testmode.c
+++ b/mt7915/testmode.c
@@ -9,6 +9,10 @@
@@ -1896,9 +1896,11 @@ index 4693919..32dc85c 100644
}
static int
@@ -617,34 +1626,7 @@ mt7915_tm_set_tx_cont(struct mt7915_phy *phy, bool en)
@@ -616,35 +1625,9 @@ mt7915_tm_set_tx_cont(struct mt7915_phy *phy, bool en)
tx_cont->center_ch = freq1;
tx_cont->tx_ant = td->tx_antenna_mask;
tx_cont->band = band;
+ tx_cont->txfd_mode = 3;
- switch (chandef->width) {
- case NL80211_CHAN_WIDTH_40:
@@ -1932,7 +1934,7 @@ index 4693919..32dc85c 100644
if (!en) {
req.op.rf.param.func_data = cpu_to_le32(band);
@@ -728,6 +1710,18 @@ mt7915_tm_update_params(struct mt7915_phy *phy, u32 changed)
@@ -728,6 +1711,18 @@ mt7915_tm_update_params(struct mt7915_phy *phy, u32 changed)
mt7915_tm_set_freq_offset(phy, en, en ? td->freq_offset : 0);
if (changed & BIT(TM_CHANGED_TXPOWER))
mt7915_tm_set_tx_power(phy);
@@ -1951,7 +1953,7 @@ index 4693919..32dc85c 100644
}
static int
@@ -737,6 +1731,11 @@ mt7915_tm_set_state(struct mt76_phy *mphy, enum mt76_testmode_state state)
@@ -737,6 +1732,11 @@ mt7915_tm_set_state(struct mt76_phy *mphy, enum mt76_testmode_state state)
struct mt7915_phy *phy = mphy->priv;
enum mt76_testmode_state prev_state = td->state;
@@ -1963,7 +1965,7 @@ index 4693919..32dc85c 100644
mphy->test.state = state;
if (prev_state == MT76_TM_STATE_TX_FRAMES ||
@@ -757,7 +1756,7 @@ mt7915_tm_set_state(struct mt76_phy *mphy, enum mt76_testmode_state state)
@@ -757,7 +1757,7 @@ mt7915_tm_set_state(struct mt76_phy *mphy, enum mt76_testmode_state state)
(state == MT76_TM_STATE_OFF &&
prev_state == MT76_TM_STATE_IDLE)) {
u32 changed = 0;
@@ -1972,7 +1974,7 @@ index 4693919..32dc85c 100644
for (i = 0; i < ARRAY_SIZE(tm_change_map); i++) {
u16 cur = tm_change_map[i];
@@ -766,6 +1765,10 @@ mt7915_tm_set_state(struct mt76_phy *mphy, enum mt76_testmode_state state)
@@ -766,6 +1766,10 @@ mt7915_tm_set_state(struct mt76_phy *mphy, enum mt76_testmode_state state)
changed |= BIT(i);
}
@@ -1983,7 +1985,7 @@ index 4693919..32dc85c 100644
mt7915_tm_update_params(phy, changed);
}
@@ -778,10 +1781,8 @@ mt7915_tm_set_params(struct mt76_phy *mphy, struct nlattr **tb,
@@ -778,10 +1782,8 @@ mt7915_tm_set_params(struct mt76_phy *mphy, struct nlattr **tb,
{
struct mt76_testmode_data *td = &mphy->test;
struct mt7915_phy *phy = mphy->priv;
@@ -1996,7 +1998,7 @@ index 4693919..32dc85c 100644
BUILD_BUG_ON(NUM_TM_CHANGED >= 32);
@@ -789,9 +1790,9 @@ mt7915_tm_set_params(struct mt76_phy *mphy, struct nlattr **tb,
@@ -789,9 +1791,9 @@ mt7915_tm_set_params(struct mt76_phy *mphy, struct nlattr **tb,
td->state == MT76_TM_STATE_OFF)
return 0;
@@ -2009,7 +2011,7 @@ index 4693919..32dc85c 100644
for (i = 0; i < ARRAY_SIZE(tm_change_map); i++) {
if (tb[tm_change_map[i]])
@@ -807,6 +1808,7 @@ static int
@@ -807,6 +1809,7 @@ static int
mt7915_tm_dump_stats(struct mt76_phy *mphy, struct sk_buff *msg)
{
struct mt7915_phy *phy = mphy->priv;
@@ -2017,7 +2019,7 @@ index 4693919..32dc85c 100644
void *rx, *rssi;
int i;
@@ -827,6 +1829,16 @@ mt7915_tm_dump_stats(struct mt76_phy *mphy, struct sk_buff *msg)
@@ -827,6 +1830,16 @@ mt7915_tm_dump_stats(struct mt76_phy *mphy, struct sk_buff *msg)
nla_nest_end(msg, rssi);
@@ -2034,7 +2036,7 @@ index 4693919..32dc85c 100644
rssi = nla_nest_start(msg, MT76_TM_RX_ATTR_IB_RSSI);
if (!rssi)
return -ENOMEM;
@@ -852,11 +1864,75 @@ mt7915_tm_dump_stats(struct mt76_phy *mphy, struct sk_buff *msg)
@@ -852,11 +1865,75 @@ mt7915_tm_dump_stats(struct mt76_phy *mphy, struct sk_buff *msg)
nla_nest_end(msg, rx);
@@ -2919,7 +2921,7 @@ index 9e05b86..7587047 100644
if (mt76_testmode_param_present(td, MT76_TM_ATTR_TX_POWER)) {
diff --git a/testmode.h b/testmode.h
index 8961326..7a68625 100644
index 8961326..3fad988 100644
--- a/testmode.h
+++ b/testmode.h
@@ -6,6 +6,8 @@
@@ -2939,7 +2941,17 @@ index 8961326..7a68625 100644
* @MT76_TM_ATTR_TX_COUNT: configured number of frames to send when setting
* state to MT76_TM_STATE_TX_FRAMES (u32)
* @MT76_TM_ATTR_TX_PENDING: pending frames during MT76_TM_STATE_TX_FRAMES (u32)
@@ -47,6 +50,15 @@
@@ -34,6 +37,9 @@
* @MT76_TM_ATTR_TX_POWER_CONTROL: enable tx power control (u8)
* @MT76_TM_ATTR_TX_POWER: per-antenna tx power array (nested, u8 attrs)
*
+ * @MT76_TM_ATTR_TX_PKT_BW: per-packet data bandwidth (u8)
+ * @MT76_TM_ATTR_TX_PRI_SEL: primary channel selection index (u8)
+ *
* @MT76_TM_ATTR_FREQ_OFFSET: RF frequency offset (u32)
*
* @MT76_TM_ATTR_STATS: statistics (nested, see &enum mt76_testmode_stats_attr)
@@ -47,6 +53,15 @@
* @MT76_TM_ATTR_DRV_DATA: driver specific netlink attrs (nested)
*
* @MT76_TM_ATTR_MAC_ADDRS: array of nested MAC addresses (nested)
@@ -2955,7 +2967,7 @@ index 8961326..7a68625 100644
*/
enum mt76_testmode_attr {
MT76_TM_ATTR_UNSPEC,
@@ -57,6 +69,7 @@ enum mt76_testmode_attr {
@@ -57,6 +72,7 @@ enum mt76_testmode_attr {
MT76_TM_ATTR_MTD_PART,
MT76_TM_ATTR_MTD_OFFSET,
@@ -2963,7 +2975,17 @@ index 8961326..7a68625 100644
MT76_TM_ATTR_TX_COUNT,
MT76_TM_ATTR_TX_LENGTH,
MT76_TM_ATTR_TX_RATE_MODE,
@@ -84,6 +97,17 @@ enum mt76_testmode_attr {
@@ -71,6 +87,9 @@ enum mt76_testmode_attr {
MT76_TM_ATTR_TX_POWER_CONTROL,
MT76_TM_ATTR_TX_POWER,
+ MT76_TM_ATTR_TX_PKT_BW,
+ MT76_TM_ATTR_TX_PRI_SEL,
+
MT76_TM_ATTR_FREQ_OFFSET,
MT76_TM_ATTR_STATS,
@@ -84,6 +103,17 @@ enum mt76_testmode_attr {
MT76_TM_ATTR_DRV_DATA,
MT76_TM_ATTR_MAC_ADDRS,
@@ -2981,7 +3003,7 @@ index 8961326..7a68625 100644
/* keep last */
NUM_MT76_TM_ATTRS,
@@ -128,6 +152,7 @@ enum mt76_testmode_stats_attr {
@@ -128,6 +158,7 @@ enum mt76_testmode_stats_attr {
*
* @MT76_TM_RX_ATTR_FREQ_OFFSET: frequency offset (s32)
* @MT76_TM_RX_ATTR_RCPI: received channel power indicator (array, u8)
@@ -2989,7 +3011,7 @@ index 8961326..7a68625 100644
* @MT76_TM_RX_ATTR_IB_RSSI: internal inband RSSI (array, s8)
* @MT76_TM_RX_ATTR_WB_RSSI: internal wideband RSSI (array, s8)
* @MT76_TM_RX_ATTR_SNR: signal-to-noise ratio (u8)
@@ -137,6 +162,7 @@ enum mt76_testmode_rx_attr {
@@ -137,6 +168,7 @@ enum mt76_testmode_rx_attr {
MT76_TM_RX_ATTR_FREQ_OFFSET,
MT76_TM_RX_ATTR_RCPI,
@@ -2997,7 +3019,7 @@ index 8961326..7a68625 100644
MT76_TM_RX_ATTR_IB_RSSI,
MT76_TM_RX_ATTR_WB_RSSI,
MT76_TM_RX_ATTR_SNR,
@@ -198,4 +224,57 @@ enum mt76_testmode_tx_mode {
@@ -198,4 +230,57 @@ enum mt76_testmode_tx_mode {
extern const struct nla_policy mt76_tm_policy[NUM_MT76_TM_ATTRS];
@@ -3235,7 +3257,7 @@ index e3f6908..406ba77 100644
};
diff --git a/tx.c b/tx.c
index 0fdf7d8..db0d4df 100644
index b3d7669..0002779 100644
--- a/tx.c
+++ b/tx.c
@@ -259,8 +259,7 @@ void __mt76_tx_complete_skb(struct mt76_dev *dev, u16 wcid_idx, struct sk_buff *
@@ -3249,5 +3271,5 @@ index 0fdf7d8..db0d4df 100644
wake_up(&dev->tx_wait);
--
2.18.0
2.45.2

View File

@@ -1,7 +1,7 @@
From 2d9fc3393a175ec0b132e6186df69baaad77e428 Mon Sep 17 00:00:00 2001
From fbbb77d3e06f0dd3f4ed27e8bb5ff113fe3c77fc Mon Sep 17 00:00:00 2001
From: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
Date: Wed, 31 Aug 2022 20:06:52 +0800
Subject: [PATCH 1009/1053] wifi: mt76: testmode: add pre-cal support
Subject: [PATCH 1009/1052] wifi: mt76: testmode: add pre-cal support
Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
---
@@ -12,13 +12,13 @@ Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
mt7915/mt7915.h | 1 +
mt7915/testmode.c | 425 +++++++++++++++++++++++++++++++++++++++++++++-
mt7915/testmode.h | 36 ++++
testmode.c | 15 +-
testmode.c | 15 ++
testmode.h | 17 ++
tools/fields.c | 8 +
10 files changed, 506 insertions(+), 7 deletions(-)
10 files changed, 507 insertions(+), 6 deletions(-)
diff --git a/eeprom.c b/eeprom.c
index a267397..3625b16 100644
index a2673978..3625b169 100644
--- a/eeprom.c
+++ b/eeprom.c
@@ -94,8 +94,10 @@ int mt76_get_of_data_from_mtd(struct mt76_dev *dev, void *eep, int offset, int l
@@ -35,7 +35,7 @@ index a267397..3625b16 100644
out_put_node:
diff --git a/mt76.h b/mt76.h
index 3fe18cd..22d76bb 100644
index 62205051..d8c2a515 100644
--- a/mt76.h
+++ b/mt76.h
@@ -708,6 +708,7 @@ struct mt76_testmode_ops {
@@ -47,10 +47,10 @@ index 3fe18cd..22d76bb 100644
struct mt76_testmode_entry_data {
diff --git a/mt76_connac_mcu.h b/mt76_connac_mcu.h
index 0972010..b75d340 100644
index 152b4aaa..cf88b674 100644
--- a/mt76_connac_mcu.h
+++ b/mt76_connac_mcu.h
@@ -1019,6 +1019,7 @@ enum {
@@ -1020,6 +1020,7 @@ enum {
/* ext event table */
enum {
@@ -59,7 +59,7 @@ index 0972010..b75d340 100644
MCU_EXT_EVENT_FW_LOG_2_HOST = 0x13,
MCU_EXT_EVENT_THERMAL_PROTECT = 0x22,
diff --git a/mt7915/mcu.c b/mt7915/mcu.c
index 233411c..ad58e3b 100644
index b5177e30..d4291e24 100644
--- a/mt7915/mcu.c
+++ b/mt7915/mcu.c
@@ -482,6 +482,9 @@ mt7915_mcu_rx_ext_event(struct mt7915_dev *dev, struct sk_buff *skb)
@@ -73,10 +73,10 @@ index 233411c..ad58e3b 100644
case MCU_EXT_EVENT_BSS_ACQ_PKT_CNT:
mt7915_mcu_rx_bss_acq_pkt_cnt(dev, skb);
diff --git a/mt7915/mt7915.h b/mt7915/mt7915.h
index 1846e2f..dd2e80b 100644
index bc77a61a..ca385b66 100644
--- a/mt7915/mt7915.h
+++ b/mt7915/mt7915.h
@@ -654,6 +654,7 @@ int mt7915_mcu_fw_dbg_ctrl(struct mt7915_dev *dev, u32 module, u8 level);
@@ -671,6 +671,7 @@ int mt7915_mcu_fw_dbg_ctrl(struct mt7915_dev *dev, u32 module, u8 level);
void mt7915_mcu_rx_event(struct mt7915_dev *dev, struct sk_buff *skb);
void mt7915_mcu_exit(struct mt7915_dev *dev);
int mt7915_tm_txbf_status_read(struct mt7915_dev *dev, struct sk_buff *skb);
@@ -85,7 +85,7 @@ index 1846e2f..dd2e80b 100644
static inline u16 mt7915_wtbl_size(struct mt7915_dev *dev)
diff --git a/mt7915/testmode.c b/mt7915/testmode.c
index 32dc85c..4b34430 100644
index 32dc85cd..4b344303 100644
--- a/mt7915/testmode.c
+++ b/mt7915/testmode.c
@@ -5,6 +5,7 @@
@@ -560,7 +560,7 @@ index 32dc85c..4b34430 100644
+ .dump_precal = mt7915_tm_dump_precal,
};
diff --git a/mt7915/testmode.h b/mt7915/testmode.h
index eb0e043..7569826 100644
index eb0e0432..75698261 100644
--- a/mt7915/testmode.h
+++ b/mt7915/testmode.h
@@ -81,6 +81,11 @@ struct tm_tx_cont {
@@ -628,7 +628,7 @@ index eb0e043..7569826 100644
TAM_ARB_OP_MODE_NORMAL = 1,
TAM_ARB_OP_MODE_TEST,
diff --git a/testmode.c b/testmode.c
index 7587047..070b296 100644
index 75870478..132267eb 100644
--- a/testmode.c
+++ b/testmode.c
@@ -771,6 +771,18 @@ int mt76_testmode_dump(struct ieee80211_hw *hw, struct sk_buff *msg,
@@ -650,18 +650,18 @@ index 7587047..070b296 100644
if (tb[MT76_TM_ATTR_STATS]) {
err = -EINVAL;
@@ -804,7 +816,8 @@ int mt76_testmode_dump(struct ieee80211_hw *hw, struct sk_buff *msg,
if (dev->test_mtd.name &&
(nla_put_string(msg, MT76_TM_ATTR_MTD_PART, dev->test_mtd.name) ||
- nla_put_u32(msg, MT76_TM_ATTR_MTD_OFFSET, dev->test_mtd.offset)))
+ nla_put_u32(msg, MT76_TM_ATTR_MTD_OFFSET, dev->test_mtd.offset) ||
+ nla_put_u8(msg, MT76_TM_ATTR_BAND_IDX, phy->band_idx)))
@@ -802,6 +814,9 @@ int mt76_testmode_dump(struct ieee80211_hw *hw, struct sk_buff *msg,
if (nla_put_u32(msg, MT76_TM_ATTR_STATE, td->state))
goto out;
if (nla_put_u32(msg, MT76_TM_ATTR_TX_COUNT, td->tx_count) ||
+ if (nla_put_u8(msg, MT76_TM_ATTR_BAND_IDX, phy->band_idx))
+ goto out;
+
if (dev->test_mtd.name &&
(nla_put_string(msg, MT76_TM_ATTR_MTD_PART, dev->test_mtd.name) ||
nla_put_u32(msg, MT76_TM_ATTR_MTD_OFFSET, dev->test_mtd.offset)))
diff --git a/testmode.h b/testmode.h
index 7a68625..e4c1b52 100644
index 7a686250..e4c1b521 100644
--- a/testmode.h
+++ b/testmode.h
@@ -19,6 +19,7 @@
@@ -717,7 +717,7 @@ index 7a68625..e4c1b52 100644
/* keep last */
diff --git a/tools/fields.c b/tools/fields.c
index 406ba77..27801db 100644
index 406ba77c..27801dbe 100644
--- a/tools/fields.c
+++ b/tools/fields.c
@@ -11,6 +11,14 @@ static const char * const testmode_state[] = {

View File

@@ -1,7 +1,7 @@
From be62cd03caedf8de9f3d6f2ef8883f85be51b9c7 Mon Sep 17 00:00:00 2001
From a78a0de5858eba651ca9630dc8970c947b190b28 Mon Sep 17 00:00:00 2001
From: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
Date: Mon, 12 Sep 2022 18:16:54 +0800
Subject: [PATCH 1010/1053] wifi: mt76: testmode: add iBF command mode support
Subject: [PATCH 1010/1052] wifi: mt76: testmode: add iBF command mode support
Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
---
@@ -12,7 +12,7 @@ Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
4 files changed, 85 insertions(+), 7 deletions(-)
diff --git a/mt7915/testmode.c b/mt7915/testmode.c
index 4b34430..453319e 100644
index 4b344303..453319e1 100644
--- a/mt7915/testmode.c
+++ b/mt7915/testmode.c
@@ -722,6 +722,7 @@ mt7915_tm_txbf_profile_update(struct mt7915_phy *phy, u16 *val, bool ebf)
@@ -104,7 +104,7 @@ index 4b34430..453319e 100644
mt7915_tm_set_tx_len(phy, tx_time);
diff --git a/testmode.c b/testmode.c
index 070b296..b1986ad 100644
index 132267eb..06b10a36 100644
--- a/testmode.c
+++ b/testmode.c
@@ -535,6 +535,42 @@ out:
@@ -163,7 +163,7 @@ index 070b296..b1986ad 100644
nla_for_each_nested(cur, tb[MT76_TM_ATTR_TXBF_PARAM], rem) {
if (nla_len(cur) != 2 ||
diff --git a/testmode.h b/testmode.h
index e4c1b52..1d7aef8 100644
index e4c1b521..1d7aef86 100644
--- a/testmode.h
+++ b/testmode.h
@@ -285,8 +285,10 @@ enum mt76_testmode_txbf_act {
@@ -178,7 +178,7 @@ index e4c1b52..1d7aef8 100644
/* keep last */
diff --git a/tools/fields.c b/tools/fields.c
index 27801db..b0ee84d 100644
index 27801dbe..b0ee84d2 100644
--- a/tools/fields.c
+++ b/tools/fields.c
@@ -32,6 +32,20 @@ static const char * const testmode_tx_mode[] = {

View File

@@ -1,7 +1,7 @@
From 460f28c1cba4632a4bd046d0a93d1569f69acea0 Mon Sep 17 00:00:00 2001
From 12f1e58ae28f7e12f298d213a0cfe13b751082df Mon Sep 17 00:00:00 2001
From: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
Date: Thu, 27 Oct 2022 17:42:07 +0800
Subject: [PATCH] wifi: mt76: testmode: add ZWDFS test mode support
Subject: [PATCH 1011/1052] wifi: mt76: testmode: add ZWDFS test mode support
Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
---
@@ -18,7 +18,7 @@ Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
10 files changed, 508 insertions(+), 1 deletion(-)
diff --git a/mt76.h b/mt76.h
index 20577af..53b0964 100644
index d8c2a515..15106812 100644
--- a/mt76.h
+++ b/mt76.h
@@ -793,6 +793,15 @@ struct mt76_testmode_data {
@@ -38,10 +38,10 @@ index 20577af..53b0964 100644
struct mt76_vif {
diff --git a/mt76_connac_mcu.h b/mt76_connac_mcu.h
index 6511060..9ac1c46 100644
index cf88b674..40fa9fc8 100644
--- a/mt76_connac_mcu.h
+++ b/mt76_connac_mcu.h
@@ -1241,6 +1241,7 @@ enum {
@@ -1243,6 +1243,7 @@ enum {
MCU_EXT_CMD_OFFCH_SCAN_CTRL = 0x9a,
MCU_EXT_CMD_SET_RDD_TH = 0x9d,
MCU_EXT_CMD_MURU_CTRL = 0x9f,
@@ -49,7 +49,7 @@ index 6511060..9ac1c46 100644
MCU_EXT_CMD_RX_STAT = 0xa4,
MCU_EXT_CMD_SET_SPR = 0xa8,
MCU_EXT_CMD_GROUP_PRE_CAL_INFO = 0xab,
@@ -1252,6 +1253,7 @@ enum {
@@ -1254,6 +1255,7 @@ enum {
MCU_EXT_CMD_SET_QOS_MAP = 0xb4,
MCU_EXT_CMD_CERT_CFG = 0xb7,
MCU_EXT_CMD_CSI_CTRL = 0xc2,
@@ -58,7 +58,7 @@ index 6511060..9ac1c46 100644
enum {
diff --git a/mt7915/mcu.c b/mt7915/mcu.c
index 5f3fec8..2025ef3 100644
index d4291e24..500ecbbb 100644
--- a/mt7915/mcu.c
+++ b/mt7915/mcu.c
@@ -2759,6 +2759,7 @@ mt7915_mcu_background_chain_ctrl(struct mt7915_phy *phy,
@@ -69,10 +69,11 @@ index 5f3fec8..2025ef3 100644
req.band_idx = phy->mt76->band_idx;
req.scan_mode = 2;
break;
@@ -4955,6 +4956,71 @@ int mt7915_mcu_set_amsdu_algo(struct mt7915_dev *dev, u16 wcid, u8 enable)
@@ -4954,3 +4955,68 @@ int mt7915_mcu_set_amsdu_algo(struct mt7915_dev *dev, u16 wcid, u8 enable)
return mt76_mcu_send_msg(&dev->mt76, MCU_EXT_CMD(MEC_CTRL), &req, sizeof(req), true);
}
#endif
+
+int mt7915_mcu_ipi_hist_ctrl(struct mt7915_phy *phy, void *data, u8 cmd, bool wait_resp)
+{
+ struct mt7915_dev *dev = phy->dev;
@@ -137,12 +138,8 @@ index 5f3fec8..2025ef3 100644
+
+ return 0;
+}
+
int mt7915_mcu_set_qos_map(struct mt7915_dev *dev, struct ieee80211_vif *vif)
{
#define IP_DSCP_NUM 64
diff --git a/mt7915/mcu.h b/mt7915/mcu.h
index c791c7f..066246b 100644
index c791c7fa..066246bb 100644
--- a/mt7915/mcu.h
+++ b/mt7915/mcu.h
@@ -698,6 +698,52 @@ enum CSI_CHAIN_TYPE {
@@ -199,10 +196,10 @@ index c791c7f..066246b 100644
#define OFDMA_DL BIT(0)
#define OFDMA_UL BIT(1)
diff --git a/mt7915/mt7915.h b/mt7915/mt7915.h
index b716b57..ec33afd 100644
index ca385b66..00f55443 100644
--- a/mt7915/mt7915.h
+++ b/mt7915/mt7915.h
@@ -293,6 +293,7 @@ struct mt7915_phy {
@@ -306,6 +306,7 @@ struct mt7915_phy {
struct mt76_mib_stats mib;
struct mt76_channel_state state_ts;
@@ -210,7 +207,7 @@ index b716b57..ec33afd 100644
u8 stats_work_count;
struct list_head stats_list;
@@ -768,6 +769,9 @@ int mt7915_vendor_amnt_sta_remove(struct mt7915_phy *phy,
@@ -786,6 +787,9 @@ int mt7915_vendor_amnt_sta_remove(struct mt7915_phy *phy,
struct ieee80211_sta *sta);
#endif
@@ -221,7 +218,7 @@ index b716b57..ec33afd 100644
int mt7915_mtk_init_debugfs(struct mt7915_phy *phy, struct dentry *dir);
int mt7915_dbg_mcu_wa_cmd(struct mt7915_dev *dev, int cmd, u32 a1, u32 a2, u32 a3, bool wait_resp);
diff --git a/mt7915/regs.h b/mt7915/regs.h
index 1236da9..7e9b76b 100644
index 1236da91..7e9b76b0 100644
--- a/mt7915/regs.h
+++ b/mt7915/regs.h
@@ -1211,6 +1211,8 @@ enum offs_rev {
@@ -234,7 +231,7 @@ index 1236da9..7e9b76b 100644
#define MT_WF_PHY_BASE 0x83080000
#define MT_WF_PHY(ofs) (MT_WF_PHY_BASE + (ofs))
diff --git a/mt7915/testmode.c b/mt7915/testmode.c
index 453319e..caa3590 100644
index 453319e1..caa35906 100644
--- a/mt7915/testmode.c
+++ b/mt7915/testmode.c
@@ -14,6 +14,12 @@ enum {
@@ -561,7 +558,7 @@ index 453319e..caa3590 100644
static int
diff --git a/testmode.c b/testmode.c
index b1986ad..b369826 100644
index 06b10a36..d8fc5d6f 100644
--- a/testmode.c
+++ b/testmode.c
@@ -26,6 +26,13 @@ const struct nla_policy mt76_tm_policy[NUM_MT76_TM_ATTRS] = {
@@ -614,7 +611,7 @@ index b1986ad..b369826 100644
goto out;
if (tb[MT76_TM_ATTR_TX_LENGTH]) {
@@ -866,6 +886,9 @@ int mt76_testmode_dump(struct ieee80211_hw *hw, struct sk_buff *msg,
@@ -868,6 +888,9 @@ int mt76_testmode_dump(struct ieee80211_hw *hw, struct sk_buff *msg,
nla_put_u8(msg, MT76_TM_ATTR_TX_RATE_MODE, td->tx_rate_mode) ||
nla_put_u8(msg, MT76_TM_ATTR_TX_RATE_SGI, td->tx_rate_sgi) ||
nla_put_u8(msg, MT76_TM_ATTR_TX_RATE_STBC, td->tx_rate_stbc) ||
@@ -625,7 +622,7 @@ index b1986ad..b369826 100644
nla_put_u8(msg, MT76_TM_ATTR_TX_LTF, td->tx_ltf)) ||
(mt76_testmode_param_present(td, MT76_TM_ATTR_TX_ANTENNA) &&
diff --git a/testmode.h b/testmode.h
index 1d7aef8..b39cf51 100644
index 1d7aef86..b39cf511 100644
--- a/testmode.h
+++ b/testmode.h
@@ -64,6 +64,20 @@
@@ -693,7 +690,7 @@ index 1d7aef8..b39cf51 100644
+
#endif
diff --git a/tools/fields.c b/tools/fields.c
index b0ee84d..e2cf4b9 100644
index b0ee84d2..e2cf4b92 100644
--- a/tools/fields.c
+++ b/tools/fields.c
@@ -46,6 +46,14 @@ static const char * const testmode_txbf_act[] = {

View File

@@ -1,8 +1,8 @@
From 2a34bd2105e5021dacaf30c90bb6816f107cabd4 Mon Sep 17 00:00:00 2001
From 46dec6692579a5ccd030e2facf62e16a51712ad2 Mon Sep 17 00:00:00 2001
From: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
Date: Thu, 15 Dec 2022 19:45:18 +0800
Subject: [PATCH] wifi: mt76: testmode: add iBF/eBF cal and cert commands with
golden
Subject: [PATCH 37/94] wifi: mt76: testmode: add iBF/eBF cal and cert commands
with golden
Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
---
@@ -25,10 +25,10 @@ Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
16 files changed, 859 insertions(+), 325 deletions(-)
diff --git a/mt76.h b/mt76.h
index 53b0964..1455144 100644
index 62bf468..a2640cf 100644
--- a/mt76.h
+++ b/mt76.h
@@ -755,6 +755,7 @@ struct mt76_testmode_data {
@@ -762,6 +762,7 @@ struct mt76_testmode_data {
struct list_head tm_entry_list;
struct mt76_wcid *cur_entry;
@@ -36,7 +36,7 @@ index 53b0964..1455144 100644
u8 entry_num;
union {
struct mt76_testmode_entry_data ed;
@@ -783,6 +784,9 @@ struct mt76_testmode_data {
@@ -790,6 +791,9 @@ struct mt76_testmode_data {
u8 txbf_act;
u16 txbf_param[8];
@@ -47,7 +47,7 @@ index 53b0964..1455144 100644
u32 tx_pending;
u32 tx_queued;
diff --git a/mt76_connac_mcu.c b/mt76_connac_mcu.c
index 44cd646..15e61c9 100644
index 2acd7ef..0ce7ecd 100644
--- a/mt76_connac_mcu.c
+++ b/mt76_connac_mcu.c
@@ -2688,6 +2688,7 @@ int mt76_connac_mcu_bss_basic_tlv(struct sk_buff *skb,
@@ -68,7 +68,7 @@ index 44cd646..15e61c9 100644
memcpy(bss->bssid, phy->macaddr, ETH_ALEN);
}
diff --git a/mt7915/mac.c b/mt7915/mac.c
index 7d3397e..d94a0d5 100644
index 7fce115..7bc2834 100644
--- a/mt7915/mac.c
+++ b/mt7915/mac.c
@@ -737,8 +737,10 @@ mt7915_mac_write_txwi_tm(struct mt7915_phy *phy, __le32 *txwi,
@@ -84,7 +84,7 @@ index 7d3397e..d94a0d5 100644
txwi[6] |= cpu_to_le32(val);
#endif
diff --git a/mt7915/main.c b/mt7915/main.c
index e53754c..69477f1 100644
index 73d176c..73e8ec1 100644
--- a/mt7915/main.c
+++ b/mt7915/main.c
@@ -205,46 +205,37 @@ static void mt7915_init_bitrate_mask(struct ieee80211_vif *vif)
@@ -101,7 +101,7 @@ index e53754c..69477f1 100644
+ struct mt7915_dev *dev = phy->dev;
struct mt76_txq *mtxq;
bool ext_phy = phy != &dev->phy;
int idx, ret = 0;
int idx, i, ret = 0;
- mutex_lock(&dev->mt76.mutex);
-
@@ -146,7 +146,7 @@ index e53754c..69477f1 100644
dev->mt76.vif_mask |= BIT_ULL(mvif->mt76.idx);
phy->omac_mask |= BIT_ULL(mvif->mt76.omac_idx);
@@ -280,7 +271,26 @@ static int mt7915_add_interface(struct ieee80211_hw *hw,
@@ -286,7 +277,26 @@ static int mt7915_add_interface(struct ieee80211_hw *hw,
mt7915_mcu_add_sta(dev, vif, NULL, true);
rcu_assign_pointer(dev->mt76.wcid[idx], &mvif->sta.wcid);
@@ -175,7 +175,7 @@ index e53754c..69477f1 100644
return ret;
diff --git a/mt7915/mcu.c b/mt7915/mcu.c
index 2025ef3..f5042ae 100644
index 500ecbb..6f05a08 100644
--- a/mt7915/mcu.c
+++ b/mt7915/mcu.c
@@ -199,6 +199,7 @@ mt7915_mcu_send_message(struct mt76_dev *mdev, struct sk_buff *skb,
@@ -448,7 +448,7 @@ index 066246b..de17c57 100644
MURU_SET_ARB_OP_MODE = 14,
MURU_SET_PLATFORM_TYPE = 25,
diff --git a/mt7915/mmio.c b/mt7915/mmio.c
index 222e2cf..ddf1b72 100644
index 730cd33..ed15d71 100644
--- a/mt7915/mmio.c
+++ b/mt7915/mmio.c
@@ -133,6 +133,7 @@ static const u32 mt7915_offs[] = {
@@ -468,10 +468,10 @@ index 222e2cf..ddf1b72 100644
[AGG_AALCR0] = 0x028,
[AGG_AWSCR0] = 0x030,
diff --git a/mt7915/mt7915.h b/mt7915/mt7915.h
index ec33afd..700efaf 100644
index 1df3d9f..ea284ae 100644
--- a/mt7915/mt7915.h
+++ b/mt7915/mt7915.h
@@ -312,7 +312,6 @@ struct mt7915_phy {
@@ -329,7 +329,6 @@ struct mt7915_phy {
u8 spe_idx;
@@ -479,7 +479,7 @@ index ec33afd..700efaf 100644
bool bf_ever_en;
} test;
#endif
@@ -426,7 +425,7 @@ struct mt7915_dev {
@@ -447,7 +446,7 @@ struct mt7915_dev {
void __iomem *dcm;
void __iomem *sku;
@@ -488,7 +488,7 @@ index ec33afd..700efaf 100644
struct {
void *txbf_phase_cal;
void *txbf_pfmu_data;
@@ -574,6 +573,7 @@ int mt7915_dma_reset(struct mt7915_dev *dev, bool force);
@@ -595,6 +594,7 @@ int mt7915_dma_reset(struct mt7915_dev *dev, bool force);
int mt7915_dma_start(struct mt7915_dev *dev, bool reset, bool wed_reset);
int mt7915_txbf_init(struct mt7915_dev *dev);
void mt7915_init_txpower(struct mt7915_phy *phy);
@@ -496,14 +496,13 @@ index ec33afd..700efaf 100644
void mt7915_reset(struct mt7915_dev *dev);
int mt7915_run(struct ieee80211_hw *hw);
int mt7915_mcu_init(struct mt7915_dev *dev);
@@ -654,11 +654,13 @@ int mt7915_mcu_fw_log_2_host(struct mt7915_dev *dev, u8 type, u8 ctrl);
@@ -675,10 +675,12 @@ int mt7915_mcu_fw_log_2_host(struct mt7915_dev *dev, u8 type, u8 ctrl);
int mt7915_mcu_fw_dbg_ctrl(struct mt7915_dev *dev, u32 module, u8 level);
void mt7915_mcu_rx_event(struct mt7915_dev *dev, struct sk_buff *skb);
void mt7915_mcu_exit(struct mt7915_dev *dev);
-int mt7915_tm_txbf_status_read(struct mt7915_dev *dev, struct sk_buff *skb);
-void mt7915_tm_rf_test_event(struct mt7915_dev *dev, struct sk_buff *skb);
void mt7915_mcu_wmm_pbc_work(struct work_struct *work);
int mt7915_mcu_set_qos_map(struct mt7915_dev *dev, struct ieee80211_vif *vif);
+#ifdef CONFIG_NL80211_TESTMODE
+void mt7915_tm_rf_test_event(struct mt7915_dev *dev, struct sk_buff *skb);
@@ -512,7 +511,7 @@ index ec33afd..700efaf 100644
static inline u16 mt7915_wtbl_size(struct mt7915_dev *dev)
{
return is_mt7915(&dev->mt76) ? MT7915_WTBL_SIZE : MT7916_WTBL_SIZE;
@@ -792,4 +794,10 @@ enum {
@@ -814,4 +816,10 @@ enum {
#endif
@@ -524,7 +523,7 @@ index ec33afd..700efaf 100644
+
#endif
diff --git a/mt7915/mtk_debugfs.c b/mt7915/mtk_debugfs.c
index 84f8fae..9e490ad 100644
index b94914d..adc4929 100644
--- a/mt7915/mtk_debugfs.c
+++ b/mt7915/mtk_debugfs.c
@@ -2888,6 +2888,36 @@ mt7915_txpower_level_set(void *data, u64 val)
@@ -1851,7 +1850,7 @@ index 7569826..5aba13c 100644
#endif
diff --git a/testmode.c b/testmode.c
index b369826..a3e6d4a 100644
index d8fc5d6..56b9205 100644
--- a/testmode.c
+++ b/testmode.c
@@ -196,6 +196,7 @@ mt76_testmode_alloc_skb(struct mt76_phy *phy, u32 len,
@@ -1919,5 +1918,5 @@ index e2cf4b9..027b8cd 100644
static const char * const testmode_offchan_bw[] = {
--
2.18.0
2.45.2

View File

@@ -1,7 +1,7 @@
From b19594cf12b01dede83a984ca717e26be37bbfdd Mon Sep 17 00:00:00 2001
From 9e7d1c03b7944cd7a0641c68c9515f400e662451 Mon Sep 17 00:00:00 2001
From: Evelyn Tsai <evelyn.tsai@mediatek.com>
Date: Fri, 6 May 2022 15:58:42 +0800
Subject: [PATCH 1013/1053] wifi: mt76: connac: airtime fairness feature off in
Subject: [PATCH 1013/1052] wifi: mt76: connac: airtime fairness feature off in
mac80211
---
@@ -9,7 +9,7 @@ Subject: [PATCH 1013/1053] wifi: mt76: connac: airtime fairness feature off in
1 file changed, 1 deletion(-)
diff --git a/mac80211.c b/mac80211.c
index 305cae7..f9dfdf8 100644
index d6b70374..750a642a 100644
--- a/mac80211.c
+++ b/mac80211.c
@@ -451,7 +451,6 @@ mt76_phy_init(struct mt76_phy *phy, struct ieee80211_hw *hw)

View File

@@ -1,17 +1,17 @@
From 34cb90df1cfbbe69bb96a4eabd249e190d821e03 Mon Sep 17 00:00:00 2001
From ea8636284d9278b7053ecedb02045be768d90957 Mon Sep 17 00:00:00 2001
From: Yi-Chia Hsieh <Yi-Chia.Hsieh@mediatek.com>
Date: Tue, 12 Jul 2022 10:04:35 -0700
Subject: [PATCH 1014/1053] wifi: mt76: mt7915: add phy capability vendor
Subject: [PATCH 1014/1052] wifi: mt76: mt7915: add phy capability vendor
command
---
mt7915/mt7915.h | 1 +
mt7915/vendor.c | 52 +++++++++++++++++++++++++++++++++++++++++++++++++
mt7915/vendor.h | 25 ++++++++++++++++++++++++
3 files changed, 78 insertions(+)
mt7915/vendor.h | 26 +++++++++++++++++++++++++
3 files changed, 79 insertions(+)
diff --git a/mt7915/mt7915.h b/mt7915/mt7915.h
index b06e5ca..d21b843 100644
index ef92b2ea..64cfa2e0 100644
--- a/mt7915/mt7915.h
+++ b/mt7915/mt7915.h
@@ -11,6 +11,7 @@
@@ -23,10 +23,10 @@ index b06e5ca..d21b843 100644
#define MT7916_WTBL_SIZE 544
#define MT7915_WTBL_RESERVED (mt7915_wtbl_size(dev) - 1)
diff --git a/mt7915/vendor.c b/mt7915/vendor.c
index a8b1fa8..757aecb 100644
index cf09b513..9e8d2442 100644
--- a/mt7915/vendor.c
+++ b/mt7915/vendor.c
@@ -51,6 +51,18 @@ rfeature_ctrl_policy[NUM_MTK_VENDOR_ATTRS_RFEATURE_CTRL] = {
@@ -52,6 +52,18 @@ rfeature_ctrl_policy[NUM_MTK_VENDOR_ATTRS_RFEATURE_CTRL] = {
[MTK_VENDOR_ATTR_RFEATURE_CTRL_TRIG_TXBF] = { .type = NLA_U8 },
};
@@ -45,7 +45,7 @@ index a8b1fa8..757aecb 100644
struct csi_null_tone {
u8 start;
u8 end;
@@ -995,6 +1007,35 @@ static int mt7915_vendor_mu_ctrl(struct wiphy *wiphy,
@@ -1131,6 +1143,35 @@ static int mt7915_vendor_mu_ctrl(struct wiphy *wiphy,
return 0;
}
@@ -81,7 +81,7 @@ index a8b1fa8..757aecb 100644
static const struct wiphy_vendor_command mt7915_vendor_commands[] = {
{
.info = {
@@ -1052,6 +1093,17 @@ static const struct wiphy_vendor_command mt7915_vendor_commands[] = {
@@ -1188,6 +1229,17 @@ static const struct wiphy_vendor_command mt7915_vendor_commands[] = {
.doit = mt7915_vendor_mu_ctrl,
.policy = mu_ctrl_policy,
.maxattr = MTK_VENDOR_ATTR_MU_CTRL_MAX,
@@ -100,7 +100,7 @@ index a8b1fa8..757aecb 100644
};
diff --git a/mt7915/vendor.h b/mt7915/vendor.h
index a4a9180..34dd7d0 100644
index 9cb67551..e58884ce 100644
--- a/mt7915/vendor.h
+++ b/mt7915/vendor.h
@@ -10,6 +10,7 @@ enum mtk_nl80211_vendor_subcmds {
@@ -111,10 +111,11 @@ index a4a9180..34dd7d0 100644
};
enum mtk_capi_control_changed {
@@ -152,4 +153,28 @@ enum mtk_vendor_attr_mnt_dump {
@@ -164,4 +165,29 @@ enum mtk_vendor_attr_mnt_dump {
MTK_VENDOR_ATTR_AMNT_DUMP_MAX =
NUM_MTK_VENDOR_ATTRS_AMNT_DUMP - 1
};
+
+enum mtk_vendor_attr_phy_capa_ctrl {
+ MTK_VENDOR_ATTR_PHY_CAPA_CTRL_UNSPEC,
+

View File

@@ -1,7 +1,7 @@
From 7f9793b9c724014e9993091b47566cd9bf3cec06 Mon Sep 17 00:00:00 2001
From 31ecfaed704ad082d532a32ae5abd045f5d2f339 Mon Sep 17 00:00:00 2001
From: Howard Hsu <howard-yh.hsu@mediatek.com>
Date: Fri, 24 Jun 2022 11:15:45 +0800
Subject: [PATCH] wifi: mt76: mt7915: add vendor subcmd EDCCA ctrl
Subject: [PATCH 1015/1052] wifi: mt76: mt7915: add vendor subcmd EDCCA ctrl
enable/threshold/compensation
---
@@ -15,10 +15,10 @@ Subject: [PATCH] wifi: mt76: mt7915: add vendor subcmd EDCCA ctrl
7 files changed, 264 insertions(+), 1 deletion(-)
diff --git a/mt76_connac_mcu.h b/mt76_connac_mcu.h
index 9ac1c46..012f9be 100644
index 40fa9fc8..a85179b8 100644
--- a/mt76_connac_mcu.h
+++ b/mt76_connac_mcu.h
@@ -1252,6 +1252,7 @@ enum {
@@ -1254,6 +1254,7 @@ enum {
MCU_EXT_CMD_RX_STAT_USER_CTRL = 0xb3,
MCU_EXT_CMD_SET_QOS_MAP = 0xb4,
MCU_EXT_CMD_CERT_CFG = 0xb7,
@@ -27,7 +27,7 @@ index 9ac1c46..012f9be 100644
MCU_EXT_CMD_IPI_HIST_SCAN = 0xc5,
};
diff --git a/mt7915/main.c b/mt7915/main.c
index 69477f1..d0ba4b7 100644
index 4a541188..de2f9098 100644
--- a/mt7915/main.c
+++ b/mt7915/main.c
@@ -479,6 +479,9 @@ static int mt7915_config(struct ieee80211_hw *hw, u32 changed)
@@ -41,13 +41,14 @@ index 69477f1..d0ba4b7 100644
ret = mt7915_set_channel(phy);
if (ret)
diff --git a/mt7915/mcu.c b/mt7915/mcu.c
index f5042ae..20395e9 100644
index 6f05a081..f83d969c 100644
--- a/mt7915/mcu.c
+++ b/mt7915/mcu.c
@@ -5038,6 +5038,78 @@ int mt7915_mcu_ipi_hist_scan(struct mt7915_phy *phy, void *data, u8 mode, bool w
@@ -5037,3 +5037,75 @@ int mt7915_mcu_ipi_hist_scan(struct mt7915_phy *phy, void *data, u8 mode, bool w
return 0;
}
+
+int mt7915_mcu_set_edcca(struct mt7915_phy *phy, int mode, u8 *value, s8 compensation)
+{
+ static const u8 ch_band[] = {
@@ -119,12 +120,8 @@ index f5042ae..20395e9 100644
+
+ return 0;
+}
+
int mt7915_mcu_set_qos_map(struct mt7915_dev *dev, struct ieee80211_vif *vif)
{
#define IP_DSCP_NUM 64
diff --git a/mt7915/mcu.h b/mt7915/mcu.h
index de17c57..1682c11 100644
index de17c579..1682c117 100644
--- a/mt7915/mcu.h
+++ b/mt7915/mcu.h
@@ -1128,6 +1128,27 @@ enum {
@@ -156,10 +153,10 @@ index de17c57..1682c11 100644
#endif
diff --git a/mt7915/mt7915.h b/mt7915/mt7915.h
index d4a3467..8da1d1b 100644
index 64cfa2e0..141c151e 100644
--- a/mt7915/mt7915.h
+++ b/mt7915/mt7915.h
@@ -771,7 +771,8 @@ void mt7915_vendor_amnt_fill_rx(struct mt7915_phy *phy, struct sk_buff *skb);
@@ -789,7 +789,8 @@ void mt7915_vendor_amnt_fill_rx(struct mt7915_phy *phy, struct sk_buff *skb);
int mt7915_vendor_amnt_sta_remove(struct mt7915_phy *phy,
struct ieee80211_sta *sta);
#endif
@@ -170,10 +167,10 @@ index d4a3467..8da1d1b 100644
int mt7915_mcu_ipi_hist_scan(struct mt7915_phy *phy, void *data, u8 mode, bool wait_resp);
diff --git a/mt7915/vendor.c b/mt7915/vendor.c
index 757aecb..3a58684 100644
index 9e8d2442..aaa0cf1d 100644
--- a/mt7915/vendor.c
+++ b/mt7915/vendor.c
@@ -63,6 +63,24 @@ phy_capa_dump_policy[NUM_MTK_VENDOR_ATTRS_PHY_CAPA_DUMP] = {
@@ -64,6 +64,24 @@ phy_capa_dump_policy[NUM_MTK_VENDOR_ATTRS_PHY_CAPA_DUMP] = {
[MTK_VENDOR_ATTR_PHY_CAPA_DUMP_MAX_SUPPORTED_STA] = { .type = NLA_U16 },
};
@@ -198,7 +195,7 @@ index 757aecb..3a58684 100644
struct csi_null_tone {
u8 start;
u8 end;
@@ -1036,6 +1054,108 @@ mt7915_vendor_phy_capa_ctrl_dump(struct wiphy *wiphy, struct wireless_dev *wdev,
@@ -1172,6 +1190,108 @@ mt7915_vendor_phy_capa_ctrl_dump(struct wiphy *wiphy, struct wireless_dev *wdev,
return len;
}
@@ -307,7 +304,7 @@ index 757aecb..3a58684 100644
static const struct wiphy_vendor_command mt7915_vendor_commands[] = {
{
.info = {
@@ -1104,6 +1224,18 @@ static const struct wiphy_vendor_command mt7915_vendor_commands[] = {
@@ -1240,6 +1360,18 @@ static const struct wiphy_vendor_command mt7915_vendor_commands[] = {
.dumpit = mt7915_vendor_phy_capa_ctrl_dump,
.policy = phy_capa_ctrl_policy,
.maxattr = MTK_VENDOR_ATTR_PHY_CAPA_CTRL_MAX,
@@ -327,7 +324,7 @@ index 757aecb..3a58684 100644
};
diff --git a/mt7915/vendor.h b/mt7915/vendor.h
index 34dd7d0..284994a 100644
index e58884ce..c8d30b52 100644
--- a/mt7915/vendor.h
+++ b/mt7915/vendor.h
@@ -3,6 +3,7 @@

View File

@@ -1,7 +1,7 @@
From 9291fdb4f324728e5f4e233a08282f828cc04b80 Mon Sep 17 00:00:00 2001
From 6aa933c1f0af48d3703f500dce4514b62d9d2121 Mon Sep 17 00:00:00 2001
From: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
Date: Thu, 7 Jul 2022 11:09:59 +0800
Subject: [PATCH 1016/1053] wifi: mt76: mt7915: implement bin file mode
Subject: [PATCH 1016/1052] wifi: mt76: mt7915: implement bin file mode
Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
@@ -16,7 +16,7 @@ Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
7 files changed, 144 insertions(+), 4 deletions(-)
diff --git a/eeprom.c b/eeprom.c
index 3625b16..9d029c0 100644
index 3625b169..9d029c04 100644
--- a/eeprom.c
+++ b/eeprom.c
@@ -161,6 +161,31 @@ static int mt76_get_of_eeprom(struct mt76_dev *dev, void *eep, int len)
@@ -52,7 +52,7 @@ index 3625b16..9d029c0 100644
mt76_eeprom_override(struct mt76_phy *phy)
{
diff --git a/mt76.h b/mt76.h
index 8025e04..48e98a3 100644
index 9597f564..253a564f 100644
--- a/mt76.h
+++ b/mt76.h
@@ -983,6 +983,9 @@ struct mt76_dev {
@@ -74,7 +74,7 @@ index 8025e04..48e98a3 100644
struct mt76_queue *
mt76_init_queue(struct mt76_dev *dev, int qid, int idx, int n_desc,
diff --git a/mt7915/eeprom.c b/mt7915/eeprom.c
index f4876fe..c8b1c18 100644
index f4876fe9..c8b1c18e 100644
--- a/mt7915/eeprom.c
+++ b/mt7915/eeprom.c
@@ -5,6 +5,30 @@
@@ -196,7 +196,7 @@ index f4876fe..c8b1c18 100644
if (ret)
return ret;
diff --git a/mt7915/eeprom.h b/mt7915/eeprom.h
index 509fb43..99101f9 100644
index 509fb43d..99101f91 100644
--- a/mt7915/eeprom.h
+++ b/mt7915/eeprom.h
@@ -109,6 +109,13 @@ enum mt7915_sku_rate_group {
@@ -214,10 +214,10 @@ index 509fb43..99101f9 100644
mt7915_get_channel_group_5g(int channel, bool is_7976)
{
diff --git a/mt7915/mt7915.h b/mt7915/mt7915.h
index 000751b..a06a46e 100644
index 141c151e..2fb8e2fb 100644
--- a/mt7915/mt7915.h
+++ b/mt7915/mt7915.h
@@ -397,6 +397,8 @@ struct mt7915_dev {
@@ -414,6 +414,8 @@ struct mt7915_dev {
bool dbdc_support;
bool flash_mode;
@@ -226,7 +226,7 @@ index 000751b..a06a46e 100644
bool muru_debug;
bool ibf;
@@ -783,6 +785,7 @@ void mt7915_dump_tmac_info(u8 *tmac_info);
@@ -802,6 +804,7 @@ void mt7915_dump_tmac_info(u8 *tmac_info);
int mt7915_mcu_set_txpower_level(struct mt7915_phy *phy, u8 drop_level);
void mt7915_packet_log_to_host(struct mt7915_dev *dev, const void *data, int len, int type, int des_len);
int mt7915_mcu_set_amsdu_algo(struct mt7915_dev *dev, u16 wcid, u8 enable);
@@ -235,7 +235,7 @@ index 000751b..a06a46e 100644
#define PKT_BIN_DEBUG_MAGIC 0xc8763123
enum {
diff --git a/mt7915/mtk_debugfs.c b/mt7915/mtk_debugfs.c
index 30c5f68..02e0db3 100644
index 02fe61a3..76f4849e 100644
--- a/mt7915/mtk_debugfs.c
+++ b/mt7915/mtk_debugfs.c
@@ -3,6 +3,7 @@
@@ -304,7 +304,7 @@ index 30c5f68..02e0db3 100644
}
#endif
diff --git a/testmode.h b/testmode.h
index 20fab3e..91d1e86 100644
index 20fab3ec..91d1e867 100644
--- a/testmode.h
+++ b/testmode.h
@@ -17,7 +17,7 @@

View File

@@ -1,7 +1,7 @@
From 7a381293087e8d94349e5488936e53f884730787 Mon Sep 17 00:00:00 2001
From 0623b3b87fe33c6ad8037aa01cf63b2a1ab2274f Mon Sep 17 00:00:00 2001
From: TomLiu <tomml.liu@mediatek.com>
Date: Thu, 11 Aug 2022 18:09:45 -0700
Subject: [PATCH 1017/1053] wifi: mt76: mt7915: Add mu dump support
Subject: [PATCH 1017/1052] wifi: mt76: mt7915: Add mu dump support
---
mt7915/vendor.c | 24 ++++++++++++++++++++++++
@@ -9,10 +9,10 @@ Subject: [PATCH 1017/1053] wifi: mt76: mt7915: Add mu dump support
2 files changed, 25 insertions(+)
diff --git a/mt7915/vendor.c b/mt7915/vendor.c
index 3a58684..ac6f637 100644
index aaa0cf1d..eb0b380d 100644
--- a/mt7915/vendor.c
+++ b/mt7915/vendor.c
@@ -38,6 +38,7 @@ wireless_ctrl_policy[NUM_MTK_VENDOR_ATTRS_WIRELESS_CTRL] = {
@@ -39,6 +39,7 @@ wireless_ctrl_policy[NUM_MTK_VENDOR_ATTRS_WIRELESS_CTRL] = {
static const struct nla_policy
mu_ctrl_policy[NUM_MTK_VENDOR_ATTRS_MU_CTRL] = {
[MTK_VENDOR_ATTR_MU_CTRL_ONOFF] = {.type = NLA_U8 },
@@ -20,7 +20,7 @@ index 3a58684..ac6f637 100644
};
static const struct nla_policy
@@ -1025,6 +1026,28 @@ static int mt7915_vendor_mu_ctrl(struct wiphy *wiphy,
@@ -1161,6 +1162,28 @@ static int mt7915_vendor_mu_ctrl(struct wiphy *wiphy,
return 0;
}
@@ -49,7 +49,7 @@ index 3a58684..ac6f637 100644
static int
mt7915_vendor_phy_capa_ctrl_dump(struct wiphy *wiphy, struct wireless_dev *wdev,
struct sk_buff *skb, const void *data, int data_len,
@@ -1211,6 +1234,7 @@ static const struct wiphy_vendor_command mt7915_vendor_commands[] = {
@@ -1347,6 +1370,7 @@ static const struct wiphy_vendor_command mt7915_vendor_commands[] = {
.flags = WIPHY_VENDOR_CMD_NEED_NETDEV |
WIPHY_VENDOR_CMD_NEED_RUNNING,
.doit = mt7915_vendor_mu_ctrl,
@@ -58,7 +58,7 @@ index 3a58684..ac6f637 100644
.maxattr = MTK_VENDOR_ATTR_MU_CTRL_MAX,
},
diff --git a/mt7915/vendor.h b/mt7915/vendor.h
index 284994a..8c2a996 100644
index c8d30b52..c61ba260 100644
--- a/mt7915/vendor.h
+++ b/mt7915/vendor.h
@@ -73,6 +73,7 @@ enum mtk_vendor_attr_mu_ctrl {

View File

@@ -1,7 +1,8 @@
From 35c3c602288b8c1a11b9c1ca4e1b0182d451d15e Mon Sep 17 00:00:00 2001
From a2610e02282fb1825cdc2d76ebff9e979a6a977c Mon Sep 17 00:00:00 2001
From: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
Date: Fri, 28 Oct 2022 10:15:56 +0800
Subject: [PATCH] wifi: mt76: mt7915: add vendor subcmd three wire (PTA) ctrl
Subject: [PATCH 1018/1052] wifi: mt76: mt7915: add vendor subcmd three wire
(PTA) ctrl
Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
---
@@ -14,10 +15,10 @@ Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
6 files changed, 111 insertions(+), 29 deletions(-)
diff --git a/mt76_connac_mcu.h b/mt76_connac_mcu.h
index 012f9be..7e12c05 100644
index a85179b8..e7eb6a93 100644
--- a/mt76_connac_mcu.h
+++ b/mt76_connac_mcu.h
@@ -1251,7 +1251,7 @@ enum {
@@ -1253,7 +1253,7 @@ enum {
MCU_EXT_CMD_SMESH_CTRL = 0xae,
MCU_EXT_CMD_RX_STAT_USER_CTRL = 0xb3,
MCU_EXT_CMD_SET_QOS_MAP = 0xb4,
@@ -27,7 +28,7 @@ index 012f9be..7e12c05 100644
MCU_EXT_CMD_CSI_CTRL = 0xc2,
MCU_EXT_CMD_IPI_HIST_SCAN = 0xc5,
diff --git a/mt7915/mcu.c b/mt7915/mcu.c
index 20395e9..8f5fcbb 100644
index f83d969c..3e4239f6 100644
--- a/mt7915/mcu.c
+++ b/mt7915/mcu.c
@@ -4736,37 +4736,33 @@ void mt7915_mcu_set_dynalgo(struct mt7915_phy *phy, u8 enable)
@@ -92,7 +93,7 @@ index 20395e9..8f5fcbb 100644
void mt7915_mcu_set_bypass_smthint(struct mt7915_phy *phy, u8 val)
diff --git a/mt7915/mcu.h b/mt7915/mcu.h
index 1682c11..1b0bd06 100644
index 1682c117..1b0bd06b 100644
--- a/mt7915/mcu.h
+++ b/mt7915/mcu.h
@@ -916,6 +916,35 @@ struct mt7915_mcu_rdd_ipi_scan {
@@ -132,10 +133,10 @@ index 1682c11..1b0bd06 100644
#define OFDMA_DL BIT(0)
#define OFDMA_UL BIT(1)
diff --git a/mt7915/mt7915.h b/mt7915/mt7915.h
index 27b007b..f9ca9d5 100644
index 2fb8e2fb..6027e7f7 100644
--- a/mt7915/mt7915.h
+++ b/mt7915/mt7915.h
@@ -765,6 +765,7 @@ void mt7915_mcu_set_mimo(struct mt7915_phy *phy, u8 direction);
@@ -781,6 +781,7 @@ void mt7915_mcu_set_mimo(struct mt7915_phy *phy, u8 direction);
void mt7915_mcu_set_dynalgo(struct mt7915_phy *phy, u8 enable);
int mt7915_mcu_set_mu_edca(struct mt7915_phy *phy, u8 val);
void mt7915_mcu_set_cert(struct mt7915_phy *phy, u8 type);
@@ -144,10 +145,10 @@ index 27b007b..f9ca9d5 100644
void mt7915_vendor_register(struct mt7915_phy *phy);
int mt7915_mcu_set_csi(struct mt7915_phy *phy, u8 mode,
diff --git a/mt7915/vendor.c b/mt7915/vendor.c
index ac6f637..eeac18d 100644
index eb0b380d..54b89030 100644
--- a/mt7915/vendor.c
+++ b/mt7915/vendor.c
@@ -41,6 +41,11 @@ mu_ctrl_policy[NUM_MTK_VENDOR_ATTRS_MU_CTRL] = {
@@ -42,6 +42,11 @@ mu_ctrl_policy[NUM_MTK_VENDOR_ATTRS_MU_CTRL] = {
[MTK_VENDOR_ATTR_MU_CTRL_DUMP] = {.type = NLA_U8 },
};
@@ -159,7 +160,7 @@ index ac6f637..eeac18d 100644
static const struct nla_policy
rfeature_ctrl_policy[NUM_MTK_VENDOR_ATTRS_RFEATURE_CTRL] = {
[MTK_VENDOR_ATTR_RFEATURE_CTRL_HE_GI] = {.type = NLA_U8 },
@@ -992,7 +997,7 @@ static int mt7915_vendor_wireless_ctrl(struct wiphy *wiphy,
@@ -1128,7 +1133,7 @@ static int mt7915_vendor_wireless_ctrl(struct wiphy *wiphy,
mt7915_set_wireless_vif, &val32);
} else if (tb[MTK_VENDOR_ATTR_WIRELESS_CTRL_CERT]) {
val8 = nla_get_u8(tb[MTK_VENDOR_ATTR_WIRELESS_CTRL_CERT]);
@@ -168,7 +169,7 @@ index ac6f637..eeac18d 100644
mt7915_mcu_set_bypass_smthint(phy, val8); /* Cert bypass smooth interpolation */
}
@@ -1136,6 +1141,7 @@ static int mt7915_vendor_edcca_ctrl(struct wiphy *wiphy,
@@ -1272,6 +1277,7 @@ static int mt7915_vendor_edcca_ctrl(struct wiphy *wiphy,
return 0;
}
@@ -176,7 +177,7 @@ index ac6f637..eeac18d 100644
static int
mt7915_vendor_edcca_ctrl_dump(struct wiphy *wiphy, struct wireless_dev *wdev,
struct sk_buff *skb, const void *data, int data_len,
@@ -1179,6 +1185,31 @@ mt7915_vendor_edcca_ctrl_dump(struct wiphy *wiphy, struct wireless_dev *wdev,
@@ -1315,6 +1321,31 @@ mt7915_vendor_edcca_ctrl_dump(struct wiphy *wiphy, struct wireless_dev *wdev,
return len;
}
@@ -208,7 +209,7 @@ index ac6f637..eeac18d 100644
static const struct wiphy_vendor_command mt7915_vendor_commands[] = {
{
.info = {
@@ -1260,6 +1291,17 @@ static const struct wiphy_vendor_command mt7915_vendor_commands[] = {
@@ -1396,6 +1427,17 @@ static const struct wiphy_vendor_command mt7915_vendor_commands[] = {
.dumpit = mt7915_vendor_edcca_ctrl_dump,
.policy = edcca_ctrl_policy,
.maxattr = MTK_VENDOR_ATTR_EDCCA_CTRL_MAX,
@@ -227,7 +228,7 @@ index ac6f637..eeac18d 100644
};
diff --git a/mt7915/vendor.h b/mt7915/vendor.h
index 8c2a996..e61a6aa 100644
index c61ba260..ddde0cc0 100644
--- a/mt7915/vendor.h
+++ b/mt7915/vendor.h
@@ -13,6 +13,7 @@ enum mtk_nl80211_vendor_subcmds {

View File

@@ -1,7 +1,7 @@
From 090c1e87976b841379871abfa75879dc115e4224 Mon Sep 17 00:00:00 2001
From 95a5898db592cf183d3275e67a511f3ad5c2f541 Mon Sep 17 00:00:00 2001
From: mtk27835 <shurong.wen@mediatek.com>
Date: Wed, 7 Sep 2022 14:01:29 -0700
Subject: [PATCH 1019/1053] wifi: mt76: mt7915: add ibf control vendor cmd
Subject: [PATCH 1019/1052] wifi: mt76: mt7915: add ibf control vendor cmd
Signed-off-by: mtk27835 <shurong.wen@mediatek.com>
---
@@ -10,10 +10,10 @@ Signed-off-by: mtk27835 <shurong.wen@mediatek.com>
2 files changed, 89 insertions(+), 1 deletion(-)
diff --git a/mt7915/vendor.c b/mt7915/vendor.c
index eeac18d..a21cbce 100644
index 54b89030..b4facaaa 100644
--- a/mt7915/vendor.c
+++ b/mt7915/vendor.c
@@ -87,6 +87,11 @@ edcca_dump_policy[NUM_MTK_VENDOR_ATTRS_EDCCA_DUMP] = {
@@ -88,6 +88,11 @@ edcca_dump_policy[NUM_MTK_VENDOR_ATTRS_EDCCA_DUMP] = {
[MTK_VENDOR_ATTR_EDCCA_DUMP_SEC80_VAL] = { .type = NLA_U8 },
};
@@ -25,7 +25,7 @@ index eeac18d..a21cbce 100644
struct csi_null_tone {
u8 start;
u8 end;
@@ -1209,6 +1214,54 @@ static int mt7915_vendor_3wire_ctrl(struct wiphy *wiphy,
@@ -1345,6 +1350,54 @@ static int mt7915_vendor_3wire_ctrl(struct wiphy *wiphy,
return mt7915_mcu_set_cfg(phy, CFGINFO_3WIRE_EN_CFG, three_wire_mode);
}
@@ -80,7 +80,7 @@ index eeac18d..a21cbce 100644
static const struct wiphy_vendor_command mt7915_vendor_commands[] = {
{
@@ -1302,6 +1355,18 @@ static const struct wiphy_vendor_command mt7915_vendor_commands[] = {
@@ -1438,6 +1491,18 @@ static const struct wiphy_vendor_command mt7915_vendor_commands[] = {
.doit = mt7915_vendor_3wire_ctrl,
.policy = three_wire_ctrl_policy,
.maxattr = MTK_VENDOR_ATTR_3WIRE_CTRL_MAX,
@@ -100,7 +100,7 @@ index eeac18d..a21cbce 100644
};
diff --git a/mt7915/vendor.h b/mt7915/vendor.h
index e61a6aa..876edf3 100644
index ddde0cc0..24f35c8e 100644
--- a/mt7915/vendor.h
+++ b/mt7915/vendor.h
@@ -13,7 +13,8 @@ enum mtk_nl80211_vendor_subcmds {
@@ -113,7 +113,7 @@ index e61a6aa..876edf3 100644
};
@@ -225,4 +226,26 @@ enum mtk_vendor_attr_phy_capa_dump {
@@ -238,4 +239,26 @@ enum mtk_vendor_attr_phy_capa_dump {
NUM_MTK_VENDOR_ATTRS_PHY_CAPA_DUMP - 1
};

View File

@@ -1,7 +1,7 @@
From 0d530532bcd6795ff333eb7dafee44872c35c64b Mon Sep 17 00:00:00 2001
From 1c8aa13277994e9d4bedcc2399bdcbd73d3612ef Mon Sep 17 00:00:00 2001
From: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
Date: Thu, 30 Mar 2023 15:12:37 +0800
Subject: [PATCH 1020/1053] wifi: mt76: mt7915: add cal free data merge support
Subject: [PATCH 1020/1052] wifi: mt76: mt7915: add cal free data merge support
1. add basic cal free data support
2. add E3 low yield rate workaround for panther E3 with 7976 adie
@@ -19,12 +19,12 @@ Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
5 files changed, 250 insertions(+), 6 deletions(-)
diff --git a/mt7915/debugfs.c b/mt7915/debugfs.c
index 2661386..5c08910 100644
index 909df246..c3692969 100644
--- a/mt7915/debugfs.c
+++ b/mt7915/debugfs.c
@@ -1241,6 +1241,46 @@ mt7915_rf_regval_set(void *data, u64 val)
DEFINE_DEBUGFS_ATTRIBUTE(fops_rf_regval, mt7915_rf_regval_get,
mt7915_rf_regval_set, "0x%08llx\n");
@@ -1286,6 +1286,46 @@ static const struct file_operations mt7915_csi_ops = {
};
#endif
+static ssize_t
+mt7915_efuse_get(struct file *file, char __user *user_buf,
@@ -69,16 +69,16 @@ index 2661386..5c08910 100644
int mt7915_init_debugfs(struct mt7915_phy *phy)
{
struct mt7915_dev *dev = phy->dev;
@@ -1283,6 +1323,7 @@ int mt7915_init_debugfs(struct mt7915_phy *phy)
@@ -1328,6 +1368,7 @@ int mt7915_init_debugfs(struct mt7915_phy *phy)
debugfs_create_devm_seqfile(dev->mt76.dev, "rdd_monitor", dir,
mt7915_rdd_monitor);
}
+ debugfs_create_file("otp", 0400, dir, dev, &mt7915_efuse_ops);
if (!ext_phy)
dev->debugfs_dir = dir;
#ifdef CONFIG_MTK_VENDOR
debugfs_create_file("csi_stats", 0400, dir, phy, &mt7915_csi_ops);
#endif
diff --git a/mt7915/eeprom.c b/mt7915/eeprom.c
index c8b1c18..6133c20 100644
index c8b1c18e..6133c200 100644
--- a/mt7915/eeprom.c
+++ b/mt7915/eeprom.c
@@ -48,8 +48,13 @@ static int mt7915_eeprom_load_precal(struct mt7915_dev *dev)
@@ -309,7 +309,7 @@ index c8b1c18..6133c20 100644
memcpy(dev->mphy.macaddr, dev->mt76.eeprom.data + MT_EE_MAC_ADDR,
ETH_ALEN);
diff --git a/mt7915/eeprom.h b/mt7915/eeprom.h
index 99101f9..70fca0b 100644
index 99101f91..70fca0b3 100644
--- a/mt7915/eeprom.h
+++ b/mt7915/eeprom.h
@@ -68,6 +68,8 @@ enum mt7915_eeprom_field {
@@ -322,7 +322,7 @@ index 99101f9..70fca0b 100644
MT7976_ONE_ADIE_DBDC = 0x7,
MT7975_ONE_ADIE = 0x8,
diff --git a/mt7915/mcu.c b/mt7915/mcu.c
index 072185f..1262206 100644
index 3e4239f6..85112791 100644
--- a/mt7915/mcu.c
+++ b/mt7915/mcu.c
@@ -2968,6 +2968,7 @@ int mt7915_mcu_get_eeprom(struct mt7915_dev *dev, u32 offset, u8 *read_buf)
@@ -353,10 +353,10 @@ index 072185f..1262206 100644
dev_kfree_skb(skb);
diff --git a/mt7915/mt7915.h b/mt7915/mt7915.h
index 00d2b35..1e5cd94 100644
index 6027e7f7..7d068e1e 100644
--- a/mt7915/mt7915.h
+++ b/mt7915/mt7915.h
@@ -562,6 +562,7 @@ u32 mt7915_wed_init_buf(void *ptr, dma_addr_t phys, int token_id);
@@ -579,6 +579,7 @@ u32 mt7915_wed_init_buf(void *ptr, dma_addr_t phys, int token_id);
int mt7915_register_device(struct mt7915_dev *dev);
void mt7915_unregister_device(struct mt7915_dev *dev);

View File

@@ -1,7 +1,7 @@
From 43d77d4dd7c55898fea4df333be72e77b5571eab Mon Sep 17 00:00:00 2001
From cf95b91353888672b8fcf839592760de4d5f93ac Mon Sep 17 00:00:00 2001
From: Evelyn Tsai <evelyn.tsai@mediatek.com>
Date: Fri, 14 Oct 2022 11:15:13 +0800
Subject: [PATCH 1021/1053] wifi: mt76: mt7915: support on off SW ACI through
Subject: [PATCH 1021/1052] wifi: mt76: mt7915: support on off SW ACI through
debugfs
Signed-off-by: Evelyn Tsai <evelyn.tsai@mediatek.com>
@@ -11,11 +11,11 @@ Signed-off-by: Evelyn Tsai <evelyn.tsai@mediatek.com>
2 files changed, 22 insertions(+)
diff --git a/mt76_connac_mcu.h b/mt76_connac_mcu.h
index 109462a..c6a43dd 100644
index e7eb6a93..49c3f1aa 100644
--- a/mt76_connac_mcu.h
+++ b/mt76_connac_mcu.h
@@ -1252,6 +1252,7 @@ enum {
MCU_EXT_CMD_RX_STAT_USER_CTRL = 0xb3,
@@ -1255,6 +1255,7 @@ enum {
MCU_EXT_CMD_SET_QOS_MAP = 0xb4,
MCU_EXT_CMD_SET_CFG = 0xb7,
MCU_EXT_CMD_EDCCA = 0xba,
+ MCU_EXT_CMD_SWLNA_ACI_CTRL = 0xc0,
@@ -23,7 +23,7 @@ index 109462a..c6a43dd 100644
MCU_EXT_CMD_IPI_HIST_SCAN = 0xc5,
};
diff --git a/mt7915/mtk_debugfs.c b/mt7915/mtk_debugfs.c
index 02e0db3..a433e67 100644
index 76f4849e..3e84d753 100644
--- a/mt7915/mtk_debugfs.c
+++ b/mt7915/mtk_debugfs.c
@@ -3770,6 +3770,25 @@ static int mt7915_show_eeprom_mode(struct seq_file *s, void *data)

View File

@@ -1,7 +1,8 @@
From ff7ce1171852dedcaec49ea0de398dfea04aaced Mon Sep 17 00:00:00 2001
From 94af1c45316f8510f60afd0348918345757f1c20 Mon Sep 17 00:00:00 2001
From: Shayne Chen <shayne.chen@mediatek.com>
Date: Mon, 5 Dec 2022 18:21:51 +0800
Subject: [PATCH] wifi: mt76: mt7915: add bf backoff limit table support
Subject: [PATCH 1022/1052] wifi: mt76: mt7915: add bf backoff limit table
support
Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
---
@@ -17,7 +18,7 @@ Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
9 files changed, 275 insertions(+), 54 deletions(-)
diff --git a/debugfs.c b/debugfs.c
index 1c8328d..a626f7c 100644
index 1c8328d5..a626f7cf 100644
--- a/debugfs.c
+++ b/debugfs.c
@@ -95,9 +95,9 @@ void mt76_seq_puts_array(struct seq_file *file, const char *str,
@@ -33,7 +34,7 @@ index 1c8328d..a626f7c 100644
}
EXPORT_SYMBOL_GPL(mt76_seq_puts_array);
diff --git a/eeprom.c b/eeprom.c
index 9d029c0..aa33e7b 100644
index 9d029c04..aa33e7b5 100644
--- a/eeprom.c
+++ b/eeprom.c
@@ -336,9 +336,10 @@ mt76_apply_array_limit(s8 *pwr, size_t pwr_len, const __be32 *data,
@@ -114,7 +115,7 @@ index 9d029c0..aa33e7b 100644
return max_power;
}
diff --git a/mt76.h b/mt76.h
index 48e98a3..5c26715 100644
index 253a564f..580320fd 100644
--- a/mt76.h
+++ b/mt76.h
@@ -1089,6 +1089,14 @@ struct mt76_power_limits {
@@ -133,7 +134,7 @@ index 48e98a3..5c26715 100644
struct mt76_ethtool_worker_info {
diff --git a/mt7915/debugfs.c b/mt7915/debugfs.c
index 5c08910..fa1d2ac 100644
index c3692969..3830a735 100644
--- a/mt7915/debugfs.c
+++ b/mt7915/debugfs.c
@@ -1020,7 +1020,7 @@ mt7915_rate_txpower_get(struct file *file, char __user *user_buf,
@@ -233,7 +234,7 @@ index 5c08910..fa1d2ac 100644
static int
mt7915_twt_stats(struct seq_file *s, void *data)
{
@@ -1310,7 +1373,9 @@ int mt7915_init_debugfs(struct mt7915_phy *phy)
@@ -1355,7 +1418,9 @@ int mt7915_init_debugfs(struct mt7915_phy *phy)
debugfs_create_file("implicit_txbf", 0600, dir, dev,
&fops_implicit_txbf);
debugfs_create_file("txpower_sku", 0400, dir, phy,
@@ -245,10 +246,10 @@ index 5c08910..fa1d2ac 100644
mt7915_twt_stats);
debugfs_create_file("rf_regval", 0600, dir, dev, &fops_rf_regval);
diff --git a/mt7915/init.c b/mt7915/init.c
index 439403f..b32e213 100644
index 0c58ab7b..a9cb496b 100644
--- a/mt7915/init.c
+++ b/mt7915/init.c
@@ -284,6 +284,8 @@ static void __mt7915_init_txpower(struct mt7915_phy *phy,
@@ -285,6 +285,8 @@ static void __mt7915_init_txpower(struct mt7915_phy *phy,
int pwr_delta = mt7915_eeprom_get_power_delta(dev, sband->band);
struct mt76_power_limits limits;
@@ -257,7 +258,7 @@ index 439403f..b32e213 100644
for (i = 0; i < sband->n_channels; i++) {
struct ieee80211_channel *chan = &sband->channels[i];
u32 target_power = 0;
@@ -300,6 +302,11 @@ static void __mt7915_init_txpower(struct mt7915_phy *phy,
@@ -301,6 +303,11 @@ static void __mt7915_init_txpower(struct mt7915_phy *phy,
target_power = mt76_get_rate_power_limits(phy->mt76, chan,
&limits,
target_power);
@@ -270,7 +271,7 @@ index 439403f..b32e213 100644
target_power = DIV_ROUND_UP(target_power, 2);
chan->max_power = min_t(int, chan->max_reg_power,
diff --git a/mt7915/main.c b/mt7915/main.c
index 9fafa16..da7a87b 100644
index de2f9098..4a5a0155 100644
--- a/mt7915/main.c
+++ b/mt7915/main.c
@@ -73,11 +73,7 @@ int mt7915_run(struct ieee80211_hw *hw)
@@ -287,7 +288,7 @@ index 9fafa16..da7a87b 100644
goto out;
diff --git a/mt7915/mcu.c b/mt7915/mcu.c
index 1262206..eb7638b 100644
index 85112791..1b5ef875 100644
--- a/mt7915/mcu.c
+++ b/mt7915/mcu.c
@@ -3422,7 +3422,8 @@ int mt7915_mcu_set_txpower_frame(struct mt7915_phy *phy,
@@ -535,7 +536,7 @@ index 1262206..eb7638b 100644
return mt76_mcu_send_msg(&dev->mt76,
MCU_EXT_CMD(TX_POWER_FEATURE_CTRL), &req,
diff --git a/mt7915/mcu.h b/mt7915/mcu.h
index 1b0bd06..94eff26 100644
index 1b0bd06b..94eff268 100644
--- a/mt7915/mcu.h
+++ b/mt7915/mcu.h
@@ -517,12 +517,18 @@ enum {
@@ -558,7 +559,7 @@ index 1b0bd06..94eff26 100644
SPR_ENABLE = 0x1,
SPR_ENABLE_SD = 0x3,
diff --git a/mt7915/mt7915.h b/mt7915/mt7915.h
index 1e5cd94..826682b 100644
index 7d068e1e..437cfb63 100644
--- a/mt7915/mt7915.h
+++ b/mt7915/mt7915.h
@@ -72,6 +72,7 @@
@@ -569,7 +570,7 @@ index 1e5cd94..826682b 100644
#define MT7915_MAX_TWT_AGRT 16
#define MT7915_MAX_STA_TWT_AGRT 8
@@ -300,6 +301,9 @@ struct mt7915_phy {
@@ -313,6 +314,9 @@ struct mt7915_phy {
struct list_head stats_list;
spinlock_t stats_lock;
@@ -579,7 +580,7 @@ index 1e5cd94..826682b 100644
#ifdef CONFIG_NL80211_TESTMODE
struct {
u32 *reg_backup;
@@ -626,9 +630,10 @@ int mt7915_mcu_set_mac(struct mt7915_dev *dev, int band, bool enable,
@@ -643,9 +647,10 @@ int mt7915_mcu_set_mac(struct mt7915_dev *dev, int band, bool enable,
int mt7915_mcu_set_test_param(struct mt7915_dev *dev, u8 param, bool test_mode,
u8 en);
int mt7915_mcu_set_ser(struct mt7915_dev *dev, u8 action, u8 set, u8 band);

View File

@@ -1,7 +1,7 @@
From 568ebf749e43bade66a39a223a53918db8d71edf Mon Sep 17 00:00:00 2001
From 71155a316facf65574dc5a03cc6c70a824c3d220 Mon Sep 17 00:00:00 2001
From: TomLiu <tomml.liu@mediatek.com>
Date: Wed, 14 Dec 2022 00:44:07 -0800
Subject: [PATCH 1023/1053] wifi: mt76: mt7915: amsdu set and get control
Subject: [PATCH 1023/1052] wifi: mt76: mt7915: amsdu set and get control
---
mt7915/mac.c | 7 +++++++
@@ -11,10 +11,10 @@ Subject: [PATCH 1023/1053] wifi: mt76: mt7915: amsdu set and get control
4 files changed, 50 insertions(+)
diff --git a/mt7915/mac.c b/mt7915/mac.c
index d94a0d5..1e39ad2 100644
index dc75ff1f..e14b3fdd 100644
--- a/mt7915/mac.c
+++ b/mt7915/mac.c
@@ -2035,6 +2035,13 @@ static void mt7915_mac_sta_stats_work(struct mt7915_phy *phy)
@@ -1994,6 +1994,13 @@ static void mt7915_mac_sta_stats_work(struct mt7915_phy *phy)
spin_unlock_bh(&phy->stats_lock);
}
@@ -29,10 +29,10 @@ index d94a0d5..1e39ad2 100644
void mt7915_capi_sta_rc_work(void *data, struct ieee80211_sta *sta)
{
diff --git a/mt7915/mt7915.h b/mt7915/mt7915.h
index 826682b..fe7c211 100644
index 437cfb63..82d374eb 100644
--- a/mt7915/mt7915.h
+++ b/mt7915/mt7915.h
@@ -758,6 +758,7 @@ int mt7915_mmio_wed_init(struct mt7915_dev *dev, void *pdev_ptr,
@@ -775,6 +775,7 @@ int mt7915_mmio_wed_init(struct mt7915_dev *dev, void *pdev_ptr,
bool pci, int *irq);
#ifdef CONFIG_MTK_VENDOR
@@ -41,10 +41,10 @@ index 826682b..fe7c211 100644
void mt7915_set_wireless_vif(void *data, u8 *mac, struct ieee80211_vif *vif);
void mt7915_mcu_set_rfeature_starec(void *data, struct mt7915_dev *dev,
diff --git a/mt7915/vendor.c b/mt7915/vendor.c
index a21cbce..e25a0ce 100644
index b4facaaa..4848e0a1 100644
--- a/mt7915/vendor.c
+++ b/mt7915/vendor.c
@@ -31,10 +31,16 @@ wireless_ctrl_policy[NUM_MTK_VENDOR_ATTRS_WIRELESS_CTRL] = {
@@ -32,10 +32,16 @@ wireless_ctrl_policy[NUM_MTK_VENDOR_ATTRS_WIRELESS_CTRL] = {
[MTK_VENDOR_ATTR_WIRELESS_CTRL_NUSERS_OFDMA] = {.type = NLA_U8 },
[MTK_VENDOR_ATTR_WIRELESS_CTRL_MIMO] = {.type = NLA_U8 },
[MTK_VENDOR_ATTR_WIRELESS_CTRL_BA_BUFFER_SIZE] = {.type = NLA_U16 },
@@ -61,7 +61,7 @@ index a21cbce..e25a0ce 100644
static const struct nla_policy
mu_ctrl_policy[NUM_MTK_VENDOR_ATTRS_MU_CTRL] = {
[MTK_VENDOR_ATTR_MU_CTRL_ONOFF] = {.type = NLA_U8 },
@@ -1004,11 +1010,34 @@ static int mt7915_vendor_wireless_ctrl(struct wiphy *wiphy,
@@ -1140,11 +1146,34 @@ static int mt7915_vendor_wireless_ctrl(struct wiphy *wiphy,
val8 = nla_get_u8(tb[MTK_VENDOR_ATTR_WIRELESS_CTRL_CERT]);
mt7915_mcu_set_cfg(phy, CFGINFO_CERT_CFG, val8); /* Cert Enable for OMI */
mt7915_mcu_set_bypass_smthint(phy, val8); /* Cert bypass smooth interpolation */
@@ -96,7 +96,7 @@ index a21cbce..e25a0ce 100644
static int mt7915_vendor_mu_ctrl(struct wiphy *wiphy,
struct wireless_dev *wdev,
const void *data,
@@ -1307,6 +1336,7 @@ static const struct wiphy_vendor_command mt7915_vendor_commands[] = {
@@ -1443,6 +1472,7 @@ static const struct wiphy_vendor_command mt7915_vendor_commands[] = {
.flags = WIPHY_VENDOR_CMD_NEED_NETDEV |
WIPHY_VENDOR_CMD_NEED_RUNNING,
.doit = mt7915_vendor_wireless_ctrl,
@@ -105,7 +105,7 @@ index a21cbce..e25a0ce 100644
.maxattr = MTK_VENDOR_ATTR_WIRELESS_CTRL_MAX,
},
diff --git a/mt7915/vendor.h b/mt7915/vendor.h
index 876edf3..7c4e914 100644
index 24f35c8e..8a13b3a3 100644
--- a/mt7915/vendor.h
+++ b/mt7915/vendor.h
@@ -75,6 +75,7 @@ enum mtk_vendor_attr_wireless_ctrl {

View File

@@ -1,7 +1,7 @@
From b6063c3c2566911919194c88cb9b68e68596d994 Mon Sep 17 00:00:00 2001
From fbbc0bb4591648f645ed1b0b43f77e9922ecdfdd Mon Sep 17 00:00:00 2001
From: "himanshu.goyal" <himanshu.goyal@mediatek.com>
Date: Tue, 24 Jan 2023 14:32:08 +0800
Subject: [PATCH 1024/1053] wifi: mt76: mt7915: Add vendor command attribute
Subject: [PATCH 1024/1052] wifi: mt76: mt7915: Add vendor command attribute
for RTS BW signaling.
Signed-off-by: himanshu.goyal <himanshu.goyal@mediatek.com>
@@ -13,7 +13,7 @@ Signed-off-by: himanshu.goyal <himanshu.goyal@mediatek.com>
4 files changed, 20 insertions(+)
diff --git a/mt7915/mcu.c b/mt7915/mcu.c
index eb7638b..8e9b801 100644
index 1b5ef875..ca18acfb 100644
--- a/mt7915/mcu.c
+++ b/mt7915/mcu.c
@@ -4863,6 +4863,12 @@ int mt7915_mcu_set_cfg(struct mt7915_phy *phy, u8 cfg_info, u8 type)
@@ -30,7 +30,7 @@ index eb7638b..8e9b801 100644
tlv_len = sizeof(struct three_wire_cfg);
req.three_wire.tag = cpu_to_le16(cfg_info);
diff --git a/mt7915/mcu.h b/mt7915/mcu.h
index 94eff26..6ebcce0 100644
index 94eff268..6ebcce0d 100644
--- a/mt7915/mcu.h
+++ b/mt7915/mcu.h
@@ -936,6 +936,13 @@ struct three_wire_cfg {
@@ -62,10 +62,10 @@ index 94eff26..6ebcce0 100644
};
diff --git a/mt7915/vendor.c b/mt7915/vendor.c
index e25a0ce..8370216 100644
index 4848e0a1..35891d49 100644
--- a/mt7915/vendor.c
+++ b/mt7915/vendor.c
@@ -34,6 +34,7 @@ wireless_ctrl_policy[NUM_MTK_VENDOR_ATTRS_WIRELESS_CTRL] = {
@@ -35,6 +35,7 @@ wireless_ctrl_policy[NUM_MTK_VENDOR_ATTRS_WIRELESS_CTRL] = {
[MTK_VENDOR_ATTR_WIRELESS_CTRL_AMSDU] = {.type = NLA_U8 },
[MTK_VENDOR_ATTR_WIRELESS_CTRL_MU_EDCA] = {.type = NLA_U8 },
[MTK_VENDOR_ATTR_WIRELESS_CTRL_CERT] = {.type = NLA_U8 },
@@ -73,7 +73,7 @@ index e25a0ce..8370216 100644
};
static const struct nla_policy
@@ -1013,6 +1014,9 @@ static int mt7915_vendor_wireless_ctrl(struct wiphy *wiphy,
@@ -1149,6 +1150,9 @@ static int mt7915_vendor_wireless_ctrl(struct wiphy *wiphy,
} else if (tb[MTK_VENDOR_ATTR_WIRELESS_CTRL_AMSDU]) {
val8 = nla_get_u8(tb[MTK_VENDOR_ATTR_WIRELESS_CTRL_AMSDU]);
mt7915_set_wireless_amsdu(hw, val8);
@@ -84,7 +84,7 @@ index e25a0ce..8370216 100644
return 0;
diff --git a/mt7915/vendor.h b/mt7915/vendor.h
index 7c4e914..3672420 100644
index 8a13b3a3..f91ad695 100644
--- a/mt7915/vendor.h
+++ b/mt7915/vendor.h
@@ -77,6 +77,7 @@ enum mtk_vendor_attr_wireless_ctrl {

View File

@@ -1,7 +1,7 @@
From 9981c906450cc4758d975b98f89ff62a64529be6 Mon Sep 17 00:00:00 2001
From a48f497ea998ba30f4ee8ab7e5c41e0eb7738119 Mon Sep 17 00:00:00 2001
From: Yi-Chia Hsieh <yi-chia.hsieh@mediatek.com>
Date: Thu, 26 Jan 2023 08:50:47 +0800
Subject: [PATCH 1025/1053] wifi: mt76: mt7915: add vendor cmd to get available
Subject: [PATCH 1025/1052] wifi: mt76: mt7915: add vendor cmd to get available
color bitmap
Add a vendor cmd to notify user space available color bitmap.
@@ -14,10 +14,10 @@ Signed-off-by: Yi-Chia Hsieh <yi-chia.hsieh@mediatek.com>
2 files changed, 48 insertions(+)
diff --git a/mt7915/vendor.c b/mt7915/vendor.c
index 8370216..9a26f7f 100644
index 35891d49..df08704b 100644
--- a/mt7915/vendor.c
+++ b/mt7915/vendor.c
@@ -99,6 +99,11 @@ ibf_ctrl_policy[NUM_MTK_VENDOR_ATTRS_IBF_CTRL] = {
@@ -100,6 +100,11 @@ ibf_ctrl_policy[NUM_MTK_VENDOR_ATTRS_IBF_CTRL] = {
[MTK_VENDOR_ATTR_IBF_CTRL_ENABLE] = { .type = NLA_U8 },
};
@@ -29,7 +29,7 @@ index 8370216..9a26f7f 100644
struct csi_null_tone {
u8 start;
u8 end;
@@ -1295,6 +1300,27 @@ mt7915_vendor_ibf_ctrl_dump(struct wiphy *wiphy, struct wireless_dev *wdev,
@@ -1431,6 +1436,27 @@ mt7915_vendor_ibf_ctrl_dump(struct wiphy *wiphy, struct wireless_dev *wdev,
return 1;
}
@@ -57,7 +57,7 @@ index 8370216..9a26f7f 100644
static const struct wiphy_vendor_command mt7915_vendor_commands[] = {
{
@@ -1401,6 +1427,17 @@ static const struct wiphy_vendor_command mt7915_vendor_commands[] = {
@@ -1537,6 +1563,17 @@ static const struct wiphy_vendor_command mt7915_vendor_commands[] = {
.dumpit = mt7915_vendor_ibf_ctrl_dump,
.policy = ibf_ctrl_policy,
.maxattr = MTK_VENDOR_ATTR_IBF_CTRL_MAX,
@@ -76,7 +76,7 @@ index 8370216..9a26f7f 100644
};
diff --git a/mt7915/vendor.h b/mt7915/vendor.h
index 3672420..bd1c617 100644
index f91ad695..5b8d99bf 100644
--- a/mt7915/vendor.h
+++ b/mt7915/vendor.h
@@ -15,6 +15,7 @@ enum mtk_nl80211_vendor_subcmds {
@@ -87,7 +87,7 @@ index 3672420..bd1c617 100644
};
@@ -261,4 +262,14 @@ enum mtk_vendor_attr_ibf_dump {
@@ -274,4 +275,14 @@ enum mtk_vendor_attr_ibf_dump {
NUM_MTK_VENDOR_ATTRS_IBF_DUMP - 1
};

View File

@@ -1,7 +1,7 @@
From 0df14b3d2578681009ca9be604e98bb94ee1186a Mon Sep 17 00:00:00 2001
From 252b23b1e979d3b44ca148407d0166c9b618c9e2 Mon Sep 17 00:00:00 2001
From: Howard Hsu <howard-yh.hsu@mediatek.com>
Date: Fri, 24 Feb 2023 16:29:42 +0800
Subject: [PATCH] wifi: mt76: mt7915: disable SW-ACI by default
Subject: [PATCH 1026/1052] wifi: mt76: mt7915: disable SW-ACI by default
Support to enable/disable SW-ACI by module parameter "sw_aci_enable".
SW-ACI feature is disable by default.
@@ -13,7 +13,7 @@ SW-ACI feature is disable by default.
4 files changed, 29 insertions(+), 9 deletions(-)
diff --git a/mt7915/main.c b/mt7915/main.c
index b80d6fd..2ff7667 100644
index 4a5a0155..75042189 100644
--- a/mt7915/main.c
+++ b/mt7915/main.c
@@ -8,6 +8,10 @@
@@ -39,13 +39,14 @@ index b80d6fd..2ff7667 100644
if (phy != &dev->phy) {
diff --git a/mt7915/mcu.c b/mt7915/mcu.c
index 5534603..e95a5d7 100644
index ca18acfb..7a7b3bac 100644
--- a/mt7915/mcu.c
+++ b/mt7915/mcu.c
@@ -5223,6 +5223,21 @@ int mt7915_mcu_get_edcca(struct mt7915_phy *phy, u8 mode, s8 *value)
@@ -5222,3 +5222,18 @@ int mt7915_mcu_get_edcca(struct mt7915_phy *phy, u8 mode, s8 *value)
return 0;
}
+
+int mt7915_mcu_sw_aci_set(struct mt7915_dev *dev, bool val)
+{
+#define SWLNA_ENABLE 6
@@ -60,15 +61,11 @@ index 5534603..e95a5d7 100644
+ return mt76_mcu_send_msg(&dev->mt76, MCU_EXT_CMD(SWLNA_ACI_CTRL), &req,
+ sizeof(req), NULL);
+}
+
int mt7915_mcu_set_qos_map(struct mt7915_dev *dev, struct ieee80211_vif *vif)
{
#define IP_DSCP_NUM 64
diff --git a/mt7915/mt7915.h b/mt7915/mt7915.h
index 9e7183c..c8b697c 100644
index 82d374eb..3fa32574 100644
--- a/mt7915/mt7915.h
+++ b/mt7915/mt7915.h
@@ -783,6 +783,7 @@ int mt7915_vendor_amnt_sta_remove(struct mt7915_phy *phy,
@@ -801,6 +801,7 @@ int mt7915_vendor_amnt_sta_remove(struct mt7915_phy *phy,
#endif
int mt7915_mcu_set_edcca(struct mt7915_phy *phy, int mode, u8 *value, s8 compensation);
int mt7915_mcu_get_edcca(struct mt7915_phy *phy, u8 mode, s8 *value);
@@ -77,7 +74,7 @@ index 9e7183c..c8b697c 100644
int mt7915_mcu_ipi_hist_scan(struct mt7915_phy *phy, void *data, u8 mode, bool wait_resp);
diff --git a/mt7915/mtk_debugfs.c b/mt7915/mtk_debugfs.c
index 8f2f496..ad7abda 100644
index 3e84d753..d9323603 100644
--- a/mt7915/mtk_debugfs.c
+++ b/mt7915/mtk_debugfs.c
@@ -3773,16 +3773,12 @@ static int mt7915_show_eeprom_mode(struct seq_file *s, void *data)

View File

@@ -1,7 +1,7 @@
From ed2035d25794352ca10f4cdc04dd931b1ebfac50 Mon Sep 17 00:00:00 2001
From ffe8743a0ee8310def4abad0968fee55cf409ea6 Mon Sep 17 00:00:00 2001
From: MeiChia Chiu <meichia.chiu@mediatek.com>
Date: Thu, 27 Apr 2023 15:37:33 +0800
Subject: [PATCH 1027/1053] wifi: mt76: mt7915: add muru user number debug
Subject: [PATCH 1027/1052] wifi: mt76: mt7915: add muru user number debug
command
---
@@ -11,10 +11,10 @@ Subject: [PATCH 1027/1053] wifi: mt76: mt7915: add muru user number debug
3 files changed, 17 insertions(+), 1 deletion(-)
diff --git a/mt7915/mt7915.h b/mt7915/mt7915.h
index 44dd0f4..e5a201c 100644
index 3fa32574..c745b31d 100644
--- a/mt7915/mt7915.h
+++ b/mt7915/mt7915.h
@@ -645,6 +645,7 @@ int mt7915_mcu_set_pulse_th(struct mt7915_dev *dev,
@@ -662,6 +662,7 @@ int mt7915_mcu_set_pulse_th(struct mt7915_dev *dev,
int mt7915_mcu_set_radar_th(struct mt7915_dev *dev, int index,
const struct mt7915_dfs_pattern *pattern);
int mt7915_mcu_set_muru_ctrl(struct mt7915_dev *dev, u32 cmd, u32 val);
@@ -23,10 +23,10 @@ index 44dd0f4..e5a201c 100644
int mt7915_mcu_apply_tx_dpd(struct mt7915_phy *phy);
int mt7915_mcu_get_chan_mib_info(struct mt7915_phy *phy, bool chan_switch);
diff --git a/mt7915/vendor.c b/mt7915/vendor.c
index 9a26f7f..432d750 100644
index df08704b..6446439f 100644
--- a/mt7915/vendor.c
+++ b/mt7915/vendor.c
@@ -46,6 +46,8 @@ static const struct nla_policy
@@ -47,6 +47,8 @@ static const struct nla_policy
mu_ctrl_policy[NUM_MTK_VENDOR_ATTRS_MU_CTRL] = {
[MTK_VENDOR_ATTR_MU_CTRL_ONOFF] = {.type = NLA_U8 },
[MTK_VENDOR_ATTR_MU_CTRL_DUMP] = {.type = NLA_U8 },
@@ -35,7 +35,7 @@ index 9a26f7f..432d750 100644
};
static const struct nla_policy
@@ -1053,9 +1055,10 @@ static int mt7915_vendor_mu_ctrl(struct wiphy *wiphy,
@@ -1189,9 +1191,10 @@ static int mt7915_vendor_mu_ctrl(struct wiphy *wiphy,
int data_len)
{
struct ieee80211_hw *hw = wiphy_to_ieee80211_hw(wiphy);
@@ -47,7 +47,7 @@ index 9a26f7f..432d750 100644
u32 val32 = 0;
err = nla_parse(tb, MTK_VENDOR_ATTR_MU_CTRL_MAX, data, data_len,
@@ -1069,6 +1072,16 @@ static int mt7915_vendor_mu_ctrl(struct wiphy *wiphy,
@@ -1205,6 +1208,16 @@ static int mt7915_vendor_mu_ctrl(struct wiphy *wiphy,
FIELD_PREP(RATE_CFG_VAL, val8);
ieee80211_iterate_active_interfaces_atomic(hw, IEEE80211_IFACE_ITER_RESUME_ALL,
mt7915_set_wireless_vif, &val32);
@@ -65,7 +65,7 @@ index 9a26f7f..432d750 100644
return 0;
diff --git a/mt7915/vendor.h b/mt7915/vendor.h
index bd1c617..03d1660 100644
index 5b8d99bf..11ccd0d8 100644
--- a/mt7915/vendor.h
+++ b/mt7915/vendor.h
@@ -103,6 +103,8 @@ enum mtk_vendor_attr_mu_ctrl {

View File

@@ -1,7 +1,7 @@
From 1eedf84cfc86e9b6e9de78509e85789025b1b3ac Mon Sep 17 00:00:00 2001
From 15cd113a03288b74f6486c898378d61b2204b09e Mon Sep 17 00:00:00 2001
From: Bo Jiao <Bo.Jiao@mediatek.com>
Date: Mon, 22 May 2023 15:30:21 +0800
Subject: [PATCH 1028/1053] wifi: mt76: mt7915: add debugfs for fw coredump.
Subject: [PATCH 1028/1052] wifi: mt76: mt7915: add debugfs for fw coredump.
Signed-off-by: Bo Jiao <Bo.Jiao@mediatek.com>
---
@@ -12,7 +12,7 @@ Signed-off-by: Bo Jiao <Bo.Jiao@mediatek.com>
4 files changed, 58 insertions(+), 9 deletions(-)
diff --git a/mt7915/debugfs.c b/mt7915/debugfs.c
index fa1d2ac..3044557 100644
index 3830a735..06c62dd3 100644
--- a/mt7915/debugfs.c
+++ b/mt7915/debugfs.c
@@ -82,8 +82,10 @@ mt7915_sys_recovery_set(struct file *file, const char __user *user_buf,
@@ -67,10 +67,10 @@ index fa1d2ac..3044557 100644
/* SER statistics */
desc += scnprintf(buff + desc, bufsz - desc,
diff --git a/mt7915/mac.c b/mt7915/mac.c
index 1e39ad2..14367fd 100644
index e14b3fdd..35e97f88 100644
--- a/mt7915/mac.c
+++ b/mt7915/mac.c
@@ -1728,10 +1728,34 @@ void mt7915_mac_dump_work(struct work_struct *work)
@@ -1687,10 +1687,34 @@ void mt7915_mac_dump_work(struct work_struct *work)
dev = container_of(work, struct mt7915_dev, dump_work);
@@ -107,7 +107,7 @@ index 1e39ad2..14367fd 100644
}
void mt7915_reset(struct mt7915_dev *dev)
@@ -1750,7 +1774,7 @@ void mt7915_reset(struct mt7915_dev *dev)
@@ -1709,7 +1733,7 @@ void mt7915_reset(struct mt7915_dev *dev)
wiphy_name(dev->mt76.hw->wiphy));
mt7915_irq_disable(dev, MT_INT_MCU_CMD);
@@ -117,7 +117,7 @@ index 1e39ad2..14367fd 100644
}
diff --git a/mt7915/mcu.h b/mt7915/mcu.h
index 6ebcce0..035ad97 100644
index 6ebcce0d..035ad97d 100644
--- a/mt7915/mcu.h
+++ b/mt7915/mcu.h
@@ -760,8 +760,12 @@ enum {
@@ -135,7 +135,7 @@ index 6ebcce0..035ad97 100644
SER_ENABLE = 2,
SER_RECOVER
diff --git a/mt7915/mt7915.h b/mt7915/mt7915.h
index e5a201c..ea91611 100644
index c745b31d..ef51d6e2 100644
--- a/mt7915/mt7915.h
+++ b/mt7915/mt7915.h
@@ -91,6 +91,13 @@ struct mt7915_sta;
@@ -152,7 +152,7 @@ index e5a201c..ea91611 100644
enum mt7915_txq_id {
MT7915_TXQ_FWDL = 16,
MT7915_TXQ_MCU_WM,
@@ -387,6 +394,7 @@ struct mt7915_dev {
@@ -404,6 +411,7 @@ struct mt7915_dev {
/* protects coredump data */
struct mutex dump_mutex;
@@ -160,7 +160,7 @@ index e5a201c..ea91611 100644
#ifdef CONFIG_DEV_COREDUMP
struct {
struct mt7915_crash_data *crash_data[__MT76_RAM_TYPE_MAX];
@@ -583,6 +591,7 @@ int mt7915_txbf_init(struct mt7915_dev *dev);
@@ -600,6 +608,7 @@ int mt7915_txbf_init(struct mt7915_dev *dev);
void mt7915_init_txpower(struct mt7915_phy *phy);
int mt7915_init_vif(struct mt7915_phy *phy, struct ieee80211_vif *vif, bool bf_en);
void mt7915_reset(struct mt7915_dev *dev);

View File

@@ -1,7 +1,7 @@
From 42cbeac3362b0d1ca2c513b4bcb850a73afafb94 Mon Sep 17 00:00:00 2001
From 1ffedbe219a388f3b76a717cbf2d42e6ba9b25f2 Mon Sep 17 00:00:00 2001
From: MeiChia Chiu <meichia.chiu@mediatek.com>
Date: Wed, 24 May 2023 22:35:54 +0800
Subject: [PATCH 1029/1053] wifi: mt76: mt7915: remove BW160 support
Subject: [PATCH 1029/1052] wifi: mt76: mt7915: remove BW160 support
Remove BW160 capability in mt7915.
---
@@ -9,10 +9,10 @@ Remove BW160 capability in mt7915.
1 file changed, 6 insertions(+), 20 deletions(-)
diff --git a/mt7915/init.c b/mt7915/init.c
index b32e213..decccc0 100644
index a9cb496b..a77078f7 100644
--- a/mt7915/init.c
+++ b/mt7915/init.c
@@ -439,11 +439,6 @@ mt7915_init_wiphy(struct mt7915_phy *phy)
@@ -441,11 +441,6 @@ mt7915_init_wiphy(struct mt7915_phy *phy)
vht_cap->cap |=
IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_7991 |
IEEE80211_VHT_CAP_MAX_A_MPDU_LENGTH_EXPONENT_MASK;
@@ -24,7 +24,7 @@ index b32e213..decccc0 100644
} else {
phy->mt76->sband_5g.sband.ht_cap.ampdu_density =
IEEE80211_HT_MPDU_DENSITY_2;
@@ -899,13 +894,9 @@ mt7915_set_stream_he_txbf_caps(struct mt7915_phy *phy,
@@ -873,13 +868,9 @@ mt7915_set_stream_he_txbf_caps(struct mt7915_phy *phy,
int sts = hweight8(phy->mt76->chainmask);
u8 c, sts_160 = sts;
@@ -41,7 +41,7 @@ index b32e213..decccc0 100644
#ifdef CONFIG_MAC80211_MESH
if (vif == NL80211_IFTYPE_MESH_POINT)
@@ -989,15 +980,10 @@ mt7915_init_he_caps(struct mt7915_phy *phy, enum nl80211_band band,
@@ -963,15 +954,10 @@ mt7915_init_he_caps(struct mt7915_phy *phy, enum nl80211_band band,
int i, idx = 0, nss = hweight8(phy->mt76->antenna_mask);
u16 mcs_map = 0;
u16 mcs_map_160 = 0;

View File

@@ -1,7 +1,7 @@
From cc213fc945f430c8767ee6984741c3cf9a030d9c Mon Sep 17 00:00:00 2001
From ac55beffc7c153e47a63dd889a80f90656afa5a4 Mon Sep 17 00:00:00 2001
From: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
Date: Tue, 11 Jul 2023 17:06:04 +0800
Subject: [PATCH 1030/1053] wifi: mt76: mt7915: add txpower info dump support
Subject: [PATCH 1030/1052] wifi: mt76: mt7915: add txpower info dump support
Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
---
@@ -11,7 +11,7 @@ Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
3 files changed, 91 insertions(+), 1 deletion(-)
diff --git a/mt7915/debugfs.c b/mt7915/debugfs.c
index 3044557..24e88f7 100644
index 06c62dd3..223f9a37 100644
--- a/mt7915/debugfs.c
+++ b/mt7915/debugfs.c
@@ -1259,6 +1259,91 @@ mt7915_txpower_path_show(struct seq_file *file, void *data)
@@ -106,7 +106,7 @@ index 3044557..24e88f7 100644
static int
mt7915_twt_stats(struct seq_file *s, void *data)
{
@@ -1388,6 +1473,8 @@ int mt7915_init_debugfs(struct mt7915_phy *phy)
@@ -1433,6 +1518,8 @@ int mt7915_init_debugfs(struct mt7915_phy *phy)
&mt7915_txpower_fops);
debugfs_create_file("txpower_path", 0400, dir, phy,
&mt7915_txpower_path_fops);
@@ -116,7 +116,7 @@ index 3044557..24e88f7 100644
mt7915_twt_stats);
debugfs_create_file("rf_regval", 0600, dir, dev, &fops_rf_regval);
diff --git a/mt7915/mcu.c b/mt7915/mcu.c
index 45b0907..b9beb4f 100644
index 7a7b3bac..34d36e50 100644
--- a/mt7915/mcu.c
+++ b/mt7915/mcu.c
@@ -3624,6 +3624,8 @@ int mt7915_mcu_get_txpower_sku(struct mt7915_phy *phy, s8 *txpower, int len,
@@ -129,7 +129,7 @@ index 45b0907..b9beb4f 100644
dev_kfree_skb(skb);
diff --git a/mt7915/mcu.h b/mt7915/mcu.h
index 035ad97..3089fb6 100644
index 035ad97d..3089fb64 100644
--- a/mt7915/mcu.h
+++ b/mt7915/mcu.h
@@ -525,7 +525,8 @@ enum {

View File

@@ -1,8 +1,8 @@
From 539de29220ad63d73fdb1ff86d63014b4e246e3a Mon Sep 17 00:00:00 2001
From 51f9f9e7d922b77f86ddebca13232472a91609d2 Mon Sep 17 00:00:00 2001
From: Yi-Chia Hsieh <yi-chia.hsieh@mediatek.com>
Date: Fri, 23 Jun 2023 06:06:21 +0800
Subject: [PATCH 1031/1053] wifi: mt76: mt7915: report tx and rx byte to
tpt_led when wed is enabled
Subject: [PATCH] wifi: mt76: mt7915: report tx and rx byte to tpt_led when wed
is enabled
Signed-off-by: Yi-Chia Hsieh <yi-chia.hsieh@mediatek.com>
---
@@ -11,18 +11,17 @@ Signed-off-by: Yi-Chia Hsieh <yi-chia.hsieh@mediatek.com>
2 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/mt76_connac_mac.c b/mt76_connac_mac.c
index 630c640..949df63 100644
index 09c28dc..8a511c9 100644
--- a/mt76_connac_mac.c
+++ b/mt76_connac_mac.c
@@ -597,9 +597,15 @@ bool mt76_connac2_mac_fill_txs(struct mt76_dev *dev, struct mt76_wcid *wcid,
@@ -605,8 +605,14 @@ bool mt76_connac2_mac_fill_txs(struct mt76_dev *dev, struct mt76_wcid *wcid,
txs = le32_to_cpu(txs_data[0]);
+ mphy = mt76_dev_phy(dev, wcid->phy_idx);
+
/* PPDU based reporting */
if (mtk_wed_device_active(&dev->mmio.wed) &&
FIELD_GET(MT_TXS0_TXS_FORMAT, txs) > 1) {
if (FIELD_GET(MT_TXS0_TXS_FORMAT, txs) > 1) {
+ ieee80211_tpt_led_trig_tx(mphy->hw,
+ le32_get_bits(txs_data[5], MT_TXS5_MPDU_TX_BYTE) -
+ le32_get_bits(txs_data[7], MT_TXS7_MPDU_RETRY_BYTE));
@@ -30,7 +29,7 @@ index 630c640..949df63 100644
stats->tx_bytes +=
le32_get_bits(txs_data[5], MT_TXS5_MPDU_TX_BYTE) -
le32_get_bits(txs_data[7], MT_TXS7_MPDU_RETRY_BYTE);
@@ -640,10 +646,6 @@ bool mt76_connac2_mac_fill_txs(struct mt76_dev *dev, struct mt76_wcid *wcid,
@@ -650,10 +656,6 @@ bool mt76_connac2_mac_fill_txs(struct mt76_dev *dev, struct mt76_wcid *wcid,
cck = true;
fallthrough;
case MT_PHY_TYPE_OFDM:
@@ -42,7 +41,7 @@ index 630c640..949df63 100644
sband = &mphy->sband_5g.sband;
else if (mphy->chandef.chan->band == NL80211_BAND_6GHZ)
diff --git a/mt7915/mmio.c b/mt7915/mmio.c
index ddf1b72..437a9b0 100644
index ed15d71..b1b219c 100644
--- a/mt7915/mmio.c
+++ b/mt7915/mmio.c
@@ -588,6 +588,7 @@ static void mt7915_mmio_wed_update_rx_stats(struct mtk_wed_device *wed,
@@ -65,5 +64,5 @@ index ddf1b72..437a9b0 100644
wcid->stats.rx_packets += le32_to_cpu(stats->rx_pkt_cnt);
wcid->stats.rx_errors += le32_to_cpu(stats->rx_err_cnt);
--
2.18.0
2.45.2

View File

@@ -1,17 +1,17 @@
From d588c607b158e13343964b451d1de5b98bba7feb Mon Sep 17 00:00:00 2001
From fcfa851c3dd6782c382dc1890f2623fdc0858f73 Mon Sep 17 00:00:00 2001
From: MeiChia Chiu <meichia.chiu@mediatek.com>
Date: Tue, 8 Aug 2023 11:20:58 +0800
Subject: [PATCH 1032/1053] wifi: mt76: mt7915: Establish BA in VO queue
Subject: [PATCH 1032/1052] wifi: mt76: mt7915: Establish BA in VO queue
---
mt76_connac_mac.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/mt76_connac_mac.c b/mt76_connac_mac.c
index 949df63..d036047 100644
index 6eeea971..c23d266e 100644
--- a/mt76_connac_mac.c
+++ b/mt76_connac_mac.c
@@ -1115,8 +1115,6 @@ void mt76_connac2_tx_check_aggr(struct ieee80211_sta *sta, __le32 *txwi)
@@ -1123,8 +1123,6 @@ void mt76_connac2_tx_check_aggr(struct ieee80211_sta *sta, __le32 *txwi)
return;
tid = le32_get_bits(txwi[1], MT_TXD1_TID);

View File

@@ -1,7 +1,7 @@
From ee3f33638400dfe0306ed5d12f1e2c1840632cea Mon Sep 17 00:00:00 2001
From 6eb114c04f79a4e1642a6743e9895cb8038a4630 Mon Sep 17 00:00:00 2001
From: "Allen.Ye" <allen.ye@mediatek.com>
Date: Fri, 11 Aug 2023 16:46:53 +0800
Subject: [PATCH 1033/1053] wifi: mt76: mt7915: Disable RegDB when enable
Subject: [PATCH 1033/1052] wifi: mt76: mt7915: Disable RegDB when enable
single sku
---
@@ -11,7 +11,7 @@ Subject: [PATCH 1033/1053] wifi: mt76: mt7915: Disable RegDB when enable
3 files changed, 57 insertions(+), 11 deletions(-)
diff --git a/mt7915/debugfs.c b/mt7915/debugfs.c
index 24e88f7..502b493 100644
index 223f9a37..2c1e1bea 100644
--- a/mt7915/debugfs.c
+++ b/mt7915/debugfs.c
@@ -1020,10 +1020,16 @@ mt7915_rate_txpower_get(struct file *file, char __user *user_buf,
@@ -40,15 +40,15 @@ index 24e88f7..502b493 100644
- MT_WF_PHY_TPC_CTRL_STAT_MT7916(band);
+ reg = is_mt7915(&dev->mt76) ? MT_WF_IRPI_TPC_CTRL_STAT(band) :
+ MT_WF_IRPI_TPC_CTRL_STAT_MT7916(band);
- len += scnprintf(buf + len, sz - len, "\nTx power (bbp) : %6ld\n",
- mt76_get_field(dev, reg, MT_WF_PHY_TPC_POWER));
+
+ len += scnprintf(buf + len, sz - len, "\nTx power (bbp) : %6ld [0.5 dBm]\n",
+ mt76_get_field(dev, reg, MT_WF_IRPI_TPC_POWER));
+
+ len += scnprintf(buf + len, sz - len, "RegDB maximum power:\t%d [dBm]\n",
+ chan->max_reg_power);
+
- len += scnprintf(buf + len, sz - len, "\nTx power (bbp) : %6ld\n",
- mt76_get_field(dev, reg, MT_WF_PHY_TPC_POWER));
+ if (chan->band == NL80211_BAND_2GHZ)
+ sband = phy->mt76->sband_2g.sband;
+ else if (chan->band == NL80211_BAND_5GHZ)
@@ -103,10 +103,10 @@ index 24e88f7..502b493 100644
return ret;
}
diff --git a/mt7915/init.c b/mt7915/init.c
index decccc0..a5b38c8 100644
index a77078f7..6f616b54 100644
--- a/mt7915/init.c
+++ b/mt7915/init.c
@@ -283,9 +283,11 @@ static void __mt7915_init_txpower(struct mt7915_phy *phy,
@@ -284,9 +284,11 @@ static void __mt7915_init_txpower(struct mt7915_phy *phy,
int nss_delta = mt76_tx_power_nss_delta(n_chains);
int pwr_delta = mt7915_eeprom_get_power_delta(dev, sband->band);
struct mt76_power_limits limits;
@@ -118,7 +118,7 @@ index decccc0..a5b38c8 100644
for (i = 0; i < sband->n_channels; i++) {
struct ieee80211_channel *chan = &sband->channels[i];
u32 target_power = 0;
@@ -309,8 +311,13 @@ static void __mt7915_init_txpower(struct mt7915_phy *phy,
@@ -310,8 +312,13 @@ static void __mt7915_init_txpower(struct mt7915_phy *phy,
target_power += nss_delta;
target_power = DIV_ROUND_UP(target_power, 2);
@@ -135,7 +135,7 @@ index decccc0..a5b38c8 100644
}
}
diff --git a/mt7915/regs.h b/mt7915/regs.h
index 4d05e39..ca355d1 100644
index 4d05e391..ca355d14 100644
--- a/mt7915/regs.h
+++ b/mt7915/regs.h
@@ -1215,6 +1215,10 @@ enum offs_rev {

View File

@@ -1,18 +1,18 @@
From 20c497b434dc4555210ea64cde38dd86817d8891 Mon Sep 17 00:00:00 2001
From 18fd1219383a2d2f2b0881d87ca8a1552e273bf1 Mon Sep 17 00:00:00 2001
From: Evelyn Tsai <evelyn.tsai@mediatek.com>
Date: Thu, 24 Aug 2023 03:01:27 +0800
Subject: [PATCH] wifi: mt76: mt7915: enable the mac80211 hw bmc ps buffer
function.
Subject: [PATCH 1034/1052] wifi: mt76: mt7915: enable the mac80211 hw bmc ps
buffer function.
---
mt7915/init.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/mt7915/init.c b/mt7915/init.c
index 35aefca..545afe7 100644
index 6f616b54..c4685f21 100644
--- a/mt7915/init.c
+++ b/mt7915/init.c
@@ -413,6 +413,7 @@ mt7915_init_wiphy(struct mt7915_phy *phy)
@@ -414,6 +414,7 @@ mt7915_init_wiphy(struct mt7915_phy *phy)
ieee80211_hw_set(hw, SUPPORTS_RX_DECAP_OFFLOAD);
ieee80211_hw_set(hw, SUPPORTS_MULTI_BSSID);
ieee80211_hw_set(hw, WANT_MONITOR_VIF);

View File

@@ -1,7 +1,7 @@
From e9cf08519595e2d8c5c227486948d8cb00db626a Mon Sep 17 00:00:00 2001
From c324616943e4a51d5d288a26bdbb330be11d2d8f Mon Sep 17 00:00:00 2001
From: Evelyn Tsai <evelyn.tsai@mediatek.com>
Date: Thu, 24 Aug 2023 03:01:27 +0800
Subject: [PATCH 1035/1053] wifi: mt76: update debugfs knob for tx tokens
Subject: [PATCH 1035/1052] wifi: mt76: update debugfs knob for tx tokens
1. dump token pending time
2. dump per-band token counts
@@ -14,7 +14,7 @@ Signed-off-by: Peter Chiu <chui-hao.chiu@mediatek.com>
3 files changed, 22 insertions(+), 5 deletions(-)
diff --git a/mt76.h b/mt76.h
index 5c26715..6f78c07 100644
index 580320fd..16b76b48 100644
--- a/mt76.h
+++ b/mt76.h
@@ -403,6 +403,7 @@ struct mt76_txwi_cache {
@@ -26,7 +26,7 @@ index 5c26715..6f78c07 100644
union {
struct sk_buff *skb;
diff --git a/mt7915/mac.c b/mt7915/mac.c
index 14367fd..71b4e2d 100644
index 35e97f88..a7314465 100644
--- a/mt7915/mac.c
+++ b/mt7915/mac.c
@@ -811,6 +811,8 @@ int mt7915_tx_prepare_skb(struct mt76_dev *mdev, void *txwi_ptr,
@@ -39,7 +39,7 @@ index 14367fd..71b4e2d 100644
mt7915_mac_write_txwi(mdev, txwi_ptr, tx_info->skb, wcid, pid, key,
qid, 0);
diff --git a/mt7915/mtk_debugfs.c b/mt7915/mtk_debugfs.c
index f00ac10..3c248ee 100644
index d9323603..2cc0b2d8 100644
--- a/mt7915/mtk_debugfs.c
+++ b/mt7915/mtk_debugfs.c
@@ -2203,17 +2203,31 @@ static int mt7915_mibinfo_band1(struct seq_file *s, void *data)

View File

@@ -1,7 +1,7 @@
From e81df1a68b96bc91891c9c097db376a1890450ae Mon Sep 17 00:00:00 2001
From 8e5290c521da92f931b169e1b2dccc7125e17253 Mon Sep 17 00:00:00 2001
From: Howard Hsu <howard-yh.hsu@mediatek.com>
Date: Tue, 5 Sep 2023 20:17:19 +0800
Subject: [PATCH 1036/1053] wifi: mt76: mt7915: support enable/disable spatial
Subject: [PATCH 1036/1052] wifi: mt76: mt7915: support enable/disable spatial
reuse through debugfs
Signed-off-by: Howard Hsu <howard-yh.hsu@mediatek.com>
@@ -12,7 +12,7 @@ Signed-off-by: Howard Hsu <howard-yh.hsu@mediatek.com>
3 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/mt7915/mcu.c b/mt7915/mcu.c
index b9beb4f..4b5fb53 100644
index 34d36e50..40d94c4f 100644
--- a/mt7915/mcu.c
+++ b/mt7915/mcu.c
@@ -3756,8 +3756,7 @@ int mt7915_mcu_set_txbf(struct mt7915_dev *dev, u8 action)
@@ -26,10 +26,10 @@ index b9beb4f..4b5fb53 100644
struct mt7915_dev *dev = phy->dev;
struct mt7915_mcu_sr_ctrl req = {
diff --git a/mt7915/mt7915.h b/mt7915/mt7915.h
index ea91611..bfd87bc 100644
index ef51d6e2..bc0f313c 100644
--- a/mt7915/mt7915.h
+++ b/mt7915/mt7915.h
@@ -795,6 +795,7 @@ int mt7915_mcu_get_edcca(struct mt7915_phy *phy, u8 mode, s8 *value);
@@ -814,6 +814,7 @@ int mt7915_mcu_get_edcca(struct mt7915_phy *phy, u8 mode, s8 *value);
int mt7915_mcu_sw_aci_set(struct mt7915_dev *dev, bool val);
int mt7915_mcu_ipi_hist_ctrl(struct mt7915_phy *phy, void *data, u8 cmd, bool wait_resp);
int mt7915_mcu_ipi_hist_scan(struct mt7915_phy *phy, void *data, u8 mode, bool wait_resp);
@@ -38,7 +38,7 @@ index ea91611..bfd87bc 100644
#ifdef MTK_DEBUG
int mt7915_mtk_init_debugfs(struct mt7915_phy *phy, struct dentry *dir);
diff --git a/mt7915/mtk_debugfs.c b/mt7915/mtk_debugfs.c
index 3c248ee..9bbe50d 100644
index 2cc0b2d8..c00184f8 100644
--- a/mt7915/mtk_debugfs.c
+++ b/mt7915/mtk_debugfs.c
@@ -3799,6 +3799,17 @@ mt7915_sw_aci_set(void *data, u64 val)

View File

@@ -1,7 +1,7 @@
From b8b4b5abf0dce8bedfca44e1a7871c119f2b92e6 Mon Sep 17 00:00:00 2001
From 50046dd2dad794942f0f28fda6ede3b90261e0be Mon Sep 17 00:00:00 2001
From: Bo Jiao <Bo.Jiao@mediatek.com>
Date: Mon, 11 Sep 2023 17:11:24 +0800
Subject: [PATCH 1037/1053] wifi: mt76: mt7915: add debug log for SER flow.
Subject: [PATCH 1037/1052] wifi: mt76: mt7915: add debug log for SER flow.
Signed-off-by: Bo Jiao <Bo.Jiao@mediatek.com>
---
@@ -9,10 +9,10 @@ Signed-off-by: Bo Jiao <Bo.Jiao@mediatek.com>
1 file changed, 9 insertions(+)
diff --git a/mt7915/mac.c b/mt7915/mac.c
index 71b4e2d..b0ddb10 100644
index a7314465..c421447c 100644
--- a/mt7915/mac.c
+++ b/mt7915/mac.c
@@ -1572,6 +1572,9 @@ void mt7915_mac_reset_work(struct work_struct *work)
@@ -1531,6 +1531,9 @@ void mt7915_mac_reset_work(struct work_struct *work)
if (!(READ_ONCE(dev->recovery.state) & MT_MCU_CMD_STOP_DMA))
return;
@@ -22,7 +22,7 @@ index 71b4e2d..b0ddb10 100644
ieee80211_stop_queues(mt76_hw(dev));
if (ext_phy)
ieee80211_stop_queues(ext_phy->hw);
@@ -1647,6 +1650,9 @@ void mt7915_mac_reset_work(struct work_struct *work)
@@ -1606,6 +1609,9 @@ void mt7915_mac_reset_work(struct work_struct *work)
ieee80211_queue_delayed_work(ext_phy->hw,
&phy2->mt76->mac_work,
MT7915_WATCHDOG_TIME);
@@ -32,7 +32,7 @@ index 71b4e2d..b0ddb10 100644
}
/* firmware coredump */
@@ -1762,6 +1768,9 @@ void mt7915_coredump(struct mt7915_dev *dev, u8 state)
@@ -1721,6 +1727,9 @@ void mt7915_coredump(struct mt7915_dev *dev, u8 state)
void mt7915_reset(struct mt7915_dev *dev)
{

View File

@@ -1,7 +1,7 @@
From 2674288ca511860d73b068f73c14d864de13653f Mon Sep 17 00:00:00 2001
From 5fa70ee3f31733b9ddee67fdc78fe637df251aca Mon Sep 17 00:00:00 2001
From: Peter Chiu <chui-hao.chiu@mediatek.com>
Date: Mon, 2 Oct 2023 14:00:13 +0800
Subject: [PATCH 1039/1053] wifi: mt76: mt7915: add debuffs knob for protect
Subject: [PATCH 1038/1052] wifi: mt76: mt7915: add debuffs knob for protect
threshold
---
@@ -10,10 +10,10 @@ Subject: [PATCH 1039/1053] wifi: mt76: mt7915: add debuffs knob for protect
2 files changed, 12 insertions(+)
diff --git a/mt7915/mt7915.h b/mt7915/mt7915.h
index bfd87bc..1b43c54 100644
index bc0f313c..183d59da 100644
--- a/mt7915/mt7915.h
+++ b/mt7915/mt7915.h
@@ -775,6 +775,7 @@ void mt7915_mcu_set_rfeature_starec(void *data, struct mt7915_dev *dev,
@@ -792,6 +792,7 @@ void mt7915_mcu_set_rfeature_starec(void *data, struct mt7915_dev *dev,
struct ieee80211_vif *vif, struct ieee80211_sta *sta);
int mt7915_mcu_set_rfeature_trig_type(struct mt7915_phy *phy, u8 enable, u8 trig_type);
int mt7915_mcu_set_mu_dl_ack_policy(struct mt7915_phy *phy, u8 policy_num);
@@ -22,7 +22,7 @@ index bfd87bc..1b43c54 100644
void mt7915_mcu_set_nusers_ofdma(struct mt7915_phy *phy, u8 type, u8 ofdma_user_cnt);
void mt7915_mcu_set_mimo(struct mt7915_phy *phy, u8 direction);
diff --git a/mt7915/mtk_debugfs.c b/mt7915/mtk_debugfs.c
index 9bbe50d..2b59e35 100644
index c00184f8..c8efd266 100644
--- a/mt7915/mtk_debugfs.c
+++ b/mt7915/mtk_debugfs.c
@@ -2852,6 +2852,16 @@ static int mt7915_sta_tx_amsdu_set(void *data, u64 tx_amsdu)

View File

@@ -1,7 +1,7 @@
From 45752d6719ee863fe80d2821f9ff6176e6a2497d Mon Sep 17 00:00:00 2001
From 90dfcdd20e564dc3b82342141dfd6917899b7b66 Mon Sep 17 00:00:00 2001
From: "Henry.Yen" <henry.yen@mediatek.com>
Date: Mon, 11 Dec 2023 16:01:55 +0800
Subject: [PATCH 1040/1053] wifi: mt76: mt7915 add mt7981 efuse variants
Subject: [PATCH 1039/1052] wifi: mt76: mt7915 add mt7981 efuse variants
support
---
@@ -10,7 +10,7 @@ Subject: [PATCH 1040/1053] wifi: mt76: mt7915 add mt7981 efuse variants
2 files changed, 28 insertions(+), 1 deletion(-)
diff --git a/mt7915/eeprom.c b/mt7915/eeprom.c
index 6133c20..df5e396 100644
index 6133c200..df5e396c 100644
--- a/mt7915/eeprom.c
+++ b/mt7915/eeprom.c
@@ -193,6 +193,21 @@ static int mt7915_eeprom_load(struct mt7915_dev *dev)
@@ -50,10 +50,10 @@ index 6133c20..df5e396 100644
mt7915_eeprom_parse_band_config(phy);
diff --git a/mt7915/mt7915.h b/mt7915/mt7915.h
index 1b43c54..c6150c8 100644
index 183d59da..c8f9ed52 100644
--- a/mt7915/mt7915.h
+++ b/mt7915/mt7915.h
@@ -407,6 +407,7 @@ struct mt7915_dev {
@@ -424,6 +424,7 @@ struct mt7915_dev {
u32 hw_pattern;
@@ -61,7 +61,7 @@ index 1b43c54..c6150c8 100644
bool dbdc_support;
bool flash_mode;
bool bin_file_mode;
@@ -681,7 +682,11 @@ void mt7915_tm_rf_test_event(struct mt7915_dev *dev, struct sk_buff *skb);
@@ -698,7 +699,11 @@ void mt7915_tm_rf_test_event(struct mt7915_dev *dev, struct sk_buff *skb);
static inline u16 mt7915_wtbl_size(struct mt7915_dev *dev)
{

View File

@@ -1,7 +1,7 @@
From 9c8dcebc80801b77b23b0a2af28a3d51662c164f Mon Sep 17 00:00:00 2001
From 5ba9ebc9e86610960d798ff1103350d2d3453a90 Mon Sep 17 00:00:00 2001
From: Howard Hsu <howard-yh.hsu@mediatek.com>
Date: Wed, 6 Dec 2023 08:53:03 +0800
Subject: [PATCH] wifi: mt76: mt7915: support scs feature
Subject: [PATCH 1040/1052] wifi: mt76: mt7915: support scs feature
Add support scs feature for connac2 codebase. This commit includes three
parts.
@@ -29,7 +29,7 @@ Signed-off-by: Howard Hsu <howard-yh.hsu@mediatek.com>
9 files changed, 188 insertions(+)
diff --git a/mt76.h b/mt76.h
index cff22f5..7ffba7d 100644
index 16b76b48..43f3c282 100644
--- a/mt76.h
+++ b/mt76.h
@@ -311,6 +311,7 @@ struct mt76_sta_stats {
@@ -49,10 +49,10 @@ index cff22f5..7ffba7d 100644
enum mt76_wcid_flags {
diff --git a/mt76_connac_mcu.h b/mt76_connac_mcu.h
index 94fcf32..247b520 100644
index 49c3f1aa..febe3ed4 100644
--- a/mt76_connac_mcu.h
+++ b/mt76_connac_mcu.h
@@ -1236,6 +1236,7 @@ enum {
@@ -1238,6 +1238,7 @@ enum {
MCU_EXT_CMD_SET_RDD_PATTERN = 0x7d,
MCU_EXT_CMD_MWDS_SUPPORT = 0x80,
MCU_EXT_CMD_SET_SER_TRIGGER = 0x81,
@@ -61,10 +61,10 @@ index 94fcf32..247b520 100644
MCU_EXT_CMD_FW_DBG_CTRL = 0x95,
MCU_EXT_CMD_OFFCH_SCAN_CTRL = 0x9a,
diff --git a/mt7915/init.c b/mt7915/init.c
index 545afe7..074f247 100644
index c4685f21..a26e0d69 100644
--- a/mt7915/init.c
+++ b/mt7915/init.c
@@ -1248,6 +1248,7 @@ int mt7915_register_device(struct mt7915_dev *dev)
@@ -1222,6 +1222,7 @@ int mt7915_register_device(struct mt7915_dev *dev)
spin_lock_init(&dev->phy.stats_lock);
INIT_WORK(&dev->rc_work, mt7915_mac_sta_rc_work);
INIT_DELAYED_WORK(&dev->mphy.mac_work, mt7915_mac_work);
@@ -73,10 +73,10 @@ index 545afe7..074f247 100644
INIT_LIST_HEAD(&dev->twt_list);
diff --git a/mt7915/mac.c b/mt7915/mac.c
index 9a49375..2e4a8f8 100644
index c421447c..fb989405 100644
--- a/mt7915/mac.c
+++ b/mt7915/mac.c
@@ -1504,6 +1504,8 @@ mt7915_mac_full_reset(struct mt7915_dev *dev)
@@ -1463,6 +1463,8 @@ mt7915_mac_full_reset(struct mt7915_dev *dev)
if (ext_phy)
cancel_delayed_work_sync(&ext_phy->mac_work);
@@ -85,7 +85,7 @@ index 9a49375..2e4a8f8 100644
mutex_lock(&dev->mt76.mutex);
for (i = 0; i < 10; i++) {
if (!mt7915_mac_restart(dev))
@@ -1529,6 +1531,10 @@ mt7915_mac_full_reset(struct mt7915_dev *dev)
@@ -1488,6 +1490,10 @@ mt7915_mac_full_reset(struct mt7915_dev *dev)
ieee80211_queue_delayed_work(ext_phy->hw,
&ext_phy->mac_work,
MT7915_WATCHDOG_TIME);
@@ -96,7 +96,7 @@ index 9a49375..2e4a8f8 100644
}
/* system error recovery */
@@ -1587,6 +1593,7 @@ void mt7915_mac_reset_work(struct work_struct *work)
@@ -1546,6 +1552,7 @@ void mt7915_mac_reset_work(struct work_struct *work)
set_bit(MT76_RESET, &phy2->mt76->state);
cancel_delayed_work_sync(&phy2->mt76->mac_work);
}
@@ -104,7 +104,7 @@ index 9a49375..2e4a8f8 100644
mt76_worker_disable(&dev->mt76.tx_worker);
mt76_for_each_q_rx(&dev->mt76, i)
napi_disable(&dev->mt76.napi[i]);
@@ -1651,6 +1658,10 @@ void mt7915_mac_reset_work(struct work_struct *work)
@@ -1610,6 +1617,10 @@ void mt7915_mac_reset_work(struct work_struct *work)
&phy2->mt76->mac_work,
MT7915_WATCHDOG_TIME);
@@ -116,7 +116,7 @@ index 9a49375..2e4a8f8 100644
wiphy_name(dev->mt76.hw->wiphy));
}
diff --git a/mt7915/main.c b/mt7915/main.c
index 2ff7667..2750e60 100644
index 75042189..04301300 100644
--- a/mt7915/main.c
+++ b/mt7915/main.c
@@ -89,12 +89,24 @@ int mt7915_run(struct ieee80211_hw *hw)
@@ -153,13 +153,14 @@ index 2ff7667..2750e60 100644
mt7915_mcu_set_mac(dev, dev->phy.mt76->band_idx, false, false);
}
diff --git a/mt7915/mcu.c b/mt7915/mcu.c
index 1af6dac..aa3f9ad 100644
index 40d94c4f..fcbe4da4 100644
--- a/mt7915/mcu.c
+++ b/mt7915/mcu.c
@@ -5239,6 +5239,124 @@ int mt7915_mcu_sw_aci_set(struct mt7915_dev *dev, bool val)
@@ -5238,3 +5238,121 @@ int mt7915_mcu_sw_aci_set(struct mt7915_dev *dev, bool val)
return mt76_mcu_send_msg(&dev->mt76, MCU_EXT_CMD(SWLNA_ACI_CTRL), &req,
sizeof(req), NULL);
}
+
+int mt7915_mcu_set_scs_en(struct mt7915_phy *phy, u8 enable)
+{
+ struct mt7915_dev *dev = phy->dev;
@@ -277,12 +278,8 @@ index 1af6dac..aa3f9ad 100644
+ if (scs_enable_flag)
+ ieee80211_queue_delayed_work(mt76_hw(dev), &dev->scs_work, HZ);
+}
+
int mt7915_mcu_set_qos_map(struct mt7915_dev *dev, struct ieee80211_vif *vif)
{
#define IP_DSCP_NUM 64
diff --git a/mt7915/mcu.h b/mt7915/mcu.h
index 3089fb6..742a785 100644
index 3089fb64..742a7855 100644
--- a/mt7915/mcu.h
+++ b/mt7915/mcu.h
@@ -1200,4 +1200,8 @@ struct mt7915_mcu_edcca_info {
@@ -295,10 +292,10 @@ index 3089fb6..742a785 100644
+};
#endif
diff --git a/mt7915/mt7915.h b/mt7915/mt7915.h
index 03ec7e2..3daec29 100644
index c8f9ed52..6b27be9c 100644
--- a/mt7915/mt7915.h
+++ b/mt7915/mt7915.h
@@ -270,6 +270,15 @@ struct mt7915_air_monitor_ctrl {
@@ -283,6 +283,15 @@ struct mt7915_air_monitor_ctrl {
};
#endif
@@ -314,7 +311,7 @@ index 03ec7e2..3daec29 100644
struct mt7915_phy {
struct mt76_phy *mt76;
struct mt7915_dev *dev;
@@ -344,6 +353,7 @@ struct mt7915_phy {
@@ -361,6 +370,7 @@ struct mt7915_phy {
struct mt7915_air_monitor_ctrl amnt_ctrl;
#endif
@@ -322,7 +319,7 @@ index 03ec7e2..3daec29 100644
};
#ifdef MTK_DEBUG
@@ -476,6 +486,8 @@ struct mt7915_dev {
@@ -493,6 +503,8 @@ struct mt7915_dev {
} adie[ADIE_MAX_CNT];
#endif
@@ -331,7 +328,7 @@ index 03ec7e2..3daec29 100644
bool wmm_pbc_enable;
struct work_struct wmm_pbc_work;
u32 adie_type;
@@ -803,6 +815,8 @@ int mt7915_mcu_sw_aci_set(struct mt7915_dev *dev, bool val);
@@ -821,6 +833,8 @@ int mt7915_mcu_sw_aci_set(struct mt7915_dev *dev, bool val);
int mt7915_mcu_ipi_hist_ctrl(struct mt7915_phy *phy, void *data, u8 cmd, bool wait_resp);
int mt7915_mcu_ipi_hist_scan(struct mt7915_phy *phy, void *data, u8 mode, bool wait_resp);
int mt7915_mcu_enable_obss_spr(struct mt7915_phy *phy, u8 action, u8 val);
@@ -341,7 +338,7 @@ index 03ec7e2..3daec29 100644
#ifdef MTK_DEBUG
int mt7915_mtk_init_debugfs(struct mt7915_phy *phy, struct dentry *dir);
diff --git a/mt7915/mtk_debugfs.c b/mt7915/mtk_debugfs.c
index dad5ed7..0953223 100644
index c8efd266..e60dc850 100644
--- a/mt7915/mtk_debugfs.c
+++ b/mt7915/mtk_debugfs.c
@@ -3820,6 +3820,29 @@ mt7915_sr_enable_set(void *data, u64 val)

View File

@@ -1,7 +1,8 @@
From e9f5c9f345503c5653d1a5fd5bedd69cd1bc48f1 Mon Sep 17 00:00:00 2001
From 71385726a0af02c6cb650a6be60511e6f0f1b3a4 Mon Sep 17 00:00:00 2001
From: Howard Hsu <howard-yh.hsu@mediatek.com>
Date: Thu, 21 Dec 2023 20:35:36 +0800
Subject: [PATCH] wifi: mt76: mt7915: support thermal recal debug commnad
Subject: [PATCH 1041/1052] wifi: mt76: mt7915: support thermal recal debug
commnad
Add thermal recal debug command:
$ echo val > debugfs/thermal_recal
@@ -20,10 +21,10 @@ Signed-off-by: Howard Hsu <howard-yh.hsu@mediatek.com>
4 files changed, 35 insertions(+)
diff --git a/mt76_connac_mcu.h b/mt76_connac_mcu.h
index 247b520..e445046 100644
index febe3ed4..8a0f5bea 100644
--- a/mt76_connac_mcu.h
+++ b/mt76_connac_mcu.h
@@ -1232,6 +1232,7 @@ enum {
@@ -1234,6 +1234,7 @@ enum {
MCU_EXT_CMD_RED_ENABLE = 0x68,
MCU_EXT_CMD_PKT_BUDGET_CTRL = 0x6c,
MCU_EXT_CMD_CP_SUPPORT = 0x75,
@@ -32,13 +33,14 @@ index 247b520..e445046 100644
MCU_EXT_CMD_SET_RDD_PATTERN = 0x7d,
MCU_EXT_CMD_MWDS_SUPPORT = 0x80,
diff --git a/mt7915/mcu.c b/mt7915/mcu.c
index aa3f9ad..2417251 100644
index fcbe4da4..2b653bfb 100644
--- a/mt7915/mcu.c
+++ b/mt7915/mcu.c
@@ -5357,6 +5357,21 @@ void mt7915_mcu_scs_sta_poll(struct work_struct *work)
@@ -5356,3 +5356,18 @@ void mt7915_mcu_scs_sta_poll(struct work_struct *work)
if (scs_enable_flag)
ieee80211_queue_delayed_work(mt76_hw(dev), &dev->scs_work, HZ);
}
+
+int mt7915_mcu_thermal_debug(struct mt7915_dev *dev, u8 mode, u8 action)
+{
+ struct {
@@ -53,15 +55,11 @@ index aa3f9ad..2417251 100644
+ return mt76_mcu_send_msg(&dev->mt76, MCU_EXT_CMD(THERMAL_DEBUG), &req,
+ sizeof(req), true);
+}
+
int mt7915_mcu_set_qos_map(struct mt7915_dev *dev, struct ieee80211_vif *vif)
{
#define IP_DSCP_NUM 64
diff --git a/mt7915/mt7915.h b/mt7915/mt7915.h
index 3daec29..9b52ec4 100644
index 6b27be9c..496ccd94 100644
--- a/mt7915/mt7915.h
+++ b/mt7915/mt7915.h
@@ -817,6 +817,7 @@ int mt7915_mcu_ipi_hist_scan(struct mt7915_phy *phy, void *data, u8 mode, bool w
@@ -835,6 +835,7 @@ int mt7915_mcu_ipi_hist_scan(struct mt7915_phy *phy, void *data, u8 mode, bool w
int mt7915_mcu_enable_obss_spr(struct mt7915_phy *phy, u8 action, u8 val);
int mt7915_mcu_set_scs_en(struct mt7915_phy *phy, u8 enable);
void mt7915_mcu_scs_sta_poll(struct work_struct *work);
@@ -70,7 +68,7 @@ index 3daec29..9b52ec4 100644
#ifdef MTK_DEBUG
int mt7915_mtk_init_debugfs(struct mt7915_phy *phy, struct dentry *dir);
diff --git a/mt7915/mtk_debugfs.c b/mt7915/mtk_debugfs.c
index 0953223..53294c1 100644
index e60dc850..0677495c 100644
--- a/mt7915/mtk_debugfs.c
+++ b/mt7915/mtk_debugfs.c
@@ -3843,6 +3843,22 @@ mt7915_scs_enable_set(void *data, u64 val)

View File

@@ -1,7 +1,8 @@
From 771d717a6bce6c6a7f7bb06599b42fa3994b560e Mon Sep 17 00:00:00 2001
From 45dbb4f20ca056bd56f8c723a10d0f5662d92f75 Mon Sep 17 00:00:00 2001
From: Allen Ye <allen.ye@mediatek.com>
Date: Fri, 15 Dec 2023 14:03:11 +0800
Subject: [PATCH] wifi: mt76: mt7915: Add support for lpi and duplicate mode
Subject: [PATCH 1042/1052] wifi: mt76: mt7915: Add support for lpi and
duplicate mode
Add support lpi and duplicate mode.
1. lpi_enable: lpi fw cmd and set psd flag to fw by the country setting.
@@ -30,7 +31,7 @@ Signed-off-by: Allen Ye <allen.ye@mediatek.com>
12 files changed, 210 insertions(+), 17 deletions(-)
diff --git a/eeprom.c b/eeprom.c
index 4213e44..2ee262a 100644
index aa33e7b5..261d65ad 100644
--- a/eeprom.c
+++ b/eeprom.c
@@ -224,8 +224,9 @@ static bool mt76_string_prop_find(struct property *prop, const char *str)
@@ -94,7 +95,7 @@ index 4213e44..2ee262a 100644
return target_power;
diff --git a/mt76.h b/mt76.h
index c011812..b023f38 100644
index 43f3c282..a18b3e57 100644
--- a/mt76.h
+++ b/mt76.h
@@ -853,6 +853,9 @@ struct mt76_phy {
@@ -107,7 +108,7 @@ index c011812..b023f38 100644
u8 antenna_mask;
u16 chainmask;
@@ -1744,7 +1747,7 @@ mt76_mcu_skb_send_msg(struct mt76_dev *dev, struct sk_buff *skb, int cmd,
@@ -1753,7 +1756,7 @@ mt76_mcu_skb_send_msg(struct mt76_dev *dev, struct sk_buff *skb, int cmd,
void mt76_set_irq_mask(struct mt76_dev *dev, u32 addr, u32 clear, u32 set);
struct device_node *
@@ -117,7 +118,7 @@ index c011812..b023f38 100644
mt76_find_channel_node(struct device_node *np, struct ieee80211_channel *chan);
diff --git a/mt76_connac2_mac.h b/mt76_connac2_mac.h
index eb47653..49ba39f 100644
index eb476536..49ba39ff 100644
--- a/mt76_connac2_mac.h
+++ b/mt76_connac2_mac.h
@@ -355,6 +355,13 @@ enum tx_port_idx {
@@ -135,7 +136,7 @@ index eb47653..49ba39f 100644
MT_TX_FRAG_NONE,
MT_TX_FRAG_FIRST,
diff --git a/mt76_connac_mac.c b/mt76_connac_mac.c
index 5ba0255..5f705bb 100644
index c23d266e..d1708152 100644
--- a/mt76_connac_mac.c
+++ b/mt76_connac_mac.c
@@ -572,7 +572,8 @@ void mt76_connac2_mac_write_txwi(struct mt76_dev *dev, __le32 *txwi,
@@ -160,10 +161,10 @@ index 5ba0255..5f705bb 100644
txwi[7] &= ~cpu_to_le32(MT_TXD7_HW_AMSDU);
diff --git a/mt76_connac_mcu.h b/mt76_connac_mcu.h
index cbe8da5..c96621f 100644
index 8a0f5bea..3148526a 100644
--- a/mt76_connac_mcu.h
+++ b/mt76_connac_mcu.h
@@ -1257,6 +1257,7 @@ enum {
@@ -1260,6 +1260,7 @@ enum {
MCU_EXT_CMD_SWLNA_ACI_CTRL = 0xc0,
MCU_EXT_CMD_CSI_CTRL = 0xc2,
MCU_EXT_CMD_IPI_HIST_SCAN = 0xc5,
@@ -172,7 +173,7 @@ index cbe8da5..c96621f 100644
enum {
diff --git a/mt7915/debugfs.c b/mt7915/debugfs.c
index 502b493..b2a4ff4 100644
index 2c1e1bea..f031b54c 100644
--- a/mt7915/debugfs.c
+++ b/mt7915/debugfs.c
@@ -1297,7 +1297,6 @@ mt7915_txpower_info_show(struct seq_file *file, void *data)
@@ -193,10 +194,10 @@ index 502b493..b2a4ff4 100644
out:
diff --git a/mt7915/init.c b/mt7915/init.c
index 373f4f5..b53075b 100644
index a26e0d69..e8a6fcda 100644
--- a/mt7915/init.c
+++ b/mt7915/init.c
@@ -287,7 +287,7 @@ static void __mt7915_init_txpower(struct mt7915_phy *phy,
@@ -288,7 +288,7 @@ static void __mt7915_init_txpower(struct mt7915_phy *phy,
phy->sku_limit_en = true;
phy->sku_path_en = true;
@@ -205,7 +206,7 @@ index 373f4f5..b53075b 100644
for (i = 0; i < sband->n_channels; i++) {
struct ieee80211_channel *chan = &sband->channels[i];
u32 target_power = 0;
@@ -331,8 +331,10 @@ void mt7915_init_txpower(struct mt7915_phy *phy)
@@ -332,8 +332,10 @@ void mt7915_init_txpower(struct mt7915_phy *phy)
__mt7915_init_txpower(phy, &phy->mt76->sband_2g.sband);
if (phy->mt76->cap.has_5ghz)
__mt7915_init_txpower(phy, &phy->mt76->sband_5g.sband);
@@ -218,7 +219,7 @@ index 373f4f5..b53075b 100644
static void
diff --git a/mt7915/mcu.c b/mt7915/mcu.c
index c5f60c0..e17c61d 100644
index 2b653bfb..0fba0a6d 100644
--- a/mt7915/mcu.c
+++ b/mt7915/mcu.c
@@ -1522,7 +1522,8 @@ mt7915_mcu_set_spe_idx(struct mt7915_dev *dev, struct ieee80211_vif *vif,
@@ -354,10 +355,10 @@ index c5f60c0..e17c61d 100644
u8 en)
{
diff --git a/mt7915/mt7915.h b/mt7915/mt7915.h
index 1b2f584..ff08d25 100644
index 496ccd94..74008d4f 100644
--- a/mt7915/mt7915.h
+++ b/mt7915/mt7915.h
@@ -807,6 +807,7 @@ int mt7915_mcu_set_csi(struct mt7915_phy *phy, u8 mode,
@@ -826,6 +826,7 @@ void mt7915_csi_mac_filter_clear(struct mt7915_phy *phy);
void mt7915_vendor_amnt_fill_rx(struct mt7915_phy *phy, struct sk_buff *skb);
int mt7915_vendor_amnt_sta_remove(struct mt7915_phy *phy,
struct ieee80211_sta *sta);
@@ -366,7 +367,7 @@ index 1b2f584..ff08d25 100644
int mt7915_mcu_set_edcca(struct mt7915_phy *phy, int mode, u8 *value, s8 compensation);
int mt7915_mcu_get_edcca(struct mt7915_phy *phy, u8 mode, s8 *value);
diff --git a/mt7915/mtk_debugfs.c b/mt7915/mtk_debugfs.c
index 53294c1..352b8e9 100644
index 0677495c..3291aafc 100644
--- a/mt7915/mtk_debugfs.c
+++ b/mt7915/mtk_debugfs.c
@@ -3945,6 +3945,7 @@ int mt7915_mtk_init_debugfs(struct mt7915_phy *phy, struct dentry *dir)
@@ -378,10 +379,10 @@ index 53294c1..352b8e9 100644
debugfs_create_devm_seqfile(dev->mt76.dev, "eeprom_mode", dir,
mt7915_show_eeprom_mode);
diff --git a/mt7915/vendor.c b/mt7915/vendor.c
index 432d750..566fec0 100644
index 6446439f..a9e87a17 100644
--- a/mt7915/vendor.c
+++ b/mt7915/vendor.c
@@ -106,6 +106,13 @@ bss_color_ctrl_policy[NUM_MTK_VENDOR_ATTRS_BSS_COLOR_CTRL] = {
@@ -107,6 +107,13 @@ bss_color_ctrl_policy[NUM_MTK_VENDOR_ATTRS_BSS_COLOR_CTRL] = {
[MTK_VENDOR_ATTR_AVAL_BSS_COLOR_BMP] = { .type = NLA_U64 },
};
@@ -395,7 +396,7 @@ index 432d750..566fec0 100644
struct csi_null_tone {
u8 start;
u8 end;
@@ -1335,6 +1342,63 @@ mt7915_vendor_bss_color_ctrl_dump(struct wiphy *wiphy, struct wireless_dev *wdev
@@ -1471,6 +1478,63 @@ mt7915_vendor_bss_color_ctrl_dump(struct wiphy *wiphy, struct wireless_dev *wdev
return len;
}
@@ -459,7 +460,7 @@ index 432d750..566fec0 100644
static const struct wiphy_vendor_command mt7915_vendor_commands[] = {
{
.info = {
@@ -1451,6 +1515,17 @@ static const struct wiphy_vendor_command mt7915_vendor_commands[] = {
@@ -1587,6 +1651,17 @@ static const struct wiphy_vendor_command mt7915_vendor_commands[] = {
.dumpit = mt7915_vendor_bss_color_ctrl_dump,
.policy = bss_color_ctrl_policy,
.maxattr = MTK_VENDOR_ATTR_BSS_COLOR_CTRL_MAX,
@@ -478,7 +479,7 @@ index 432d750..566fec0 100644
};
diff --git a/mt7915/vendor.h b/mt7915/vendor.h
index 03d1660..5b8a1fb 100644
index 11ccd0d8..3040007f 100644
--- a/mt7915/vendor.h
+++ b/mt7915/vendor.h
@@ -16,6 +16,7 @@ enum mtk_nl80211_vendor_subcmds {
@@ -489,7 +490,7 @@ index 03d1660..5b8a1fb 100644
};
@@ -274,4 +275,18 @@ enum mtk_vendor_attr_bss_color_ctrl {
@@ -287,4 +288,18 @@ enum mtk_vendor_attr_bss_color_ctrl {
MTK_VENDOR_ATTR_BSS_COLOR_CTRL_MAX =
NUM_MTK_VENDOR_ATTRS_BSS_COLOR_CTRL - 1
};

View File

@@ -1,7 +1,7 @@
From e9b737f036595d84f680ff9ee15cfffe5cd08efc Mon Sep 17 00:00:00 2001
From 3eec1f57a5ad5fd0322ac69360cac993ef9f8902 Mon Sep 17 00:00:00 2001
From: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
Date: Tue, 31 Oct 2023 16:29:13 +0800
Subject: [PATCH 1044/1053] wifi: mt76: testmode: add cheetah support
Subject: [PATCH 1043/1052] wifi: mt76: testmode: add cheetah support
Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
---
@@ -9,7 +9,7 @@ Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/mt7915/testmode.c b/mt7915/testmode.c
index faf6014..ecd6271 100644
index faf60146..ecd62712 100644
--- a/mt7915/testmode.c
+++ b/mt7915/testmode.c
@@ -2151,7 +2151,7 @@ mt7915_tm_group_prek(struct mt7915_phy *phy, enum mt76_testmode_state state)

View File

@@ -1,7 +1,7 @@
From 966bba87073d983aa136f1f762d1b787a81ec767 Mon Sep 17 00:00:00 2001
From e91a2d40ac3cb7c76827b894c03e31e577944f68 Mon Sep 17 00:00:00 2001
From: MeiChia Chiu <MeiChia.Chiu@mediatek.com>
Date: Wed, 24 Jan 2024 14:39:14 +0800
Subject: [PATCH 1045/1053] wifi: mt76: mt7915: add no_beacon vendor command
Subject: [PATCH 1044/1052] wifi: mt76: mt7915: add no_beacon vendor command
for cert
Add the vendor command to disable/enable beacon
@@ -21,7 +21,7 @@ Signed-off-by: MeiChia Chiu <meichia.chiu@mediatek.com>
4 files changed, 65 insertions(+), 1 deletion(-)
diff --git a/mt7915/mcu.c b/mt7915/mcu.c
index e17c61d..ddb738c 100644
index 0fba0a6d..b1cb7747 100644
--- a/mt7915/mcu.c
+++ b/mt7915/mcu.c
@@ -5101,6 +5101,17 @@ int mt7915_mcu_set_rfeature_trig_type(struct mt7915_phy *phy, u8 enable, u8 trig
@@ -43,10 +43,10 @@ index e17c61d..ddb738c 100644
#ifdef MTK_DEBUG
diff --git a/mt7915/mt7915.h b/mt7915/mt7915.h
index ff08d25..34f1a35 100644
index 74008d4f..8b2e360e 100644
--- a/mt7915/mt7915.h
+++ b/mt7915/mt7915.h
@@ -808,6 +808,7 @@ void mt7915_vendor_amnt_fill_rx(struct mt7915_phy *phy, struct sk_buff *skb);
@@ -827,6 +827,7 @@ void mt7915_vendor_amnt_fill_rx(struct mt7915_phy *phy, struct sk_buff *skb);
int mt7915_vendor_amnt_sta_remove(struct mt7915_phy *phy,
struct ieee80211_sta *sta);
int mt7915_mcu_set_lpi(struct mt7915_phy *phy, bool en);
@@ -55,10 +55,10 @@ index ff08d25..34f1a35 100644
int mt7915_mcu_set_edcca(struct mt7915_phy *phy, int mode, u8 *value, s8 compensation);
int mt7915_mcu_get_edcca(struct mt7915_phy *phy, u8 mode, s8 *value);
diff --git a/mt7915/vendor.c b/mt7915/vendor.c
index 566fec0..6154d1a 100644
index a9e87a17..309480d1 100644
--- a/mt7915/vendor.c
+++ b/mt7915/vendor.c
@@ -113,6 +113,11 @@ txpower_ctrl_policy[NUM_MTK_VENDOR_ATTRS_TXPOWER_CTRL] = {
@@ -114,6 +114,11 @@ txpower_ctrl_policy[NUM_MTK_VENDOR_ATTRS_TXPOWER_CTRL] = {
[MTK_VENDOR_ATTR_TXPOWER_CTRL_BCN_DUP] = { .type = NLA_U8 },
};
@@ -70,7 +70,7 @@ index 566fec0..6154d1a 100644
struct csi_null_tone {
u8 start;
u8 end;
@@ -1399,6 +1404,30 @@ static int mt7915_vendor_txpower_ctrl(struct wiphy *wiphy,
@@ -1535,6 +1540,30 @@ static int mt7915_vendor_txpower_ctrl(struct wiphy *wiphy,
return 0;
}
@@ -101,7 +101,7 @@ index 566fec0..6154d1a 100644
static const struct wiphy_vendor_command mt7915_vendor_commands[] = {
{
.info = {
@@ -1526,7 +1555,18 @@ static const struct wiphy_vendor_command mt7915_vendor_commands[] = {
@@ -1662,7 +1691,18 @@ static const struct wiphy_vendor_command mt7915_vendor_commands[] = {
.doit = mt7915_vendor_txpower_ctrl,
.policy = txpower_ctrl_policy,
.maxattr = MTK_VENDOR_ATTR_TXPOWER_CTRL_MAX,
@@ -122,7 +122,7 @@ index 566fec0..6154d1a 100644
void mt7915_vendor_register(struct mt7915_phy *phy)
diff --git a/mt7915/vendor.h b/mt7915/vendor.h
index 5b8a1fb..661d636 100644
index 3040007f..bcde5d3c 100644
--- a/mt7915/vendor.h
+++ b/mt7915/vendor.h
@@ -16,6 +16,7 @@ enum mtk_nl80211_vendor_subcmds {
@@ -133,7 +133,7 @@ index 5b8a1fb..661d636 100644
MTK_NL80211_VENDOR_SUBCMD_TXPOWER_CTRL = 0xce,
};
@@ -289,4 +290,15 @@ enum mtk_vendor_attr_txpower_ctrl {
@@ -302,4 +303,15 @@ enum mtk_vendor_attr_txpower_ctrl {
NUM_MTK_VENDOR_ATTRS_TXPOWER_CTRL - 1
};

View File

@@ -1,7 +1,7 @@
From 3a8ffe4b10bd9949dcd689406d5378a1b93c201d Mon Sep 17 00:00:00 2001
From 40e0945208ca6569cc032b59f935223b8fac19f4 Mon Sep 17 00:00:00 2001
From: Howard Hsu <howard-yh.hsu@mediatek.com>
Date: Thu, 15 Feb 2024 11:16:16 +0800
Subject: [PATCH 1046/1053] wifi: mt76: mt7915: support spatial reuse debug
Subject: [PATCH 1045/1052] wifi: mt76: mt7915: support spatial reuse debug
commands
Support 3 spatial reuse debug commands:
@@ -19,10 +19,10 @@ Signed-off-by: Howard Hsu <howard-yh.hsu@mediatek.com>
5 files changed, 191 insertions(+), 4 deletions(-)
diff --git a/mt76_connac_mcu.h b/mt76_connac_mcu.h
index c96621f..dc60e35 100644
index 3148526a..d8b001f1 100644
--- a/mt76_connac_mcu.h
+++ b/mt76_connac_mcu.h
@@ -1031,6 +1031,7 @@ enum {
@@ -1032,6 +1032,7 @@ enum {
MCU_EXT_EVENT_WA_TX_STAT = 0x74,
MCU_EXT_EVENT_BCC_NOTIFY = 0x75,
MCU_EXT_EVENT_MURU_CTRL = 0x9f,
@@ -31,7 +31,7 @@ index c96621f..dc60e35 100644
};
diff --git a/mt7915/mcu.c b/mt7915/mcu.c
index ddb738c..b3faf77 100644
index b1cb7747..e505664e 100644
--- a/mt7915/mcu.c
+++ b/mt7915/mcu.c
@@ -452,6 +452,91 @@ mt7915_mcu_rx_bss_acq_pkt_cnt(struct mt7915_dev *dev, struct sk_buff * skb)
@@ -158,7 +158,7 @@ index ddb738c..b3faf77 100644
return 0;
diff --git a/mt7915/mcu.h b/mt7915/mcu.h
index 742a785..f476767 100644
index 742a7855..f4767671 100644
--- a/mt7915/mcu.h
+++ b/mt7915/mcu.h
@@ -42,6 +42,45 @@ struct mt7915_mcu_thermal_notify {
@@ -233,10 +233,10 @@ index 742a785..f476767 100644
THERMAL_PROTECT_PARAMETER_CTRL,
THERMAL_PROTECT_BASIC_INFO,
diff --git a/mt7915/mt7915.h b/mt7915/mt7915.h
index 34f1a35..47f7d16 100644
index 8b2e360e..10d48495 100644
--- a/mt7915/mt7915.h
+++ b/mt7915/mt7915.h
@@ -354,6 +354,9 @@ struct mt7915_phy {
@@ -371,6 +371,9 @@ struct mt7915_phy {
struct mt7915_air_monitor_ctrl amnt_ctrl;
#endif
struct mt7915_scs_ctrl scs_ctrl;
@@ -247,7 +247,7 @@ index 34f1a35..47f7d16 100644
#ifdef MTK_DEBUG
diff --git a/mt7915/mtk_debugfs.c b/mt7915/mtk_debugfs.c
index d3d3b17..78ac4e5 100644
index 3291aafc..c8dd569c 100644
--- a/mt7915/mtk_debugfs.c
+++ b/mt7915/mtk_debugfs.c
@@ -3809,16 +3809,34 @@ mt7915_sw_aci_set(void *data, u64 val)

View File

@@ -1,10 +1,9 @@
From b0e4d25607d3a52f93139919c85482f87087f145 Mon Sep 17 00:00:00 2001
From 73508da4263fcc10cd059fd89ef4017f9725324d Mon Sep 17 00:00:00 2001
From: Bo Jiao <Bo.Jiao@mediatek.com>
Date: Thu, 7 Mar 2024 11:13:45 +0800
Subject: [PATCH 1047/1053] wifi: mt76: try more times when send message
Subject: [PATCH 1046/1052] wifi: mt76: try more times when send message
timeout.
CR-Id: WCNCR00334773
Signed-off-by: Bo Jiao <Bo.Jiao@mediatek.com>
---
dma.c | 7 ++++--
@@ -13,7 +12,7 @@ Signed-off-by: Bo Jiao <Bo.Jiao@mediatek.com>
3 files changed, 64 insertions(+), 52 deletions(-)
diff --git a/dma.c b/dma.c
index bc8afcf..133a50d 100644
index bc8afcff..133a50dc 100644
--- a/dma.c
+++ b/dma.c
@@ -504,9 +504,12 @@ mt76_dma_tx_queue_skb_raw(struct mt76_dev *dev, struct mt76_queue *q,
@@ -40,7 +39,7 @@ index bc8afcf..133a50d 100644
static int
diff --git a/mcu.c b/mcu.c
index fa4b054..de185cc 100644
index fa4b0544..de185cc9 100644
--- a/mcu.c
+++ b/mcu.c
@@ -4,6 +4,7 @@
@@ -133,10 +132,10 @@ index fa4b054..de185cc 100644
return ret;
diff --git a/mt7915/mac.c b/mt7915/mac.c
index 2e4a8f8..dbc1095 100644
index fb989405..b3c91633 100644
--- a/mt7915/mac.c
+++ b/mt7915/mac.c
@@ -1389,12 +1389,6 @@ mt7915_mac_restart(struct mt7915_dev *dev)
@@ -1348,12 +1348,6 @@ mt7915_mac_restart(struct mt7915_dev *dev)
}
}
@@ -149,7 +148,7 @@ index 2e4a8f8..dbc1095 100644
/* lock/unlock all queues to ensure that no tx is pending */
mt76_txq_schedule_all(&dev->mphy);
if (ext_phy)
@@ -1495,11 +1489,18 @@ mt7915_mac_full_reset(struct mt7915_dev *dev)
@@ -1454,11 +1448,18 @@ mt7915_mac_full_reset(struct mt7915_dev *dev)
dev->recovery.hw_full_reset = true;
@@ -169,7 +168,7 @@ index 2e4a8f8..dbc1095 100644
cancel_delayed_work_sync(&dev->mphy.mac_work);
if (ext_phy)
cancel_delayed_work_sync(&ext_phy->mac_work);
@@ -1587,20 +1588,15 @@ void mt7915_mac_reset_work(struct work_struct *work)
@@ -1546,20 +1547,15 @@ void mt7915_mac_reset_work(struct work_struct *work)
set_bit(MT76_RESET, &dev->mphy.state);
set_bit(MT76_MCU_RESET, &dev->mphy.state);
@@ -193,7 +192,7 @@ index 2e4a8f8..dbc1095 100644
if (mtk_wed_device_active(&dev->mt76.mmio.wed))
mtk_wed_device_stop(&dev->mt76.mmio.wed);
@@ -1624,8 +1620,8 @@ void mt7915_mac_reset_work(struct work_struct *work)
@@ -1583,8 +1579,8 @@ void mt7915_mac_reset_work(struct work_struct *work)
clear_bit(MT76_MCU_RESET, &dev->mphy.state);
clear_bit(MT76_RESET, &dev->mphy.state);
@@ -204,7 +203,7 @@ index 2e4a8f8..dbc1095 100644
local_bh_disable();
mt76_for_each_q_rx(&dev->mt76, i) {
@@ -1647,21 +1643,8 @@ void mt7915_mac_reset_work(struct work_struct *work)
@@ -1606,21 +1602,8 @@ void mt7915_mac_reset_work(struct work_struct *work)
if (ext_phy)
ieee80211_wake_queues(ext_phy->hw);

View File

@@ -1,9 +1,8 @@
From 6b84e5955fac1b324c5ad7bf2ea585e6531697a7 Mon Sep 17 00:00:00 2001
From 1b93f1495d5f28a7620add2ebea0f691ff6e8a0d Mon Sep 17 00:00:00 2001
From: Bo Jiao <Bo.Jiao@mediatek.com>
Date: Tue, 6 Feb 2024 14:46:59 +0800
Subject: [PATCH 1048/1053] wifi: mt76: mt7915: add SER overlap handle
Subject: [PATCH 1047/1052] wifi: mt76: mt7915: add SER overlap handle
CR-ID: WCNCR00355921
Signed-off-by: Bo Jiao <Bo.Jiao@mediatek.com>
---
dma.c | 3 ++-
@@ -14,7 +13,7 @@ Signed-off-by: Bo Jiao <Bo.Jiao@mediatek.com>
5 files changed, 34 insertions(+), 3 deletions(-)
diff --git a/dma.c b/dma.c
index 133a50d..100d2af 100644
index 133a50dc..100d2aff 100644
--- a/dma.c
+++ b/dma.c
@@ -506,7 +506,8 @@ mt76_dma_tx_queue_skb_raw(struct mt76_dev *dev, struct mt76_queue *q,
@@ -28,7 +27,7 @@ index 133a50d..100d2af 100644
goto error;
}
diff --git a/mcu.c b/mcu.c
index de185cc..1bc94e8 100644
index de185cc9..1bc94e85 100644
--- a/mcu.c
+++ b/mcu.c
@@ -42,7 +42,9 @@ struct sk_buff *mt76_mcu_get_response(struct mt76_dev *dev,
@@ -53,7 +52,7 @@ index de185cc..1bc94e8 100644
dev_err(dev->dev, "send message %08x timeout, try again(%d).\n",
cmd, (MT76_MSG_MAX_RETRY_CNT - retry_cnt));
diff --git a/mt76.h b/mt76.h
index b023f38..fb50d88 100644
index a18b3e57..49ddaade 100644
--- a/mt76.h
+++ b/mt76.h
@@ -478,6 +478,14 @@ enum {
@@ -80,10 +79,10 @@ index b023f38..fb50d88 100644
u32 wcid_mask[DIV_ROUND_UP(MT76_N_WCIDS, 32)];
u32 wcid_phy_mask[DIV_ROUND_UP(MT76_N_WCIDS, 32)];
diff --git a/mt7915/mac.c b/mt7915/mac.c
index dbc1095..e9f50a3 100644
index b3c91633..c84b9573 100644
--- a/mt7915/mac.c
+++ b/mt7915/mac.c
@@ -1579,6 +1579,7 @@ void mt7915_mac_reset_work(struct work_struct *work)
@@ -1538,6 +1538,7 @@ void mt7915_mac_reset_work(struct work_struct *work)
if (!(READ_ONCE(dev->recovery.state) & MT_MCU_CMD_STOP_DMA))
return;
@@ -91,7 +90,7 @@ index dbc1095..e9f50a3 100644
dev_info(dev->mt76.dev,"\n%s L1 SER recovery start.",
wiphy_name(dev->mt76.hw->wiphy));
@@ -1645,6 +1646,7 @@ void mt7915_mac_reset_work(struct work_struct *work)
@@ -1604,6 +1605,7 @@ void mt7915_mac_reset_work(struct work_struct *work)
mt7915_update_beacons(dev);
@@ -99,7 +98,7 @@ index dbc1095..e9f50a3 100644
dev_info(dev->mt76.dev,"\n%s L1 SER recovery completed.",
wiphy_name(dev->mt76.hw->wiphy));
}
@@ -1783,6 +1785,15 @@ void mt7915_reset(struct mt7915_dev *dev)
@@ -1742,6 +1744,15 @@ void mt7915_reset(struct mt7915_dev *dev)
return;
}
@@ -116,7 +115,7 @@ index dbc1095..e9f50a3 100644
wake_up(&dev->reset_wait);
}
diff --git a/mt7915/mcu.c b/mt7915/mcu.c
index b3faf77..f71688e 100644
index e505664e..272db06a 100644
--- a/mt7915/mcu.c
+++ b/mt7915/mcu.c
@@ -198,6 +198,13 @@ mt7915_mcu_send_message(struct mt76_dev *mdev, struct sk_buff *skb,

View File

@@ -1,25 +1,26 @@
From 016069539c9436262f37516462e9396e6f63b550 Mon Sep 17 00:00:00 2001
From ae7cf2b772c6f4f9e151f7a60b3cf726780f03ae Mon Sep 17 00:00:00 2001
From: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
Date: Mon, 4 Mar 2024 11:29:06 +0800
Subject: [PATCH 1049/1053] wifi: mt76: mt7915: add background radar hw cap
check
Subject: [PATCH] wifi: mt76: mt7915: add background radar hw cap check
Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
---
mt7915/debugfs.c | 5 +++++
mt7915/eeprom.h | 30 ++++++++++++++++++++++++++++++
mt7915/eeprom.c | 29 +++++++++++++++++++++++++++++
mt7915/eeprom.h | 1 +
mt7915/init.c | 7 ++++---
3 files changed, 39 insertions(+), 3 deletions(-)
mt7915/mt7915.h | 1 +
5 files changed, 40 insertions(+), 3 deletions(-)
diff --git a/mt7915/debugfs.c b/mt7915/debugfs.c
index b2a4ff4..03daf44 100644
index f031b54..d26816a 100644
--- a/mt7915/debugfs.c
+++ b/mt7915/debugfs.c
@@ -459,6 +459,11 @@ mt7915_rdd_monitor(struct seq_file *s, void *data)
mutex_lock(&dev->mt76.mutex);
+ if (!mt7915_get_background_radar_cap(dev)) {
+ if (!mt7915_eeprom_has_background_radar(dev)) {
+ seq_puts(s, "no background radar capability\n");
+ goto out;
+ }
@@ -27,31 +28,23 @@ index b2a4ff4..03daf44 100644
if (!cfg80211_chandef_valid(chandef)) {
ret = -EINVAL;
goto out;
diff --git a/mt7915/eeprom.h b/mt7915/eeprom.h
index 70fca0b..adeee10 100644
--- a/mt7915/eeprom.h
+++ b/mt7915/eeprom.h
@@ -55,6 +55,7 @@ enum mt7915_eeprom_field {
#define MT_EE_CAL_DPD_SIZE_V2_7981 (102 * MT_EE_CAL_UNIT) /* no 6g dpd data */
#define MT_EE_WIFI_CONF0_TX_PATH GENMASK(2, 0)
+#define MT_EE_WIFI_CONF0_RX_PATH GENMASK(5, 3)
#define MT_EE_WIFI_CONF0_BAND_SEL GENMASK(7, 6)
#define MT_EE_WIFI_CONF1_BAND_SEL GENMASK(7, 6)
#define MT_EE_WIFI_CONF_STREAM_NUM GENMASK(7, 5)
@@ -206,6 +207,35 @@ mt7915_get_cal_dpd_size(struct mt7915_dev *dev)
return MT_EE_CAL_DPD_SIZE_V2;
diff --git a/mt7915/eeprom.c b/mt7915/eeprom.c
index df5e396..6a910b0 100644
--- a/mt7915/eeprom.c
+++ b/mt7915/eeprom.c
@@ -618,6 +618,35 @@ s8 mt7915_eeprom_get_power_delta(struct mt7915_dev *dev, int band)
return val & MT_EE_RATE_DELTA_SIGN ? delta : -delta;
}
+static inline bool
+mt7915_get_background_radar_cap(struct mt7915_dev *dev)
+bool
+mt7915_eeprom_has_background_radar(struct mt7915_dev *dev)
+{
+ u8 buf[MT7915_EEPROM_BLOCK_SIZE];
+ int val, band_sel, tx_path, rx_path, offs = MT_EE_WIFI_CONF + 1;
+
+ switch (mt76_chip(&dev->mt76)) {
+ case 0x7915:
+ return 1;
+ return true;
+ case 0x7906:
+ if (!mt7915_mcu_get_eeprom(dev, offs, buf)) {
+ val = buf[offs % MT7915_EEPROM_BLOCK_SIZE];
@@ -69,30 +62,54 @@ index 70fca0b..adeee10 100644
+ break;
+ }
+
+ return 0;
+ return false;
+}
+
extern const u8 mt7915_sku_group_len[MAX_SKU_RATE_GROUP_NUM];
const u8 mt7915_sku_group_len[] = {
[SKU_CCK] = 4,
[SKU_OFDM] = 8,
diff --git a/mt7915/eeprom.h b/mt7915/eeprom.h
index 70fca0b..22df5a9 100644
--- a/mt7915/eeprom.h
+++ b/mt7915/eeprom.h
@@ -55,6 +55,7 @@ enum mt7915_eeprom_field {
#define MT_EE_CAL_DPD_SIZE_V2_7981 (102 * MT_EE_CAL_UNIT) /* no 6g dpd data */
#endif
#define MT_EE_WIFI_CONF0_TX_PATH GENMASK(2, 0)
+#define MT_EE_WIFI_CONF0_RX_PATH GENMASK(5, 3)
#define MT_EE_WIFI_CONF0_BAND_SEL GENMASK(7, 6)
#define MT_EE_WIFI_CONF1_BAND_SEL GENMASK(7, 6)
#define MT_EE_WIFI_CONF_STREAM_NUM GENMASK(7, 5)
diff --git a/mt7915/init.c b/mt7915/init.c
index b53075b..26ae63f 100644
index ec26909..813aa43 100644
--- a/mt7915/init.c
+++ b/mt7915/init.c
@@ -404,9 +404,10 @@ mt7915_init_wiphy(struct mt7915_phy *phy)
@@ -405,9 +405,10 @@ mt7915_init_wiphy(struct mt7915_phy *phy)
if (!is_mt7915(&dev->mt76))
wiphy_ext_feature_set(wiphy, NL80211_EXT_FEATURE_STA_TX_PWR);
- if (!mdev->dev->of_node ||
- !of_property_read_bool(mdev->dev->of_node,
- "mediatek,disable-radar-background"))
+ if (mt7915_get_background_radar_cap(phy->dev) &&
+ if (mt7915_eeprom_has_background_radar(phy->dev) &&
+ (!mdev->dev->of_node ||
+ !of_property_read_bool(mdev->dev->of_node,
+ "mediatek,disable-radar-background")))
wiphy_ext_feature_set(wiphy,
NL80211_EXT_FEATURE_RADAR_BACKGROUND);
diff --git a/mt7915/mt7915.h b/mt7915/mt7915.h
index 2351c1f..b5a39d7 100644
--- a/mt7915/mt7915.h
+++ b/mt7915/mt7915.h
@@ -618,6 +618,7 @@ int mt7915_eeprom_get_target_power(struct mt7915_dev *dev,
struct ieee80211_channel *chan,
u8 chain_idx);
s8 mt7915_eeprom_get_power_delta(struct mt7915_dev *dev, int band);
+bool mt7915_eeprom_has_background_radar(struct mt7915_dev *dev);
int mt7915_dma_init(struct mt7915_dev *dev, struct mt7915_phy *phy2);
void mt7915_dma_prefetch(struct mt7915_dev *dev);
void mt7915_dma_cleanup(struct mt7915_dev *dev);
--
2.18.0
2.45.2

View File

@@ -1,7 +1,7 @@
From 25eef0359cbdfb1a1e7730da256ac35a943242ea Mon Sep 17 00:00:00 2001
From 7f45a6881d88e92180fe2b162800b8334d005a5f Mon Sep 17 00:00:00 2001
From: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
Date: Wed, 6 Mar 2024 11:30:34 +0800
Subject: [PATCH 1051/1053] wifi: mt76: mt7915: add foolproof mechanism for
Subject: [PATCH 1049/1052] wifi: mt76: mt7915: add foolproof mechanism for
ZWDFS during radar detected & triggered
Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
@@ -11,7 +11,7 @@ Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
2 files changed, 8 insertions(+)
diff --git a/mt7915/debugfs.c b/mt7915/debugfs.c
index 03daf44..d8ca90a 100644
index 3fd1654c..522e2999 100644
--- a/mt7915/debugfs.c
+++ b/mt7915/debugfs.c
@@ -231,6 +231,11 @@ mt7915_radar_trigger(void *data, u64 val)
@@ -27,7 +27,7 @@ index 03daf44..d8ca90a 100644
val, 0, 0);
}
diff --git a/mt7915/mcu.c b/mt7915/mcu.c
index f71688e..d857658 100644
index 272db06a..250b05ec 100644
--- a/mt7915/mcu.c
+++ b/mt7915/mcu.c
@@ -302,6 +302,9 @@ mt7915_mcu_rx_radar_detected(struct mt7915_dev *dev, struct sk_buff *skb)

View File

@@ -1,7 +1,7 @@
From 93810a9bad2fd59c8e4742195a3b5c53878116ef Mon Sep 17 00:00:00 2001
From 2ed70c162a13b4b4af3bfc7a806e8cfab29126f7 Mon Sep 17 00:00:00 2001
From: Michael-CY Lee <michael-cy.lee@mediatek.com>
Date: Tue, 19 Mar 2024 08:35:26 +0800
Subject: [PATCH 1052/1053] mtk: wifi: mt76: mt7915: assign DEAUTH to ALTX
Subject: [PATCH 1050/1052] mtk: wifi: mt76: mt7915: assign DEAUTH to ALTX
queue for CERT
Signed-off-by: Michael-CY Lee <michael-cy.lee@mediatek.com>
@@ -10,7 +10,7 @@ Signed-off-by: Michael-CY Lee <michael-cy.lee@mediatek.com>
1 file changed, 10 insertions(+)
diff --git a/mt76_connac_mac.c b/mt76_connac_mac.c
index d41f004..0510296 100644
index d1708152..21dadb55 100644
--- a/mt76_connac_mac.c
+++ b/mt76_connac_mac.c
@@ -385,6 +385,8 @@ mt76_connac2_mac_write_txwi_80211(struct mt76_dev *dev, __le32 *txwi,
@@ -22,7 +22,7 @@ index d41f004..0510296 100644
struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *)skb->data;
struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
@@ -394,6 +396,14 @@ mt76_connac2_mac_write_txwi_80211(struct mt76_dev *dev, __le32 *txwi,
@@ -395,6 +397,14 @@ mt76_connac2_mac_write_txwi_80211(struct mt76_dev *dev, __le32 *txwi,
u8 fc_type, fc_stype;
u32 val;

View File

@@ -1,7 +1,7 @@
From 124ffa4206375bcbcb8bfaa0032045e3063ad286 Mon Sep 17 00:00:00 2001
From 1d18008ab9d67f318932ed993103bd46d9f0215d Mon Sep 17 00:00:00 2001
From: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
Date: Thu, 21 Mar 2024 16:52:34 +0800
Subject: [PATCH 1053/1053] wifi: mt76: mt7915: set channel after sta is
Subject: [PATCH 1051/1052] wifi: mt76: mt7915: set channel after sta is
associated to adjust switch reason
when sta is associated to AP operating in DFS channel, a channel
@@ -16,10 +16,10 @@ Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
1 file changed, 26 insertions(+)
diff --git a/mt7915/main.c b/mt7915/main.c
index 69fcf4c..41fa450 100644
index 04301300..eab45737 100644
--- a/mt7915/main.c
+++ b/mt7915/main.c
@@ -792,6 +792,31 @@ out:
@@ -794,6 +794,31 @@ out:
return ret;
}
@@ -51,7 +51,7 @@ index 69fcf4c..41fa450 100644
int mt7915_mac_sta_add(struct mt76_dev *mdev, struct ieee80211_vif *vif,
struct ieee80211_sta *sta)
{
@@ -1771,6 +1796,7 @@ const struct ieee80211_ops mt7915_ops = {
@@ -1835,6 +1860,7 @@ const struct ieee80211_ops mt7915_ops = {
.set_sar_specs = mt7915_set_sar_specs,
.channel_switch_beacon = mt7915_channel_switch_beacon,
.post_channel_switch = mt7915_post_channel_switch,

View File

@@ -0,0 +1,28 @@
From 3b8af1b07109458e7274bc032b27c3c2e331acb3 Mon Sep 17 00:00:00 2001
From: Rex Lu <rex.lu@mediatek.com>
Date: Fri, 5 Jul 2024 17:50:29 +0800
Subject: [PATCH] wifi: mt76: mt7915: Clear private driver data in case of
reuse
Signed-off-by: Rex Lu <rex.lu@mediatek.com>
---
mt7915/main.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/mt7915/main.c b/mt7915/main.c
index f9ce1ba7..d5ea85d6 100644
--- a/mt7915/main.c
+++ b/mt7915/main.c
@@ -230,6 +230,9 @@ int mt7915_init_vif(struct mt7915_phy *phy, struct ieee80211_vif *vif, bool bf_e
bool ext_phy = phy != &dev->phy;
int idx, i, ret = 0;
+ /* Clear private driver data in case of reuse */
+ memset(mvif, 0, sizeof(struct mt7915_vif));
+
/* To differentiate the mac address of TXD and TXCMD interface */
vif->addr[0] |= bf_en;
--
2.45.2

View File

@@ -0,0 +1,132 @@
From ef27c50654dd962bd941a1e0ddd4181dd6473cc4 Mon Sep 17 00:00:00 2001
From: Rex Lu <rex.lu@mediatek.com>
Date: Thu, 12 Sep 2024 16:17:51 +0800
Subject: [PATCH] wifi: mt76: mt7915: fix TX/RX hang without SER hw bit to do
L1 recovery issue
---
mcu.c | 4 +++-
mt76.h | 2 +-
mt76_connac_mcu.c | 18 +++++++++++++++++-
mt7915/mcu.c | 10 +++++++++-
mt7915/regs.h | 2 +-
5 files changed, 31 insertions(+), 5 deletions(-)
diff --git a/mcu.c b/mcu.c
index 1bc94e8..d331d81 100644
--- a/mcu.c
+++ b/mcu.c
@@ -82,6 +82,7 @@ int mt76_mcu_skb_send_and_get_msg(struct mt76_dev *dev, struct sk_buff *skb,
int ret, seq, retry_cnt;
struct sk_buff *skb_tmp;
bool retry = wait_resp && is_connac_v2(dev);
+ bool force_ser = false;
if (ret_skb)
*ret_skb = NULL;
@@ -99,9 +100,10 @@ int mt76_mcu_skb_send_and_get_msg(struct mt76_dev *dev, struct sk_buff *skb,
usleep_range(200000, 500000);
dev_err(dev->dev, "send message %08x timeout, try again(%d).\n",
cmd, (MT76_MSG_MAX_RETRY_CNT - retry_cnt));
+ force_ser = true;
}
- ret = dev->mcu_ops->mcu_skb_send_msg(dev, skb_tmp, cmd, &seq);
+ ret = dev->mcu_ops->mcu_skb_send_msg(dev, skb_tmp, cmd, &seq, force_ser);
if (ret < 0 && ret != -EAGAIN)
goto out;
diff --git a/mt76.h b/mt76.h
index fd59fdf..dbf0fba 100644
--- a/mt76.h
+++ b/mt76.h
@@ -245,7 +245,7 @@ struct mt76_mcu_ops {
int (*mcu_send_msg)(struct mt76_dev *dev, int cmd, const void *data,
int len, bool wait_resp);
int (*mcu_skb_send_msg)(struct mt76_dev *dev, struct sk_buff *skb,
- int cmd, int *seq);
+ int cmd, int *seq, bool force_ser);
int (*mcu_parse_response)(struct mt76_dev *dev, int cmd,
struct sk_buff *skb, int seq);
u32 (*mcu_rr)(struct mt76_dev *dev, u32 offset);
diff --git a/mt76_connac_mcu.c b/mt76_connac_mcu.c
index 0ce7ecd..b6c61b4 100644
--- a/mt76_connac_mcu.c
+++ b/mt76_connac_mcu.c
@@ -3065,6 +3065,22 @@ out:
}
EXPORT_SYMBOL_GPL(mt76_connac2_load_patch);
+static int mt76_connac2_mcu_timeout_value(int cmd)
+{
+ u8 ext_cid = FIELD_GET(__MCU_CMD_FIELD_EXT_ID, cmd);
+ int timeout = 3 * HZ;
+
+ switch (ext_cid) {
+ case MCU_EXT_CMD_EFUSE_BUFFER_MODE:
+ timeout = 20 * HZ;
+ break;
+ default:
+ break;
+ }
+
+ return timeout;
+}
+
int mt76_connac2_mcu_fill_message(struct mt76_dev *dev, struct sk_buff *skb,
int cmd, int *wait_seq)
{
@@ -3076,7 +3092,7 @@ int mt76_connac2_mcu_fill_message(struct mt76_dev *dev, struct sk_buff *skb,
u8 seq;
/* TODO: make dynamic based on msg type */
- dev->mcu.timeout = 20 * HZ;
+ dev->mcu.timeout = mt76_connac2_mcu_timeout_value(cmd);
seq = ++dev->mcu.msg_seq & 0xf;
if (!seq)
diff --git a/mt7915/mcu.c b/mt7915/mcu.c
index 250b05e..bd32b0a 100644
--- a/mt7915/mcu.c
+++ b/mt7915/mcu.c
@@ -192,7 +192,7 @@ mt7915_mcu_parse_response(struct mt76_dev *mdev, int cmd,
static int
mt7915_mcu_send_message(struct mt76_dev *mdev, struct sk_buff *skb,
- int cmd, int *wait_seq)
+ int cmd, int *wait_seq, bool force_ser)
{
struct mt7915_dev *dev = container_of(mdev, struct mt7915_dev, mt76);
enum mt76_mcuq_id qid;
@@ -205,6 +205,14 @@ mt7915_mcu_send_message(struct mt76_dev *mdev, struct sk_buff *skb,
return -EPERM;
}
+ if (force_ser && mdev->recovery_state == MT76_RECOVERY_INIT) {
+ dev_info(dev->mt76.dev,"\n%s TX/RX hang force trigger L1 SER recovery, drop message %08x.",
+ wiphy_name(dev->mt76.hw->wiphy), cmd);
+ mt76_wr(dev, MT_MCU_INT_EVENT, MT_MCU_INT_EVENT_SER_TRIGGER);
+ dev_kfree_skb(skb);
+ return -EPERM;
+ }
+
ret = mt76_connac2_mcu_fill_message(mdev, skb, cmd, wait_seq);
if (ret)
diff --git a/mt7915/regs.h b/mt7915/regs.h
index ca355d1..24778d3 100644
--- a/mt7915/regs.h
+++ b/mt7915/regs.h
@@ -141,8 +141,8 @@ enum offs_rev {
#define MT_MCU_INT_EVENT __REG(INT_MCU_CMD_EVENT)
#define MT_MCU_INT_EVENT_DMA_STOPPED BIT(0)
#define MT_MCU_INT_EVENT_DMA_INIT BIT(1)
-#define MT_MCU_INT_EVENT_SER_TRIGGER BIT(2)
#define MT_MCU_INT_EVENT_RESET_DONE BIT(3)
+#define MT_MCU_INT_EVENT_SER_TRIGGER BIT(4)
/* PLE */
#define MT_PLE_BASE 0x820c0000
--
2.45.2

View File

@@ -0,0 +1,65 @@
From 01a42eca7e7ac3362e4108efc4d9b1938ff4c5ee Mon Sep 17 00:00:00 2001
From: Rex Lu <rex.lu@mediatek.com>
Date: Wed, 16 Oct 2024 13:48:03 +0800
Subject: [PATCH] wifi: mt76: mt7915: remove rts and cts protection enable flow
---
mt7915/mac.c | 13 -------------
mt7915/main.c | 3 ---
mt7915/mt7915.h | 2 --
3 files changed, 18 deletions(-)
diff --git a/mt7915/mac.c b/mt7915/mac.c
index 677c339..b4f115e 100644
--- a/mt7915/mac.c
+++ b/mt7915/mac.c
@@ -216,19 +216,6 @@ static void mt7915_mac_sta_poll(struct mt7915_dev *dev)
rcu_read_unlock();
}
-void mt7915_mac_enable_rtscts(struct mt7915_dev *dev,
- struct ieee80211_vif *vif, bool enable)
-{
- struct mt7915_vif *mvif = (struct mt7915_vif *)vif->drv_priv;
- u32 addr;
-
- addr = mt7915_mac_wtbl_lmac_addr(dev, mvif->sta.wcid.idx, 5);
- if (enable)
- mt76_set(dev, addr, BIT(5));
- else
- mt76_clear(dev, addr, BIT(5));
-}
-
static void
mt7915_wed_check_ppe(struct mt7915_dev *dev, struct mt76_queue *q,
struct mt7915_sta *msta, struct sk_buff *skb,
diff --git a/mt7915/main.c b/mt7915/main.c
index d5ea85d..ea427d1 100644
--- a/mt7915/main.c
+++ b/mt7915/main.c
@@ -681,9 +681,6 @@ static void mt7915_bss_info_changed(struct ieee80211_hw *hw,
if (set_sta == 1)
mt7915_mcu_add_sta(dev, vif, NULL, true);
- if (changed & BSS_CHANGED_ERP_CTS_PROT)
- mt7915_mac_enable_rtscts(dev, vif, info->use_cts_prot);
-
if (changed & BSS_CHANGED_ERP_SLOT) {
int slottime = info->use_short_slot ? 9 : 20;
diff --git a/mt7915/mt7915.h b/mt7915/mt7915.h
index 7c185a1..01d8552 100644
--- a/mt7915/mt7915.h
+++ b/mt7915/mt7915.h
@@ -760,8 +760,6 @@ bool mt7915_mac_wtbl_update(struct mt7915_dev *dev, int idx, u32 mask);
void mt7915_mac_reset_counters(struct mt7915_phy *phy);
void mt7915_mac_cca_stats_reset(struct mt7915_phy *phy);
void mt7915_mac_enable_nf(struct mt7915_dev *dev, bool ext_phy);
-void mt7915_mac_enable_rtscts(struct mt7915_dev *dev,
- struct ieee80211_vif *vif, bool enable);
void mt7915_mac_write_txwi(struct mt76_dev *dev, __le32 *txwi,
struct sk_buff *skb, struct mt76_wcid *wcid, int pid,
struct ieee80211_key_conf *key,
--
2.45.2

View File

@@ -0,0 +1,180 @@
From b4f66803c2096c386411bc4a211b4b56fb4496d2 Mon Sep 17 00:00:00 2001
From: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
Date: Fri, 18 Oct 2024 09:43:43 +0800
Subject: [PATCH] wifi: mt76: testmode: add interface addition/deletion command
in mt76-test
Add mt76-test phyX add/del <interface> command to align Wi-Fi 7 codebase
CR-Id: WCNCR00274293
Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
---
tools/main.c | 124 +++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 124 insertions(+)
diff --git a/tools/main.c b/tools/main.c
index 699a9ee..76b87c8 100644
--- a/tools/main.c
+++ b/tools/main.c
@@ -13,6 +13,7 @@
#include <poll.h>
#include <fcntl.h>
#include <signal.h>
+#include <net/if.h>
#include "mt76-test.h"
struct unl unl;
@@ -25,6 +26,7 @@ static int phy_lookup_idx(const char *name)
FILE *f;
int len;
+ /* TODO: Handle single wiphy radio index */
snprintf(buf, sizeof(buf), "/sys/class/ieee80211/%s/index", name);
f = fopen(buf, "r");
if (!f)
@@ -43,6 +45,8 @@ static int phy_lookup_idx(const char *name)
void usage(void)
{
static const char *const commands[] = {
+ "add <interface>",
+ "del <interface>",
"set <var>=<val> [...]",
"dump [stats]",
"eeprom file",
@@ -164,6 +168,122 @@ static int mt76_set(int phy, int argc, char **argv)
return ret;
}
+static int mt76_set_state(int phy, char *state)
+{
+ const struct tm_field *fields = msg_field.fields;
+ struct nl_msg *msg;
+ void *data;
+ int ret, i;
+
+ msg = unl_genl_msg(&unl, NL80211_CMD_TESTMODE, false);
+ nla_put_u32(msg, NL80211_ATTR_WIPHY, phy);
+
+ data = nla_nest_start(msg, NL80211_ATTR_TESTDATA);
+ for (i = 0; i < msg_field.len; i++) {
+ if (!fields[i].parse)
+ continue;
+
+ if (!strcmp(fields[i].name, "state"))
+ break;
+ }
+
+ if (!fields[i].parse(&fields[i], i, msg, state))
+ return 1;
+
+ tm_set_changed(i);
+ nla_nest_end(msg, data);
+
+ ret = unl_genl_request(&unl, msg, NULL, NULL);
+ if (ret)
+ fprintf(stderr, "Failed to turn off testmode: %s\n", strerror(-ret));
+
+ return ret;
+}
+
+static void mt76_set_tm_reg(void)
+{
+ struct nl_msg *msg;
+ char reg[3] = "VV\0";
+ int ret;
+
+ msg = unl_genl_msg(&unl, NL80211_CMD_REQ_SET_REG, false);
+ nla_put_string(msg, NL80211_ATTR_REG_ALPHA2, reg);
+
+ ret = unl_genl_request(&unl, msg, NULL, NULL);
+ if (ret)
+ fprintf(stderr, "Failed to set reg %s: %s\n", reg, strerror(-ret));
+}
+
+static int mt76_add_iface(int phy, int argc, char **argv)
+{
+ struct nl_msg *msg;
+ char *name, cmd[64];
+ int ret;
+
+ mt76_set_tm_reg();
+
+ if (argc < 1)
+ return 1;
+
+ name = argv[0];
+ msg = unl_genl_msg(&unl, NL80211_CMD_NEW_INTERFACE, false);
+ /* TODO: Handle single wiphy radio index */
+ nla_put_u32(msg, NL80211_ATTR_WIPHY, phy);
+ nla_put_u32(msg, NL80211_ATTR_IFTYPE, NL80211_IFTYPE_MONITOR);
+ nla_put_string(msg, NL80211_ATTR_IFNAME, name);
+
+ ret = unl_genl_request(&unl, msg, NULL, NULL);
+ if (ret) {
+ fprintf(stderr, "nl80211 call failed: %s\n", strerror(-ret));
+ return ret;
+ }
+
+ sprintf(cmd, "ifconfig %s up", name);
+ system(cmd);
+
+ /* turn on testmode */
+ ret = mt76_set_state(phy, "idle");
+ return ret;
+}
+
+static int mt76_delete_iface(int phy, int argc, char **argv)
+{
+ unsigned int devidx;
+ struct nl_msg *msg;
+ char *name, cmd[64];
+ int ret;
+
+ if (argc < 1)
+ return 1;
+
+ name = argv[0];
+ devidx = if_nametoindex(name);
+ if (!devidx) {
+ fprintf(stderr, "Failed to find ifindex for %s: %s\n",
+ name, strerror(errno));
+ return 2;
+ }
+
+ /* turn off testmode before deleting interface */
+ ret = mt76_set_state(phy, "off");
+ if (ret)
+ return ret;
+
+ sprintf(cmd, "ifconfig %s down", name);
+ system(cmd);
+
+ /* delete interface */
+ msg = unl_genl_msg(&unl, NL80211_CMD_DEL_INTERFACE, false);
+ nla_put_u32(msg, NL80211_ATTR_WIPHY, phy);
+ nla_put_u32(msg, NL80211_ATTR_IFINDEX, devidx);
+
+ ret = unl_genl_request(&unl, msg, NULL, NULL);
+ if (ret)
+ fprintf(stderr, "nl80211 call failed: %s\n", strerror(-ret));
+
+ return ret;
+}
+
int main(int argc, char **argv)
{
const char *cmd, *phyname;
@@ -194,6 +314,10 @@ int main(int argc, char **argv)
ret = mt76_dump(phy, argc, argv);
else if (!strcmp(cmd, "set"))
ret = mt76_set(phy, argc, argv);
+ else if (!strcmp(cmd, "add"))
+ ret = mt76_add_iface(phy, argc, argv);
+ else if (!strcmp(cmd, "del"))
+ ret = mt76_delete_iface(phy, argc, argv);
else if (!strcmp(cmd, "eeprom"))
ret = mt76_eeprom(phy, argc, argv);
else if (!strcmp(cmd, "fwlog"))
--
2.45.2

View File

@@ -0,0 +1,355 @@
From 5cfa5da26a0d68168b9771a0b2777e26edcdb8f7 Mon Sep 17 00:00:00 2001
From: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
Date: Mon, 3 Mar 2025 14:51:20 +0800
Subject: [PATCH] wifi: mt76: mt7915: rework radar rdd idx
The definition of MT_RX_SEL (for rdd_rx_sel) is mixed with the definition of HWRDD idx.
For example, MT_RX_SEL2 is for background HWRDD idx, not an option of rdd_rx_sel.
Therefore, add mt7915_get_rdd_idx as a helper function to get the HWRDD idx for each
variants.
Additionally, remove some parts of the code inherited from the legacy chips.
For instance,
1. rdd_state is used for single-band-dual-HWRDD chips (for 80+80),
especially the 76xx series.
2. rdd_rx_sel is also used for single-band-dual-HWRDD chips
rx_sel = 0 => RDD0 for WF0, RDD1 for WF2
rx_sel = 1 => RDD0 for WF1, RDD1 for WF3
Chip Variants | 5G HWRDD Index (= band idx) | Background HWRDD Index
-----------------------------------------|-----------------------------|------------------------
MT7915A (single band, 2G or 5G) | 0 | 2
MT7915D (DBDC 2G + 5G) | 1 | 2
MT7916 2G + 5G (2T2R + ZWDFS) | 1 | 2
MT7916 2G + 5G (3T3R) | 1 | N/A
MT7981 2G + 5G | 1 | N/A
MT7986 2G + 5G (one adie DBDC, AX4200) | 1 | N/A
MT7986 5G single band (one adie, AX7800) | 1(first band idx = MT_BAND1)| N/A
MT7986 2G + 5G (dual adie, AX6000) | 1 | N/A
Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
---
mt7915/debugfs.c | 20 ++++++++++++----
mt7915/mac.c | 60 +++++++++++++++++-------------------------------
mt7915/mcu.c | 41 +++++++++++++++++++++++----------
mt7915/mcu.h | 2 +-
mt7915/mt7915.h | 22 +++++++++++++-----
5 files changed, 82 insertions(+), 63 deletions(-)
diff --git a/mt7915/debugfs.c b/mt7915/debugfs.c
index 2043c77..fc7d0ee 100644
--- a/mt7915/debugfs.c
+++ b/mt7915/debugfs.c
@@ -226,18 +226,28 @@ static const struct file_operations mt7915_sys_recovery_ops = {
static int
mt7915_radar_trigger(void *data, u64 val)
{
- struct mt7915_dev *dev = data;
+#define RADAR_MAIN_CHAIN 1
+#define RADAR_BACKGROUND 2
+ struct mt7915_phy *phy = data;
+ struct mt7915_dev *dev = phy->dev;
+ int rdd_idx;
- if (val > MT_RX_SEL2)
+ if (!val || val > RADAR_BACKGROUND)
return -EINVAL;
- if (val == MT_RX_SEL2 && !dev->rdd2_phy) {
+ if (val == RADAR_BACKGROUND && !dev->rdd2_phy) {
dev_err(dev->mt76.dev, "Background radar is not enabled\n");
return -EINVAL;
}
+ rdd_idx = mt7915_get_rdd_idx(phy, val == RADAR_BACKGROUND);
+ if (rdd_idx < 0) {
+ dev_err(dev->mt76.dev, "No RDD found\n");
+ return -EINVAL;
+ }
+
return mt76_connac_mcu_rdd_cmd(&dev->mt76, RDD_RADAR_EMULATE,
- val, 0, 0);
+ rdd_idx, 0, 0);
}
DEFINE_DEBUGFS_ATTRIBUTE(fops_radar_trigger, NULL,
@@ -1575,7 +1585,7 @@ int mt7915_init_debugfs(struct mt7915_phy *phy)
if (!dev->dbdc_support || phy->mt76->band_idx) {
debugfs_create_u32("dfs_hw_pattern", 0400, dir,
&dev->hw_pattern);
- debugfs_create_file("radar_trigger", 0200, dir, dev,
+ debugfs_create_file("radar_trigger", 0200, dir, phy,
&fops_radar_trigger);
debugfs_create_devm_seqfile(dev->mt76.dev, "rdd_monitor", dir,
mt7915_rdd_monitor);
diff --git a/mt7915/mac.c b/mt7915/mac.c
index cff604e..30f54d2 100644
--- a/mt7915/mac.c
+++ b/mt7915/mac.c
@@ -2127,16 +2127,15 @@ void mt7915_mac_work(struct work_struct *work)
static void mt7915_dfs_stop_radar_detector(struct mt7915_phy *phy)
{
struct mt7915_dev *dev = phy->dev;
+ int rdd_idx = mt7915_get_rdd_idx(phy, false);
- if (phy->rdd_state & BIT(0))
- mt76_connac_mcu_rdd_cmd(&dev->mt76, RDD_STOP, 0,
- MT_RX_SEL0, 0);
- if (phy->rdd_state & BIT(1))
- mt76_connac_mcu_rdd_cmd(&dev->mt76, RDD_STOP, 1,
- MT_RX_SEL0, 0);
+ if (rdd_idx < 0)
+ return;
+
+ mt76_connac_mcu_rdd_cmd(&dev->mt76, RDD_STOP, rdd_idx, 0, 0);
}
-static int mt7915_dfs_start_rdd(struct mt7915_dev *dev, int chain)
+static int mt7915_dfs_start_rdd(struct mt7915_dev *dev, int rdd_idx)
{
int err, region;
@@ -2153,52 +2152,38 @@ static int mt7915_dfs_start_rdd(struct mt7915_dev *dev, int chain)
break;
}
- err = mt76_connac_mcu_rdd_cmd(&dev->mt76, RDD_START, chain,
- MT_RX_SEL0, region);
+ err = mt76_connac_mcu_rdd_cmd(&dev->mt76, RDD_START, rdd_idx, 0, region);
if (err < 0)
return err;
if (is_mt7915(&dev->mt76)) {
- err = mt76_connac_mcu_rdd_cmd(&dev->mt76, RDD_SET_WF_ANT, chain,
+ err = mt76_connac_mcu_rdd_cmd(&dev->mt76, RDD_SET_WF_ANT, rdd_idx,
0, dev->dbdc_support ? 2 : 0);
if (err < 0)
return err;
}
- return mt76_connac_mcu_rdd_cmd(&dev->mt76, RDD_DET_MODE, chain,
- MT_RX_SEL0, 1);
+ return mt76_connac_mcu_rdd_cmd(&dev->mt76, RDD_DET_MODE, rdd_idx, 0, 1);
}
static int mt7915_dfs_start_radar_detector(struct mt7915_phy *phy)
{
- struct cfg80211_chan_def *chandef = &phy->mt76->chandef;
struct mt7915_dev *dev = phy->dev;
- int err;
+ int err, rdd_idx;
+
+ rdd_idx = mt7915_get_rdd_idx(phy, false);
+ if (rdd_idx < 0)
+ return -EINVAL;
/* start CAC */
- err = mt76_connac_mcu_rdd_cmd(&dev->mt76, RDD_CAC_START,
- phy->mt76->band_idx, MT_RX_SEL0, 0);
+ err = mt76_connac_mcu_rdd_cmd(&dev->mt76, RDD_CAC_START, rdd_idx, 0, 0);
if (err < 0)
return err;
- err = mt7915_dfs_start_rdd(dev, phy->mt76->band_idx);
+ err = mt7915_dfs_start_rdd(dev, rdd_idx);
if (err < 0)
return err;
- phy->rdd_state |= BIT(phy->mt76->band_idx);
-
- if (!is_mt7915(&dev->mt76))
- return 0;
-
- if (chandef->width == NL80211_CHAN_WIDTH_160 ||
- chandef->width == NL80211_CHAN_WIDTH_80P80) {
- err = mt7915_dfs_start_rdd(dev, 1);
- if (err < 0)
- return err;
-
- phy->rdd_state |= BIT(1);
- }
-
return 0;
}
@@ -2240,12 +2225,12 @@ int mt7915_dfs_init_radar_detector(struct mt7915_phy *phy)
{
struct mt7915_dev *dev = phy->dev;
enum mt76_dfs_state dfs_state, prev_state;
- int err;
+ int err, rdd_idx = mt7915_get_rdd_idx(phy, false);
prev_state = phy->mt76->dfs_state;
dfs_state = mt76_phy_dfs_state(phy->mt76);
- if (prev_state == dfs_state)
+ if (prev_state == dfs_state || rdd_idx < 0)
return 0;
if (prev_state == MT_DFS_STATE_UNKNOWN)
@@ -2269,8 +2254,7 @@ int mt7915_dfs_init_radar_detector(struct mt7915_phy *phy)
if (dfs_state == MT_DFS_STATE_CAC)
return 0;
- err = mt76_connac_mcu_rdd_cmd(&dev->mt76, RDD_CAC_END,
- phy->mt76->band_idx, MT_RX_SEL0, 0);
+ err = mt76_connac_mcu_rdd_cmd(&dev->mt76, RDD_CAC_END, rdd_idx, 0, 0);
if (err < 0) {
phy->mt76->dfs_state = MT_DFS_STATE_UNKNOWN;
return err;
@@ -2280,15 +2264,13 @@ int mt7915_dfs_init_radar_detector(struct mt7915_phy *phy)
return 0;
stop:
- err = mt76_connac_mcu_rdd_cmd(&dev->mt76, RDD_NORMAL_START,
- phy->mt76->band_idx, MT_RX_SEL0, 0);
+ err = mt76_connac_mcu_rdd_cmd(&dev->mt76, RDD_NORMAL_START, rdd_idx, 0, 0);
if (err < 0)
return err;
if (is_mt7915(&dev->mt76)) {
err = mt76_connac_mcu_rdd_cmd(&dev->mt76, RDD_SET_WF_ANT,
- phy->mt76->band_idx, 0,
- dev->dbdc_support ? 2 : 0);
+ rdd_idx, 0, dev->dbdc_support ? 2 : 0);
if (err < 0)
return err;
}
diff --git a/mt7915/mcu.c b/mt7915/mcu.c
index bd32b0a..993d390 100644
--- a/mt7915/mcu.c
+++ b/mt7915/mcu.c
@@ -304,20 +304,35 @@ mt7915_mcu_rx_radar_detected(struct mt7915_dev *dev, struct sk_buff *skb)
{
struct mt76_phy *mphy = &dev->mt76.phy;
struct mt7915_mcu_rdd_report *r;
+ u32 sku;
r = (struct mt7915_mcu_rdd_report *)skb->data;
- if (r->band_idx > MT_RX_SEL2)
+ switch (r->rdd_idx) {
+ case MT_RDD_IDX_BAND0:
+ break;
+ case MT_RDD_IDX_BAND1:
+ sku = mt7915_check_adie(dev, true);
+ /* the main phy is bound to band 1 for this sku */
+ if (is_mt7986(&dev->mt76) &&
+ (sku == MT7975_ONE_ADIE || sku == MT7976_ONE_ADIE))
+ break;
+ mphy = dev->mt76.phys[MT_BAND1];
+ break;
+ case MT_RDD_IDX_BACKGROUND:
+ if (!dev->rdd2_phy)
+ return;
+ mphy = dev->rdd2_phy->mt76;
+ break;
+ default:
+ dev_err(dev->mt76.dev, "Unknown RDD idx %d\n", r->rdd_idx);
return;
+ }
- if (r->band_idx == MT_RX_SEL2 && !dev->rdd2_phy)
+ if (!mphy)
return;
- if ((r->band_idx && !dev->phy.mt76->band_idx) &&
- dev->mt76.phys[MT_BAND1])
- mphy = dev->mt76.phys[MT_BAND1];
-
- if (r->band_idx == MT_RX_SEL2)
+ if (r->rdd_idx == MT_RDD_IDX_BACKGROUND)
cfg80211_background_radar_event(mphy->hw->wiphy,
&dev->rdd2_chandef,
GFP_ATOMIC);
@@ -2907,11 +2922,14 @@ int mt7915_mcu_rdd_background_enable(struct mt7915_phy *phy,
struct cfg80211_chan_def *chandef)
{
struct mt7915_dev *dev = phy->dev;
- int err, region;
+ int err, region, rdd_idx;
+
+ rdd_idx = mt7915_get_rdd_idx(phy, true);
+ if (rdd_idx < 0)
+ return -EINVAL;
if (!chandef) { /* disable offchain */
- err = mt76_connac_mcu_rdd_cmd(&dev->mt76, RDD_STOP, MT_RX_SEL2,
- 0, 0);
+ err = mt76_connac_mcu_rdd_cmd(&dev->mt76, RDD_STOP, rdd_idx, 0, 0);
if (err)
return err;
@@ -2937,8 +2955,7 @@ int mt7915_mcu_rdd_background_enable(struct mt7915_phy *phy,
break;
}
- return mt76_connac_mcu_rdd_cmd(&dev->mt76, RDD_START, MT_RX_SEL2,
- 0, region);
+ return mt76_connac_mcu_rdd_cmd(&dev->mt76, RDD_START, rdd_idx, 0, region);
}
int mt7915_mcu_set_chan_info(struct mt7915_phy *phy, int cmd)
diff --git a/mt7915/mcu.h b/mt7915/mcu.h
index f476767..458263d 100644
--- a/mt7915/mcu.h
+++ b/mt7915/mcu.h
@@ -102,7 +102,7 @@ struct mt7915_mcu_bcc_notify {
struct mt7915_mcu_rdd_report {
struct mt76_connac2_mcu_rxd rxd;
- u8 band_idx;
+ u8 rdd_idx;
u8 long_detected;
u8 constant_prf_detected;
u8 staggered_prf_detected;
diff --git a/mt7915/mt7915.h b/mt7915/mt7915.h
index 6a823b8..afd9850 100644
--- a/mt7915/mt7915.h
+++ b/mt7915/mt7915.h
@@ -316,8 +316,6 @@ struct mt7915_phy {
s16 coverage_class;
u8 slottime;
- u8 rdd_state;
-
u32 trb_ts;
u32 rx_ampdu_ts;
@@ -523,10 +521,10 @@ enum {
__MT_WFDMA_MAX,
};
-enum {
- MT_RX_SEL0,
- MT_RX_SEL1,
- MT_RX_SEL2, /* monitor chain */
+enum rdd_idx {
+ MT_RDD_IDX_BAND0, /* RDD idx for band idx 0 (single-band) */
+ MT_RDD_IDX_BAND1, /* RDD idx for band idx 1 */
+ MT_RDD_IDX_BACKGROUND, /* RDD idx for background chain */
};
enum mt7915_rdd_cmd {
@@ -546,6 +544,18 @@ enum mt7915_rdd_cmd {
RDD_IRQ_OFF,
};
+static inline int
+mt7915_get_rdd_idx(struct mt7915_phy *phy, bool is_background)
+{
+ if (!phy->mt76->cap.has_5ghz)
+ return -1;
+
+ if (is_background)
+ return MT_RDD_IDX_BACKGROUND;
+
+ return phy->mt76->band_idx;
+}
+
static inline struct mt7915_phy *
mt7915_hw_phy(struct ieee80211_hw *hw)
{
--
2.45.2

View File

@@ -0,0 +1,470 @@
From d43a156e8d7191a8643cf4d5975cd670f3c17aa6 Mon Sep 17 00:00:00 2001
From: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
Date: Thu, 13 Mar 2025 15:25:31 +0800
Subject: [PATCH] wifi: mt76: testmode: fix rx stats issue
Originally, RX ok count is calculated by RX MDRDY count - FCS err count
- len mismatch count.
However, this is incorrect as the other err counts are not included in
the FW event.
Therefore, just use the RX ok count reported from FW.
Additionally, rework testmode dump stats for dump order
The orignal dump order is determined by the order of MT76 testmode
attribute enums, and the order of the attribute enum cannot be exchanged.
If a new attribute which is related to the previous attribute, the dump
info of these two attributes will be separated.
Therefore, use nla_for_each_nested instead of for loop to dump info, so
that the dump order will be determined by the order of nla_put
in driver.
Finally, adjust the dump stats flow to adjust the order of dump
info.
Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
---
mac80211.c | 4 +--
mt76.h | 17 ++++++++--
mt7915/mac.c | 12 +++----
mt7915/mt7915.h | 9 -----
mt7915/testmode.c | 69 ++++++++-------------------------------
testmode.c | 83 ++++++++++++++++++++++++++++++++++++++++++-----
testmode.h | 5 ++-
tools/fields.c | 30 ++++++++++-------
8 files changed, 132 insertions(+), 97 deletions(-)
diff --git a/mac80211.c b/mac80211.c
index 750a642..ffff8a5 100644
--- a/mac80211.c
+++ b/mac80211.c
@@ -818,9 +818,9 @@ void mt76_rx(struct mt76_dev *dev, enum mt76_rxq_id q, struct sk_buff *skb)
#ifdef CONFIG_NL80211_TESTMODE
if (!(phy->test.flag & MT_TM_FW_RX_COUNT) &&
phy->test.state == MT76_TM_STATE_RX_FRAMES) {
- phy->test.rx_stats.packets[q]++;
+ phy->test.rx_stats[q].packets++;
if (status->flag & RX_FLAG_FAILED_FCS_CRC)
- phy->test.rx_stats.fcs_error[q]++;
+ phy->test.rx_stats[q].fcs_error++;
}
#endif
diff --git a/mt76.h b/mt76.h
index 17400fd..67e3b2f 100644
--- a/mt76.h
+++ b/mt76.h
@@ -811,10 +811,21 @@ struct mt76_testmode_data {
u16 tx_queued_limit;
u32 tx_done;
struct {
- u64 packets[__MT_RXQ_MAX];
- u64 fcs_error[__MT_RXQ_MAX];
+ u64 packets;
+ u64 rx_success;
+ u64 fcs_error;
u64 len_mismatch;
- } rx_stats;
+ } rx_stats[__MT_RXQ_MAX];
+
+ struct {
+ s32 freq_offset;
+ u8 path;
+ u8 *rcpi;
+ s8 *rssi;
+ s8 *ib_rssi;
+ s8 *wb_rssi;
+ u8 snr;
+ } last_rx;
u8 offchan_ch;
u8 offchan_center_ch;
diff --git a/mt7915/mac.c b/mt7915/mac.c
index cff604e..46cfe35 100644
--- a/mt7915/mac.c
+++ b/mt7915/mac.c
@@ -572,10 +572,10 @@ mt7915_mac_fill_rx_vector(struct mt7915_dev *dev, struct sk_buff *skb)
if (i == 3)
wb_rssi = le32_to_cpu(rxv[9]);
- phy->test.last_rcpi[i] = rcpi & 0xff;
- phy->test.last_rssi[i] = to_rssi(GENMASK(7, 0), rcpi);
- phy->test.last_ib_rssi[i] = ib_rssi & 0xff;
- phy->test.last_wb_rssi[i] = wb_rssi & 0xff;
+ phy->mt76->test.last_rx.rcpi[i] = rcpi & 0xff;
+ phy->mt76->test.last_rx.rssi[i] = to_rssi(GENMASK(7, 0), rcpi);
+ phy->mt76->test.last_rx.ib_rssi[i] = ib_rssi & 0xff;
+ phy->mt76->test.last_rx.wb_rssi[i] = wb_rssi & 0xff;
}
v20 = le32_to_cpu(rxv[20]);
@@ -586,8 +586,8 @@ mt7915_mac_fill_rx_vector(struct mt7915_dev *dev, struct sk_buff *skb)
snr = FIELD_GET(MT_CRXV_SNR, v20) - 16;
- phy->test.last_freq_offset = foe;
- phy->test.last_snr = snr;
+ phy->mt76->test.last_rx.freq_offset = foe;
+ phy->mt76->test.last_rx.snr = snr;
out:
#endif
dev_kfree_skb(skb);
diff --git a/mt7915/mt7915.h b/mt7915/mt7915.h
index 073e65d..c67a9bb 100644
--- a/mt7915/mt7915.h
+++ b/mt7915/mt7915.h
@@ -339,16 +339,7 @@ struct mt7915_phy {
#ifdef CONFIG_NL80211_TESTMODE
struct {
u32 *reg_backup;
-
- s32 last_freq_offset;
- u8 last_rcpi[4];
- s8 last_rssi[4];
- s8 last_ib_rssi[4];
- s8 last_wb_rssi[4];
- u8 last_snr;
-
u8 spe_idx;
-
bool bf_ever_en;
} test;
#endif
diff --git a/mt7915/testmode.c b/mt7915/testmode.c
index 8398edd..72cee21 100644
--- a/mt7915/testmode.c
+++ b/mt7915/testmode.c
@@ -1965,9 +1965,10 @@ mt7915_tm_get_rx_stats(struct mt7915_phy *phy, bool clear)
if (!clear) {
enum mt76_rxq_id q = req.band ? MT_RXQ_BAND1 : MT_RXQ_MAIN;
- td->rx_stats.packets[q] += le32_to_cpu(rs_band->mdrdy_cnt);
- td->rx_stats.fcs_error[q] += le16_to_cpu(rs_band->fcs_err);
- td->rx_stats.len_mismatch += le16_to_cpu(rs_band->len_mismatch);
+ td->rx_stats[q].packets += le32_to_cpu(rs_band->mdrdy_cnt);
+ td->rx_stats[q].rx_success += le16_to_cpu(rs_band->fcs_succ);
+ td->rx_stats[q].fcs_error += le16_to_cpu(rs_band->fcs_err);
+ td->rx_stats[q].len_mismatch += le16_to_cpu(rs_band->len_mismatch);
}
dev_kfree_skb(skb);
@@ -2560,62 +2561,18 @@ mt7915_tm_set_params(struct mt76_phy *mphy, struct nlattr **tb,
static int
mt7915_tm_dump_stats(struct mt76_phy *mphy, struct sk_buff *msg)
{
+ struct mt76_testmode_data *td = &mphy->test;
struct mt7915_phy *phy = mphy->priv;
struct mt7915_dev *dev = phy->dev;
- void *rx, *rssi;
- int i;
-
- rx = nla_nest_start(msg, MT76_TM_STATS_ATTR_LAST_RX);
- if (!rx)
- return -ENOMEM;
-
- if (nla_put_s32(msg, MT76_TM_RX_ATTR_FREQ_OFFSET, phy->test.last_freq_offset))
- return -ENOMEM;
-
- rssi = nla_nest_start(msg, MT76_TM_RX_ATTR_RCPI);
- if (!rssi)
- return -ENOMEM;
-
- for (i = 0; i < ARRAY_SIZE(phy->test.last_rcpi); i++)
- if (nla_put_u8(msg, i, phy->test.last_rcpi[i]))
- return -ENOMEM;
-
- nla_nest_end(msg, rssi);
-
- rssi = nla_nest_start(msg, MT76_TM_RX_ATTR_RSSI);
- if (!rssi)
- return -ENOMEM;
-
- for (i = 0; i < ARRAY_SIZE(phy->test.last_rssi); i++)
- if (nla_put_s8(msg, i, phy->test.last_rssi[i]))
- return -ENOMEM;
+ int band_idx = mphy->band_idx;
- nla_nest_end(msg, rssi);
-
- rssi = nla_nest_start(msg, MT76_TM_RX_ATTR_IB_RSSI);
- if (!rssi)
- return -ENOMEM;
-
- for (i = 0; i < ARRAY_SIZE(phy->test.last_ib_rssi); i++)
- if (nla_put_s8(msg, i, phy->test.last_ib_rssi[i]))
- return -ENOMEM;
-
- nla_nest_end(msg, rssi);
-
- rssi = nla_nest_start(msg, MT76_TM_RX_ATTR_WB_RSSI);
- if (!rssi)
- return -ENOMEM;
-
- for (i = 0; i < ARRAY_SIZE(phy->test.last_wb_rssi); i++)
- if (nla_put_s8(msg, i, phy->test.last_wb_rssi[i]))
- return -ENOMEM;
-
- nla_nest_end(msg, rssi);
-
- if (nla_put_u8(msg, MT76_TM_RX_ATTR_SNR, phy->test.last_snr))
- return -ENOMEM;
-
- nla_nest_end(msg, rx);
+ if (!td->last_rx.path) {
+ td->last_rx.path = hweight32(mphy->chainmask >> (dev->chainshift * band_idx));
+ td->last_rx.rcpi = devm_kzalloc(dev->mt76.dev, td->last_rx.path, GFP_KERNEL);
+ td->last_rx.rssi = devm_kzalloc(dev->mt76.dev, td->last_rx.path, GFP_KERNEL);
+ td->last_rx.ib_rssi = devm_kzalloc(dev->mt76.dev, td->last_rx.path, GFP_KERNEL);
+ td->last_rx.wb_rssi = devm_kzalloc(dev->mt76.dev, td->last_rx.path, GFP_KERNEL);
+ }
if (mphy->test.tx_rate_mode == MT76_TM_TX_MODE_HE_MU)
mphy->test.tx_done += mt76_rr(dev, MT_MIB_DR8(phy != &dev->phy));
diff --git a/testmode.c b/testmode.c
index 56b9205..c041b35 100644
--- a/testmode.c
+++ b/testmode.c
@@ -454,9 +454,8 @@ __mt76_testmode_set_state(struct mt76_phy *phy, enum mt76_testmode_state state)
if (state == MT76_TM_STATE_TX_FRAMES)
mt76_testmode_tx_start(phy);
- else if (state == MT76_TM_STATE_RX_FRAMES) {
+ else if (state == MT76_TM_STATE_RX_FRAMES)
memset(&phy->test.rx_stats, 0, sizeof(phy->test.rx_stats));
- }
phy->test.state = state;
@@ -769,13 +768,77 @@ out:
}
EXPORT_SYMBOL(mt76_testmode_cmd);
+static int
+mt76_testmode_dump_last_rx_stats(struct mt76_phy *phy, struct sk_buff *msg)
+{
+ struct mt76_testmode_data *td = &phy->test;
+ void *rx, *rssi;
+ int i;
+
+ rx = nla_nest_start(msg, MT76_TM_STATS_ATTR_LAST_RX);
+ if (!rx)
+ return -ENOMEM;
+
+ rssi = nla_nest_start(msg, MT76_TM_RX_ATTR_RSSI);
+ if (!rssi)
+ return -ENOMEM;
+
+ for (i = 0; i < td->last_rx.path; i++)
+ if (nla_put_s8(msg, i, td->last_rx.rssi[i]))
+ return -ENOMEM;
+
+ nla_nest_end(msg, rssi);
+
+ rssi = nla_nest_start(msg, MT76_TM_RX_ATTR_RCPI);
+ if (!rssi)
+ return -ENOMEM;
+
+ for (i = 0; i < td->last_rx.path; i++)
+ if (nla_put_u8(msg, i, td->last_rx.rcpi[i]))
+ return -ENOMEM;
+
+ nla_nest_end(msg, rssi);
+
+ rssi = nla_nest_start(msg, MT76_TM_RX_ATTR_IB_RSSI);
+ if (!rssi)
+ return -ENOMEM;
+
+ for (i = 0; i < td->last_rx.path; i++)
+ if (nla_put_s8(msg, i, td->last_rx.ib_rssi[i]))
+ return -ENOMEM;
+
+ nla_nest_end(msg, rssi);
+
+ rssi = nla_nest_start(msg, MT76_TM_RX_ATTR_WB_RSSI);
+ if (!rssi)
+ return -ENOMEM;
+
+ for (i = 0; i < td->last_rx.path; i++)
+ if (nla_put_s8(msg, i, td->last_rx.wb_rssi[i]))
+ return -ENOMEM;
+
+ nla_nest_end(msg, rssi);
+
+ if (nla_put_s32(msg, MT76_TM_RX_ATTR_FREQ_OFFSET, td->last_rx.freq_offset))
+ return -ENOMEM;
+
+ if (nla_put_u8(msg, MT76_TM_RX_ATTR_SNR, td->last_rx.snr))
+ return -ENOMEM;
+
+ nla_nest_end(msg, rx);
+
+ return 0;
+}
+
static int
mt76_testmode_dump_stats(struct mt76_phy *phy, struct sk_buff *msg)
{
struct mt76_testmode_data *td = &phy->test;
struct mt76_dev *dev = phy->dev;
u64 rx_packets = 0;
+ u64 rx_success = 0;
u64 rx_fcs_error = 0;
+ u64 rx_len_mismatch = 0;
int i;
if (dev->test_ops->dump_stats) {
@@ -786,9 +849,11 @@ mt76_testmode_dump_stats(struct mt76_phy *phy, struct sk_buff *msg)
return ret;
}
- for (i = 0; i < ARRAY_SIZE(td->rx_stats.packets); i++) {
- rx_packets += td->rx_stats.packets[i];
- rx_fcs_error += td->rx_stats.fcs_error[i];
+ for (i = 0; i < ARRAY_SIZE(td->rx_stats); i++) {
+ rx_packets += td->rx_stats[i].packets;
+ rx_success += td->rx_stats[i].rx_success;
+ rx_fcs_error += td->rx_stats[i].fcs_error;
+ rx_len_mismatch += td->rx_stats[i].len_mismatch;
}
if (nla_put_u32(msg, MT76_TM_STATS_ATTR_TX_PENDING, td->tx_pending) ||
@@ -796,14 +861,15 @@ mt76_testmode_dump_stats(struct mt76_phy *phy, struct sk_buff *msg)
nla_put_u32(msg, MT76_TM_STATS_ATTR_TX_DONE, td->tx_done) ||
nla_put_u64_64bit(msg, MT76_TM_STATS_ATTR_RX_PACKETS, rx_packets,
MT76_TM_STATS_ATTR_PAD) ||
+ nla_put_u64_64bit(msg, MT76_TM_STATS_ATTR_RX_SUCCESS, rx_success,
+ MT76_TM_STATS_ATTR_PAD) ||
nla_put_u64_64bit(msg, MT76_TM_STATS_ATTR_RX_FCS_ERROR, rx_fcs_error,
MT76_TM_STATS_ATTR_PAD) ||
- nla_put_u64_64bit(msg, MT76_TM_STATS_ATTR_RX_LEN_MISMATCH,
- td->rx_stats.len_mismatch,
+ nla_put_u64_64bit(msg, MT76_TM_STATS_ATTR_RX_LEN_MISMATCH, rx_len_mismatch,
MT76_TM_STATS_ATTR_PAD))
return -EMSGSIZE;
- return 0;
+ return mt76_testmode_dump_last_rx_stats(phy, msg);
}
int mt76_testmode_dump(struct ieee80211_hw *hw, struct sk_buff *msg,
@@ -845,6 +911,7 @@ int mt76_testmode_dump(struct ieee80211_hw *hw, struct sk_buff *msg,
goto out;
}
+ /* the dump order follows the order of nla_put for each attribute */
if (tb[MT76_TM_ATTR_STATS]) {
err = -EINVAL;
diff --git a/testmode.h b/testmode.h
index 14ce948..d1be530 100644
--- a/testmode.h
+++ b/testmode.h
@@ -160,12 +160,14 @@ enum mt76_testmode_attr {
* @MT76_TM_STATS_ATTR_TX_QUEUED: queued tx frames (u32)
* @MT76_TM_STATS_ATTR_TX_QUEUED: completed tx frames (u32)
*
- * @MT76_TM_STATS_ATTR_RX_PACKETS: number of rx packets (u64)
+ * @MT76_TM_STATS_ATTR_RX_PACKETS: number of rx mdrdy packets
+ * with successfully parsed headers (u64)
* @MT76_TM_STATS_ATTR_RX_FCS_ERROR: number of rx packets with FCS error (u64)
* @MT76_TM_STATS_ATTR_LAST_RX: information about the last received packet
* see &enum mt76_testmode_rx_attr
* @MT76_TM_STATS_ATTR_RX_LEN_MISMATCH: number of rx packets with length
* mismatch error (u64)
+ * @MT76_TM_STATS_ATTR_RX_SUCCESS: number of successfully rx packets (u64)
*/
enum mt76_testmode_stats_attr {
MT76_TM_STATS_ATTR_UNSPEC,
@@ -179,6 +181,7 @@ enum mt76_testmode_stats_attr {
MT76_TM_STATS_ATTR_RX_FCS_ERROR,
MT76_TM_STATS_ATTR_LAST_RX,
MT76_TM_STATS_ATTR_RX_LEN_MISMATCH,
+ MT76_TM_STATS_ATTR_RX_SUCCESS,
/* keep last */
NUM_MT76_TM_STATS_ATTRS,
diff --git a/tools/fields.c b/tools/fields.c
index 027b8cd..2cf8af0 100644
--- a/tools/fields.c
+++ b/tools/fields.c
@@ -203,17 +203,14 @@ static void print_array(const struct tm_field *field, struct nlattr *attr)
static void print_nested(const struct tm_field *field, struct nlattr *attr)
{
- struct nlattr **tb = alloca(field->len * sizeof(struct nlattr *));
const struct tm_field *fields = field->fields;
- int i;
+ struct nlattr *cur;
+ int i, rem;
- nla_parse_nested(tb, field->len - 1, attr, field->policy);
- for (i = 0; i < field->len; i++) {
+ nla_for_each_nested(cur, attr, rem) {
int prefix_len = 0;
- if (!tb[i])
- continue;
-
+ i = nla_type(cur);
if (!fields[i].print)
continue;
@@ -226,7 +223,7 @@ static void print_nested(const struct tm_field *field, struct nlattr *attr)
sizeof(prefix) - prefix_len - 1);
}
- fields[i].print(&fields[i], tb[i]);
+ fields[i].print(&fields[i], cur);
if (fields[i].prefix)
prefix[prefix_len] = 0;
@@ -234,20 +231,25 @@ static void print_nested(const struct tm_field *field, struct nlattr *attr)
printf("\n");
}
- if (field->print_extra)
+ if (field->print_extra) {
+ struct nlattr **tb = alloca(field->len * sizeof(struct nlattr *));
+
+ nla_parse_nested(tb, field->len - 1, attr, field->policy);
field->print_extra(field, tb);
+ }
}
static void print_extra_stats(const struct tm_field *field, struct nlattr **tb)
{
- float total, failed;
+ float total, success, failed;
if (!tb[MT76_TM_STATS_ATTR_RX_PACKETS] ||
- !tb[MT76_TM_STATS_ATTR_RX_FCS_ERROR])
+ !tb[MT76_TM_STATS_ATTR_RX_SUCCESS])
return;
total = nla_get_u64(tb[MT76_TM_STATS_ATTR_RX_PACKETS]);
- failed = nla_get_u64(tb[MT76_TM_STATS_ATTR_RX_FCS_ERROR]);
+ success = nla_get_u64(tb[MT76_TM_STATS_ATTR_RX_SUCCESS]);
+ failed = total - success;
printf("%srx_per=%.02f%%\n", prefix, 100 * failed / total);
}
@@ -391,6 +393,8 @@ static const struct tm_field stats_fields[NUM_MT76_TM_STATS_ATTRS] = {
FIELD_RO(u32, TX_DONE, "tx_done"),
FIELD_RO(u64, RX_PACKETS, "rx_packets"),
FIELD_RO(u64, RX_FCS_ERROR, "rx_fcs_error"),
+ FIELD_RO(u64, RX_LEN_MISMATCH, "rx_len_mismatch"),
+ FIELD_RO(u64, RX_SUCCESS, "rx_success"),
FIELD_NESTED_RO(LAST_RX, rx, "last_"),
};
static struct nla_policy stats_policy[NUM_MT76_TM_STATS_ATTRS] = {
@@ -399,6 +403,8 @@ static struct nla_policy stats_policy[NUM_MT76_TM_STATS_ATTRS] = {
[MT76_TM_STATS_ATTR_TX_DONE] = { .type = NLA_U32 },
[MT76_TM_STATS_ATTR_RX_PACKETS] = { .type = NLA_U64 },
[MT76_TM_STATS_ATTR_RX_FCS_ERROR] = { .type = NLA_U64 },
+ [MT76_TM_STATS_ATTR_RX_LEN_MISMATCH] = { .type = NLA_U64 },
+ [MT76_TM_STATS_ATTR_RX_SUCCESS] = { .type = NLA_U64 },
};
#undef FIELD_NAME
--
2.45.2

View File

@@ -1,7 +1,7 @@
From 86f4aafcab8e833c7009e453e97adc254628d4d1 Mon Sep 17 00:00:00 2001
From daf071f6469272be2b7b61cb227efb7ad57c2ddd Mon Sep 17 00:00:00 2001
From: Sujuan Chen <sujuan.chen@mediatek.com>
Date: Fri, 25 Nov 2022 10:38:53 +0800
Subject: [PATCH 2000/2014] wifi: mt76: mt7915: wed: add wed tx support
Subject: [PATCH 78/94] wifi: mt76: mt7915: wed: add wed tx support
Signed-off-by: Sujuan Chen <sujuan.chen@mediatek.com>
---
@@ -14,7 +14,7 @@ Signed-off-by: Sujuan Chen <sujuan.chen@mediatek.com>
6 files changed, 14 insertions(+), 8 deletions(-)
diff --git a/mt76_connac.h b/mt76_connac.h
index 8e7068c..e1d6ca2 100644
index e411032..f2006ea 100644
--- a/mt76_connac.h
+++ b/mt76_connac.h
@@ -130,6 +130,7 @@ struct mt76_connac_sta_key_conf {
@@ -26,7 +26,7 @@ index 8e7068c..e1d6ca2 100644
struct mt76_connac_fw_txp {
__le16 flags;
diff --git a/mt7915/mac.c b/mt7915/mac.c
index c84b957..1c8b873 100644
index 677c339..543077d 100644
--- a/mt7915/mac.c
+++ b/mt7915/mac.c
@@ -878,9 +878,9 @@ u32 mt7915_wed_init_buf(void *ptr, dma_addr_t phys, int token_id)
@@ -67,10 +67,10 @@ index c84b957..1c8b873 100644
static void
diff --git a/mt7915/main.c b/mt7915/main.c
index 41fa450..332b087 100644
index e3bc373..6f09dda 100644
--- a/mt7915/main.c
+++ b/mt7915/main.c
@@ -1753,14 +1753,14 @@ mt7915_net_fill_forward_path(struct ieee80211_hw *hw,
@@ -1832,7 +1832,7 @@ mt7915_net_fill_forward_path(struct ieee80211_hw *hw,
if (!mtk_wed_device_active(wed))
return -ENODEV;
@@ -78,7 +78,8 @@ index 41fa450..332b087 100644
+ if (msta->wcid.idx > MT7915_WTBL_STA)
return -EIO;
path->type = DEV_PATH_MTK_WDMA;
if (!test_bit((mvif->qos_map[path->mtk_wdma.tid >> 2] + AMPDU_ADDBA_SUCC_SHFT),
@@ -1843,7 +1843,7 @@ mt7915_net_fill_forward_path(struct ieee80211_hw *hw,
path->dev = ctx->dev;
path->mtk_wdma.wdma_idx = wed->wdma_idx;
path->mtk_wdma.bss = mvif->mt76.idx;
@@ -88,7 +89,7 @@ index 41fa450..332b087 100644
ctx->dev = NULL;
diff --git a/mt7915/mmio.c b/mt7915/mmio.c
index 437a9b0..91100f1 100644
index b1b219c..5364821 100644
--- a/mt7915/mmio.c
+++ b/mt7915/mmio.c
@@ -13,7 +13,7 @@
@@ -109,7 +110,7 @@ index 437a9b0..91100f1 100644
ret = dma_set_mask(wed->dev, DMA_BIT_MASK(32));
if (ret)
diff --git a/mt7915/mt7915.h b/mt7915/mt7915.h
index 47f7d16..1d0188d 100644
index 7c185a1..94ea3e1 100644
--- a/mt7915/mt7915.h
+++ b/mt7915/mt7915.h
@@ -62,7 +62,7 @@
@@ -135,5 +136,5 @@ index f7a3f1b..47c81a2 100644
}
EXPORT_SYMBOL_GPL(mt76_wed_offload_disable);
--
2.18.0
2.45.2

View File

@@ -1,7 +1,7 @@
From ab7172fb880f05bc6005a78982278c5b365055b4 Mon Sep 17 00:00:00 2001
From 2845e9a6b55d63d970541c8322eec387bfa252e4 Mon Sep 17 00:00:00 2001
From: Sujuan Chen <sujuan.chen@mediatek.com>
Date: Tue, 13 Dec 2022 17:51:26 +0800
Subject: [PATCH 2001/2014] wifi: mt76: mt7915: wed: add wds support when wed
Subject: [PATCH 2001/2015] wifi: mt76: mt7915: wed: add wds support when wed
is enabled
Signed-off-by: Sujuan Chen <sujuan.chen@mediatek.com>
@@ -15,7 +15,7 @@ Signed-off-by: Sujuan Chen <sujuan.chen@mediatek.com>
6 files changed, 82 insertions(+), 10 deletions(-)
diff --git a/mt76.h b/mt76.h
index fb50d88..d3c6ac0 100644
index 49ddaade..411a9576 100644
--- a/mt76.h
+++ b/mt76.h
@@ -78,6 +78,12 @@ enum mt76_wed_type {
@@ -32,10 +32,10 @@ index fb50d88..d3c6ac0 100644
u32 (*rr)(struct mt76_dev *dev, u32 offset);
void (*wr)(struct mt76_dev *dev, u32 offset, u32 val);
diff --git a/mt7915/main.c b/mt7915/main.c
index 332b087..ab60159 100644
index ff0337a6..778c73e9 100644
--- a/mt7915/main.c
+++ b/mt7915/main.c
@@ -829,8 +829,15 @@ int mt7915_mac_sta_add(struct mt76_dev *mdev, struct ieee80211_vif *vif,
@@ -834,8 +834,15 @@ int mt7915_mac_sta_add(struct mt76_dev *mdev, struct ieee80211_vif *vif,
#endif
int ret, idx;
u32 addr;
@@ -52,7 +52,7 @@ index 332b087..ab60159 100644
if (idx < 0)
return -ENOSPC;
@@ -1321,6 +1328,13 @@ static void mt7915_sta_set_4addr(struct ieee80211_hw *hw,
@@ -1335,6 +1342,13 @@ static void mt7915_sta_set_4addr(struct ieee80211_hw *hw,
else
clear_bit(MT_WCID_FLAG_4ADDR, &msta->wcid.flags);
@@ -66,7 +66,7 @@ index 332b087..ab60159 100644
mt76_connac_mcu_wtbl_update_hdr_trans(&dev->mt76, vif, sta);
}
@@ -1760,8 +1774,12 @@ mt7915_net_fill_forward_path(struct ieee80211_hw *hw,
@@ -1823,8 +1837,12 @@ mt7915_net_fill_forward_path(struct ieee80211_hw *hw,
path->dev = ctx->dev;
path->mtk_wdma.wdma_idx = wed->wdma_idx;
path->mtk_wdma.bss = mvif->mt76.idx;
@@ -81,7 +81,7 @@ index 332b087..ab60159 100644
ctx->dev = NULL;
diff --git a/mt7915/mcu.c b/mt7915/mcu.c
index d857658..b42afe8 100644
index 250b05ec..7927a523 100644
--- a/mt7915/mcu.c
+++ b/mt7915/mcu.c
@@ -2588,10 +2588,18 @@ int mt7915_mcu_init_firmware(struct mt7915_dev *dev)
@@ -108,7 +108,7 @@ index d857658..b42afe8 100644
ret = mt7915_mcu_set_mwds(dev, 1);
if (ret)
diff --git a/mt7915/mcu.h b/mt7915/mcu.h
index f476767..52baaa7 100644
index f4767671..52baaa73 100644
--- a/mt7915/mcu.h
+++ b/mt7915/mcu.h
@@ -392,6 +392,7 @@ enum {
@@ -120,7 +120,7 @@ index f476767..52baaa7 100644
MCU_WA_PARAM_RED_SHOW_STA = 0xf,
MCU_WA_PARAM_RED_TARGET_DELAY = 0x10,
diff --git a/util.c b/util.c
index fc76c66..61b2d30 100644
index d6c01a2d..995d7880 100644
--- a/util.c
+++ b/util.c
@@ -42,9 +42,14 @@ bool ____mt76_poll_msec(struct mt76_dev *dev, u32 offset, u32 mask, u32 val,
@@ -188,7 +188,7 @@ index fc76c66..61b2d30 100644
int mt76_get_min_avg_rssi(struct mt76_dev *dev, bool ext_phy)
{
diff --git a/util.h b/util.h
index 260965d..99b7263 100644
index 260965dd..99b7263c 100644
--- a/util.h
+++ b/util.h
@@ -27,7 +27,12 @@ enum {

View File

@@ -1,7 +1,7 @@
From 6fa429e617e59379bd82c8dbef851e99954676ed Mon Sep 17 00:00:00 2001
From 0f848ffb35cc45beb156069d3856b14414e9a6ee Mon Sep 17 00:00:00 2001
From: Evelyn Tsai <evelyn.tsai@mediatek.com>
Date: Fri, 19 May 2023 07:05:22 +0800
Subject: [PATCH 2002/2014] wifi: mt76: mt7915: wed: add fill receive path to
Subject: [PATCH 2002/2015] wifi: mt76: mt7915: wed: add fill receive path to
report wed idx
Signed-off-by: Sujuan Chen <sujuan.chen@mediatek.com>
@@ -10,10 +10,10 @@ Signed-off-by: Sujuan Chen <sujuan.chen@mediatek.com>
1 file changed, 18 insertions(+)
diff --git a/mt7915/main.c b/mt7915/main.c
index ab60159..b3e06aa 100644
index 778c73e9..abafa5e4 100644
--- a/mt7915/main.c
+++ b/mt7915/main.c
@@ -1785,6 +1785,23 @@ mt7915_net_fill_forward_path(struct ieee80211_hw *hw,
@@ -1848,6 +1848,23 @@ mt7915_net_fill_forward_path(struct ieee80211_hw *hw,
return 0;
}
@@ -37,7 +37,7 @@ index ab60159..b3e06aa 100644
#endif
const struct ieee80211_ops mt7915_ops = {
@@ -1841,6 +1858,7 @@ const struct ieee80211_ops mt7915_ops = {
@@ -1910,6 +1927,7 @@ const struct ieee80211_ops mt7915_ops = {
.set_radar_background = mt7915_set_radar_background,
#ifdef CONFIG_NET_MEDIATEK_SOC_WED
.net_fill_forward_path = mt7915_net_fill_forward_path,

View File

@@ -1,7 +1,7 @@
From 79d00e5e7ff7653dc6839551f33a5b36d6291169 Mon Sep 17 00:00:00 2001
From 6d6ae068e478b101556ae723c23533220a8daeb5 Mon Sep 17 00:00:00 2001
From: Sujuan Chen <sujuan.chen@mediatek.com>
Date: Fri, 25 Nov 2022 14:32:35 +0800
Subject: [PATCH 2003/2014] wifi: mt76: mt7915: wed: find rx token by physical
Subject: [PATCH 2003/2015] wifi: mt76: mt7915: wed: find rx token by physical
address
The token id in RxDMAD may be incorrect when it is not the last frame due to
@@ -13,7 +13,7 @@ Signed-off-by: Peter Chiu <chui-hao.chiu@mediatek.com>
1 file changed, 24 insertions(+), 1 deletion(-)
diff --git a/dma.c b/dma.c
index 100d2af..185c6f1 100644
index 100d2aff..185c6f12 100644
--- a/dma.c
+++ b/dma.c
@@ -444,9 +444,32 @@ mt76_dma_get_buf(struct mt76_dev *dev, struct mt76_queue *q, int idx,

View File

@@ -1,7 +1,7 @@
From f4c4eda21841dae1229e6f7942d4a74f385d87a5 Mon Sep 17 00:00:00 2001
From bd38f1f0988785cb9316c99e0fe144f3a6421b50 Mon Sep 17 00:00:00 2001
From: Lian Chen <lian.chen@mediatek.com>
Date: Mon, 7 Nov 2022 14:47:44 +0800
Subject: [PATCH 2004/2014] wifi: mt76: mt7915: wed: HW ATF support for mt7986
Subject: [PATCH] wifi: mt76: mt7915: wed: HW ATF support for mt7986
Signed-off-by: Lian Chen <lian.chen@mediatek.com>
Signed-off-by: Benjamin Lin <benjamin-jw.lin@mediatek.com>
@@ -11,15 +11,15 @@ Signed-off-by: Benjamin Lin <benjamin-jw.lin@mediatek.com>
mt7915/init.c | 58 +++++++
mt7915/main.c | 14 ++
mt7915/mcu.c | 169 +++++++++++++++++++-
mt7915/mt7915.h | 69 +++++++++
mt7915/mt7915.h | 67 ++++++++
mt7915/mtk_debugfs.c | 130 ++++++++++++++++
7 files changed, 796 insertions(+), 3 deletions(-)
7 files changed, 794 insertions(+), 3 deletions(-)
diff --git a/mt76_connac_mcu.h b/mt76_connac_mcu.h
index dc60e35..03d6a2b 100644
index d8b001f..1721f9b 100644
--- a/mt76_connac_mcu.h
+++ b/mt76_connac_mcu.h
@@ -1209,6 +1209,7 @@ enum {
@@ -1211,6 +1211,7 @@ enum {
MCU_EXT_CMD_THERMAL_CTRL = 0x2c,
MCU_EXT_CMD_WTBL_UPDATE = 0x32,
MCU_EXT_CMD_SET_DRR_CTRL = 0x36,
@@ -27,7 +27,7 @@ index dc60e35..03d6a2b 100644
MCU_EXT_CMD_SET_RDD_CTRL = 0x3a,
MCU_EXT_CMD_ATE_CTRL = 0x3d,
MCU_EXT_CMD_PROTECT_CTRL = 0x3e,
@@ -1218,6 +1219,7 @@ enum {
@@ -1220,6 +1221,7 @@ enum {
MCU_EXT_CMD_MUAR_UPDATE = 0x48,
MCU_EXT_CMD_BCN_OFFLOAD = 0x49,
MCU_EXT_CMD_RX_AIRTIME_CTRL = 0x4a,
@@ -36,7 +36,7 @@ index dc60e35..03d6a2b 100644
MCU_EXT_CMD_EFUSE_FREE_BLOCK = 0x4f,
MCU_EXT_CMD_TX_POWER_FEATURE_CTRL = 0x58,
diff --git a/mt7915/debugfs.c b/mt7915/debugfs.c
index d8ca90a..3ae4aca 100644
index c118492..c612af3 100644
--- a/mt7915/debugfs.c
+++ b/mt7915/debugfs.c
@@ -12,6 +12,10 @@
@@ -409,7 +409,7 @@ index d8ca90a..3ae4aca 100644
static int
mt7915_radar_trigger(void *data, u64 val)
{
@@ -1526,6 +1882,7 @@ int mt7915_init_debugfs(struct mt7915_phy *phy)
@@ -1581,6 +1937,7 @@ int mt7915_init_debugfs(struct mt7915_phy *phy)
debugfs_create_devm_seqfile(dev->mt76.dev, "twt_stats", dir,
mt7915_twt_stats);
debugfs_create_file("rf_regval", 0600, dir, dev, &fops_rf_regval);
@@ -418,10 +418,10 @@ index d8ca90a..3ae4aca 100644
if (!dev->dbdc_support || phy->mt76->band_idx) {
debugfs_create_u32("dfs_hw_pattern", 0400, dir,
diff --git a/mt7915/init.c b/mt7915/init.c
index 9ffeca5..16c3632 100644
index 813aa43..d1cea0e 100644
--- a/mt7915/init.c
+++ b/mt7915/init.c
@@ -587,9 +587,64 @@ mt7915_init_led_mux(struct mt7915_dev *dev)
@@ -588,9 +588,64 @@ mt7915_init_led_mux(struct mt7915_dev *dev)
}
}
@@ -484,9 +484,9 @@ index 9ffeca5..16c3632 100644
int i;
+ struct wiphy *wiphy = dev->phy.mt76->hw->wiphy;
if (!is_mt7915(&dev->mt76))
mt76_clear(dev, MT_MDP_DCR2, MT_MDP_DCR2_RX_TRANS_SHORT);
@@ -603,6 +658,9 @@ void mt7915_mac_init(struct mt7915_dev *dev)
/* config pse qid6 wfdma port selection */
if (!is_mt7915(&dev->mt76) && dev->hif2)
@@ -609,6 +664,9 @@ void mt7915_mac_init(struct mt7915_dev *dev)
mt7915_mac_init_band(dev, i);
mt7915_init_led_mux(dev);
@@ -497,7 +497,7 @@ index 9ffeca5..16c3632 100644
int mt7915_txbf_init(struct mt7915_dev *dev)
diff --git a/mt7915/main.c b/mt7915/main.c
index b3e06aa..199ce82 100644
index 35e488f..dd2bc22 100644
--- a/mt7915/main.c
+++ b/mt7915/main.c
@@ -226,6 +226,7 @@ int mt7915_init_vif(struct mt7915_phy *phy, struct ieee80211_vif *vif, bool bf_e
@@ -507,8 +507,8 @@ index b3e06aa..199ce82 100644
+ struct wiphy *wiphy = dev->phy.mt76->hw->wiphy;
struct mt76_txq *mtxq;
bool ext_phy = phy != &dev->phy;
int idx, ret = 0;
@@ -288,6 +289,9 @@ int mt7915_init_vif(struct mt7915_phy *phy, struct ieee80211_vif *vif, bool bf_e
int idx, i, ret = 0;
@@ -297,6 +298,9 @@ int mt7915_init_vif(struct mt7915_phy *phy, struct ieee80211_vif *vif, bool bf_e
mt7915_mcu_add_sta(dev, vif, NULL, true);
rcu_assign_pointer(dev->mt76.wcid[idx], &mvif->sta.wcid);
@@ -518,7 +518,7 @@ index b3e06aa..199ce82 100644
return ret;
}
@@ -824,6 +828,7 @@ int mt7915_mac_sta_add(struct mt76_dev *mdev, struct ieee80211_vif *vif,
@@ -832,6 +836,7 @@ int mt7915_mac_sta_add(struct mt76_dev *mdev, struct ieee80211_vif *vif,
struct mt7915_sta *msta = (struct mt7915_sta *)sta->drv_priv;
struct mt7915_vif *mvif = (struct mt7915_vif *)vif->drv_priv;
bool ext_phy = mvif->phy != &dev->phy;
@@ -526,7 +526,7 @@ index b3e06aa..199ce82 100644
#ifdef CONFIG_MTK_VENDOR
struct mt7915_phy *phy = ext_phy ? mt7915_ext_phy(dev) : &dev->phy;
#endif
@@ -874,6 +879,15 @@ int mt7915_mac_sta_add(struct mt76_dev *mdev, struct ieee80211_vif *vif,
@@ -881,6 +886,15 @@ int mt7915_mac_sta_add(struct mt76_dev *mdev, struct ieee80211_vif *vif,
if (phy->muru_onoff & MUMIMO_DL_CERT)
mt7915_mcu_set_mimo(phy, 0);
#endif
@@ -543,10 +543,10 @@ index b3e06aa..199ce82 100644
}
diff --git a/mt7915/mcu.c b/mt7915/mcu.c
index b42afe8..a153585 100644
index 1bc1500..5fcffd1 100644
--- a/mt7915/mcu.c
+++ b/mt7915/mcu.c
@@ -1866,7 +1866,7 @@ mt7915_mcu_add_group(struct mt7915_dev *dev, struct ieee80211_vif *vif,
@@ -1889,7 +1889,7 @@ mt7915_mcu_add_group(struct mt7915_dev *dev, struct ieee80211_vif *vif,
{
#define MT_STA_BSS_GROUP 1
struct mt7915_vif *mvif = (struct mt7915_vif *)vif->drv_priv;
@@ -555,7 +555,7 @@ index b42afe8..a153585 100644
struct {
__le32 action;
u8 wlan_idx_lo;
@@ -1877,10 +1877,9 @@ mt7915_mcu_add_group(struct mt7915_dev *dev, struct ieee80211_vif *vif,
@@ -1900,10 +1900,9 @@ mt7915_mcu_add_group(struct mt7915_dev *dev, struct ieee80211_vif *vif,
u8 rsv1[8];
} __packed req = {
.action = cpu_to_le32(MT_STA_BSS_GROUP),
@@ -567,7 +567,7 @@ index b42afe8..a153585 100644
req.wlan_idx_lo = to_wcid_lo(msta->wcid.idx);
req.wlan_idx_hi = to_wcid_hi(msta->wcid.idx);
@@ -1938,6 +1937,7 @@ int mt7915_mcu_add_sta(struct mt7915_dev *dev, struct ieee80211_vif *vif,
@@ -1961,6 +1960,7 @@ int mt7915_mcu_add_sta(struct mt7915_dev *dev, struct ieee80211_vif *vif,
mt7915_mcu_sta_bfee_tlv(dev, skb, vif, sta);
}
@@ -575,7 +575,7 @@ index b42afe8..a153585 100644
ret = mt7915_mcu_add_group(dev, vif, sta);
if (ret) {
dev_kfree_skb(skb);
@@ -3897,6 +3897,169 @@ int mt7915_mcu_set_ser(struct mt7915_dev *dev, u8 action, u8 set, u8 band)
@@ -3922,6 +3922,169 @@ int mt7915_mcu_set_ser(struct mt7915_dev *dev, u8 action, u8 set, u8 band)
&req, sizeof(req), false);
}
@@ -746,10 +746,10 @@ index b42afe8..a153585 100644
{
#define MT_BF_PROCESSING 4
diff --git a/mt7915/mt7915.h b/mt7915/mt7915.h
index 1d0188d..d779488 100644
index 9cdf4d8..b841202 100644
--- a/mt7915/mt7915.h
+++ b/mt7915/mt7915.h
@@ -141,6 +141,58 @@ struct mt7915_twt_flow {
@@ -143,6 +143,58 @@ struct mt7915_twt_flow {
DECLARE_EWMA(avg_signal, 10, 8)
@@ -808,7 +808,7 @@ index 1d0188d..d779488 100644
struct mt7915_sta {
struct mt76_wcid wcid; /* must be first */
@@ -161,6 +213,7 @@ struct mt7915_sta {
@@ -162,6 +214,7 @@ struct mt7915_sta {
u8 flowid_mask;
struct mt7915_twt_flow flow[MT7915_MAX_STA_TWT_AGRT];
} twt;
@@ -816,7 +816,7 @@ index 1d0188d..d779488 100644
};
struct mt7915_vif_cap {
@@ -490,6 +543,8 @@ struct mt7915_dev {
@@ -508,6 +561,8 @@ struct mt7915_dev {
#endif
struct delayed_work scs_work;
@@ -825,23 +825,21 @@ index 1d0188d..d779488 100644
bool wmm_pbc_enable;
struct work_struct wmm_pbc_work;
@@ -526,6 +581,15 @@ enum mt7915_rdd_cmd {
RDD_IRQ_OFF,
};
@@ -556,6 +611,13 @@ mt7915_get_rdd_idx(struct mt7915_phy *phy, bool is_background)
return phy->mt76->band_idx;
}
+static inline bool
+mt7915_is_atf_default_on(struct wiphy *wiphy, struct mt7915_dev *dev)
+{
+ return ((!wiphy_ext_feature_isset(wiphy,
+ NL80211_EXT_FEATURE_AIRTIME_FAIRNESS)) ||
+ mtk_wed_device_active(&dev->mt76.mmio.wed));
+ return !wiphy_ext_feature_isset(wiphy, NL80211_EXT_FEATURE_AIRTIME_FAIRNESS) ||
+ mtk_wed_device_active(&dev->mt76.mmio.wed);
+}
+
+
static inline struct mt7915_phy *
mt7915_hw_phy(struct ieee80211_hw *hw)
{
@@ -655,6 +719,11 @@ int mt7915_mcu_set_mac(struct mt7915_dev *dev, int band, bool enable,
@@ -686,6 +748,11 @@ int mt7915_mcu_set_mac(struct mt7915_dev *dev, int band, bool enable,
int mt7915_mcu_set_test_param(struct mt7915_dev *dev, u8 param, bool test_mode,
u8 en);
int mt7915_mcu_set_ser(struct mt7915_dev *dev, u8 action, u8 set, u8 band);
@@ -854,7 +852,7 @@ index 1d0188d..d779488 100644
int mt7915_mcu_set_txpower_sku(struct mt7915_phy *phy);
int mt7915_mcu_get_txpower_sku(struct mt7915_phy *phy, s8 *txpower, int len,
diff --git a/mt7915/mtk_debugfs.c b/mt7915/mtk_debugfs.c
index 78ac4e5..ead8970 100644
index 3a58a06..b201492 100644
--- a/mt7915/mtk_debugfs.c
+++ b/mt7915/mtk_debugfs.c
@@ -1518,6 +1518,136 @@ static void chip_get_sta_pause(struct mt7915_dev *dev, u32 *sta_pause)
@@ -995,5 +993,5 @@ index 78ac4e5..ead8970 100644
{
struct mt7915_dev *dev = dev_get_drvdata(s->private);
--
2.18.0
2.45.2

View File

@@ -1,7 +1,7 @@
From 1cb052dfd4d21367e1c6623721d58a05648c9b2a Mon Sep 17 00:00:00 2001
From b6184a94736ddea3277b1bea374686edb9aef6b4 Mon Sep 17 00:00:00 2001
From: Sujuan Chen <sujuan.chen@mediatek.com>
Date: Fri, 6 Jan 2023 18:18:50 +0800
Subject: [PATCH 2005/2014] wifi: mt76: mt7915: wed: add rxwi for further in
Subject: [PATCH 2005/2015] wifi: mt76: mt7915: wed: add rxwi for further in
chip rro
Signed-off-by: Sujuan Chen <sujuan.chen@mediatek.com>
@@ -17,7 +17,7 @@ Signed-off-by: Sujuan Chen <sujuan.chen@mediatek.com>
8 files changed, 87 insertions(+), 80 deletions(-)
diff --git a/dma.c b/dma.c
index 185c6f1..9cd97d2 100644
index 185c6f12..9cd97d24 100644
--- a/dma.c
+++ b/dma.c
@@ -64,17 +64,17 @@ mt76_alloc_txwi(struct mt76_dev *dev)
@@ -245,10 +245,10 @@ index 185c6f1..9cd97d2 100644
unmap:
for (n--; n > 0; n--)
diff --git a/mac80211.c b/mac80211.c
index f9dfdf8..225b290 100644
index 750a642a..e50c68f8 100644
--- a/mac80211.c
+++ b/mac80211.c
@@ -618,7 +618,6 @@ mt76_alloc_device(struct device *pdev, unsigned int size,
@@ -619,7 +619,6 @@ mt76_alloc_device(struct device *pdev, unsigned int size,
spin_lock_init(&dev->lock);
spin_lock_init(&dev->cc_lock);
spin_lock_init(&dev->status_lock);
@@ -256,7 +256,7 @@ index f9dfdf8..225b290 100644
mutex_init(&dev->mutex);
init_waitqueue_head(&dev->tx_wait);
@@ -651,6 +650,7 @@ mt76_alloc_device(struct device *pdev, unsigned int size,
@@ -652,6 +651,7 @@ mt76_alloc_device(struct device *pdev, unsigned int size,
INIT_LIST_HEAD(&dev->txwi_cache);
INIT_LIST_HEAD(&dev->rxwi_cache);
dev->token_size = dev->drv->token_size;
@@ -265,7 +265,7 @@ index f9dfdf8..225b290 100644
for (i = 0; i < ARRAY_SIZE(dev->q_rx); i++)
skb_queue_head_init(&dev->rx_skb[i]);
diff --git a/mt76.h b/mt76.h
index d3c6ac0..2e7585a 100644
index 411a9576..40884fd8 100644
--- a/mt76.h
+++ b/mt76.h
@@ -193,6 +193,7 @@ struct mt76_queue_entry {
@@ -312,7 +312,7 @@ index d3c6ac0..2e7585a 100644
spinlock_t lock;
spinlock_t cc_lock;
@@ -1630,8 +1636,8 @@ mt76_tx_status_get_hw(struct mt76_dev *dev, struct sk_buff *skb)
@@ -1639,8 +1645,8 @@ mt76_tx_status_get_hw(struct mt76_dev *dev, struct sk_buff *skb)
}
void mt76_put_txwi(struct mt76_dev *dev, struct mt76_txwi_cache *t);
@@ -323,7 +323,7 @@ index d3c6ac0..2e7585a 100644
void mt76_free_pending_rxwi(struct mt76_dev *dev);
void mt76_rx_complete(struct mt76_dev *dev, struct sk_buff_head *frames,
struct napi_struct *napi);
@@ -1810,9 +1816,9 @@ mt76_token_release(struct mt76_dev *dev, int token, bool *wake);
@@ -1831,9 +1837,9 @@ mt76_token_release(struct mt76_dev *dev, int token, bool *wake);
int mt76_token_consume(struct mt76_dev *dev, struct mt76_txwi_cache **ptxwi,
u8 phy_idx);
void __mt76_set_tx_blocked(struct mt76_dev *dev, bool blocked);
@@ -336,7 +336,7 @@ index d3c6ac0..2e7585a 100644
static inline void mt76_set_tx_blocked(struct mt76_dev *dev, bool blocked)
{
diff --git a/mt7915/dma.c b/mt7915/dma.c
index 0baa82c..552410a 100644
index 0baa82c8..552410aa 100644
--- a/mt7915/dma.c
+++ b/mt7915/dma.c
@@ -512,7 +512,6 @@ int mt7915_dma_init(struct mt7915_dev *dev, struct mt7915_phy *phy2)
@@ -356,7 +356,7 @@ index 0baa82c..552410a 100644
}
diff --git a/mt7915/mmio.c b/mt7915/mmio.c
index 91100f1..3391a94 100644
index 53648212..baf35a53 100644
--- a/mt7915/mmio.c
+++ b/mt7915/mmio.c
@@ -725,7 +725,7 @@ int mt7915_mmio_wed_init(struct mt7915_dev *dev, void *pdev_ptr,
@@ -377,7 +377,7 @@ index 91100f1..3391a94 100644
.tx_complete_skb = mt76_connac_tx_complete_skb,
.rx_skb = mt7915_queue_rx_skb,
diff --git a/mt7915/mt7915.h b/mt7915/mt7915.h
index d779488..e41c7ad 100644
index 9ea30f1d..55af5c8c 100644
--- a/mt7915/mt7915.h
+++ b/mt7915/mt7915.h
@@ -64,6 +64,7 @@
@@ -389,7 +389,7 @@ index d779488..e41c7ad 100644
#define MT7915_CFEND_RATE_DEFAULT 0x49 /* OFDM 24M */
#define MT7915_CFEND_RATE_11B 0x03 /* 11B LP, 11M */
diff --git a/tx.c b/tx.c
index db0d4df..92afbf5 100644
index db0d4df5..92afbf5d 100644
--- a/tx.c
+++ b/tx.c
@@ -864,16 +864,16 @@ int mt76_token_consume(struct mt76_dev *dev, struct mt76_txwi_cache **ptxwi,
@@ -434,7 +434,7 @@ index db0d4df..92afbf5 100644
}
EXPORT_SYMBOL_GPL(mt76_rx_token_release);
diff --git a/wed.c b/wed.c
index 47c81a2..c03b52f 100644
index 47c81a28..c03b52f9 100644
--- a/wed.c
+++ b/wed.c
@@ -16,18 +16,18 @@ void mt76_wed_release_rx_buf(struct mtk_wed_device *wed)

View File

@@ -1,7 +1,7 @@
From 94195c0022e50d9a3e28dc184bbaaa4505648611 Mon Sep 17 00:00:00 2001
From 35000e804c9cad780ee340efba7cebf461366cd3 Mon Sep 17 00:00:00 2001
From: Peter Chiu <chui-hao.chiu@mediatek.com>
Date: Wed, 11 Jan 2023 10:56:27 +0800
Subject: [PATCH 2006/2014] wifi: mt76: add debugfs knob to show packet error
Subject: [PATCH 2006/2015] wifi: mt76: add debugfs knob to show packet error
rate
Get tx count and tx failed from mcu command
@@ -15,7 +15,7 @@ Get tx count and tx failed from mcu command
6 files changed, 194 insertions(+), 1 deletion(-)
diff --git a/mt76.h b/mt76.h
index 2e7585a..29e0b19 100644
index 40884fd8..7100934a 100644
--- a/mt76.h
+++ b/mt76.h
@@ -321,8 +321,10 @@ struct mt76_sta_stats {
@@ -30,10 +30,10 @@ index 2e7585a..29e0b19 100644
u64 rx_bytes;
u32 rx_packets;
diff --git a/mt76_connac_mcu.h b/mt76_connac_mcu.h
index 03d6a2b..b0d3fe8 100644
index 1721f9b5..3d00961c 100644
--- a/mt76_connac_mcu.h
+++ b/mt76_connac_mcu.h
@@ -1207,6 +1207,7 @@ enum {
@@ -1209,6 +1209,7 @@ enum {
MCU_EXT_CMD_EDCA_UPDATE = 0x27,
MCU_EXT_CMD_DEV_INFO_UPDATE = 0x2A,
MCU_EXT_CMD_THERMAL_CTRL = 0x2c,
@@ -42,7 +42,7 @@ index 03d6a2b..b0d3fe8 100644
MCU_EXT_CMD_SET_DRR_CTRL = 0x36,
MCU_EXT_CMD_SET_FEATURE_CTRL = 0x38,
diff --git a/mt7915/mcu.c b/mt7915/mcu.c
index a153585..c75db44 100644
index 570dd171..8733a07d 100644
--- a/mt7915/mcu.c
+++ b/mt7915/mcu.c
@@ -4565,6 +4565,114 @@ int mt7915_mcu_get_tx_rate(struct mt7915_phy *phy, u16 wcidx)
@@ -161,7 +161,7 @@ index a153585..c75db44 100644
struct cfg80211_he_bss_color *he_bss_color)
{
diff --git a/mt7915/mcu.h b/mt7915/mcu.h
index 52baaa7..ec7ad7d 100644
index 52baaa73..ec7ad7db 100644
--- a/mt7915/mcu.h
+++ b/mt7915/mcu.h
@@ -854,7 +854,8 @@ mt7915_get_power_bound(struct mt7915_phy *phy, s8 txpower)
@@ -200,10 +200,10 @@ index 52baaa7..ec7ad7d 100644
CAPI_SU,
CAPI_MU,
diff --git a/mt7915/mt7915.h b/mt7915/mt7915.h
index e41c7ad..38d39c8 100644
index 55af5c8c..731f5f3e 100644
--- a/mt7915/mt7915.h
+++ b/mt7915/mt7915.h
@@ -753,6 +753,7 @@ int mt7915_mcu_get_rx_rate(struct mt7915_phy *phy, struct ieee80211_vif *vif,
@@ -770,6 +770,7 @@ int mt7915_mcu_get_rx_rate(struct mt7915_phy *phy, struct ieee80211_vif *vif,
int mt7915_mcu_rdd_background_enable(struct mt7915_phy *phy,
struct cfg80211_chan_def *chandef);
int mt7915_mcu_wed_wa_tx_stats(struct mt7915_dev *dev, u16 wcid);
@@ -212,7 +212,7 @@ index e41c7ad..38d39c8 100644
int mt7915_mcu_wa_cmd(struct mt7915_dev *dev, int cmd, u32 a1, u32 a2, u32 a3);
int mt7915_mcu_fw_log_2_host(struct mt7915_dev *dev, u8 type, u8 ctrl);
diff --git a/mt7915/mtk_debugfs.c b/mt7915/mtk_debugfs.c
index ead8970..a80ddeb 100644
index d6e92b12..d64a3aec 100644
--- a/mt7915/mtk_debugfs.c
+++ b/mt7915/mtk_debugfs.c
@@ -4027,6 +4027,66 @@ mt7915_sr_scene_cond_show(struct seq_file *file, void *data)

View File

@@ -1,7 +1,7 @@
From 1509b89e35f93f8e8bf7b1343cee162377b18305 Mon Sep 17 00:00:00 2001
From fac0ee814e10b01fc8536f4da0e2e7cec474b5d7 Mon Sep 17 00:00:00 2001
From: "sujuan.chen" <sujuan.chen@mediatek.com>
Date: Thu, 6 Apr 2023 17:50:52 +0800
Subject: [PATCH 2007/2014] wifi: mt76: mt7915: add ctxd support for mt7916
Subject: [PATCH 2007/2015] wifi: mt76: mt7915: add ctxd support for mt7916
Signed-off-by: sujuan.chen <sujuan.chen@mediatek.com>
---
@@ -10,7 +10,7 @@ Signed-off-by: sujuan.chen <sujuan.chen@mediatek.com>
2 files changed, 35 insertions(+)
diff --git a/mt7915/dma.c b/mt7915/dma.c
index 552410a..4f9f5a3 100644
index 552410aa..4f9f5a38 100644
--- a/mt7915/dma.c
+++ b/mt7915/dma.c
@@ -435,6 +435,26 @@ int mt7915_dma_init(struct mt7915_dev *dev, struct mt7915_phy *phy2)
@@ -41,7 +41,7 @@ index 552410a..4f9f5a3 100644
} else {
mt76_clear(dev, MT_WFDMA_HOST_CONFIG, MT_WFDMA_HOST_CONFIG_WED);
diff --git a/mt7915/regs.h b/mt7915/regs.h
index ca355d1..d4acefc 100644
index ca355d14..d4acefca 100644
--- a/mt7915/regs.h
+++ b/mt7915/regs.h
@@ -607,6 +607,7 @@ enum offs_rev {

View File

@@ -1,7 +1,7 @@
From 6f0a79be1206d1d8b656e7388d47ecebfa5c786f Mon Sep 17 00:00:00 2001
From cfad406a8e50de85347861782835596f599bfe59 Mon Sep 17 00:00:00 2001
From: Evelyn Tsai <evelyn.tsai@mediatek.com>
Date: Sun, 4 Feb 2024 17:52:44 +0800
Subject: [PATCH 2008/2014] wifi: mt76: connac: wed: add wed rx copy skb
Subject: [PATCH 2008/2015] wifi: mt76: connac: wed: add wed rx copy skb
Signed-off-by: Sujuan Chen <sujuan.chen@mediatek.com>
---
@@ -10,7 +10,7 @@ Signed-off-by: Sujuan Chen <sujuan.chen@mediatek.com>
2 files changed, 80 insertions(+), 28 deletions(-)
diff --git a/dma.c b/dma.c
index 9cd97d2..d17fc88 100644
index 9cd97d24..d17fc88c 100644
--- a/dma.c
+++ b/dma.c
@@ -225,10 +225,10 @@ void mt76_dma_queue_reset(struct mt76_dev *dev, struct mt76_queue *q)
@@ -138,7 +138,7 @@ index 9cd97d2..d17fc88 100644
static void
diff --git a/wed.c b/wed.c
index c03b52f..70e4057 100644
index c03b52f9..70e40575 100644
--- a/wed.c
+++ b/wed.c
@@ -9,12 +9,9 @@

View File

@@ -1,7 +1,7 @@
From 0d4fe8030a80350c0b5b66a45467f4f53a49b526 Mon Sep 17 00:00:00 2001
From 3be6f92d47cdfd1ab676c9728cc84560fd2cee91 Mon Sep 17 00:00:00 2001
From: Peter Chiu <chui-hao.chiu@mediatek.com>
Date: Fri, 8 Sep 2023 18:26:21 +0800
Subject: [PATCH 2009/2014] wifi: mt76: mt7915: enable wa log to uart
Subject: [PATCH 2009/2015] wifi: mt76: mt7915: enable wa log to uart
Signed-off-by: Peter Chiu <chui-hao.chiu@mediatek.com>
---
@@ -9,7 +9,7 @@ Signed-off-by: Peter Chiu <chui-hao.chiu@mediatek.com>
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/mt7915/debugfs.c b/mt7915/debugfs.c
index 3ae4aca..76d1951 100644
index 576ec1a5..03ccb51b 100644
--- a/mt7915/debugfs.c
+++ b/mt7915/debugfs.c
@@ -951,7 +951,11 @@ mt7915_fw_debug_wa_set(void *data, u64 val)

View File

@@ -1,7 +1,7 @@
From bc7b628c2a3ec331489bff0a1c940743db7b5f1e Mon Sep 17 00:00:00 2001
From 24b3e43ac4d858dd17013087e4ea0b4b86002079 Mon Sep 17 00:00:00 2001
From: Peter Chiu <chui-hao.chiu@mediatek.com>
Date: Fri, 8 Sep 2023 18:29:32 +0800
Subject: [PATCH 2010/2014] wifi: mt76: mt7915: add error message when driver
Subject: [PATCH 2010/2015] wifi: mt76: mt7915: add error message when driver
receive invalid token id
Signed-off-by: Peter Chiu <chui-hao.chiu@mediatek.com>
@@ -10,7 +10,7 @@ Signed-off-by: Peter Chiu <chui-hao.chiu@mediatek.com>
1 file changed, 6 insertions(+)
diff --git a/mt7915/mac.c b/mt7915/mac.c
index 1c8b873..3f907e6 100644
index 1c8b8732..3f907e61 100644
--- a/mt7915/mac.c
+++ b/mt7915/mac.c
@@ -1007,6 +1007,12 @@ mt7915_mac_tx_free(struct mt7915_dev *dev, void *data, int len)

Some files were not shown because too many files have changed in this diff Show More