[rdkb][common][bsp][Refactor and sync wifi from openwrt]

[Description]
feda97c [MAC80211][mt76][Enable sigma daemon in mt7988]
90bafdf [MAC80211][mt76][rework patches for mt7996]
1b21440 [MAC80211][mt76][Add mac80211 5.15 source]
c75c5a6 [MAC80211][mt76][Refactor mt76 internal patches]

[Release-log]

Change-Id: I5b2706e2673bc43437f51713260237f67e8fbea9
diff --git a/recipes-wifi/linux-mt76/files/patches/3004-mt76-mt7915-wed-find-rx-token-by-physical-address.patch b/recipes-wifi/linux-mt76/files/patches/3004-mt76-mt7915-wed-find-rx-token-by-physical-address.patch
new file mode 100644
index 0000000..ea151cb
--- /dev/null
+++ b/recipes-wifi/linux-mt76/files/patches/3004-mt76-mt7915-wed-find-rx-token-by-physical-address.patch
@@ -0,0 +1,58 @@
+From e27abd8471cfe265afd0061cc86f85cce5b37773 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 3004/3010] 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
+WED HW bug. Lookup correct token id by physical address in sdp0.
+
+Signed-off-by: Peter Chiu <chui-hao.chiu@mediatek.com>
+---
+ dma.c | 27 ++++++++++++++++++++++++++-
+ 1 file changed, 26 insertions(+), 1 deletion(-)
+
+diff --git a/dma.c b/dma.c
+index a6bb3730..b58579c5 100644
+--- a/dma.c
++++ b/dma.c
+@@ -402,10 +402,35 @@ mt76_dma_get_buf(struct mt76_dev *dev, struct mt76_queue *q, int idx,
+ 		*info = le32_to_cpu(desc->info);
+ 
+ 	if (mt76_queue_is_wed_rx(q)) {
++		__le32 buf1;
++		u32 id, find = 0;
+ 		u32 token = FIELD_GET(MT_DMA_CTL_TOKEN,
+ 				      le32_to_cpu(desc->buf1));
+-		struct mt76_txwi_cache *t = mt76_rx_token_release(dev, token);
++		struct mt76_txwi_cache *t;
++
++		if (*more) {
++			spin_lock_bh(&dev->rx_token_lock);
++
++			idr_for_each_entry(&dev->rx_token, t, id) {
++				if (t->dma_addr == le32_to_cpu(desc->buf0)) {
++					find = 1;
++					token = id;
++
++					/* Write correct id back to DMA*/
++					buf1 = desc->buf1;
++					buf1 = le32_replace_bits(buf1, id,
++							MT_DMA_CTL_TOKEN);
++					WRITE_ONCE(desc->buf1, buf1);
++					break;
++				}
++			}
++
++			spin_unlock_bh(&dev->rx_token_lock);
++			if (!find)
++				return NULL;
++		}
+ 
++		t = mt76_rx_token_release(dev, token);
+ 		if (!t)
+ 			return NULL;
+ 
+-- 
+2.18.0
+