]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
wifi: ath12k: Move arch specific REO functions to wifi7 directory
authorPavankumar Nandeshwar <quic_pnandesh@quicinc.com>
Thu, 28 Aug 2025 17:35:46 +0000 (23:05 +0530)
committerJeff Johnson <jeff.johnson@oss.qualcomm.com>
Wed, 3 Sep 2025 17:06:59 +0000 (10:06 -0700)
Move arch specific REO functions to wifi7 directory.

The moved APIs will be a part of dp_rx.c file inside wifi7 directory.
wifi7/dp_rx.c file will continue to be part of ath12k.ko temporarily
until the corresponding infra for movement to ath12k_wifi7.ko arrives
in upcoming patches.

Architecture specific APIs:
ath12k_dp_setup_pn_check_reo_cmd
ath12k_dp_rx_assign_reoq

Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.4.1-00199-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: Pavankumar Nandeshwar <quic_pnandesh@quicinc.com>
Signed-off-by: Ripan Deuri <quic_rdeuri@quicinc.com>
Reviewed-by: Vasanthakumar Thiagarajan <vasanthakumar.thiagarajan@oss.qualcomm.com>
Reviewed-by: Baochen Qiang <baochen.qiang@oss.qualcomm.com>
Link: https://patch.msgid.link/20250828173553.3341351-14-quic_rdeuri@quicinc.com
Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
drivers/net/wireless/ath/ath12k/dp_rx.c
drivers/net/wireless/ath/ath12k/wifi7/dp_rx.c
drivers/net/wireless/ath/ath12k/wifi7/dp_rx.h

index dd771063f5915ed9726cfc169637621ed7fec027..22d9c2d8c4e3603fe5b1bb47c2a206d6b1b5efcd 100644 (file)
@@ -13,6 +13,7 @@
 #include "wifi7/hal_desc.h"
 #include "hw.h"
 #include "dp_rx.h"
+#include "wifi7/dp_rx.h"
 #include "wifi7/hal_rx.h"
 #include "dp_tx.h"
 #include "peer.h"
@@ -728,57 +729,6 @@ static int ath12k_peer_rx_tid_reo_update(struct ath12k *ar,
        return 0;
 }
 
-static int ath12k_dp_rx_assign_reoq(struct ath12k_base *ab,
-                                   struct ath12k_sta *ahsta,
-                                   struct ath12k_dp_rx_tid *rx_tid,
-                                   u16 ssn, enum hal_pn_type pn_type)
-{
-       u32 ba_win_sz = rx_tid->ba_win_sz;
-       struct ath12k_reoq_buf *buf;
-       void *vaddr, *vaddr_aligned;
-       dma_addr_t paddr_aligned;
-       u8 tid = rx_tid->tid;
-       u32 hw_desc_sz;
-       int ret;
-
-       buf = &ahsta->reoq_bufs[tid];
-       if (!buf->vaddr) {
-               /* TODO: Optimize the memory allocation for qos tid based on
-                * the actual BA window size in REO tid update path.
-                */
-               if (tid == HAL_DESC_REO_NON_QOS_TID)
-                       hw_desc_sz = ath12k_hal_reo_qdesc_size(ba_win_sz, tid);
-               else
-                       hw_desc_sz = ath12k_hal_reo_qdesc_size(DP_BA_WIN_SZ_MAX, tid);
-
-               vaddr = kzalloc(hw_desc_sz + HAL_LINK_DESC_ALIGN - 1, GFP_ATOMIC);
-               if (!vaddr)
-                       return -ENOMEM;
-
-               vaddr_aligned = PTR_ALIGN(vaddr, HAL_LINK_DESC_ALIGN);
-
-               ath12k_hal_reo_qdesc_setup(vaddr_aligned, tid, ba_win_sz,
-                                          ssn, pn_type);
-
-               paddr_aligned = dma_map_single(ab->dev, vaddr_aligned, hw_desc_sz,
-                                              DMA_BIDIRECTIONAL);
-               ret = dma_mapping_error(ab->dev, paddr_aligned);
-               if (ret) {
-                       kfree(vaddr);
-                       return ret;
-               }
-
-               buf->vaddr = vaddr;
-               buf->paddr_aligned = paddr_aligned;
-               buf->size = hw_desc_sz;
-       }
-
-       rx_tid->qbuf = *buf;
-       rx_tid->active = true;
-
-       return 0;
-}
-
 int ath12k_dp_rx_peer_tid_setup(struct ath12k *ar, const u8 *peer_mac, int vdev_id,
                                u8 tid, u32 ba_win_sz, u16 ssn,
                                enum hal_pn_type pn_type)
