Browse Source

qcacmn: Add os_if implementation of pdev cp stats

Add change to support get API for pdev cp stats from
within cp stats component

Change-Id: Ib791a32a912b7f7e8b7c3b5ebcb3f4e64cdf1f6f
CRs-Fixed: 2247228
Naga 6 years ago
parent
commit
06ef93b2c1

+ 10 - 0
os_if/linux/cp_stats/inc/wlan_cfg80211_ic_cp_stats.h

@@ -50,5 +50,15 @@ int wlan_cfg80211_get_peer_cp_stats(struct wlan_objmgr_peer *peer_obj,
 int wlan_cfg80211_get_vdev_cp_stats(struct wlan_objmgr_vdev *vdev_obj,
 				    struct vdev_ic_cp_stats *vdev_cp_stats);
 
+/**
+ * wlan_cfg80211_get_pdev_cp_stats() - API to get pdev cp stats object
+ * @pdev_obj: pdev object as input
+ * @pdev_cp_stats: pdev cp stats object to populate
+ *
+ * Return: 0 on success, negative value on failure
+ */
+int wlan_cfg80211_get_pdev_cp_stats(struct wlan_objmgr_pdev *pdev_obj,
+				    struct pdev_ic_cp_stats *pdev_cp_stats);
+
 #endif /* QCA_SUPPORT_CP_STATS */
 #endif /* __WLAN_CFG80211_IC_CP_STATS_H__ */

+ 27 - 1
os_if/linux/cp_stats/src/wlan_cfg80211_ic_cp_stats.c

@@ -19,7 +19,7 @@
 /**
  * DOC: wlan_cfg80211_ic_cp_stats.c
  *
- * This file provide definitions to cp stats supported cfg80211 cmd handlers
+ * This file provide definitions to os_if cp_stats APIs
  */
 #include <wlan_cfg80211_ic_cp_stats.h>
 #include <wlan_cp_stats_ic_ucfg_api.h>
@@ -73,3 +73,29 @@ int wlan_cfg80211_get_vdev_cp_stats(struct wlan_objmgr_vdev *vdev_obj,
 
 	return qdf_status_to_os_return(status);
 }
+
+int wlan_cfg80211_get_pdev_cp_stats(struct wlan_objmgr_pdev *pdev_obj,
+				    struct pdev_ic_cp_stats *pdev_cp_stats)
+{
+	QDF_STATUS status;
+
+	if (!pdev_obj) {
+		cfg80211_err("Invalid input, pdev obj is NULL");
+		return -EINVAL;
+	}
+
+	if (!pdev_cp_stats) {
+		cfg80211_err("Invalid input, pdev cp obj is NULL");
+		return -EINVAL;
+	}
+
+	status = wlan_ucfg_get_pdev_cp_stats(pdev_obj, pdev_cp_stats);
+	if (QDF_IS_STATUS_ERROR(status)) {
+		cfg80211_err("wlan_cfg80211_get_pdev_cp_stats status: %d",
+			     status);
+	}
+
+	return qdf_status_to_os_return(status);
+}
+
+qdf_export_symbol(wlan_cfg80211_get_pdev_cp_stats);