Browse Source

qcacmn: Add support for cp stats in global_umac_dispatcher

Add support for cp stats lmac Tx and Rx Ops data structure
and handle Rx Ops registration

CRs-Fixed: 2192386
Change-Id: I07f41d8550778142abf01d8bd66c8c373c479ac2
Naga 7 years ago
parent
commit
a3d376270a

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

@@ -71,6 +71,32 @@ struct scheduler_msg;
 #include "wlan_tdls_public_structs.h"
 #endif
 
+#ifdef QCA_SUPPORT_CP_STATS
+#include <wlan_cp_stats_tgt_api.h>
+#endif
+
+#ifdef QCA_SUPPORT_CP_STATS
+/**
+ * struct wlan_lmac_if_cp_stats_tx_ops - defines southbound tx callbacks for
+ * control plane statistics component
+ * @cp_stats_attach:	function pointer to register events from FW
+ * @cp_stats_detach:	function pointer to unregister events from FW
+ */
+struct wlan_lmac_if_cp_stats_tx_ops {
+	QDF_STATUS (*cp_stats_attach)(struct wlan_objmgr_psoc *psoc);
+	QDF_STATUS (*cp_stats_detach)(struct wlan_objmgr_psoc *posc);
+};
+
+/**
+ * struct wlan_lmac_if_cp_stats_rx_ops - defines southbound rx callbacks for
+ * control plane statistics component
+ * @cp_stats_rx_event_handler:	function pointer to rx FW events
+ */
+struct wlan_lmac_if_cp_stats_rx_ops {
+	QDF_STATUS (*cp_stats_rx_event_handler)(struct wlan_objmgr_vdev *vdev);
+};
+#endif
+
 /**
  * struct wlan_lmac_if_mgmt_txrx_tx_ops - structure of tx function
  *                  pointers for mgmt txrx component
@@ -638,6 +664,7 @@ struct wlan_lmac_if_green_ap_tx_ops {
  * @scan: scan tx ops
  * @dfs_tx_ops: dfs tx ops.
  * @green_ap_tx_ops: green_ap tx_ops
+ * @cp_stats_tx_ops: cp stats tx_ops
  *
  * Callback function tabled to be registered with umac.
  * umac will use the functional table to send events/frames to lmac/wmi
@@ -661,6 +688,9 @@ struct wlan_lmac_if_tx_ops {
 #ifdef WLAN_ATF_ENABLE
 	struct wlan_lmac_if_atf_tx_ops atf_tx_ops;
 #endif
+#ifdef QCA_SUPPORT_CP_STATS
+	struct wlan_lmac_if_cp_stats_tx_ops cp_stats_tx_ops;
+#endif
 #ifdef WLAN_SA_API_ENABLE
 	struct wlan_lmac_if_sa_api_tx_ops sa_api_tx_ops;
 #endif
@@ -1133,6 +1163,7 @@ struct wlan_lmac_if_green_ap_rx_ops {
  * @mgmt_txrx_tx_ops: mgmt txrx rx ops
  * @scan: scan rx ops
  * @dfs_rx_ops: dfs rx ops.
+ * @cp_stats_rx_ops: cp stats rx ops
  *
  * Callback function tabled to be registered with lmac/wmi.
  * lmac will use the functional table to send events/frames to umac
@@ -1152,6 +1183,9 @@ struct wlan_lmac_if_rx_ops {
 #ifdef WLAN_ATF_ENABLE
 	struct wlan_lmac_if_atf_rx_ops atf_rx_ops;
 #endif
+#ifdef QCA_SUPPORT_CP_STATS
+	struct wlan_lmac_if_cp_stats_rx_ops cp_stats_rx_ops;
+#endif
 #ifdef WLAN_SA_API_ENABLE
 	struct wlan_lmac_if_sa_api_rx_ops sa_api_rx_ops;
 #endif

+ 26 - 0
umac/global_umac_dispatcher/lmac_if/src/wlan_lmac_if.c

@@ -63,6 +63,10 @@
 #include <wlan_fd_tgt_api.h>
 #endif
 
+#ifdef QCA_SUPPORT_CP_STATS
+#include <wlan_cp_stats_tgt_api.h>
+#endif /* QCA_SUPPORT_CP_STATS */
+
 /* Function pointer for OL/WMA specific UMAC tx_ops
  * registration.
  */
@@ -70,6 +74,26 @@ QDF_STATUS (*wlan_lmac_if_umac_tx_ops_register)
 				(struct wlan_lmac_if_tx_ops *tx_ops);
 qdf_export_symbol(wlan_lmac_if_umac_tx_ops_register);
 
+#ifdef QCA_SUPPORT_CP_STATS
+/**
+ * wlan_lmac_if_cp_stats_rx_ops_register() - API to register cp stats Rx Ops
+ * @rx_ops:	pointer to lmac rx ops
+ *
+ * This API will be used to register function pointers for FW events
+ *
+ * Return: void
+ */
+static void
+wlan_lmac_if_cp_stats_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops)
+{
+}
+#else
+static void
+wlan_lmac_if_cp_stats_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops)
+{
+}
+#endif
+
 #ifdef WLAN_ATF_ENABLE
 /**
  * wlan_lmac_if_atf_rx_ops_register() - Function to register ATF RX ops.
@@ -411,6 +435,8 @@ wlan_lmac_if_umac_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops)
 
 	wlan_lmac_if_atf_rx_ops_register(rx_ops);
 
+	wlan_lmac_if_cp_stats_rx_ops_register(rx_ops);
+
 	wlan_lmac_if_sa_api_rx_ops_register(rx_ops);
 
 	wlan_lmac_if_crypto_rx_ops_register(rx_ops);