]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
wifi: rtw89: disable firmware training HE GI and LTF
authorKuan-Chung Chen <damon.chen@realtek.com>
Fri, 6 Dec 2024 05:57:13 +0000 (13:57 +0800)
committerPing-Ke Shih <pkshih@realtek.com>
Thu, 12 Dec 2024 02:19:10 +0000 (10:19 +0800)
Given the performance trade-off associated with firmware training
HE GI/LTF, especially in high attenuation environments, we have
decided to utilize a constant value instead.

Signed-off-by: Kuan-Chung Chen <damon.chen@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/20241206055716.18598-5-pkshih@realtek.com
drivers/net/wireless/realtek/rtw89/core.h
drivers/net/wireless/realtek/rtw89/phy.c

index ec2a80af04bb4db814fb1f433eb0e4c4ea67ddbc..15967978bf4ae0bc51503f732f665773b07293de 100644 (file)
@@ -6875,6 +6875,16 @@ bool rtw89_sta_has_beamformer_cap(struct ieee80211_link_sta *link_sta)
        return false;
 }
 
+static inline
+bool rtw89_sta_link_has_su_mu_4xhe08(struct ieee80211_link_sta *link_sta)
+{
+       if (link_sta->he_cap.he_cap_elem.phy_cap_info[7] &
+           IEEE80211_HE_PHY_CAP7_HE_SU_MU_PPDU_4XLTF_AND_08_US_GI)
+               return true;
+
+       return false;
+}
+
 static inline struct rtw89_fw_suit *rtw89_fw_suit_get(struct rtw89_dev *rtwdev,
                                                      enum rtw89_fw_type type)
 {
index 1d4d3dcce0604bcfe196b22c3b15383c97a769e2..604ea048c3abceeaa59a1f1575eeb6f14d40c22a 100644 (file)
@@ -264,16 +264,26 @@ rtw89_ra_mask_eht_rates[4] = {RA_MASK_EHT_1SS_RATES, RA_MASK_EHT_2SS_RATES,
 
 static void rtw89_phy_ra_gi_ltf(struct rtw89_dev *rtwdev,
                                struct rtw89_sta_link *rtwsta_link,
+                               struct ieee80211_link_sta *link_sta,
                                const struct rtw89_chan *chan,
                                bool *fix_giltf_en, u8 *fix_giltf)
 {
        struct cfg80211_bitrate_mask *mask = &rtwsta_link->mask;
        u8 band = chan->band_type;
        enum nl80211_band nl_band = rtw89_hw_to_nl80211_band(band);
-       u8 he_gi = mask->control[nl_band].he_gi;
        u8 he_ltf = mask->control[nl_band].he_ltf;
+       u8 he_gi = mask->control[nl_band].he_gi;
 
-       if (!rtwsta_link->use_cfg_mask)
+       *fix_giltf_en = true;
+
+       if (rtwdev->chip->chip_id == RTL8852C &&
+           chan->band_width == RTW89_CHANNEL_WIDTH_160 &&
+           rtw89_sta_link_has_su_mu_4xhe08(link_sta))
+               *fix_giltf = RTW89_GILTF_SGI_4XHE08;
+       else
+               *fix_giltf = RTW89_GILTF_2XHE08;
+
+       if (!(rtwsta_link->use_cfg_mask && link_sta->he_cap.has_he))
                return;
 
        if (he_ltf == 2 && he_gi == 2) {
@@ -288,12 +298,7 @@ static void rtw89_phy_ra_gi_ltf(struct rtw89_dev *rtwdev,
                *fix_giltf = RTW89_GILTF_1XHE16;
        } else if (he_ltf == 0 && he_gi == 0) {
                *fix_giltf = RTW89_GILTF_1XHE08;
-       } else {
-               *fix_giltf_en = false;
-               return;
        }
-
-       *fix_giltf_en = true;
 }
 
 static void rtw89_phy_ra_sta_update(struct rtw89_dev *rtwdev,
@@ -326,6 +331,8 @@ static void rtw89_phy_ra_sta_update(struct rtw89_dev *rtwdev,
                mode |= RTW89_RA_MODE_EHT;
                ra_mask |= get_eht_ra_mask(link_sta);
                high_rate_masks = rtw89_ra_mask_eht_rates;
+               rtw89_phy_ra_gi_ltf(rtwdev, rtwsta_link, link_sta,
+                                   chan, &fix_giltf_en, &fix_giltf);
        } else if (link_sta->he_cap.has_he) {
                mode |= RTW89_RA_MODE_HE;
                csi_mode = RTW89_RA_RPT_MODE_HE;
@@ -337,7 +344,8 @@ static void rtw89_phy_ra_sta_update(struct rtw89_dev *rtwdev,
                if (link_sta->he_cap.he_cap_elem.phy_cap_info[1] &
                    IEEE80211_HE_PHY_CAP1_LDPC_CODING_IN_PAYLOAD)
                        ldpc_en = 1;
-               rtw89_phy_ra_gi_ltf(rtwdev, rtwsta_link, chan, &fix_giltf_en, &fix_giltf);
+               rtw89_phy_ra_gi_ltf(rtwdev, rtwsta_link, link_sta,
+                                   chan, &fix_giltf_en, &fix_giltf);
        } else if (link_sta->vht_cap.vht_supported) {
                u16 mcs_map = le16_to_cpu(link_sta->vht_cap.vht_mcs.rx_mcs_map);