diff options
Diffstat (limited to 'xpp/zap_debug.c')
-rw-r--r-- | xpp/zap_debug.c | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/xpp/zap_debug.c b/xpp/zap_debug.c index 59eb0a8..bf54e62 100644 --- a/xpp/zap_debug.c +++ b/xpp/zap_debug.c @@ -30,6 +30,7 @@ #include <linux/module.h> #include <zaptel.h> #include "zap_debug.h" +#include "xdefs.h" static const char rcsid[] = "$Id$"; @@ -59,9 +60,32 @@ void dump_poll(int print_dbg, const char *msg, int poll) for(i = 0; i < ARRAY_SIZE(poll_names); i++) { if(poll & poll_names[i].value) - DBG("%s: %s\n", msg, poll_names[i].name); + DBG(GENERAL, "%s: %s\n", msg, poll_names[i].name); } } +void alarm2str(int alarm, char *buf, int buflen) +{ + char *p = buf; + int left = buflen; + int i; + int n; + + if(!alarm) { + snprintf(buf, buflen, "NONE"); + return; + } + memset(buf, 0, buflen); + for(i = 0; i < 8; i++) { + if(left && (alarm & BIT(i))) { + n = snprintf(p, left, "%s,", alarmbit2str(i)); + p += n; + left -= n; + } + } + if(p > buf) /* kill last comma */ + *(p - 1) = '\0'; +} EXPORT_SYMBOL(dump_poll); +EXPORT_SYMBOL(alarm2str); |