[dahdi-commits] rmeyerriecks: branch linux/mspiceland/dahdi-qfalc31 r7414 - /linux/team/mspic...

SVN commits to the DAHDI project dahdi-commits at lists.digium.com
Fri Oct 23 14:46:59 CDT 2009


Author: rmeyerriecks
Date: Fri Oct 23 14:46:56 2009
New Revision: 7414

URL: http://svnview.digium.com/svn/dahdi?view=rev&rev=7414
Log:
Modified the previous two patches so they conform to coding guidelines.


Modified:
    linux/team/mspiceland/dahdi-qfalc31/drivers/dahdi/wct4xxp/base.c

Modified: linux/team/mspiceland/dahdi-qfalc31/drivers/dahdi/wct4xxp/base.c
URL: http://svnview.digium.com/svn/dahdi/linux/team/mspiceland/dahdi-qfalc31/drivers/dahdi/wct4xxp/base.c?view=diff&rev=7414&r1=7413&r2=7414
==============================================================================
--- linux/team/mspiceland/dahdi-qfalc31/drivers/dahdi/wct4xxp/base.c (original)
+++ linux/team/mspiceland/dahdi-qfalc31/drivers/dahdi/wct4xxp/base.c Fri Oct 23 14:46:56 2009
@@ -1494,7 +1494,7 @@
 
 	printk(KERN_INFO "About to enter spanconfig!\n");
 	if (debug & DEBUG_MAIN)
-		printk(KERN_DEBUG "TE%dXXP: Configuring span %d sync %d\n", wc->numspans, span->spanno, lc->sync);
+		printk(KERN_DEBUG "TE%dXXP: Configuring span %d\n", wc->numspans, span->spanno);
 
 	if (lc->sync < 0)
 		lc->sync = 0;
@@ -1774,18 +1774,10 @@
 	int cmr1 = 0x38;	/* Clock Mode: RCLK sourced by DCO-R1
 				   by default, Disable Clock-Switching */
 
-	if(span != wc->syncsrc) {
-		if (debug & DEBUG_MAIN)
-			printk(KERN_DEBUG "TE%dXXP: RCLK source already set to\
-					span %d\n", wc->numspans, span+1);
-	}
-
 	cmr1 |= (span << 6);
 	__t4_framer_out(wc, 0, 0x44, cmr1);
 
-	if(debug & DEBUG_MAIN)
-		printk(KERN_DEBUG "TE%dXXP: RCLK source set to\
-				span %d\n", wc->numspans, span+1);
+	dev_dbg(&wc->dev->dev, "RCLK source set to span %d\n", span+1);
 }
 
 static void __t4_set_sclk_src(struct t4 *wc, int mode, int master, int slave)
@@ -1799,10 +1791,10 @@
 	else
 		wc->dmactrl &= ~(1 << 24);
 
-	if(mode == WC_RECOVER)
+	if (mode == WC_RECOVER)
 		wc->dmactrl |= (1 << 29); /* Recover timing from RCLK */
 
-	if(mode == WC_SELF)
+	if (mode == WC_SELF)
 		wc->dmactrl &= ~(1 << 29);/* Provide timing from MCLK */
 
 	__t4_pci_out(wc, WC_DMACTRL, wc->dmactrl);
@@ -1943,56 +1935,61 @@
 	int firstprio, secondprio;
 	firstprio = secondprio = 4;
 
