[dahdi-commits] tzafrir: branch linux/tzafrir/sysfs r5644 - in /linux/team/tzafrir/sysfs: ./ ...

SVN commits to the DAHDI project dahdi-commits at lists.digium.com
Tue Jan 6 09:17:53 CST 2009


Author: tzafrir
Date: Tue Jan  6 09:17:52 2009
New Revision: 5644

URL: http://svn.digium.com/view/dahdi?view=rev&rev=5644
Log:
Merge changes from trunk.

Added:
    linux/team/tzafrir/sysfs/build_tools/live_dahdi
      - copied unchanged from r5636, linux/trunk/build_tools/live_dahdi
Modified:
    linux/team/tzafrir/sysfs/   (props changed)
    linux/team/tzafrir/sysfs/Makefile
    linux/team/tzafrir/sysfs/drivers/dahdi/   (props changed)
    linux/team/tzafrir/sysfs/drivers/dahdi/dahdi-base.c
    linux/team/tzafrir/sysfs/drivers/dahdi/dahdi_dummy.c
    linux/team/tzafrir/sysfs/drivers/dahdi/dahdi_echocan_oslec.c
    linux/team/tzafrir/sysfs/drivers/dahdi/dahdi_transcode.c
    linux/team/tzafrir/sysfs/drivers/dahdi/tor2.c
    linux/team/tzafrir/sysfs/drivers/dahdi/wcb4xxp/   (props changed)
    linux/team/tzafrir/sysfs/drivers/dahdi/wcb4xxp/base.c
    linux/team/tzafrir/sysfs/drivers/dahdi/wct4xxp/   (props changed)
    linux/team/tzafrir/sysfs/drivers/dahdi/wctc4xxp/   (props changed)
    linux/team/tzafrir/sysfs/drivers/dahdi/wctc4xxp/base.c
    linux/team/tzafrir/sysfs/drivers/dahdi/wctdm.c
    linux/team/tzafrir/sysfs/drivers/dahdi/wctdm24xxp/   (props changed)
    linux/team/tzafrir/sysfs/drivers/dahdi/wcte12xp/   (props changed)
    linux/team/tzafrir/sysfs/drivers/dahdi/wcte12xp/base.c
    linux/team/tzafrir/sysfs/drivers/dahdi/xpp/   (props changed)
    linux/team/tzafrir/sysfs/drivers/dahdi/xpp/xbus-core.h
    linux/team/tzafrir/sysfs/drivers/dahdi/xpp/xbus-sysfs.c
    linux/team/tzafrir/sysfs/drivers/dahdi/xpp/xdefs.h
    linux/team/tzafrir/sysfs/include/dahdi/kernel.h
    linux/team/tzafrir/sysfs/include/dahdi/user.h

Propchange: linux/team/tzafrir/sysfs/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Tue Jan  6 09:17:52 2009
@@ -1,1 +1,1 @@
-/linux/trunk:1-5440
+/linux/trunk:1-5643

Modified: linux/team/tzafrir/sysfs/Makefile
URL: http://svn.digium.com/view/dahdi/linux/team/tzafrir/sysfs/Makefile?view=diff&rev=5644&r1=5643&r2=5644
==============================================================================
--- linux/team/tzafrir/sysfs/Makefile (original)
+++ linux/team/tzafrir/sysfs/Makefile Tue Jan  6 09:17:52 2009
@@ -86,8 +86,8 @@
 
 modules: prereq
 ifeq (no,$(HAS_KSRC))
-	echo "You do not appear to have the sources for the $(KVERS) kernel installed."
-	exit 1
+	@echo "You do not appear to have the sources for the $(KVERS) kernel installed."
+	@exit 1
 endif
 	$(KMAKE) modules DAHDI_BUILD_ALL=$(DAHDI_BUILD_ALL)
 
@@ -195,8 +195,8 @@
 
 uninstall-modules:
 ifdef DESTDIR
-	echo "Uninstalling modules is not supported with a DESTDIR specified."
-	exit 1
+	@echo "Uninstalling modules is not supported with a DESTDIR specified."
+	@exit 1
 else
 	@if modinfo dahdi > /dev/null 2>&1 ; then \
 		echo -n "Removing DAHDI modules for kernel $(KVERS), please wait..."; \

Propchange: linux/team/tzafrir/sysfs/drivers/dahdi/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Tue Jan  6 09:17:52 2009
@@ -7,3 +7,4 @@
 tor2fw.h
 makefw
 Module.symvers
+modules.order

Modified: linux/team/tzafrir/sysfs/drivers/dahdi/dahdi-base.c
URL: http://svn.digium.com/view/dahdi/linux/team/tzafrir/sysfs/drivers/dahdi/dahdi-base.c?view=diff&rev=5644&r1=5643&r2=5644
==============================================================================
--- linux/team/tzafrir/sysfs/drivers/dahdi/dahdi-base.c (original)
+++ linux/team/tzafrir/sysfs/drivers/dahdi/dahdi-base.c Tue Jan  6 09:17:52 2009
@@ -177,7 +177,7 @@
 #elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,13)
 #define CLASS_DEV_DESTROY(class, devt) \
 	class_device_destroy(class, devt)
