Browse Source

qcacmn: Add public API to print CM state history

Add public API to print CM state history

Change-Id: Iab079eeb1e4f4a2a256e8e0721db415e539523eb
Himanshu Batra 4 years ago
parent
commit
27378433c5

+ 15 - 0
umac/mlme/connection_mgr/core/src/wlan_cm_sm.c

@@ -1090,3 +1090,18 @@ QDF_STATUS cm_sm_destroy(struct cnx_mgr *cm_ctx)
 
 	return QDF_STATUS_SUCCESS;
 }
+
+#ifdef SM_ENG_HIST_ENABLE
+void cm_sm_history_print(struct wlan_objmgr_vdev *vdev)
+{
+	struct cnx_mgr *cm_ctx;
+
+	cm_ctx = cm_get_cm_ctx(vdev);
+	if (!cm_ctx) {
+		mlme_err("cm_ctx is NULL");
+		return;
+	}
+
+	return wlan_sm_print_history(cm_ctx->sm.sm_hdl);
+}
+#endif

+ 1 - 8
umac/mlme/connection_mgr/core/src/wlan_cm_sm.h

@@ -122,14 +122,7 @@ QDF_STATUS cm_sm_destroy(struct cnx_mgr *cm_ctx);
  * Return: void
  */
 #ifdef SM_ENG_HIST_ENABLE
-static inline void cm_sm_history_print(struct cnx_mgr *cm_ctx)
-{
-	return wlan_sm_print_history(cm_ctx->sm.sm_hdl);
-}
-#else
-static inline void cm_sm_history_print(struct cnx_mgr *cm_ctx)
-{
-}
+void cm_sm_history_print(struct wlan_objmgr_vdev *vdev);
 #endif
 
 #ifdef WLAN_CM_USE_SPINLOCK

+ 15 - 0
umac/mlme/connection_mgr/dispatcher/inc/wlan_cm_api.h

@@ -208,6 +208,21 @@ void wlan_cm_hw_mode_change_resp(struct wlan_objmgr_pdev *pdev, uint8_t vdev_id,
 				 wlan_cm_id cm_id, QDF_STATUS status);
 #endif /* ifdef POLICY_MGR_ENABLE */
 
+/**
+ * wlan_cm_sm_history_print() - Prints SM history
+ * @vdev: Objmgr vdev
+ *
+ * API to print CM SM history
+ *
+ * Return: void
+ */
+#ifdef SM_ENG_HIST_ENABLE
+void wlan_cm_sm_history_print(struct wlan_objmgr_vdev *vdev);
+#else
+static inline void wlan_cm_sm_history_print(struct wlan_objmgr_vdev *vdev)
+{
+}
+#endif
 #else
 
 #ifdef WLAN_POLICY_MGR_ENABLE

+ 7 - 0
umac/mlme/connection_mgr/dispatcher/src/wlan_cm_api.c

@@ -206,3 +206,10 @@ void wlan_cm_hw_mode_change_resp(struct wlan_objmgr_pdev *pdev, uint8_t vdev_id,
 	cm_hw_mode_change_resp(pdev, vdev_id, cm_id, status);
 }
 #endif /* ifdef POLICY_MGR_ENABLE */
+
+#ifdef SM_ENG_HIST_ENABLE
+void wlan_cm_sm_history_print(struct wlan_objmgr_vdev *vdev)
+{
+	return cm_sm_history_print(vdev);
+}
+#endif