linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/8] wifi: rtw88: Prepare to support RTL8814AU (part 2/2)
@ 2025-02-11 22:21 Bitterblue Smith
  2025-02-11 22:22 ` [PATCH 1/8] wifi: rtw88: Fix rtw_mac_power_switch() for RTL8814AU Bitterblue Smith
                   ` (7 more replies)
  0 siblings, 8 replies; 20+ messages in thread
From: Bitterblue Smith @ 2025-02-11 22:21 UTC (permalink / raw)
  To: linux-wireless@vger.kernel.org; +Cc: Ping-Ke Shih

A few more changes for RTL8814AU. Fix power on/off, the HT/VHT
capabilities advertised to mac80211, RX statistics, TX power tracking
stuff, debugfs stuff.

Part 1 was here:
https://lore.kernel.org/all/9fc518ae-7708-42c6-99ca-56ee307555b6@gmail.com/

Part 3 will be mostly the new files for RTL8814AU.

Part 4 will improve performance.

Bitterblue Smith (8):
  wifi: rtw88: Fix rtw_mac_power_switch() for RTL8814AU
  wifi: rtw88: Fix rtw_desc_to_mcsrate() to handle MCS16-31
  wifi: rtw88: Fix rtw_init_ht_cap() for RTL8814AU
  wifi: rtw88: Fix rtw_init_vht_cap() for RTL8814AU
  wifi: rtw88: Fix rtw_rx_phy_stat() for RTL8814AU
  wifi: rtw88: Extend rtw_phy_config_swing_table() for RTL8814AU
  wifi: rtw88: Extend rtw_debugfs_get_phy_info() for RTL8814AU
  wifi: rtw88: Extend rtw_debugfs_get_tx_pwr_tbl() for RTL8814AU

 drivers/net/wireless/realtek/rtw88/debug.c | 47 +++++++++++++---------
 drivers/net/wireless/realtek/rtw88/mac.c   |  3 +-
 drivers/net/wireless/realtek/rtw88/main.c  | 40 +++++++-----------
 drivers/net/wireless/realtek/rtw88/main.h  |  7 ++++
 drivers/net/wireless/realtek/rtw88/phy.c   | 24 +++++++++++
 drivers/net/wireless/realtek/rtw88/rx.c    |  6 +++
 drivers/net/wireless/realtek/rtw88/util.c  |  2 +-
 7 files changed, 83 insertions(+), 46 deletions(-)

-- 
2.48.1


^ permalink raw reply	[flat|nested] 20+ messages in thread

* [PATCH 1/8] wifi: rtw88: Fix rtw_mac_power_switch() for RTL8814AU
  2025-02-11 22:21 [PATCH 0/8] wifi: rtw88: Prepare to support RTL8814AU (part 2/2) Bitterblue Smith
@ 2025-02-11 22:22 ` Bitterblue Smith
  2025-02-13  7:29   ` Ping-Ke Shih
  2025-02-11 22:22 ` [PATCH 2/8] wifi: rtw88: Fix rtw_desc_to_mcsrate() to handle MCS16-31 Bitterblue Smith
                   ` (6 subsequent siblings)
  7 siblings, 1 reply; 20+ messages in thread
From: Bitterblue Smith @ 2025-02-11 22:22 UTC (permalink / raw)
  To: linux-wireless@vger.kernel.org; +Cc: Ping-Ke Shih

rtw_mac_power_switch() checks bit 8 of REG_SYS_STATUS1 to see if the
chip is powered on. This bit appears to be always on in the RTL8814AU,
so ignore it.

Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
---
 drivers/net/wireless/realtek/rtw88/mac.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/realtek/rtw88/mac.c b/drivers/net/wireless/realtek/rtw88/mac.c
