rtw88: 8723d: some chips don't support LDPC
authorPing-Ke Shih <pkshih@realtek.com>
Mon, 4 May 2020 10:50:07 +0000 (18:50 +0800)
committerKalle Valo <kvalo@codeaurora.org>
Wed, 6 May 2020 08:34:43 +0000 (11:34 +0300)
Some chips are not able to receive LDPC packets. Add an attribute
to rtw_chip_info to determine if the LDPC capability in [ht/vht]_cap
should be advertised or not.

Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Yan-Hsuan Chuang <yhchuang@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20200504105010.10780-6-yhchuang@realtek.com
drivers/net/wireless/realtek/rtw88/main.c
drivers/net/wireless/realtek/rtw88/main.h
drivers/net/wireless/realtek/rtw88/rtw8723d.c
drivers/net/wireless/realtek/rtw88/rtw8822b.c
drivers/net/wireless/realtek/rtw88/rtw8822c.c

index b0dadff0dc7b8140b9914128cb4cc4c9888853bd..f88a7d2370aa8c117e7f383f62d69d4e408648d6 100644 (file)
@@ -933,8 +933,11 @@ static void rtw_init_ht_cap(struct rtw_dev *rtwdev,
        ht_cap->cap = 0;
        ht_cap->cap |= IEEE80211_HT_CAP_SGI_20 |
                        IEEE80211_HT_CAP_MAX_AMSDU |
-                       IEEE80211_HT_CAP_LDPC_CODING |
                        (1 << IEEE80211_HT_CAP_RX_STBC_SHIFT);
+
+       if (rtw_chip_has_rx_ldpc(rtwdev))
+               ht_cap->cap |= IEEE80211_HT_CAP_LDPC_CODING;
+
        if (efuse->hw_cap.bw & BIT(RTW_CHANNEL_WIDTH_40))
                ht_cap->cap |= IEEE80211_HT_CAP_SUP_WIDTH_20_40 |
                                IEEE80211_HT_CAP_DSSSCCK40 |
@@ -968,7 +971,6 @@ static void rtw_init_vht_cap(struct rtw_dev *rtwdev,
 
        vht_cap->vht_supported = true;
        vht_cap->cap = IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_11454 |
-                      IEEE80211_VHT_CAP_RXLDPC |
                       IEEE80211_VHT_CAP_SHORT_GI_80 |
                       IEEE80211_VHT_CAP_TXSTBC |
                       IEEE80211_VHT_CAP_RXSTBC_1 |
@@ -981,6 +983,9 @@ static void rtw_init_vht_cap(struct rtw_dev *rtwdev,
        vht_cap->cap |= (rtwdev->hal.bfee_sts_cap <<
                        IEEE80211_VHT_CAP_BEAMFORMEE_STS_SHIFT);
 
+       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 |
index cb0dd30e9683d0d5d1da666ba54b87349ca264f7..ed9c7163fc4efd9c7135f19902238ed7f0f97f57 100644 (file)
@@ -1085,6 +1085,7 @@ struct rtw_chip_info {
        u8 dig_min;
        u8 txgi_factor;
        bool is_pwr_by_rate_dec;
+       bool rx_ldpc;
        u8 max_power_index;
 
        bool ht_supported;
@@ -1743,6 +1744,11 @@ static inline bool rtw_chip_wcpu_11ac(struct rtw_dev *rtwdev)
        return rtwdev->chip->wlan_cpu == RTW_WCPU_11AC;
 }
 
+static inline bool rtw_chip_has_rx_ldpc(struct rtw_dev *rtwdev)
+{
+       return rtwdev->chip->rx_ldpc;
+}
+
 void rtw_get_channel_params(struct cfg80211_chan_def *chandef,
                            struct rtw_channel_params *ch_param);
 bool check_hw_ready(struct rtw_dev *rtwdev, u32 addr, u32 mask, u32 target);
index 6011ca8352b3d0ef36dd8af4c66e4cc2f7182758..6fe7596d6a11ae85f25172272552735deb3400f7 100644 (file)
@@ -1039,6 +1039,7 @@ struct rtw_chip_info rtw8723d_hw_spec = {
        .rf_tbl = {&rtw8723d_rf_a_tbl},
        .rfe_defs = rtw8723d_rfe_defs,
        .rfe_defs_size = ARRAY_SIZE(rtw8723d_rfe_defs),
+       .rx_ldpc = false,
 };
 EXPORT_SYMBOL(rtw8723d_hw_spec);
 
index ffee8111d14572b33bbc56f929b399e10f446214..f1019e196918521cb58debd800cd63a1d1f4a3ee 100644 (file)
@@ -2447,6 +2447,7 @@ struct rtw_chip_info rtw8822b_hw_spec = {
        .iqk_threshold = 8,
        .bfer_su_max_num = 2,
        .bfer_mu_max_num = 1,
+       .rx_ldpc = true,
 
        .coex_para_ver = 0x19062706,
        .bt_desired_ver = 0x6,
index 38a096d5af6f5ad7c57da8dd41dc23fee0b31683..9a9423e23e9d69341d286cb71cc19161980b851f 100644 (file)
@@ -4312,6 +4312,7 @@ struct rtw_chip_info rtw8822c_hw_spec = {
        .iqk_threshold = 8,
        .bfer_su_max_num = 2,
        .bfer_mu_max_num = 1,
+       .rx_ldpc = true,
 
 #ifdef CONFIG_PM
        .wow_fw_name = "rtw88/rtw8822c_wow_fw.bin",