[svn-commits] sruffell: linux/trunk r9945 - /linux/trunk/drivers/dahdi/wcte12xp/

SVN commits to the Digium repositories svn-commits at lists.digium.com
Thu Jun 2 15:02:03 CDT 2011


Author: sruffell
Date: Thu Jun  2 15:01:59 2011
New Revision: 9945

URL: http://svnview.digium.com/svn/dahdi?view=rev&rev=9945
Log:
wcte12xp: Force spanconfig/chanconfig to wait for ready.

This is always true currently but will not necessarily be in the future.

Signed-off-by: Shaun Ruffell <sruffell at digium.com>

Modified:
    linux/trunk/drivers/dahdi/wcte12xp/base.c
    linux/trunk/drivers/dahdi/wcte12xp/wcte12xp.h

Modified: linux/trunk/drivers/dahdi/wcte12xp/base.c
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/wcte12xp/base.c?view=diff&rev=9945&r1=9944&r2=9945
==============================================================================
--- linux/trunk/drivers/dahdi/wcte12xp/base.c (original)
+++ linux/trunk/drivers/dahdi/wcte12xp/base.c Thu Jun  2 15:01:59 2011
@@ -957,6 +957,18 @@
 			    struct dahdi_chan *chan, int sigtype)
 {
 	struct t1 *wc = chan->pvt;
+
+	if (file->f_flags & O_NONBLOCK) {
+		if (!test_bit(READY, &wc->bit_flags))
+			return -EAGAIN;
+	} else {
+		while (!test_bit(READY, &wc->bit_flags)) {
+			if (fatal_signal_pending(current))
+				return -EIO;
+			msleep_interruptible(250);
+		}
+	}
+
 	if (test_bit(DAHDI_FLAGBIT_RUNNING, &chan->span->flags) &&
 		(wc->spantype != TYPE_E1)) {
 		__t1xxp_set_clear(wc);
@@ -1368,6 +1380,12 @@
 }
 
 #ifdef VPM_SUPPORT
+
+struct vpm_load_work {
+	struct work_struct work;
+	struct t1 *wc;
+};
+
 static int check_and_load_vpm(struct t1 *wc)
 {
 	int res;
@@ -1489,6 +1507,17 @@
 {
 	struct t1 *wc = container_of(span, struct t1, span);
 	int i;
+
+	if (file->f_flags & O_NONBLOCK) {
+		if (!test_bit(READY, &wc->bit_flags))
+			return -EAGAIN;
+	} else {
+		while (!test_bit(READY, &wc->bit_flags)) {
+			if (fatal_signal_pending(current))
+				return -EIO;
+			msleep_interruptible(250);
+		}
+	}
 
 	/* Do we want to SYNC on receive or not */
 	if (lc->sync) {
@@ -2110,6 +2139,7 @@
 	set_bit(VPM150M_ACTIVE, &wc->ctlreg);
 	t1_info(wc, "VPMADT032 is reenabled.\n");
 	wc->vpm_check = jiffies + HZ*5;
+	set_bit(READY, &wc->bit_flags);
 	return;
 }
 
@@ -2361,6 +2391,11 @@
 	t1_software_init(wc);
 	t1_info(wc, "Found a %s\n", wc->variety);
 	voicebus_unlock_latency(&wc->vb);
+
+	/* If there is VPMADT032 module attached to this device, it will
+	 * signal ready after the channels are configured and ready for use. */
+	if (!wc->vpmadt032)
+		set_bit(READY, &wc->bit_flags);
 	return 0;
 }
 

Modified: linux/trunk/drivers/dahdi/wcte12xp/wcte12xp.h
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/wcte12xp/wcte12xp.h?view=diff&rev=9945&r1=9944&r2=9945
==============================================================================
--- linux/trunk/drivers/dahdi/wcte12xp/wcte12xp.h (original)
+++ linux/trunk/drivers/dahdi/wcte12xp/wcte12xp.h Thu Jun  2 15:01:59 2011
@@ -111,6 +111,7 @@
 	int loopdowncnt;
 #define INITIALIZED 1
 #define SHUTDOWN    2
+#define READY	    3
 	unsigned long bit_flags;
 	unsigned long alarmtimer;
 	unsigned char ledstate;




More information about the svn-commits mailing list