qcacmn: Add support to extract the channel info from RTT measreq

Add support to extract the freq, cfreq1, cfreq2, PHY mode, Destination
macaddr, and channel BW values from the RTT measurement request buffer
received from the LOWI application. Pass these values to a registered
callback. Users can use these values to make some decisions on the RTT
scan.

Change-Id: Idb2232c07bbfa2946dc01e75908b9a6036597ecf
CRs-Fixed: 3060685
Este commit está contenido en:
Shashikala Prabhu
2021-11-01 16:40:58 +05:30
cometido por Madan Koyyalamudi
padre b966b27c3f
commit a117c19fda
Se han modificado 14 ficheros con 296 adiciones y 5 borrados

Ver fichero

@@ -1,5 +1,6 @@
/*
* Copyright (c) 2017, 2019-2020 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
@@ -176,4 +177,29 @@ static inline QDF_STATUS target_if_wifi_pos_convert_pdev_id_target_to_host(
}
#endif /* CNSS_GENL */
#if !defined(CNSS_GENL) && defined(WLAN_RTT_MEASUREMENT_NOTIFICATION)
/**
* target_if_wifi_pos_parse_measreq_chan_info() - Get the channel info from
* measurement request buffer.
* @pdev: Pointer to pdev structure
* @data_len: Data length of the LOWI measurement request buffer
* @dara: Pointer to the LOWI measurement request buffer
* @chinfo: Pointer to a structure to save channel info
*
* Return: QDF_STATUS
*/
static QDF_STATUS
target_if_wifi_pos_parse_measreq_chan_info(struct wlan_objmgr_pdev *pdev,
uint32_t data_len, uint8_t *data,
struct rtt_channel_info *chinfo);
#else
static inline QDF_STATUS
target_if_wifi_pos_parse_measreq_chan_info(struct wlan_objmgr_pdev *pdev,
uint32_t data_len, uint8_t *data,
struct rtt_channel_info *chinfo)
{
return QDF_STATUS_SUCCESS;
}
#endif /*!defined(CNSS_GENL) && defined(WLAN_RTT_MEASUREMENT_NOTIFICATION)*/
#endif /* _WIFI_POS_TGT_IF_H_ */

Ver fichero

@@ -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
@@ -21,13 +22,13 @@
* This file defines the functions pertinent to wifi positioning component's
* target if layer.
*/
#include "../../../../umac/wifi_pos/src/wifi_pos_utils_i.h"
#include "wifi_pos_utils_pub.h"
#include "wmi_unified_api.h"
#include "wlan_lmac_if_def.h"
#include "target_if_wifi_pos.h"
#include "../../../../umac/wifi_pos/src/wifi_pos_main_i.h"
#include "../../../../umac/wifi_pos/src/wifi_pos_utils_i.h"
#include "target_if.h"
#ifdef WLAN_FEATURE_CIF_CFR
#include "hal_api.h"
@@ -333,6 +334,8 @@ void target_if_wifi_pos_register_tx_ops(struct wlan_lmac_if_tx_ops *tx_ops)
target_if_wifi_pos_convert_pdev_id_target_to_host;
wifi_pos_tx_ops->wifi_pos_get_vht_ch_width =
target_if_wifi_pos_get_vht_ch_width;
wifi_pos_tx_ops->wifi_pos_parse_measreq_chan_info =
target_if_wifi_pos_parse_measreq_chan_info;
}
@@ -486,6 +489,35 @@ QDF_STATUS target_if_wifi_pos_convert_pdev_id_target_to_host(
return wmi_convert_pdev_id_target_to_host(wmi_hdl, target_pdev_id,
host_pdev_id);
}
#ifdef WLAN_RTT_MEASUREMENT_NOTIFICATION
static QDF_STATUS
target_if_wifi_pos_parse_measreq_chan_info(struct wlan_objmgr_pdev *pdev,
uint32_t data_len, uint8_t *data,
struct rtt_channel_info *chinfo)
{
QDF_STATUS status;
wmi_unified_t wmi_hdl = get_wmi_unified_hdl_from_pdev(pdev);
if (!data) {
target_if_err("data is null");
return QDF_STATUS_E_INVAL;
}
if (!wmi_hdl) {
target_if_err("wmi_hdl is null");
return QDF_STATUS_E_INVAL;
}
status = wmi_unified_extract_measreq_chan_info(wmi_hdl, data_len, data,
chinfo);
if (!QDF_IS_STATUS_SUCCESS(status))
target_if_err("wmi_unified_extract_measreq_chan_info failed");
return status;
}
#endif /* WLAN_RTT_MEASUREMENT_NOTIFICATION */
#endif /* CNSS_GENL */
#ifdef WLAN_FEATURE_CIF_CFR