[dahdi-commits] rmeyerriecks: linux/trunk r10728 - /linux/trunk/drivers/dahdi/wct4xxp/base.c

SVN commits to the DAHDI project dahdi-commits at lists.digium.com
Thu Oct 4 15:24:32 CDT 2012


Author: rmeyerriecks
Date: Thu Oct  4 15:24:29 2012
New Revision: 10728

URL: http://svnview.digium.com/svn/dahdi?view=rev&rev=10728
Log:
wct4xxp: Ensure all spans are configured by default.

Not configuring all the spans on an octal card can result in some of the
spans not working in clear channel modes.

Now ensure that all spans receive a default configuration regardless how
they are configured from user space.

Internal-Issue-ID: DAHLIN-289
Signed-off-by: Shaun Ruffell <sruffell at digium.com>
Signed-off-by: Russ Meyerriecks <rmeyerriecks at digium.com>

Modified:
    linux/trunk/drivers/dahdi/wct4xxp/base.c

Modified: linux/trunk/drivers/dahdi/wct4xxp/base.c
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/wct4xxp/base.c?view=diff&rev=10728&r1=10727&r2=10728
==============================================================================
--- linux/trunk/drivers/dahdi/wct4xxp/base.c (original)
+++ linux/trunk/drivers/dahdi/wct4xxp/base.c Thu Oct  4 15:24:29 2012
@@ -436,6 +436,7 @@
 #endif
 
 static void __set_clear(struct t4 *wc, int span);
+static int _t4_startup(struct file *file, struct dahdi_span *span);
 static int t4_startup(struct file *file, struct dahdi_span *span);
 static int t4_shutdown(struct dahdi_span *span);
 static int t4_rbsbits(struct dahdi_chan *chan, int bits);
@@ -1693,7 +1694,7 @@
 }
 
 static int
-t4_spanconfig(struct file *file, struct dahdi_span *span,
+_t4_spanconfig(struct file *file, struct dahdi_span *span,
 	      struct dahdi_lineconfig *lc)
 {
 	int i;
@@ -1733,11 +1734,34 @@
 
 	/* If we're already running, then go ahead and apply the changes */
 	if (span->flags & DAHDI_FLAG_RUNNING)
-		return t4_startup(file, span);
+		return _t4_startup(file, span);
 
 	if (debug)
 		dev_info(&wc->dev->dev, "Done with spanconfig!\n");
 	return 0;
+}
+
+static int
+t4_spanconfig(struct file *file, struct dahdi_span *span,
+	      struct dahdi_lineconfig *lc)
+{
+	int ret;
+	struct dahdi_device *const ddev = span->parent;
+	struct dahdi_span *s;
+
+	ret = _t4_spanconfig(file, span, lc);
+
+	/* Make sure all the spans have a basic configuration in case they are
+	 * not all specified in the configuration files. */
+	lc->sync = 0;
+	list_for_each_entry(s, &ddev->spans, device_node) {
+		WARN_ON(!s->channels);
+		if (!s->channels)
+			continue;
+		if (!s->chans[0]->sigcap)
+			_t4_spanconfig(file, s, lc);
+	}
+	return ret;
 }
 
 static int
@@ -2833,7 +2857,7 @@
 	return 0;
 }
 
-static int t4_startup(struct file *file, struct dahdi_span *span)
+static int _t4_startup(struct file *file, struct dahdi_span *span)
 {
 #ifdef SUPPORT_GEN1
 	int i;
@@ -2964,6 +2988,21 @@
 		dev_info(&wc->dev->dev, "Completed startup!\n");
 	clear_bit(T4_IGNORE_LATENCY, &wc->checkflag);
 	return 0;
+}
+
+static int t4_startup(struct file *file, struct dahdi_span *span)
+{
+	int ret;
+	struct dahdi_device *const ddev = span->parent;
+	struct dahdi_span *s;
+
+	ret = _t4_startup(file, span);
+	list_for_each_entry(s, &ddev->spans, device_node) {
+		if (!test_bit(DAHDI_FLAGBIT_RUNNING, &s->flags)) {
+			_t4_startup(file, s);
+		}
+	}
+	return ret;
 }
 
 #ifdef SUPPORT_GEN1




More information about the dahdi-commits mailing list