[dahdi-commits] rmeyerriecks: linux/trunk r9487 - /linux/trunk/drivers/dahdi/dahdi-base.c

SVN commits to the DAHDI project dahdi-commits at lists.digium.com
Thu Nov 18 11:15:13 CST 2010


Author: rmeyerriecks
Date: Thu Nov 18 11:15:07 2010
New Revision: 9487

URL: http://svnview.digium.com/svn/dahdi?view=rev&rev=9487
Log:
dahdi-base: Add debug option to log RBS bit changes

Logs the RBS bits to dmesg, for troubleshooting, for all drivers that call
dahdi_rbsbits(). Added the DEBUG_RBS bit in the debug module parameter
bitfield.

(issue #18025)

Acked-by: Shaun Ruffell <sruffell at digium.com>
Signed-off-by: Russ Meyerriecks <rmeyerriecks at digium.com>

Modified:
    linux/trunk/drivers/dahdi/dahdi-base.c

Modified: linux/trunk/drivers/dahdi/dahdi-base.c
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/dahdi-base.c?view=diff&rev=9487&r1=9486&r2=9487
==============================================================================
--- linux/trunk/drivers/dahdi/dahdi-base.c (original)
+++ linux/trunk/drivers/dahdi/dahdi-base.c Thu Nov 18 11:15:07 2010
@@ -179,6 +179,8 @@
 static int deftaps = 64;
 
 static int debug;
+#define DEBUG_MAIN	(1 << 0)
+#define DEBUG_RBS	(1 << 5)
 
 /*!
  * \brief states for transmit signalling
@@ -3465,7 +3467,7 @@
 		for (x=1; x<maxspans; x++) {
 			struct dahdi_span *const s = spans[x];
 			if (s && !s->alarms && (s->flags & DAHDI_FLAG_RUNNING)) {
-				if (debug && (master != s)) {
+				if ((debug & DEBUG_MAIN) && (master != s)) {
 					module_printk(KERN_NOTICE,
 						"Master changed to %s\n",
 						s->name);
@@ -3475,7 +3477,7 @@
 			}
 		}
 		/* Report more detailed alarms */
-		if (debug) {
+		if (debug & DEBUG_MAIN) {
 			if (span->alarms & DAHDI_ALARM_LOS) {
 				module_printk(KERN_NOTICE,
 					"Span %d: Loss of signal\n",
@@ -6057,14 +6059,14 @@
 		}
 	}
 
-	if (debug) {
+	if (debug & DEBUG_MAIN) {
 		module_printk(KERN_NOTICE, "Registered Span %d ('%s') with "
 				"%d channels\n", span->spanno, span->name, span->channels);
 	}
 
 	if (!master || prefmaster) {
 		master = span;
-		if (debug) {
+		if (debug & DEBUG_MAIN) {
 			module_printk(KERN_NOTICE, "Span ('%s') is new master\n", 
 					span->name);
 		}
@@ -6108,7 +6110,7 @@
 		module_printk(KERN_ERR, "Span %s has spanno %d which is something else\n", span->name, span->spanno);
 		return -1;
 	}
-	if (debug)
+	if (debug & DEBUG_MAIN)
 		module_printk(KERN_NOTICE, "Unregistering Span '%s' with %d channels\n", span->name, span->channels);
 #ifdef CONFIG_PROC_FS
 	snprintf(tempfile, sizeof(tempfile)-1, "dahdi/%d", span->spanno);
@@ -6138,7 +6140,7 @@
 	}
 	maxspans = new_maxspans;
 	if (master != new_master)
-		if (debug)
+		if (debug & DEBUG_MAIN)
 			module_printk(KERN_NOTICE, "%s: Span ('%s') is new master\n", __FUNCTION__,
 				      (new_master)? new_master->name: "no master");
 	master = new_master;
@@ -7132,6 +7134,10 @@
 	/* Keep track of signalling for next time */
 	chan->rxsig = cursig;
 	spin_unlock_irqrestore(&chan->lock, flags);
+
+	if ((debug & DEBUG_RBS) && printk_ratelimit()) {
+		chan_notice(chan, "Detected sigbits change to %04x\n", cursig);
+	}
 }
 
 static void process_echocan_events(struct dahdi_chan *chan)
@@ -8633,6 +8639,9 @@
 MODULE_VERSION(DAHDI_VERSION);
 
 module_param(debug, int, 0644);
+MODULE_PARM_DESC(debug, "Sets debugging verbosity as a bitfield, to see"\
+		" general debugging set this to 1. To see RBS debugging set"\
+		" this to 32");
 module_param(deftaps, int, 0644);
 
 static const struct file_operations dahdi_fops = {




More information about the dahdi-commits mailing list