[][MAC80211][WiFi6][core][Sync wifi7 cert SQC fix to wifi6]

[Description]
Fix CERT SAE-4.8.1 issue
  - Testbed STA somehow enters PSM and thus DEAUTH is queued in PSE.
    Therefore, mt76 AP sends DEAUTH to ALTX queue when in CERT mode.

[Release-log]
N/A

Change-Id: I0eb46758a38ebd86aa56e1aa8c90d8636602cdef
Reviewed-on: https://gerrit.mediatek.inc/c/openwrt/feeds/mtk_openwrt_feeds/+/8816431
diff --git a/autobuild_mac80211_release/package/kernel/mt76/patches/1054-wifi-mt76-mt7915-assign-DEAUTH-to-ALTX-queue-for.patch b/autobuild_mac80211_release/package/kernel/mt76/patches/1054-wifi-mt76-mt7915-assign-DEAUTH-to-ALTX-queue-for.patch
new file mode 100644
index 0000000..e3aaa55
--- /dev/null
+++ b/autobuild_mac80211_release/package/kernel/mt76/patches/1054-wifi-mt76-mt7915-assign-DEAUTH-to-ALTX-queue-for.patch
@@ -0,0 +1,41 @@
+From acb471cadec0bb69035099acab4f6d2b247b81a2 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] mtk: wifi: mt76: mt7915: assign DEAUTH to ALTX queue for CERT
+
+Signed-off-by: Michael-CY Lee <michael-cy.lee@mediatek.com>
+---
+ mt76_connac_mac.c | 10 ++++++++++
+ 1 file changed, 10 insertions(+)
+
+diff --git a/mt76_connac_mac.c b/mt76_connac_mac.c
+index abb95b3..5da130c 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,
+ 				  struct sk_buff *skb,
+ 				  struct ieee80211_key_conf *key)
+ {
++	struct mt76_phy *mphy =
++		mt76_dev_phy(&dev->mt76, le32_get_bits(txwi[1], MT_TXD1_TGID));
+ 	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,
+ 	u8 fc_type, fc_stype;
+ 	u32 val;
+ 
++	if (ieee80211_is_cert_mode(mphy->hw) && ieee80211_is_deauth(fc)) {
++		/* In WPA3 cert TC-4.8.1, the deauth must be transmitted without
++		 * considering PSM bit
++		 */
++		txwi[0] &= ~cpu_to_le32(MT_TXD0_Q_IDX);
++		txwi[0] |= cpu_to_le32(FIELD_PREP(MT_TXD0_Q_IDX, MT_LMAC_ALTX0));
++	}
++
+ 	if (ieee80211_is_action(fc) &&
+ 	    mgmt->u.action.category == WLAN_CATEGORY_BACK &&
+ 	    mgmt->u.action.u.addba_req.action_code == WLAN_ACTION_ADDBA_REQ) {
+-- 
+2.25.1
+