@@ -958,36 +908,6 @@ int ath12k_dp_rx_ampdu_stop(struct ath12k *ar,
        return ret;
 }
 
-static void ath12k_dp_setup_pn_check_reo_cmd(struct ath12k_hal_reo_cmd *cmd,
-                                            struct ath12k_dp_rx_tid *rx_tid,
-                                            u32 cipher, enum set_key_cmd key_cmd)
-{
-       cmd->flag = HAL_REO_CMD_FLG_NEED_STATUS;
-       cmd->upd0 = HAL_REO_CMD_UPD0_PN |
-                       HAL_REO_CMD_UPD0_PN_SIZE |
-                       HAL_REO_CMD_UPD0_PN_VALID |
-                       HAL_REO_CMD_UPD0_PN_CHECK |
-                       HAL_REO_CMD_UPD0_SVLD;
-
-       switch (cipher) {
-       case WLAN_CIPHER_SUITE_TKIP:
-       case WLAN_CIPHER_SUITE_CCMP:
-       case WLAN_CIPHER_SUITE_CCMP_256:
-       case WLAN_CIPHER_SUITE_GCMP:
-       case WLAN_CIPHER_SUITE_GCMP_256:
-               if (key_cmd == SET_KEY) {
-                       cmd->upd1 |= HAL_REO_CMD_UPD1_PN_CHECK;
-                       cmd->pn_size = 48;
-               }
-               break;
-       default:
-               break;
-       }
-
-       cmd->addr_lo = lower_32_bits(rx_tid->qbuf.paddr_aligned);
-       cmd->addr_hi = upper_32_bits(rx_tid->qbuf.paddr_aligned);
-}
-
 int ath12k_dp_rx_peer_pn_replay_config(struct ath12k_link_vif *arvif,
                                       const u8 *peer_addr,
                                       enum set_key_cmd key_cmd,
index cbc51a9a2c42b103f56e50e799465d97bdd89bbf..bcdfa19a2e5f4ade21a690c43262831d4ba7c758 100644 (file)
@@ -8,6 +8,56 @@
 #include "../dp_tx.h"
 #include "../peer.h"
 
+int ath12k_dp_rx_assign_reoq(struct ath12k_base *ab, struct ath12k_sta *ahsta,
+                            struct ath12k_dp_rx_tid *rx_tid,
+                            u16 ssn, enum hal_pn_type pn_type)
+{
+       u32 ba_win_sz = rx_tid->ba_win_sz;
+       struct ath12k_reoq_buf *buf;
+       void *vaddr, *vaddr_aligned;
+       dma_addr_t paddr_aligned;
+       u8 tid = rx_tid->tid;
+       u32 hw_desc_sz;
+       int ret;
+
+       buf = &ahsta->reoq_bufs[tid];
+       if (!buf->vaddr) {
+               /* TODO: Optimize the memory allocation for qos tid based on
+                * the actual BA window size in REO tid update path.
+                */
+               if (tid == HAL_DESC_REO_NON_QOS_TID)
+                       hw_desc_sz = ath12k_hal_reo_qdesc_size(ba_win_sz, tid);
+               else
+                       hw_desc_sz = ath12k_hal_reo_qdesc_size(DP_BA_WIN_SZ_MAX, tid);
+
+               vaddr = kzalloc(hw_desc_sz + HAL_LINK_DESC_ALIGN - 1, GFP_ATOMIC);
+               if (!vaddr)
+                       return -ENOMEM;
+
+               vaddr_aligned = PTR_ALIGN(vaddr, HAL_LINK_DESC_ALIGN);
+
+               ath12k_hal_reo_qdesc_setup(vaddr_aligned, tid, ba_win_sz,
+                                          ssn, pn_type);
+
+               paddr_aligned = dma_map_single(ab->dev, vaddr_aligned, hw_desc_sz,
+                                              DMA_BIDIRECTIONAL);
+               ret = dma_mapping_error(ab->dev, paddr_aligned);
+               if (ret) {
+                       kfree(vaddr);
+                       return ret;
+               }
+
+               buf->vaddr = vaddr;
+               buf->paddr_aligned = paddr_aligned;
+               buf->size = hw_desc_sz;
+       }
+
+       rx_tid->qbuf = *buf;
+       rx_tid->active = true;
+
+       return 0;
+}
+
 static void ath12k_dp_rx_h_csum_offload(struct sk_buff *msdu,
                                        struct ath12k_dp_rx_info *rx_info)
 {
@@ -1354,6 +1404,36 @@ static void ath12k_dp_rx_wbm_err(struct ath12k *ar,
        ath12k_dp_rx_deliver_msdu(ar, napi, msdu, &rx_info);
 }
 
+void ath12k_dp_setup_pn_check_reo_cmd(struct ath12k_hal_reo_cmd *cmd,
+                                     struct ath12k_dp_rx_tid *rx_tid,
+                                     u32 cipher, enum set_key_cmd key_cmd)
+{
+       cmd->flag = HAL_REO_CMD_FLG_NEED_STATUS;
+       cmd->upd0 = HAL_REO_CMD_UPD0_PN |
+                       HAL_REO_CMD_UPD0_PN_SIZE |
+                       HAL_REO_CMD_UPD0_PN_VALID |
+                       HAL_REO_CMD_UPD0_PN_CHECK |
+                       HAL_REO_CMD_UPD0_SVLD;
+
+       switch (cipher) {
+       case WLAN_CIPHER_SUITE_TKIP:
+       case WLAN_CIPHER_SUITE_CCMP:
+       case WLAN_CIPHER_SUITE_CCMP_256:
+       case WLAN_CIPHER_SUITE_GCMP:
+       case WLAN_CIPHER_SUITE_GCMP_256:
+               if (key_cmd == SET_KEY) {
+                       cmd->upd1 |= HAL_REO_CMD_UPD1_PN_CHECK;
+                       cmd->pn_size = 48;
+               }
+               break;
+       default:
+               break;
+       }
+
+       cmd->addr_lo = lower_32_bits(rx_tid->qbuf.paddr_aligned);
+       cmd->addr_hi = upper_32_bits(rx_tid->qbuf.paddr_aligned);
+}
+
 int ath12k_dp_rx_process_wbm_err(struct ath12k_base *ab,
                                 struct napi_struct *napi, int budget)
 {
index 63176a53c1e7653b4da48e4cdc217716349d5d24..3589db00c9064dc946502009a316e10745f1731c 100644 (file)
@@ -19,4 +19,10 @@ int ath12k_dp_rx_process(struct ath12k_base *ab, int mac_id,
 void ath12k_dp_rx_process_reo_status(struct ath12k_base *ab);
 int ath12k_dp_rxdma_ring_sel_config_qcn9274(struct ath12k_base *ab);
 int ath12k_dp_rxdma_ring_sel_config_wcn7850(struct ath12k_base *ab);
+void ath12k_dp_setup_pn_check_reo_cmd(struct ath12k_hal_reo_cmd *cmd,
+                                     struct ath12k_dp_rx_tid *rx_tid,
+                                     u32 cipher, enum set_key_cmd key_cmd);
+int ath12k_dp_rx_assign_reoq(struct ath12k_base *ab, struct ath12k_sta *ahsta,
+                            struct ath12k_dp_rx_tid *rx_tid,
+                            u16 ssn, enum hal_pn_type pn_type);
 #endif