xref: /freebsd/sys/dev/qat/qat_api/common/include/lac_log.h (revision f81cdf24ba5436367377f7c8e8f51f6df2a75ca7)
1 /* SPDX-License-Identifier: BSD-3-Clause */
2 /* Copyright(c) 2007-2022 Intel Corporation */
3 
4 /**
5  ***************************************************************************
6  * @file lac_log.h
7  *
8  * @defgroup LacLog     Log
9  *
10  * @ingroup LacCommon
11  *
12  * Logging Macros. These macros also log the function name they are called in.
13  *
14  ***************************************************************************/
15 
16 /***************************************************************************/
17 
18 #ifndef LAC_LOG_H
19 #define LAC_LOG_H
20 
21 /***************************************************************************
22  * Include public/global header files
23  ***************************************************************************/
24 #include "cpa.h"
25 #include "lac_common.h"
26 #include "icp_accel_devices.h"
27 
28 #define LAC_INVALID_PARAM_LOG_(log, args...)                                   \
29 	QAT_UTILS_LOG("[error] %s() - : Invalid API Param - " log "\n",        \
30 		      __func__,                                                \
31 		      ##args)
32 
33 #define LAC_INVALID_PARAM_LOG(log) LAC_INVALID_PARAM_LOG_(log)
34 
35 #define LAC_INVALID_PARAM_LOG1(log, param1) LAC_INVALID_PARAM_LOG_(log, param1)
36 
37 #define LAC_INVALID_PARAM_LOG2(log, param1, param2)                            \
38 	LAC_INVALID_PARAM_LOG_(log, param1, param2)
39 
40 #define LAC_UNSUPPORTED_PARAM_LOG(log)                                         \
41 	QAT_UTILS_LOG("%s() - : UnSupported API Param - " log "\n", __func__)
42 
43 #define LAC_LOG_ERROR(log) QAT_UTILS_LOG("%s() - : " log "\n", __func__)
44 
45 #endif /* LAC_LOG_H */
46