浏览代码

qcacmn: Add new files for cp_stats mobile connectivity component

Add file for mobile connectivity to use control path stats component.

Change-Id: I11ba1103745371ebf740ee2ec06dd04912afa7c9
CRs-Fixed: 2210307
Naveen Rawat 7 年之前
父节点
当前提交
70fd32e41b

+ 42 - 0
os_if/linux/cp_stats/inc/wlan_cfg80211_mc_cp_stats.h

@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2011-2018 The Linux Foundation. All rights reserved.
+ *
+ * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
+ *
+ *
+ * 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.
+ */
+
+/*
+ * This file was originally distributed by Qualcomm Atheros, Inc.
+ * under proprietary terms before Copyright ownership was assigned
+ * to the Linux Foundation.
+ */
+
+/**
+ * DOC: wlan_cfg80211_mc_cp_stats.h
+ *
+ * This Header file provide declaration for cfg80211 command handler API
+ * registered cp stats and specific with ic
+ */
+
+#ifndef __WLAN_CFG80211_MC_CP_STATS_H__
+#define __WLAN_CFG80211_MC_CP_STATS_H__
+
+#ifdef QCA_SUPPORT_CP_STATS
+
+#endif /* QCA_SUPPORT_CP_STATS */
+#endif /* __WLAN_CFG80211_MC_CP_STATS_H__ */
+

+ 32 - 0
os_if/linux/cp_stats/src/wlan_cfg80211_mc_cp_stats.c

@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) 2011-2018 The Linux Foundation. All rights reserved.
+ *
+ * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
+ *
+ *
+ * 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.
+ */
+
+/*
+ * This file was originally distributed by Qualcomm Atheros, Inc.
+ * under proprietary terms before Copyright ownership was assigned
+ * to the Linux Foundation.
+ */
+
+/**
+ * DOC: wlan_cfg80211_mc_cp_stats.c
+ *
+ * This file provide definitions to cp stats supported cfg80211 cmd handlers
+ */

+ 41 - 1
target_if/cp_stats/inc/target_if_cp_stats.h

@@ -26,10 +26,35 @@
 #ifndef __TARGET_IF_CP_STATS_H__
 #define __TARGET_IF_CP_STATS_H__
 
+#include <target_if.h>
 #include <wlan_lmac_if_def.h>
+#include <wlan_cp_stats_utils_api.h>
 
 #ifdef QCA_SUPPORT_CP_STATS
-#include <wlan_cp_stats_utils_api.h>
+
+/**
+ * target_if_cp_stats_get_rx_ops() - get rx ops
+ * @tx_ops: pointer to lmac tx ops
+ *
+ * Return: pointer to rx ops
+ */
+static inline struct wlan_lmac_if_cp_stats_rx_ops *
+target_if_cp_stats_get_rx_ops(struct wlan_objmgr_psoc *psoc)
+{
+	return &psoc->soc_cb.rx_ops.cp_stats_rx_ops;
+}
+
+/**
+ * target_if_cp_stats_get_tx_ops() - get tx ops
+ * @tx_ops: pointer to lmac tx ops
+ *
+ * Return: pointer to tx ops
+ */
+static inline struct wlan_lmac_if_cp_stats_tx_ops *
+target_if_cp_stats_get_tx_ops(struct wlan_objmgr_psoc *psoc)
+{
+	return &psoc->soc_cb.tx_ops.cp_stats_tx_ops;
+}
 
 /**
  * target_if_cp_stats_register_tx_ops() - define cp_stats lmac tx ops functions
@@ -39,12 +64,27 @@
  */
 QDF_STATUS
 target_if_cp_stats_register_tx_ops(struct wlan_lmac_if_tx_ops *tx_ops);
+
+/**
+ * target_if_cp_stats_register_rx_ops() - define cp_stats lmac rx ops functions
+ * @rx_ops: pointer to lmac rx ops
+ *
+ * Return: QDF_STATUS_SUCCESS on success, QDF_STATUS_E_** on error
+ */
+QDF_STATUS
+target_if_cp_stats_register_rx_ops(struct wlan_lmac_if_rx_ops *tx_ops);
 #else
 static inline QDF_STATUS
 target_if_cp_stats_register_tx_ops(struct wlan_lmac_if_tx_ops *tx_ops)
 {
 	return QDF_STATUS_SUCCESS;
 }
+
+static inline QDF_STATUS
+target_if_cp_stats_register_rx_ops(struct wlan_lmac_if_rx_ops *rx_ops)
+{
+	return QDF_STATUS_SUCCESS;
+}
 #endif /* QCA_SUPPORT_CP_STATS */
 
 #endif /* __TARGET_IF_CP_STATS_H__ */

+ 1 - 1
target_if/cp_stats/src/target_if_cp_stats.c

@@ -31,7 +31,7 @@
 #include <wlan_tgt_def_config.h>
 #include <wmi_unified_api.h>
 #include <wlan_osif_priv.h>
-#include <target_if.h>
+#include <wlan_cp_stats_utils_api.h>
 
 static QDF_STATUS
 target_if_cp_stats_register_event_handler(struct wlan_objmgr_psoc *psoc)

+ 89 - 0
target_if/cp_stats/src/target_if_mc_cp_stats.c

