From d384cff416fc72dcd1e22d39af1ef7f7abaafa42 Mon Sep 17 00:00:00 2001 From: Shwetha G K Date: Tue, 22 Dec 2020 17:26:10 +0530 Subject: [PATCH] qcacmn: Populate additional parameters from CFR capture event Add CFO, agc_gain and rx start timestamp related parameters to wmi_cfr_peer_tx_event_param and populate the same with data from FW peer tx event. Change-Id: I462fa56a854b18d1f9b46d1e14eea85da0d45f23 --- wmi/inc/wmi_unified_param.h | 4 ++++ wmi/src/wmi_unified_cfr_tlv.c | 12 +++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/wmi/inc/wmi_unified_param.h b/wmi/inc/wmi_unified_param.h index 0e45a30fae..be44e0004a 100644 --- a/wmi/inc/wmi_unified_param.h +++ b/wmi/inc/wmi_unified_param.h @@ -7587,6 +7587,10 @@ typedef struct { uint32_t counter; uint32_t chain_rssi[WMI_HOST_MAX_CHAINS]; uint16_t chain_phase[WMI_HOST_MAX_CHAINS]; + int32_t cfo_measurement; + uint8_t agc_gain[WMI_HOST_MAX_CHAINS]; + uint32_t rx_start_ts; + uint32_t rx_ts_reset; } wmi_cfr_peer_tx_event_param; /** diff --git a/wmi/src/wmi_unified_cfr_tlv.c b/wmi/src/wmi_unified_cfr_tlv.c index be782021f3..e2c6ce0419 100644 --- a/wmi/src/wmi_unified_cfr_tlv.c +++ b/wmi/src/wmi_unified_cfr_tlv.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2020, The Linux Foundation. All rights reserved. + * Copyright (c) 2019-2021, The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -62,6 +62,14 @@ extract_cfr_peer_tx_event_param_tlv(wmi_unified_t wmi_handle, void *evt_buf, peer_tx_event->counter = peer_tx_event_ev->counter; qdf_mem_copy(peer_tx_event->chain_rssi, peer_tx_event_ev->chain_rssi, sizeof(peer_tx_event->chain_rssi)); + if (peer_tx_event_ev->cfo_measurement_valid) + peer_tx_event->cfo_measurement = + peer_tx_event_ev->cfo_measurement; + else + peer_tx_event->cfo_measurement = 0; + + peer_tx_event->rx_start_ts = peer_tx_event_ev->rx_start_ts; + peer_tx_event->rx_ts_reset = peer_tx_event_ev->rx_ts_reset; chain_phase_ev = param_buf->phase_param; if (chain_phase_ev) { @@ -74,6 +82,8 @@ extract_cfr_peer_tx_event_param_tlv(wmi_unified_t wmi_handle, void *evt_buf, */ peer_tx_event->chain_phase[idx] = (0xffff & chain_phase_ev->chain_phase[idx]); + peer_tx_event->agc_gain[idx] = + WMI_UNIFIED_AGC_GAIN_GET(chain_phase_ev, idx); } }