Explorar el Código

qcacld-3.0: Implement api for interop issues ap

Implement the interface to transfer the info between
host driver and firmware about the ap which has interop
issues with the DUT. It is detected by firmware and
forwarded to user sapce for persistent storage. And
user space configs these APs to firmware when the DUT
starts up next time.

CRs-Fixed: 2425202
Change-Id: I2e828d521f0e04862a01fa1c90626f51b7f65796
Paul Zhang hace 6 años
padre
commit
773de9fb86

+ 154 - 0
interop_issues_ap/core/inc/wlan_interop_issues_ap_api.h

@@ -0,0 +1,154 @@
+/*
+ * Copyright (c) 2019 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 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: wlan_interop_issues_ap_api.h
+ *
+ * This header file provide API declarations required for interop issues
+ * ap global context specific to offload
+ */
+
+#ifndef __WLAN_INTEROP_ISSUES_AP_API_H__
+#define __WLAN_INTEROP_ISSUES_AP_API_H__
+
+#ifdef WLAN_FEATURE_INTEROP_ISSUES_AP
+#include <qdf_types.h>
+#include <wlan_objmgr_cmn.h>
+#include <wlan_objmgr_global_obj.h>
+#include <wlan_objmgr_psoc_obj.h>
+#include <wlan_interop_issues_ap_public_structs.h>
+
+#define interop_issues_ap_debug(args ...) \
+	QDF_TRACE_DEBUG(QDF_MODULE_ID_INTEROP_ISSUES_AP, ## args)
+#define interop_issues_ap_err(args ...) \
+	QDF_TRACE_ERROR(QDF_MODULE_ID_INTEROP_ISSUES_AP, ## args)
+
+/**
+ * struct interop_issues_ap_psoc_priv_obj - psoc private object
+ * @lock: qdf spin lock
+ * @soc: pointer to psoc object
+ * @cbs: interop issues ap ps event callbacks
+ * @tx_ops: interop issues ap ps tx ops
+ */
+struct interop_issues_ap_psoc_priv_obj {
+	qdf_spinlock_t lock;
+	struct wlan_objmgr_psoc *soc;
+	struct wlan_interop_issues_ap_callbacks cbs;
+	struct wlan_interop_issues_ap_tx_ops tx_ops;
+};
+
+/**
+ * wlan_interop_issues_ap_psoc_enable() - interop issues ap psoc enable
+ * @psoc: the pointer to psoc object
+ *
+ * Return: QDF_STATUS
+ */
+QDF_STATUS wlan_interop_issues_ap_psoc_enable(struct wlan_objmgr_psoc *soc);
+
+/**
+ * wlan_interop_issues_ap_psoc_disable() - interop issues ap psoc disable
+ * @psoc: the pointer to psoc object
+ *
+ * Return: QDF_STATUS
+ */
+QDF_STATUS wlan_interop_issues_ap_psoc_disable(struct wlan_objmgr_psoc *soc);
+
+/**
+ * wlan_interop_issues_ap_init() - API to init component
+ *
+ * Return: QDF_STATUS_SUCCESS on success, QDF_STATUS_E_** on error
+ */
+QDF_STATUS wlan_interop_issues_ap_init(void);
+
+/**
+ * wlan_interop_issues_ap_deinit() - API to deinit component
+ *
+ * Return: QDF_STATUS_SUCCESS on success, QDF_STATUS_E_** on error
+ */
+QDF_STATUS wlan_interop_issues_ap_deinit(void);
+
+/**
+ * interop_issues_ap_get_psoc_priv_obj() - get priv object from psoc object
+ * @psoc: pointer to psoc object
+ *
+ * Return: pointer to interop issues ap psoc private object
+ */
+static inline
+struct interop_issues_ap_psoc_priv_obj *interop_issues_ap_get_psoc_priv_obj(
+						struct wlan_objmgr_psoc *psoc)
+{
+	struct interop_issues_ap_psoc_priv_obj *obj;
+
+	if (!psoc)
+		return NULL;
+
+	obj = wlan_objmgr_psoc_get_comp_private_obj(psoc,
+					WLAN_UMAC_COMP_INTEROP_ISSUES_AP);
+
+	return obj;
+}
+
+/**
+ * interop_issues_ap_psoc_get_tx_ops() - get TX ops from the private object
+ * @psoc: pointer to psoc object
+ *
+ * Return: pointer to TX op callback
+ */
+static inline
+struct wlan_interop_issues_ap_tx_ops *interop_issues_ap_psoc_get_tx_ops(
+						struct wlan_objmgr_psoc *psoc)
+{
+	struct interop_issues_ap_psoc_priv_obj *interop_issues_ap_priv;
+
+	if (!psoc)
+		return NULL;
+
+	interop_issues_ap_priv = interop_issues_ap_get_psoc_priv_obj(psoc);
+	if (!interop_issues_ap_priv) {
+		interop_issues_ap_err("psoc private object is null");
+		return NULL;
+	}
+
+	return &interop_issues_ap_priv->tx_ops;
+}
+
+/**
+ * interop_issues_ap_psoc_get_cbs() - get RX ops from private object
+ * @psoc: pointer to psoc object
+ *
+ * Return: pointer to RX op callback
+ */
+static inline
+struct wlan_interop_issues_ap_callbacks *interop_issues_ap_psoc_get_cbs(
+						struct wlan_objmgr_psoc *psoc)
+{
+	struct interop_issues_ap_psoc_priv_obj *interop_issues_ap_priv;
+
+	if (!psoc)
+		return NULL;
+
+	interop_issues_ap_priv = interop_issues_ap_get_psoc_priv_obj(psoc);
+	if (!interop_issues_ap_priv) {
+		interop_issues_ap_err("psoc private object is null");
+		return NULL;
+	}
+
+	return &interop_issues_ap_priv->cbs;
+}
+#endif
+#endif

+ 171 - 0
interop_issues_ap/core/src/wlan_interop_issues_ap_api.c

@@ -0,0 +1,171 @@
+/*
+ * Copyright (c) 2019 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 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: wlan_interop_issues_ap_api.c
+ */
+#include <wlan_interop_issues_ap_ucfg_api.h>
+#include <wlan_interop_issues_ap_api.h>
+#include <target_if_interop_issues_ap.h>
+
+/**
+ * interop_issues_ap_psoc_obj_created_notification() - PSOC obj create callback
+ * @psoc: PSOC object
+ * @arg_list: Variable argument list
+ *
+ * This callback is registered with object manager during initialization to
+ * get notified when the object is created.
+ *
+ * Return: Success or Failure
+ */
+static QDF_STATUS
+interop_issues_ap_psoc_obj_created_notification(struct wlan_objmgr_psoc *psoc,
+						void *arg_list)
+{
+	QDF_STATUS status = QDF_STATUS_SUCCESS;
+	struct interop_issues_ap_psoc_priv_obj *interop_issues_ap_obj;
+
+	interop_issues_ap_obj = qdf_mem_malloc(sizeof(*interop_issues_ap_obj));
+	if (!interop_issues_ap_obj)
+		return QDF_STATUS_E_NOMEM;
+
+	qdf_spinlock_create(&interop_issues_ap_obj->lock);
+	status = wlan_objmgr_psoc_component_obj_attach(psoc,
+					WLAN_UMAC_COMP_INTEROP_ISSUES_AP,
+					interop_issues_ap_obj,
+					QDF_STATUS_SUCCESS);
+	if (QDF_IS_STATUS_ERROR(status)) {
+		interop_issues_ap_err("obj attach with psoc failed");
+		goto interop_issues_ap_psoc_attach_failed;
+	}
+
+	target_if_interop_issues_ap_register_tx_ops(psoc,
+					&interop_issues_ap_obj->tx_ops);
+
+	return QDF_STATUS_SUCCESS;
+
+interop_issues_ap_psoc_attach_failed:
+	qdf_spinlock_destroy(&interop_issues_ap_obj->lock);
+	qdf_mem_free(interop_issues_ap_obj);
+	return status;
+}
+
+/**
+ * interop_issues_ap_psoc_obj_destroyed_notification() - obj delete callback
+ * @psoc: PSOC object
+ * @arg_list: Variable argument list
+ *
+ * This callback is registered with object manager during initialization to
+ * get notified when the object is deleted.
+ *
+ * Return: Success or Failure
+ */
+static QDF_STATUS
+interop_issues_ap_psoc_obj_destroyed_notification(struct wlan_objmgr_psoc *psoc,
+						  void *arg_list)
+{
+	QDF_STATUS status = QDF_STATUS_SUCCESS;
+	struct interop_issues_ap_psoc_priv_obj *interop_issues_ap_obj;
+
+	interop_issues_ap_obj = interop_issues_ap_get_psoc_priv_obj(psoc);
+
+	if (!interop_issues_ap_obj) {
+		interop_issues_ap_err("interop_issues_ap_obj is NULL");
+		return QDF_STATUS_E_FAULT;
+	}
+	target_if_interop_issues_ap_unregister_tx_ops(psoc,
+					&interop_issues_ap_obj->tx_ops);
+
+	status = wlan_objmgr_psoc_component_obj_detach(psoc,
+					WLAN_UMAC_COMP_INTEROP_ISSUES_AP,
+					interop_issues_ap_obj);
+	if (QDF_IS_STATUS_ERROR(status))
+		interop_issues_ap_err("interop_issues_ap_obj detach failed");
+
+	qdf_spinlock_destroy(&interop_issues_ap_obj->lock);
+	qdf_mem_free(interop_issues_ap_obj);
+
+	return status;
+}
+
+QDF_STATUS wlan_interop_issues_ap_psoc_enable(struct wlan_objmgr_psoc *psoc)
+{
+	return target_if_interop_issues_ap_register_event_handler(psoc);
+}
+
+QDF_STATUS wlan_interop_issues_ap_psoc_disable(struct wlan_objmgr_psoc *psoc)
+{
+	return target_if_interop_issues_ap_unregister_event_handler(psoc);
+}
+
+QDF_STATUS wlan_interop_issues_ap_init(void)
+{
+	QDF_STATUS status;
+
+	/* register psoc create handler functions. */
+	status = wlan_objmgr_register_psoc_create_handler(
+			WLAN_UMAC_COMP_INTEROP_ISSUES_AP,
+			interop_issues_ap_psoc_obj_created_notification,
+			NULL);
+	if (QDF_IS_STATUS_ERROR(status)) {
+		interop_issues_ap_err("register create handler failed");
+		return status;
+	}
+
+	/* register psoc delete handler functions. */
+	status = wlan_objmgr_register_psoc_destroy_handler(
+			WLAN_UMAC_COMP_INTEROP_ISSUES_AP,
+			interop_issues_ap_psoc_obj_destroyed_notification,
+			NULL);
+	if (QDF_IS_STATUS_ERROR(status)) {
+		interop_issues_ap_err("register destroy handler failed");
+		status = wlan_objmgr_unregister_psoc_create_handler(
+				WLAN_UMAC_COMP_INTEROP_ISSUES_AP,
+				interop_issues_ap_psoc_obj_created_notification,
+				NULL);
+	}
+
+	return status;
+}
+
+QDF_STATUS wlan_interop_issues_ap_deinit(void)
+{
+	QDF_STATUS ret = QDF_STATUS_SUCCESS, status;
+
+	/* unregister psoc delete handler functions. */
+	status = wlan_objmgr_unregister_psoc_destroy_handler(
+			WLAN_UMAC_COMP_INTEROP_ISSUES_AP,
+			interop_issues_ap_psoc_obj_destroyed_notification,
+			NULL);
+	if (QDF_IS_STATUS_ERROR(status)) {
+		interop_issues_ap_err("unregister destroy handler failed");
+		ret = status;
+	}
+
+	/* unregister psoc create handler functions. */
+	status = wlan_objmgr_unregister_psoc_create_handler(
+			WLAN_UMAC_COMP_INTEROP_ISSUES_AP,
+			interop_issues_ap_psoc_obj_created_notification,
+			NULL);
+	if (QDF_IS_STATUS_ERROR(status)) {
+		interop_issues_ap_err("unregister create handler failed");
+		ret = status;
+	}
+
+	return ret;
+}

+ 74 - 0
interop_issues_ap/dispatcher/inc/wlan_interop_issues_ap_public_structs.h

@@ -0,0 +1,74 @@
+/*
+ * Copyright (c) 2019 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 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: contains interop issues ap structure definations
+ */
+
+#ifndef _WLAN_INTEROP_ISSUES_AP_STRUCTS_H_
+#define _WLAN_INTEROP_ISSUES_AP_STRUCTS_H_
+
+#ifdef WLAN_FEATURE_INTEROP_ISSUES_AP
+#include <qdf_types.h>
+#include <wlan_objmgr_psoc_obj.h>
+
+#define MAX_INTEROP_ISSUES_AP_NUM 20
+
+/**
+ * struct wlan_interop_issues_ap_info - interop issues ap info
+ * @count: the number of interop issues ap
+ * @rap_items: interop issues ap items
+ */
+struct wlan_interop_issues_ap_info {
+	uint32_t count;
+	struct qdf_mac_addr rap_items[MAX_INTEROP_ISSUES_AP_NUM];
+};
+
+/**
+ * struct wlan_interop_issues_ap_event - interop issues ap event
+ * @pdev: pdev object
+ * @psoc: psoc object
+ * @pdev_id: pdev id number
+ * @rap_addr: interop issues ap mac address
+ */
+struct wlan_interop_issues_ap_event {
+	struct wlan_objmgr_pdev *pdev;
+	struct wlan_objmgr_psoc *psoc;
+	uint32_t pdev_id;
+	struct qdf_mac_addr rap_addr;
+};
+
+/**
+ * struct wlan_interop_issues_ap_callbacks - interop issues ap callbacks
+ * @os_if_interop_issues_ap_event_handler: OS IF callback for handling events
+ */
+struct wlan_interop_issues_ap_callbacks {
+	void (*os_if_interop_issues_ap_event_handler)
+				(struct wlan_interop_issues_ap_event *event);
+};
+
+/**
+ * struct wlan_interop_issues_ap_tx_ops - structure of tx func pointers
+ * @set_rap_ps: handler for TX operations for the interop issues ap ps config
+ */
+struct wlan_interop_issues_ap_tx_ops {
+	QDF_STATUS (*set_rap_ps)(struct wlan_objmgr_psoc *psoc,
+				 struct wlan_interop_issues_ap_info *rap);
+};
+#endif
+#endif /* _WLAN_INTEROP_ISSUES_AP_STRUCTS_H_ */

+ 50 - 0
interop_issues_ap/dispatcher/inc/wlan_interop_issues_ap_tgt_api.h

@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2019 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 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: wlan_interop_issues_ap_tgt_api.h
+ *
+ * This header file provide with API declarations to interface with Southbound
+ */
+#ifndef __WLAN_INTEROP_ISSUES_AP_TGT_API_H__
+#define __WLAN_INTEROP_ISSUES_AP_TGT_API_H__
+
+#ifdef WLAN_FEATURE_INTEROP_ISSUES_AP
+/**
+ * tgt_interop_issues_ap_info_callback() - interop issues ap info callback
+ * @psoc: the pointer to psoc object manager
+ * @rap: the interop issues ap mac address
+ *
+ * Return: QDF_STATUS
+ */
+QDF_STATUS
+tgt_interop_issues_ap_info_callback(struct wlan_objmgr_psoc *psoc,
+				    struct wlan_interop_issues_ap_event *rap);
+
+/**
+ * tgt_set_interop_issues_ap_req(): API to set interop issues ap to lmac
+ * @rx_ops: rx ops struct
+ * @rap: the pointer to interop issues ap info
+ *
+ * Return: status of operation
+ */
+QDF_STATUS
+tgt_set_interop_issues_ap_req(struct wlan_objmgr_psoc *psoc,
+			      struct wlan_interop_issues_ap_info *rap);
+#endif
+#endif /* __WLAN_INTEROP_ISSUES_AP_TGT_API_H__ */

+ 100 - 0
interop_issues_ap/dispatcher/inc/wlan_interop_issues_ap_ucfg_api.h

@@ -0,0 +1,100 @@
+/*
+ * Copyright (c) 2019 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 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: wlan_interop_issues_ap_ucfg_api.h
+ *
+ * This header file maintain API declaration required for northbound interaction
+ */
+
+#ifndef __WLAN_INTEROP_ISSUES_AP_UCFG_API_H__
+#define __WLAN_INTEROP_ISSUES_AP_UCFG_API_H__
+
+#ifdef WLAN_FEATURE_INTEROP_ISSUES_AP
+#include <qdf_status.h>
+#include <qdf_types.h>
+#include <wlan_interop_issues_ap_public_structs.h>
+
+/**
+ * ucfg_interop_issues_ap_psoc_enable() - interop issues ap component enable
+ * @psoc: the point to psoc object
+ *
+ * Return: QDF_STATUS_SUCCESS - in case of success
+ */
+QDF_STATUS ucfg_interop_issues_ap_psoc_enable(struct wlan_objmgr_psoc *psoc);
+
+/**
+ * ucfg_interop_issues_ap_psoc_disable() - interop issues ap component disable
+ * @psoc: the point to psoc object
+ *
+ * Return: QDF_STATUS_SUCCESS - in case of success
+ */
+QDF_STATUS ucfg_interop_issues_ap_psoc_disable(struct wlan_objmgr_psoc *psoc);
+
+/**
+ * ucfg_interop_issues_ap_init() - interop issues ap component initialization
+ *
+ * Return: QDF_STATUS_SUCCESS - in case of success
+ */
+QDF_STATUS ucfg_interop_issues_ap_init(void);
+
+/**
+ * ucfg_interop_issues_ap_deinit() - interop issues ap component de-init
+ *
+ * Return: QDF_STATUS_SUCCESS - in case of success
+ */
+QDF_STATUS ucfg_interop_issues_ap_deinit(void);
+
+/**
+ * ucfg_register_interop_issues_ap_callback() - API to register callback
+ * @cbs: pointer to callback structure
+ *
+ * Return: none
+ */
+void ucfg_register_interop_issues_ap_callback(struct wlan_objmgr_pdev *pdev,
+				struct wlan_interop_issues_ap_callbacks *cbs);
+
+/**
+ * ucfg_set_interop_issues_ap_config() - API to set interop issues ap
+ * @vdev: the pointer of vdev object
+ * @rap: the pointer of interop issues ap info
+ *
+ * Return: none
+ */
+QDF_STATUS ucfg_set_interop_issues_ap_config(struct wlan_objmgr_vdev *vdev,
+				     struct wlan_interop_issues_ap_info *rap);
+#else
+static inline
+QDF_STATUS ucfg_interop_issues_ap_psoc_enable(struct wlan_objmgr_psoc *psoc)
+{
+	return QDF_STATUS_SUCCESS;
+}
+
+static inline
+QDF_STATUS ucfg_interop_issues_ap_psoc_disable(struct wlan_objmgr_psoc *psoc)
+{
+	return QDF_STATUS_SUCCESS;
+}
+
+static inline
+QDF_STATUS ucfg_interop_issues_ap_init(void) { return QDF_STATUS_SUCCESS; }
+
+static inline
+QDF_STATUS ucfg_interop_issues_ap_deinit(void) { return QDF_STATUS_SUCCESS; }
+#endif /* WLAN_FEATURE_INTEROP_ISSUES_AP */
+#endif /* __WLAN_RAP_PS_UCFG_API_H__ */

+ 103 - 0
interop_issues_ap/dispatcher/src/wlan_interop_issues_ap_tgt_api.c

@@ -0,0 +1,103 @@
+/*
+ * Copyright (c) 2019 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 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:wlan_interop_issues_ap_tgt_api.c
+ *
+ * This file provide API definitions to update interop issues ap from interface
+ */
+#include <wlan_objmgr_cmn.h>
+#include <wlan_objmgr_pdev_obj.h>
+#include <scheduler_api.h>
+#include <wlan_interop_issues_ap_api.h>
+#include <wlan_interop_issues_ap_tgt_api.h>
+
+static QDF_STATUS wlan_interop_issues_ap_flush_cbk(struct scheduler_msg *msg)
+{
+	if (msg->bodyptr) {
+		qdf_mem_free(msg->bodyptr);
+		msg->bodyptr = NULL;
+	}
+
+	return QDF_STATUS_SUCCESS;
+}
+
+static void wlan_interop_issues_ap_info_cbk(struct scheduler_msg *msg)
+{
+	struct wlan_interop_issues_ap_event *data;
+	struct wlan_interop_issues_ap_callbacks *cbs;
+
+	data = msg->bodyptr;
+	data->pdev = wlan_objmgr_get_pdev_by_id(data->psoc,
+						data->pdev_id,
+						WLAN_INTEROP_ISSUES_AP_ID);
+	if (!data->pdev) {
+		interop_issues_ap_err("pdev is null.");
+		goto err;
+	}
+
+	cbs = interop_issues_ap_psoc_get_cbs(data->psoc);
+	if (cbs && cbs->os_if_interop_issues_ap_event_handler)
+		cbs->os_if_interop_issues_ap_event_handler(msg->bodyptr);
+
+	wlan_objmgr_pdev_release_ref(data->pdev, WLAN_INTEROP_ISSUES_AP_ID);
+err:
+	qdf_mem_free(data);
+	msg->bodyptr = NULL;
+}
+
+QDF_STATUS tgt_interop_issues_ap_info_callback(struct wlan_objmgr_psoc *psoc,
+				      struct wlan_interop_issues_ap_event *rap)
+{
+	struct scheduler_msg msg = {0};
+	QDF_STATUS status;
+	struct wlan_interop_issues_ap_event *data;
+
+	data = qdf_mem_malloc(sizeof(*data));
+	if (!data)
+		return QDF_STATUS_E_NOMEM;
+
+	qdf_mem_copy(data, rap, sizeof(*data));
+
+	msg.bodyptr = data;
+	msg.callback = wlan_interop_issues_ap_info_cbk;
+	msg.flush_callback = wlan_interop_issues_ap_flush_cbk;
+
+	status = scheduler_post_message(QDF_MODULE_ID_INTEROP_ISSUES_AP,
+					QDF_MODULE_ID_INTEROP_ISSUES_AP,
+					QDF_MODULE_ID_TARGET_IF, &msg);
+	if (QDF_IS_STATUS_ERROR(status)) {
+		interop_issues_ap_err("scheduler msg posting failed");
+		qdf_mem_free(msg.bodyptr);
+		msg.bodyptr = NULL;
+	}
+
+	return status;
+}
+
+QDF_STATUS tgt_set_interop_issues_ap_req(struct wlan_objmgr_psoc *psoc,
+				struct wlan_interop_issues_ap_info *rap)
+{
+	struct interop_issues_ap_psoc_priv_obj *obj;
+
+	obj = interop_issues_ap_get_psoc_priv_obj(psoc);
+	if (!obj || !obj->tx_ops.set_rap_ps)
+		return QDF_STATUS_E_NULL_VALUE;
+
+	return obj->tx_ops.set_rap_ps(psoc, rap);
+}

+ 75 - 0
interop_issues_ap/dispatcher/src/wlan_interop_issues_ap_ucfg_api.c

@@ -0,0 +1,75 @@
+/*
+ * Copyright (c) 2019 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 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: This file contains interop issues ap north bound interface definitions
+ */
+#include <wlan_objmgr_vdev_obj.h>
+#include <wlan_interop_issues_ap_ucfg_api.h>
+#include <wlan_interop_issues_ap_tgt_api.h>
+#include <wlan_cfg80211_interop_issues_ap.h>
+#include <wlan_interop_issues_ap_api.h>
+
+QDF_STATUS
+ucfg_set_interop_issues_ap_config(struct wlan_objmgr_vdev *vdev,
+				  struct wlan_interop_issues_ap_info *rap)
+{
+	return tgt_set_interop_issues_ap_req(wlan_vdev_get_psoc(vdev), rap);
+}
+
+void ucfg_register_interop_issues_ap_callback(struct wlan_objmgr_pdev *pdev,
+				   struct wlan_interop_issues_ap_callbacks *cb)
+{
+	struct wlan_objmgr_psoc *psoc;
+	struct interop_issues_ap_psoc_priv_obj *obj;
+
+	psoc = wlan_pdev_get_psoc(pdev);
+	if (!psoc) {
+		interop_issues_ap_err("psoc object is NULL");
+		return;
+	}
+
+	obj = interop_issues_ap_get_psoc_priv_obj(psoc);
+	if (!obj) {
+		interop_issues_ap_err("interop issues ap priv obj is NULL");
+		return;
+	}
+
+	obj->cbs.os_if_interop_issues_ap_event_handler =
+			cb->os_if_interop_issues_ap_event_handler;
+}
+
+QDF_STATUS ucfg_interop_issues_ap_psoc_enable(struct wlan_objmgr_psoc *psoc)
+{
+	return wlan_interop_issues_ap_psoc_enable(psoc);
+}
+
+QDF_STATUS ucfg_interop_issues_ap_psoc_disable(struct wlan_objmgr_psoc *psoc)
+{
+	return wlan_interop_issues_ap_psoc_disable(psoc);
+}
+
+QDF_STATUS ucfg_interop_issues_ap_init(void)
+{
+	return wlan_interop_issues_ap_init();
+}
+
+QDF_STATUS ucfg_interop_issues_ap_deinit(void)
+{
+	return wlan_interop_issues_ap_deinit();
+}

+ 73 - 0
target_if/interop_issues_ap/inc/target_if_interop_issues_ap.h

@@ -0,0 +1,73 @@
+/*
+ * Copyright (c) 2019 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 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: offload lmac interface APIs for interop issues ap
+ */
+#ifndef __TARGET_IF_INTEROP_ISSUES_AP_H__
+#define __TARGET_IF_INTEROP_ISSUES_AP_H__
+
+#ifdef WLAN_FEATURE_INTEROP_ISSUES_AP
+#include <wlan_objmgr_cmn.h>
+#include <wlan_objmgr_pdev_obj.h>
+#include <qdf_status.h>
+#include <wlan_lmac_if_def.h>
+#include <wlan_interop_issues_ap_public_structs.h>
+
+/**
+ * target_if_interop_issues_ap_register_event_handler() - register callback
+ * @psoc: the pointer to psoc object
+ *
+ * Return: QDF_STATUS
+ */
+QDF_STATUS
+target_if_interop_issues_ap_register_event_handler(
+						struct wlan_objmgr_psoc *psoc);
+
+/**
+ * target_if_interop_issues_ap_unregister_event_handler() - unregister callback
+ * @psoc: the pointer to psoc object
+ *
+ * Return: QDF_STATUS
+ */
+QDF_STATUS
+target_if_interop_issues_ap_unregister_event_handler(
+						struct wlan_objmgr_psoc *psoc);
+
+/**
+ * target_if_interop_issues_ap_register_tx_ops() - register tx ops funcs
+ * @psoc: the pointer of psoc object
+ * @tx_ops: pointer to rap_ps tx ops
+ *
+ * Return: QDF_STATUS_SUCCESS on success, QDF_STATUS_E_** on error
+ */
+QDF_STATUS
+target_if_interop_issues_ap_register_tx_ops(struct wlan_objmgr_psoc *psoc,
+				struct wlan_interop_issues_ap_tx_ops *tx_ops);
+/**
+ * target_if_interop_issues_ap_unregister_tx_ops() - unregister tx ops funcs
+ * @psoc: the pointer of psoc object
+ * @tx_ops: pointer to rap_ps tx ops
+ *
+ * Return: QDF_STATUS_SUCCESS on success, QDF_STATUS_E_** on error
+ */
+QDF_STATUS
+target_if_interop_issues_ap_unregister_tx_ops(struct wlan_objmgr_psoc *psoc,
+				 struct wlan_interop_issues_ap_tx_ops *tx_ops);
+#endif
+#endif /* __TARGET_IF_INTEROP_ISSUES_AP_H__ */

+ 187 - 0
target_if/interop_issues_ap/src/target_if_interop_issues_ap.c

@@ -0,0 +1,187 @@
+/*
+ * Copyright (c) 2019 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 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: target_if_interop_issues_ap.c
+ *
+ * This file provide definition for APIs registered through lmac Tx Ops
+ */
+
+#include <qdf_mem.h>
+#include <qdf_status.h>
+#include <qdf_types.h>
+#include <target_if.h>
+#include <wlan_tgt_def_config.h>
+#include <wlan_osif_priv.h>
+#include <wlan_interop_issues_ap_tgt_api.h>
+#include <wlan_interop_issues_ap_api.h>
+#include <target_if_interop_issues_ap.h>
+#include <wmi_unified_interop_issues_ap_api.h>
+
+/**
+ * target_if_interop_issues_ap_event_handler() - callback for event
+ * @event: firmware event
+ * @len: the event length
+ *
+ * Return: 0 or error status
+ */
+static int target_if_interop_issues_ap_event_handler(ol_scn_t sc,
+						     uint8_t *event,
+						     uint32_t len)
+{
+	struct wlan_objmgr_psoc *psoc;
+	struct wmi_unified *wmi_handle;
+	struct wlan_interop_issues_ap_event data = {0};
+	int ret;
+
+	TARGET_IF_ENTER();
+
+	psoc = target_if_get_psoc_from_scn_hdl(sc);
+	if (!psoc) {
+		target_if_err("psoc ptr is NULL");
+		return -EINVAL;
+	}
+	data.psoc = psoc;
+
+	wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
+	if (!wmi_handle) {
+		target_if_err("wmi_handle is null.");
+		return -EINVAL;
+	}
+
+	ret = wmi_extract_interop_issues_ap_ev_param(wmi_handle, event, &data);
+	if (ret)
+		return -EINVAL;
+
+	target_if_debug("interop issues ap macaddr: " QDF_MAC_ADDR_STR,
+			QDF_MAC_ADDR_ARRAY(data.rap_addr.bytes));
+
+	return tgt_interop_issues_ap_info_callback(psoc, &data);
+}
+
+/**
+ * target_if_interop_issues_ap_register_event_handler() - register callback
+ * @psoc: the pointer to psoc object
+ *
+ * Return: QDF_STATUS
+ */
+QDF_STATUS
+target_if_interop_issues_ap_register_event_handler(
+						struct wlan_objmgr_psoc *psoc)
+{
+	int ret_val;
+	struct wmi_unified *wmi_handle;
+
+	if (!psoc) {
+		target_if_err("PSOC is NULL!");
+		return QDF_STATUS_E_NULL_VALUE;
+	}
+
+	wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
+	if (!wmi_handle) {
+		target_if_err("wmi_handle is null");
+		return QDF_STATUS_E_INVAL;
+	}
+	ret_val =
+	   wmi_unified_register_event_handler(wmi_handle,
+				wmi_pdev_interop_issues_ap_event_id,
+				target_if_interop_issues_ap_event_handler,
+				WMI_RX_WORK_CTX);
+	if (ret_val)
+		target_if_err("Failed to register event cb");
+
+	return qdf_status_from_os_return(ret_val);
+}
+
+/**
+ * target_if_interop_issues_ap_unregister_event_handler() - unregister callback
+ * @psoc: the pointer to psoc object
+ *
+ * Return: QDF_STATUS
+ */
+QDF_STATUS
+target_if_interop_issues_ap_unregister_event_handler(
+						struct wlan_objmgr_psoc *psoc)
+{
+	struct wmi_unified *wmi_handle;
+
+	if (!psoc) {
+		target_if_err("PSOC is NULL!");
+		return QDF_STATUS_E_INVAL;
+	}
+
+	wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
+	if (!wmi_handle) {
+		target_if_err("wmi_handle is null");
+		return QDF_STATUS_E_INVAL;
+	}
+	wmi_unified_unregister_event_handler(wmi_handle,
+					wmi_pdev_interop_issues_ap_event_id);
+
+	return QDF_STATUS_SUCCESS;
+}
+
+/**
+ * target_if_set_interop_issues_ap_req() - API to send stats request to wmi
+ * @psoc: pointer to psoc object
+ * @raq: pointer to interop issues ap info
+ *
+ * Return: status of operation.
+ */
+static QDF_STATUS
+target_if_set_interop_issues_ap_req(struct wlan_objmgr_psoc *psoc,
+				    struct wlan_interop_issues_ap_info *rap)
+{
+	struct wmi_unified *wmi_handle;
+
+	wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
+	if (!wmi_handle) {
+		target_if_err("wmi_handle is null.");
+		return QDF_STATUS_E_NULL_VALUE;
+	}
+
+	return wmi_unified_set_rap_ps_cmd(wmi_handle, rap);
+}
+
+QDF_STATUS
+target_if_interop_issues_ap_register_tx_ops(struct wlan_objmgr_psoc *psoc,
+				  struct wlan_interop_issues_ap_tx_ops *tx_ops)
+{
+	if (!tx_ops) {
+		target_if_err("tx ops is NULL!");
+		return QDF_STATUS_E_INVAL;
+	}
+
+	tx_ops->set_rap_ps = target_if_set_interop_issues_ap_req;
+
+	return QDF_STATUS_SUCCESS;
+}
+
+QDF_STATUS
+target_if_interop_issues_ap_unregister_tx_ops(struct wlan_objmgr_psoc *psoc,
+				  struct wlan_interop_issues_ap_tx_ops *tx_ops)
+{
+	if (!tx_ops) {
+		target_if_err("tx ops is NULL!");
+		return QDF_STATUS_E_INVAL;
+	}
+
+	tx_ops->set_rap_ps = NULL;
+
+	return QDF_STATUS_SUCCESS;
+}