Преглед на файлове

qcacmn: Changes for mgmt txrx component to interact with southbound

Define mgmt txrx tx and rx ops in lmac if layer and register rx ops
with mgmt txrx layer statically inside wlan_lmac_if_register_rx_handlers.

Change-Id: I4f59f69ed0e8b702b8d3c93e4b732891d50c1555
CRs-Fixed: 1103247
Himanshu Agarwal преди 8 години
родител
ревизия
f8641b9a4e
променени са 2 файла, в които са добавени 70 реда и са изтрити 2 реда
  1. 48 1
      umac/global_umac_dispatcher/lmac_if/inc/wlan_lmac_if_def.h
  2. 22 1
      umac/global_umac_dispatcher/lmac_if/src/wlan_lmac_if.c

+ 48 - 1
umac/global_umac_dispatcher/lmac_if/inc/wlan_lmac_if_def.h

@@ -20,9 +20,27 @@
 #ifndef _WLAN_LMAC_IF_DEF_H_
 #define _WLAN_LMAC_IF_DEF_H_
 
+#include "qdf_status.h"
+#include "wlan_objmgr_cmn.h"
+
 /* Number of dev type: Direct attach and Offload */
 #define MAX_DEV_TYPE 2
 
+
+/**
+ * struct wlan_lmac_if_mgmt_txrx_tx_ops - structure of tx function
+ *                  pointers for mgmt txrx component
+ * @mgmt_tx_send: function pointer to transmit mgmt tx frame
+ * @beacon_send:  function pointer to transmit beacon frame
+ */
+struct wlan_lmac_if_mgmt_txrx_tx_ops {
+	QDF_STATUS (*mgmt_tx_send)(struct wlan_objmgr_vdev *vdev,
+			qdf_nbuf_t nbuf, u_int32_t desc_id,
+			void *mgmt_tx_params);
+	QDF_STATUS (*beacon_send)(struct wlan_objmgr_vdev *vdev,
+			qdf_nbuf_t nbuf);
+};
+
 /**
  * struct wlan_lmac_if_tx_ops - south bound tx function pointers
  * @arg1
@@ -44,7 +62,36 @@ struct wlan_lmac_if_tx_ops {
 	 *	void (*fp2)();
 	 * }
 	 */
+	 struct wlan_lmac_if_mgmt_txrx_tx_ops mgmt_txrx_tx_ops;
+};
 
+/**
+ * struct wlan_lmac_if_mgmt_txrx_rx_ops - structure of rx function
+ *                  pointers for mgmt txrx component
+ * @mgmt_tx_completion_handler: function pointer to give tx completions
+ *                              to mgmt txrx comp.
+ * @mgmt_rx_frame_handler: function pointer to give rx frame to mgmt txrx comp.
+ * @mgmt_txrx_get_nbuf_from_desc_id: function pointer to get nbuf from desc id
+ * @mgmt_txrx_get_peer_from_desc_id: function pointer to get peer from desc id
+ * @mgmt_txrx_get_vdev_id_from_desc_id: function pointer to get vdev id from
+ *                                      desc id
+ */
+struct wlan_lmac_if_mgmt_txrx_rx_ops {
+	QDF_STATUS (*mgmt_tx_completion_handler)(
+			struct wlan_objmgr_psoc *psoc,
+			uint32_t desc_id, uint32_t status,
+			void *tx_compl_params);
+	QDF_STATUS (*mgmt_rx_frame_handler)(
+			struct wlan_objmgr_psoc *psoc,
+			qdf_nbuf_t buf, void *params);
+	qdf_nbuf_t (*mgmt_txrx_get_nbuf_from_desc_id)(
+			struct wlan_objmgr_psoc *psoc,
+			uint32_t desc_id);
+	struct wlan_objmgr_peer * (*mgmt_txrx_get_peer_from_desc_id)(
+			struct wlan_objmgr_psoc *psoc, uint32_t desc_id);
+	uint8_t (*mgmt_txrx_get_vdev_id_from_desc_id)(
+			struct wlan_objmgr_psoc *psoc,
+			uint32_t desc_id);
 };
 
 /**
@@ -67,7 +114,7 @@ struct wlan_lmac_if_rx_ops {
 	 *	void (*fp2)();
 	 * }
 	 */
-
+	 struct wlan_lmac_if_mgmt_txrx_rx_ops mgmt_txrx_rx_ops;
 };
 
 #endif /* _WLAN_LMAC_IF_DEF_H_ */

+ 22 - 1
umac/global_umac_dispatcher/lmac_if/src/wlan_lmac_if.c

@@ -20,6 +20,7 @@
 #include "qdf_mem.h"
 #include "wlan_lmac_if_def.h"
 #include "wlan_lmac_if_api.h"
+#include "wlan_mgmt_txrx_tgt_api.h"
 
 /* Function pointer to call DA/OL specific tx_ops registration function */
 QDF_STATUS (*wlan_lmac_if_tx_ops_create_handler[MAX_DEV_TYPE])
@@ -40,6 +41,26 @@ wlan_lmac_if_register_rx_handlers(struct wlan_lmac_if_rx_ops *rx_ops)
 	 * respective callbacks
 	 * Ex: rx_ops->fp = function;
 	 */
+	struct wlan_lmac_if_mgmt_txrx_rx_ops *mgmt_txrx_rx_ops;
+
+	if (!rx_ops) {
+		qdf_print("%s: lmac if rx ops pointer is NULL", __func__);
+		return QDF_STATUS_E_INVAL;
+	}
+
+	/* mgmt txrx rx ops */
+	mgmt_txrx_rx_ops = &rx_ops->mgmt_txrx_rx_ops;
+
+	mgmt_txrx_rx_ops->mgmt_tx_completion_handler =
+			tgt_mgmt_txrx_tx_completion_handler;
+	mgmt_txrx_rx_ops->mgmt_rx_frame_handler =
+			tgt_mgmt_txrx_rx_frame_handler;
+	mgmt_txrx_rx_ops->mgmt_txrx_get_nbuf_from_desc_id =
+			tgt_mgmt_txrx_get_nbuf_from_desc_id;
+	mgmt_txrx_rx_ops->mgmt_txrx_get_peer_from_desc_id =
+			tgt_mgmt_txrx_get_peer_from_desc_id;
+	mgmt_txrx_rx_ops->mgmt_txrx_get_vdev_id_from_desc_id =
+			tgt_mgmt_txrx_get_vdev_id_from_desc_id;
 
 	return QDF_STATUS_SUCCESS;
 }
@@ -67,7 +88,7 @@ struct wlan_objmgr_psoc *wlan_lmac_if_open(struct wlan_objmgr_psoc *psoc)
 					(&psoc->soc_cb.tx_ops);
 	} else {
 		/* Control should ideally not reach here */
-		qdf_print("Invalid device type\n");
+		qdf_print("Invalid device type");
 		return psoc;
 	}