[svn-commits] rmeyerriecks: linux/trunk r8569 - in /linux/trunk/drivers/dahdi: ./ wcte12xp/

SVN commits to the Digium repositories svn-commits at lists.digium.com
Mon Apr 26 16:49:58 CDT 2010


Author: rmeyerriecks
Date: Mon Apr 26 16:49:55 2010
New Revision: 8569

URL: http://svnview.digium.com/svn/dahdi?view=rev&rev=8569
Log:
dahdi-base: Reverted a change from last patch

Removed a change to dahdi-base from last patch which might have caused
compatibility with drivers other than the wcte12xp.

wcte12xp: The channel clear/rbs function no longer reads the register first.
It now uses the span's channel flags to determine each channels clear state.
Also added various minor readability improvements.


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

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=8569&r1=8568&r2=8569
==============================================================================
--- linux/trunk/drivers/dahdi/dahdi-base.c (original)
+++ linux/trunk/drivers/dahdi/dahdi-base.c Mon Apr 26 16:49:55 2010
@@ -4288,10 +4288,8 @@
 		}
 
 		if (!res && chans[ch.chan]->span->chanconfig) {
-			spin_unlock_irqrestore(&chans[ch.chan]->lock, flags);
 			res = chans[ch.chan]->span->chanconfig(chans[ch.chan],
 							       ch.sigtype);
-			spin_lock_irqsave(&chans[ch.chan]->lock, flags);
 		}
 
 #ifdef CONFIG_DAHDI_NET

Modified: linux/trunk/drivers/dahdi/wcte12xp/base.c
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/wcte12xp/base.c?view=diff&rev=8569&r1=8568&r2=8569
==============================================================================
--- linux/trunk/drivers/dahdi/wcte12xp/base.c (original)
+++ linux/trunk/drivers/dahdi/wcte12xp/base.c Mon Apr 26 16:49:55 2010
@@ -658,42 +658,39 @@
 
 static void __t1xxp_set_clear(struct t1 *wc, int channo)
 {
-	int i,j;
+	int i,offset;
 	int ret;
-	unsigned short val=0;
+	unsigned short reg[2];
 	
 	if (channo < 0) {
 		/* If channo is passed as -1, we want to set all
 		   24 channels to clear mode */
-		t1_setreg(wc, 0x2f, 0xff);
-		t1_setreg(wc, 0x30, 0xff);
-		t1_setreg(wc, 0x31, 0xff);
+		t1_setreg(wc, CCB1, 0xff);
+		t1_setreg(wc, CCB2, 0xff);
+		t1_setreg(wc, CCB3, 0xff);
 	} else {
-		/* if channo is passed as an existing channel
-		   set that specific channel depending on its flag */
-
-		/* Get register offset and regster's value */
-		j = (channo-1)/8;
-		val = t1_getreg(wc, 0x2f+j);
+		/* Calculate all states on all 24 channels using the channel
+		   flags, then write all 3 clear channel registers at once */
 
 		for (i = 0; i < 24; i++) {
+			offset = i/8;
 			if(wc->span.chans[i]->flags & DAHDI_FLAG_CLEAR)
-				debug |= (1<<i);
+				reg[offset] |= 1 << (7 - (i % 8));
 			else
-				debug &= ~(1<<i);
-		}
-
-		/* Clear or set the bit depending on the channo's flag */
-		if (wc->span.chans[channo-1]->flags & DAHDI_FLAG_CLEAR) {
-			val |= 1 << (7 - ((channo-1) % 8));
-		} else {
-			val &= ~(1 << (7 - ((channo-1) % 8)));
-		}
-
-		ret = t1_setreg(wc, 0x2f+j, val);
-		if (ret < 0) {
+				reg[offset] &= ~(1 << (7 - (i % 8)));
+		}
+
+		ret = t1_setreg(wc, CCB1, reg[0]);
+		if (ret < 0)
 			t1_info(wc, "set_clear failed for chan %d!\n", channo);
-		}
+
+		ret = t1_setreg(wc, CCB2, reg[1]);
+		if (ret < 0)
+			t1_info(wc, "set_clear failed for chan %d!\n", channo);
+
+		ret = t1_setreg(wc, CCB3, reg[2]);
+		if (ret < 0)
+			t1_info(wc, "set_clear failed for chan %d!\n", channo);
 	}
 }
 

Modified: linux/trunk/drivers/dahdi/wcte12xp/wcte12xp.h
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/wcte12xp/wcte12xp.h?view=diff&rev=8569&r1=8568&r2=8569
==============================================================================
--- linux/trunk/drivers/dahdi/wcte12xp/wcte12xp.h (original)
+++ linux/trunk/drivers/dahdi/wcte12xp/wcte12xp.h Mon Apr 26 16:49:55 2010
@@ -150,4 +150,9 @@
 #define LIM1_RL 	(1<<1)
 #define LIM1_JATT	(1<<2)
 
+/* Clear Channel Registers */
+#define CCB1		0x2f
+#define CCB2		0x30
+#define CCB3		0x31
+
 #endif




More information about the svn-commits mailing list