ATH11K Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Baochen Qiang <baochen.qiang@oss.qualcomm.com>
To: "Yu Zhang(Yuriy)" <yu.zhang@oss.qualcomm.com>, jjohnson@kernel.org
Cc: linux-kernel@vger.kernel.org, linux-wireless@vger.kernel.org,
	ath11k@lists.infradead.org
Subject: Re: [PATCH ath-next 6/6] wifi: ath11k: Register handler for CFR capture event
Date: Fri, 31 Oct 2025 11:05:35 +0800	[thread overview]
Message-ID: <69db0369-91bd-4fb3-83aa-4db1216fc747@oss.qualcomm.com> (raw)
In-Reply-To: <20251030043150.3905086-7-yu.zhang@oss.qualcomm.com>



On 10/30/2025 12:31 PM, Yu Zhang(Yuriy) wrote:
> From: Venkateswara Naralasetty <quic_vnaralas@quicinc.com>
> 
> Firmware sends CFR meta data through the WMI event
> WMI_PEER_CFR_CAPTURE_EVENT. Parse the meta data coming from the firmware
> and invoke correlate_and_relay function to correlate the CFR meta data
> with the CFR payload coming from the other WMI event
> WMI_PDEV_DMA_RING_BUF_RELEASE_EVENT.
> 
> Release the buffer to user space once correlate and relay return
> success.
> 
> Tested-on: IPQ8074 hw2.0 PCI IPQ8074 WLAN.HK.2.5.0.1-00991-QCAHKSWPL_SILICONZ-1
> Tested-on: WCN6855 hw2.1 PCI WLAN.HSP.1.1-04685-QCAHSPSWPL_V1_V2_SILICONZ_IOE-1
> 
> Signed-off-by: Venkateswara Naralasetty <quic_vnaralas@quicinc.com>
> Co-developed-by: Yu Zhang(Yuriy) <yu.zhang@oss.qualcomm.com>
> Signed-off-by: Yu Zhang(Yuriy) <yu.zhang@oss.qualcomm.com>
> ---
>  drivers/net/wireless/ath/ath11k/cfr.c | 145 ++++++++++++++++++++++++++
>  drivers/net/wireless/ath/ath11k/cfr.h |  62 ++++++++++-
>  drivers/net/wireless/ath/ath11k/wmi.c |  90 ++++++++++++++++
>  drivers/net/wireless/ath/ath11k/wmi.h |  44 ++++++++
>  4 files changed, 340 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/wireless/ath/ath11k/cfr.c b/drivers/net/wireless/ath/ath11k/cfr.c
> index e8a976d64733..61eeb02af6c5 100644
> --- a/drivers/net/wireless/ath/ath11k/cfr.c
> +++ b/drivers/net/wireless/ath/ath11k/cfr.c
> @@ -247,6 +247,151 @@ static int ath11k_cfr_process_data(struct ath11k *ar,
>  	return status;
>  }
>  
> +static void ath11k_cfr_fill_hdr_info(struct ath11k *ar,
> +				     struct ath11k_csi_cfr_header *header,
> +				     struct ath11k_cfr_peer_tx_param *params)
> +{
> +	header->cfr_metadata_version = ATH11K_CFR_META_VERSION_4;
> +	header->cfr_data_version = ATH11K_CFR_DATA_VERSION_1;
> +	header->cfr_metadata_len = sizeof(struct cfr_metadata);
> +	header->chip_type = ar->ab->hw_rev;
> +	header->meta_data.status = FIELD_GET(WMI_CFR_PEER_CAPTURE_STATUS,
> +					     params->status);
> +	header->meta_data.capture_bw = params->bandwidth;
> +	header->meta_data.phy_mode = params->phy_mode;
> +	header->meta_data.prim20_chan = params->primary_20mhz_chan;
> +	header->meta_data.center_freq1 = params->band_center_freq1;
> +	header->meta_data.center_freq2 = params->band_center_freq2;
> +
> +	/* Currently CFR data is captured on ACK of a Qos NULL frame.
> +	 * For 20 MHz, ACK is Legacy and for 40/80/160, ACK is DUP Legacy.
> +	 */

please check comment style

> +	header->meta_data.capture_mode = params->bandwidth ?
> +		ATH11K_CFR_CAPTURE_DUP_LEGACY_ACK : ATH11K_CFR_CAPTURE_LEGACY_ACK;
> +	header->meta_data.capture_type = params->capture_method;
> +	header->meta_data.num_rx_chain = ar->num_rx_chains;
> +	header->meta_data.sts_count = params->spatial_streams;
> +	header->meta_data.timestamp = params->timestamp_us;
> +	ether_addr_copy(header->meta_data.peer_addr, params->peer_mac_addr);
> +	memcpy(header->meta_data.chain_rssi, params->chain_rssi,
> +	       sizeof(params->chain_rssi));
> +	memcpy(header->meta_data.chain_phase, params->chain_phase,
> +	       sizeof(params->chain_phase));
> +	memcpy(header->meta_data.agc_gain, params->agc_gain,
> +	       sizeof(params->agc_gain));
> +}
> +
> +int ath11k_process_cfr_capture_event(struct ath11k_base *ab,
> +				     struct ath11k_cfr_peer_tx_param *params)
> +{
> +	struct ath11k_look_up_table *lut = NULL;
> +	u32 end_magic = ATH11K_CFR_END_MAGIC;
> +	struct ath11k_csi_cfr_header *header;
> +	struct ath11k_dbring_element *buff;
> +	struct ath11k_vif *arvif;
> +	struct ath11k_cfr *cfr;
> +	dma_addr_t buf_addr;
> +	struct ath11k *ar;
> +	u8 tx_status;
> +	int status;
> +	int i;
> +
> +	rcu_read_lock();
> +	arvif = ath11k_mac_get_arvif_by_vdev_id(ab, params->vdev_id);
> +	if (!arvif) {
> +		rcu_read_unlock();
> +		ath11k_warn(ab, "Failed to get arvif for vdev id %d\n",
> +			    params->vdev_id);
> +		return -ENOENT;
> +	}
> +
> +	ar = arvif->ar;

ath11k_mac_get_ar_by_vdev_id() is better?




  reply	other threads:[~2025-10-31  3:05 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-30  4:31 [PATCH ath-next 0/6] wifi: ath11k: Add single shot/periodic CFR capture support Yu Zhang(Yuriy)
2025-10-30  4:31 ` [PATCH ath-next 1/6] wifi: ath11k: Add initialization and deinitialization sequence for CFR module Yu Zhang(Yuriy)
2025-10-31  2:42   ` Baochen Qiang
2025-10-30  4:31 ` [PATCH ath-next 2/6] wifi: ath11k: Register debugfs for CFR configuration Yu Zhang(Yuriy)
2025-10-31  2:43   ` Baochen Qiang
2025-11-02  9:21     ` Yu Zhang(Yuriy)
2025-11-03  3:14       ` Baochen Qiang
2025-11-03  7:37         ` Yu Zhang(Yuriy)
2025-10-30  4:31 ` [PATCH ath-next 3/6] wifi: ath11k: Add support unassociated client CFR Yu Zhang(Yuriy)
2025-10-30  4:31 ` [PATCH ath-next 4/6] wifi: ath11k: Register relayfs entries for CFR dump Yu Zhang(Yuriy)
2025-10-30  4:31 ` [PATCH ath-next 5/6] wifi: ath11k: Register DBR event handler for CFR data Yu Zhang(Yuriy)
2025-10-31  2:59   ` Baochen Qiang
2025-10-30  4:31 ` [PATCH ath-next 6/6] wifi: ath11k: Register handler for CFR capture event Yu Zhang(Yuriy)
2025-10-31  3:05   ` Baochen Qiang [this message]
2025-10-30 18:17 ` [PATCH ath-next 0/6] wifi: ath11k: Add single shot/periodic CFR capture support Vasanthakumar Thiagarajan

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=69db0369-91bd-4fb3-83aa-4db1216fc747@oss.qualcomm.com \
    --to=baochen.qiang@oss.qualcomm.com \
    --cc=ath11k@lists.infradead.org \
    --cc=jjohnson@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=yu.zhang@oss.qualcomm.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox