[zaptel-commits] trunk - r891 /trunk/wct4xxp.c

zaptel-commits at lists.digium.com zaptel-commits at lists.digium.com
Thu Jan 12 08:02:21 CST 2006


Author: bweschke
Date: Thu Jan 12 08:02:20 2006
New Revision: 891

URL: http://svn.digium.com/view/zaptel?rev=891&view=rev
Log:
 Fix compile breakage on wct4xxp by repositioning inline function.


Modified:
    trunk/wct4xxp.c

Modified: trunk/wct4xxp.c
URL: http://svn.digium.com/view/zaptel/trunk/wct4xxp.c?rev=891&r1=890&r2=891&view=diff
==============================================================================
--- trunk/wct4xxp.c (original)
+++ trunk/wct4xxp.c Thu Jan 12 08:02:20 2006
@@ -2216,112 +2216,6 @@
 #endif
 }
 
-static inline void __t4_framer_interrupt(struct t4 *wc, int span);
-
-#ifdef SUPPORT_GEN1
-#ifdef LINUX26
-static irqreturn_t t4_interrupt(int irq, void *dev_id, struct pt_regs *regs)
-#else
-static void t4_interrupt(int irq, void *dev_id, struct pt_regs *regs)
-#endif
-{
-	struct t4 *wc = dev_id;
-	unsigned long flags;
-	int x;
-	
-	unsigned int status;
-	unsigned int status2;
-
-#if 0
-	if (wc->intcount < 20)
-		printk("Pre-interrupt\n");
-#endif
-	
-	inirq = 1;
-	/* Make sure it's really for us */
-	status = t4_pci_in(wc, WC_INTR);
-	t4_pci_out(wc, WC_INTR, 0);
-
-	/* Process framer interrupts */
-	status2 = t4_framer_in(wc, 0, FRMR_CIS);
-	if (status2 & 0x0f) {
-		spin_lock_irqsave(&wc->reglock, flags);
-		for (x = 0; x < wc->numspans; ++x) {
-			if (status2 & (1 << x))
-				__t4_framer_interrupt(wc, x);
-		}
-		spin_unlock_irqrestore(&wc->reglock, flags);
-	}
-
-	/* Ignore if it's not for us */
-	if (!status)
-#ifdef LINUX26
-		return IRQ_NONE;
-#else
-		return;
-#endif		
-
-	if (!wc->spansstarted) {
-		printk("Not prepped yet!\n");
-#ifdef LINUX26
-		return IRQ_NONE;
-#else
-		return;
-#endif		
-	}
-
-	wc->intcount++;
-#if 0
-	if (wc->intcount < 20)
-		printk("Got interrupt, status = %08x\n", status);
-#endif		
-
-	if (status & 0x3) {
-		t4_receiveprep(wc, status);
-		t4_transmitprep(wc, status);
-	}
-	
-#if 0
-	if ((wc->intcount < 10) || !(wc->intcount % 1000)) {
-		status2 = t4_framer_in(wc, 0, FRMR_CIS);
-		printk("Status2: %04x\n", status2);
-		for (x = 0;x<4;x++) {
-			status2 = t4_framer_in(wc, x, FRMR_FRS0);
-			printk("FRS0/%d: %04x\n", x, status2);
-		}
-	}
-#endif
-	spin_lock_irqsave(&wc->reglock, flags);
-
-	__handle_leds(wc);
-
-	__t4_do_counters(wc);
-
-	x = wc->intcount & 15 /* 63 */;
-	switch(x) {
-	case 0:
-	case 1:
-	case 2:
-	case 3:
-		__t4_check_sigbits(wc, x);
-		break;
-	case 4:
-	case 5:
-	case 6:
-	case 7:
-		__t4_check_alarms(wc, x - 4);
-		break;
-	}
-
-	if (wc->checktiming > 0)
-		__t4_set_timing_source_auto(wc);
-	spin_unlock_irqrestore(&wc->reglock, flags);
-#ifdef LINUX26
-	return IRQ_RETVAL(1);
-#endif		
-}
-#endif
-
 static inline void __t4_framer_interrupt(struct t4 *wc, int span)
 {
 	/* Check interrupts for a given span */
@@ -2455,6 +2349,111 @@
 	}
 
 }
+
+#ifdef SUPPORT_GEN1
+#ifdef LINUX26
+static irqreturn_t t4_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+#else
+static void t4_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+#endif
+{
+	struct t4 *wc = dev_id;
+	unsigned long flags;
+	int x;
+	
+	unsigned int status;
+	unsigned int status2;
+
+#if 0
+	if (wc->intcount < 20)
+		printk("Pre-interrupt\n");
+#endif
+	
+	inirq = 1;
+	/* Make sure it's really for us */
+	status = t4_pci_in(wc, WC_INTR);
+	t4_pci_out(wc, WC_INTR, 0);
+
+	/* Process framer interrupts */
+	status2 = t4_framer_in(wc, 0, FRMR_CIS);
+	if (status2 & 0x0f) {
+		spin_lock_irqsave(&wc->reglock, flags);
+		for (x = 0; x < wc->numspans; ++x) {
+			if (status2 & (1 << x))
+				__t4_framer_interrupt(wc, x);
+		}
+		spin_unlock_irqrestore(&wc->reglock, flags);
+	}
+
+	/* Ignore if it's not for us */
+	if (!status)
+#ifdef LINUX26
+		return IRQ_NONE;
+#else
+		return;
+#endif		
+
+	if (!wc->spansstarted) {
+		printk("Not prepped yet!\n");
+#ifdef LINUX26
+		return IRQ_NONE;
+#else
+		return;
+#endif		
+	}
+
+	wc->intcount++;
+#if 0
+	if (wc->intcount < 20)
+		printk("Got interrupt, status = %08x\n", status);
+#endif		
+
+	if (status & 0x3) {
+		t4_receiveprep(wc, status);
+		t4_transmitprep(wc, status);
+	}
+	
+#if 0
+	if ((wc->intcount < 10) || !(wc->intcount % 1000)) {
+		status2 = t4_framer_in(wc, 0, FRMR_CIS);
+		printk("Status2: %04x\n", status2);
+		for (x = 0;x<4;x++) {
+			status2 = t4_framer_in(wc, x, FRMR_FRS0);
+			printk("FRS0/%d: %04x\n", x, status2);
+		}
+	}
+#endif
+	spin_lock_irqsave(&wc->reglock, flags);
+
+	__handle_leds(wc);
+
+	__t4_do_counters(wc);
+
+	x = wc->intcount & 15 /* 63 */;
+	switch(x) {
+	case 0:
+	case 1:
+	case 2:
+	case 3:
+		__t4_check_sigbits(wc, x);
+		break;
+	case 4:
+	case 5:
+	case 6:
+	case 7:
+		__t4_check_alarms(wc, x - 4);
+		break;
+	}
+
+	if (wc->checktiming > 0)
+		__t4_set_timing_source_auto(wc);
+	spin_unlock_irqrestore(&wc->reglock, flags);
+#ifdef LINUX26
+	return IRQ_RETVAL(1);
+#endif		
+}
+#endif
+
 
 #ifdef LINUX26
 static irqreturn_t t4_interrupt_gen2(int irq, void *dev_id, struct pt_regs *regs)



More information about the zaptel-commits mailing list