The coming WiFi 7 chip named 8922AE uses different rate code, and basically
we can use chip generations (i.e. 802.11ax/802.11be) to determine which one
we should use.
The things related to rate in this patchset are
- The rate to set fixed rate configured by 'iw bitrates'
- TX rate (set by rate mask for firmware rate adaptive mechanism)
- TX rate report (reported by firmware to tell driver TX rate it is
currently using)
- RX rate from RX descriptor
- TX/RX histogram in debugfs
It still only support HE rate, and we will support EHT later. So,
everything is almost unchanged for existing chips.
Among this patchset, some are to adjust H2C/C2H marco to use struct, such
as 4/10, 6/10 and 7/10. They don't change logic at all.
Ping-Ke Shih (9):
wifi: rtw89: add chip_info::chip_gen to determine chip generation
wifi: rtw89: define hardware rate v1 for WiFi 7 chips
wifi: rtw89: use struct to set RA H2C command
wifi: rtw89: add H2C RA command V1 to support WiFi 7 chips
wifi: rtw89: use struct to access firmware C2H event header
wifi: rtw89: use struct to access RA report
wifi: rtw89: add C2H RA event V1 to support WiFi 7 chips
wifi: rtw89: add to display hardware rates v1 histogram in debugfs
wifi: rtw89: get data rate mode/NSS/MCS v1 from RX descriptor
Zong-Zhe Yang (1):
wifi: rtw89: phy: rate pattern handles HW rate by chip gen
drivers/net/wireless/realtek/rtw89/core.c | 24 +-
drivers/net/wireless/realtek/rtw89/core.h | 205 +++++++++++++-
drivers/net/wireless/realtek/rtw89/debug.c | 35 ++-
drivers/net/wireless/realtek/rtw89/fw.c | 104 +++++---
drivers/net/wireless/realtek/rtw89/fw.h | 251 ++++++------------
drivers/net/wireless/realtek/rtw89/phy.c | 93 +++++--
drivers/net/wireless/realtek/rtw89/rtw8851b.c | 1 +
drivers/net/wireless/realtek/rtw89/rtw8852a.c | 1 +
drivers/net/wireless/realtek/rtw89/rtw8852b.c | 1 +
drivers/net/wireless/realtek/rtw89/rtw8852c.c | 1 +
drivers/net/wireless/realtek/rtw89/txrx.h | 47 +++-
11 files changed, 486 insertions(+), 277 deletions(-)
--
2.25.1
From: Zong-Zhe Yang <[email protected]>
Rate pattern is controlled by 'iw bitrates' to fix rate as desired, and
we extend to support v1 rate.
Signed-off-by: Zong-Zhe Yang <[email protected]>
Signed-off-by: Ping-Ke Shih <[email protected]>
---
drivers/net/wireless/realtek/rtw89/phy.c | 43 +++++++++++++++---------
1 file changed, 28 insertions(+), 15 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtw89/phy.c b/drivers/net/wireless/realtek/rtw89/phy.c
index fb15c852fdd48..e0d4b97a372d6 100644
--- a/drivers/net/wireless/realtek/rtw89/phy.c
+++ b/drivers/net/wireless/realtek/rtw89/phy.c
@@ -444,6 +444,12 @@ static bool __check_rate_pattern(struct rtw89_phy_rate_pattern *next,
return true;
}
+#define RTW89_HW_RATE_BY_CHIP_GEN(rate) \
+ { \
+ [RTW89_CHIP_AX] = RTW89_HW_RATE_ ## rate, \
+ [RTW89_CHIP_BE] = RTW89_HW_RATE_V1_ ## rate, \
+ }
+
void rtw89_phy_rate_pattern_vif(struct rtw89_dev *rtwdev,
struct ieee80211_vif *vif,
const struct cfg80211_bitrate_mask *mask)
@@ -452,39 +458,46 @@ void rtw89_phy_rate_pattern_vif(struct rtw89_dev *rtwdev,
struct rtw89_vif *rtwvif = (struct rtw89_vif *)vif->drv_priv;
struct rtw89_phy_rate_pattern next_pattern = {0};
const struct rtw89_chan *chan = rtw89_chan_get(rtwdev, RTW89_SUB_ENTITY_0);
- static const u16 hw_rate_he[] = {RTW89_HW_RATE_HE_NSS1_MCS0,
- RTW89_HW_RATE_HE_NSS2_MCS0,
- RTW89_HW_RATE_HE_NSS3_MCS0,
- RTW89_HW_RATE_HE_NSS4_MCS0};
- static const u16 hw_rate_vht[] = {RTW89_HW_RATE_VHT_NSS1_MCS0,
- RTW89_HW_RATE_VHT_NSS2_MCS0,
- RTW89_HW_RATE_VHT_NSS3_MCS0,
- RTW89_HW_RATE_VHT_NSS4_MCS0};
- static const u16 hw_rate_ht[] = {RTW89_HW_RATE_MCS0,
- RTW89_HW_RATE_MCS8,
- RTW89_HW_RATE_MCS16,
- RTW89_HW_RATE_MCS24};
+ static const u16 hw_rate_he[][RTW89_CHIP_GEN_NUM] = {
+ RTW89_HW_RATE_BY_CHIP_GEN(HE_NSS1_MCS0),
+ RTW89_HW_RATE_BY_CHIP_GEN(HE_NSS2_MCS0),
+ RTW89_HW_RATE_BY_CHIP_GEN(HE_NSS3_MCS0),
+ RTW89_HW_RATE_BY_CHIP_GEN(HE_NSS4_MCS0),
+ };
+ static const u16 hw_rate_vht[][RTW89_CHIP_GEN_NUM] = {
+ RTW89_HW_RATE_BY_CHIP_GEN(VHT_NSS1_MCS0),
+ RTW89_HW_RATE_BY_CHIP_GEN(VHT_NSS2_MCS0),
+ RTW89_HW_RATE_BY_CHIP_GEN(VHT_NSS3_MCS0),
+ RTW89_HW_RATE_BY_CHIP_GEN(VHT_NSS4_MCS0),
+ };
+ static const u16 hw_rate_ht[][RTW89_CHIP_GEN_NUM] = {
+ RTW89_HW_RATE_BY_CHIP_GEN(MCS0),
+ RTW89_HW_RATE_BY_CHIP_GEN(MCS8),
+ RTW89_HW_RATE_BY_CHIP_GEN(MCS16),
+ RTW89_HW_RATE_BY_CHIP_GEN(MCS24),
+ };
u8 band = chan->band_type;
enum nl80211_band nl_band = rtw89_hw_to_nl80211_band(band);
+ enum rtw89_chip_gen chip_gen = rtwdev->chip->chip_gen;
u8 tx_nss = rtwdev->hal.tx_nss;
u8 i;
for (i = 0; i < tx_nss; i++)
- if (!__check_rate_pattern(&next_pattern, hw_rate_he[i],
+ if (!__check_rate_pattern(&next_pattern, hw_rate_he[i][chip_gen],
RA_MASK_HE_RATES, RTW89_RA_MODE_HE,
mask->control[nl_band].he_mcs[i],
0, true))
goto out;
for (i = 0; i < tx_nss; i++)
- if (!__check_rate_pattern(&next_pattern, hw_rate_vht[i],
+ if (!__check_rate_pattern(&next_pattern, hw_rate_vht[i][chip_gen],
RA_MASK_VHT_RATES, RTW89_RA_MODE_VHT,
mask->control[nl_band].vht_mcs[i],
0, true))
goto out;
for (i = 0; i < tx_nss; i++)
- if (!__check_rate_pattern(&next_pattern, hw_rate_ht[i],
+ if (!__check_rate_pattern(&next_pattern, hw_rate_ht[i][chip_gen],
RA_MASK_HT_RATES, RTW89_RA_MODE_HT,
mask->control[nl_band].ht_mcs[i],
0, true))
--
2.25.1