wifi: ath12k: Remove the wifi7 header inclusions in common code

As a precursor to the movement of wifi7 specific .c files to
ath12k_wifi7.ko module, remove the wifi7 headers included
in the common .c files except for dp_mon.c file, as the changes
for moving the code from common to wifi7 directory for monitor
will be coming incrementally.

Since, dp_mon.c continues to be part of ath12k.ko module,
add a few callbacks in hal_ops to facilitate calls from
dp_mon.c to reach hal APIs present in ath12k_wifi7.ko module

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: Karthikeyan Periyasamy <karthikeyan.periyasamy@oss.qualcomm.com>
Reviewed-by: Baochen Qiang <baochen.qiang@oss.qualcomm.com>
Link: https://patch.msgid.link/20251103112111.2260639-7-quic_rdeuri@quicinc.com
Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
This commit is contained in:
Pavankumar Nandeshwar 2025-11-03 16:51:05 +05:30 committed by Jeff Johnson
parent c26f294fef
commit c870602510
15 changed files with 129 additions and 98 deletions

View File

@ -15,7 +15,6 @@
#include "ahb.h"
#include "debug.h"
#include "hif.h"
#include "wifi7/dp.h"
#define ATH12K_IRQ_CE0_OFFSET 4
#define ATH12K_MAX_UPDS 1

View File

@ -15,7 +15,6 @@
#include "core.h"
#include "dp_tx.h"
#include "dp_rx.h"
#include "wifi7/dp_rx.h"
#include "debug.h"
#include "debugfs.h"
#include "fw.h"

View File

@ -27,7 +27,6 @@
#include "ce.h"
#include "mac.h"
#include "hw.h"
#include "wifi7/hal_desc.h"
#include "reg.h"
#include "dbring.h"
#include "fw.h"

View File

@ -11,7 +11,6 @@
#include "dp_htt.h"
#include "dp_cmn.h"
#include <linux/rhashtable.h>
#include "wifi7/hal_desc.h"
#define MAX_RXDMA_PER_PDEV 2

View File

