summaryrefslogtreecommitdiff
path: root/xpp/zap_debug.h
diff options
context:
space:
mode:
authortzafrir <tzafrir@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2007-08-16 21:45:13 +0000
committertzafrir <tzafrir@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2007-08-16 21:45:13 +0000
commitbbdb7ec96737aee49feaa3d908438fc90fd27eea (patch)
tree594c8336e2308960c11cb97f17faef63ebd8a036 /xpp/zap_debug.h
parentfb790bb2e462f4b00be49c29e570587d5a7d21af (diff)
xpp rev. 4515:
* BRI improvement: an 'nt_keepalive' parameter to xpd_bri forces a BRI_NT to retry a connection indefinitely (this is our default). When false it revert to the behaviour in changeset:4415 ("Bezeq like") * Improvement in DBG macros. The print_dbg parameter is now set of flags to debug. They are defined in zap_debug.h * Don't use Astribanks connected to USB1 interfaces Unless the user set the option usb1=1 for xpp_usb (r4504). * And some more documentation... * Include some of our variables in the default zaptel sample file. Merged revisions 2860 via svnmerge from https://origsvn.digium.com/svn/zaptel/branches/1.2 Merged revisions 2866 via svnmerge from https://origsvn.digium.com/svn/zaptel/branches/1.4 git-svn-id: http://svn.digium.com/svn/zaptel/trunk@2867 5390a7c7-147a-4af0-8ec9-7488f05a26cb
Diffstat (limited to 'xpp/zap_debug.h')
-rw-r--r--xpp/zap_debug.h26
1 files changed, 16 insertions, 10 deletions
diff --git a/xpp/zap_debug.h b/xpp/zap_debug.h
index a234cca..ff4b554 100644
--- a/xpp/zap_debug.h
+++ b/xpp/zap_debug.h
@@ -39,35 +39,41 @@
printk(KERN_ ## level "%s-%s: %s/%s/%d: " fmt, #level, \
THIS_MODULE->name, (xpd)->xbus->busname, (xpd)->xpdname, (pos), ## __VA_ARGS__)
-#define DBG(fmt, ...) \
- ((void)((print_dbg) && PRINTK(DEBUG, "%s: " fmt, __FUNCTION__, ## __VA_ARGS__)))
+#define DBG(bits, fmt, ...) \
+ ((void)((print_dbg & (DBG_ ## bits)) && PRINTK(DEBUG, "%s: " fmt, __FUNCTION__, ## __VA_ARGS__)))
#define INFO(fmt, ...) PRINTK(INFO, fmt, ## __VA_ARGS__)
#define NOTICE(fmt, ...) PRINTK(NOTICE, fmt, ## __VA_ARGS__)
#define WARNING(fmt, ...) PRINTK(WARNING, fmt, ## __VA_ARGS__)
#define ERR(fmt, ...) PRINTK(ERR, fmt, ## __VA_ARGS__)
-#define XBUS_DBG(xbus, fmt, ...) \
- ((void)((print_dbg) && XBUS_PRINTK(DEBUG, xbus, "%s: " fmt, __FUNCTION__, ## __VA_ARGS__)))
+#define XBUS_DBG(bits, xbus, fmt, ...) \
+ ((void)((print_dbg & (DBG_ ## bits)) && XBUS_PRINTK(DEBUG, xbus, "%s: " fmt, __FUNCTION__, ## __VA_ARGS__)))
#define XBUS_INFO(xbus, fmt, ...) XBUS_PRINTK(INFO, xbus, fmt, ## __VA_ARGS__)
#define XBUS_NOTICE(xbus, fmt, ...) XBUS_PRINTK(NOTICE, xbus, fmt, ## __VA_ARGS__)
#define XBUS_ERR(xbus, fmt, ...) XBUS_PRINTK(ERR, xbus, fmt, ## __VA_ARGS__)
-#define XPD_DBG(xpd, fmt, ...) \
- ((void)((print_dbg) && XPD_PRINTK(DEBUG, xpd, "%s: " fmt, __FUNCTION__, ## __VA_ARGS__)))
+#define XPD_DBG(bits, xpd, fmt, ...) \
+ ((void)((print_dbg & (DBG_ ## bits)) && XPD_PRINTK(DEBUG, xpd, "%s: " fmt, __FUNCTION__, ## __VA_ARGS__)))
#define XPD_INFO(xpd, fmt, ...) XPD_PRINTK(INFO, xpd, fmt, ## __VA_ARGS__)
#define XPD_NOTICE(xpd, fmt, ...) XPD_PRINTK(NOTICE, xpd, fmt, ## __VA_ARGS__)
#define XPD_WARNING(xpd, fmt, ...) XPD_PRINTK(WARNING, xpd, fmt, ## __VA_ARGS__)
#define XPD_ERR(xpd, fmt, ...) XPD_PRINTK(ERR, xpd, fmt, ## __VA_ARGS__)
-#define LINE_DBG(xpd, pos, fmt, ...) \
- ((void)((print_dbg) && LINE_PRINTK(DEBUG, xpd, pos, "%s: " fmt, __FUNCTION__, ## __VA_ARGS__)))
+#define LINE_DBG(bits, xpd, pos, fmt, ...) \
+ ((void)((print_dbg & (DBG_ ## bits)) && LINE_PRINTK(DEBUG, xpd, pos, "%s: " fmt, __FUNCTION__, ## __VA_ARGS__)))
#define LINE_NOTICE(xpd, pos, fmt, ...) LINE_PRINTK(NOTICE, xpd, pos, fmt, ## __VA_ARGS__)
/*
* Bits for print_dbg
*/
-#define DBG_DEFAULT 0x01
-#define DBG_PCM 0x02
+#define DBG_GENERAL BIT(0)
+#define DBG_PCM BIT(1)
+#define DBG_LEDS BIT(2)
+#define DBG_SYNC BIT(3)
+#define DBG_SIGNAL BIT(4)
+#define DBG_PROC BIT(5)
+#define DBG_REGS BIT(6)
+#define DBG_ANY (~0)
void dump_poll(int print_dbg, const char *msg, int poll);