2023-10-10 02:11:06

by Ping-Ke Shih

[permalink] [raw]
Subject: [PATCH v2 0/6] wifi: rtw89: handle EHT rate

We have parsed new formats used by WiFi 7 chips before, and this patchset
is to handle EHT rate. The handlers contain
- RX rate
* from RX descriptor, which is also used to find corresponding PPDU
status packet
- TX rate
* RA (Rate adaptive) mask to tell firmware selectable rates
* RA report tells driver the rate selected by firmware
- debugfs
* show TX/RX rate above
- monitor mode
* add enumerators of radiotap bandwidth of EHT U-SIG
* add EHT radiotap if working on monitor mode

v2:
- correct commit message of patch 5/6 about the source of bandwidth
definition of EHT U-SIG suggested by Johannes

Ping-Ke Shih (6):
wifi: rtw89: parse EHT information from RX descriptor and PPDU status
packet
wifi: rtw89: Add EHT rate mask as parameters of RA H2C command
wifi: rtw89: parse TX EHT rate selected by firmware from RA C2H report
wifi: rtw89: show EHT rate in debugfs
wifi: radiotap: add bandwidth definition of EHT U-SIG
wifi: rtw89: add EHT radiotap in monitor mode

drivers/net/wireless/realtek/rtw89/core.c | 125 ++++++++++++++++++---
drivers/net/wireless/realtek/rtw89/core.h | 11 +-
drivers/net/wireless/realtek/rtw89/debug.c | 14 +++
drivers/net/wireless/realtek/rtw89/phy.c | 70 +++++++++++-
drivers/net/wireless/realtek/rtw89/phy.h | 5 +
include/net/ieee80211_radiotap.h | 6 +
6 files changed, 214 insertions(+), 17 deletions(-)

--
2.25.1


2023-10-10 02:11:06

by Ping-Ke Shih

[permalink] [raw]
Subject: [PATCH v2 5/6] wifi: radiotap: add bandwidth definition of EHT U-SIG

Define EHT U-SIG bandwidth used by radiotap according to Table 36-28
"U-SIG field of an EHT MU PPDU" in 802.11be (D3.0).

Signed-off-by: Ping-Ke Shih <[email protected]>
---
v2:
- correct commit message about the source of bandwidth definition
of EHT U-SIG suggested by Johannes
---
include/net/ieee80211_radiotap.h | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/include/net/ieee80211_radiotap.h b/include/net/ieee80211_radiotap.h
index 2338f8d2a8b3..925bac726a92 100644
--- a/include/net/ieee80211_radiotap.h
+++ b/include/net/ieee80211_radiotap.h
@@ -539,6 +539,12 @@ enum ieee80211_radiotap_eht_usig_common {
IEEE80211_RADIOTAP_EHT_USIG_COMMON_VALIDATE_BITS_OK = 0x00000080,
IEEE80211_RADIOTAP_EHT_USIG_COMMON_PHY_VER = 0x00007000,
IEEE80211_RADIOTAP_EHT_USIG_COMMON_BW = 0x00038000,
+ IEEE80211_RADIOTAP_EHT_USIG_COMMON_BW_20MHZ = 0,
+ IEEE80211_RADIOTAP_EHT_USIG_COMMON_BW_40MHZ = 1,
+ IEEE80211_RADIOTAP_EHT_USIG_COMMON_BW_80MHZ = 2,
+ IEEE80211_RADIOTAP_EHT_USIG_COMMON_BW_160MHZ = 3,
+ IEEE80211_RADIOTAP_EHT_USIG_COMMON_BW_320MHZ_1 = 4,
+ IEEE80211_RADIOTAP_EHT_USIG_COMMON_BW_320MHZ_2 = 5,
IEEE80211_RADIOTAP_EHT_USIG_COMMON_UL_DL = 0x00040000,
IEEE80211_RADIOTAP_EHT_USIG_COMMON_BSS_COLOR = 0x01f80000,
IEEE80211_RADIOTAP_EHT_USIG_COMMON_TXOP = 0xfe000000,
--
2.25.1

2023-10-10 02:11:13

by Ping-Ke Shih

[permalink] [raw]
Subject: [PATCH v2 4/6] wifi: rtw89: show EHT rate in debugfs

Since we have TX rate from RA report of C2H event and RX rate from RX
descriptor, show them in debugfs like

TX rate [1]: EHT 2SS MCS-7 GI:3.2 BW:80 (hw_rate=0x427)
RX rate [1]: EHT 2SS MCS-7 GI:3.2 BW:80 (hw_rate=0x427)

Signed-off-by: Ping-Ke Shih <[email protected]>
---
drivers/net/wireless/realtek/rtw89/debug.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)