index 63edf6461de8..5de16c75adf2 100644
--- a/drivers/net/wireless/realtek/rtw88/mac.c
+++ b/drivers/net/wireless/realtek/rtw88/mac.c
@@ -291,7 +291,8 @@ static int rtw_mac_power_switch(struct rtw_dev *rtwdev, bool pwr_on)
 	if (rtw_read8(rtwdev, REG_CR) == 0xea)
 		cur_pwr = false;
 	else if (rtw_hci_type(rtwdev) == RTW_HCI_TYPE_USB &&
-		 (rtw_read8(rtwdev, REG_SYS_STATUS1 + 1) & BIT(0)))
+		   chip->id != RTW_CHIP_TYPE_8814A &&
+		   (rtw_read8(rtwdev, REG_SYS_STATUS1 + 1) & BIT(0)))
 		cur_pwr = false;
 	else
 		cur_pwr = true;
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH 2/8] wifi: rtw88: Fix rtw_desc_to_mcsrate() to handle MCS16-31
  2025-02-11 22:21 [PATCH 0/8] wifi: rtw88: Prepare to support RTL8814AU (part 2/2) Bitterblue Smith
  2025-02-11 22:22 ` [PATCH 1/8] wifi: rtw88: Fix rtw_mac_power_switch() for RTL8814AU Bitterblue Smith
@ 2025-02-11 22:22 ` Bitterblue Smith
  2025-02-13  7:30   ` Ping-Ke Shih
  2025-02-11 22:23 ` [PATCH 3/8] wifi: rtw88: Fix rtw_init_ht_cap() for RTL8814AU Bitterblue Smith
                   ` (5 subsequent siblings)
  7 siblings, 1 reply; 20+ messages in thread
From: Bitterblue Smith @ 2025-02-11 22:22 UTC (permalink / raw)
  To: linux-wireless@vger.kernel.org; +Cc: Ping-Ke Shih

This function translates the rate number reported by the hardware into
something mac80211 can understand. It was ignoring the 3SS and 4SS HT
rates.

Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
---
 drivers/net/wireless/realtek/rtw88/util.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/realtek/rtw88/util.c b/drivers/net/wireless/realtek/rtw88/util.c
index e222d3c01a77..ba02ba72e104 100644
--- a/drivers/net/wireless/realtek/rtw88/util.c
+++ b/drivers/net/wireless/realtek/rtw88/util.c
@@ -101,7 +101,7 @@ void rtw_desc_to_mcsrate(u16 rate, u8 *mcs, u8 *nss)
 		*nss = 4;
 		*mcs = rate - DESC_RATEVHT4SS_MCS0;
 	} else if (rate >= DESC_RATEMCS0 &&
-		   rate <= DESC_RATEMCS15) {
+		   rate <= DESC_RATEMCS31) {
 		*mcs = rate - DESC_RATEMCS0;
 	}
 }
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH 3/8] wifi: rtw88: Fix rtw_init_ht_cap() for RTL8814AU
  2025-02-11 22:21 [PATCH 0/8] wifi: rtw88: Prepare to support RTL8814AU (part 2/2) Bitterblue Smith
  2025-02-11 22:22 ` [PATCH 1/8] wifi: rtw88: Fix rtw_mac_power_switch() for RTL8814AU Bitterblue Smith
  2025-02-11 22:22 ` [PATCH 2/8] wifi: rtw88: Fix rtw_desc_to_mcsrate() to handle MCS16-31 Bitterblue Smith
@ 2025-02-11 22:23 ` Bitterblue Smith
  2025-02-13  7:35   ` Ping-Ke Shih
  2025-02-11 22:23 ` [PATCH 4/8] wifi: rtw88: Fix rtw_init_vht_cap() " Bitterblue Smith
                   ` (4 subsequent siblings)
  7 siblings, 1 reply; 20+ messages in thread
From: Bitterblue Smith @ 2025-02-11 22:23 UTC (permalink / raw)
  To: linux-wireless@vger.kernel.org; +Cc: Ping-Ke Shih

Set the RX mask and the highest RX rate according to the number of
spatial streams the chip can receive. For RTL8814AU that is 3.

Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
---
 drivers/net/wireless/realtek/rtw88/main.c | 17 ++++++-----------
 1 file changed, 6 insertions(+), 11 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtw88/main.c b/drivers/net/wireless/realtek/rtw88/main.c
index e4f9b744f24d..3319bb5044c3 100644
--- a/drivers/net/wireless/realtek/rtw88/main.c
+++ b/drivers/net/wireless/realtek/rtw88/main.c
@@ -1565,6 +1565,7 @@ static void rtw_init_ht_cap(struct rtw_dev *rtwdev,
 {
 	const struct rtw_chip_info *chip = rtwdev->chip;
 	struct rtw_efuse *efuse = &rtwdev->efuse;
+	int i;
 
 	ht_cap->ht_supported = true;
 	ht_cap->cap = 0;
@@ -1584,17 +1585,11 @@ static void rtw_init_ht_cap(struct rtw_dev *rtwdev,
 	ht_cap->ampdu_factor = IEEE80211_HT_MAX_AMPDU_64K;
 	ht_cap->ampdu_density = chip->ampdu_density;
 	ht_cap->mcs.tx_params = IEEE80211_HT_MCS_TX_DEFINED;
-	if (efuse->hw_cap.nss > 1) {
-		ht_cap->mcs.rx_mask[0] = 0xFF;
-		ht_cap->mcs.rx_mask[1] = 0xFF;
-		ht_cap->mcs.rx_mask[4] = 0x01;
-		ht_cap->mcs.rx_highest = cpu_to_le16(300);
-	} else {
-		ht_cap->mcs.rx_mask[0] = 0xFF;
-		ht_cap->mcs.rx_mask[1] = 0x00;
-		ht_cap->mcs.rx_mask[4] = 0x01;
-		ht_cap->mcs.rx_highest = cpu_to_le16(150);
-	}
+
+	for (i = 0; i < efuse->hw_cap.nss; i++)
+		ht_cap->mcs.rx_mask[i] = 0xFF;
+	ht_cap->mcs.rx_mask[4] = 0x01;
+	ht_cap->mcs.rx_highest = cpu_to_le16(150 * efuse->hw_cap.nss);
 }
 
 static void rtw_init_vht_cap(struct rtw_dev *rtwdev,
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH 4/8] wifi: rtw88: Fix rtw_init_vht_cap() for RTL8814AU
  2025-02-11 22:21 [PATCH 0/8] wifi: rtw88: Prepare to support RTL8814AU (part 2/2) Bitterblue Smith
                   ` (2 preceding siblings ...)
  2025-02-11 22:23 ` [PATCH 3/8] wifi: rtw88: Fix rtw_init_ht_cap() for RTL8814AU Bitterblue Smith
@ 2025-02-11 22:23 ` Bitterblue Smith
  2025-02-13  7:39   ` Ping-Ke Shih
  2025-02-11 22:24 ` [PATCH 5/8] wifi: rtw88: Fix rtw_rx_phy_stat() " Bitterblue Smith
                   ` (3 subsequent siblings)
  7 siblings, 1 reply; 20+ messages in thread
From: Bitterblue Smith @ 2025-02-11 22:23 UTC (permalink / raw)
  To: linux-wireless@vger.kernel.org; +Cc: Ping-Ke Shih

Set the MCS maps and the highest rates according to the number of
spatial streams the chip has. For RTL8814AU that is 3.

Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
---
 drivers/net/wireless/realtek/rtw88/main.c | 23 +++++++++--------------
 1 file changed, 9 insertions(+), 14 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtw88/main.c b/drivers/net/wireless/realtek/rtw88/main.c
index 3319bb5044c3..959f56a3cc1a 100644
--- a/drivers/net/wireless/realtek/rtw88/main.c
+++ b/drivers/net/wireless/realtek/rtw88/main.c
@@ -1596,8 +1596,9 @@ static void rtw_init_vht_cap(struct rtw_dev *rtwdev,
 			     struct ieee80211_sta_vht_cap *vht_cap)
 {
 	struct rtw_efuse *efuse = &rtwdev->efuse;
-	u16 mcs_map;
+	u16 mcs_map = 0;
 	__le16 highest;
+	int i;
 
 	if (efuse->hw_cap.ptcl != EFUSE_HW_CAP_IGNORE &&
 	    efuse->hw_cap.ptcl != EFUSE_HW_CAP_PTCL_VHT)
@@ -1620,21 +1621,15 @@ static void rtw_init_vht_cap(struct rtw_dev *rtwdev,
 	if (rtw_chip_has_rx_ldpc(rtwdev))
 		vht_cap->cap |= IEEE80211_VHT_CAP_RXLDPC;
 
-	mcs_map = IEEE80211_VHT_MCS_SUPPORT_0_9 << 0 |
-		  IEEE80211_VHT_MCS_NOT_SUPPORTED << 4 |
-		  IEEE80211_VHT_MCS_NOT_SUPPORTED << 6 |
-		  IEEE80211_VHT_MCS_NOT_SUPPORTED << 8 |
-		  IEEE80211_VHT_MCS_NOT_SUPPORTED << 10 |
-		  IEEE80211_VHT_MCS_NOT_SUPPORTED << 12 |
-		  IEEE80211_VHT_MCS_NOT_SUPPORTED << 14;
-	if (efuse->hw_cap.nss > 1) {
-		highest = cpu_to_le16(780);
-		mcs_map |= IEEE80211_VHT_MCS_SUPPORT_0_9 << 2;
-	} else {
-		highest = cpu_to_le16(390);
-		mcs_map |= IEEE80211_VHT_MCS_NOT_SUPPORTED << 2;
+	for (i = 0; i < 8; i++) {
+		if (i < efuse->hw_cap.nss)
+			mcs_map |= IEEE80211_VHT_MCS_SUPPORT_0_9 << (i * 2);
+		else
+			mcs_map |= IEEE80211_VHT_MCS_NOT_SUPPORTED << (i * 2);
 	}
 
+	highest = cpu_to_le16(390 * efuse->hw_cap.nss);
+
 	vht_cap->vht_mcs.rx_mcs_map = cpu_to_le16(mcs_map);
 	vht_cap->vht_mcs.tx_mcs_map = cpu_to_le16(mcs_map);
 	vht_cap->vht_mcs.rx_highest = highest;
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH 5/8] wifi: rtw88: Fix rtw_rx_phy_stat() for RTL8814AU
  2025-02-11 22:21 [PATCH 0/8] wifi: rtw88: Prepare to support RTL8814AU (part 2/2) Bitterblue Smith
                   ` (3 preceding siblings ...)
  2025-02-11 22:23 ` [PATCH 4/8] wifi: rtw88: Fix rtw_init_vht_cap() " Bitterblue Smith
@ 2025-02-11 22:24 ` Bitterblue Smith
  2025-02-13  7:43   ` Ping-Ke Shih
  2025-02-11 22:24 ` [PATCH 6/8] wifi: rtw88: Extend rtw_phy_config_swing_table() " Bitterblue Smith
                   ` (2 subsequent siblings)
  7 siblings, 1 reply; 20+ messages in thread
From: Bitterblue Smith @ 2025-02-11 22:24 UTC (permalink / raw)
  To: linux-wireless@vger.kernel.org; +Cc: Ping-Ke Shih

Record statistics for the 3SS rates too.

Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
---
 drivers/net/wireless/realtek/rtw88/main.h | 7 +++++++
 drivers/net/wireless/realtek/rtw88/rx.c   | 6 ++++++
 2 files changed, 13 insertions(+)

diff --git a/drivers/net/wireless/realtek/rtw88/main.h b/drivers/net/wireless/realtek/rtw88/main.h
index 24ac749271cc..c15e0f55d09a 100644
--- a/drivers/net/wireless/realtek/rtw88/main.h
+++ b/drivers/net/wireless/realtek/rtw88/main.h
@@ -386,6 +386,9 @@ enum rtw_evm {
 	RTW_EVM_1SS,
 	RTW_EVM_2SS_A,
 	RTW_EVM_2SS_B,
+	RTW_EVM_3SS_A,
+	RTW_EVM_3SS_B,
+	RTW_EVM_3SS_C,
 	/* keep it last */
 	RTW_EVM_NUM
 };
@@ -403,6 +406,10 @@ enum rtw_snr {
 	RTW_SNR_2SS_B,
 	RTW_SNR_2SS_C,
 	RTW_SNR_2SS_D,
+	RTW_SNR_3SS_A,
+	RTW_SNR_3SS_B,
+	RTW_SNR_3SS_C,
+	RTW_SNR_3SS_D,
 	/* keep it last */
 	RTW_SNR_NUM
 };
diff --git a/drivers/net/wireless/realtek/rtw88/rx.c b/drivers/net/wireless/realtek/rtw88/rx.c
index 90fc8a5fa89e..8b0afaaffaa0 100644
--- a/drivers/net/wireless/realtek/rtw88/rx.c
+++ b/drivers/net/wireless/realtek/rtw88/rx.c
@@ -73,6 +73,12 @@ static void rtw_rx_phy_stat(struct rtw_dev *rtwdev,
 		rate_ss_evm = 2;
 		evm_id = RTW_EVM_2SS_A;
 		break;
+	case DESC_RATEMCS16...DESC_RATEMCS23:
+	case DESC_RATEVHT3SS_MCS0...DESC_RATEVHT3SS_MCS9:
+		rate_ss = 3;
+		rate_ss_evm = 3;
+		evm_id = RTW_EVM_3SS_A;
+		break;
 	default:
 		rtw_warn(rtwdev, "unknown pkt rate = %d\n", pkt_stat->rate);
 		return;
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH 6/8] wifi: rtw88: Extend rtw_phy_config_swing_table() for RTL8814AU
  2025-02-11 22:21 [PATCH 0/8] wifi: rtw88: Prepare to support RTL8814AU (part 2/2) Bitterblue Smith
                   ` (4 preceding siblings ...)
  2025-02-11 22:24 ` [PATCH 5/8] wifi: rtw88: Fix rtw_rx_phy_stat() " Bitterblue Smith
@ 2025-02-11 22:24 ` Bitterblue Smith
  2025-02-13  7:44   ` Ping-Ke Shih
  2025-02-11 22:25 ` [PATCH 7/8] wifi: rtw88: Extend rtw_debugfs_get_phy_info() " Bitterblue Smith
  2025-02-11 22:26 ` [PATCH 8/8] wifi: rtw88: Extend rtw_debugfs_get_tx_pwr_tbl() " Bitterblue Smith
  7 siblings, 1 reply; 20+ messages in thread
From: Bitterblue Smith @ 2025-02-11 22:24 UTC (permalink / raw)
  To: linux-wireless@vger.kernel.org; +Cc: Ping-Ke Shih

Select the TX power tracking tables for RF paths C and D as well.

Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
---
 drivers/net/wireless/realtek/rtw88/phy.c | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/drivers/net/wireless/realtek/rtw88/phy.c b/drivers/net/wireless/realtek/rtw88/phy.c
index b487457d2215..55be0d8e0c28 100644
--- a/drivers/net/wireless/realtek/rtw88/phy.c
+++ b/drivers/net/wireless/realtek/rtw88/phy.c
@@ -2458,32 +2458,56 @@ void rtw_phy_config_swing_table(struct rtw_dev *rtwdev,
 			swing_table->n[RF_PATH_A] = tbl->pwrtrk_2g_ccka_n;
 			swing_table->p[RF_PATH_B] = tbl->pwrtrk_2g_cckb_p;
 			swing_table->n[RF_PATH_B] = tbl->pwrtrk_2g_cckb_n;
+			swing_table->p[RF_PATH_C] = tbl->pwrtrk_2g_cckc_p;
+			swing_table->n[RF_PATH_C] = tbl->pwrtrk_2g_cckc_n;
+			swing_table->p[RF_PATH_D] = tbl->pwrtrk_2g_cckd_p;
+			swing_table->n[RF_PATH_D] = tbl->pwrtrk_2g_cckd_n;
 		} else {
 			swing_table->p[RF_PATH_A] = tbl->pwrtrk_2ga_p;
 			swing_table->n[RF_PATH_A] = tbl->pwrtrk_2ga_n;
 			swing_table->p[RF_PATH_B] = tbl->pwrtrk_2gb_p;
 			swing_table->n[RF_PATH_B] = tbl->pwrtrk_2gb_n;
+			swing_table->p[RF_PATH_C] = tbl->pwrtrk_2gc_p;
+			swing_table->n[RF_PATH_C] = tbl->pwrtrk_2gc_n;
+			swing_table->p[RF_PATH_D] = tbl->pwrtrk_2gd_p;
+			swing_table->n[RF_PATH_D] = tbl->pwrtrk_2gd_n;
 		}
 	} else if (IS_CH_5G_BAND_1(channel) || IS_CH_5G_BAND_2(channel)) {
 		swing_table->p[RF_PATH_A] = tbl->pwrtrk_5ga_p[RTW_PWR_TRK_5G_1];
 		swing_table->n[RF_PATH_A] = tbl->pwrtrk_5ga_n[RTW_PWR_TRK_5G_1];
 		swing_table->p[RF_PATH_B] = tbl->pwrtrk_5gb_p[RTW_PWR_TRK_5G_1];
 		swing_table->n[RF_PATH_B] = tbl->pwrtrk_5gb_n[RTW_PWR_TRK_5G_1];
+		swing_table->p[RF_PATH_C] = tbl->pwrtrk_5gc_p[RTW_PWR_TRK_5G_1];
+		swing_table->n[RF_PATH_C] = tbl->pwrtrk_5gc_n[RTW_PWR_TRK_5G_1];
+		swing_table->p[RF_PATH_D] = tbl->pwrtrk_5gd_p[RTW_PWR_TRK_5G_1];
+		swing_table->n[RF_PATH_D] = tbl->pwrtrk_5gd_n[RTW_PWR_TRK_5G_1];
 	} else if (IS_CH_5G_BAND_3(channel)) {
 		swing_table->p[RF_PATH_A] = tbl->pwrtrk_5ga_p[RTW_PWR_TRK_5G_2];
 		swing_table->n[RF_PATH_A] = tbl->pwrtrk_5ga_n[RTW_PWR_TRK_5G_2];
 		swing_table->p[RF_PATH_B] = tbl->pwrtrk_5gb_p[RTW_PWR_TRK_5G_2];
 		swing_table->n[RF_PATH_B] = tbl->pwrtrk_5gb_n[RTW_PWR_TRK_5G_2];
+		swing_table->p[RF_PATH_C] = tbl->pwrtrk_5gc_p[RTW_PWR_TRK_5G_2];
+		swing_table->n[RF_PATH_C] = tbl->pwrtrk_5gc_n[RTW_PWR_TRK_5G_2];
+		swing_table->p[RF_PATH_D] = tbl->pwrtrk_5gd_p[RTW_PWR_TRK_5G_2];
+		swing_table->n[RF_PATH_D] = tbl->pwrtrk_5gd_n[RTW_PWR_TRK_5G_2];
 	} else if (IS_CH_5G_BAND_4(channel)) {
 		swing_table->p[RF_PATH_A] = tbl->pwrtrk_5ga_p[RTW_PWR_TRK_5G_3];
 		swing_table->n[RF_PATH_A] = tbl->pwrtrk_5ga_n[RTW_PWR_TRK_5G_3];
 		swing_table->p[RF_PATH_B] = tbl->pwrtrk_5gb_p[RTW_PWR_TRK_5G_3];
 		swing_table->n[RF_PATH_B] = tbl->pwrtrk_5gb_n[RTW_PWR_TRK_5G_3];
+		swing_table->p[RF_PATH_C] = tbl->pwrtrk_5gc_p[RTW_PWR_TRK_5G_3];
+		swing_table->n[RF_PATH_C] = tbl->pwrtrk_5gc_n[RTW_PWR_TRK_5G_3];
+		swing_table->p[RF_PATH_D] = tbl->pwrtrk_5gd_p[RTW_PWR_TRK_5G_3];
+		swing_table->n[RF_PATH_D] = tbl->pwrtrk_5gd_n[RTW_PWR_TRK_5G_3];
 	} else {
 		swing_table->p[RF_PATH_A] = tbl->pwrtrk_2ga_p;
 		swing_table->n[RF_PATH_A] = tbl->pwrtrk_2ga_n;
 		swing_table->p[RF_PATH_B] = tbl->pwrtrk_2gb_p;
 		swing_table->n[RF_PATH_B] = tbl->pwrtrk_2gb_n;
+		swing_table->p[RF_PATH_C] = tbl->pwrtrk_2gc_p;
+		swing_table->n[RF_PATH_C] = tbl->pwrtrk_2gc_n;
+		swing_table->p[RF_PATH_D] = tbl->pwrtrk_2gd_p;
+		swing_table->n[RF_PATH_D] = tbl->pwrtrk_2gd_n;
 	}
 }
 EXPORT_SYMBOL(rtw_phy_config_swing_table);
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH 7/8] wifi: rtw88: Extend rtw_debugfs_get_phy_info() for RTL8814AU
  2025-02-11 22:21 [PATCH 0/8] wifi: rtw88: Prepare to support RTL8814AU (part 2/2) Bitterblue Smith
                   ` (5 preceding siblings ...)
  2025-02-11 22:24 ` [PATCH 6/8] wifi: rtw88: Extend rtw_phy_config_swing_table() " Bitterblue Smith
@ 2025-02-11 22:25 ` Bitterblue Smith
  2025-02-13  7:48   ` Ping-Ke Shih
  2025-02-11 22:26 ` [PATCH 8/8] wifi: rtw88: Extend rtw_debugfs_get_tx_pwr_tbl() " Bitterblue Smith
  7 siblings, 1 reply; 20+ messages in thread
