4 * @brief Debugging defines.
5 * @note Copyright (C) 2006 Meilhaus Electronic GmbH (support@meilhaus.de)
6 * @author Guenter Gebhardt
7 * @author Krzysztof Gantzke (k.gantzke@meilhaus.de)
15 #include <linux/kernel.h>
19 #ifdef MEDEBUG_TEST_ALL /* Switch to enable all info messages. */
23 # ifndef MEDEBUG_TEST_INFO
24 # define MEDEBUG_TEST_INFO
26 # ifndef MEDEBUG_DEBUG_REG
27 # define MEDEBUG_DEBUG_REG /* Switch to enable registry access debuging messages. */
29 # ifndef MEDEBUG_DEBUG_LOCKS
30 # define MEDEBUG_DEBUG_LOCKS /* Switch to enable locking messages. */
34 #ifdef MEDEBUG_TEST_INFO /* Switch to enable info and test messages. */
36 # define MEDEBUG_INFO /* Switch to enable info messages. */
43 #ifdef MEDEBUG_TEST /* Switch to enable debug test messages. */
44 # ifndef MEDEBUG_DEBUG
45 # define MEDEBUG_DEBUG /* Switch to enable debug messages. */
47 # ifndef MEDEBUG_ERROR
48 # define MEDEBUG_ERROR /* Switch to enable error messages. */
52 #ifdef MEDEBUG_ERROR /* Switch to enable error messages. */
53 # ifndef MEDEBUG_ERROR_CRITICAL /* Also critical error messages. */
54 # define MEDEBUG_ERROR_CRITICAL /* Switch to enable high importance error messages. */
58 #undef PDEBUG /* Only to be sure. */
59 #undef PINFO /* Only to be sure. */
60 #undef PERROR /* Only to be sure. */
61 #undef PERROR_CRITICAL /* Only to be sure. */
62 #undef PDEBUG_REG /* Only to be sure. */
63 #undef PDEBUG_LOCKS /* Only to be sure. */
64 #undef PSECURITY /* Only to be sure. */
65 #undef PLOG /* Only to be sure. */
68 # define PDEBUG(fmt, args...) \
69 printk(KERN_DEBUG"ME_DRV D: <%s> " fmt, __func__, ##args)
71 # define PDEBUG(fmt, args...)
74 #ifdef MEDEBUG_DEBUG_LOCKS
75 # define PDEBUG_LOCKS(fmt, args...) \
76 printk(KERN_DEBUG"ME_DRV L: <%s> " fmt, __func__, ##args)
78 # define PDEBUG_LOCKS(fmt, args...)
81 #ifdef MEDEBUG_DEBUG_REG
82 # define PDEBUG_REG(fmt, args...) \
83 printk(KERN_DEBUG"ME_DRV R: <%s:%d> REG:" fmt, __func__, __LINE__, ##args)
85 # define PDEBUG_REG(fmt, args...)
89 # define PINFO(fmt, args...) \
90 printk(KERN_INFO"ME_DRV I: " fmt, ##args)
92 # define PINFO(fmt, args...)
96 # define PERROR(fmt, args...) \
97 printk(KERN_ERR"ME_DRV E: <%s:%i> " fmt, __FILE__, __LINE__, ##args)
99 # define PERROR(fmt, args...)
102 #ifdef MEDEBUG_ERROR_CRITICAL
103 # define PERROR_CRITICAL(fmt, args...) \
104 printk(KERN_CRIT"ME_DRV C: <%s:%i> " fmt, __FILE__, __LINE__, ##args)
106 # define PERROR_CRITICAL(fmt, args...)
109 //This debug is only to detect logical errors!
110 # define PSECURITY(fmt, args...) \
111 printk(KERN_CRIT"ME_DRV SECURITY: <%s:%s:%i> " fmt, __FILE__, __func__, __LINE__, ##args)
112 //This debug is to keep track in customers' system
113 # define PLOG(fmt, args...) \
114 printk(KERN_INFO"ME_DRV: " fmt, ##args)
116 //This debug is to check new parts during development
117 #ifdef MEDEBUG_DEVELOP
118 # define PDEVELOP(fmt, args...) \
119 printk(KERN_CRIT"ME_DRV: <%s:%s:%i> " fmt, __FILE__, __func__, __LINE__, ##args)
121 # define PDEVELOP(fmt, args...)