-	printk(KERN_INFO "timing source auto card %d!\n", wc->num);
+	dev_info(&wc->dev->dev, "timing source auto\n");
 	clear_bit(T4_CHECK_TIMING, &wc->checkflag);
 	if (timingcable) {
 		__t4_findsync(wc);
 	} else {
 		printk(KERN_DEBUG "Evaluating spans for timing sources:\n");
 		for (x=0;x<wc->numspans;x++) {
-			if ((wc->tspans[x]->span.flags & DAHDI_FLAG_RUNNING) && 
-			   !(wc->tspans[x]->span.alarms & (DAHDI_ALARM_RED | DAHDI_ALARM_BLUE) )) {
-				printk(KERN_DEBUG "span %d is green : syncpos %d\n", x+1, wc->tspans[x]->syncpos); 
-				if(wc->tspans[x]->syncpos){
+			if ((wc->tspans[x]->span.flags & DAHDI_FLAG_RUNNING) &&
+			   !(wc->tspans[x]->span.alarms & (DAHDI_ALARM_RED |
+							   DAHDI_ALARM_BLUE))) {
+				dev_info(&wc->dev->dev, "span %d is green : "\
+							"syncpos %d\n",
+						  x+1, wc->tspans[x]->syncpos);
+				if (wc->tspans[x]->syncpos) {
 					/* If our current timing source is in
 					   this list, stay locked to it */
-					if(x == wc->syncsrc){
-						printk(KERN_DEBUG "RCLK syncsrc: %d== offset: %d?\n", wc->syncsrc, x);
+					if (x == wc->syncsrc)
 						return;
-					}
-					/* Valid rsync source in recovered timing mode */
-					if(firstprio == 4)
+					/* Valid rsync source in recovered
+					   timing mode */
+					if (firstprio == 4)
 						firstprio = x;
-					else if(wc->tspans[x]->syncpos > wc->tspans[firstprio]->syncpos)
+					else if (wc->tspans[x]->syncpos >
+						wc->tspans[firstprio]->syncpos)
 						firstprio = x;
-				}else {
-					/* Valid rsync source in system timing mode */
-					if(secondprio == 4)
+				} else {
+					/* Valid rsync source in system timing
+					   mode */
+					if (secondprio == 4)
 						secondprio = x;
-					else if(wc->tspans[x]->syncpos > wc->tspans[secondprio]->syncpos)
+					else if (wc->tspans[x]->syncpos >
+						wc->tspans[secondprio]->syncpos)
 						secondprio = x;
 
 				}
 			}
 		}
-		printk(KERN_DEBUG "firstprio %d : secondprio %d\n", 
-				firstprio, secondprio);
-		if(firstprio != 4) {
+		if (firstprio != 4) {
 			wc->syncsrc = firstprio;
 			__t4_set_rclk_src(wc, firstprio);
 			__t4_set_sclk_src(wc, WC_RECOVER, 0, 0);
-			printk(KERN_INFO "Recovered timing mode, RCLK set to\
-					span %d\n", firstprio+1);
-		} else if(secondprio != 4) {
+			dev_info(&wc->dev->dev, "Recovered timing mode, "\
+						"RCLK set to span %d\n",
+						firstprio+1);
+		} else if (secondprio != 4) {
 			wc->syncsrc = -1;
 			__t4_set_rclk_src(wc, secondprio);
 			__t4_set_sclk_src(wc, WC_SELF, 0, 0);
-			printk(KERN_INFO "System timing mode, RCLK set to span\
-					%d\n", secondprio+1);
+			dev_info(&wc->dev->dev, "System timing mode, "\
+						"RCLK set to span %d\n",
+						secondprio+1);
 		} else {
 			wc->syncsrc = -1;
-			printk(KERN_INFO "All spans in alarm : No valid span to\
-				       	source RCLK from\n");
+			dev_info(&wc->dev->dev, "All spans in alarm : No valid"\
+						"span to source RCLK from\n");
 			/* Default rclk to lock with span 1 */
 			__t4_set_rclk_src(wc, 0);
 			__t4_set_sclk_src(wc, WC_SELF, 0, 0);
@@ -2207,8 +2204,7 @@
 	}
 #endif
 	/* Force re-evaluation fo timing source */
-//	if (timingcable)
-		wc->syncsrc = -1;
+	wc->syncsrc = -1;
 
 	if (ts->spantype == TYPE_E1) { /* if this is an E1 card */
 		__t4_configure_e1(wc, span->offset, span->lineconfig);
@@ -2591,7 +2587,7 @@
 
 static void t4_check_alarms(struct t4 *wc, int span)
 {
-	unsigned char c,d, e;
+	unsigned char c, d, e;
 	int alarms;
 	int x,j;
 	struct t4_span *ts = wc->tspans[span];
@@ -2664,13 +2660,14 @@
 	}
 
 	if (c & 0xa0) {
-		if (ts->alarmcount >= alarmdebounce){
-			printk(KERN_INFO "Loss of Signal card %d span %d\n", wc->num, span+1);
+		if (ts->alarmcount >= alarmdebounce) {
+			dev_info(&wc->dev->dev, "Loss-of-signal span %d\n",
+								   span+1);
 			alarms |= DAHDI_ALARM_RED;
 			/* Disable Slip Interrupts */
 			e = __t4_framer_in(wc, span, 0x17);
 			__t4_framer_out(wc, span, 0x17, (e|0x03));
-		}else{
+		} else {
 			ts->alarmcount++;
 		}
 	} else




More information about the dahdi-commits mailing list