wifi: ath12k: add helper function to init partner cmem configuration
authorKarthikeyan Periyasamy <quic_periyasa@quicinc.com>
Mon, 9 Dec 2024 18:54:15 +0000 (20:54 +0200)
committerJeff Johnson <jeff.johnson@oss.qualcomm.com>
Mon, 16 Dec 2024 20:46:58 +0000 (12:46 -0800)
In the Inter Multi-Link Operation, the primary device is expected to receive
the partner device buffer. Therefore, each device initializes the partner
device buffer in their cmem configuration. So add a helper function to
initialize the partner device buffer in their cmem configuration.

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: Karthikeyan Periyasamy <quic_periyasa@quicinc.com>
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
Link: https://patch.msgid.link/20241209185421.376381-4-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/dp.c
drivers/net/wireless/ath/ath12k/dp.h

index af642b466ea0d557f1599fae8b0d4eb5c3e02a67..ff79cb910523a5e7d728a217e7bad4ad61508076 100644 (file)
@@ -930,7 +930,7 @@ out:
 
 static int ath12k_core_mlo_setup(struct ath12k_hw_group *ag)
 {
-       int ret;
+       int ret, i;
 
        if (!ag->mlo_capable || ag->num_devices == 1)
                return 0;
@@ -939,6 +939,9 @@ static int ath12k_core_mlo_setup(struct ath12k_hw_group *ag)
        if (ret)
                return ret;
 
+       for (i = 0; i < ag->num_devices; i++)
+               ath12k_dp_partner_cc_init(ag->ab[i]);
+
        ret = ath12k_mac_mlo_ready(ag);
        if (ret)
                goto err_mlo_teardown;
index 9a7df54bf5709745989c04bbeb8c74d72799792a..9e5a4e75f2f62fbd3f7d9f7e639a00d766333534 100644 (file)
@@ -1522,6 +1522,19 @@ static int ath12k_dp_cmem_init(struct ath12k_base *ab,
        return 0;
 }
 
+void ath12k_dp_partner_cc_init(struct ath12k_base *ab)
+{
+       struct ath12k_hw_group *ag = ab->ag;
+       int i;
+
+       for (i = 0; i < ag->num_devices; i++) {
+               if (ag->ab[i] == ab)
+                       continue;
+
+               ath12k_dp_cmem_init(ab, &ag->ab[i]->dp, ATH12K_DP_RX_DESC);
+       }
+}
+
 static int ath12k_dp_cc_init(struct ath12k_base *ab)
 {
        struct ath12k_dp *dp = &ab->dp;
index d3f3d39a1cd0f5f213a1d5420d4a0b16b2f7bb7d..7700828375e3e18d06f7b613ece32bb9d9ca6d94 100644 (file)
@@ -1806,6 +1806,7 @@ void ath12k_dp_vdev_tx_attach(struct ath12k *ar, struct ath12k_link_vif *arvif);
 void ath12k_dp_free(struct ath12k_base *ab);
 int ath12k_dp_alloc(struct ath12k_base *ab);
 void ath12k_dp_cc_config(struct ath12k_base *ab);
+void ath12k_dp_partner_cc_init(struct ath12k_base *ab);
 int ath12k_dp_pdev_alloc(struct ath12k_base *ab);
 void ath12k_dp_pdev_pre_alloc(struct ath12k *ar);
 void ath12k_dp_pdev_free(struct ath12k_base *ab);