فهرست منبع

qcacmn: Add txops support for MGMT txrx module

1. Add txops APIs in mgmt txrx module
2. Register the txops APIs of mgmt txrx module.

CRs-Fixed: 2927742
Change-Id: I9b226d9f2b85b4ef92527315cb08047563b9ebdd
Edayilliam Jayadev 4 سال پیش
والد
کامیت
ceacfdf8ae

+ 19 - 0
target_if/core/src/target_if_main.c

@@ -95,6 +95,10 @@
 
 #include <target_if_gpio.h>
 
+#ifdef WLAN_MGMT_RX_REO_SUPPORT
+#include <target_if_mgmt_txrx.h>
+#endif /* WLAN_MGMT_RX_REO_SUPPORT */
+
 static struct target_if_ctx *g_target_if_ctx;
 
 struct target_if_ctx *target_if_get_ctx()
@@ -475,6 +479,19 @@ void target_if_gpio_tx_ops_register(struct wlan_lmac_if_tx_ops *tx_ops)
 }
 #endif
 
+#ifdef WLAN_MGMT_RX_REO_SUPPORT
+static
+void target_if_mgmt_txrx_register_tx_ops(struct wlan_lmac_if_tx_ops *tx_ops)
+{
+	target_if_mgmt_txrx_tx_ops_register(tx_ops);
+}
+#else
+static
+void target_if_mgmt_txrx_register_tx_ops(struct wlan_lmac_if_tx_ops *tx_ops)
+{
+}
+#endif /* WLAN_MGMT_RX_REO_SUPPORT */
+
 static
 QDF_STATUS target_if_register_umac_tx_ops(struct wlan_lmac_if_tx_ops *tx_ops)
 {
@@ -523,6 +540,8 @@ QDF_STATUS target_if_register_umac_tx_ops(struct wlan_lmac_if_tx_ops *tx_ops)
 
 	target_if_gpio_tx_ops_register(tx_ops);
 
+	target_if_mgmt_txrx_register_tx_ops(tx_ops);
+
 	/* Converged UMAC components to register their TX-ops here */
 	return QDF_STATUS_SUCCESS;
 }

+ 39 - 0
target_if/mgmt_txrx/inc/target_if_mgmt_txrx.h

@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2021, 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_mgmt_txrx.h
+ *  This file contains mgmt txrx module's target related APIs
+ */
+
+#ifndef _TARGET_IF_MGMT_TXRX_H_
+#define _TARGET_IF_MGMT_TXRX_H_
+
+#include <wlan_lmac_if_def.h>
+
+/**
+ * target_if_mgmt_txrx_tx_ops_register() - Register txops for mgmt_txrx
+ * module.
+ * @tx_ops: pointer to txops
+ *
+ * Register txops for mgmt_txrx module.
+ *
+ * return: QDF_STATUS
+ */
+QDF_STATUS
+target_if_mgmt_txrx_tx_ops_register(struct wlan_lmac_if_tx_ops *tx_ops);
+#endif /*_TARGET_IF_MGMT_TXRX_H_ */
+

+ 4 - 0
target_if/mgmt_txrx/inc/target_if_mgmt_txrx_rx_reo.h

@@ -21,6 +21,10 @@
 
 #ifndef _TARGET_IF_MGMT_TXRX_RX_REO_H_
 #define _TARGET_IF_MGMT_TXRX_RX_REO_H_