From: Bitterblue Smith @ 2025-02-11 22:25 UTC (permalink / raw)
  To: linux-wireless@vger.kernel.org; +Cc: Ping-Ke Shih

Print information about the 3rd and 4th RF paths and about the 3rd
spatial stream.

Also, fix a small bug: don't show the average SNR and EVM for the OFDM
and HT/VHT rates when the rate is actually CCK 11M.

Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
---
 drivers/net/wireless/realtek/rtw88/debug.c | 37 +++++++++++++++-------
 1 file changed, 26 insertions(+), 11 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtw88/debug.c b/drivers/net/wireless/realtek/rtw88/debug.c
index 364ec0436d0f..1adb03d1210a 100644
--- a/drivers/net/wireless/realtek/rtw88/debug.c
+++ b/drivers/net/wireless/realtek/rtw88/debug.c
@@ -654,10 +654,10 @@ static void rtw_print_rate(struct seq_file *m, u8 rate)
 	case DESC_RATE6M...DESC_RATE54M:
 		rtw_print_ofdm_rate_txt(m, rate);
 		break;
-	case DESC_RATEMCS0...DESC_RATEMCS15:
+	case DESC_RATEMCS0...DESC_RATEMCS31:
 		rtw_print_ht_rate_txt(m, rate);
 		break;