-#elif LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,9)
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,9)
 #define CLASS_DEV_DESTROY(class, devt) \
 	class_simple_device_remove(devt)
 #else
@@ -942,7 +942,7 @@
 	ss->outwritebuf = -1;
 	ss->numbufs = numbufs;
 
-	if (ss->txbufpolicy == DAHDI_POLICY_WHEN_FULL)
+	if ((ss->txbufpolicy == DAHDI_POLICY_WHEN_FULL) || (ss->txbufpolicy == DAHDI_POLICY_HALF_FULL))
 		ss->txdisable = 1;
 	else
 		ss->txdisable = 0;
@@ -1148,7 +1148,7 @@
 		*c = tolower(*d);
 	}
 
-	request_module(modname_buf);
+	request_module("%s", modname_buf);
 
 	tried_once = 1;
 
@@ -2024,6 +2024,29 @@
 	return amnt;
 }
 
+static int num_filled_bufs(struct dahdi_chan *chan)
+{
+	int range1, range2;
+
+	if (chan->inwritebuf < 0) {
+		return chan->numbufs;
+	}
+
+	if (chan->outwritebuf < 0) {
+		return 0;
+	}
+
+	if (chan->outwritebuf <= chan->inwritebuf) {
+		return chan->inwritebuf - chan->outwritebuf;
+	}
+
+	/* This means (in > out) and we have wrap around */
+	range1 = chan->numbufs - chan->outwritebuf;
+	range2 = chan->inwritebuf;
+
+	return range1 + range2;
+}
+
 static ssize_t dahdi_chan_write(struct file *file, const char *usrbuf, size_t count, int unit)
 {
 	unsigned long flags;
@@ -2036,8 +2059,9 @@
 	if (!chan)
 		return -EINVAL;
 
-	if (count < 1)
+	if (count < 1) {
 		return -EINVAL;
+	}
 
 	for (;;) {
 		spin_lock_irqsave(&chan->lock, flags);
@@ -2056,12 +2080,17 @@
 		spin_unlock_irqrestore(&chan->lock, flags);
 		if (res >= 0)
 			break;
-		if (file->f_flags & O_NONBLOCK)
+		if (file->f_flags & O_NONBLOCK) {
+#ifdef BUFFER_DEBUG
+			printk("Error: Nonblock\n");
+#endif
 			return -EAGAIN;
+		}
 		/* Wait for something to be available */
 		rv = schluffen(&chan->writebufq);
-		if (rv)
+		if (rv) {
 			return rv;
+		}
 	}
 
 	amnt = count;
@@ -2099,8 +2128,9 @@
 				pass = left;
 				if (pass > 128)
 					pass = 128;
-				if (copy_from_user(lindata, usrbuf + (pos << 1), pass << 1))
+				if (copy_from_user(lindata, usrbuf + (pos << 1), pass << 1)) {
 					return -EFAULT;
+				}
 				left -= pass;
 				for (x = 0; x < pass; x++)
 					chan->writebuf[res][x + pos] = DAHDI_LIN2X(lindata[x], chan);
@@ -2108,8 +2138,9 @@
 			}
 			chan->writen[res] = amnt >> 1;
 		} else {
-			if (copy_from_user(chan->writebuf[res], usrbuf, amnt))
+			if (copy_from_user(chan->writebuf[res], usrbuf, amnt)) {
 				return -EFAULT;
+			}
 			chan->writen[res] = amnt;
 		}
 		chan->writeidx[res] = 0;
@@ -2118,6 +2149,7 @@
 		oldbuf = res;
 		spin_lock_irqsave(&chan->lock, flags);
 		chan->inwritebuf = (res + 1) % chan->numbufs;
+
 		if (chan->inwritebuf == chan->outwritebuf) {
 			/* Don't stomp on the transmitter, just wait for them to
 			   wake us up */
@@ -2125,10 +2157,29 @@
 			/* Make sure the transmitter is transmitting in case of POLICY_WHEN_FULL */
 			chan->txdisable = 0;
 		}
+
 		if (chan->outwritebuf < 0) {
 			/* Okay, the interrupt handler has been waiting for us.  Give them a buffer */
 			chan->outwritebuf = oldbuf;
 		}
+
+		if ((chan->txbufpolicy == DAHDI_POLICY_HALF_FULL) && (chan->txdisable)) {
+			if (num_filled_bufs(chan) >= (chan->numbufs >> 1)) {
+#ifdef BUFFER_DEBUG
+				printk("Reached buffer fill mark of %d\n", num_filled_bufs(chan));
+#endif
+				chan->txdisable = 0;
+			}
+		}
+
+#ifdef BUFFER_DEBUG
+		if ((chan->statcount <= 0) || (amnt != 128) || (num_filled_bufs(chan) != chan->lastnumbufs)) {
+			printk("amnt: %d Number of filled buffers: %d\n", amnt, num_filled_bufs(chan));
+			chan->statcount = 32000;
+			chan->lastnumbufs = num_filled_bufs(chan);
+		}
+#endif
+
 		spin_unlock_irqrestore(&chan->lock, flags);
 
 		if (chan->flags & DAHDI_FLAG_NOSTDTXRX && chan->span->hdlc_hard_xmit)
