[][MAC80211][mt76][Fix mt7915 testmode crash in cck modulation]
[Description]
Fix mt7915 testmode crash in cck modulation
Fix iwpriv wrapper ATETXMODE=0 not working due to removing leading zeros
inappropriately
[Release-log]
N/A
Change-Id: I58390e7405b650cb45279bf66dc5ce477c3ac3f6
Reviewed-on: https://gerrit.mediatek.inc/c/openwrt/feeds/mtk_openwrt_feeds/+/7074077
diff --git a/autobuild_mac80211_release/package/kernel/mt76/patches/1112-mt76-testmode-additional-supports.patch b/autobuild_mac80211_release/package/kernel/mt76/patches/1112-mt76-testmode-additional-supports.patch
index 7ea329f..1d9a4de 100644
--- a/autobuild_mac80211_release/package/kernel/mt76/patches/1112-mt76-testmode-additional-supports.patch
+++ b/autobuild_mac80211_release/package/kernel/mt76/patches/1112-mt76-testmode-additional-supports.patch
@@ -1,7 +1,7 @@
-From 152f71de255dfaf82baeecf1d554152bc2ef3db2 Mon Sep 17 00:00:00 2001
+From 852090bdc691d094e9ede04ea1e8b5931e35cdd9 Mon Sep 17 00:00:00 2001
From: Shayne Chen <shayne.chen@mediatek.com>
Date: Thu, 21 Apr 2022 15:43:19 +0800
-Subject: [PATCH 1112/1131] mt76: testmode: additional supports
+Subject: [PATCH] mt76: testmode: additional supports
Signed-off-by: Shayne Chen <shayne.chen@mediatek.com>
---
@@ -11,7 +11,7 @@
mt76_connac_mcu.c | 4 +
mt76_connac_mcu.h | 2 +
mt7915/init.c | 2 +-
- mt7915/mac.c | 37 +-
+ mt7915/mac.c | 39 +-
mt7915/main.c | 2 +-
mt7915/mcu.c | 10 +-
mt7915/mcu.h | 28 +-
@@ -24,13 +24,13 @@
testmode.h | 75 +++
tools/fields.c | 80 ++++
tx.c | 3 +-
- 19 files changed, 1963 insertions(+), 147 deletions(-)
+ 19 files changed, 1964 insertions(+), 148 deletions(-)
diff --git a/dma.c b/dma.c
-index fc24b35..dc8d888 100644
+index 9d1b928..f977b7f 100644
--- a/dma.c
+++ b/dma.c
-@@ -539,8 +539,7 @@ free:
+@@ -567,8 +567,7 @@ free:
if (mt76_is_testmode_skb(dev, skb, &hw)) {
struct mt76_phy *phy = hw->priv;
@@ -288,7 +288,7 @@
mt7915_init_txpower(dev, &dev->mphy.sband_2g.sband);
mt7915_init_txpower(dev, &dev->mphy.sband_5g.sband);
diff --git a/mt7915/mac.c b/mt7915/mac.c
-index fc7b790..0746e4b 100644
+index fc7b790..6ed6eb7 100644
--- a/mt7915/mac.c
+++ b/mt7915/mac.c
@@ -628,16 +628,38 @@ mt7915_mac_write_txwi_tm(struct mt7915_phy *phy, __le32 *txwi,
@@ -333,6 +333,15 @@
switch (td->tx_rate_mode) {
case MT76_TM_TX_MODE_HT:
+@@ -668,7 +690,7 @@ mt7915_mac_write_txwi_tm(struct mt7915_phy *phy, __le32 *txwi,
+ rate_idx += 4;
+
+ r = &phy->mt76->hw->wiphy->bands[band]->bitrates[rate_idx];
+- val = cck ? r->hw_value_short : r->hw_value;
++ val = r->hw_value;
+
+ mode = val >> 8;
+ rate_idx = val & 0xff;
@@ -727,13 +749,14 @@ mt7915_mac_write_txwi_tm(struct mt7915_phy *phy, __le32 *txwi,
if (mode >= MT_PHY_TYPE_HE_SU)
val |= FIELD_PREP(MT_TXD6_HELTF, td->tx_ltf);
@@ -2925,5 +2934,5 @@
wake_up(&dev->tx_wait);
--
-2.36.1
+2.18.0
diff --git a/feed/atenl/files/iwpriv.sh b/feed/atenl/files/iwpriv.sh
index a9b7fcc..fd25212 100755
--- a/feed/atenl/files/iwpriv.sh
+++ b/feed/atenl/files/iwpriv.sh
@@ -251,7 +251,7 @@
function convert_tx_mode() {
# Remove leading zeros
- local tx_mode=$(echo $1 | sed 's/^0*//')
+ local tx_mode=$(echo $1 | sed -r 's/0+([0-9]+)/\1/g')
if [ "$tx_mode" = "0" ]; then
echo "cck"