[rdk-b][common][bsp][Refactor and sync kernel/wifi from Openwrt]
[Description]
Refactor and sync kernel/wifi from Openwrt
[Release-log]
N/A
diff --git a/recipes-wifi/linux-mt76/files/patches/3005-mt76-add-ser-spport-when-wed-on.patch b/recipes-wifi/linux-mt76/files/patches/3005-mt76-add-ser-spport-when-wed-on.patch
index 8fc8e61..3fc96e6 100644
--- a/recipes-wifi/linux-mt76/files/patches/3005-mt76-add-ser-spport-when-wed-on.patch
+++ b/recipes-wifi/linux-mt76/files/patches/3005-mt76-add-ser-spport-when-wed-on.patch
@@ -1,10 +1,9 @@
-From fcd960471fe61d47225ac1da974e64a2700cd797 Mon Sep 17 00:00:00 2001
+From cfa2b02b3cbc63ccf936d0620c36ed5a5c841cb7 Mon Sep 17 00:00:00 2001
From: Sujuan Chen <sujuan.chen@mediatek.com>
Date: Thu, 28 Jul 2022 11:16:15 +0800
-Subject: [PATCH 3005/3010] mt76 add ser spport when wed on
+Subject: [PATCH 3005/3011] mt76 add ser spport when wed on
Signed-off-by: Sujuan Chen <sujuan.chen@mediatek.com>
-Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
---
dma.c | 29 ++++++++++++++++++++---------
dma.h | 2 +-
@@ -16,7 +15,7 @@
7 files changed, 76 insertions(+), 15 deletions(-)
diff --git a/dma.c b/dma.c
-index a8739eb..d63b02f 100644
+index a8739eb4..d63b02f5 100644
--- a/dma.c
+++ b/dma.c
@@ -169,7 +169,7 @@ mt76_free_pending_txwi(struct mt76_dev *dev)
@@ -110,7 +109,7 @@
if (!q->rx_head)
return;
diff --git a/dma.h b/dma.h
-index 90370d1..083cbca 100644
+index 90370d12..083cbca4 100644
--- a/dma.h
+++ b/dma.h
@@ -58,5 +58,5 @@ enum mt76_mcu_evt_type {
@@ -121,10 +120,10 @@
+int mt76_dma_wed_setup(struct mt76_dev *dev, struct mt76_queue *q, bool reset);
#endif
diff --git a/mt76.h b/mt76.h
-index 45439a7..13bdc08 100644
+index 627bcbf9..f22e96e0 100644
--- a/mt76.h
+++ b/mt76.h
-@@ -1373,6 +1373,7 @@ mt76_tx_status_get_hw(struct mt76_dev *dev, struct sk_buff *skb)
+@@ -1375,6 +1375,7 @@ 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);
void mt76_put_rxwi(struct mt76_dev *dev, struct mt76_txwi_cache *t);
struct mt76_txwi_cache *mt76_get_rxwi(struct mt76_dev *dev);
@@ -133,10 +132,10 @@
struct napi_struct *napi);
void mt76_rx_poll_complete(struct mt76_dev *dev, enum mt76_rxq_id q,
diff --git a/mt7915/dma.c b/mt7915/dma.c
-index 702d629..96cad2b 100644
+index 6f6550f5..8edfa465 100644
--- a/mt7915/dma.c
+++ b/mt7915/dma.c
-@@ -532,6 +532,7 @@ int mt7915_dma_init(struct mt7915_dev *dev, struct mt7915_phy *phy2)
+@@ -553,6 +553,7 @@ int mt7915_dma_init(struct mt7915_dev *dev, struct mt7915_phy *phy2)
int mt7915_dma_reset(struct mt7915_dev *dev, bool force)
{
struct mt76_phy *mphy_ext = dev->mt76.phys[MT_BAND1];
@@ -144,10 +143,10 @@
int i;
/* clean up hw queues */
-@@ -552,28 +553,53 @@ int mt7915_dma_reset(struct mt7915_dev *dev, bool force)
+@@ -572,28 +573,53 @@ int mt7915_dma_reset(struct mt7915_dev *dev, bool force)
+ if (force)
mt7915_wfsys_reset(dev);
- /* disable wfdma */
+ if (mtk_wed_device_active(&dev->mt76.mmio.wed))
+ mtk_wed_device_dma_reset(&dev->mt76.mmio.wed);
mt7915_dma_disable(dev, force);
@@ -204,10 +203,10 @@
}
diff --git a/mt7915/mac.c b/mt7915/mac.c
-index 1ef7cb4..e78f30f 100644
+index eac49465..cbdabea0 100644
--- a/mt7915/mac.c
+++ b/mt7915/mac.c
-@@ -918,6 +918,8 @@ void mt7915_wed_release_rx_buf(struct mtk_wed_device *wed)
+@@ -948,6 +948,8 @@ void mt7915_wed_release_rx_buf(struct mtk_wed_device *wed)
mt76_put_rxwi(&dev->mt76, rxwi);
}
@@ -216,7 +215,7 @@
if (wed->rx_page.va)
return;
-@@ -928,6 +930,18 @@ void mt7915_wed_release_rx_buf(struct mtk_wed_device *wed)
+@@ -958,6 +960,18 @@ void mt7915_wed_release_rx_buf(struct mtk_wed_device *wed)
return;
}
@@ -235,8 +234,8 @@
static void
mt7915_tx_check_aggr(struct ieee80211_sta *sta, __le32 *txwi)
{
-@@ -1681,6 +1695,12 @@ void mt7915_mac_reset_work(struct work_struct *work)
- if (!(READ_ONCE(dev->reset_state) & MT_MCU_CMD_STOP_DMA))
+@@ -1697,6 +1711,12 @@ void mt7915_mac_reset_work(struct work_struct *work)
+ if (!(READ_ONCE(dev->recovery.state) & MT_MCU_CMD_STOP_DMA))
return;
+ if (mtk_wed_device_active(&dev->mt76.mmio.wed)) {
@@ -249,10 +248,10 @@
if (ext_phy)
ieee80211_stop_queues(ext_phy->hw);
diff --git a/mt7915/mmio.c b/mt7915/mmio.c
-index 45520c7..6a1877d 100644
+index 1e22ec98..60b7886c 100644
--- a/mt7915/mmio.c
+++ b/mt7915/mmio.c
-@@ -616,6 +616,8 @@ int mt7915_mmio_wed_init(struct mt7915_dev *dev, void *pdev_ptr,
+@@ -666,6 +666,8 @@ int mt7915_mmio_wed_init(struct mt7915_dev *dev, void *pdev_ptr,
wed->wlan.init_rx_buf = mt7915_wed_init_rx_buf;
wed->wlan.release_rx_buf = mt7915_wed_release_rx_buf;
@@ -262,10 +261,10 @@
if (mtk_wed_device_attach(wed))
return 0;
diff --git a/mt7915/mt7915.h b/mt7915/mt7915.h
-index 346571a..412f4f4 100644
+index acc345a2..55fe6343 100644
--- a/mt7915/mt7915.h
+++ b/mt7915/mt7915.h
-@@ -548,6 +548,7 @@ u32 mt7915_wed_init_buf(void *ptr, dma_addr_t phys, int token_id);
+@@ -563,6 +563,7 @@ u32 mt7915_wed_init_buf(void *ptr, dma_addr_t phys, int token_id);
u32 mt7915_wed_init_rx_buf(struct mtk_wed_device *wed,
int pkt_num);
void mt7915_wed_release_rx_buf(struct mtk_wed_device *wed);