ath10k: add a condition to fill the LDPC capability correctly
authorSurabhi Vishnoi <svishnoi@codeaurora.org>
Fri, 1 Feb 2019 05:34:22 +0000 (11:04 +0530)
committerKalle Valo <kvalo@codeaurora.org>
Thu, 7 Feb 2019 14:57:06 +0000 (16:57 +0200)
The firmware advertises the LDPC support information for HT in
HT capability info in the wmi service ready event. To provide
granularity, firmware now advertises WMI_HT_CAP_RX_LDPC and
WMI_HT_CAP_TX_LDPC separately. To support LDPC, host should
also check for WMI_HT_CAP_RX_LDPC and WMI_HT_CAP_TX_LDPC in HT
capabilities.

Add a condition to existing logic in host to know whether firmware
supports LDPC or not.

Tested HW: WCN3990
Tested FW: WLAN.HL.3.1-00784-QCAHLSWMTPLZ-1,
           WLAN.HL.2.0-01617-QCAHLSWMTPLZ-1

Signed-off-by: Surabhi Vishnoi <svishnoi@codeaurora.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/ath/ath10k/mac.c
drivers/net/wireless/ath/ath10k/wmi.h

index 8c6c5152d4166683e0f9bf359a0f93a2e951fb86..a1bb70e073f6e182cd16106ea5718cb0df95fc0a 100644 (file)
@@ -4549,7 +4549,8 @@ static struct ieee80211_sta_ht_cap ath10k_get_ht_cap(struct ath10k *ar)
                ht_cap.cap |= stbc;
        }
 
-       if (ar->ht_cap_info & WMI_HT_CAP_LDPC)
+       if (ar->ht_cap_info & WMI_HT_CAP_LDPC || (ar->ht_cap_info &
+           WMI_HT_CAP_RX_LDPC && (ar->ht_cap_info & WMI_HT_CAP_TX_LDPC)))
                ht_cap.cap |= IEEE80211_HT_CAP_LDPC_CODING;
 
        if (ar->ht_cap_info & WMI_HT_CAP_L_SIG_TXOP_PROT)
index ac04077c4e692c83edfc041fe25e25357a6c25b2..86348418a2780675ed8827a88cb73dbcf66ff248 100644 (file)
@@ -2075,6 +2075,8 @@ enum wmi_channel_change_cause {
 #define WMI_HT_CAP_MPDU_DENSITY           0x0700   /* MPDU Density */
 #define WMI_HT_CAP_MPDU_DENSITY_MASK_SHIFT 8
 #define WMI_HT_CAP_HT40_SGI               0x0800
+#define WMI_HT_CAP_RX_LDPC                0x1000   /* LDPC RX support */
+#define WMI_HT_CAP_TX_LDPC                0x2000   /* LDPC TX support */
 
 #define WMI_HT_CAP_DEFAULT_ALL (WMI_HT_CAP_ENABLED       | \
                                WMI_HT_CAP_HT20_SGI      | \