wifi: ath12k: add ATH12K_FW_FEATURE_MLO capability firmware feature
authorAditya Kumar Singh <quic_adisi@quicinc.com>
Wed, 11 Dec 2024 15:43:56 +0000 (17:43 +0200)
committerJeff Johnson <jeff.johnson@oss.qualcomm.com>
Mon, 16 Dec 2024 20:46:59 +0000 (12:46 -0800)
To maintain backward compatibility with older firmware versions, introduce a
new feature bit, ATH12K_FW_FEATURE_MLO, to identify whether the firmware
supports MLO. If the firmware-X.bin does not have this bit advertised in the
feature, then MLO capability in the host will be disabled.

This applies only for QCN9274 chipsets.

Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.3.1-00173-QCAHKSWPL_SILICONZ-1
Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3

Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
Link: https://patch.msgid.link/20241211154358.776279-6-kvalo@kernel.org
Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
drivers/net/wireless/ath/ath12k/core.c
drivers/net/wireless/ath/ath12k/fw.h

index ff79cb910523a5e7d728a217e7bad4ad61508076..0c6b35aac96eb8d6660cbf30f807a04619feebda 100644 (file)
@@ -1782,6 +1782,9 @@ static int ath12k_core_hw_group_create(struct ath12k_hw_group *ag)
 
 void ath12k_core_hw_group_set_mlo_capable(struct ath12k_hw_group *ag)
 {
+       struct ath12k_base *ab;
+       int i;
+
        lockdep_assert_held(&ag->mutex);
 
        /* If more than one devices are grouped, then inter MLO
@@ -1790,10 +1793,35 @@ void ath12k_core_hw_group_set_mlo_capable(struct ath12k_hw_group *ag)
         * Only when there is one device, then it depends whether the
         * device can support intra chip MLO or not
         */
-       if (ag->num_devices > 1)
+       if (ag->num_devices > 1) {
                ag->mlo_capable = true;
-       else
-               ag->mlo_capable = ag->ab[0]->single_chip_mlo_supp;
+       } else {
+               ab = ag->ab[0];
+               ag->mlo_capable = ab->single_chip_mlo_supp;
+
+               /* WCN chipsets does not advertise in firmware features
+                * hence skip checking
+                */
+               if (ab->hw_params->def_num_link)
+                       return;
+       }
+
+       if (!ag->mlo_capable)
+               return;
+
+       for (i = 0; i < ag->num_devices; i++) {
+               ab = ag->ab[i];
+               if (!ab)
+                       continue;
+
+               /* even if 1 device's firmware feature indicates MLO
+                * unsupported, make MLO unsupported for the whole group
+                */
+               if (!test_bit(ATH12K_FW_FEATURE_MLO, ab->fw.fw_features)) {
+                       ag->mlo_capable = false;
+                       return;
+               }
+       }
 }
 
 int ath12k_core_init(struct ath12k_base *ab)
index 3ff041f15fa0efd5c12b6dbc41a7ca02bb3360b5..273c003eff3ba709a248fed799fb64326c1e3e92 100644 (file)
@@ -23,6 +23,9 @@ enum ath12k_fw_features {
         */
        ATH12K_FW_FEATURE_MULTI_QRTR_ID = 0,
 
+       /* The firmware supports MLO capability */
+       ATH12K_FW_FEATURE_MLO,
+
        /* keep last */
        ATH12K_FW_FEATURE_COUNT,
 };