@ -17,6 +17,16 @@
#define ATH12K_LE64_DEC_ENC(value, dec_bits, enc_bits) \
u32_encode_bits(le64_get_bits(value, dec_bits), enc_bits)
static bool ath12k_dp_rxdesc_mpdu_valid(struct ath12k_base *ab,
struct hal_rx_desc *rx_desc)
{
u32 tlv_tag;
tlv_tag = ab->hal.ops->rx_desc_get_mpdu_start_tag(rx_desc);
return tlv_tag == HAL_RX_MPDU_START;
}
static void
ath12k_dp_mon_rx_handle_ofdma_info(const struct hal_rx_ppdu_end_user_stats *ppdu_end_user,
struct hal_rx_user_status *rx_user_status)
@ -1812,7 +1822,7 @@ ath12k_dp_rx_mon_buf_done(struct ath12k_base *ab, struct hal_srng *srng,
if (!status_desc)
return DP_MON_STATUS_NO_DMA;
ath12k_wifi7_hal_rx_buf_addr_info_get(status_desc, &paddr, &cookie, &rbm);
ath12k_hal_rx_buf_addr_info_get(&ab->hal, status_desc, &paddr, &cookie, &rbm);
buf_id = u32_get_bits(cookie, DP_RXDMA_BUF_COOKIE_BUF_ID);
@ -1856,7 +1866,8 @@ static u32 ath12k_dp_mon_comp_ppduid(u32 msdu_ppdu_id, u32 *ppdu_id)
}
static
void ath12k_dp_mon_next_link_desc_get(struct hal_rx_msdu_link *msdu_link,
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)
{
@ -1864,7 +1875,7 @@ void ath12k_dp_mon_next_link_desc_get(struct hal_rx_msdu_link *msdu_link,
buf_addr_info = &msdu_link->buf_addr_info;
ath12k_wifi7_hal_rx_buf_addr_info_get(buf_addr_info, paddr, sw_cookie, rbm);
ath12k_hal_rx_buf_addr_info_get(&ab->hal, buf_addr_info, paddr, sw_cookie, rbm);
*pp_buf_addr_info = buf_addr_info;
}
@ -2746,7 +2757,7 @@ int ath12k_dp_mon_status_bufs_replenish(struct ath12k_base *ab,
num_remain--;
ath12k_wifi7_hal_rx_buf_addr_info_set(desc, paddr, cookie, mgr);
ath12k_hal_rx_buf_addr_info_set(&ab->hal, desc, paddr, cookie, mgr);
}
ath12k_hal_srng_access_end(ab, srng);
@ -3947,8 +3958,8 @@ static int ath12k_dp_rx_reap_mon_status_ring(struct ath12k_base *ab, int mac_id,
pmon->buf_state = DP_MON_STATUS_REPLINISH;
break;
}
ath12k_wifi7_hal_rx_buf_addr_info_get(rx_mon_status_desc, &paddr,
&cookie, &rbm);
ath12k_hal_rx_buf_addr_info_get(&ab->hal, rx_mon_status_desc, &paddr,
&cookie, &rbm);
if (paddr) {
buf_id = u32_get_bits(cookie, DP_RXDMA_BUF_COOKIE_BUF_ID);
@ -4033,8 +4044,8 @@ static int ath12k_dp_rx_reap_mon_status_ring(struct ath12k_base *ab, int mac_id,
if (!skb) {
ath12k_warn(ab, "failed to alloc buffer for status ring\n");
ath12k_wifi7_hal_rx_buf_addr_info_set(rx_mon_status_desc, 0, 0,
hal_params->rx_buf_rbm);
ath12k_hal_rx_buf_addr_info_set(&ab->hal, rx_mon_status_desc,
0, 0, hal_params->rx_buf_rbm);
num_buffs_reaped++;
break;
}
@ -4043,9 +4054,8 @@ static int ath12k_dp_rx_reap_mon_status_ring(struct ath12k_base *ab, int mac_id,
cookie = u32_encode_bits(mac_id, DP_RXDMA_BUF_COOKIE_PDEV_ID) |
u32_encode_bits(buf_id, DP_RXDMA_BUF_COOKIE_BUF_ID);
ath12k_wifi7_hal_rx_buf_addr_info_set(rx_mon_status_desc, rxcb->paddr,
cookie,
hal_params->rx_buf_rbm);
ath12k_hal_rx_buf_addr_info_set(&ab->hal, rx_mon_status_desc, rxcb->paddr,
cookie, hal_params->rx_buf_rbm);
ath12k_hal_srng_src_get_next_entry(ab, srng);
num_buffs_reaped++;
}
@ -4083,7 +4093,7 @@ ath12k_dp_rx_mon_mpdu_pop(struct ath12k *ar, int mac_id,
dma_addr_t paddr;
u8 rbm;
ath12k_hal_rx_reo_ent_buf_paddr_get(ring_entry, &paddr,
ath12k_hal_rx_reo_ent_buf_paddr_get(&ab->hal, ring_entry, &paddr,
&sw_cookie,
&p_last_buf_addr_info, &rbm,
&msdu_cnt);
@ -4119,7 +4129,7 @@ ath12k_dp_rx_mon_mpdu_pop(struct ath12k *ar, int mac_id,
dp->link_desc_banks[desc_bank].vaddr +
(paddr - dp->link_desc_banks[desc_bank].paddr);
ath12k_hal_rx_msdu_list_get(ar, msdu_link_desc, &msdu_list,
ath12k_hal_rx_msdu_list_get(&ar->ab->hal, ar, msdu_link_desc, &msdu_list,
&num_msdus);
desc_info = ath12k_dp_get_rx_desc(ar->ab,
msdu_list.sw_cookie[num_msdus - 1]);
@ -4216,14 +4226,15 @@ ath12k_dp_rx_mon_mpdu_pop(struct ath12k *ar, int mac_id,
list_add_tail(&desc_info->list, used_list);
}
ath12k_wifi7_hal_rx_buf_addr_info_set(&buf_info, paddr, sw_cookie, rbm);
ath12k_hal_rx_buf_addr_info_set(&ab->hal, &buf_info, paddr,
sw_cookie, rbm);
ath12k_dp_mon_next_link_desc_get(msdu_link_desc, &paddr,
ath12k_dp_mon_next_link_desc_get(ab, msdu_link_desc, &paddr,
&sw_cookie, &rbm,
&p_buf_addr_info);
ath12k_wifi7_dp_rx_link_desc_return(ar->ab, &buf_info,
HAL_WBM_REL_BM_ACT_PUT_IN_IDLE);
ath12k_dp_arch_rx_link_desc_return(ar->ab->dp, &buf_info,
HAL_WBM_REL_BM_ACT_PUT_IN_IDLE);
p_last_buf_addr_info = p_buf_addr_info;

View File

@ -12,7 +12,6 @@
#include "debug.h"
#include "hw.h"
#include "dp_rx.h"
#include "wifi7/dp_rx.h"
#include "dp_tx.h"
#include "peer.h"
#include "dp_mon.h"

View File

@ -136,16 +136,6 @@ static inline u32 ath12k_dp_rxdesc_get_ppduid(struct ath12k_base *ab,
return ab->hal.ops->rx_desc_get_mpdu_ppdu_id(rx_desc);
}
static inline bool ath12k_dp_rxdesc_mpdu_valid(struct ath12k_base *ab,
struct hal_rx_desc *rx_desc)
{
u32 tlv_tag;
tlv_tag = ab->hal.ops->rx_desc_get_mpdu_start_tag(rx_desc);
return tlv_tag == HAL_RX_MPDU_START;
}
static inline void ath12k_dp_rx_desc_get_dot11_hdr(struct ath12k_base *ab,
struct hal_rx_desc *desc,
struct ieee80211_hdr *hdr)
@ -244,10 +234,6 @@ u32 ath12k_dp_rx_h_mpdu_err(struct ath12k_base *ab,
int ath12k_dp_rx_crypto_mic_len(struct ath12k_dp *dp, enum hal_encrypt_type enctype);
u32 ath12k_dp_rxdesc_get_ppduid(struct ath12k_base *ab,
struct hal_rx_desc *rx_desc);
bool ath12k_dp_rxdesc_mpdu_valid(struct ath12k_base *ab,
struct hal_rx_desc *rx_desc);
bool ath12k_dp_rxdesc_mpdu_valid(struct ath12k_base *ab,
struct hal_rx_desc *rx_desc);
void ath12k_dp_rx_h_ppdu(struct ath12k_pdev_dp *dp_pdev,
struct hal_rx_desc_data *rx_info);
struct sk_buff *ath12k_dp_rx_get_msdu_last_buf(struct sk_buff_head *msdu_list,

View File

@ -116,6 +116,24 @@ void ath12k_hal_rx_buf_addr_info_get(struct ath12k_hal *hal,
hal->ops->rx_buf_addr_info_get(binfo, paddr, msdu_cookies, rbm);
}
void ath12k_hal_rx_msdu_list_get(struct ath12k_hal *hal, struct ath12k *ar,
void *link_desc,
void *msdu_list,
u16 *num_msdus)
{
hal->ops->rx_msdu_list_get(ar, link_desc, msdu_list, num_msdus);
}
void ath12k_hal_rx_reo_ent_buf_paddr_get(struct ath12k_hal *hal, void *rx_desc,
dma_addr_t *paddr,
u32 *sw_cookie,
struct ath12k_buffer_addr **pp_buf_addr,
u8 *rbm, u32 *msdu_cnt)
{
hal->ops->rx_reo_ent_buf_paddr_get(rx_desc, paddr, sw_cookie,
pp_buf_addr, rbm, msdu_cnt);
}
void ath12k_hal_cc_config(struct ath12k_base *ab)
{
ab->hal.ops->cc_config(ab);

View File

@ -927,6 +927,51 @@ struct hal_srng {
} u;
};
/* hal_wbm_link_desc
*
* Producer: WBM
* Consumer: WBM
*
* buf_addr_info
* Details of the physical address of a buffer or MSDU
* link descriptor.
*/
enum hal_wbm_rel_src_module {
HAL_WBM_REL_SRC_MODULE_TQM,
HAL_WBM_REL_SRC_MODULE_RXDMA,
HAL_WBM_REL_SRC_MODULE_REO,
HAL_WBM_REL_SRC_MODULE_FW,
HAL_WBM_REL_SRC_MODULE_SW,
HAL_WBM_REL_SRC_MODULE_MAX,
};
/* hal_wbm_rel_desc_type
*
* msdu_buffer
* The address points to an MSDU buffer
*
* msdu_link_descriptor
* The address points to an Tx MSDU link descriptor
*
* mpdu_link_descriptor
* The address points to an MPDU link descriptor
*
* msdu_ext_descriptor
* The address points to an MSDU extension descriptor
*
* queue_ext_descriptor
* The address points to an TQM queue extension descriptor. WBM should
* treat this is the same way as a link descriptor.
*/
enum hal_wbm_rel_desc_type {
HAL_WBM_REL_DESC_TYPE_REL_MSDU,
HAL_WBM_REL_DESC_TYPE_MSDU_LINK,
HAL_WBM_REL_DESC_TYPE_MPDU_LINK,
HAL_WBM_REL_DESC_TYPE_MSDU_EXT,
HAL_WBM_REL_DESC_TYPE_QUEUE_EXT,
};
/* Interrupt mitigation - Batch threshold in terms of number of frames */
#define HAL_SRNG_INT_BATCH_THRESHOLD_TX 256
#define HAL_SRNG_INT_BATCH_THRESHOLD_RX 128
@ -1335,6 +1380,14 @@ struct hal_ops {
void (*cc_config)(struct ath12k_base *ab);
enum hal_rx_buf_return_buf_manager
(*get_idle_link_rbm)(struct ath12k_hal *hal, u8 device_id);
void (*rx_msdu_list_get)(struct ath12k *ar,
void *link_desc,
void *msdu_list,
u16 *num_msdus);
void (*rx_reo_ent_buf_paddr_get)(void *rx_desc, dma_addr_t *paddr,
u32 *sw_cookie,
struct ath12k_buffer_addr **pp_buf_addr,
u8 *rbm, u32 *msdu_cnt);
};
dma_addr_t ath12k_hal_srng_get_tp_addr(struct ath12k_base *ab,
@ -1417,4 +1470,11 @@ void ath12k_hal_rx_buf_addr_info_get(struct ath12k_hal *hal,
void ath12k_hal_cc_config(struct ath12k_base *ab);
enum hal_rx_buf_return_buf_manager
ath12k_hal_get_idle_link_rbm(struct ath12k_hal *hal, u8 device_id);
void ath12k_hal_rx_msdu_list_get(struct ath12k_hal *hal, struct ath12k *ar,
void *link_desc, void *msdu_list,
u16 *num_msdus);
void ath12k_hal_rx_reo_ent_buf_paddr_get(struct ath12k_hal *hal, void *rx_desc,
dma_addr_t *paddr, u32 *sw_cookie,
struct ath12k_buffer_addr **pp_buf_addr,
u8 *rbm, u32 *msdu_cnt);
#endif

View File

@ -14,7 +14,6 @@
#include "wmi.h"
#include "hw.h"
#include "dp_tx.h"
#include "wifi7/dp_tx.h"
#include "dp_rx.h"
#include "testmode.h"
#include "peer.h"

View File

@ -1596,52 +1596,6 @@ struct hal_wbm_link_desc {
struct ath12k_buffer_addr buf_addr_info;
} __packed;
/* hal_wbm_link_desc
*
* Producer: WBM
* Consumer: WBM
*
* buf_addr_info
* Details of the physical address of a buffer or MSDU
* link descriptor.
*/
enum hal_wbm_rel_src_module {
HAL_WBM_REL_SRC_MODULE_TQM,
HAL_WBM_REL_SRC_MODULE_RXDMA,
HAL_WBM_REL_SRC_MODULE_REO,
HAL_WBM_REL_SRC_MODULE_FW,
HAL_WBM_REL_SRC_MODULE_SW,
HAL_WBM_REL_SRC_MODULE_MAX,
};
enum hal_wbm_rel_desc_type {
HAL_WBM_REL_DESC_TYPE_REL_MSDU,
HAL_WBM_REL_DESC_TYPE_MSDU_LINK,
HAL_WBM_REL_DESC_TYPE_MPDU_LINK,
HAL_WBM_REL_DESC_TYPE_MSDU_EXT,
HAL_WBM_REL_DESC_TYPE_QUEUE_EXT,
};
/* hal_wbm_rel_desc_type
*
* msdu_buffer
* The address points to an MSDU buffer
*
* msdu_link_descriptor
* The address points to an Tx MSDU link descriptor
*
* mpdu_link_descriptor
* The address points to an MPDU link descriptor
*
* msdu_ext_descriptor
* The address points to an MSDU extension descriptor
*
* queue_ext_descriptor
* The address points to an TQM queue extension descriptor. WBM should
* treat this is the same way as a link descriptor.
*/
#define HAL_WBM_COMPL_RX_INFO0_REL_SRC_MODULE GENMASK(2, 0)
#define HAL_WBM_COMPL_RX_INFO0_BM_ACTION GENMASK(5, 3)
#define HAL_WBM_COMPL_RX_INFO0_DESC_TYPE GENMASK(8, 6)

View File

@ -1026,5 +1026,7 @@ const struct hal_ops hal_qcn9274_ops = {
.rx_buf_addr_info_get = ath12k_wifi7_hal_rx_buf_addr_info_get,
.cc_config = ath12k_wifi7_hal_cc_config,
.get_idle_link_rbm = ath12k_wifi7_hal_get_idle_link_rbm,
.rx_msdu_list_get = ath12k_wifi7_hal_rx_msdu_list_get,
.rx_reo_ent_buf_paddr_get = ath12k_wifi7_hal_rx_reo_ent_buf_paddr_get,
};
EXPORT_SYMBOL(hal_qcn9274_ops);

View File

@ -457,10 +457,10 @@ void ath12k_wifi7_hal_rx_reo_ent_paddr_get(struct ath12k_base *ab,
*cookie = le32_get_bits(buff_addr->info1, BUFFER_ADDR_INFO1_SW_COOKIE);
}
void ath12k_hal_rx_reo_ent_buf_paddr_get(void *rx_desc, dma_addr_t *paddr,
u32 *sw_cookie,
struct ath12k_buffer_addr **pp_buf_addr,
u8 *rbm, u32 *msdu_cnt)
void ath12k_wifi7_hal_rx_reo_ent_buf_paddr_get(void *rx_desc, dma_addr_t *paddr,
u32 *sw_cookie,
struct ath12k_buffer_addr **pp_buf_addr,
u8 *rbm, u32 *msdu_cnt)
{
struct hal_reo_entrance_ring *reo_ent_ring =
(struct hal_reo_entrance_ring *)rx_desc;
@ -488,11 +488,14 @@ void ath12k_hal_rx_reo_ent_buf_paddr_get(void *rx_desc, dma_addr_t *paddr,
*pp_buf_addr = (void *)buf_addr_info;
}
void ath12k_hal_rx_msdu_list_get(struct ath12k *ar,
struct hal_rx_msdu_link *link_desc,
struct hal_rx_msdu_list *msdu_list,
u16 *num_msdus)
void ath12k_wifi7_hal_rx_msdu_list_get(struct ath12k *ar,
void *link_desc_opaque,
void *msdu_list_opaque, u16 *num_msdus)
{
struct hal_rx_msdu_link *link_desc =
(struct hal_rx_msdu_link *)link_desc_opaque;
struct hal_rx_msdu_list *msdu_list =
(struct hal_rx_msdu_list *)msdu_list_opaque;
struct hal_rx_msdu_details *msdu_details = NULL;
struct rx_msdu_desc *msdu_desc_info = NULL;
u32 last = 0, first = 0;

View File

@ -866,13 +866,14 @@ int ath12k_wifi7_hal_wbm_desc_parse_err(struct ath12k_base *ab, void *desc,
void ath12k_wifi7_hal_rx_reo_ent_paddr_get(struct ath12k_base *ab,
struct ath12k_buffer_addr *buff_addr,
dma_addr_t *paddr, u32 *cookie);
void ath12k_hal_rx_reo_ent_buf_paddr_get(void *rx_desc, dma_addr_t *paddr, u32 *sw_cookie,
struct ath12k_buffer_addr **pp_buf_addr,
u8 *rbm, u32 *msdu_cnt);
void ath12k_hal_rx_msdu_list_get(struct ath12k *ar,
struct hal_rx_msdu_link *link_desc,
struct hal_rx_msdu_list *msdu_list,
u16 *num_msdus);
void ath12k_wifi7_hal_rx_reo_ent_buf_paddr_get(void *rx_desc, dma_addr_t *paddr,
u32 *sw_cookie,
struct ath12k_buffer_addr **pp_buf_addr,
u8 *rbm, u32 *msdu_cnt);
void ath12k_wifi7_hal_rx_msdu_list_get(struct ath12k *ar,
void *link_desc,
void *msdu_list_opaque,
u16 *num_msdus);
void ath12k_wifi7_hal_reo_init_cmd_ring(struct ath12k_base *ab,
struct hal_srng *srng);
void ath12k_wifi7_hal_reo_hw_setup(struct ath12k_base *ab, u32 ring_hash_map);

View File

@ -799,5 +799,7 @@ const struct hal_ops hal_wcn7850_ops = {
.rx_buf_addr_info_get = ath12k_wifi7_hal_rx_buf_addr_info_get,
.cc_config = ath12k_wifi7_hal_cc_config,
.get_idle_link_rbm = ath12k_wifi7_hal_get_idle_link_rbm,
.rx_msdu_list_get = ath12k_wifi7_hal_rx_msdu_list_get,
.rx_reo_ent_buf_paddr_get = ath12k_wifi7_hal_rx_reo_ent_buf_paddr_get,
};
EXPORT_SYMBOL(hal_wcn7850_ops);