[Asterisk-cvs] zaptel wct4xxp.c,1.17,1.18

markster at lists.digium.com markster at lists.digium.com
Sat Jan 10 16:23:05 CST 2004


Update of /usr/cvsroot/zaptel
In directory mongoose.digium.com:/tmp/cvs-serv13328

Modified Files:
	wct4xxp.c 
Log Message:
Revert earlier changes until finished


Index: wct4xxp.c
===================================================================
RCS file: /usr/cvsroot/zaptel/wct4xxp.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- wct4xxp.c	10 Jan 2004 05:35:55 -0000	1.17
+++ wct4xxp.c	10 Jan 2004 22:14:50 -0000	1.18
@@ -3,6 +3,7 @@
  *
  * Written by Mark Spencer <markster at linux-support.net>
  * Based on previous works, designs, and archetectures conceived and
+ * written by Jim Dixon <jim at lambdatel.com>.
  *
  * Copyright (C) 2001 Jim Dixon / Zapata Telephony.
  * Copyright (C) 2001, Linux Support Services, Inc.
@@ -75,6 +76,8 @@
 
 #define CANARY 0xc0de
 
+static int inirq = 0;
+
 struct t4 {
 	/* This structure exists one per card */
 	struct pci_dev *dev;		/* Pointer to PCI device */
@@ -153,7 +156,6 @@
 #define WC_GPIO		9
 #define WC_LADDR	10
 #define WC_LDATA		11
-#define WC_POSITION	12
 #define WC_LREAD			(1 << 15)
 #define WC_LWRITE		(1 << 16)
 
@@ -968,14 +970,6 @@
 			wc->spans[1].chans[z].readchunk[x] = (tmp & 0xff0000) >> 16;
 			wc->spans[0].chans[z].readchunk[x] = tmp >> 24;
 		}
-#if 0
-		if (wc->spans[0].chans[0].readchunk[x] == 0xff) {
-				static int printed = 0;
-				if (!(printed++ % 100)) {
-					printk("Read 255 at position %d/%d\n", wc->last0, x);
-				}
-			}
-#endif		
 		if (wc->t1e1) {
 			if (wc->e1recover > 0)
 				wc->e1recover--;
@@ -1324,9 +1318,6 @@
 #endif
 }
 
-static int __t4_reset_dma2(struct t4 *wc);
-static int __t4_reset_dma3(struct t4 *wc);
-
 #ifdef LINUX26
 static irqreturn_t t4_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 #else
@@ -1336,8 +1327,6 @@
 	struct t4 *wc = dev_id;
 	unsigned long flags;
 	int x;
-	static int irqcount;
-	static int irqdisp;
 	
 	unsigned int status;
 #if 0
@@ -1348,46 +1337,22 @@
 	if (wc->intcount < 20)
 		printk("Pre-interrupt\n");
 #endif
-	spin_lock_irqsave(&wc->reglock, flags);
+	
+	inirq = 1;
 	/* Make sure it's really for us */
-	status = __t4_pci_in(wc, WC_INTR);
+	status = t4_pci_in(wc, WC_INTR);
+	t4_pci_out(wc, WC_INTR, 0);
 
 	/* Ignore if it's not for us */
-	if (!status) {
-		spin_unlock_irqrestore(&wc->lock, flags);
+	if (!status)
 #ifdef LINUX26
 		return IRQ_NONE;
 #else
 		return;
 #endif		
-	}
-	if ((status & 3) == 3)
-		printk("Got both at the same time? (%08x)\n", status);
-
-	irqcount++;  
-	irqdisp++;
-	if (!(irqcount % 1000)) {
-		/* printk("Position: %08x\n", __t4_pci_in(wc, WC_POSITION)); */
-	}
-	if (irqcount == 4000) {
-		__t4_reset_dma3(wc);
-	}
-	if (irqcount == 5000) {
-		__t4_reset_dma2(wc);
-	}
-	if (irqcount == 6000) {
-		__t4_reset_dma3(wc);
-	}
-#if 0
-	if (irqdisp < 8) {
-		printk("IRQ Status %d: %08x\n", irqdisp, status);
-	}
-#endif	
 
 	if (!wc->spansstarted) {
 		printk("Not prepped yet!\n");
-		__t4_pci_out(wc, WC_INTR, 0);
-		spin_unlock_irqrestore(&wc->reglock, flags);
 #ifdef LINUX26
 		return IRQ_NONE;
 #else
@@ -1416,7 +1381,7 @@
 		}
 	}
 #endif
-	/* spin_lock_irqsave(&wc->reglock, flags); */
+	spin_lock_irqsave(&wc->reglock, flags);
 
 	__handle_leds(wc);
 
@@ -1437,25 +1402,11 @@
 		__t4_check_alarms(wc, x - 4);
 		break;
 	}
-	__t4_pci_out(wc, WC_INTR, 0);
-	spin_unlock_irqrestore(&wc->reglock, flags);
-
-}
 
-static int __t4_reset_dma2(struct t4 *wc)
-{
-	printk("DMA Reset part 2\n");
-	wc->dmactrl |= (1 << 27);
-	__t4_pci_out(wc, WC_DMACTRL, wc->dmactrl);
-	return 0;
-}
-
-static int __t4_reset_dma3(struct t4 *wc)
-{
-	printk("DMA Reset part 3\n");
-	wc->dmactrl &= ~(1 << 27);
-	__t4_pci_out(wc, WC_DMACTRL, wc->dmactrl);
-	return 0;
+	spin_unlock_irqrestore(&wc->reglock, flags);
+#ifdef LINUX26
+	return IRQ_RETVAL(1);
+#endif		
 }
 
 static int t4_reset_dma(struct t4 *wc)




More information about the svn-commits mailing list