-	case DESC_RATEVHT1SS_MCS0...DESC_RATEVHT2SS_MCS9:
+	case DESC_RATEVHT1SS_MCS0...DESC_RATEVHT4SS_MCS9:
 		rtw_print_vht_rate_txt(m, rate);
 		break;
 	default:
@@ -849,20 +849,28 @@ static int rtw_debugfs_get_phy_info(struct seq_file *m, void *v)
 			   last_cnt->num_qry_pkt[rate_id + 9]);
 	}
 
-	seq_printf(m, "[RSSI(dBm)] = {%d, %d}\n",
+	seq_printf(m, "[RSSI(dBm)] = {%d, %d, %d, %d}\n",
 		   dm_info->rssi[RF_PATH_A] - 100,
-		   dm_info->rssi[RF_PATH_B] - 100);
-	seq_printf(m, "[Rx EVM(dB)] = {-%d, -%d}\n",
+		   dm_info->rssi[RF_PATH_B] - 100,
+		   dm_info->rssi[RF_PATH_C] - 100,
+		   dm_info->rssi[RF_PATH_D] - 100);
+	seq_printf(m, "[Rx EVM(dB)] = {-%d, -%d, -%d, -%d}\n",
 		   dm_info->rx_evm_dbm[RF_PATH_A],
-		   dm_info->rx_evm_dbm[RF_PATH_B]);
-	seq_printf(m, "[Rx SNR] = {%d, %d}\n",
+		   dm_info->rx_evm_dbm[RF_PATH_B],
+		   dm_info->rx_evm_dbm[RF_PATH_C],
+		   dm_info->rx_evm_dbm[RF_PATH_D]);
+	seq_printf(m, "[Rx SNR] = {%d, %d, %d, %d}\n",
 		   dm_info->rx_snr[RF_PATH_A],
-		   dm_info->rx_snr[RF_PATH_B]);
-	seq_printf(m, "[CFO_tail(KHz)] = {%d, %d}\n",
+		   dm_info->rx_snr[RF_PATH_B],
+		   dm_info->rx_snr[RF_PATH_C],
+		   dm_info->rx_snr[RF_PATH_D]);
+	seq_printf(m, "[CFO_tail(KHz)] = {%d, %d, %d, %d}\n",
 		   dm_info->cfo_tail[RF_PATH_A],
-		   dm_info->cfo_tail[RF_PATH_B]);
+		   dm_info->cfo_tail[RF_PATH_B],
+		   dm_info->cfo_tail[RF_PATH_C],
+		   dm_info->cfo_tail[RF_PATH_D]);
 
