Skip to content

Commit

Permalink
wifi: ath12k: Refactor the monitor Tx/RX handler procedure arguments
Browse files Browse the repository at this point in the history
Currently, the pdev handle is given along with the mac id to all the
monitor Tx/Rx handler procedure arguments. The mac id information is
derived from the pdev handle itself. Therefore, remove the unnecessary
mac id argument from the handler.

Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.3.1-00173-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: Karthikeyan Periyasamy <quic_periyasa@quicinc.com>
Acked-by: Kalle Valo <kvalo@kernel.org>
Link: https://patch.msgid.link/20241224143613.164921-3-quic_periyasa@quicinc.com
Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
  • Loading branch information
Karthikeyan Periyasamy authored and Jeff Johnson committed Jan 17, 2025
1 parent b238941 commit 844c256
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 19 deletions.
29 changes: 14 additions & 15 deletions drivers/net/wireless/ath/ath12k/dp_mon.c
Original file line number Diff line number Diff line change
Expand Up @@ -845,7 +845,7 @@ static void ath12k_dp_mon_rx_msdus_set_payload(struct ath12k *ar,
}

static struct sk_buff *
ath12k_dp_mon_rx_merg_msdus(struct ath12k *ar, u32 mac_id,
ath12k_dp_mon_rx_merg_msdus(struct ath12k *ar,
struct sk_buff *head_msdu, struct sk_buff *tail_msdu,
struct ieee80211_rx_status *rxs, bool *fcs_err)
{
Expand Down Expand Up @@ -1126,7 +1126,7 @@ static void ath12k_dp_mon_rx_deliver_msdu(struct ath12k *ar, struct napi_struct
ieee80211_rx_napi(ath12k_ar_to_hw(ar), pubsta, msdu, napi);
}

static int ath12k_dp_mon_rx_deliver(struct ath12k *ar, u32 mac_id,
static int ath12k_dp_mon_rx_deliver(struct ath12k *ar,
struct sk_buff *head_msdu, struct sk_buff *tail_msdu,
struct hal_rx_mon_ppdu_info *ppduinfo,
struct napi_struct *napi)
Expand All @@ -1136,7 +1136,7 @@ static int ath12k_dp_mon_rx_deliver(struct ath12k *ar, u32 mac_id,
struct ieee80211_rx_status *rxs = &dp->rx_status;
bool fcs_err = false;

mon_skb = ath12k_dp_mon_rx_merg_msdus(ar, mac_id,
mon_skb = ath12k_dp_mon_rx_merg_msdus(ar,
head_msdu, tail_msdu,
rxs, &fcs_err);
if (!mon_skb)
Expand Down Expand Up @@ -1225,7 +1225,6 @@ ath12k_dp_mon_parse_rx_dest(struct ath12k *ar, struct ath12k_mon_data *pmon,
enum hal_rx_mon_status
ath12k_dp_mon_rx_parse_mon_status(struct ath12k *ar,
struct ath12k_mon_data *pmon,
int mac_id,
struct sk_buff *skb,
struct napi_struct *napi)
{
Expand All @@ -1243,7 +1242,7 @@ ath12k_dp_mon_rx_parse_mon_status(struct ath12k *ar,
tail_msdu = mon_mpdu->tail;

if (head_msdu && tail_msdu) {
ath12k_dp_mon_rx_deliver(ar, mac_id, head_msdu,
ath12k_dp_mon_rx_deliver(ar, head_msdu,
tail_msdu, ppdu_info, napi);
}

Expand Down Expand Up @@ -1924,7 +1923,7 @@ ath12k_dp_mon_tx_status_get_num_user(u16 tlv_tag,
}

static void
ath12k_dp_mon_tx_process_ppdu_info(struct ath12k *ar, int mac_id,
ath12k_dp_mon_tx_process_ppdu_info(struct ath12k *ar,
struct napi_struct *napi,
struct dp_mon_tx_ppdu_info *tx_ppdu_info)
{
Expand All @@ -1938,7 +1937,7 @@ ath12k_dp_mon_tx_process_ppdu_info(struct ath12k *ar, int mac_id,
tail_msdu = mon_mpdu->tail;

if (head_msdu)
ath12k_dp_mon_rx_deliver(ar, mac_id, head_msdu, tail_msdu,
ath12k_dp_mon_rx_deliver(ar, head_msdu, tail_msdu,
&tx_ppdu_info->rx_status, napi);

kfree(mon_mpdu);
Expand All @@ -1948,7 +1947,6 @@ ath12k_dp_mon_tx_process_ppdu_info(struct ath12k *ar, int mac_id,
enum hal_rx_mon_status
ath12k_dp_mon_tx_parse_mon_status(struct ath12k *ar,
struct ath12k_mon_data *pmon,
int mac_id,
struct sk_buff *skb,
struct napi_struct *napi,
u32 ppdu_id)
Expand Down Expand Up @@ -1995,13 +1993,13 @@ ath12k_dp_mon_tx_parse_mon_status(struct ath12k *ar,
break;
} while (tlv_status != DP_MON_TX_FES_STATUS_END);

ath12k_dp_mon_tx_process_ppdu_info(ar, mac_id, napi, tx_data_ppdu_info);
ath12k_dp_mon_tx_process_ppdu_info(ar, mac_id, napi, tx_prot_ppdu_info);
ath12k_dp_mon_tx_process_ppdu_info(ar, napi, tx_data_ppdu_info);
ath12k_dp_mon_tx_process_ppdu_info(ar, napi, tx_prot_ppdu_info);

return tlv_status;
}

int ath12k_dp_mon_srng_process(struct ath12k *ar, int mac_id, int *budget,
int ath12k_dp_mon_srng_process(struct ath12k *ar, int *budget,
enum dp_monitor_mode monitor_mode,
struct napi_struct *napi)
{
Expand All @@ -2022,12 +2020,13 @@ int ath12k_dp_mon_srng_process(struct ath12k *ar, int mac_id, int *budget,
bool end_of_ppdu;
struct hal_rx_mon_ppdu_info *ppdu_info;
struct ath12k_peer *peer = NULL;
u8 pdev_idx = ath12k_hw_mac_id_to_pdev_id(ab->hw_params, ar->pdev_idx);

ppdu_info = &pmon->mon_ppdu_info;
memset(ppdu_info, 0, sizeof(*ppdu_info));
ppdu_info->peer_id = HAL_INVALID_PEERID;

srng_id = ath12k_hw_mac_id_to_srng_id(ab->hw_params, mac_id);
srng_id = ath12k_hw_mac_id_to_srng_id(ab->hw_params, pdev_idx);

if (monitor_mode == ATH12K_DP_RX_MONITOR_MODE) {
mon_dst_ring = &pdev_dp->rxdma_mon_dst_ring[srng_id];
Expand Down Expand Up @@ -2077,10 +2076,10 @@ int ath12k_dp_mon_srng_process(struct ath12k *ar, int mac_id, int *budget,
skb = pmon->dest_skb_q[i];

if (monitor_mode == ATH12K_DP_RX_MONITOR_MODE)
ath12k_dp_mon_rx_parse_mon_status(ar, pmon, mac_id,
ath12k_dp_mon_rx_parse_mon_status(ar, pmon,
skb, napi);
else
ath12k_dp_mon_tx_parse_mon_status(ar, pmon, mac_id,
ath12k_dp_mon_tx_parse_mon_status(ar, pmon,
skb, napi, ppdu_id);

peer = ath12k_peer_find_by_id(ab, ppdu_info->peer_id);
Expand Down Expand Up @@ -2538,7 +2537,7 @@ int ath12k_dp_mon_process_ring(struct ath12k_base *ab, int mac_id,
if (!ar->monitor_started)
ath12k_dp_mon_rx_process_stats(ar, mac_id, napi, &budget);
else
num_buffs_reaped = ath12k_dp_mon_srng_process(ar, mac_id, &budget,
num_buffs_reaped = ath12k_dp_mon_srng_process(ar, &budget,
monitor_mode, napi);

return num_buffs_reaped;
Expand Down
7 changes: 3 additions & 4 deletions drivers/net/wireless/ath/ath12k/dp_mon.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* SPDX-License-Identifier: BSD-3-Clause-Clear */
/*
* Copyright (c) 2019-2021 The Linux Foundation. All rights reserved.
* Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved.
* Copyright (c) 2021-2024 Qualcomm Innovation Center, Inc. All rights reserved.
*/

#ifndef ATH12K_DP_MON_H
Expand Down Expand Up @@ -77,12 +77,12 @@ struct dp_mon_tx_ppdu_info {
enum hal_rx_mon_status
ath12k_dp_mon_rx_parse_mon_status(struct ath12k *ar,
struct ath12k_mon_data *pmon,
int mac_id, struct sk_buff *skb,
struct sk_buff *skb,
struct napi_struct *napi);
int ath12k_dp_mon_buf_replenish(struct ath12k_base *ab,
struct dp_rxdma_mon_ring *buf_ring,
int req_entries);
int ath12k_dp_mon_srng_process(struct ath12k *ar, int mac_id,
int ath12k_dp_mon_srng_process(struct ath12k *ar,
int *budget, enum dp_monitor_mode monitor_mode,
struct napi_struct *napi);
int ath12k_dp_mon_process_ring(struct ath12k_base *ab, int mac_id,
Expand All @@ -96,7 +96,6 @@ ath12k_dp_mon_tx_status_get_num_user(u16 tlv_tag,
enum hal_rx_mon_status
ath12k_dp_mon_tx_parse_mon_status(struct ath12k *ar,
struct ath12k_mon_data *pmon,
int mac_id,
struct sk_buff *skb,
struct napi_struct *napi,
u32 ppdu_id);
Expand Down

0 comments on commit 844c256

Please sign in to comment.