[svn-commits] rmeyerriecks: branch linux/rmeyerriecks/dahdi-linux-alarms r8838 - in /linux/...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Tue Jun 29 16:10:36 CDT 2010


Author: rmeyerriecks
Date: Tue Jun 29 16:10:25 2010
New Revision: 8838

URL: http://svnview.digium.com/svn/dahdi?view=rev&rev=8838
Log:
Added card level event handler

When a loss of syncronization signal occurs on one of
the spans, it affects all spans on that card. Since we
do not have a span or card level event system, we have
to queue up a global event on all channels for that card

The new event is DAHDI_EVENT_SYNC

Modified:
    linux/team/rmeyerriecks/dahdi-linux-alarms/drivers/dahdi/dahdi-base.c
    linux/team/rmeyerriecks/dahdi-linux-alarms/drivers/dahdi/wct4xxp/base.c
    linux/team/rmeyerriecks/dahdi-linux-alarms/include/dahdi/user.h

Modified: linux/team/rmeyerriecks/dahdi-linux-alarms/drivers/dahdi/dahdi-base.c
URL: http://svnview.digium.com/svn/dahdi/linux/team/rmeyerriecks/dahdi-linux-alarms/drivers/dahdi/dahdi-base.c?view=diff&rev=8838&r1=8837&r2=8838
==============================================================================
--- linux/team/rmeyerriecks/dahdi-linux-alarms/drivers/dahdi/dahdi-base.c (original)
+++ linux/team/rmeyerriecks/dahdi-linux-alarms/drivers/dahdi/dahdi-base.c Tue Jun 29 16:10:25 2010
@@ -3459,7 +3459,6 @@
 	int x;
 
 	span->alarms &= ~DAHDI_ALARM_LOOPBACK;
-	span->alarms &= ~DAHDI_ALARM_SYNC;
 	/* Determine maint status */
 	if (span->maintstat || span->mainttimer)
 		span->alarms |= DAHDI_ALARM_LOOPBACK;
@@ -3476,7 +3475,6 @@
 			if (spans[x] && !spans[x]->alarms && (spans[x]->flags & DAHDI_FLAG_RUNNING)) {
 				if (master != spans[x]) {
 					module_printk(KERN_NOTICE, "Master changed to %s\n", spans[x]->name);
-					span->alarms |= DAHDI_ALARM_SYNC;
 				}
 				master = spans[x];
 				break;
@@ -3494,8 +3492,6 @@
 			module_printk(KERN_NOTICE, "Span %d: Transmit Line Short\n", span->spanno);
 		if (span->alarms & DAHDI_ALARM_XLO)
 			module_printk(KERN_NOTICE, "Span %d: Transmit Line Open\n", span->spanno);
-		if (span->alarms & DAHDI_ALARM_SYNC)
-			module_printk(KERN_NOTICE, "Span %d: Change of syncronization signal\n", span->spanno);
 	}
 }
 

Modified: linux/team/rmeyerriecks/dahdi-linux-alarms/drivers/dahdi/wct4xxp/base.c
URL: http://svnview.digium.com/svn/dahdi/linux/team/rmeyerriecks/dahdi-linux-alarms/drivers/dahdi/wct4xxp/base.c?view=diff&rev=8838&r1=8837&r2=8838
==============================================================================
--- linux/team/rmeyerriecks/dahdi-linux-alarms/drivers/dahdi/wct4xxp/base.c (original)
+++ linux/team/rmeyerriecks/dahdi-linux-alarms/drivers/dahdi/wct4xxp/base.c Tue Jun 29 16:10:25 2010
@@ -423,6 +423,7 @@
 static void t4_tsi_unassign(struct t4 *wc, int tospan, int tochan);
 static void __t4_set_rclk_src(struct t4 *wc, int span);
 static void __t4_set_sclk_src(struct t4 *wc, int mode, int master, int slave);
+static void t4_card_event(struct t4 *wc, int event);
 static void t4_check_alarms(struct t4 *wc, int span);
 static void t4_check_sigbits(struct t4 *wc, int span);
 
@@ -2038,6 +2039,8 @@
 
 	cmr1 |= (span << 6);
 	__t4_framer_out(wc, 0, 0x44, cmr1);
+	
+	t4_card_event(wc, DAHDI_EVENT_SYNC);
 
 	dev_info(&wc->dev->dev, "RCLK source set to span %d\n", span+1);
 }
@@ -2065,6 +2068,31 @@
 		wc->dmactrl &= ~(1 << 29);/* Provide timing from MCLK */
 
 	__t4_pci_out(wc, WC_DMACTRL, wc->dmactrl);
+}
+
+/*
+ * We do not have a per-span or per-card event system. In
+ * order to create a global event, we send that event to
+ * every channel on the card
+ */
+void t4_card_event(struct t4 *wc, int event) {
+	unsigned long flags;
+	struct dahdi_span *span;
+	struct dahdi_chan *chan;
+	int x, y;
+
+	/* Loop through every channel on this card and
+	 * set the global event that occured
+	 */
+	for (x = 0; x < wc->numspans; x++) {
+		span = &wc->tspans[x]->span;
+		for (y = 0; y < span->channels; y++) {
+			chan = span->chans[y];
+			spin_lock_irqsave(&chan->lock, flags);
+			dahdi_qevent_nolock(chan, event);
+			spin_unlock_irqrestore(&chan->lock, flags);
+		}
+	}
 }
 
 static inline void __t4_update_timing(struct t4 *wc)

Modified: linux/team/rmeyerriecks/dahdi-linux-alarms/include/dahdi/user.h
URL: http://svnview.digium.com/svn/dahdi/linux/team/rmeyerriecks/dahdi-linux-alarms/include/dahdi/user.h?view=diff&rev=8838&r1=8837&r2=8838
==============================================================================
--- linux/team/rmeyerriecks/dahdi-linux-alarms/include/dahdi/user.h (original)
+++ linux/team/rmeyerriecks/dahdi-linux-alarms/include/dahdi/user.h Tue Jun 29 16:10:25 2010
@@ -327,7 +327,6 @@
 #define DAHDI_ALARM_LMFA		(1 << 10)	/* Loss of Multi-Frame Alignment */
 #define DAHDI_ALARM_XLS			(1 << 11)	/* Transmit line Short */
 #define DAHDI_ALARM_XLO			(1 << 12)	/* Transmit line Open */
-#define DAHDI_ALARM_SYNC		(1 << 13)	/* Loss of Sync source */
 
 /* Maintenance modes */
 #define DAHDI_MAINT_NONE		0	/* Normal Mode */
@@ -453,6 +452,9 @@
 #define DAHDI_EVENT_PULSEDIGIT		(1 << 16)	/* This is OR'd with the digit received */
 #define DAHDI_EVENT_DTMFDOWN		(1 << 17)	/* Ditto for DTMF key down event */
 #define DAHDI_EVENT_DTMFUP		(1 << 18)	/* Ditto for DTMF key up event */
+
+/* If the source of timing changes */
+#define DAHDI_EVENT_SYNC		29
 
 /* Transcoder related definitions */
 




More information about the svn-commits mailing list