Jelajahi Sumber

qcacld-3.0: Add new Wifi Pos files for legacy ops

Add below new Wifi pos files to register legacy peer create and
peer delete operations:
core/inc/wlan_wifi_pos_interface.h
core/src/wlan_wifi_pos_interface.c
dispatcher/inc/wifi_pos_ucfg_api.h
dispatcher/src/wifi_pos_ucfg_api.c

Change-Id: Iee628450fbaac9d57f1b672ca0550ce5c828f7d5
CRs-Fixed: 3170664
Pragaspathi Thilagaraj 3 tahun lalu
induk
melakukan
2bb23a6dd7

+ 54 - 0
components/wifi_pos/core/inc/wlan_wifi_pos_interface.h

@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2022 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
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+/**
+ * DOC: declare WIFI POS interface APIs exposed by the mlme component
+ */
+
+#ifndef _WLAN_WIFI_POS_IFACE_API_H_
+#define _WLAN_WIFI_POS_IFACE_API_H_
+
+#include <wlan_objmgr_vdev_obj.h>
+#include "wma_if.h"
+
+#if defined(WIFI_POS_CONVERGED) && defined(WLAN_FEATURE_RTT_11AZ_SUPPORT)
+/**
+ * wifi_pos_register_legacy_ops() - Register wifi pos legacy callbacks
+ * @psoc: Psoc pointer
+ *
+ * Return: QDF_STATUS
+ */
+QDF_STATUS
+wifi_pos_register_legacy_ops(struct wlan_objmgr_psoc *psoc);
+
+/**
+ * ucfg_wifi_pos_set_legacy_ops() - Wrapper to set legacy ops
+ * @psoc: PSOC pointer
+ *
+ * Return: QDF_STATUS
+ */
+static inline QDF_STATUS
+ucfg_wifi_pos_set_legacy_ops(struct wlan_objmgr_psoc *psoc)
+{
+	return wifi_pos_register_legacy_ops(psoc);
+}
+#else
+static inline QDF_STATUS
+ucfg_wifi_pos_set_legacy_ops(struct wlan_objmgr_psoc *psoc)
+{
+	return QDF_STATUS_SUCCESS;
+}
+#endif
+#endif /* _WLAN_WIFI_POS_IFACE_API_H_ */

+ 68 - 0
components/wifi_pos/core/src/wlan_wifi_pos_interface.c

@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 2022 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
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+/**
+ * DOC: define internal APIs related to the mlme component, legacy APIs are
+ *	called for the time being, but will be cleaned up after convergence
+ */
+#include "wma_api.h"
+#include "wma.h"
+#include "wifi_pos_api.h"
+#include "wlan_wifi_pos_interface.h"
+
+#if defined(WIFI_POS_CONVERGED) && defined(WLAN_FEATURE_RTT_11AZ_SUPPORT)
+/**
+ * wlan_wifi_pos_pasn_peer_create() - Callback to create ranging peer
+ * @psoc: Pointer to PSOC
+ * @peer_addr: Address of the peer for which PASN peer is to be created
+ * @vdev_id: Vdev id
+ *
+ * Return: QDF_STATUS
+ */
+static QDF_STATUS wlan_wifi_pos_pasn_peer_create(struct wlan_objmgr_psoc *psoc,
+						 struct qdf_mac_addr *peer_addr,
+						 uint8_t vdev_id)
+{
+	return wma_create_ranging_peer(psoc, peer_addr, vdev_id);
+}
+
+/**
+ * wlan_wifi_pos_pasn_peer_create() - Callback to create ranging peer
+ * @psoc: Pointer to PSOC
+ * @peer_addr: Address of the peer for which PASN peer is to be created
+ * @vdev_id: Vdev id
+ *
+ * Return: QDF_STATUS
+ */
+static QDF_STATUS wlan_wifi_pos_pasn_peer_delete(struct wlan_objmgr_psoc *psoc,
+						 struct qdf_mac_addr *peer_addr,
+						 uint8_t vdev_id,
+						 bool no_fw_peer_delete)
+{
+	return wma_remove_pasn_peer(psoc, peer_addr, vdev_id,
+				    no_fw_peer_delete);
+}
+
+static struct wifi_pos_legacy_ops wifi_pos_ops = {
+	.pasn_peer_create_cb = wlan_wifi_pos_pasn_peer_create,
+	.pasn_peer_delete_cb = wlan_wifi_pos_pasn_peer_delete,
+};
+
+QDF_STATUS
+wifi_pos_register_legacy_ops(struct wlan_objmgr_psoc *psoc)
+{
+	return wifi_pos_set_legacy_ops(psoc, &wifi_pos_ops);
+}
+#endif

+ 44 - 0
components/wifi_pos/dispatcher/inc/wifi_pos_ucfg_api.h

@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2022 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
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+/**
+ * DOC: declare WIFI POS ucfg APIs exposed by the mlme component
+ */
+
+#ifndef _WLAN_WIFI_POS_UCFG_API_H_
+#define _WLAN_WIFI_POS_UCFG_API_H_
+
+#include <wlan_objmgr_vdev_obj.h>
+#include "wma_if.h"
+#include "wlan_wifi_pos_interface.h"
+#include "os_if_wifi_pos_utils.h"
+
+#if defined(WIFI_POS_CONVERGED) && defined(WLAN_FEATURE_RTT_11AZ_SUPPORT)
+/**
+ * ucfg_wifi_pos_psoc_open  - Wifi pos module PSOC open api
+ * @psoc: Pointer to PSOC object
+ *
+ * Return: QDF_STATUS
+ */
+QDF_STATUS
+ucfg_wifi_pos_psoc_open(struct wlan_objmgr_psoc *psoc);
+#else
+static inline QDF_STATUS
+ucfg_wifi_pos_psoc_open(struct wlan_objmgr_psoc *psoc)
+{
+	return QDF_STATUS_SUCCESS;
+}
+#endif /* WIFI_POS_CONVERGED && WLAN_FEATURE_RTT_11AZ_SUPPORT */
+#endif /* _WLAN_WIFI_POS_UCFG_API_H_ */

+ 40 - 0
components/wifi_pos/dispatcher/src/wifi_pos_ucfg_api.c

@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2022 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
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+/**
+ * DOC: declare WIFI POS ucfg APIs exposed by the mlme component
+ */
+
+#include "wifi_pos_ucfg_api.h"
+#include "wifi_pos_utils_i.h"
+#include "os_if_wifi_pos_utils.h"
+
+#if defined(WIFI_POS_CONVERGED) && defined(WLAN_FEATURE_RTT_11AZ_SUPPORT)
+QDF_STATUS
+ucfg_wifi_pos_psoc_open(struct wlan_objmgr_psoc *psoc)
+{
+	QDF_STATUS status;
+
+	status = osif_wifi_pos_register_ops(psoc);
+	if (QDF_IS_STATUS_ERROR(status))
+		wifi_pos_err("Register OSIF ops failed");
+
+	status = ucfg_wifi_pos_set_legacy_ops(psoc);
+	if (QDF_IS_STATUS_ERROR(status))
+		wifi_pos_err("Set legacy ops failed");
+
+	return status;
+}
+#endif /* WIFI_POS_CONVERGED && WLAN_FEATURE_RTT_11AZ_SUPPORT */