[dahdi-commits] mattf: branch linux/mattf/dahdi-datapath-events r7963 - in /linux/team/mattf/...

SVN commits to the DAHDI project dahdi-commits at lists.digium.com
Mon Jan 25 14:11:48 CST 2010


Author: mattf
Date: Mon Jan 25 14:11:46 2010
New Revision: 7963

URL: http://svnview.digium.com/svn/dahdi?view=rev&rev=7963
Log: (empty)

Modified:
    linux/team/mattf/dahdi-datapath-events/drivers/dahdi/dahdi-base.c
    linux/team/mattf/dahdi-datapath-events/include/dahdi/kernel.h
    linux/team/mattf/dahdi-datapath-events/include/dahdi/user.h

Modified: linux/team/mattf/dahdi-datapath-events/drivers/dahdi/dahdi-base.c
URL: http://svnview.digium.com/svn/dahdi/linux/team/mattf/dahdi-datapath-events/drivers/dahdi/dahdi-base.c?view=diff&rev=7963&r1=7962&r2=7963
==============================================================================
--- linux/team/mattf/dahdi-datapath-events/drivers/dahdi/dahdi-base.c (original)
+++ linux/team/mattf/dahdi-datapath-events/drivers/dahdi/dahdi-base.c Mon Jan 25 14:11:46 2010
@@ -6289,6 +6289,7 @@
 	int getlin;
 	/* How many bytes we need to process */
 	int bytes = DAHDI_CHUNKSIZE, left;
+	unsigned int needtxunderrun = 0;
 	int x;
 
 	/* Let's pick something to transmit.  First source to
@@ -6432,12 +6433,23 @@
 			} else {
 				memset(txb, 0xFF, bytes);
 			}
+			needtxunderrun += bytes;
 			bytes = 0;
 		} else {
 			memset(txb, DAHDI_LIN2X(0, ms), bytes);	/* Lastly we use silence on telephony channels */
+			needtxunderrun += bytes;
 			bytes = 0;
 		}
 	}
+
+
+	if (needtxunderrun && !ms->txunderrunbytes) {
+		__qevent(ms, DAHDI_EVENT_DAHDI_TRANSMIT_XRUN);
+	} else if (!needtxunderrun) {
+		ms->txunderrunbytes = 0;
+	}
+
+	ms->txunderrunbytes += needtxunderrun;
 }
 
 static inline void rbs_itimer_expire(struct dahdi_chan *chan)
@@ -7601,6 +7613,15 @@
 		}
 #endif
 	}
+
+	if (bytes && !ms->rxoverrunbytes) {
+		__qevent(ms, DAHDI_EVENT_DAHDI_RECEIVE_XRUN);
+	} if (!bytes) {
+		ms->rxoverrunbytes = 0;
+	}
+
+
+	ms->rxoverrunbytes += bytes;
 }
 
 static inline void __dahdi_putbuf_chunk(struct dahdi_chan *ss, unsigned char *rxb)

Modified: linux/team/mattf/dahdi-datapath-events/include/dahdi/kernel.h
URL: http://svnview.digium.com/svn/dahdi/linux/team/mattf/dahdi-datapath-events/include/dahdi/kernel.h?view=diff&rev=7963&r1=7962&r2=7963
==============================================================================
--- linux/team/mattf/dahdi-datapath-events/include/dahdi/kernel.h (original)
+++ linux/team/mattf/dahdi-datapath-events/include/dahdi/kernel.h Mon Jan 25 14:11:46 2010
@@ -588,6 +588,8 @@
 #else
 	unsigned char *lin2x;
 #endif
+	unsigned int txunderrunbytes;
+	unsigned int rxoverrunbytes;
 };
 
 #ifdef CONFIG_DAHDI_NET

Modified: linux/team/mattf/dahdi-datapath-events/include/dahdi/user.h
URL: http://svnview.digium.com/svn/dahdi/linux/team/mattf/dahdi-datapath-events/include/dahdi/user.h?view=diff&rev=7963&r1=7962&r2=7963
==============================================================================
--- linux/team/mattf/dahdi-datapath-events/include/dahdi/user.h (original)
+++ linux/team/mattf/dahdi-datapath-events/include/dahdi/user.h Mon Jan 25 14:11:46 2010
@@ -428,6 +428,10 @@
 
 /* The echo canceler's NLP (only) was enabled */
 #define DAHDI_EVENT_EC_NLP_ENABLED	28
+
+#define DAHDI_EVENT_DAHDI_TRANSMIT_XRUN	29
+
+#define DAHDI_EVENT_DAHDI_RECEIVE_XRUN	30
 
 #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 */




More information about the dahdi-commits mailing list