aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/qat/qat_api/common/utils/sal_service_state.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/qat/qat_api/common/utils/sal_service_state.c')
-rw-r--r--sys/dev/qat/qat_api/common/utils/sal_service_state.c45
1 files changed, 45 insertions, 0 deletions
diff --git a/sys/dev/qat/qat_api/common/utils/sal_service_state.c b/sys/dev/qat/qat_api/common/utils/sal_service_state.c
new file mode 100644
index 000000000000..0fda6b1c69c7
--- /dev/null
+++ b/sys/dev/qat/qat_api/common/utils/sal_service_state.c
@@ -0,0 +1,45 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/* Copyright(c) 2007-2022 Intel Corporation */
+/**
+ ***************************************************************************
+ * @file sal_service_state.c Service state checks
+ *
+ * @ingroup SalServiceState
+ *
+ ***************************************************************************/
+
+/*
+*******************************************************************************
+* Include public/global header files
+*******************************************************************************
+*/
+
+#include "cpa.h"
+#include "qat_utils.h"
+#include "lac_list.h"
+#include "icp_accel_devices.h"
+#include "icp_adf_debug.h"
+#include "lac_sal_types.h"
+#include "sal_service_state.h"
+
+CpaBoolean
+Sal_ServiceIsRunning(CpaInstanceHandle instanceHandle)
+{
+ sal_service_t *pService = (sal_service_t *)instanceHandle;
+
+ if (SAL_SERVICE_STATE_RUNNING == pService->state) {
+ return CPA_TRUE;
+ }
+ return CPA_FALSE;
+}
+
+CpaBoolean
+Sal_ServiceIsRestarting(CpaInstanceHandle instanceHandle)
+{
+ sal_service_t *pService = (sal_service_t *)instanceHandle;
+
+ if (SAL_SERVICE_STATE_RESTARTING == pService->state) {
+ return CPA_TRUE;
+ }
+ return CPA_FALSE;
+}