diff --git a/drivers/net/wireless/realtek/rtw89/debug.c b/drivers/net/wireless/realtek/rtw89/debug.c
index 6990d3679bc0..a3f795d240ea 100644
--- a/drivers/net/wireless/realtek/rtw89/debug.c
+++ b/drivers/net/wireless/realtek/rtw89/debug.c
@@ -3467,6 +3467,11 @@ static void rtw89_sta_info_get_iter(void *data, struct ieee80211_sta *sta)
[NL80211_RATE_INFO_HE_GI_1_6] = "1.6",
[NL80211_RATE_INFO_HE_GI_3_2] = "3.2",
};
+ static const char * const eht_gi_str[] = {
+ [NL80211_RATE_INFO_EHT_GI_0_8] = "0.8",
+ [NL80211_RATE_INFO_EHT_GI_1_6] = "1.6",
+ [NL80211_RATE_INFO_EHT_GI_3_2] = "3.2",
+ };
struct rtw89_sta *rtwsta = (struct rtw89_sta *)sta->drv_priv;
struct rate_info *rate = &rtwsta->ra_report.txrate;
struct ieee80211_rx_status *status = &rtwsta->rx_status;
@@ -3492,6 +3497,10 @@ static void rtw89_sta_info_get_iter(void *data, struct ieee80211_sta *sta)
seq_printf(m, "HE %dSS MCS-%d GI:%s", rate->nss, rate->mcs,
rate->he_gi <= NL80211_RATE_INFO_HE_GI_3_2 ?
he_gi_str[rate->he_gi] : "N/A");
+ else if (rate->flags & RATE_INFO_FLAGS_EHT_MCS)
+ seq_printf(m, "EHT %dSS MCS-%d GI:%s", rate->nss, rate->mcs,
+ rate->eht_gi < ARRAY_SIZE(eht_gi_str) ?
+ eht_gi_str[rate->eht_gi] : "N/A");
else
seq_printf(m, "Legacy %d", rate->legacy);
seq_printf(m, "%s", rtwsta->ra_report.might_fallback_legacy ? " FB_G" : "");
@@ -3520,6 +3529,11 @@ static void rtw89_sta_info_get_iter(void *data, struct ieee80211_sta *sta)
status->he_gi <= NL80211_RATE_INFO_HE_GI_3_2 ?
he_gi_str[rate->he_gi] : "N/A");
break;
+ case RX_ENC_EHT:
+ seq_printf(m, "EHT %dSS MCS-%d GI:%s", status->nss, status->rate_idx,
+ status->eht.gi < ARRAY_SIZE(eht_gi_str) ?
+ eht_gi_str[status->eht.gi] : "N/A");
+ break;
}
seq_printf(m, " BW:%u", rtw89_rate_info_bw_to_mhz(status->bw));
seq_printf(m, "\t(hw_rate=0x%x)\n", rtwsta->rx_hw_rate);
--
2.25.1

2023-10-10 06:20:17

by Kalle Valo

[permalink] [raw]
Subject: Re: [PATCH v2 5/6] wifi: radiotap: add bandwidth definition of EHT U-SIG

Ping-Ke Shih <[email protected]> writes:

> Define EHT U-SIG bandwidth used by radiotap according to Table 36-28
> "U-SIG field of an EHT MU PPDU" in 802.11be (D3.0).
>
> Signed-off-by: Ping-Ke Shih <[email protected]>
> ---
> v2:
> - correct commit message about the source of bandwidth definition
> of EHT U-SIG suggested by Johannes
> ---
> include/net/ieee80211_radiotap.h | 6 ++++++
> 1 file changed, 6 insertions(+)

This is nitpicking but in general it's good to have the patches touching
files outside of drivers/net/wireless in the beginning of the patchset
to make them more visible. No need to resend because of this, just a
small tip.

--
https://patchwork.kernel.org/project/linux-wireless/list/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

2023-10-11 00:55:00

by Ping-Ke Shih

[permalink] [raw]
Subject: RE: [PATCH v2 5/6] wifi: radiotap: add bandwidth definition of EHT U-SIG



> -----Original Message-----
> From: Kalle Valo <[email protected]>
> Sent: Tuesday, October 10, 2023 2:20 PM
> To: Ping-Ke Shih <[email protected]>
> Cc: [email protected]; [email protected]
> Subject: Re: [PATCH v2 5/6] wifi: radiotap: add bandwidth definition of EHT U-SIG
>
> Ping-Ke Shih <[email protected]> writes:
>
> > Define EHT U-SIG bandwidth used by radiotap according to Table 36-28
> > "U-SIG field of an EHT MU PPDU" in 802.11be (D3.0).
> >
> > Signed-off-by: Ping-Ke Shih <[email protected]>
> > ---
> > v2:
> > - correct commit message about the source of bandwidth definition
> > of EHT U-SIG suggested by Johannes
> > ---
> > include/net/ieee80211_radiotap.h | 6 ++++++
> > 1 file changed, 6 insertions(+)
>
> This is nitpicking but in general it's good to have the patches touching
> files outside of drivers/net/wireless in the beginning of the patchset
> to make them more visible. No need to resend because of this, just a
> small tip.
>

Got it. I will pay attention to it next time.

Ping-Ke