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