@@ -4308,7 +4359,7 @@
 		 * different since we might want to allow the kernel to build
 		 * up a buffer in order to prevent underruns from the
 		 * interrupt context. */
-		chan->txbufpolicy = stack.bi.txbufpolicy & 0x1;
+		chan->txbufpolicy = stack.bi.txbufpolicy & 0x3;
 		if ((rv = dahdi_reallocbufs(chan,  stack.bi.bufsize, stack.bi.numbufs)))
 			return (rv);
 		break;
@@ -5975,7 +6026,8 @@
 						if (ms->iomask & (DAHDI_IOMUX_WRITE | DAHDI_IOMUX_WRITEEMPTY))
 							wake_up_interruptible(&ms->eventbufq);
 						/* If we're only supposed to start when full, disable the transmitter */
-						if (ms->txbufpolicy == DAHDI_POLICY_WHEN_FULL)
+						if ((ms->txbufpolicy == DAHDI_POLICY_WHEN_FULL) ||
+							(ms->txbufpolicy == DAHDI_POLICY_HALF_FULL))
 							ms->txdisable = 1;
 					}
 				} else {
@@ -5984,7 +6036,8 @@
 						if (ms->iomask & (DAHDI_IOMUX_WRITE | DAHDI_IOMUX_WRITEEMPTY))
 							wake_up_interruptible(&ms->eventbufq);
 						/* If we're only supposed to start when full, disable the transmitter */
-						if (ms->txbufpolicy == DAHDI_POLICY_WHEN_FULL)
+						if ((ms->txbufpolicy == DAHDI_POLICY_WHEN_FULL) ||
+							(ms->txbufpolicy == DAHDI_POLICY_HALF_FULL))
 							ms->txdisable = 1;
 					}
 				}
@@ -7042,7 +7095,7 @@
 							/* Whoops, we're full, and have no where else
 							   to store into at the moment.  We'll drop it
 							   until there's a buffer available */
-#ifdef CONFIG_DAHDI_DEBUG
+#ifdef BUFFER_DEBUG
 							module_printk(KERN_NOTICE, "Out of storage space\n");
 #endif
 							ms->inreadbuf = -1;
@@ -7294,7 +7347,7 @@
 				if (ss->iomask & (DAHDI_IOMUX_WRITE | DAHDI_IOMUX_WRITEEMPTY))
 					wake_up_interruptible(&ss->eventbufq);
 				/* If we're only supposed to start when full, disable the transmitter */
-				if (ss->txbufpolicy == DAHDI_POLICY_WHEN_FULL)
+				if ((ss->txbufpolicy == DAHDI_POLICY_WHEN_FULL) || (ss->txbufpolicy == DAHDI_POLICY_HALF_FULL))
 					ss->txdisable = 1;
 				res = -1;
 			}
@@ -7700,6 +7753,9 @@
 					}
 				}
 			}
+#ifdef BUFFER_DEBUG
+			span->chans[x]->statcount -= DAHDI_CHUNKSIZE;
+#endif
 			spin_unlock_irqrestore(&span->chans[x]->lock, flags);
 		}
 	}

Modified: linux/team/tzafrir/sysfs/drivers/dahdi/dahdi_dummy.c
URL: http://svn.digium.com/view/dahdi/linux/team/tzafrir/sysfs/drivers/dahdi/dahdi_dummy.c?view=diff&rev=5644&r1=5643&r2=5644
==============================================================================
--- linux/team/tzafrir/sysfs/drivers/dahdi/dahdi_dummy.c (original)
+++ linux/team/tzafrir/sysfs/drivers/dahdi/dahdi_dummy.c Tue Jan  6 09:17:52 2009
@@ -54,7 +54,7 @@
  * the #define USE_RTC should be commented out.
  */
 #if defined(__i386__) || defined(__x86_64__)
-#if LINUX_VERSION_CODE >= VERSION_CODE(2,6,13)
+#if LINUX_VERSION_CODE >= VERSION_CODE(2,6,15)
 /* The symbol hrtimer_forward is only exported as of 2.6.22: */
 #if defined(CONFIG_HIGH_RES_TIMERS) && LINUX_VERSION_CODE >= VERSION_CODE(2,6,22)
 #define USE_HIGHRESTIMER
