[][MAC80211][wifi6][mt76][Check vif type before report cca and csa done]

[Description]
Fix call trace due to csa finalize with station interface.
If station interface call csa or cca finalize, it would do
set beacon in mac80211.
Setting beacon is unexpected for station interface and
it would lead to kernel warning.

[Release-log]
N/A

Change-Id: Ie1a0398cc0bca8c6bd174818d52f165dd8a6684a
Reviewed-on: https://gerrit.mediatek.inc/c/openwrt/feeds/mtk_openwrt_feeds/+/7934368
diff --git a/autobuild_mac80211_release/package/kernel/mt76/patches/0012-wifi-mt76-mt7915-check-vif-type-before-reporting-cca.patch b/autobuild_mac80211_release/package/kernel/mt76/patches/0012-wifi-mt76-mt7915-check-vif-type-before-reporting-cca.patch
new file mode 100644
index 0000000..1e2e712
--- /dev/null
+++ b/autobuild_mac80211_release/package/kernel/mt76/patches/0012-wifi-mt76-mt7915-check-vif-type-before-reporting-cca.patch
@@ -0,0 +1,36 @@
+From 83629860fe17ebc27cda2c91ce43c1bc064b85b4 Mon Sep 17 00:00:00 2001
+From: Peter Chiu <chui-hao.chiu@mediatek.com>
+Date: Mon, 28 Aug 2023 10:59:23 +0800
+Subject: [PATCH] wifi: mt76: mt7915: check vif type before reporting cca and
+ csa
+
+Signed-off-by: Peter Chiu <chui-hao.chiu@mediatek.com>
+---
+ mt7915/mcu.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/mt7915/mcu.c b/mt7915/mcu.c
+index 502610fc..ab337c6b 100644
+--- a/mt7915/mcu.c
++++ b/mt7915/mcu.c
+@@ -225,7 +225,7 @@ int mt7915_mcu_wa_cmd(struct mt7915_dev *dev, int cmd, u32 a1, u32 a2, u32 a3)
+ static void
+ mt7915_mcu_csa_finish(void *priv, u8 *mac, struct ieee80211_vif *vif)
+ {
+-	if (vif->bss_conf.csa_active)
++	if (vif->bss_conf.csa_active && vif->type != NL80211_IFTYPE_STATION)
+ 		ieee80211_csa_finish(vif);
+ }
+ 
+@@ -326,7 +326,7 @@ mt7915_mcu_rx_log_message(struct mt7915_dev *dev, struct sk_buff *skb)
+ static void
+ mt7915_mcu_cca_finish(void *priv, u8 *mac, struct ieee80211_vif *vif)
+ {
+-	if (!vif->bss_conf.color_change_active)
++	if (!vif->bss_conf.color_change_active || vif->type == NL80211_IFTYPE_STATION)
+ 		return;
+ 
+ 	ieee80211_color_change_finish(vif);
+-- 
+2.18.0
+