[][mac80211][wifi6][mt76][Enhance debug log]

[Description]
Add debug log for wa uart and invalid token id.

[Release-log]
N/A

Change-Id: Ib8c57a85610c7b7f4116c7ebc584420f61a9ff3c
Reviewed-on: https://gerrit.mediatek.inc/c/openwrt/feeds/mtk_openwrt_feeds/+/7987487
diff --git a/autobuild_mac80211_release/package/kernel/mt76/patches/2009-wifi-mt76-mt7915-enable-wa-log-to-uart.patch b/autobuild_mac80211_release/package/kernel/mt76/patches/2009-wifi-mt76-mt7915-enable-wa-log-to-uart.patch
new file mode 100644
index 0000000..6fbee7e
--- /dev/null
+++ b/autobuild_mac80211_release/package/kernel/mt76/patches/2009-wifi-mt76-mt7915-enable-wa-log-to-uart.patch
@@ -0,0 +1,30 @@
+From 44d7d8c0fba2102d07d197525e06c191ccae4fd8 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] wifi: mt76: mt7915: enable wa log to uart
+
+Signed-off-by: Peter Chiu <chui-hao.chiu@mediatek.com>
+---
+ mt7915/debugfs.c | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/mt7915/debugfs.c b/mt7915/debugfs.c
+index fefa4540..ba42a8b9 100644
+--- a/mt7915/debugfs.c
++++ b/mt7915/debugfs.c
+@@ -988,7 +988,11 @@ mt7915_fw_debug_wa_set(void *data, u64 val)
+ 	struct mt7915_dev *dev = data;
+ 	int ret;
+ 
+-	dev->fw.debug_wa = val ? MCU_FW_LOG_TO_HOST : 0;
++	/* bit 0: log to uart, bit 1: log to Host */
++	if (val > 3)
++		return -EINVAL;
++
++	dev->fw.debug_wa = val;
+ 
+ 	ret = mt7915_mcu_fw_log_2_host(dev, MCU_FW_LOG_WA, dev->fw.debug_wa);
+ 	if (ret)
+-- 
+2.18.0
+