[dahdi-commits] rmeyerriecks: linux/trunk r9492 - in /linux/trunk: drivers/dahdi/ include/dahdi/

SVN commits to the DAHDI project dahdi-commits at lists.digium.com
Fri Nov 19 11:34:35 CST 2010


Author: rmeyerriecks
Date: Fri Nov 19 11:34:31 2010
New Revision: 9492

URL: http://svnview.digium.com/svn/dahdi?view=rev&rev=9492
Log:
dahdi: Moved the channel mirroring interface behind a build flag

It can now be enabled by un-commenting the CONFIG_DAHDI_MIRROR define in
include/dahdi/dahdi_config.h
Signed-off-by: Russ Meyerriecks <rmeyerriecks at digium.com>
Acked-by: Shaun Ruffell <sruffell at digium.com>

Modified:
    linux/trunk/drivers/dahdi/dahdi-base.c
    linux/trunk/include/dahdi/dahdi_config.h
    linux/trunk/include/dahdi/kernel.h
    linux/trunk/include/dahdi/user.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=9492&r1=9491&r2=9492
==============================================================================
--- linux/trunk/drivers/dahdi/dahdi-base.c (original)
+++ linux/trunk/drivers/dahdi/dahdi-base.c Fri Nov 19 11:34:31 2010
@@ -2801,6 +2801,7 @@
 	if (chan) {
 		/* Chan lock protects contents against potentially non atomic accesses.
 		 * So if the pointer setting is not atomic, we should protect */
+#ifdef CONFIG_DAHDI_MIRROR
 		if (chan->srcmirror) {
 			struct dahdi_chan *const srcmirror = chan->srcmirror;
 			spin_lock_irqsave(&srcmirror->lock, flags);
@@ -2821,11 +2822,14 @@
 			}
 			spin_unlock_irqrestore(&chan->srcmirror->lock, flags);
 		}
+#endif /* CONFIG_DAHDI_MIRROR */
 
 		spin_lock_irqsave(&chan->lock, flags);
 		chan->file = NULL;
 		file->private_data = NULL;
+#ifdef CONFIG_DAHDI_MIRROR
 		chan->srcmirror = NULL;
+#endif /* CONFIG_DAHDI_MIRROR */
 
 		spin_unlock_irqrestore(&chan->lock, flags);
 		close_channel(chan);
@@ -5042,6 +5046,7 @@
 	return ret;
 }
 
+#ifdef CONFIG_DAHDI_MIRROR
 static int dahdi_ioctl_rxmirror(struct file *file, unsigned long data)
 {
 	int res;
@@ -5128,6 +5133,7 @@
 
 	return 0;
 }
+#endif /* CONFIG_DAHDI_MIRROR */
 
 static int
 dahdi_chanandpseudo_ioctl(struct file *file, unsigned int cmd,
@@ -5145,11 +5151,13 @@
 	if (!chan)
 		return -EINVAL;
 	switch(cmd) {
+#ifdef CONFIG_DAHDI_MIRROR
 	case DAHDI_RXMIRROR:
 		return dahdi_ioctl_rxmirror(file, data);
 
 	case DAHDI_TXMIRROR:
 		return dahdi_ioctl_txmirror(file, data);
+#endif /* CONFIG_DAHDI_MIRROR */
 
 	case DAHDI_DIALING:
 		spin_lock_irqsave(&chan->lock, flags);
@@ -6668,7 +6676,9 @@
 {
 
 
+#ifdef CONFIG_DAHDI_MIRROR
 	unsigned char *orig_txb = txb;
+#endif /* CONFIG_DAHDI_MIRROR */
 
 	/* Called with ss->lock held */
 	/* We transmit data from our master channel */
@@ -6832,11 +6842,13 @@
 		}
 	}
 
+#ifdef CONFIG_DAHDI_MIRROR
 	if (ss->txmirror) {
 		spin_lock(&ss->txmirror->lock);
 		__putbuf_chunk(ss->txmirror, orig_txb, DAHDI_CHUNKSIZE);
 		spin_unlock(&ss->txmirror->lock);
 	}
+#endif /* CONFIG_DAHDI_MIRROR */
 }
 
 static inline void rbs_itimer_expire(struct dahdi_chan *chan)
@@ -8012,11 +8024,13 @@
 {
 	__putbuf_chunk(ss, rxb, DAHDI_CHUNKSIZE);
 
+#ifdef CONFIG_DAHDI_MIRROR
 	if (ss->rxmirror) {
 		spin_lock(&ss->rxmirror->lock);
 		__putbuf_chunk(ss->rxmirror, rxb, DAHDI_CHUNKSIZE);
 		spin_unlock(&ss->rxmirror->lock);
 	}
+#endif /* CONFIG_DAHDI_MIRROR */
 }
 
 static void __dahdi_hdlc_abort(struct dahdi_chan *ss, int event)

Modified: linux/trunk/include/dahdi/dahdi_config.h
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/include/dahdi/dahdi_config.h?view=diff&rev=9492&r1=9491&r2=9492
==============================================================================
--- linux/trunk/include/dahdi/dahdi_config.h (original)
+++ linux/trunk/include/dahdi/dahdi_config.h Fri Nov 19 11:34:31 2010
@@ -184,4 +184,9 @@
  */
 /* #define	DAHDI_AUDIO_NOTIFY */
 
+/*
+ * Creates an interface for mirroring the raw channel data out to a pseudo-chan
+ */
+/*#define CONFIG_DAHDI_MIRROR*/
+
 #endif

Modified: linux/trunk/include/dahdi/kernel.h
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/include/dahdi/kernel.h?view=diff&rev=9492&r1=9491&r2=9492
==============================================================================
--- linux/trunk/include/dahdi/kernel.h (original)
+++ linux/trunk/include/dahdi/kernel.h Fri Nov 19 11:34:31 2010
@@ -444,9 +444,11 @@
 	struct file *file;	/*!< File structure */
 	
 	
+#ifdef CONFIG_DAHDI_MIRROR
 	struct dahdi_chan	*rxmirror;  /*!< channel we mirror reads to */
 	struct dahdi_chan	*txmirror;  /*!< channel we mirror writes to */
 	struct dahdi_chan	*srcmirror; /*!< channel we mirror from */
+#endif /* CONFIG_DAHDI_MIRROR */
 	struct dahdi_span	*span;			/*!< Span we're a member of */
 	int		sig;			/*!< Signalling */
 	int		sigcap;			/*!< Capability for signalling */

Modified: linux/trunk/include/dahdi/user.h
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/include/dahdi/user.h?view=diff&rev=9492&r1=9491&r2=9492
==============================================================================
--- linux/trunk/include/dahdi/user.h (original)
+++ linux/trunk/include/dahdi/user.h Fri Nov 19 11:34:31 2010
@@ -37,6 +37,7 @@
 
 #include <linux/types.h>
 #include <linux/ioctl.h>
+#include <dahdi/dahdi_config.h>
 
 #ifndef ELAST
 #define ELAST 500
@@ -1079,8 +1080,10 @@
 /*
  * Defines which channel to receive mirrored traffic from
  */
+#ifdef CONFIG_DAHDI_MIRROR
 #define DAHDI_RXMIRROR			_IOW(DAHDI_CODE, 103, int)
 #define DAHDI_TXMIRROR			_IOW(DAHDI_CODE, 104, int)
+#endif /* CONFIG_DAHDI_MIRROR */
 
 /* Get current status IOCTL */
 /* Defines for Radio Status (dahdi_radio_stat.radstat) bits */




More information about the dahdi-commits mailing list