qcacmn: Add new wmi ops extract_inst_rssi_stats_resp

Add new wmi ops extract_inst_rssi_stats_resp to extract instantaneous
rssi stats resp.

Change-Id: Idce8a5fb0036145aa14682997ca5101666772c70
CRs-Fixed: 3058799
This commit is contained in:
Li Feng
2021-11-08 12:09:56 +08:00
committed by Madan Koyyalamudi
parent dece2a5af1
commit 9cba107914
5 changed files with 91 additions and 0 deletions

View File

@@ -1,5 +1,6 @@
/*
* Copyright (c) 2013-2021, The Linux Foundation. All rights reserved.
* Copyright (c) 2021 Qualcomm Innovation Center, Inc. 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
@@ -154,4 +155,18 @@ QDF_STATUS
wmi_extract_peer_extd_stats(wmi_unified_t wmi_handle, void *evt_buf,
uint32_t index,
wmi_host_peer_extd_stats *peer_extd_stats);
#ifdef WLAN_FEATURE_SON
/**
* wmi_extract_inst_rssi_stats_resp() - extract inst rssi stats from event
* @wmi_handle: wmi handle
* @evt_buf: pointer to event buffer
* @inst_rssi_resp: pointer to hold inst rssi stats
*
* Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure
*/
QDF_STATUS
wmi_extract_inst_rssi_stats_resp(wmi_unified_t wmi_handle, void *evt_buf,
struct wmi_host_inst_rssi_stats_resp *inst_rssi_resp);
#endif
#endif /* _WMI_UNIFIED_CP_STATS_API_H_ */

View File

@@ -8204,4 +8204,18 @@ struct set_mec_timer_params {
uint32_t mec_aging_timer_threshold;
};
#endif
#ifdef WLAN_FEATURE_SON
/**
* struct wmi_host_inst_rssi_stats_resp - inst rssi stats
* @inst_rssi: instantaneous rssi above the noise floor in dB unit
* @peer_macaddr: peer mac address
* @vdev_id: vdev_id
*/
struct wmi_host_inst_rssi_stats_resp {
uint32_t inst_rssi;
struct qdf_mac_addr peer_macaddr;
uint32_t vdev_id;
};
#endif
#endif /* _WMI_UNIFIED_PARAM_H_ */

View File

@@ -1,5 +1,6 @@
/*
* Copyright (c) 2013-2021 The Linux Foundation. All rights reserved.
* Copyright (c) 2021 Qualcomm Innovation Center, Inc. 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
@@ -2754,6 +2755,12 @@ QDF_STATUS
void *evt_buf,
struct wmi_mlo_link_set_active_resp *resp);
#endif
#ifdef WLAN_FEATURE_SON
QDF_STATUS
(*extract_inst_rssi_stats_resp)(wmi_unified_t wmi_handle, void *evt_buf,
struct wmi_host_inst_rssi_stats_resp *inst_rssi_resp);
#endif
};
/* Forward declartion for psoc*/

View File

@@ -1,5 +1,6 @@
/*
* Copyright (c) 2016-2021, The Linux Foundation. All rights reserved.
* Copyright (c) 2021 Qualcomm Innovation Center, Inc. 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
@@ -130,3 +131,16 @@ wmi_extract_peer_extd_stats(wmi_unified_t wmi_handle, void *evt_buf,
return QDF_STATUS_E_FAILURE;
}
#ifdef WLAN_FEATURE_SON
QDF_STATUS
wmi_extract_inst_rssi_stats_resp(wmi_unified_t wmi_handle, void *evt_buf,
struct wmi_host_inst_rssi_stats_resp *inst_rssi_resp)
{
if (wmi_handle->ops->extract_inst_rssi_stats_resp)
return wmi_handle->ops->extract_inst_rssi_stats_resp(
wmi_handle, evt_buf, inst_rssi_resp);
return QDF_STATUS_E_FAILURE;
}
#endif

View File

@@ -1,5 +1,6 @@
/*
* Copyright (c) 2016-2021, The Linux Foundation. All rights reserved.
* Copyright (c) 2021 Qualcomm Innovation Center, Inc. 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
@@ -927,6 +928,45 @@ static void wmi_infra_cp_stats_ops_attach_tlv(struct wmi_ops *ops)
}
#endif /* WLAN_SUPPORT_INFRA_CTRL_PATH_STATS */
#ifdef WLAN_FEATURE_SON
/**
* extract_inst_rssi_stats_resp_tlv() - extract inst rssi stats from event
* @wmi_handle: wmi handle
* @evt_buf: pointer to event buffer
* @inst_rssi_resp: Pointer to hold inst rssi response
*
* @Return: QDF_STATUS_SUCCESS for success or error code
*/
static QDF_STATUS
extract_inst_rssi_stats_resp_tlv(wmi_unified_t wmi_handle, void *evt_buf,
struct wmi_host_inst_rssi_stats_resp *inst_rssi_resp)
{
WMI_INST_RSSI_STATS_EVENTID_param_tlvs *param_buf;
wmi_inst_rssi_stats_resp_fixed_param *event;
param_buf = (WMI_INST_RSSI_STATS_EVENTID_param_tlvs *)evt_buf;
event = (wmi_inst_rssi_stats_resp_fixed_param *)param_buf->fixed_param;
inst_rssi_resp->inst_rssi = event->iRSSI;
WMI_CHAR_ARRAY_TO_MAC_ADDR(inst_rssi_resp->peer_macaddr.bytes,
&event->peer_macaddr);
inst_rssi_resp->vdev_id = event->vdev_id;
return QDF_STATUS_SUCCESS;
}
static void
wmi_inst_rssi_stats_ops_attach_tlv(struct wmi_ops *ops)
{
ops->extract_inst_rssi_stats_resp = extract_inst_rssi_stats_resp_tlv;
}
#else
static void
wmi_inst_rssi_stats_ops_attach_tlv(struct wmi_ops *ops)
{
}
#endif
void wmi_cp_stats_attach_tlv(wmi_unified_t wmi_handle)
{
struct wmi_ops *ops = wmi_handle->ops;
@@ -943,6 +983,7 @@ void wmi_cp_stats_attach_tlv(wmi_unified_t wmi_handle)
ops->extract_peer_extd_stats = extract_peer_extd_stats_tlv;
wmi_infra_cp_stats_ops_attach_tlv(ops);
ops->extract_pmf_bcn_protect_stats = extract_pmf_bcn_protect_stats_tlv,
wmi_inst_rssi_stats_ops_attach_tlv(ops);
wmi_mc_cp_stats_attach_tlv(wmi_handle);
}