From 90e7ec13c7aa02b2becee3c47442d209d88365ae Mon Sep 17 00:00:00 2001 From: Shwetha G K Date: Thu, 8 Jul 2021 15:04:19 +0530 Subject: [PATCH] qcacmn: Extract AoA phase delta from WMI event Changes to extract AoA phase delta values from WMI event. The AoA phase delta values along with ibf calibration value is shared to derive the phase values which is to be used in CFR. Change-Id: I70f50656db4194025a0b6b37c8b4a27048968e0f --- wmi/inc/wmi_unified_cfr_api.h | 16 +++++++++++++++- wmi/inc/wmi_unified_param.h | 24 ++++++++++++++++++++++++ wmi/inc/wmi_unified_priv.h | 7 +++++++ wmi/src/wmi_unified_cfr_api.c | 14 +++++++++++++- 4 files changed, 59 insertions(+), 2 deletions(-) diff --git a/wmi/inc/wmi_unified_cfr_api.h b/wmi/inc/wmi_unified_cfr_api.h index aa457b905d..bffbd06cda 100644 --- a/wmi/inc/wmi_unified_cfr_api.h +++ b/wmi/inc/wmi_unified_cfr_api.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 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 @@ -55,6 +55,20 @@ wmi_extract_cfr_peer_tx_event_param(wmi_unified_t wmi_handle, void *evt_buf, */ QDF_STATUS wmi_unified_send_cfr_rcc_cmd(wmi_unified_t wmi_handle, struct cfr_rcc_param *cfg); + +/** + * wmi_extract_cfr_pdev_phase_delta_event() - WMI function to extract the + * phase delta information. + * @wmi_handle: WMI handle + * @evt_buf: Buffer holding the event data + * @param: phase delta params to be updated from event + * + * Return: QDF_STATUS_SUCCESS if success, else returns proper error code. + */ +QDF_STATUS +wmi_extract_cfr_pdev_phase_delta_event(wmi_unified_t wmi_handle, + void *evt_buf, + struct wmi_cfr_phase_delta_param *param); #endif #endif /* WLAN_CFR_ENABLE */ #endif /* _WMI_UNIFIED_CFR_API_H_ */ diff --git a/wmi/inc/wmi_unified_param.h b/wmi/inc/wmi_unified_param.h index 50d07a38ac..cde23a3155 100644 --- a/wmi/inc/wmi_unified_param.h +++ b/wmi/inc/wmi_unified_param.h @@ -401,6 +401,9 @@ #define WMI_CONFIG_MSDU_AST_INDEX_2 0x2 #define WMI_CONFIG_MSDU_AST_INDEX_3 0x3 +#define WMI_MAX_AOA_PHASE_DELTA 31 +#define WMI_MAX_CHAINS_PHASE 2 + #include "qdf_atomic.h" #ifdef BIG_ENDIAN_HOST @@ -4680,6 +4683,7 @@ typedef enum { wmi_vdev_smart_monitor_event_id, #endif wmi_pdev_get_halphy_cal_status_event_id, + wmi_pdev_aoa_phasedelta_event_id, wmi_events_max, } wmi_conv_event_id; @@ -5270,6 +5274,7 @@ typedef enum { wmi_service_halphy_cal_status, wmi_service_rtt_ap_initiator_staggered_mode_supported, wmi_service_rtt_ap_initiator_bursted_mode_supported, + wmi_service_aoa_for_rcc_supported, wmi_services_max, } wmi_conv_service_ids; #define WMI_SERVICE_UNAVAILABLE 0xFFFF @@ -7827,6 +7832,25 @@ typedef struct { uint32_t gi_type; } wmi_cfr_peer_tx_event_param; +/** + * struct wmi_cfr_phase_delta_param - AoA phase delta params + * @pdev_id: pdev id + * @freq: primary 20 MHz channel frequency in mhz + * @max_chains: indicates max chains for which AoA will be reported + * @chain_phase_mask: indicates the chains to which phase values are + * reported by target + * @phase_delta: phase delta associated with reported chain's each gain value + * ibf_cal_val: IBF values to be added with phase delta of chains reported + */ +struct wmi_cfr_phase_delta_param { + uint32_t pdev_id; + uint32_t freq; + uint32_t max_chains; + uint32_t chain_phase_mask; + uint32_t phase_delta[WMI_MAX_CHAINS_PHASE][WMI_MAX_AOA_PHASE_DELTA]; + uint32_t ibf_cal_val[WMI_MAX_CHAINS_PHASE]; +}; + /** * struct wmi_host_oem_indirect_data - Indirect OEM data * @pdev_id: pdev id diff --git a/wmi/inc/wmi_unified_priv.h b/wmi/inc/wmi_unified_priv.h index 91d1f869bb..ef83a485d8 100644 --- a/wmi/inc/wmi_unified_priv.h +++ b/wmi/inc/wmi_unified_priv.h @@ -2574,6 +2574,13 @@ QDF_STATUS (*extract_install_key_comp_event)(wmi_unified_t wmi_handle, void *evt_buf, uint32_t len, struct wmi_install_key_comp_event *param); + +#ifdef WLAN_ENH_CFR_ENABLE +QDF_STATUS +(*extract_cfr_phase_param)(wmi_unified_t wmi_handle, + void *evt_buf, + struct wmi_cfr_phase_delta_param *param); +#endif }; /* Forward declartion for psoc*/ diff --git a/wmi/src/wmi_unified_cfr_api.c b/wmi/src/wmi_unified_cfr_api.c index 8d727d7c48..4e2489220a 100644 --- a/wmi/src/wmi_unified_cfr_api.c +++ b/wmi/src/wmi_unified_cfr_api.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 @@ -52,5 +52,17 @@ QDF_STATUS wmi_unified_send_cfr_rcc_cmd(wmi_unified_t wmi_handle, return wmi_handle->ops->send_cfr_rcc_cmd(wmi_handle, cfg); return QDF_STATUS_E_FAILURE; } + +QDF_STATUS +wmi_extract_cfr_pdev_phase_delta_event(wmi_unified_t wmi_handle, + void *evt_buf, + struct wmi_cfr_phase_delta_param *param) +{ + if (wmi_handle->ops->extract_cfr_phase_param) + return wmi_handle->ops->extract_cfr_phase_param(wmi_handle, + evt_buf, + param); + return QDF_STATUS_E_FAILURE; +} #endif /* WLAN_ENH_CFR_ENABLE */ #endif /* WLAN_CFR_ENABLE */