]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
wifi: ath12k: Remove hal_rx_ops and merge into hal_ops
authorRipan Deuri <quic_rdeuri@quicinc.com>
Wed, 10 Sep 2025 18:14:13 +0000 (23:44 +0530)
committerJeff Johnson <jeff.johnson@oss.qualcomm.com>
Thu, 11 Sep 2025 14:26:54 +0000 (07:26 -0700)
Move following ops from hal_rx_ops to hal_ops to simplify the HAL interface.

rx_desc_get_l3_pad_bytes
rx_desc_get_mpdu_start_tag
rx_desc_get_mpdu_ppdu_id
rx_desc_get_msdu_payload

Remove the hal_rx_ops as they become unused with this change.

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: 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/20250910181414.2062280-8-quic_rdeuri@quicinc.com
Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
drivers/net/wireless/ath/ath12k/core.h
drivers/net/wireless/ath/ath12k/dp_mon.c
drivers/net/wireless/ath/ath12k/dp_rx.h
drivers/net/wireless/ath/ath12k/hal.c
drivers/net/wireless/ath/ath12k/hal.h
drivers/net/wireless/ath/ath12k/wifi7/pci.c

index b68f063283fe3983763f625dea9ad44ad812d070..9ae98556dd94d4082c02f03ee8cd9f3a5d3210ff 100644 (file)
@@ -1196,8 +1196,6 @@ struct ath12k_base {
                bool fw_features_valid;
        } fw;
 
-       const struct hal_rx_ops *hal_rx_ops;
-
        struct completion restart_completed;
 
 #ifdef CONFIG_ACPI
