Browse Source

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
Shashikala Prabhu 3 years ago
parent
commit
a117c19fda

+ 2 - 0
os_if/linux/wifi_pos/src/os_if_wifi_pos.c

@@ -1,5 +1,6 @@
 /*
  * Copyright (c) 2012-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
@@ -28,6 +29,7 @@
 #include "wlan_ptt_sock_svc.h"
 #include "wlan_nlink_common.h"
 #include "os_if_wifi_pos.h"
+#include <wlan_lmac_if_def.h>
 #include "wifi_pos_api.h"
 #include "wlan_cfg80211.h"
 #include "wlan_objmgr_psoc_obj.h"

+ 26 - 0
target_if/wifi_pos/inc/target_if_wifi_pos.h

@@ -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_ */

+ 33 - 1
target_if/wifi_pos/src/target_if_wifi_pos.c

@@ -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

+ 7 - 0
umac/global_umac_dispatcher/lmac_if/inc/wlan_lmac_if_def.h

@@ -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
@@ -818,6 +819,8 @@ struct wlan_lmac_if_iot_sim_tx_ops {
  * @wifi_pos_convert_pdev_id_target_to_host: function pointer to get host
  * pdev_id from target pdev_id.
  * @wifi_pos_get_vht_ch_width: Function pointer to get max supported bw by FW
+ * @wifi_pos_parse_measreq_chan_info: Parse channel info from LOWI measurement
+ *                                    request buffer.
  */
 struct wlan_lmac_if_wifi_pos_tx_ops {
 	QDF_STATUS (*data_req_tx)(struct wlan_objmgr_pdev *pdev,
@@ -832,6 +835,10 @@ struct wlan_lmac_if_wifi_pos_tx_ops {
 			uint32_t *host_pdev_id);
 	QDF_STATUS (*wifi_pos_get_vht_ch_width)(struct wlan_objmgr_psoc *psoc,
 						enum phy_ch_width *ch_width);
+	QDF_STATUS (*wifi_pos_parse_measreq_chan_info)(
+			struct wlan_objmgr_pdev *pdev, uint32_t data_len,
+			uint8_t *data, struct rtt_channel_info *chinfo);
+
 };
 #endif
 

+ 34 - 0
umac/mlme/vdev_mgr/dispatcher/inc/wlan_vdev_mgr_tgt_if_tx_defs.h

@@ -1,5 +1,6 @@
 /*
  * Copyright (c) 2019-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
@@ -704,4 +705,37 @@ struct muedca_params {
 	uint8_t muedca_timer[AC_MAX];       /* MU EDCA timer value */
 };
 
+/* Total 10 BSSIDs can be packed in a single measurement request buffer */
+#define RTT_MAX_BSSIDS_TO_SCAN  10
+
+/**
+ * struct rtt_bssid_info - Store the parsed macaddr and BW from the measurement
+ *                         request buffer.
+ * @macaddr: Destination macaddr to scan
+ * @bw: packet bandwidth
+ */
+struct rtt_bssid_info {
+	uint8_t macaddr[QDF_MAC_ADDR_SIZE];
+	uint8_t bw;
+};
+
+/**
+ * struct rtt_channel_info - Store the parsed channel info from LOWI measurement
+ *                           request buffer.
+ * @freq: Channel frequency
+ * @cfreq1: Center frequency1
+ * @cfreq2: Center frequency2
+ * @phymode: Phymode
+ * @num_bssids: Number of bssids present in the measurement request buffer
+ * @bssid_info: Array to store BW and macaddr present in the measurement request
+ *              buffer.
+ */
+struct rtt_channel_info {
+	uint16_t freq;
+	uint16_t cfreq1;
+	uint16_t cfreq2;
+	uint16_t phymode;
+	uint16_t num_bssids;
+	struct rtt_bssid_info bssid_info[RTT_MAX_BSSIDS_TO_SCAN];
+};
 #endif /* __WLAN_VDEV_MGR_TX_OPS_DEFS_H__ */

+ 50 - 2
umac/wifi_pos/inc/wifi_pos_api.h

@@ -1,5 +1,6 @@
 /*
  * Copyright (c) 2012-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
@@ -86,6 +87,7 @@ struct wifi_pos_interface {
  * @OEM_ERR_NULL_MESSAGE_HEADER: Invalid message header
  * @OEM_ERR_INVALID_MESSAGE_TYPE: Invalid message type
  * @OEM_ERR_INVALID_MESSAGE_LENGTH: Invalid length in message body
+ * @OEM_ERR_REQUEST_REJECTED: Request is rejected by the driver
  */
 enum oem_err_msg {
 	OEM_ERR_NULL_CONTEXT = 1,
@@ -93,7 +95,8 @@ enum oem_err_msg {
 	OEM_ERR_INVALID_SIGNATURE,
 	OEM_ERR_NULL_MESSAGE_HEADER,
 	OEM_ERR_INVALID_MESSAGE_TYPE,
-	OEM_ERR_INVALID_MESSAGE_LENGTH
+	OEM_ERR_INVALID_MESSAGE_LENGTH,
+	OEM_ERR_REQUEST_REJECTED
 };
 
 /* this struct is needed since MLME is not converged yet */
@@ -510,7 +513,52 @@ QDF_STATUS wifi_pos_register_get_pdev_id_by_dev_name(
 		struct wlan_objmgr_psoc *psoc,
 		QDF_STATUS (*handler)(char *dev_name, uint8_t *pdev_id,
 				      struct wlan_objmgr_psoc **psoc));
-#endif
+#endif /* CNSS_GENL */
+
+#if !defined(CNSS_GENL) && defined(WLAN_RTT_MEASUREMENT_NOTIFICATION)
+/**
+ * ucfg_wifi_pos_measurement_request_notification: ucfg API to notify
+ * measurement request received from the LOWI application
+ * @pdev: Pointer to pdev structure
+ * @req: Pointer to wifi_pos_req_msg structure
+ *
+ * Return: QDF_STATUS_SUCCESS in case of success, error codes in
+ * case of failure
+ */
+QDF_STATUS ucfg_wifi_pos_measurement_request_notification(
+		struct wlan_objmgr_pdev *pdev,
+		struct wifi_pos_req_msg *req);
+
+/**
+ * wifi_pos_register_measurement_request_notification: API to register a
+ * callback that needs to be called when the driver receives a measurement
+ * request from the LOWI application.
+ * @psoc: pointer to global psoc object
+ * @handler: callback to be registered
+ *
+ * Return: QDF_STATUS_SUCCESS in case of success, error codes in case of
+ * failure.
+ */
+QDF_STATUS wifi_pos_register_measurement_request_notification(
+		struct wlan_objmgr_psoc *psoc,
+		QDF_STATUS (*handler)(struct wlan_objmgr_pdev *pdev,
+				      struct rtt_channel_info *chinfo));
+#else
+static inline QDF_STATUS ucfg_wifi_pos_measurement_request_notification(
+		struct wlan_objmgr_pdev *pdev,
+		struct wifi_pos_req_msg *req)
+{
+	return QDF_STATUS_SUCCESS;
+}
+
+static inline QDF_STATUS wifi_pos_register_measurement_request_notification(
+		struct wlan_objmgr_psoc *psoc,
+		QDF_STATUS (*handler)(struct wlan_objmgr_pdev *pdev,
+				      struct rtt_channel_info *chinfo))
+{
+	return QDF_STATUS_SUCCESS;
+}
+#endif /*!defined(CNSS_GENL) && defined(WLAN_RTT_MEASUREMENT_NOTIFICATION)*/
 
 /**
  * wifi_pos_send_report_resp: Send report to osif

+ 33 - 1
umac/wifi_pos/src/wifi_pos_api.c

@@ -1,5 +1,6 @@
 /*
  * Copyright (c) 2017-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
@@ -20,6 +21,7 @@
  * This file defines the APIs wifi_pos component.
  */
 
+#include <wlan_lmac_if_def.h>
 #include "wifi_pos_api.h"
 #include "wifi_pos_utils_i.h"
 #include "wifi_pos_main_i.h"
@@ -406,7 +408,37 @@ QDF_STATUS wifi_pos_register_get_pdev_id_by_dev_name(
 
 	return QDF_STATUS_SUCCESS;
 }
-#endif
+
+#ifdef WLAN_RTT_MEASUREMENT_NOTIFICATION
+QDF_STATUS wifi_pos_register_measurement_request_notification(
+		struct wlan_objmgr_psoc *psoc,
+		QDF_STATUS (*handler)(struct wlan_objmgr_pdev *pdev,
+				      struct rtt_channel_info *chinfo))
+{
+	struct wifi_pos_psoc_priv_obj *wifi_pos_psoc;
+
+	if (!psoc) {
+		wifi_pos_err("psoc is null");
+		return QDF_STATUS_E_NULL_VALUE;
+	}
+
+	if (!handler) {
+		wifi_pos_err("Null callback");
+		return QDF_STATUS_E_NULL_VALUE;
+	}
+
+	wifi_pos_psoc = wifi_pos_get_psoc_priv_obj(psoc);
+	if (!wifi_pos_psoc) {
+		wifi_pos_err("wifi_pos priv obj is null");
+		return QDF_STATUS_E_NULL_VALUE;
+	}
+
+	wifi_pos_psoc->wifi_pos_measurement_request_notification = handler;
+
+	return QDF_STATUS_SUCCESS;
+}
+#endif /* WLAN_RTT_MEASUREMENT_NOTIFICATION */
+#endif /* CNSS_GENL */
 
 QDF_STATUS wifi_pos_register_send_action(
 				struct wlan_objmgr_psoc *psoc,

+ 16 - 0
umac/wifi_pos/src/wifi_pos_main.c

@@ -1,5 +1,6 @@
 /*
  * Copyright (c) 2012-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,6 +22,7 @@
  * This file defines the important functions pertinent to
  * wifi positioning to initialize and de-initialize the component.
  */
+#include <wlan_lmac_if_def.h>
 #include "target_if_wifi_pos.h"
 #include "wifi_pos_oem_interface_i.h"
 #include "wifi_pos_utils_i.h"
@@ -213,6 +215,7 @@ static QDF_STATUS wifi_pos_process_data_req(struct wlan_objmgr_psoc *psoc,
 	struct wifi_pos_psoc_priv_obj *wifi_pos_obj =
 				wifi_pos_get_psoc_priv_obj(wifi_pos_get_psoc());
 	QDF_STATUS status;
+	uint8_t err;
 
 
 	if (!wifi_pos_obj) {
@@ -300,6 +303,19 @@ static QDF_STATUS wifi_pos_process_data_req(struct wlan_objmgr_psoc *psoc,
 			wifi_pos_err("pdev null");
 			return QDF_STATUS_E_INVAL;
 		}
+
+		status = ucfg_wifi_pos_measurement_request_notification(
+				pdev, req);
+		if (QDF_IS_STATUS_ERROR(status)) {
+			err = OEM_ERR_REQUEST_REJECTED;
+			wifi_pos_obj->wifi_pos_send_rsp(
+					psoc, wifi_pos_get_app_pid(psoc),
+					WIFI_POS_CMD_ERROR, sizeof(err), &err);
+			wlan_objmgr_pdev_release_ref(pdev,
+						     WLAN_WIFI_POS_CORE_ID);
+			return QDF_STATUS_E_INVAL;
+		}
+
 		data_req.data_len = req->buf_len;
 		data_req.data = req->buf;
 		tx_ops->data_req_tx(pdev, &data_req);

+ 52 - 0
umac/wifi_pos/src/wifi_pos_ucfg.c

@@ -1,5 +1,6 @@
 /*
  * Copyright (c) 2017-2018, 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
@@ -20,12 +21,14 @@
  * This file defines the important dispatcher APIs pertinent to
  * wifi positioning.
  */
+#include <wlan_lmac_if_def.h>
 #include "wifi_pos_utils_i.h"
 #include "wifi_pos_api.h"
 #include "wifi_pos_ucfg_i.h"
 #include "wlan_ptt_sock_svc.h"
 #ifndef CNSS_GENL
 #include <wlan_objmgr_psoc_obj.h>
+#include "wifi_pos_main_i.h"
 #endif
 
 #ifndef CNSS_GENL
@@ -55,6 +58,55 @@ QDF_STATUS ucfg_wifi_psoc_get_pdev_id_by_dev_name(
 	return wifi_pos_psoc_obj->wifi_pos_get_pdev_id_by_dev_name(
 			dev_name, pdev_id, psoc);
 }
+
+#ifdef WLAN_RTT_MEASUREMENT_NOTIFICATION
+QDF_STATUS ucfg_wifi_pos_measurement_request_notification(
+		struct wlan_objmgr_pdev *pdev,
+		struct wifi_pos_req_msg *req)
+{
+	struct wlan_objmgr_psoc *psoc = wifi_pos_get_psoc();
+	struct wifi_pos_psoc_priv_obj *wifi_pos_psoc_obj;
+	struct wlan_lmac_if_wifi_pos_tx_ops *tx_ops;
+	struct rtt_channel_info chinfo = {0};
+
+	if (!psoc) {
+		wifi_pos_err("psoc is null");
+		return QDF_STATUS_E_NULL_VALUE;
+	}
+
+	wifi_pos_psoc_obj = wifi_pos_get_psoc_priv_obj(psoc);
+	if (!wifi_pos_psoc_obj) {
+		wifi_pos_err("wifi_pos_psoc_obj is null");
+		return QDF_STATUS_E_NULL_VALUE;
+	}
+
+	if (!wifi_pos_psoc_obj->wifi_pos_measurement_request_notification) {
+		wifi_pos_debug("wifi_pos_measurement_request_notification is not registered");
+		return QDF_STATUS_SUCCESS;
+	}
+
+	tx_ops = wifi_pos_get_tx_ops(psoc);
+	if (!tx_ops) {
+		wifi_pos_err("tx_ops null");
+		return QDF_STATUS_E_NULL_VALUE;
+	}
+
+	if (!tx_ops->wifi_pos_parse_measreq_chan_info) {
+		wifi_pos_err("wifi_pos_parse_measreq_chan_info is null");
+		return QDF_STATUS_E_NULL_VALUE;
+	}
+
+	tx_ops->wifi_pos_parse_measreq_chan_info(pdev, req->buf_len, req->buf,
+						 &chinfo);
+	if (!chinfo.freq) {
+		wifi_pos_debug("Not a measurement request buffer, proceed");
+		return QDF_STATUS_SUCCESS;
+	}
+
+	return wifi_pos_psoc_obj->wifi_pos_measurement_request_notification(
+			pdev, &chinfo);
+}
+#endif /* WLAN_RTT_MEASUREMENT_NOTIFICATION */
 #endif
 
 QDF_STATUS ucfg_wifi_pos_process_req(struct wlan_objmgr_psoc *psoc,

+ 2 - 0
umac/wifi_pos/src/wifi_pos_utils.c

@@ -1,5 +1,6 @@
 /*
  * Copyright (c) 2017-2019 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
@@ -24,6 +25,7 @@
 #include "wlan_objmgr_cmn.h"
 #include "wlan_objmgr_global_obj.h"
 #include "wlan_objmgr_psoc_obj.h"
+#include <wlan_lmac_if_def.h>
 #include "wifi_pos_utils_i.h"
 
 /* lock to protect use of psoc global pointer variable */

+ 7 - 0
umac/wifi_pos/src/wifi_pos_utils_i.h

@@ -1,5 +1,6 @@
 /*
  * Copyright (c) 2012-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
@@ -247,6 +248,9 @@ typedef void (*wifi_pos_send_rsp_handler)(struct wlan_objmgr_psoc *, uint32_t,
  * @wifi_pos_send_action: function pointer to send registered action frames
  *                        to userspace APP
  * @wifi_pos_get_pdev_id_by_dev_name: get pdev_id from device name
+ * @wifi_pos_measurement_request_notification: Call this API when the driver
+ *                                             receives measurement request
+ *                                             from the LOWI application
  * @rsp_version: rsp version
  *
  * wifi pos request messages
@@ -297,6 +301,9 @@ struct wifi_pos_psoc_priv_obj {
 	QDF_STATUS (*wifi_pos_get_pdev_id_by_dev_name)(
 			char *dev_name, uint8_t *pdev_id,
 			struct wlan_objmgr_psoc **psoc);
+	QDF_STATUS (*wifi_pos_measurement_request_notification)(
+			struct wlan_objmgr_pdev *pdev,
+			struct rtt_channel_info *chinfo);
 	uint32_t rsp_version;
 };
 

+ 15 - 1
wmi/inc/wmi_unified_api.h

@@ -4103,7 +4103,21 @@ QDF_STATUS wmi_convert_pdev_id_host_to_target(wmi_unified_t wmi_handle,
 QDF_STATUS wmi_convert_pdev_id_target_to_host(wmi_unified_t wmi_handle,
 					      uint32_t target_pdev_id,
 					      uint32_t *host_pdev_id);
-#endif
+
+#ifdef WLAN_RTT_MEASUREMENT_NOTIFICATION
+/**
+ * wmi_unified_extract_measreq_chan_info() - Extract the channel info from the
+ * LOWI measurement request buffer.
+ * @wmi_handle: wmi handle
+ * @data_len: the length of @data
+ * @data: the pointer to data buf
+ * @chinfo: Pointer to a structure to save channel info
+ */
+QDF_STATUS wmi_unified_extract_measreq_chan_info(
+		wmi_unified_t wmi_handle, uint32_t data_len, uint8_t *data,
+		struct rtt_channel_info *chinfo);
+#endif /* WLAN_RTT_MEASUREMENT_NOTIFICATION */
+#endif /* CNSS_GENL */
 
 /**
  * wmi_unified_send_bss_color_change_enable_cmd() - WMI function to send bss

+ 4 - 0
wmi/inc/wmi_unified_priv.h

@@ -2660,6 +2660,10 @@ QDF_STATUS (*send_lcr_cmd)(wmi_unified_t wmi_handle,
 			   struct wmi_wifi_pos_lcr_info *lcr_info);
 QDF_STATUS (*send_lci_cmd)(wmi_unified_t wmi_handle,
 			   struct wifi_pos_lci_info *lci_info);
+#if !defined(CNSS_GENL) && defined(WLAN_RTT_MEASUREMENT_NOTIFICATION)
+QDF_STATUS (*extract_measreq_chan_info)(uint32_t data_len, uint8_t *data,
+					struct rtt_channel_info *chinfo);
+#endif
 
 #ifdef WLAN_SUPPORT_MESH_LATENCY
 QDF_STATUS (*config_vdev_tid_latency_info_cmd)(

+ 15 - 0
wmi/src/wmi_unified_api.c

@@ -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
@@ -3202,6 +3203,20 @@ QDF_STATUS wmi_convert_pdev_id_target_to_host(wmi_unified_t wmi_handle,
 
 	return QDF_STATUS_E_FAILURE;
 }
+
+#ifdef WLAN_RTT_MEASUREMENT_NOTIFICATION
+QDF_STATUS wmi_unified_extract_measreq_chan_info(
+		wmi_unified_t wmi_handle, uint32_t data_len, uint8_t *data,
+		struct rtt_channel_info *chinfo)
+{
+	if (wmi_handle->ops->extract_measreq_chan_info)
+		return wmi_handle->ops->extract_measreq_chan_info(
+								data_len,
+								data, chinfo);
+
+	return QDF_STATUS_E_FAILURE;
+}
+#endif /* WLAN_RTT_MEASUREMENT_NOTIFICATION */
 #endif
 
 QDF_STATUS