@@ -220,8 +220,7 @@
 /* use kernel system tick timer if PC architecture RTC is not available */
 static void dahdi_dummy_timer(unsigned long param)
 {
-	hrtimer_set_expires(timer, jiffies + 1);
-	add_timer(&timer);
+	mod_timer(&timer, jiffies + 1);
 
 	ztd->counter += DAHDI_TIME;
 	while (ztd->counter >= HZ) {

Modified: linux/team/tzafrir/sysfs/drivers/dahdi/dahdi_echocan_oslec.c
URL: http://svn.digium.com/view/dahdi/linux/team/tzafrir/sysfs/drivers/dahdi/dahdi_echocan_oslec.c?view=diff&rev=5644&r1=5643&r2=5644
==============================================================================
--- linux/team/tzafrir/sysfs/drivers/dahdi/dahdi_echocan_oslec.c (original)
+++ linux/team/tzafrir/sysfs/drivers/dahdi/dahdi_echocan_oslec.c Tue Jan  6 09:17:52 2009
@@ -46,7 +46,14 @@
 
 static void echo_can_update(struct echo_can_state *ec, short *iref, short *isig)
 {
-	oslec_update((struct oslec_state *)ec, *iref, *isig);
+	unsigned int SampleNum;
+
+	for (SampleNum = 0; SampleNum < DAHDI_CHUNKSIZE; SampleNum++, iref++)
+	{
+		short iCleanSample;
+		iCleanSample = (short) oslec_update((struct oslec_state *)ec, *iref, *isig);
+		*isig++ = iCleanSample;
+	}
 }
 
 static int echo_can_create(struct dahdi_echocanparams *ecp, struct dahdi_echocanparam *p,
@@ -57,8 +64,7 @@
 		return -EINVAL;
 	}
 
-	/* TODO: get adaption mode from EC parameters? */
-	*ec = (struct echo_can_state *)oslec_create(ecp->tap_length, 0);
+	*ec = (struct echo_can_state *)oslec_create(ecp->tap_length, ECHO_CAN_USE_ADAPTION | ECHO_CAN_USE_NLP  | ECHO_CAN_USE_CLIP | ECHO_CAN_USE_TX_HPF | ECHO_CAN_USE_RX_HPF);
 
 	return *ec ? 0 : -ENOTTY;
 }

Modified: linux/team/tzafrir/sysfs/drivers/dahdi/dahdi_transcode.c
URL: http://svn.digium.com/view/dahdi/linux/team/tzafrir/sysfs/drivers/dahdi/dahdi_transcode.c?view=diff&rev=5644&r1=5643&r2=5644
==============================================================================
--- linux/team/tzafrir/sysfs/drivers/dahdi/dahdi_transcode.c (original)
+++ linux/team/tzafrir/sysfs/drivers/dahdi/dahdi_transcode.c Tue Jan  6 09:17:52 2009
@@ -185,7 +185,9 @@
 	struct dahdi_transcoder_channel *chan;
 	int i;
 	/* Should be called with the translock held. */
+#ifdef CONFIG_SMP
 	WARN_ON(!spin_is_locked(&translock));
+#endif
 
 	for (i = 0; i < tc->numchannels; i++) {
 		chan = &tc->channels[i];

Modified: linux/team/tzafrir/sysfs/drivers/dahdi/tor2.c
URL: http://svn.digium.com/view/dahdi/linux/team/tzafrir/sysfs/drivers/dahdi/tor2.c?view=diff&rev=5644&r1=5643&r2=5644
==============================================================================
--- linux/team/tzafrir/sysfs/drivers/dahdi/tor2.c (original)
+++ linux/team/tzafrir/sysfs/drivers/dahdi/tor2.c Tue Jan  6 09:17:52 2009
@@ -200,7 +200,7 @@
 	if (debug)
 		printk(KERN_INFO "Tor2: Configuring span %d\n", span->spanno);
 
-	if ((lc->sync < 0) || (lc->sync >= MAX_TOR_CARDS)) {
+	if ((lc->sync < 0) || (lc->sync >= SPANS_PER_CARD)) {
 		printk(KERN_WARNING "%s %d: invalid span timing value %d.\n",
 				THIS_MODULE->name, span->spanno, lc->sync);
 		return -EINVAL;

Propchange: linux/team/tzafrir/sysfs/drivers/dahdi/wcb4xxp/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Tue Jan  6 09:17:52 2009
@@ -1,3 +1,4 @@
 *.ko
 .*.cmd
 *.mod.c
+modules.order

Modified: linux/team/tzafrir/sysfs/drivers/dahdi/wcb4xxp/base.c
URL: http://svn.digium.com/view/dahdi/linux/team/tzafrir/sysfs/drivers/dahdi/wcb4xxp/base.c?view=diff&rev=5644&r1=5643&r2=5644
==============================================================================
--- linux/team/tzafrir/sysfs/drivers/dahdi/wcb4xxp/base.c (original)
+++ linux/team/tzafrir/sysfs/drivers/dahdi/wcb4xxp/base.c Tue Jan  6 09:17:52 2009
@@ -34,7 +34,6 @@
 #include <linux/delay.h>
 #include <asm/io.h>
 #include <linux/spinlock.h>
-#include <linux/mutex.h>
 #include <linux/device.h>	/* dev_err() */
 #include <linux/interrupt.h>
 #include <asm/system.h>		/* cli(), *_flags */
@@ -136,9 +135,8 @@
 	unsigned char ret = ioread8(b4->addr + reg);
 
 #ifdef DEBUG_LOWLEVEL_REGS
-	if (unlikely(DBG_REGS)) {
-		drv_dbg(b4->dev, "read 0x%02x from 0x%08x\n", ret, b4->addr + reg);
-	}
+	if (unlikely(DBG_REGS))
+		drv_dbg(b4->dev, "read 0x%02x from 0x%p\n", ret, b4->addr + reg);
 #endif
 	if (unlikely(pedanticpci)) {
 		udelay(3);
@@ -152,9 +150,8 @@
 	unsigned short ret = ioread16(b4->addr + reg);
 
 #ifdef DEBUG_LOWLEVEL_REGS
-	if (unlikely(DBG_REGS)) {
-		drv_dbg(b4->dev, "read 0x%04x from 0x%08x\n", ret, b4->addr + reg);
-	}
+	if (unlikely(DBG_REGS))
+		drv_dbg(b4->dev, "read 0x%04x from 0x%p\n", ret, b4->addr + reg);
 #endif
 	if (unlikely(pedanticpci)) {
 		udelay(3);
@@ -168,9 +165,8 @@
 	unsigned int ret = ioread32(b4->addr + reg);
 
 #ifdef DEBUG_LOWLEVEL_REGS
-	if (unlikely(DBG_REGS)) {
-		drv_dbg(b4->dev, "read 0x%04x from 0x%08x\n", ret, b4->addr + reg);
-	}
+	if (unlikely(DBG_REGS))
+		drv_dbg(b4->dev, "read 0x%04x from 0x%p\n", ret, b4->addr + reg);
 #endif
 	if (unlikely(pedanticpci)) {
 		udelay(3);
@@ -182,9 +178,8 @@
 static inline void __pci_out32(struct b4xxp *b4, const unsigned int reg, const unsigned int val)
 {
 #ifdef DEBUG_LOWLEVEL_REGS
-	if (unlikely(DBG_REGS)) {
-		drv_dbg(b4->dev, "writing 0x%02x to 0x%08x\n", val, b4->addr + reg);
-	}
+	if (unlikely(DBG_REGS))
+		drv_dbg(b4->dev, "writing 0x%02x to 0x%p\n", val, b4->addr + reg);
 #endif
 	iowrite32(val, b4->addr + reg);
 
@@ -197,9 +192,8 @@
 static inline void __pci_out8(struct b4xxp *b4, const unsigned int reg, const unsigned char val)
 {
 #ifdef DEBUG_LOWLEVEL_REGS
-	if (unlikely(DBG_REGS)) {
-		drv_dbg(b4->dev, "writing 0x%02x to 0x%08x\n", val, b4->addr + reg);
-	}
+	if (unlikely(DBG_REGS)) 
+		drv_dbg(b4->dev, "writing 0x%02x to 0x%p\n", val, b4->addr + reg);
 #endif
 	iowrite8(val, b4->addr + reg);
 
@@ -682,25 +676,33 @@
 }
 
 /* performs a register write and then waits for the HFC "busy" bit to clear */
-static inline void hfc_setreg_waitbusy(struct b4xxp *b4, const unsigned int reg, const unsigned int val)
-{
-	unsigned long maxwait;
-
-	maxwait = 1048576;
+static void hfc_setreg_waitbusy(struct b4xxp *b4, const unsigned int reg, const unsigned int val)
+{
+	int timeout = 0;
+	unsigned long start;
+	const int TIMEOUT = HZ/4; /* 250ms */
+
+	start = jiffies;
 	while (unlikely((b4xxp_getreg8(b4, R_STATUS) & V_BUSY))) {
-		maxwait--; /* FIXME: do what? it isn't busy for long */
+		if (time_after(jiffies, start + TIMEOUT)) {
+			timeout = 1;
+			break;
+		}
 	};
 
 	mb();
 	b4xxp_setreg8(b4, reg, val);
 	mb();
 
-	maxwait = 1048576;
+	start = jiffies;
 	while (likely((b4xxp_getreg8(b4, R_STATUS) & V_BUSY))) {
-		maxwait--; /* FIXME: do what? it isn't busy for long */
+		if (time_after(jiffies, start + TIMEOUT)) {
+			timeout = 1;
+			break;
+		}
 	};
 
-	if (!maxwait) {
+	if (timeout) {
 		if (printk_ratelimit())
 			dev_warn(b4->dev, "hfc_setreg_waitbusy(write 0x%02x to 0x%02x) timed out waiting for busy flag to clear!\n", val, reg);
 	}
@@ -1577,7 +1579,8 @@
 		spin_unlock_irqrestore(&b4->fifolock, irq_flags);
 
 /* don't send STAT byte to DAHDI */
-		dahdi_hdlc_putbuf(bspan->sigchan, buf, (j == WCB4XXP_HDLC_BUF_LEN) ? j : j - 1);
+		if (bspan->sigchan)
+			dahdi_hdlc_putbuf(bspan->sigchan, buf, (j == WCB4XXP_HDLC_BUF_LEN) ? j : j - 1);
 
 		zleft -= j;
 		if (DBG_HDLC && DBG_SPANFILTER) {
@@ -1592,6 +1595,11 @@
 	hfc_setreg_waitbusy(b4, A_INC_RES_FIFO, V_INC_F);
 	get_F(f1, f2, flen);
 	spin_unlock_irqrestore(&b4->fifolock, irq_flags);
+
+	/* If this channel is not configured with a signalling span we don't
+	 * need to notify the rest of dahdi about this frame. */
+	if (!bspan->sigchan)
+		return flen;
 
 	++bspan->frames_in;
 	if (zlen < 3) {

Propchange: linux/team/tzafrir/sysfs/drivers/dahdi/wct4xxp/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Tue Jan  6 09:17:52 2009
@@ -1,3 +1,4 @@
 *.mod.c
 *.cmd
 *.ko
+modules.order

Propchange: linux/team/tzafrir/sysfs/drivers/dahdi/wctc4xxp/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Tue Jan  6 09:17:52 2009
@@ -1,4 +1,5 @@
 *.cmd
 *.mod.c
 *.ko
+modules.order
 codec_test

Modified: linux/team/tzafrir/sysfs/drivers/dahdi/wctc4xxp/base.c
URL: http://svn.digium.com/view/dahdi/linux/team/tzafrir/sysfs/drivers/dahdi/wctc4xxp/base.c?view=diff&rev=5644&r1=5643&r2=5644
==============================================================================
--- linux/team/tzafrir/sysfs/drivers/dahdi/wctc4xxp/base.c (original)
+++ linux/team/tzafrir/sysfs/drivers/dahdi/wctc4xxp/base.c Tue Jan  6 09:17:52 2009
@@ -73,6 +73,7 @@
 	}                                                                   \
 
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18)
+#ifndef WARN_ON_ONCE
 #define WARN_ON_ONCE(__condition) do {         \
 	static int __once = 1;                 \
 	if (unlikely(__condition)) {           \
@@ -82,6 +83,7 @@
 		}                              \
 	}                                      \
 } while(0) 
+#endif
 #endif
 
 #define INVALID 999 /* Used to mark invalid channels, commands, etc.. */
@@ -171,6 +173,13 @@
 	__le16 channel_type;
 	__le16 timeslot;
 } __attribute__((packed));
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,14)
+/* also added in RHEL kernels with the OpenInfiniband backport: */
+#if LINUX_VERSION_CODE != KERNEL_VERSION(2,6,9) || !defined(DEFINE_SPINLOCK)
+typedef	unsigned gfp_t;		/* Added in 2.6.14 */
+#endif
+#endif
 
 #define CMD_MSG_TDM_SELECT_BUS_MODE_LEN 30
 #define CMD_MSG_TDM_SELECT_BUS_MODE(s) { \
@@ -258,6 +267,7 @@
 /* Supervisor function codes */
 #define SUPVSR_CREATE_CHANNEL  0x0010
 
+#define MONITOR_LIVE_INDICATION_TYPE 0x75
 #define CONFIG_CHANGE_TYPE        0x00 
 #define CONFIG_DEVICE_CLASS       0x06
 
@@ -1880,6 +1890,38 @@
 	return ((0x02 == hdr->type) || (0x04 == hdr->type)) ? 1 : 0;
 }
 
+static void
+print_command(struct wcdte *wc, const struct tcb *cmd)
+{
+	int i, curlength;
+	const struct csm_encaps_hdr *hdr = cmd->data;
+	char *buffer;
+	const int BUFFER_SIZE = 1024;
+	int parameters = ((hdr->length - 8)/sizeof(__le16));
+
+	buffer = kzalloc(BUFFER_SIZE + 1, GFP_ATOMIC);
+	if (!buffer) {
+		DTE_PRINTK(DEBUG, "Failed print_command\n");
+		return;
+	}
+	curlength = snprintf(buffer, BUFFER_SIZE, 
+		"opcode: %04x seq: %02x control: %02x "
+		"channel: %04x ", be16_to_cpu(hdr->op_code),
+		hdr->seq_num, hdr->control, be16_to_cpu(hdr->channel));
+	curlength += snprintf(buffer + curlength, BUFFER_SIZE - curlength,
+		"length: %02x index: %02x type: %02x "
+		"class: %02x function: %04x",
+		hdr->length, hdr->index, hdr->type, hdr->class,
+		le16_to_cpu(hdr->function));
+	for (i = 0; i < parameters; ++i) {
+		curlength += snprintf(buffer + curlength,
+			BUFFER_SIZE - curlength, " %04x",
+			le16_to_cpu(hdr->params[i]));
+	}
+	DTE_PRINTK(DEBUG, "%s\n", buffer);
+	kfree(buffer);
+}
+
 static void 
 receive_csm_encaps_packet(struct wcdte *wc, struct tcb *cmd)
 {
@@ -1915,6 +1957,10 @@
 				wctc4xxp_set_ready(wc);
 				wake_up(&wc->waitq);
 			}
+			free_cmd(cmd);
+		} else if (MONITOR_LIVE_INDICATION_TYPE == hdr->type) {
+			DTE_PRINTK(WARNING, "Received diagnostic message:\n");
+			print_command(wc, cmd);
 			free_cmd(cmd);
 		} else {
 			DTE_PRINTK(WARNING, "Unknown command type received. %02x\n", hdr->type);

Modified: linux/team/tzafrir/sysfs/drivers/dahdi/wctdm.c
URL: http://svn.digium.com/view/dahdi/linux/team/tzafrir/sysfs/drivers/dahdi/wctdm.c?view=diff&rev=5644&r1=5643&r2=5644
==============================================================================
--- linux/team/tzafrir/sysfs/drivers/dahdi/wctdm.c (original)
+++ linux/team/tzafrir/sysfs/drivers/dahdi/wctdm.c Tue Jan  6 09:17:52 2009
@@ -270,6 +270,7 @@
 
 static void wctdm_release(struct wctdm *wc);
 
+static unsigned int fxovoltage;
 static unsigned int battdebounce;
 static unsigned int battalarm;
 static unsigned int battthresh;
@@ -825,6 +826,13 @@
 
 	b = wc->reg1shadow[card];
 
+	if (fxovoltage) {
+		static int count = 0;
+		if (!(count++ % 100)) {
+			printk(KERN_DEBUG "Card %d: Voltage: %d Debounce %d\n", card + 1, b, fxo->battdebounce);
+		}
+	}
+
 	if (abs(b) < battthresh) {
 		/* possible existing states:
 		   battery lost, no debounce timer
@@ -2476,6 +2484,7 @@
 }
 
 module_param(debug, int, 0600);
+module_param(fxovoltage, int, 0600);
 module_param(loopcurrent, int, 0600);
 module_param(reversepolarity, int, 0600);
 module_param(robust, int, 0600);

Propchange: linux/team/tzafrir/sysfs/drivers/dahdi/wctdm24xxp/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Tue Jan  6 09:17:52 2009
@@ -2,3 +2,4 @@
 *.o
 *.ko
 *.mod.c
+modules.order

Propchange: linux/team/tzafrir/sysfs/drivers/dahdi/wcte12xp/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Tue Jan  6 09:17:52 2009
@@ -1,3 +1,4 @@
 *.mod.c
 *.cmd
 *.ko
+modules.order

Modified: linux/team/tzafrir/sysfs/drivers/dahdi/wcte12xp/base.c
URL: http://svn.digium.com/view/dahdi/linux/team/tzafrir/sysfs/drivers/dahdi/wcte12xp/base.c?view=diff&rev=5644&r1=5643&r2=5644
==============================================================================
--- linux/team/tzafrir/sysfs/drivers/dahdi/wcte12xp/base.c (original)
+++ linux/team/tzafrir/sysfs/drivers/dahdi/wcte12xp/base.c Tue Jan  6 09:17:52 2009
@@ -203,9 +203,9 @@
 	}
 }
 
-static inline int t1_setreg_full(struct t1 *wc, int addr, int val, int inisr, int vpm_num)
-{
-	unsigned long flags;
+static inline int t1_setreg_full(struct t1 *wc, int addr, int val, const int inisr, int vpm_num)
+{
+	unsigned long flags = 0;
 	int hit;
 	int ret;
 
@@ -225,8 +225,8 @@
 		}
 		if (inisr)
 			break;
-	
-		spin_unlock_irqrestore(&wc->reglock, flags);
+		else
+			spin_unlock_irqrestore(&wc->reglock, flags);
 		if (hit < 0) {
 			if ((ret = schluffen(&wc->regq)))
 				return ret;
@@ -301,9 +301,9 @@
 	return ret;
 }
 
-static inline int t1_getreg_full(struct t1 *wc, int addr, int inisr, int vpm_num)
-{
-	unsigned long flags;
+static inline int t1_getreg_full(struct t1 *wc, int addr, const int inisr, int vpm_num)
+{
+	unsigned long flags = 0;
 	int hit;
 	int ret = 0;
 
@@ -356,9 +356,9 @@
 	return t1_getreg_full(wc, addr, inisr, NOT_VPM);
 }
 
-static inline int t1_setleds(struct t1 *wc, int leds, int inisr)
-{
-	unsigned long flags;
+static inline int t1_setleds(struct t1 *wc, int leds, const int inisr)
+{
+	unsigned long flags = 0;
 	int hit;
 	int ret = 0;
 

Propchange: linux/team/tzafrir/sysfs/drivers/dahdi/xpp/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Tue Jan  6 09:17:52 2009
@@ -5,6 +5,7 @@
 .tmp_versions
 .*.swp
 *.verified
+modules.order
 xpp_version.h
 README.Astribank.html
 print_fxo_modes

Modified: linux/team/tzafrir/sysfs/drivers/dahdi/xpp/xbus-core.h
URL: http://svn.digium.com/view/dahdi/linux/team/tzafrir/sysfs/drivers/dahdi/xpp/xbus-core.h?view=diff&rev=5644&r1=5643&r2=5644
==============================================================================
--- linux/team/tzafrir/sysfs/drivers/dahdi/xpp/xbus-core.h (original)
+++ linux/team/tzafrir/sysfs/drivers/dahdi/xpp/xbus-core.h Tue Jan  6 09:17:52 2009
@@ -319,7 +319,7 @@
 int	xbus_sysfs_create(xbus_t *xbus);
 void	xbus_sysfs_remove(xbus_t *xbus);
 
-#ifdef	OLD_HOTPLUG_SUPPORT
+#ifdef	OLD_HOTPLUG_SUPPORT_269
 /* Copy from new kernels lib/kobject_uevent.c */
 enum kobject_action {
 	KOBJ_ADD,

Modified: linux/team/tzafrir/sysfs/drivers/dahdi/xpp/xbus-sysfs.c
URL: http://svn.digium.com/view/dahdi/linux/team/tzafrir/sysfs/drivers/dahdi/xpp/xbus-sysfs.c?view=diff&rev=5644&r1=5643&r2=5644
==============================================================================
--- linux/team/tzafrir/sysfs/drivers/dahdi/xpp/xbus-sysfs.c (original)
+++ linux/team/tzafrir/sysfs/drivers/dahdi/xpp/xbus-sysfs.c Tue Jan  6 09:17:52 2009
@@ -319,20 +319,22 @@
 	XBUS_DBG(DEVICES, xbus, "SYFS bus_id=%s action=%d\n",
 		xbus->astribank.bus_id, act);
 
-#ifdef	OLD_HOTPLUG_SUPPORT
-	{
-		/* Copy from new kernels lib/kobject_uevent.c */
-		static const char	*str[] = {
-			[KOBJ_ADD]	"add",
-			[KOBJ_REMOVE]	"remove",
-			[KOBJ_CHANGE]	"change",
-			[KOBJ_MOUNT]	"mount",
-			[KOBJ_UMOUNT]	"umount",
-			[KOBJ_OFFLINE]	"offline",
-			[KOBJ_ONLINE]	"online"
-		};
-		kobject_hotplug(str[act], kobj);
-	}
+#if defined(OLD_HOTPLUG_SUPPORT_269)
+ 	{
+ 		/* Copy from new kernels lib/kobject_uevent.c */
+ 		static const char	*str[] = {
+ 			[KOBJ_ADD]	"add",
+ 			[KOBJ_REMOVE]	"remove",
+ 			[KOBJ_CHANGE]	"change",
+ 			[KOBJ_MOUNT]	"mount",
+ 			[KOBJ_UMOUNT]	"umount",
+ 			[KOBJ_OFFLINE]	"offline",
+ 			[KOBJ_ONLINE]	"online"
+ 		};
+ 		kobject_hotplug(str[act], kobj);
+ 	}
+#elif defined(OLD_HOTPLUG_SUPPORT)
+	kobject_hotplug(kobj, act);
 #else
 	kobject_uevent(kobj, act);
 #endif

Modified: linux/team/tzafrir/sysfs/drivers/dahdi/xpp/xdefs.h
URL: http://svn.digium.com/view/dahdi/linux/team/tzafrir/sysfs/drivers/dahdi/xpp/xdefs.h?view=diff&rev=5644&r1=5643&r2=5644
==============================================================================
--- linux/team/tzafrir/sysfs/drivers/dahdi/xpp/xdefs.h (original)
+++ linux/team/tzafrir/sysfs/drivers/dahdi/xpp/xdefs.h Tue Jan  6 09:17:52 2009
@@ -120,6 +120,9 @@
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,16)
 #define	OLD_HOTPLUG_SUPPORT	// for older kernels
 #endif
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10)
+#define	OLD_HOTPLUG_SUPPORT_269// for way older kernels
+#endif
 
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,14)
 #define	DEVICE_ATTR_READER(name,dev,buf)	\

Modified: linux/team/tzafrir/sysfs/include/dahdi/kernel.h
URL: http://svn.digium.com/view/dahdi/linux/team/tzafrir/sysfs/include/dahdi/kernel.h?view=diff&rev=5644&r1=5643&r2=5644
==============================================================================
--- linux/team/tzafrir/sysfs/include/dahdi/kernel.h (original)
+++ linux/team/tzafrir/sysfs/include/dahdi/kernel.h Tue Jan  6 09:17:52 2009
@@ -79,6 +79,13 @@
 #define DAHDI_IRQ_SHARED_DISABLED SA_SHIRQ | SA_INTERRUPT
 #endif
 
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,16)
+#ifndef dev_notice
+#define dev_notice(dev, format, arg...)         \
+        dev_printk(KERN_NOTICE , dev , format , ## arg)
+#endif
+#endif
+
 /*! Default chunk size for conferences and such -- static right now, might make
    variable sometime.  8 samples = 1 ms = most frequent service interval possible
    for a USB device */
@@ -132,6 +139,10 @@
 	int do_ppp_wakeup;
 	int do_ppp_error;
 	struct sk_buff_head ppp_rq;
+#endif
+#ifdef BUFFER_DEBUG
+	int statcount;
+	int lastnumbufs;
 #endif
 	spinlock_t lock;
 	char name[40];

Modified: linux/team/tzafrir/sysfs/include/dahdi/user.h
URL: http://svn.digium.com/view/dahdi/linux/team/tzafrir/sysfs/include/dahdi/user.h?view=diff&rev=5644&r1=5643&r2=5644
==============================================================================
--- linux/team/tzafrir/sysfs/include/dahdi/user.h (original)
+++ linux/team/tzafrir/sysfs/include/dahdi/user.h Tue Jan  6 09:17:52 2009
@@ -118,6 +118,8 @@
 
 #define DAHDI_POLICY_IMMEDIATE	0		/* Start play/record immediately */
 #define DAHDI_POLICY_WHEN_FULL	1		/* Start play/record when buffer is full */
+#define DAHDI_POLICY_HALF_FULL	2		/* Start play/record when buffer is half full.
+						   Note -- This policy only works on tx buffers */
 
 #define DAHDI_GET_PARAMS_RETURN_MASTER 0x40000000
 




More information about the dahdi-commits mailing list