-	if (dm_info->curr_rx_rate >= DESC_RATE11M) {
+	if (dm_info->curr_rx_rate >= DESC_RATE6M) {
 		seq_puts(m, "[Rx Average Status]:\n");
 		seq_printf(m, " * OFDM, EVM: {-%d}, SNR: {%d}\n",
 			   (u8)ewma_evm_read(&ewma_evm[RTW_EVM_OFDM]),
@@ -875,6 +883,13 @@ static int rtw_debugfs_get_phy_info(struct seq_file *m, void *v)
 			   (u8)ewma_evm_read(&ewma_evm[RTW_EVM_2SS_B]),
 			   (u8)ewma_snr_read(&ewma_snr[RTW_SNR_2SS_A]),
 			   (u8)ewma_snr_read(&ewma_snr[RTW_SNR_2SS_B]));
+		seq_printf(m, " * 3SS, EVM: {-%d, -%d, -%d}, SNR: {%d, %d, %d}\n",
+			   (u8)ewma_evm_read(&ewma_evm[RTW_EVM_3SS_A]),
+			   (u8)ewma_evm_read(&ewma_evm[RTW_EVM_3SS_B]),
+			   (u8)ewma_evm_read(&ewma_evm[RTW_EVM_3SS_C]),
+			   (u8)ewma_snr_read(&ewma_snr[RTW_SNR_3SS_A]),
+			   (u8)ewma_snr_read(&ewma_snr[RTW_SNR_3SS_B]),
+			   (u8)ewma_snr_read(&ewma_snr[RTW_SNR_3SS_C]));
 	}
 
 	seq_puts(m, "[Rx Counter]:\n");
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH 8/8] wifi: rtw88: Extend rtw_debugfs_get_tx_pwr_tbl() for RTL8814AU
  2025-02-11 22:21 [PATCH 0/8] wifi: rtw88: Prepare to support RTL8814AU (part 2/2) Bitterblue Smith
                   ` (6 preceding siblings ...)
  2025-02-11 22:25 ` [PATCH 7/8] wifi: rtw88: Extend rtw_debugfs_get_phy_info() " Bitterblue Smith
@ 2025-02-11 22:26 ` Bitterblue Smith
  2025-02-13  7:52   ` Ping-Ke Shih
  7 siblings, 1 reply; 20+ messages in thread
From: Bitterblue Smith @ 2025-02-11 22:26 UTC (permalink / raw)
  To: linux-wireless@vger.kernel.org; +Cc: Ping-Ke Shih

Make it print the TX power details for RF paths C and D, and for 3SS and
4SS rates.

Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
---
 drivers/net/wireless/realtek/rtw88/debug.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/drivers/net/wireless/realtek/rtw88/debug.c b/drivers/net/wireless/realtek/rtw88/debug.c
index 1adb03d1210a..0efb5c19b90e 100644
--- a/drivers/net/wireless/realtek/rtw88/debug.c
+++ b/drivers/net/wireless/realtek/rtw88/debug.c
@@ -708,20 +708,14 @@ static int rtw_debugfs_get_tx_pwr_tbl(struct seq_file *m, void *v)
 		   "path", "rate", "pwr", "base", "byr", "lmt", "sar", "rem");
 
 	mutex_lock(&hal->tx_power_mutex);
