2 * Copyright IBM Corp. 2012
3 * Author(s): Holger Dengler (hd@linux.vnet.ibm.com)
9 #include "zcrypt_api.h"
11 /* that gives us 15 characters in the text event views */
12 #define ZCRYPT_DBF_LEN 16
14 #define DBF_ERR 3 /* error conditions */
15 #define DBF_WARN 4 /* warning conditions */
16 #define DBF_INFO 6 /* informational */
18 #define RC2WARN(rc) ((rc) ? DBF_WARN : DBF_INFO)
20 #define ZCRYPT_DBF_COMMON(level, text...) \
22 if (debug_level_enabled(zcrypt_dbf_common, level)) { \
23 char debug_buffer[ZCRYPT_DBF_LEN]; \
24 snprintf(debug_buffer, ZCRYPT_DBF_LEN, text); \
25 debug_text_event(zcrypt_dbf_common, level, \
30 #define ZCRYPT_DBF_DEVICES(level, text...) \
32 if (debug_level_enabled(zcrypt_dbf_devices, level)) { \
33 char debug_buffer[ZCRYPT_DBF_LEN]; \
34 snprintf(debug_buffer, ZCRYPT_DBF_LEN, text); \
35 debug_text_event(zcrypt_dbf_devices, level, \
40 #define ZCRYPT_DBF_DEV(level, device, text...) \
42 if (debug_level_enabled(device->dbf_area, level)) { \
43 char debug_buffer[ZCRYPT_DBF_LEN]; \
44 snprintf(debug_buffer, ZCRYPT_DBF_LEN, text); \
45 debug_text_event(device->dbf_area, level, \
50 int zcrypt_debug_init(void);
51 void zcrypt_debug_exit(void);
53 #endif /* ZCRYPT_DEBUG_H */