]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
wifi: ath12k: Move MSDU END TLV processing to Wi-Fi 7 module
authorAlok Singh <quic_aloksing@quicinc.com>
Mon, 10 Nov 2025 10:37:12 +0000 (16:07 +0530)
committerJeff Johnson <jeff.johnson@oss.qualcomm.com>
Tue, 11 Nov 2025 15:21:34 +0000 (07:21 -0800)
Separate Wi-Fi 7-specific monitor handling from ath12k common code to
improve modularity.

Move the following MSDU END TLV processing functions into wifi7/dp_mon.c
and rename them with the ath12k_wifi7_ prefix:
- ath12k_dp_mon_parse_rx_msdu_end_err()
- ath12k_dp_mon_parse_status_msdu_end()
- ath12k_dp_mon_next_link_desc_get()

Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.5-01651-QCAHKSWPL_SILICONZ-1

Signed-off-by: Alok Singh <quic_aloksing@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/20251110103713.3484779-12-quic_aloksing@quicinc.com
Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
drivers/net/wireless/ath/ath12k/dp_mon.c
drivers/net/wireless/ath/ath12k/dp_mon.h
drivers/net/wireless/ath/ath12k/wifi7/dp_mon.c

index db67d81d557f9011b03ecb1b9d89cd192ed16e85..4f7c7748be6c956ea5f8d7ec93882ee20e00bcfd 100644 (file)
 #include "dp_tx.h"
 #include "peer.h"
 
-static void ath12k_dp_mon_parse_rx_msdu_end_err(u32 info, u32 *errmap)
-{
-       if (info & RX_MSDU_END_INFO13_FCS_ERR)
-               *errmap |= HAL_RX_MPDU_ERR_FCS;
-
-       if (info & RX_MSDU_END_INFO13_DECRYPT_ERR)
-               *errmap |= HAL_RX_MPDU_ERR_DECRYPT;
-
-       if (info & RX_MSDU_END_INFO13_TKIP_MIC_ERR)
-               *errmap |= HAL_RX_MPDU_ERR_TKIP_MIC;
-
-       if (info & RX_MSDU_END_INFO13_A_MSDU_ERROR)
-               *errmap |= HAL_RX_MPDU_ERR_AMSDU_ERR;
-
-       if (info & RX_MSDU_END_INFO13_OVERFLOW_ERR)
-               *errmap |= HAL_RX_MPDU_ERR_OVERFLOW;
-
-       if (info & RX_MSDU_END_INFO13_MSDU_LEN_ERR)
-               *errmap |= HAL_RX_MPDU_ERR_MSDU_LEN;
-
-       if (info & RX_MSDU_END_INFO13_MPDU_LEN_ERR)
-               *errmap |= HAL_RX_MPDU_ERR_MPDU_LEN;
-}
-
-void
-ath12k_dp_mon_parse_status_msdu_end(struct ath12k_mon_data *pmon,
-                                   const struct hal_rx_msdu_end *msdu_end)
-{
-       ath12k_dp_mon_parse_rx_msdu_end_err(__le32_to_cpu(msdu_end->info2),
-                                           &pmon->err_bitmap);
-       pmon->decap_format = le32_get_bits(msdu_end->info1,
-                                          RX_MSDU_END_INFO11_DECAP_FORMAT);
-}
-EXPORT_SYMBOL(ath12k_dp_mon_parse_status_msdu_end);
-
 static void
 ath12k_dp_mon_fill_rx_stats_info(struct hal_rx_mon_ppdu_info *ppdu_info,
                                 struct ieee80211_rx_status *rx_status)
@@ -139,21 +104,6 @@ u32 ath12k_dp_mon_comp_ppduid(u32 msdu_ppdu_id, u32 *ppdu_id)
 }
 EXPORT_SYMBOL(ath12k_dp_mon_comp_ppduid);
 
