[svn-commits] sruffell: linux/trunk r9399 - /linux/trunk/drivers/dahdi/wct4xxp/base.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Thu Sep 23 16:38:43 CDT 2010


Author: sruffell
Date: Thu Sep 23 16:38:37 2010
New Revision: 9399

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

Normally you can see RBS bit states in dahdi_tool, but you might also
want them logged to dmesg for troubleshooting.

(issue #18025)

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

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

Modified: linux/trunk/drivers/dahdi/wct4xxp/base.c
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/wct4xxp/base.c?view=diff&rev=9399&r1=9398&r2=9399
==============================================================================
--- linux/trunk/drivers/dahdi/wct4xxp/base.c (original)
+++ linux/trunk/drivers/dahdi/wct4xxp/base.c Thu Sep 23 16:38:37 2010
@@ -3006,6 +3006,19 @@
 }
 #endif
 
+static void t4_dahdi_rbsbits(struct dahdi_chan *const chan, int rxs)
+{
+	if ((debug & DEBUG_RBS) && printk_ratelimit()) {
+		const struct t4_span *tspan = container_of(chan->span,
+							   struct t4_span,
+							   span);
+		const struct t4 *const wc = tspan->owner;
+		dev_notice(&wc->dev->dev, "Detected sigbits change on " \
+			   "channel %s to %04x\n", chan->name, rxs);
+	}
+	dahdi_rbsbits(chan, rxs);
+}
+
 static void t4_check_sigbits(struct t4 *wc, int span)
 {
 	int a,i,rxs;
@@ -3024,12 +3037,12 @@
 			rxs = (a & 0xf);
 			if (!(ts->span.chans[i+16]->sig & DAHDI_SIG_CLEAR)) {
 				if (ts->span.chans[i+16]->rxsig != rxs)
-					dahdi_rbsbits(ts->span.chans[i+16], rxs);
+					t4_dahdi_rbsbits(ts->span.chans[i+16], rxs);
 			}
 			rxs = (a >> 4) & 0xf;
 			if (!(ts->span.chans[i]->sig & DAHDI_SIG_CLEAR)) {
 				if (ts->span.chans[i]->rxsig != rxs)
-					dahdi_rbsbits(ts->span.chans[i], rxs);
+					t4_dahdi_rbsbits(ts->span.chans[i], rxs);
 			}
 		}
 	} else if (ts->span.lineconfig & DAHDI_CONFIG_D4) {
@@ -3039,22 +3052,22 @@
 			rxs = (a & 0x3) << 2;
 			if (!(ts->span.chans[i+3]->sig & DAHDI_SIG_CLEAR)) {
 				if (ts->span.chans[i+3]->rxsig != rxs)
-					dahdi_rbsbits(ts->span.chans[i+3], rxs);
+					t4_dahdi_rbsbits(ts->span.chans[i+3], rxs);
 			}
 			rxs = (a & 0xc);
 			if (!(ts->span.chans[i+2]->sig & DAHDI_SIG_CLEAR)) {
 				if (ts->span.chans[i+2]->rxsig != rxs)
-					dahdi_rbsbits(ts->span.chans[i+2], rxs);
+					t4_dahdi_rbsbits(ts->span.chans[i+2], rxs);
 			}
 			rxs = (a >> 2) & 0xc;
 			if (!(ts->span.chans[i+1]->sig & DAHDI_SIG_CLEAR)) {
 				if (ts->span.chans[i+1]->rxsig != rxs)
-					dahdi_rbsbits(ts->span.chans[i+1], rxs);
+					t4_dahdi_rbsbits(ts->span.chans[i+1], rxs);
 			}
 			rxs = (a >> 4) & 0xc;
 			if (!(ts->span.chans[i]->sig & DAHDI_SIG_CLEAR)) {
 				if (ts->span.chans[i]->rxsig != rxs)
-					dahdi_rbsbits(ts->span.chans[i], rxs);
+					t4_dahdi_rbsbits(ts->span.chans[i], rxs);
 			}
 		}
 	} else {
@@ -3065,14 +3078,14 @@
 			if (!(ts->span.chans[i+1]->sig & DAHDI_SIG_CLEAR)) {
 				/* XXX Not really reset on every trans! XXX */
 				if (ts->span.chans[i+1]->rxsig != rxs) {
-					dahdi_rbsbits(ts->span.chans[i+1], rxs);
+					t4_dahdi_rbsbits(ts->span.chans[i+1], rxs);
 				}
 			}
 			rxs = (a >> 4) & 0xf;
 			if (!(ts->span.chans[i]->sig & DAHDI_SIG_CLEAR)) {
 				/* XXX Not really reset on every trans! XXX */
 				if (ts->span.chans[i]->rxsig != rxs) {
-					dahdi_rbsbits(ts->span.chans[i], rxs);
+					t4_dahdi_rbsbits(ts->span.chans[i], rxs);
 				}
 			}
 		}




More information about the svn-commits mailing list