summaryrefslogtreecommitdiff
path: root/xpp/zap_debug.c
diff options
context:
space:
mode:
authortzafrir <tzafrir@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2008-01-10 18:12:27 +0000
committertzafrir <tzafrir@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2008-01-10 18:12:27 +0000
commit9899bafe997a4e020f302c99a6e025b4e8b25191 (patch)
tree8a108b05d0f319c95ba83f1d5984ae261572bebf /xpp/zap_debug.c
parent1d7d5b07325a186785b22abf09ff531dfc2edd54 (diff)
xpp.r5254:
* Improved polarity reversal hangups in FXO (r5194). Fixed false detection of polarity reversals. * Optimize xframe allocation, by not zeroing the whole memory (in get_xframe()). * Fixed erronous error message that appeared sometimes from fpga_load during USB renumeration. * Zaptel::Chans now provides battery() reporting for some FXO channels (Astribank FXO and wcfxo). git-svn-id: http://svn.digium.com/svn/zaptel/branches/1.2@3643 5390a7c7-147a-4af0-8ec9-7488f05a26cb
Diffstat (limited to 'xpp/zap_debug.c')
-rw-r--r--xpp/zap_debug.c26
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);