00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056 #ifndef _IPMI_DEBUG_H
00057 #define _IPMI_DEBUG_H
00058
00059 #include <OpenIPMI/os_handler.h>
00060
00061 #ifdef __cplusplus
00062 extern "C" {
00063 #endif
00064
00065 extern unsigned int __ipmi_log_mask;
00066
00067
00068 #define DEBUG_MSG_BIT (1 << 0)
00069
00070
00071 #define DEBUG_RAWMSG_BIT (1 << 1)
00072
00073
00074 #define DEBUG_EVENTS_BIT (1 << 3)
00075
00076
00077 #define DEBUG_CON0_FAIL_BIT (1 << 4)
00078 #define DEBUG_CON1_FAIL_BIT (1 << 5)
00079 #define DEBUG_CON2_FAIL_BIT (1 << 6)
00080 #define DEBUG_CON3_FAIL_BIT (1 << 7)
00081
00082 #define DEBUG_MSG_ERR_BIT (1 << 8)
00083
00084 #define DEBUG_MSG (__ipmi_log_mask & DEBUG_MSG_BIT)
00085 #define DEBUG_MSG_ENABLE() __ipmi_log_mask |= DEBUG_MSG_BIT
00086 #define DEBUG_MSG_DISABLE() __ipmi_log_mask &= ~DEBUG_MSG_BIT
00087
00088 #define DEBUG_RAWMSG (__ipmi_log_mask & DEBUG_RAWMSG_BIT)
00089 #define DEBUG_RAWMSG_ENABLE() __ipmi_log_mask |= DEBUG_RAWMSG_BIT
00090 #define DEBUG_RAWMSG_DISABLE() __ipmi_log_mask &= ~DEBUG_RAWMSG_BIT
00091
00092 #define DEBUG_EVENTS (__ipmi_log_mask & DEBUG_EVENTS_BIT)
00093 #define DEBUG_EVENTS_ENABLE() __ipmi_log_mask |= DEBUG_EVENTS_BIT
00094 #define DEBUG_EVENTS_DISABLE() __ipmi_log_mask &= ~DEBUG_EVENTS_BIT
00095
00096 #define DEBUG_CON_FAIL(con) (__ipmi_log_mask & (DEBUG_CON0_FAIL_BIT << con))
00097 #define DEBUG_CON_FAIL_ENABLE(con) \
00098 __ipmi_log_mask |= (DEBUG_CON0_FAIL_BIT << con)
00099 #define DEBUG_CON_FAIL_DISABLE(con) \
00100 __ipmi_log_mask &= ~(DEBUG_CON0_FAIL_BIT << con)
00101
00102 #define DEBUG_MSG_ERR (__ipmi_log_mask & DEBUG_MSG_ERR_BIT)
00103 #define DEBUG_MSG_ERR_ENABLE() __ipmi_log_mask |= DEBUG_MSG_ERR_BIT
00104 #define DEBUG_MSG_ERR_DISABLE() __ipmi_log_mask &= ~DEBUG_MSG_ERR_BIT
00105
00106 #ifdef IPMI_CHECK_LOCKS
00107 void ipmi_report_lock_error(os_handler_t *handler, char *str);
00108 #define IPMI_REPORT_LOCK_ERROR(handler, str) ipmi_report_lock_error(handler, \
00109 str)
00110 #else
00111 #define IPMI_REPORT_LOCK_ERROR(handler, str) do {} while (0)
00112 #endif
00113
00114 extern int __ipmi_debug_locks;
00115 #define DEBUG_LOCKS (__ipmi_debug_locks)
00116 #define DEBUG_LOCKS_ENABLE() __ipmi_debug_locks = 1
00117 #define DEBUG_LOCKS_DISABLE() __ipmi_debug_locks = 0
00118
00119 #ifdef __cplusplus
00120 }
00121 #endif
00122
00123 #endif