+
+#include <qdf_types.h>
+#include <wlan_objmgr_psoc_obj.h>
+
 #ifdef WLAN_MGMT_RX_REO_SUPPORT
 /**
  * target_if_mgmt_rx_reo_register_event_handlers() - Register management

+ 93 - 0
target_if/mgmt_txrx/src/target_if_mgmt_txrx.c

@@ -0,0 +1,93 @@
+/*
+ * Copyright (c) 2021, 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_mgmt_txrx.c
+ *  This file contains mgmt txrx module's target related function definitions
+ */
+
+#include <target_if_mgmt_txrx.h>
+#include <target_if_mgmt_txrx_rx_reo.h>
+
+/**
+ * target_if_mgmt_txrx_unregister_event_handler() - Unregister event handlers
+ * for mgmt txrx module
+ * @psoc: pointer to psoc
+ *
+ * Unregister event handlers for management rx-reorder module
+ *
+ * return: QDF_STATUS
+ */
+static QDF_STATUS
+target_if_mgmt_txrx_unregister_event_handler(struct wlan_objmgr_psoc *psoc)
+{
+	QDF_STATUS status;
+
+	if (!psoc) {
+		mgmt_txrx_err("psoc is null");
+		return QDF_STATUS_E_FAILURE;
+	}
+
+	status = target_if_mgmt_rx_reo_unregister_event_handlers(psoc);
+	if (QDF_IS_STATUS_ERROR(status)) {
+		mgmt_txrx_err("Failed to unregister mgmt rx reo events");
+		return QDF_STATUS_E_FAILURE;
+	}
+
+	return QDF_STATUS_SUCCESS;
+}
+
+/**
+ * target_if_mgmt_txrx_register_event_handler() - Register event handlers for
+ * mgmt txrx module
+ * @psoc: pointer to psoc
+ *
+ * Register event handlers for management rx-reorder module
+ *
+ * return: QDF_STATUS
+ */
+static QDF_STATUS
+target_if_mgmt_txrx_register_event_handler(struct wlan_objmgr_psoc *psoc)
+{
+	QDF_STATUS status;
+
+	status = target_if_mgmt_rx_reo_register_event_handlers(psoc);
+	if (QDF_IS_STATUS_ERROR(status)) {
+		mgmt_txrx_err("Failed to register mgmt rx reo events");
+		return QDF_STATUS_E_FAILURE;
+	}
+
+	return QDF_STATUS_SUCCESS;
+}
+
+QDF_STATUS
+target_if_mgmt_txrx_tx_ops_register(struct wlan_lmac_if_tx_ops *tx_ops)
+{
+	struct wlan_lmac_if_mgmt_txrx_tx_ops *mgmt_txrx_tx_ops;
+
+	if (!tx_ops) {
+		mgmt_txrx_err("txops is NULL");
+		return QDF_STATUS_E_FAILURE;
+	}
+
+	mgmt_txrx_tx_ops = &tx_ops->mgmt_txrx_tx_ops;
+	mgmt_txrx_tx_ops->reg_ev_handler =
+		target_if_mgmt_txrx_register_event_handler;
+	mgmt_txrx_tx_ops->unreg_ev_handler =
+		target_if_mgmt_txrx_unregister_event_handler;
+
+	return QDF_STATUS_SUCCESS;
+}

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

@@ -219,6 +219,8 @@ struct wlan_target_if_dcs_rx_ops {
  * @fd_action_frame_send: function pointer to transmit FD action frame
  * @tx_drain_nbuf_op: function pointer for any umac nbuf realted ops for
  *                    pending mgmt frames cleanup
+ * @reg_ev_handler: function pointer to register event handlers
+ * @unreg_ev_handler: function pointer to unregister event handlers
  */
 struct wlan_lmac_if_mgmt_txrx_tx_ops {
 	QDF_STATUS (*mgmt_tx_send)(struct wlan_objmgr_vdev *vdev,
@@ -230,6 +232,8 @@ struct wlan_lmac_if_mgmt_txrx_tx_ops {
 					   qdf_nbuf_t nbuf);
 	void (*tx_drain_nbuf_op)(struct wlan_objmgr_pdev *pdev,
 				 qdf_nbuf_t nbuf);
+	QDF_STATUS (*reg_ev_handler)(struct wlan_objmgr_psoc *psoc);
+	QDF_STATUS (*unreg_ev_handler)(struct wlan_objmgr_psoc *psoc);
 };
 
 /**