]> git.baikalelectronics.ru Git - kernel.git/commitdiff
rtw88: 8822c: add tx stbc support under HT mode
authorPo-Hao Huang <phhuang@realtek.com>
Tue, 13 Jul 2021 10:45:23 +0000 (18:45 +0800)
committerKalle Valo <kvalo@codeaurora.org>
Sat, 21 Aug 2021 19:18:06 +0000 (22:18 +0300)
Enabling this improves tx performance for long distance transmission.
We used to enable stbc by the rx stbc cap of the associated station.
But rx cap will be masked out in ieee80211_ht_cap_ie_to_sta_ht_cap
if we do not declare tx stbc.

Signed-off-by: Po-Hao Huang <phhuang@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20210713104524.47101-2-pkshih@realtek.com
drivers/net/wireless/realtek/rtw88/main.c
drivers/net/wireless/realtek/rtw88/main.h
drivers/net/wireless/realtek/rtw88/rtw8822c.c

index c6364837e83bf0811d621fb7a145883e1e55682c..6bb55e663fc36be089198204c623c30c59152bea 100644 (file)
@@ -1338,6 +1338,8 @@ static void rtw_init_ht_cap(struct rtw_dev *rtwdev,
 
        if (rtw_chip_has_rx_ldpc(rtwdev))
                ht_cap->cap |= IEEE80211_HT_CAP_LDPC_CODING;
+       if (rtw_chip_has_tx_stbc(rtwdev))
+               ht_cap->cap |= IEEE80211_HT_CAP_TX_STBC;
 
        if (efuse->hw_cap.bw & BIT(RTW_CHANNEL_WIDTH_40))
                ht_cap->cap |= IEEE80211_HT_CAP_SUP_WIDTH_20_40 |
index e5af375b3dd01594ead117379d903b5a8c6ab385..56812127a0539d67b3961903b3cafc3a721afd10 100644 (file)
@@ -1146,6 +1146,7 @@ struct rtw_chip_info {
        u8 txgi_factor;
        bool is_pwr_by_rate_dec;
        bool rx_ldpc;
+       bool tx_stbc;
        u8 max_power_index;
 
        u16 fw_fifo_addr[RTW_FW_FIFO_MAX];
@@ -1959,6 +1960,11 @@ static inline bool rtw_chip_has_rx_ldpc(struct rtw_dev *rtwdev)
        return rtwdev->chip->rx_ldpc;
 }
 
+static inline bool rtw_chip_has_tx_stbc(struct rtw_dev *rtwdev)
+{
+       return rtwdev->chip->tx_stbc;
+}
+
 static inline void rtw_release_macid(struct rtw_dev *rtwdev, u8 mac_id)
 {
        clear_bit(mac_id, rtwdev->mac_id_map);
index 8bf3cd3a3678d79d66f5b24655c753c41abb5af2..f3ad079967a68b032307d854b51665018e1783b5 100644 (file)
@@ -5288,6 +5288,7 @@ struct rtw_chip_info rtw8822c_hw_spec = {
        .bfer_su_max_num = 2,
        .bfer_mu_max_num = 1,
        .rx_ldpc = true,
+       .tx_stbc = true,
 
 #ifdef CONFIG_PM
        .wow_fw_name = "rtw88/rtw8822c_wow_fw.bin",