wifi: ath12k: enable 320 MHz bandwidth for 6 GHz band in EHT PHY capability for WCN7850
authorWen Gong <quic_wgong@quicinc.com>
Mon, 28 Aug 2023 04:04:20 +0000 (00:04 -0400)
committerKalle Valo <quic_kvalo@quicinc.com>
Wed, 20 Sep 2023 13:24:30 +0000 (16:24 +0300)
320 MHz bandwidth is reported only for single PHY mode for WCN7850, get it
from WMI_HOST_HW_MODE_SINGLE ath12k_wmi_caps_ext_params and report it for
6 GHz band.

After this patch, "iw list" shows 320 MHz support for WCN7850:

EHT Iftypes: managed
        EHT PHY Capabilities: (0xe26f090010768800):
                320MHz in 6GHz Supported
        EHT bw=320 MHz, max NSS for MCS 8-9: Rx=0, Tx=0
        EHT bw=320 MHz, max NSS for MCS 10-11: Rx=0, Tx=0
        EHT bw=320 MHz, max NSS for MCS 12-13: Rx=0, Tx=0

Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0-03427-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1.15378.4

Signed-off-by: Wen Gong <quic_wgong@quicinc.com>
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
Link: https://lore.kernel.org/r/20230828040420.2165-1-quic_wgong@quicinc.com
drivers/net/wireless/ath/ath12k/wmi.c

index ef0f3cf35cfd1d3861cb13d07a6b3401a543c3d4..acc5fc8fbce6c24911cdd3852a6b15ee6530e4d1 100644 (file)
@@ -4153,14 +4153,22 @@ static void ath12k_wmi_eht_caps_parse(struct ath12k_pdev *pdev, u32 band,
                                       __le32 cap_info_internal)
 {
        struct ath12k_band_cap *cap_band = &pdev->cap.band[band];
+       u32 support_320mhz;
        u8 i;
 
+       if (band == NL80211_BAND_6GHZ)
+               support_320mhz = cap_band->eht_cap_phy_info[0] &
+                                       IEEE80211_EHT_PHY_CAP0_320MHZ_IN_6GHZ;
+
        for (i = 0; i < WMI_MAX_EHTCAP_MAC_SIZE; i++)
                cap_band->eht_cap_mac_info[i] = le32_to_cpu(cap_mac_info[i]);
 
        for (i = 0; i < WMI_MAX_EHTCAP_PHY_SIZE; i++)
                cap_band->eht_cap_phy_info[i] = le32_to_cpu(cap_phy_info[i]);
 
+       if (band == NL80211_BAND_6GHZ)
+               cap_band->eht_cap_phy_info[0] |= support_320mhz;
+
        cap_band->eht_mcs_20_only = le32_to_cpu(supp_mcs[0]);
        cap_band->eht_mcs_80 = le32_to_cpu(supp_mcs[1]);
        if (band != NL80211_BAND_2GHZ) {
@@ -4182,10 +4190,19 @@ ath12k_wmi_tlv_mac_phy_caps_ext_parse(struct ath12k_base *ab,
                                      const struct ath12k_wmi_caps_ext_params *caps,
                                      struct ath12k_pdev *pdev)
 {
-       u32 bands;
+       struct ath12k_band_cap *cap_band;
+       u32 bands, support_320mhz;
        int i;
 
        if (ab->hw_params->single_pdev_only) {
+               if (caps->hw_mode_id == WMI_HOST_HW_MODE_SINGLE) {
+                       support_320mhz = le32_to_cpu(caps->eht_cap_phy_info_5ghz[0]) &
+                               IEEE80211_EHT_PHY_CAP0_320MHZ_IN_6GHZ;
+                       cap_band = &pdev->cap.band[NL80211_BAND_6GHZ];
+                       cap_band->eht_cap_phy_info[0] |= support_320mhz;
+                       return 0;
+               }
+
                for (i = 0; i < ab->fw_pdev_count; i++) {
                        struct ath12k_fw_pdev *fw_pdev = &ab->fw_pdev[i];
 
@@ -4241,7 +4258,8 @@ static int ath12k_wmi_tlv_mac_phy_caps_ext(struct ath12k_base *ab, u16 tag,
                return -EPROTO;
 
        if (ab->hw_params->single_pdev_only) {
-               if (ab->wmi_ab.preferred_hw_mode != le32_to_cpu(caps->hw_mode_id))
+               if (ab->wmi_ab.preferred_hw_mode != le32_to_cpu(caps->hw_mode_id) &&
+                   caps->hw_mode_id != WMI_HOST_HW_MODE_SINGLE)
                        return 0;
        } else {
                for (i = 0; i < ab->num_radios; i++) {