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

SVN commits to the DAHDI project dahdi-commits at lists.digium.com
Mon Jan 18 15:00:31 CST 2010


Author: rmeyerriecks
Date: Mon Jan 18 15:00:20 2010
New Revision: 7928

URL: http://svnview.digium.com/svn/dahdi?view=rev&rev=7928
Log:
wct4xxp: Add a few bug fixes for latency bumps and for the new
ms_per_irq variable

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=7928&r1=7927&r2=7928
==============================================================================
--- linux/trunk/drivers/dahdi/wct4xxp/base.c (original)
+++ linux/trunk/drivers/dahdi/wct4xxp/base.c Mon Jan 18 15:00:20 2010
@@ -168,7 +168,7 @@
 static int pedanticpci = 1;
 static int debug=0;
 static int timingcable = 0;
-static int t1e1override = 0xff;
+static int t1e1override = -1;  /* 0xff for E1, 0x00 for T1 */
 static int j1mode = 0;
 static int sigmode = FRMR_MODE_NO_ADDR_CMP;
 static int loopback = 0;
@@ -2215,7 +2215,8 @@
 		span->flags |= DAHDI_FLAG_RUNNING;
 		wc->spansstarted++;
 
-		__t4_pci_out(wc, 5, (ms_per_irq << 16) | wc->numbufs);
+		if (wc->flags & FLAG_5THGEN)
+			__t4_pci_out(wc, 5, (ms_per_irq << 16) | wc->numbufs);
 		/* enable interrupts */
 		/* Start DMA, enabling DMA interrupts on read only */
 #if 0
@@ -3273,6 +3274,8 @@
 			} else {
 				needed_latency = (128 - wc->rxident) + rxident;
 			}
+
+			needed_latency += 2;
 
 			if (needed_latency >= 128) {
 				printk("Truncating latency request to 127 instead of %d\n", needed_latency);
@@ -3320,8 +3323,8 @@
 #else
 #if 1
 		unsigned int reg5 = __t4_pci_in(wc, 5);
-
 		if (wc->intcount < 20) {
+
 			printk("Reg 5 is %08x\n", reg5);
 		}
 #endif
@@ -3988,18 +3991,19 @@
 	/* Keep track of which device we are */
 	pci_set_drvdata(pdev, wc);
 	
-	/* FIXME */
-	dt->flags |= FLAG_5THGEN;
-	
-	if (t4_pci_in(wc, WC_VERSION) >= 0xc01a016d) {
+	if (t4_pci_in(wc, WC_VERSION) >= (unsigned int)0xc01a016d) {
 		wc->flags |= FLAG_5THGEN;
 	}
 
-	if (dt->flags & FLAG_5THGEN) {
+	if (wc->flags & FLAG_5THGEN) {
 		if ((ms_per_irq > 1) && (latency <= ((ms_per_irq) << 1))) {
 			init_latency = ms_per_irq << 1;
-		} else
-			init_latency = latency;
+		} else {
+			if (latency > 2)
+				init_latency = latency;
+			else
+				init_latency = 2;
+		}
 		printk(KERN_INFO "5th gen card with initial latency of %d and %d ms per IRQ\n", init_latency, ms_per_irq);
 	} else {
 		if (dt->flags & FLAG_2NDGEN)




More information about the dahdi-commits mailing list