From: Kang Yang <kang.yang@oss.qualcomm.com>
To: ath12k@lists.infradead.org, kang.yang@oss.qualcomm.com
Cc: linux-wireless@vger.kernel.org
Subject: [PATCH ath-next 06/13] wifi: ath12k: add monitor mode handler by monitor status ring interrupt
Date: Mon, 21 Apr 2025 10:34:37 +0800	[thread overview]
Message-ID: <20250421023444.1778-7-kang.yang@oss.qualcomm.com> (raw)
In-Reply-To: <20250421023444.1778-1-kang.yang@oss.qualcomm.com>

Monitor status ring interrupt is configured in previous patch. So add
handler function __ath12k_dp_mon_process_ring() for monitor mode.

Will implement detail processing in patch 7 and 10.

Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3
Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.3.1-00173-QCAHKSWPL_SILICONZ-1

Signed-off-by: Kang Yang <kang.yang@oss.qualcomm.com>
---
 drivers/net/wireless/ath/ath12k/dp.c     |  6 +++++-
 drivers/net/wireless/ath/ath12k/dp_mon.c | 12 ++++++++++++
 2 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath12k/dp.c b/drivers/net/wireless/ath/ath12k/dp.c
index 5eec14a7b1ea..b835c76d6d66 100644
--- a/drivers/net/wireless/ath/ath12k/dp.c
+++ b/drivers/net/wireless/ath/ath12k/dp.c
@@ -933,7 +933,11 @@ int ath12k_dp_service_srng(struct ath12k_base *ab,
 				int id = i * ab->hw_params->num_rxdma_per_pdev + j;
 
 				if (ring_mask & BIT(id)) {
-					/* TODO: add monitor mode function */
+					work_done =
+					ath12k_dp_mon_process_ring(ab, id, napi, budget,
+								   0);
+					budget -= work_done;
+					tot_work_done += work_done;
 					if (budget <= 0)
 						goto done;
 				}
diff --git a/drivers/net/wireless/ath/ath12k/dp_mon.c b/drivers/net/wireless/ath/ath12k/dp_mon.c
index 28fb9d4aa673..0f7d0d517372 100644
--- a/drivers/net/wireless/ath/ath12k/dp_mon.c
+++ b/drivers/net/wireless/ath/ath12k/dp_mon.c
@@ -3727,6 +3727,14 @@ int ath12k_dp_mon_srng_process(struct ath12k *ar, int *budget,
 	return num_buffs_reaped;
 }
 
+static int
+__ath12k_dp_mon_process_ring(struct ath12k *ar, int mac_id,
+			     struct napi_struct *napi, int *budget)
+{
+	/* TODO:Implement monitor mode for WCN7850 here. */
+	return 0;
+}
+
 int ath12k_dp_mon_process_ring(struct ath12k_base *ab, int mac_id,
 			       struct napi_struct *napi, int budget,
 			       enum dp_monitor_mode monitor_mode)
@@ -3737,6 +3745,10 @@ int ath12k_dp_mon_process_ring(struct ath12k_base *ab, int mac_id,
 	if (ab->hw_params->rxdma1_enable) {
 		if (monitor_mode == ATH12K_DP_RX_MONITOR_MODE)
 			num_buffs_reaped = ath12k_dp_mon_srng_process(ar, &budget, napi);
+	} else {
+		if (ar->monitor_started)
+			num_buffs_reaped =
+				__ath12k_dp_mon_process_ring(ar, mac_id, napi, &budget);
 	}
 
 	return num_buffs_reaped;
-- 
2.34.1


  parent reply	other threads:[~2025-04-21  2:35 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-21  2:34 [PATCH ath-next 00/13] wifi: ath12k: add monitor mode support for WCN7850 Kang Yang
2025-04-21  2:34 ` [PATCH ath-next 01/13] wifi: ath12k: parse msdu_end tlv in ath12k_dp_mon_rx_parse_status_tlv() Kang Yang
2025-04-21  2:34 ` [PATCH ath-next 02/13] wifi: ath12k: avoid call ath12k_dp_mon_parse_rx_dest_tlv() for WCN7850 Kang Yang
2025-04-21  2:34 ` [PATCH ath-next 03/13] wifi: ath12k: add srng config template for mon status ring Kang Yang
2025-04-21  2:34 ` [PATCH ath-next 04/13] wifi: ath12k: add ring config for monitor mode on WCN7850 Kang Yang
2025-04-21  2:34 ` [PATCH ath-next 05/13] wifi: ath12k: add interrupt configuration for mon status ring Kang Yang
2025-04-21  2:34 ` Kang Yang [this message]
2025-04-21  2:34 ` [PATCH ath-next 07/13] wifi: ath12k: add support to reap and process monitor " Kang Yang
2025-04-21  2:34 ` [PATCH ath-next 08/13] wifi: ath12k: fix macro definition HAL_RX_MSDU_PKT_LENGTH_GET Kang Yang
2025-04-21  2:34 ` [PATCH ath-next 09/13] wifi: ath12k: use ath12k_buffer_addr in ath12k_dp_rx_link_desc_return() Kang Yang
2025-04-21  2:34 ` [PATCH ath-next 10/13] wifi: ath12k: add support to reap and process mon dest ring Kang Yang
2025-04-21  2:34 ` [PATCH ath-next 11/13] wifi: ath12k: init monitor parameters for WCN7850 Kang Yang
2025-04-21  2:34 ` [PATCH ath-next 12/13] wifi: ath12k: use different packet offset " Kang Yang
2025-04-21  2:34 ` [PATCH ath-next 13/13] wifi: ath12k: enable monitor mode " Kang Yang
2025-04-28 16:52 ` [PATCH ath-next 00/13] wifi: ath12k: add monitor mode support " Vasanthakumar Thiagarajan
2025-05-16 19:40 ` Jeff Johnson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250421023444.1778-7-kang.yang@oss.qualcomm.com \
    --to=kang.yang@oss.qualcomm.com \
    --cc=ath12k@lists.infradead.org \
    --cc=linux-wireless@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.