-	for (path = RF_PATH_A; path <= RF_PATH_B; path++) {
+	for (path = RF_PATH_A; path <= RF_PATH_D; path++) {
 		/* there is no CCK rates used in 5G */
 		if (hal->current_band_type == RTW_BAND_5G)
 			rate = DESC_RATE6M;
 		else
 			rate = DESC_RATE1M;
 
-		/* now, not support vht 3ss and vht 4ss*/
-		for (; rate <= DESC_RATEVHT2SS_MCS9; rate++) {
-			/* now, not support ht 3ss and ht 4ss*/
-			if (rate > DESC_RATEMCS15 &&
-			    rate < DESC_RATEVHT1SS_MCS0)
-				continue;
-
+		for (; rate <= DESC_RATEVHT4SS_MCS9; rate++) {
 			rtw_get_tx_power_params(rtwdev, path, rate, bw,
 						ch, regd, &pwr_param);
 
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* RE: [PATCH 1/8] wifi: rtw88: Fix rtw_mac_power_switch() for RTL8814AU
  2025-02-11 22:22 ` [PATCH 1/8] wifi: rtw88: Fix rtw_mac_power_switch() for RTL8814AU Bitterblue Smith
@ 2025-02-13  7:29   ` Ping-Ke Shih
  0 siblings, 0 replies; 20+ messages in thread
From: Ping-Ke Shih @ 2025-02-13  7:29 UTC (permalink / raw)
  To: Bitterblue Smith, linux-wireless@vger.kernel.org

Bitterblue Smith <rtl8821cerfe2@gmail.com> wrote:
> rtw_mac_power_switch() checks bit 8 of REG_SYS_STATUS1 to see if the
> chip is powered on. This bit appears to be always on in the RTL8814AU,
> so ignore it.
> 
> Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
> ---
>  drivers/net/wireless/realtek/rtw88/mac.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/wireless/realtek/rtw88/mac.c b/drivers/net/wireless/realtek/rtw88/mac.c
> index 63edf6461de8..5de16c75adf2 100644
> --- a/drivers/net/wireless/realtek/rtw88/mac.c
> +++ b/drivers/net/wireless/realtek/rtw88/mac.c
> @@ -291,7 +291,8 @@ static int rtw_mac_power_switch(struct rtw_dev *rtwdev, bool pwr_on)
>         if (rtw_read8(rtwdev, REG_CR) == 0xea)
>                 cur_pwr = false;
>         else if (rtw_hci_type(rtwdev) == RTW_HCI_TYPE_USB &&
> -                (rtw_read8(rtwdev, REG_SYS_STATUS1 + 1) & BIT(0)))
> +                  chip->id != RTW_CHIP_TYPE_8814A &&
> +                  (rtw_read8(rtwdev, REG_SYS_STATUS1 + 1) & BIT(0)))

The newly added codes are not aligned, and seemingly only need to add 
the line checking 8814A.

>                 cur_pwr = false;
>         else
>                 cur_pwr = true;
> --
> 2.48.1


^ permalink raw reply	[flat|nested] 20+ messages in thread

* RE: [PATCH 2/8] wifi: rtw88: Fix rtw_desc_to_mcsrate() to handle MCS16-31
  2025-02-11 22:22 ` [PATCH 2/8] wifi: rtw88: Fix rtw_desc_to_mcsrate() to handle MCS16-31 Bitterblue Smith
@ 2025-02-13  7:30   ` Ping-Ke Shih
  2025-02-13 16:12     ` Bitterblue Smith
  0 siblings, 1 reply; 20+ messages in thread
From: Ping-Ke Shih @ 2025-02-13  7:30 UTC (permalink / raw)
  To: Bitterblue Smith, linux-wireless@vger.kernel.org

Bitterblue Smith <rtl8821cerfe2@gmail.com> wrote:
> This function translates the rate number reported by the hardware into
> something mac80211 can understand. It was ignoring the 3SS and 4SS HT
> rates.
> 
> Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
> ---
>  drivers/net/wireless/realtek/rtw88/util.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/wireless/realtek/rtw88/util.c b/drivers/net/wireless/realtek/rtw88/util.c
> index e222d3c01a77..ba02ba72e104 100644
> --- a/drivers/net/wireless/realtek/rtw88/util.c
> +++ b/drivers/net/wireless/realtek/rtw88/util.c
> @@ -101,7 +101,7 @@ void rtw_desc_to_mcsrate(u16 rate, u8 *mcs, u8 *nss)
>                 *nss = 4;
>                 *mcs = rate - DESC_RATEVHT4SS_MCS0;
>         } else if (rate >= DESC_RATEMCS0 &&
> -                  rate <= DESC_RATEMCS15) {
> +                  rate <= DESC_RATEMCS31) {
>                 *mcs = rate - DESC_RATEMCS0;

Somehow, we don't set *nss in this case. The caller rtw_fw_ra_report_iter()
doesn't initialize nss, so there is potential problem.



^ permalink raw reply	[flat|nested] 20+ messages in thread

* RE: [PATCH 3/8] wifi: rtw88: Fix rtw_init_ht_cap() for RTL8814AU
  2025-02-11 22:23 ` [PATCH 3/8] wifi: rtw88: Fix rtw_init_ht_cap() for RTL8814AU Bitterblue Smith
@ 2025-02-13  7:35   ` Ping-Ke Shih
  0 siblings, 0 replies; 20+ messages in thread
From: Ping-Ke Shih @ 2025-02-13  7:35 UTC (permalink / raw)
  To: Bitterblue Smith, linux-wireless@vger.kernel.org

Bitterblue Smith <rtl8821cerfe2@gmail.com> wrote:
> Set the RX mask and the highest RX rate according to the number of
> spatial streams the chip can receive. For RTL8814AU that is 3.
> 
> Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>

Acked-by: Ping-Ke Shih <pkshih@realtek.com>


^ permalink raw reply	[flat|nested] 20+ messages in thread

* RE: [PATCH 4/8] wifi: rtw88: Fix rtw_init_vht_cap() for RTL8814AU
  2025-02-11 22:23 ` [PATCH 4/8] wifi: rtw88: Fix rtw_init_vht_cap() " Bitterblue Smith
@ 2025-02-13  7:39   ` Ping-Ke Shih
  0 siblings, 0 replies; 20+ messages in thread
From: Ping-Ke Shih @ 2025-02-13  7:39 UTC (permalink / raw)
  To: Bitterblue Smith, linux-wireless@vger.kernel.org

Bitterblue Smith <rtl8821cerfe2@gmail.com> wrote:
> Set the MCS maps and the highest rates according to the number of
> spatial streams the chip has. For RTL8814AU that is 3.
> 
> Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>

Acked-by: Ping-Ke Shih <pkshih@realtek.com>



^ permalink raw reply	[flat|nested] 20+ messages in thread

* RE: [PATCH 5/8] wifi: rtw88: Fix rtw_rx_phy_stat() for RTL8814AU
  2025-02-11 22:24 ` [PATCH 5/8] wifi: rtw88: Fix rtw_rx_phy_stat() " Bitterblue Smith
@ 2025-02-13  7:43   ` Ping-Ke Shih
  0 siblings, 0 replies; 20+ messages in thread
From: Ping-Ke Shih @ 2025-02-13  7:43 UTC (permalink / raw)
  To: Bitterblue Smith, linux-wireless@vger.kernel.org

Bitterblue Smith <rtl8821cerfe2@gmail.com> wrote:
> Record statistics for the 3SS rates too.
> 
> Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>

Acked-by: Ping-Ke Shih <pkshih@realtek.com>



^ permalink raw reply	[flat|nested] 20+ messages in thread

* RE: [PATCH 6/8] wifi: rtw88: Extend rtw_phy_config_swing_table() for RTL8814AU
  2025-02-11 22:24 ` [PATCH 6/8] wifi: rtw88: Extend rtw_phy_config_swing_table() " Bitterblue Smith
@ 2025-02-13  7:44   ` Ping-Ke Shih
  0 siblings, 0 replies; 20+ messages in thread
From: Ping-Ke Shih @ 2025-02-13  7:44 UTC (permalink / raw)
  To: Bitterblue Smith, linux-wireless@vger.kernel.org

Bitterblue Smith <rtl8821cerfe2@gmail.com> wrote:
> Select the TX power tracking tables for RF paths C and D as well.
> 
> Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>

Acked-by: Ping-Ke Shih <pkshih@realtek.com>



^ permalink raw reply	[flat|nested] 20+ messages in thread

* RE: [PATCH 7/8] wifi: rtw88: Extend rtw_debugfs_get_phy_info() for RTL8814AU
  2025-02-11 22:25 ` [PATCH 7/8] wifi: rtw88: Extend rtw_debugfs_get_phy_info() " Bitterblue Smith
@ 2025-02-13  7:48   ` Ping-Ke Shih
  0 siblings, 0 replies; 20+ messages in thread
From: Ping-Ke Shih @ 2025-02-13  7:48 UTC (permalink / raw)
  To: Bitterblue Smith, linux-wireless@vger.kernel.org

Bitterblue Smith <rtl8821cerfe2@gmail.com> wrote:
> Print information about the 3rd and 4th RF paths and about the 3rd
> spatial stream.
> 
> Also, fix a small bug: don't show the average SNR and EVM for the OFDM
> and HT/VHT rates when the rate is actually CCK 11M.
> 
> Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>

Acked-by: Ping-Ke Shih <pkshih@realtek.com>

[...]


> -       if (dm_info->curr_rx_rate >= DESC_RATE11M) {
> +       if (dm_info->curr_rx_rate >= DESC_RATE6M) {

Good catch the error.

>                 seq_puts(m, "[Rx Average Status]:\n");
>                 seq_printf(m, " * OFDM, EVM: {-%d}, SNR: {%d}\n",
>                            (u8)ewma_evm_read(&ewma_evm[RTW_EVM_OFDM]),




^ permalink raw reply	[flat|nested] 20+ messages in thread

* RE: [PATCH 8/8] wifi: rtw88: Extend rtw_debugfs_get_tx_pwr_tbl() for RTL8814AU
  2025-02-11 22:26 ` [PATCH 8/8] wifi: rtw88: Extend rtw_debugfs_get_tx_pwr_tbl() " Bitterblue Smith
@ 2025-02-13  7:52   ` Ping-Ke Shih
  2025-02-13 16:13     ` Bitterblue Smith
  0 siblings, 1 reply; 20+ messages in thread
From: Ping-Ke Shih @ 2025-02-13  7:52 UTC (permalink / raw)
  To: Bitterblue Smith, linux-wireless@vger.kernel.org

Bitterblue Smith <rtl8821cerfe2@gmail.com> wrote:
> Make it print the TX power details for RF paths C and D, and for 3SS and
> 4SS rates.
> 
> Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
> ---
>  drivers/net/wireless/realtek/rtw88/debug.c | 10 ++--------
>  1 file changed, 2 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/net/wireless/realtek/rtw88/debug.c b/drivers/net/wireless/realtek/rtw88/debug.c
> index 1adb03d1210a..0efb5c19b90e 100644
> --- a/drivers/net/wireless/realtek/rtw88/debug.c
> +++ b/drivers/net/wireless/realtek/rtw88/debug.c
> @@ -708,20 +708,14 @@ static int rtw_debugfs_get_tx_pwr_tbl(struct seq_file *m, void *v)
>                    "path", "rate", "pwr", "base", "byr", "lmt", "sar", "rem");
> 
>         mutex_lock(&hal->tx_power_mutex);
> -       for (path = RF_PATH_A; path <= RF_PATH_B; path++) {
> +       for (path = RF_PATH_A; path <= RF_PATH_D; path++) {

Can we limit path and rate by efuse->hw_cap.nss or rf_path?
Only showing two paths and 2SS rate for 2SS chips would avoid confusing. 

>                 /* there is no CCK rates used in 5G */
>                 if (hal->current_band_type == RTW_BAND_5G)
>                         rate = DESC_RATE6M;
>                 else
>                         rate = DESC_RATE1M;
> 
> -               /* now, not support vht 3ss and vht 4ss*/
> -               for (; rate <= DESC_RATEVHT2SS_MCS9; rate++) {
> -                       /* now, not support ht 3ss and ht 4ss*/
> -                       if (rate > DESC_RATEMCS15 &&
> -                           rate < DESC_RATEVHT1SS_MCS0)
> -                               continue;
> -
> +               for (; rate <= DESC_RATEVHT4SS_MCS9; rate++) {
>                         rtw_get_tx_power_params(rtwdev, path, rate, bw,
>                                                 ch, regd, &pwr_param);
> 
> --
> 2.48.1


^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 2/8] wifi: rtw88: Fix rtw_desc_to_mcsrate() to handle MCS16-31
  2025-02-13  7:30   ` Ping-Ke Shih
@ 2025-02-13 16:12     ` Bitterblue Smith
  2025-02-14  0:09       ` Ping-Ke Shih
  0 siblings, 1 reply; 20+ messages in thread
From: Bitterblue Smith @ 2025-02-13 16:12 UTC (permalink / raw)
  To: Ping-Ke Shih, linux-wireless@vger.kernel.org

On 13/02/2025 09:30, Ping-Ke Shih wrote:
> Bitterblue Smith <rtl8821cerfe2@gmail.com> wrote:
>> This function translates the rate number reported by the hardware into
>> something mac80211 can understand. It was ignoring the 3SS and 4SS HT
>> rates.
>>
>> Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
>> ---
>>  drivers/net/wireless/realtek/rtw88/util.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/net/wireless/realtek/rtw88/util.c b/drivers/net/wireless/realtek/rtw88/util.c
>> index e222d3c01a77..ba02ba72e104 100644
>> --- a/drivers/net/wireless/realtek/rtw88/util.c
>> +++ b/drivers/net/wireless/realtek/rtw88/util.c
>> @@ -101,7 +101,7 @@ void rtw_desc_to_mcsrate(u16 rate, u8 *mcs, u8 *nss)
>>                 *nss = 4;
>>                 *mcs = rate - DESC_RATEVHT4SS_MCS0;
>>         } else if (rate >= DESC_RATEMCS0 &&
>> -                  rate <= DESC_RATEMCS15) {
>> +                  rate <= DESC_RATEMCS31) {
>>                 *mcs = rate - DESC_RATEMCS0;
> 
> Somehow, we don't set *nss in this case. The caller rtw_fw_ra_report_iter()
> doesn't initialize nss, so there is potential problem.
> 
> 

I assumed it's not needed because the MCS index implies the NSS,
but I can add that:

		*nss = *mcs / 8 + 1;

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH 8/8] wifi: rtw88: Extend rtw_debugfs_get_tx_pwr_tbl() for RTL8814AU
  2025-02-13  7:52   ` Ping-Ke Shih
@ 2025-02-13 16:13     ` Bitterblue Smith
  0 siblings, 0 replies; 20+ messages in thread
From: Bitterblue Smith @ 2025-02-13 16:13 UTC (permalink / raw)
  To: Ping-Ke Shih, linux-wireless@vger.kernel.org

On 13/02/2025 09:52, Ping-Ke Shih wrote:
> Bitterblue Smith <rtl8821cerfe2@gmail.com> wrote:
>> Make it print the TX power details for RF paths C and D, and for 3SS and
>> 4SS rates.
>>
>> Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
>> ---
>>  drivers/net/wireless/realtek/rtw88/debug.c | 10 ++--------
>>  1 file changed, 2 insertions(+), 8 deletions(-)
>>
>> diff --git a/drivers/net/wireless/realtek/rtw88/debug.c b/drivers/net/wireless/realtek/rtw88/debug.c
>> index 1adb03d1210a..0efb5c19b90e 100644
>> --- a/drivers/net/wireless/realtek/rtw88/debug.c
>> +++ b/drivers/net/wireless/realtek/rtw88/debug.c
>> @@ -708,20 +708,14 @@ static int rtw_debugfs_get_tx_pwr_tbl(struct seq_file *m, void *v)
>>                    "path", "rate", "pwr", "base", "byr", "lmt", "sar", "rem");
>>
>>         mutex_lock(&hal->tx_power_mutex);
>> -       for (path = RF_PATH_A; path <= RF_PATH_B; path++) {
>> +       for (path = RF_PATH_A; path <= RF_PATH_D; path++) {
> 
> Can we limit path and rate by efuse->hw_cap.nss or rf_path?
> Only showing two paths and 2SS rate for 2SS chips would avoid confusing. 
> 

Oh, right. That is a lot of unnecessary output with the 1SS and 2SS chips.

>>                 /* there is no CCK rates used in 5G */
>>                 if (hal->current_band_type == RTW_BAND_5G)
>>                         rate = DESC_RATE6M;
>>                 else
>>                         rate = DESC_RATE1M;
>>
>> -               /* now, not support vht 3ss and vht 4ss*/
>> -               for (; rate <= DESC_RATEVHT2SS_MCS9; rate++) {
>> -                       /* now, not support ht 3ss and ht 4ss*/
>> -                       if (rate > DESC_RATEMCS15 &&
>> -                           rate < DESC_RATEVHT1SS_MCS0)
>> -                               continue;
>> -
>> +               for (; rate <= DESC_RATEVHT4SS_MCS9; rate++) {
>>                         rtw_get_tx_power_params(rtwdev, path, rate, bw,
>>                                                 ch, regd, &pwr_param);
>>
>> --
>> 2.48.1
> 


^ permalink raw reply	[flat|nested] 20+ messages in thread

* RE: [PATCH 2/8] wifi: rtw88: Fix rtw_desc_to_mcsrate() to handle MCS16-31
  2025-02-13 16:12     ` Bitterblue Smith
@ 2025-02-14  0:09       ` Ping-Ke Shih
  0 siblings, 0 replies; 20+ messages in thread
From: Ping-Ke Shih @ 2025-02-14  0:09 UTC (permalink / raw)
  To: Bitterblue Smith, linux-wireless@vger.kernel.org

Bitterblue Smith <rtl8821cerfe2@gmail.com> wrote:
> On 13/02/2025 09:30, Ping-Ke Shih wrote:
> > Bitterblue Smith <rtl8821cerfe2@gmail.com> wrote:
> >> This function translates the rate number reported by the hardware into
> >> something mac80211 can understand. It was ignoring the 3SS and 4SS HT
> >> rates.
> >>
> >> Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
> >> ---
> >>  drivers/net/wireless/realtek/rtw88/util.c | 2 +-
> >>  1 file changed, 1 insertion(+), 1 deletion(-)
> >>
> >> diff --git a/drivers/net/wireless/realtek/rtw88/util.c b/drivers/net/wireless/realtek/rtw88/util.c
> >> index e222d3c01a77..ba02ba72e104 100644
> >> --- a/drivers/net/wireless/realtek/rtw88/util.c
> >> +++ b/drivers/net/wireless/realtek/rtw88/util.c
> >> @@ -101,7 +101,7 @@ void rtw_desc_to_mcsrate(u16 rate, u8 *mcs, u8 *nss)
> >>                 *nss = 4;
> >>                 *mcs = rate - DESC_RATEVHT4SS_MCS0;
> >>         } else if (rate >= DESC_RATEMCS0 &&
> >> -                  rate <= DESC_RATEMCS15) {
> >> +                  rate <= DESC_RATEMCS31) {
> >>                 *mcs = rate - DESC_RATEMCS0;
> >
> > Somehow, we don't set *nss in this case. The caller rtw_fw_ra_report_iter()
> > doesn't initialize nss, so there is potential problem.
> >
> >
> 
> I assumed it's not needed because the MCS index implies the NSS,

Yes, HT doesn't need NSS.

> but I can add that:
> 
>                 *nss = *mcs / 8 + 1;

So *nss = 0;

Please see how rtw_fw_ra_report_iter() uses its local variable 'nss'.


^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2025-02-14  0:09 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-11 22:21 [PATCH 0/8] wifi: rtw88: Prepare to support RTL8814AU (part 2/2) Bitterblue Smith
2025-02-11 22:22 ` [PATCH 1/8] wifi: rtw88: Fix rtw_mac_power_switch() for RTL8814AU Bitterblue Smith
2025-02-13  7:29   ` Ping-Ke Shih
2025-02-11 22:22 ` [PATCH 2/8] wifi: rtw88: Fix rtw_desc_to_mcsrate() to handle MCS16-31 Bitterblue Smith
2025-02-13  7:30   ` Ping-Ke Shih
2025-02-13 16:12     ` Bitterblue Smith
2025-02-14  0:09       ` Ping-Ke Shih
2025-02-11 22:23 ` [PATCH 3/8] wifi: rtw88: Fix rtw_init_ht_cap() for RTL8814AU Bitterblue Smith
2025-02-13  7:35   ` Ping-Ke Shih
2025-02-11 22:23 ` [PATCH 4/8] wifi: rtw88: Fix rtw_init_vht_cap() " Bitterblue Smith
2025-02-13  7:39   ` Ping-Ke Shih
2025-02-11 22:24 ` [PATCH 5/8] wifi: rtw88: Fix rtw_rx_phy_stat() " Bitterblue Smith
2025-02-13  7:43   ` Ping-Ke Shih
2025-02-11 22:24 ` [PATCH 6/8] wifi: rtw88: Extend rtw_phy_config_swing_table() " Bitterblue Smith
2025-02-13  7:44   ` Ping-Ke Shih
2025-02-11 22:25 ` [PATCH 7/8] wifi: rtw88: Extend rtw_debugfs_get_phy_info() " Bitterblue Smith
2025-02-13  7:48   ` Ping-Ke Shih
2025-02-11 22:26 ` [PATCH 8/8] wifi: rtw88: Extend rtw_debugfs_get_tx_pwr_tbl() " Bitterblue Smith
2025-02-13  7:52   ` Ping-Ke Shih
2025-02-13 16:13     ` Bitterblue Smith

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).