[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-3.x/1116-mt76-testmode-add-iBF-eBF-cal-and-cert-commands-with.patch b/recipes-wifi/linux-mt76/files/patches-3.x/1116-mt76-testmode-add-iBF-eBF-cal-and-cert-commands-with.patch
index 47f5fac..264bb50 100644
--- a/recipes-wifi/linux-mt76/files/patches-3.x/1116-mt76-testmode-add-iBF-eBF-cal-and-cert-commands-with.patch
+++ b/recipes-wifi/linux-mt76/files/patches-3.x/1116-mt76-testmode-add-iBF-eBF-cal-and-cert-commands-with.patch
@@ -1,8 +1,7 @@
-From 315b1e8f38eac8bfd96b7dc3e34ac48400267446 Mon Sep 17 00:00:00 2001
+From acc136bc397c9417ca42de7642ede1c35745dae3 Mon Sep 17 00:00:00 2001
From: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
Date: Thu, 15 Dec 2022 19:45:18 +0800
-Subject: [PATCH 1116/1131] mt76: testmode: add iBF/eBF cal and cert commands
- with golden
+Subject: [PATCH] mt76: testmode: add iBF/eBF cal and cert commands with golden
Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
---
@@ -17,12 +16,12 @@
mt7915/mtk_debugfs.c | 35 ++++
mt7915/mtk_mcu.c | 246 ++++++++++++++++++++++-
mt7915/regs.h | 4 +
- mt7915/testmode.c | 458 ++++++++++++++++++++++++++++---------------
+ mt7915/testmode.c | 460 ++++++++++++++++++++++++++++---------------
mt7915/testmode.h | 134 +------------
testmode.c | 1 +
testmode.h | 9 +
tools/fields.c | 9 +
- 16 files changed, 855 insertions(+), 323 deletions(-)
+ 16 files changed, 856 insertions(+), 324 deletions(-)
diff --git a/mt76.h b/mt76.h
index 2bacc1b..c6aefbf 100644
@@ -858,7 +857,7 @@
#define MT_WF_RMAC_BASE(_band) ((_band) ? 0x820f5000 : 0x820e5000)
#define MT_WF_RMAC(_band, ofs) (MT_WF_RMAC_BASE(_band) + (ofs))
diff --git a/mt7915/testmode.c b/mt7915/testmode.c
-index 2ae6c07..70382b9 100644
+index 2ae6c07..e4af5e1 100644
--- a/mt7915/testmode.c
+++ b/mt7915/testmode.c
@@ -53,6 +53,8 @@ struct reg_band {
@@ -932,8 +931,8 @@
- ndp_rate = 16;
- else
- ndp_rate = 24;
-+ /* TODO: check 160Hz */
-+ bf_bw = mt7915_tm_chan_bw(phy->mt76->chandef.width);
++ /* BF use CMD_CBW instead of TM_CBW */
++ bf_bw = mt76_connac_chan_bw(&phy->mt76->chandef);
skb = mt76_connac_mcu_alloc_sta_req(&dev->mt76, &mvif->mt76,
&msta->wcid);
@@ -994,8 +993,8 @@
{
+#define EBF_BBP_RX_OFFSET 0x10280
+#define EBF_BBP_RX_ENABLE (BIT(0) | BIT(15))
-+#define WF1 BIT(1)
-+#define WF2 BIT(2)
++#define WF1 1
++#define WF2 2
struct mt76_testmode_data *td = &phy->mt76->test;
struct mt7915_dev *dev = phy->dev;
+ struct mt76_phy *mphy = phy->mt76;
@@ -1064,7 +1063,7 @@
+ mt7915_init_vif(phy, td->second_vif, td->bf_en);
+
+ if (td->ebf && !td->is_txbf_dut) {
-+ bool is_160hz = val[1];
++ u8 is_160hz = val[1];
+
+ /* Turn On BBP CR for RX */
+ mt76_set(dev, EBF_BBP_RX_OFFSET, EBF_BBP_RX_ENABLE);
@@ -1074,7 +1073,7 @@
+ td->tx_antenna_mask = 1;
+ if (is_mt7915(&dev->mt76)) {
+ /* Add WF1/WF2 for dbdc/single band in BW 160 */
-+ td->tx_antenna_mask |= is_160hz & (dev->dbdc_support ? WF1 : WF2);
++ td->tx_antenna_mask |= is_160hz << (dev->dbdc_support ? WF1 : WF2);
+ /* Shift to WF2/WF3 for dbdc band 1 */
+ td->tx_antenna_mask <<= 2 * phy->mt76->band_idx;
+ }
@@ -1185,7 +1184,7 @@
- rate.type = MT_PHY_TYPE_HT;
- rate.bw = mt7915_tm_chan_bw(phy->mt76->chandef.width);
+ rate.type = mt7915_tm_rate_to_phy(td->tx_rate_mode);
-+ rate.bw = mt7915_tm_chan_bw(phy->mt76->chandef.width); /* TODO: check 160Hz */
++ rate.bw = mt76_connac_chan_bw(&phy->mt76->chandef);
rate.nss = ed->tx_rate_nss;
rate.mcs = ed->tx_rate_idx;
rate.ldpc = (rate.bw || ed->tx_rate_ldpc) * GENMASK(2, 0);
@@ -1233,7 +1232,7 @@
u8 pfmu_idx = val[0], nc = val[2], nr;
bool is_atenl = val[6];
int ret;
-@@ -729,11 +821,15 @@ mt7915_tm_txbf_profile_update(struct mt7915_phy *phy, u16 *val, bool ebf)
+@@ -729,18 +821,22 @@ mt7915_tm_txbf_profile_update(struct mt7915_phy *phy, u16 *val, bool ebf)
tag->t1.nr = nr;
tag->t1.nc = nc;
tag->t1.invalid_prof = true;
@@ -1242,7 +1241,7 @@
- tag->t1.snr_sts5 = 0xff;
- tag->t1.snr_sts6 = 0xff;
- tag->t1.snr_sts7 = 0xff;
-+ tag->t1.data_bw = mt7915_tm_chan_bw(phy->mt76->chandef.width); /* TODO: check 160Hz */
++ tag->t1.data_bw = mt76_connac_chan_bw(&phy->mt76->chandef);
+ tag->t2.se_idx = td->tx_spe_idx;
+
+ if (is_atenl) {
@@ -1254,6 +1253,14 @@
if (ebf) {
tag->t1.row_id1 = 0;
+ tag->t1.row_id2 = 1;
+ tag->t1.row_id3 = 2;
+ tag->t1.row_id4 = 3;
+- tag->t1.lm = mode_to_lm[MT76_TM_TX_MODE_HT];
++ tag->t1.lm = mode_to_lm[td->tx_rate_mode];
+ } else {
+ tag->t1.row_id1 = 4;
+ tag->t1.row_id2 = 5;
@@ -761,6 +857,19 @@ mt7915_tm_txbf_profile_update(struct mt7915_phy *phy, u16 *val, bool ebf)
if (ret)
return ret;
@@ -1905,5 +1912,5 @@
static const char * const testmode_offchan_bw[] = {
--
-2.36.1
+2.18.0
diff --git a/recipes-wifi/linux-mt76/files/patches/1116-mt76-testmode-add-iBF-eBF-cal-and-cert-commands-with.patch b/recipes-wifi/linux-mt76/files/patches/1116-mt76-testmode-add-iBF-eBF-cal-and-cert-commands-with.patch
index 47f5fac..264bb50 100644
--- a/recipes-wifi/linux-mt76/files/patches/1116-mt76-testmode-add-iBF-eBF-cal-and-cert-commands-with.patch
+++ b/recipes-wifi/linux-mt76/files/patches/1116-mt76-testmode-add-iBF-eBF-cal-and-cert-commands-with.patch
@@ -1,8 +1,7 @@
-From 315b1e8f38eac8bfd96b7dc3e34ac48400267446 Mon Sep 17 00:00:00 2001
+From acc136bc397c9417ca42de7642ede1c35745dae3 Mon Sep 17 00:00:00 2001
From: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
Date: Thu, 15 Dec 2022 19:45:18 +0800
-Subject: [PATCH 1116/1131] mt76: testmode: add iBF/eBF cal and cert commands
- with golden
+Subject: [PATCH] mt76: testmode: add iBF/eBF cal and cert commands with golden
Signed-off-by: StanleyYP Wang <StanleyYP.Wang@mediatek.com>
---
@@ -17,12 +16,12 @@
mt7915/mtk_debugfs.c | 35 ++++
mt7915/mtk_mcu.c | 246 ++++++++++++++++++++++-
mt7915/regs.h | 4 +
- mt7915/testmode.c | 458 ++++++++++++++++++++++++++++---------------
+ mt7915/testmode.c | 460 ++++++++++++++++++++++++++++---------------
mt7915/testmode.h | 134 +------------
testmode.c | 1 +
testmode.h | 9 +
tools/fields.c | 9 +
- 16 files changed, 855 insertions(+), 323 deletions(-)
+ 16 files changed, 856 insertions(+), 324 deletions(-)
diff --git a/mt76.h b/mt76.h
index 2bacc1b..c6aefbf 100644
@@ -858,7 +857,7 @@
#define MT_WF_RMAC_BASE(_band) ((_band) ? 0x820f5000 : 0x820e5000)
#define MT_WF_RMAC(_band, ofs) (MT_WF_RMAC_BASE(_band) + (ofs))
diff --git a/mt7915/testmode.c b/mt7915/testmode.c
-index 2ae6c07..70382b9 100644
+index 2ae6c07..e4af5e1 100644
--- a/mt7915/testmode.c
+++ b/mt7915/testmode.c
@@ -53,6 +53,8 @@ struct reg_band {
@@ -932,8 +931,8 @@
- ndp_rate = 16;
- else
- ndp_rate = 24;
-+ /* TODO: check 160Hz */
-+ bf_bw = mt7915_tm_chan_bw(phy->mt76->chandef.width);
++ /* BF use CMD_CBW instead of TM_CBW */
++ bf_bw = mt76_connac_chan_bw(&phy->mt76->chandef);
skb = mt76_connac_mcu_alloc_sta_req(&dev->mt76, &mvif->mt76,
&msta->wcid);
@@ -994,8 +993,8 @@
{
+#define EBF_BBP_RX_OFFSET 0x10280
+#define EBF_BBP_RX_ENABLE (BIT(0) | BIT(15))
-+#define WF1 BIT(1)
-+#define WF2 BIT(2)
++#define WF1 1
++#define WF2 2
struct mt76_testmode_data *td = &phy->mt76->test;
struct mt7915_dev *dev = phy->dev;
+ struct mt76_phy *mphy = phy->mt76;
@@ -1064,7 +1063,7 @@
+ mt7915_init_vif(phy, td->second_vif, td->bf_en);
+
+ if (td->ebf && !td->is_txbf_dut) {
-+ bool is_160hz = val[1];
++ u8 is_160hz = val[1];
+
+ /* Turn On BBP CR for RX */
+ mt76_set(dev, EBF_BBP_RX_OFFSET, EBF_BBP_RX_ENABLE);
@@ -1074,7 +1073,7 @@
+ td->tx_antenna_mask = 1;
+ if (is_mt7915(&dev->mt76)) {
+ /* Add WF1/WF2 for dbdc/single band in BW 160 */
-+ td->tx_antenna_mask |= is_160hz & (dev->dbdc_support ? WF1 : WF2);
++ td->tx_antenna_mask |= is_160hz << (dev->dbdc_support ? WF1 : WF2);
+ /* Shift to WF2/WF3 for dbdc band 1 */
+ td->tx_antenna_mask <<= 2 * phy->mt76->band_idx;
+ }
@@ -1185,7 +1184,7 @@
- rate.type = MT_PHY_TYPE_HT;
- rate.bw = mt7915_tm_chan_bw(phy->mt76->chandef.width);
+ rate.type = mt7915_tm_rate_to_phy(td->tx_rate_mode);
-+ rate.bw = mt7915_tm_chan_bw(phy->mt76->chandef.width); /* TODO: check 160Hz */
++ rate.bw = mt76_connac_chan_bw(&phy->mt76->chandef);
rate.nss = ed->tx_rate_nss;
rate.mcs = ed->tx_rate_idx;
rate.ldpc = (rate.bw || ed->tx_rate_ldpc) * GENMASK(2, 0);
@@ -1233,7 +1232,7 @@
u8 pfmu_idx = val[0], nc = val[2], nr;
bool is_atenl = val[6];
int ret;
-@@ -729,11 +821,15 @@ mt7915_tm_txbf_profile_update(struct mt7915_phy *phy, u16 *val, bool ebf)
+@@ -729,18 +821,22 @@ mt7915_tm_txbf_profile_update(struct mt7915_phy *phy, u16 *val, bool ebf)
tag->t1.nr = nr;
tag->t1.nc = nc;
tag->t1.invalid_prof = true;
@@ -1242,7 +1241,7 @@
- tag->t1.snr_sts5 = 0xff;
- tag->t1.snr_sts6 = 0xff;
- tag->t1.snr_sts7 = 0xff;
-+ tag->t1.data_bw = mt7915_tm_chan_bw(phy->mt76->chandef.width); /* TODO: check 160Hz */
++ tag->t1.data_bw = mt76_connac_chan_bw(&phy->mt76->chandef);
+ tag->t2.se_idx = td->tx_spe_idx;
+
+ if (is_atenl) {
@@ -1254,6 +1253,14 @@
if (ebf) {
tag->t1.row_id1 = 0;
+ tag->t1.row_id2 = 1;
+ tag->t1.row_id3 = 2;
+ tag->t1.row_id4 = 3;
+- tag->t1.lm = mode_to_lm[MT76_TM_TX_MODE_HT];
++ tag->t1.lm = mode_to_lm[td->tx_rate_mode];
+ } else {
+ tag->t1.row_id1 = 4;
+ tag->t1.row_id2 = 5;
@@ -761,6 +857,19 @@ mt7915_tm_txbf_profile_update(struct mt7915_phy *phy, u16 *val, bool ebf)
if (ret)
return ret;
@@ -1905,5 +1912,5 @@
static const char * const testmode_offchan_bw[] = {
--
-2.36.1
+2.18.0