]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
wifi: ath12k: add multi device support for WBM idle ring buffer setup
authorKarthikeyan Periyasamy <quic_periyasa@quicinc.com>
Fri, 3 May 2024 10:34:39 +0000 (13:34 +0300)
committerKalle Valo <quic_kvalo@quicinc.com>
Fri, 3 May 2024 13:19:24 +0000 (16:19 +0300)
Currently, inter device MLO is not supported. Therefore, the WBM idle ring
buffers choose the implicit return buffer manager (DEV0_IDLE_DESC_LIST).
However, this implicit return buffer manager design is not meeting the
requirements to support inter device MLO. In inter device MLO, multiple
devices participate. The device specific WBM idle ring buffers transmit
to multiple device REO rings. To distinguish between device specific WBM
idle buffers, the setup configuration need to choose a different return
buffer manager based on the unique identifier (device index).

Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1

Signed-off-by: Karthikeyan Periyasamy <quic_periyasa@quicinc.com>
Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
Link: https://msgid.link/20240430165811.1377182-5-quic_periyasa@quicinc.com
drivers/net/wireless/ath/ath12k/dp.c

index f41b3f9dac3d5b6e176ac85f27a72e513f461fb3..72ea9baaf8d70e7fc2bce0d1c6379ee0243fc665 100644 (file)
@@ -1589,6 +1589,24 @@ static int ath12k_dp_reoq_lut_setup(struct ath12k_base *ab)
        return 0;
 }
 
+static enum hal_rx_buf_return_buf_manager
+ath12k_dp_get_idle_link_rbm(struct ath12k_base *ab)
+{
+       switch (ab->device_id) {
+       case 0:
+               return HAL_RX_BUF_RBM_WBM_DEV0_IDLE_DESC_LIST;
+       case 1:
+               return HAL_RX_BUF_RBM_WBM_DEV1_IDLE_DESC_LIST;
+       case 2:
+               return HAL_RX_BUF_RBM_WBM_DEV2_IDLE_DESC_LIST;
+       default:
+               ath12k_warn(ab, "invalid %d device id, so choose default rbm\n",
+                           ab->device_id);
+               WARN_ON(1);
+               return HAL_RX_BUF_RBM_WBM_DEV0_IDLE_DESC_LIST;
+       }
+}
+
 int ath12k_dp_alloc(struct ath12k_base *ab)
 {
        struct ath12k_dp *dp = &ab->dp;
@@ -1605,7 +1623,7 @@ int ath12k_dp_alloc(struct ath12k_base *ab)
        spin_lock_init(&dp->reo_cmd_lock);
 
        dp->reo_cmd_cache_flush_count = 0;
-       dp->idle_link_rbm = HAL_RX_BUF_RBM_WBM_DEV0_IDLE_DESC_LIST;
+       dp->idle_link_rbm = ath12k_dp_get_idle_link_rbm(ab);
 
        ret = ath12k_wbm_idle_ring_setup(ab, &n_link_desc);
        if (ret) {