@@ -0,0 +1,89 @@
+/*
+ * Copyright (c) 2013-2018 The Linux Foundation. All rights reserved.
+ *
+ * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
+ *
+ *
+ * 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.
+ */
+
+/*
+ * This file was originally distributed by Qualcomm Atheros, Inc.
+ * under proprietary terms before Copyright ownership was assigned
+ * to the Linux Foundation.
+ */
+
+/**
+ * DOC: target_if_cp_stats.c
+ *
+ * This file provide definition for APIs registered through lmac Tx Ops
+ */
+
+#include <qdf_mem.h>
+#include <qdf_status.h>
+#include <target_if_cp_stats.h>
+#include <wmi_unified_priv.h>
+#include <wmi_unified_param.h>
+#include <target_if.h>
+#include <wlan_tgt_def_config.h>
+#include <wmi_unified_api.h>
+#include <wlan_osif_priv.h>
+#include "wlan_cp_stats_utils_api.h"
+
+static QDF_STATUS
+target_if_cp_stats_register_event_handler(struct wlan_objmgr_psoc *psoc)
+{
+	if (!psoc) {
+		cp_stats_err("PSOC is NULL!");
+		return QDF_STATUS_E_INVAL;
+	}
+
+	return QDF_STATUS_SUCCESS;
+}
+
+static QDF_STATUS
+target_if_cp_stats_unregister_event_handler(struct wlan_objmgr_psoc *psoc)
+{
+	if (!psoc) {
+		cp_stats_err("PSOC is NULL!");
+		return QDF_STATUS_E_INVAL;
+	}
+
+	return QDF_STATUS_SUCCESS;
+}
+
+QDF_STATUS
+target_if_cp_stats_register_tx_ops(struct wlan_lmac_if_tx_ops *tx_ops)
+{
+	struct wlan_lmac_if_cp_stats_tx_ops *cp_stats_tx_ops;
+
+	if (!tx_ops) {
+		cp_stats_err("lmac tx ops is NULL!");
+		return QDF_STATUS_E_INVAL;
+	}
+
+	cp_stats_tx_ops = &tx_ops->cp_stats_tx_ops;
+	if (!cp_stats_tx_ops) {
+		cp_stats_err("lmac tx ops is NULL!");
+		return QDF_STATUS_E_FAILURE;
+	}
+
+	cp_stats_tx_ops->cp_stats_attach =
+		target_if_cp_stats_register_event_handler;
+	cp_stats_tx_ops->cp_stats_detach =
+		target_if_cp_stats_unregister_event_handler;
+
+	return QDF_STATUS_SUCCESS;
+}

+ 37 - 0
umac/cp_stats/dispatcher/inc/wlan_cp_stats_mc_defs.h

@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved.
+ *
+ * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
+ *
+ *
+ * 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.
+ */
+
+/*
+ * This file was originally distributed by Qualcomm Atheros, Inc.
+ * under proprietary terms before Copyright ownership was assigned
+ * to the Linux Foundation.
+ */
+
+/**
+ * DOC: wlan_cp_stats_mc_defs.h
+ *
+ * This file provide definition for structure/enums/defines related to control
+ * path stats componenet
+ */
+
+#ifndef __WLAN_CP_STATS_MC_DEFS_H__
+#define __WLAN_CP_STATS_MC_DEFS_H__
+#endif /* __WLAN_CP_STATS_MC_DEFS_H__ */

+ 31 - 0
umac/cp_stats/dispatcher/inc/wlan_cp_stats_mc_tgt_api.h

@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 2018 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_cp_stats_mc_tgt_api.h
+ *
+ * This header file provide with API declarations to interface with Southbound
+ */
+#ifndef __WLAN_CP_STATS_MC_TGT_API_H__
+#define __WLAN_CP_STATS_MC_TGT_API_H__
+
+#ifdef QCA_SUPPORT_CP_STATS
+
+#endif /* QCA_SUPPORT_CP_STATS */
+#endif /* __WLAN_CP_STATS_MC_TGT_API_H__ */
+

+ 32 - 0
umac/cp_stats/dispatcher/inc/wlan_cp_stats_mc_ucfg_api.h

@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) 2018 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_cp_stats_mc_ucfg_api.h
+ *
+ * This header file maintain API declaration required for northbound interaction
+ */
+
+#ifndef __WLAN_CP_STATS_MC_UCFG_API_H__
+#define __WLAN_CP_STATS_MC_UCFG_API_H__
+
+#ifdef QCA_SUPPORT_CP_STATS
+
+#endif /* QCA_SUPPORT_CP_STATS */
+#endif /* __WLAN_CP_STATS_UCFG_API_H__ */
+

+ 25 - 0
umac/cp_stats/dispatcher/src/wlan_cp_stats_mc_tgt_api.c

@@ -0,0 +1,25 @@
+/*
+ * Copyright (c) 2018 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_cp_stats_mc_tgt_api.c
+ *
+ * This file provide API definitions to update control plane statistics received
+ * from southbound interface
+ */
+

+ 24 - 0
umac/cp_stats/dispatcher/src/wlan_cp_stats_mc_ucfg_api.c

@@ -0,0 +1,24 @@
+/*
+ * Copyright (c) 2018 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_cp_stats_mc_ucfg_api.h
+ *
+ * This file provide API definitions required for northbound interaction
+ */
+