index 0ae500ec3463287b588af7d52025980edc12dea0..3315a9e3d40ab533faaedee93d9700467b663bde 100644 (file)
@@ -2046,7 +2046,7 @@ ath12k_dp_mon_rx_merg_msdus(struct ath12k *ar,
 
                rx_desc = (struct hal_rx_desc *)head_msdu->data;
                hdr_desc =
-                       ab->hal_rx_ops->rx_desc_get_msdu_payload(rx_desc);
+                       ab->hw_params->hal_ops->rx_desc_get_msdu_payload(rx_desc);
 
                /* Base size */
                wh = (struct ieee80211_hdr_3addr *)hdr_desc;
index 432707d60fca27d60f5f63b1488a1fe3c33bd9d2..ff214bff389b825b933ec3564305bfde7f2637a4 100644 (file)
@@ -109,7 +109,7 @@ static inline u16 ath12k_dp_rx_h_frag_no(struct ath12k_base *ab,
 static inline u8 ath12k_dp_rx_h_l3pad(struct ath12k_base *ab,
                                      struct hal_rx_desc *desc)
 {
-       return ab->hal_rx_ops->rx_desc_get_l3_pad_bytes(desc);
+       return ab->hw_params->hal_ops->rx_desc_get_l3_pad_bytes(desc);
 }
 
 static inline void ath12k_dp_rx_desc_end_tlv_copy(struct ath12k_base *ab,
@@ -129,7 +129,7 @@ static inline void ath12k_dp_rxdesc_set_msdu_len(struct ath12k_base *ab,
 static inline u32 ath12k_dp_rxdesc_get_ppduid(struct ath12k_base *ab,
                                              struct hal_rx_desc *rx_desc)
 {
-       return ab->hal_rx_ops->rx_desc_get_mpdu_ppdu_id(rx_desc);
+       return ab->hw_params->hal_ops->rx_desc_get_mpdu_ppdu_id(rx_desc);
 }
 
 static inline bool ath12k_dp_rxdesc_mpdu_valid(struct ath12k_base *ab,
@@ -137,7 +137,7 @@ static inline bool ath12k_dp_rxdesc_mpdu_valid(struct ath12k_base *ab,
 {
        u32 tlv_tag;
 
-       tlv_tag = ab->hal_rx_ops->rx_desc_get_mpdu_start_tag(rx_desc);
+       tlv_tag = ab->hw_params->hal_ops->rx_desc_get_mpdu_start_tag(rx_desc);
 
        return tlv_tag == HAL_RX_MPDU_START;
 }
index db6294ba6771b789f749c5d3526799cb4dbde13f..a14a7d8dc69f2575a3791511155492a7ae948ffc 100644 (file)
@@ -406,13 +406,6 @@ static int ath12k_hal_srng_create_config_qcn9274(struct ath12k_base *ab)
        return 0;
 }
 
-const struct hal_rx_ops hal_rx_qcn9274_compact_ops = {
-       .rx_desc_get_l3_pad_bytes = ath12k_hal_rx_desc_get_l3_pad_bytes_qcn9274,
-       .rx_desc_get_mpdu_ppdu_id = ath12k_hal_rx_desc_get_mpdu_ppdu_id_qcn9274,
-       .rx_desc_get_msdu_payload = ath12k_hal_rx_desc_get_msdu_payload_qcn9274,
-};
-EXPORT_SYMBOL(hal_rx_qcn9274_compact_ops);
-
 const struct hal_ops hal_qcn9274_ops = {
        .create_srng_config = ath12k_hal_srng_create_config_qcn9274,
        .tcl_to_wbm_rbm_map = ath12k_hal_qcn9274_tcl_to_wbm_rbm_map,
@@ -423,6 +416,9 @@ const struct hal_ops hal_qcn9274_ops = {
        .rx_desc_get_msdu_src_link_id = ath12k_hal_rx_desc_get_msdu_src_link_qcn9274,
        .extract_rx_desc_data = ath12k_hal_extract_rx_desc_data_qcn9274,
        .rx_desc_get_desc_size = ath12k_hal_get_rx_desc_size_qcn9274,
+       .rx_desc_get_l3_pad_bytes = ath12k_hal_rx_desc_get_l3_pad_bytes_qcn9274,
+       .rx_desc_get_mpdu_ppdu_id = ath12k_hal_rx_desc_get_mpdu_ppdu_id_qcn9274,
+       .rx_desc_get_msdu_payload = ath12k_hal_rx_desc_get_msdu_payload_qcn9274,
 };
 EXPORT_SYMBOL(hal_qcn9274_ops);
 
@@ -550,14 +546,6 @@ static int ath12k_hal_srng_create_config_wcn7850(struct ath12k_base *ab)
        return 0;
 }
 
-const struct hal_rx_ops hal_rx_wcn7850_ops = {
-       .rx_desc_get_l3_pad_bytes = ath12k_hal_rx_desc_get_l3_pad_bytes_wcn7850,
-       .rx_desc_get_mpdu_start_tag = ath12k_hal_rx_desc_get_mpdu_start_tag_wcn7850,
-       .rx_desc_get_mpdu_ppdu_id = ath12k_hal_rx_desc_get_mpdu_ppdu_id_wcn7850,
-       .rx_desc_get_msdu_payload = ath12k_hal_rx_desc_get_msdu_payload_wcn7850,
-};
-EXPORT_SYMBOL(hal_rx_wcn7850_ops);
-
 const struct hal_ops hal_wcn7850_ops = {
        .create_srng_config = ath12k_hal_srng_create_config_wcn7850,
        .tcl_to_wbm_rbm_map = ath12k_hal_wcn7850_tcl_to_wbm_rbm_map,
@@ -568,6 +556,10 @@ const struct hal_ops hal_wcn7850_ops = {
        .rx_desc_get_msdu_src_link_id = ath12k_hal_rx_desc_get_msdu_src_link_wcn7850,
        .extract_rx_desc_data = ath12k_hal_extract_rx_desc_data_wcn7850,
        .rx_desc_get_desc_size = ath12k_hal_get_rx_desc_size_wcn7850,
+       .rx_desc_get_l3_pad_bytes = ath12k_hal_rx_desc_get_l3_pad_bytes_wcn7850,
+       .rx_desc_get_mpdu_start_tag = ath12k_hal_rx_desc_get_mpdu_start_tag_wcn7850,
+       .rx_desc_get_mpdu_ppdu_id = ath12k_hal_rx_desc_get_mpdu_ppdu_id_wcn7850,
+       .rx_desc_get_msdu_payload = ath12k_hal_rx_desc_get_msdu_payload_wcn7850,
 };
 EXPORT_SYMBOL(hal_wcn7850_ops);
 
index 37593bb7953b60bd59695a05b414bc22bdf7abe6..692d495d01c92fc31ed9b97f575a07b4206372c3 100644 (file)
@@ -1578,13 +1578,6 @@ enum nl80211_he_ru_alloc ath12k_he_ru_tones_to_nl80211_he_ru_alloc(u16 ru_tones)
        return ret;
 }
 
-struct hal_rx_ops {
-       u8 (*rx_desc_get_l3_pad_bytes)(struct hal_rx_desc *desc);
-       u32 (*rx_desc_get_mpdu_start_tag)(struct hal_rx_desc *desc);
-       u32 (*rx_desc_get_mpdu_ppdu_id)(struct hal_rx_desc *desc);
-       u8 *(*rx_desc_get_msdu_payload)(struct hal_rx_desc *desc);
-};
-
 struct hal_ops {
        int (*create_srng_config)(struct ath12k_base *ab);
        const struct ath12k_hal_tcl_to_wbm_rbm_map *tcl_to_wbm_rbm_map;
@@ -1601,14 +1594,15 @@ struct hal_ops {
                                     struct hal_rx_desc *rx_desc,
                                     struct hal_rx_desc *ldesc);
        u32 (*rx_desc_get_desc_size)(void);
+       u32 (*rx_desc_get_mpdu_start_tag)(struct hal_rx_desc *desc);
+       u32 (*rx_desc_get_mpdu_ppdu_id)(struct hal_rx_desc *desc);
+       u8 (*rx_desc_get_l3_pad_bytes)(struct hal_rx_desc *desc);
+       u8 *(*rx_desc_get_msdu_payload)(struct hal_rx_desc *desc);
 };
 
 extern const struct hal_ops hal_qcn9274_ops;
 extern const struct hal_ops hal_wcn7850_ops;
 
-extern const struct hal_rx_ops hal_rx_qcn9274_compact_ops;
-extern const struct hal_rx_ops hal_rx_wcn7850_ops;
-
 u32 ath12k_hal_reo_qdesc_size(u32 ba_window_size, u8 tid);
 void ath12k_hal_reo_qdesc_setup(struct hal_rx_reo_queue *qdesc,
                                int tid, u32 ba_window_size,
index abdb3b8ff658c2244b66a4d1364432d2ebe417ac..ba8c19c24ae6a8b47df88aa98c84299307a09fe8 100644 (file)
@@ -101,7 +101,6 @@ static int ath12k_wifi7_pci_probe(struct pci_dev *pdev,
                ab_pci->msi_config = &ath12k_wifi7_msi_config[0];
                ab->static_window_map = true;
                ab_pci->pci_ops = &ath12k_wifi7_pci_ops_qcn9274;
-               ab->hal_rx_ops = &hal_rx_qcn9274_compact_ops;
                ath12k_wifi7_pci_read_hw_version(ab, &soc_hw_version_major,
                                                 &soc_hw_version_minor);
                ab->target_mem_mode = ath12k_core_get_memory_mode(ab);
@@ -124,7 +123,6 @@ static int ath12k_wifi7_pci_probe(struct pci_dev *pdev,
                ab_pci->msi_config = &ath12k_wifi7_msi_config[0];
                ab->static_window_map = false;
                ab_pci->pci_ops = &ath12k_wifi7_pci_ops_wcn7850;
-               ab->hal_rx_ops = &hal_rx_wcn7850_ops;
                ath12k_wifi7_pci_read_hw_version(ab, &soc_hw_version_major,
                                                 &soc_hw_version_minor);
                ab->target_mem_mode = ATH12K_QMI_MEMORY_MODE_DEFAULT;