-void ath12k_dp_mon_next_link_desc_get(struct ath12k_base *ab,
-                                     struct hal_rx_msdu_link *msdu_link,
-                                     dma_addr_t *paddr, u32 *sw_cookie, u8 *rbm,
-                                     struct ath12k_buffer_addr **pp_buf_addr_info)
-{
-       struct ath12k_buffer_addr *buf_addr_info;
-
-       buf_addr_info = &msdu_link->buf_addr_info;
-
-       ath12k_hal_rx_buf_addr_info_get(&ab->hal, buf_addr_info, paddr, sw_cookie, rbm);
-
-       *pp_buf_addr_info = buf_addr_info;
-}
-EXPORT_SYMBOL(ath12k_dp_mon_next_link_desc_get);
-
 static void
 ath12k_dp_mon_fill_rx_rate(struct ath12k_pdev_dp *dp_pdev,
                           struct hal_rx_mon_ppdu_info *ppdu_info,
index 6dac4e9569b6eb4ff1a34ee41c1533402ef2ce2f..f5debe947ad69b2cb8ca432e344e3199d51a1a8d 100644 (file)
@@ -8,8 +8,6 @@
 #define ATH12K_DP_MON_H
 
 #include "core.h"
-#include "wifi7/hal_desc.h"
-#include "wifi7/hal_rx.h"
 
 #define ATH12K_MON_RX_DOT11_OFFSET     5
 #define ATH12K_MON_RX_PKT_OFFSET       8
@@ -110,16 +108,9 @@ void
 ath12k_dp_mon_get_buf_len(struct hal_rx_msdu_desc_info *info,
                          bool *is_frag, u32 *total_len,
                          u32 *frag_len, u32 *msdu_cnt);
-void ath12k_dp_mon_next_link_desc_get(struct ath12k_base *ab,
-                                     struct hal_rx_msdu_link *msdu_link,
-                                     dma_addr_t *paddr, u32 *sw_cookie, u8 *rbm,
-                                     struct ath12k_buffer_addr **pp_buf_addr_info);
 u32 ath12k_dp_mon_comp_ppduid(u32 msdu_ppdu_id, u32 *ppdu_id);
 int
 ath12k_dp_mon_parse_status_buf(struct ath12k_pdev_dp *dp_pdev,
                               struct ath12k_mon_data *pmon,
                               const struct dp_mon_packet_info *packet_info);
-void
-ath12k_dp_mon_parse_status_msdu_end(struct ath12k_mon_data *pmon,
-                                   const struct hal_rx_msdu_end *msdu_end);
 #endif
index 8d913d09f8826bb7a6dfdfe505c6756642cb386d..6d829d3e1b0c940b9ffcc1cf69ec1aecd73acffe 100644 (file)
@@ -1425,6 +1425,40 @@ ath12k_wifi7_dp_mon_parse_eht_sig_hdr(struct hal_rx_mon_ppdu_info *ppdu_info,
                ath12k_wifi7_dp_mon_hal_rx_parse_eht_sig_ofdma(tlv_data, ppdu_info);
 }
 
+static void ath12k_wifi7_dp_mon_parse_rx_msdu_end_err(u32 info, u32 *errmap)
+{
+       if (info & RX_MSDU_END_INFO13_FCS_ERR)
+               *errmap |= HAL_RX_MPDU_ERR_FCS;
+
+       if (info & RX_MSDU_END_INFO13_DECRYPT_ERR)
+               *errmap |= HAL_RX_MPDU_ERR_DECRYPT;
+
+       if (info & RX_MSDU_END_INFO13_TKIP_MIC_ERR)
+               *errmap |= HAL_RX_MPDU_ERR_TKIP_MIC;
+
+       if (info & RX_MSDU_END_INFO13_A_MSDU_ERROR)
+               *errmap |= HAL_RX_MPDU_ERR_AMSDU_ERR;
+
+       if (info & RX_MSDU_END_INFO13_OVERFLOW_ERR)
+               *errmap |= HAL_RX_MPDU_ERR_OVERFLOW;
+
+       if (info & RX_MSDU_END_INFO13_MSDU_LEN_ERR)
+               *errmap |= HAL_RX_MPDU_ERR_MSDU_LEN;
+
+       if (info & RX_MSDU_END_INFO13_MPDU_LEN_ERR)
+               *errmap |= HAL_RX_MPDU_ERR_MPDU_LEN;
+}
+
+static void
+ath12k_wifi7_dp_mon_parse_status_msdu_end(struct ath12k_mon_data *pmon,
+                                         const struct hal_rx_msdu_end *msdu_end)
+{
+       ath12k_wifi7_dp_mon_parse_rx_msdu_end_err(__le32_to_cpu(msdu_end->info2),
+                                                 &pmon->err_bitmap);
+       pmon->decap_format = le32_get_bits(msdu_end->info1,
+                                          RX_MSDU_END_INFO11_DECAP_FORMAT);
+}
+
 static enum hal_rx_mon_status
 ath12k_wifi7_dp_mon_rx_parse_status_tlv(struct ath12k_pdev_dp *dp_pdev,
                                        struct ath12k_mon_data *pmon,
@@ -1665,7 +1699,7 @@ ath12k_wifi7_dp_mon_rx_parse_status_tlv(struct ath12k_pdev_dp *dp_pdev,
        case HAL_MON_BUF_ADDR:
                return HAL_RX_MON_STATUS_BUF_ADDR;
        case HAL_RX_MSDU_END:
-               ath12k_dp_mon_parse_status_msdu_end(pmon, tlv_data);
+               ath12k_wifi7_dp_mon_parse_status_msdu_end(pmon, tlv_data);
                return HAL_RX_MON_STATUS_MSDU_END;
        case HAL_RX_MPDU_END:
                return HAL_RX_MON_STATUS_MPDU_END;
@@ -2417,6 +2451,21 @@ ath12k_wifi7_dp_mon_tx_parse_mon_status(struct ath12k_pdev_dp *dp_pdev,
        return tlv_status;
 }
 
+static void
+ath12k_wifi7_dp_mon_next_link_desc_get(struct ath12k_base *ab,
+                                      struct hal_rx_msdu_link *msdu_link,
+                                      dma_addr_t *paddr, u32 *sw_cookie, u8 *rbm,
+                                      struct ath12k_buffer_addr **pp_buf_addr_info)
+{
+       struct ath12k_buffer_addr *buf_addr_info;
+
+       buf_addr_info = &msdu_link->buf_addr_info;
+
+       ath12k_wifi7_hal_rx_buf_addr_info_get(buf_addr_info, paddr, sw_cookie, rbm);
+
+       *pp_buf_addr_info = buf_addr_info;
+}
+
 static u32
 ath12k_wifi7_dp_rx_mon_mpdu_pop(struct ath12k *ar, int mac_id,
                                void *ring_entry, struct sk_buff **head_msdu,
@@ -2583,9 +2632,10 @@ next_msdu:
                ath12k_wifi7_hal_rx_buf_addr_info_set(&buf_info, paddr,
                                                      sw_cookie, rbm);
 
-               ath12k_dp_mon_next_link_desc_get(ab, msdu_link_desc, &paddr,
-                                                &sw_cookie, &rbm,
-                                                &p_buf_addr_info);
+               ath12k_wifi7_dp_mon_next_link_desc_get(ab,
+                                                      msdu_link_desc, &paddr,
+                                                      &sw_cookie, &rbm,
+                                                      &p_buf_addr_info);
 
                ath12k_dp_arch_rx_link_desc_return(ar->ab->dp, &buf_info,
                                                   HAL_WBM_REL_BM_ACT_PUT_IN_IDLE);