[rdkb][common][bsp][Refactor and sync wifi from openwrt]
[Description]
d5ae826 [MAC80211][mt76][Fix AP crash when a station connects to AP]
5ba8783 [MAC80211][misc][Add MT7996 external openwrt build]
9e48559 [MAC80211][mt76][move muru_onoff in mt7915_phy]
1477805 [mac80211][mt76][wifi: mt76: update tx statistics]
[Release-log]
Change-Id: I93284df17ea450cba0339fa97e46dd00c40f4d9b
diff --git a/recipes-wifi/linux-mt76/files/patches/1005-mt76-mt7915-certification-patches.patch b/recipes-wifi/linux-mt76/files/patches/1005-mt76-mt7915-certification-patches.patch
index 483bfab..1c216ec 100644
--- a/recipes-wifi/linux-mt76/files/patches/1005-mt76-mt7915-certification-patches.patch
+++ b/recipes-wifi/linux-mt76/files/patches/1005-mt76-mt7915-certification-patches.patch
@@ -1,4 +1,4 @@
-From d3944b59509bc65831997e973cf800f1e3f2b205 Mon Sep 17 00:00:00 2001
+From a3246b4d0ebb9b123c552f05226b0dc612c70788 Mon Sep 17 00:00:00 2001
From: MeiChia Chiu <meichia.chiu@mediatek.com>
Date: Mon, 6 Jun 2022 20:15:51 +0800
Subject: [PATCH 1005/1009] mt76: mt7915: certification patches
@@ -10,13 +10,13 @@
mt7915/mcu.c | 466 +++++++++++++++++++++++++++++++++++++++++++
mt7915/mcu.h | 207 ++++++++++++++++++-
mt7915/mt7915.h | 13 ++
- mt7915/mtk_debugfs.c | 7 +-
+ mt7915/mtk_debugfs.c | 25 +--
mt7915/vendor.c | 187 +++++++++++++++++
mt7915/vendor.h | 42 ++++
- 9 files changed, 956 insertions(+), 5 deletions(-)
+ 9 files changed, 965 insertions(+), 14 deletions(-)
diff --git a/mt76_connac_mcu.h b/mt76_connac_mcu.h
-index 60161c9e..ff114cb9 100644
+index 60161c9..ff114cb 100644
--- a/mt76_connac_mcu.h
+++ b/mt76_connac_mcu.h
@@ -1199,6 +1199,7 @@ enum {
@@ -28,7 +28,7 @@
};
diff --git a/mt7915/mac.c b/mt7915/mac.c
-index 547519cc..599d328d 100644
+index 547519c..599d328 100644
--- a/mt7915/mac.c
+++ b/mt7915/mac.c
@@ -8,6 +8,7 @@
@@ -76,7 +76,7 @@
IEEE80211_RC_NSS_CHANGED |
IEEE80211_RC_BW_CHANGED))
diff --git a/mt7915/main.c b/mt7915/main.c
-index 3ded65de..e4d1c27b 100644
+index 3ded65d..05a5fbc 100644
--- a/mt7915/main.c
+++ b/mt7915/main.c
@@ -678,6 +678,9 @@ int mt7915_mac_sta_add(struct mt76_dev *mdev, struct ieee80211_vif *vif,
@@ -84,12 +84,12 @@
struct mt7915_vif *mvif = (struct mt7915_vif *)vif->drv_priv;
bool ext_phy = mvif->phy != &dev->phy;
+#ifdef CONFIG_MTK_VENDOR
-+ struct mt7915_phy *phy;
++ struct mt7915_phy *phy = ext_phy ? mt7915_ext_phy(dev) : &dev->phy;
+#endif
int ret, idx;
idx = mt76_wcid_alloc(dev->mt76.wcid_mask, MT7915_WTBL_STA);
-@@ -705,7 +708,17 @@ int mt7915_mac_sta_add(struct mt76_dev *mdev, struct ieee80211_vif *vif,
+@@ -705,7 +708,15 @@ int mt7915_mac_sta_add(struct mt76_dev *mdev, struct ieee80211_vif *vif,
#ifdef CONFIG_MTK_VENDOR
mt7915_vendor_amnt_sta_remove(mvif->phy, sta);
#endif
@@ -99,20 +99,18 @@
+ return ret;
+
+#ifdef CONFIG_MTK_VENDOR
-+ if (dev->dbg.muru_onoff & MUMIMO_DL_CERT) {
-+ phy = mvif->mt76.band_idx ? mt7915_ext_phy(dev) : &dev->phy;
++ if (phy->muru_onoff & MUMIMO_DL_CERT)
+ mt7915_mcu_set_mimo(phy, 0);
-+ }
+#endif
+ return 0;
}
void mt7915_mac_sta_remove(struct mt76_dev *mdev, struct ieee80211_vif *vif,
diff --git a/mt7915/mcu.c b/mt7915/mcu.c
-index a46b714d..40b17b5f 100644
+index cf9a3e2..c15dce3 100644
--- a/mt7915/mcu.c
+++ b/mt7915/mcu.c
-@@ -3938,6 +3938,472 @@ mt7915_mcu_report_csi(struct mt7915_dev *dev, struct sk_buff *skb)
+@@ -3939,6 +3939,472 @@ mt7915_mcu_report_csi(struct mt7915_dev *dev, struct sk_buff *skb)
return 0;
}
@@ -120,7 +118,7 @@
+{
+ u8 mode, val;
+ struct mt7915_vif *mvif = (struct mt7915_vif *)vif->drv_priv;
-+ struct mt7915_dev *dev = mvif->phy->dev;
++ struct mt7915_phy *phy = mvif->phy;
+
+ mode = FIELD_GET(RATE_CFG_MODE, *((u32 *)data));
+ val = FIELD_GET(RATE_CFG_VAL, *((u32 *)data));
@@ -128,13 +126,13 @@
+ switch (mode) {
+ case RATE_PARAM_FIXED_OFDMA:
+ if (val == 3) /* DL 20 and 80 */
-+ dev->dbg.muru_onoff = OFDMA_DL; /* Enable OFDMA DL only */
++ phy->muru_onoff = OFDMA_DL; /* Enable OFDMA DL only */
+ else
-+ dev->dbg.muru_onoff = val;
++ phy->muru_onoff = val;
+ break;
+ case RATE_PARAM_FIXED_MIMO:
+ if (val == 0)
-+ dev->dbg.muru_onoff = MUMIMO_DL_CERT | MUMIMO_DL;
++ phy->muru_onoff = MUMIMO_DL_CERT | MUMIMO_DL;
+ break;
+ }
+}
@@ -586,7 +584,7 @@
#ifdef MTK_DEBUG
diff --git a/mt7915/mcu.h b/mt7915/mcu.h
-index 275a0ece..714bc44d 100644
+index 275a0ec..714bc44 100644
--- a/mt7915/mcu.h
+++ b/mt7915/mcu.h
@@ -416,10 +416,14 @@ enum {
@@ -820,10 +818,10 @@
#endif
diff --git a/mt7915/mt7915.h b/mt7915/mt7915.h
-index 9a9d7f55..018fd23e 100644
+index e94970b..8b292c3 100644
--- a/mt7915/mt7915.h
+++ b/mt7915/mt7915.h
-@@ -721,6 +721,19 @@ int mt7915_mmio_wed_init(struct mt7915_dev *dev, void *pdev_ptr,
+@@ -722,6 +722,19 @@ int mt7915_mmio_wed_init(struct mt7915_dev *dev, void *pdev_ptr,
bool pci, int *irq);
#ifdef CONFIG_MTK_VENDOR
@@ -844,32 +842,32 @@
int mt7915_mcu_set_csi(struct mt7915_phy *phy, u8 mode,
u8 cfg, u8 v1, u32 v2, u8 *mac_addr);
diff --git a/mt7915/mtk_debugfs.c b/mt7915/mtk_debugfs.c
-index 1aafe040..f8d2cbbb 100644
+index 1aafe04..e0af645 100644
--- a/mt7915/mtk_debugfs.c
+++ b/mt7915/mtk_debugfs.c
-@@ -2564,7 +2564,8 @@ static int mt7915_muru_onoff_get(void *data, u64 *val)
+@@ -2564,7 +2564,8 @@ static int mt7915_muru_onoff_get(void *d
- *val = dev->dbg.muru_onoff;
+ *val = phy->muru_onoff;
-- printk("mumimo ul:%d, mumimo dl:%d, ofdma ul:%d, ofdma dl:%d\n",
-+ printk("cert mumimo dl:%d, mumimo ul:%d, mumimo dl:%d, ofdma ul:%d, ofdma dl:%d\n",
-+ !!(dev->dbg.muru_onoff & MUMIMO_DL_CERT),
- !!(dev->dbg.muru_onoff & MUMIMO_UL),
- !!(dev->dbg.muru_onoff & MUMIMO_DL),
- !!(dev->dbg.muru_onoff & OFDMA_UL),
-@@ -2577,8 +2578,8 @@ static int mt7915_muru_onoff_set(void *data, u64 val)
+- printk("mumimo ul:%d, mumimo dl:%d, ofdma ul:%d, ofdma dl:%d\n",
++ printk("cert mumimo dl:%d, normal mumimo ul:%d, mumimo dl:%d, ofdma ul:%d, ofdma dl:%d\n",
++ !!(phy->muru_onoff & MUMIMO_DL_CERT),
+ !!(phy->muru_onoff & MUMIMO_UL),
+ !!(phy->muru_onoff & MUMIMO_DL),
+ !!(phy->muru_onoff & OFDMA_UL),
+@@ -2577,8 +2578,8 @@ static int mt7915_muru_onoff_set(void *d
{
- struct mt7915_dev *dev = data;
+ struct mt7915_phy *phy = data;
-- if (val > 15) {
-- printk("Wrong value! The value is between 0 ~ 15.\n");
-+ if (val > 31) {
-+ printk("Wrong value! The value is between 0 ~ 31.\n");
- goto exit;
- }
+- if (val > 15) {
+- printk("Wrong value! The value is between 0 ~ 15.\n");
++ if (val > 31) {
++ printk("Wrong value! The value is between 0 ~ 31.\n");
+ goto exit;
+ }
diff --git a/mt7915/vendor.c b/mt7915/vendor.c
-index b94d787e..7456c577 100644
+index b94d787..beb0583 100644
--- a/mt7915/vendor.c
+++ b/mt7915/vendor.c
@@ -22,6 +22,29 @@ csi_ctrl_policy[NUM_MTK_VENDOR_ATTRS_CSI_CTRL] = {
@@ -1029,7 +1027,7 @@
+ mt7915_mcu_set_ppdu_tx_type(phy, val8);
+ } else if (tb[MTK_VENDOR_ATTR_WIRELESS_CTRL_NUSERS_OFDMA]) {
+ val8 = nla_get_u8(tb[MTK_VENDOR_ATTR_WIRELESS_CTRL_NUSERS_OFDMA]);
-+ if (FIELD_GET(OFDMA_UL, dev->dbg.muru_onoff) == 1)
++ if (FIELD_GET(OFDMA_UL, phy->muru_onoff) == 1)
+ mt7915_mcu_set_nusers_ofdma(phy, MURU_UL_USER_CNT, val8);
+ else
+ mt7915_mcu_set_nusers_ofdma(phy, MURU_DL_USER_CNT, val8);
@@ -1081,7 +1079,7 @@
};
diff --git a/mt7915/vendor.h b/mt7915/vendor.h
-index 976817f3..1b08321c 100644
+index 976817f..1b08321 100644
--- a/mt7915/vendor.h
+++ b/mt7915/vendor.h
@@ -6,6 +6,48 @@
@@ -1134,5 +1132,5 @@
enum mtk_vendor_attr_csi_ctrl {
--
-2.18.0
+2.39.0